[4.51 x86] GrabSprite crashes in 16-bit Screen

Just starting out? Need help? Post your questions and find answers here.
User avatar
kenmo
Addict
Addict
Posts: 2083
Joined: Tue Dec 23, 2003 3:54 am

[4.51 x86] GrabSprite crashes in 16-bit Screen

Post by kenmo »

I've been having some GrabSprite() issues, and it seems that it crashes with an Invalid Memory Access in any 16-bit screen. 32-bit works fine. This happens whether my desktop display is set to 32 or 16.

(tested only in PB 4.51, 32-bit XP Pro)

Code: Select all

; Try 16-bit and 32-bit...

ScreenW.i = 640
ScreenH.i = 480
;ScreenD.i =  32
ScreenD.i =  16

If InitSprite()
  If OpenScreen(ScreenW, ScreenH, ScreenD, "GrabSprite Test")
  
  
    ; Comment out any GrabSprite() you'd like...
  
    GrabSprite(0, 0, 0, ScreenW, ScreenH) ; Before ClearScreen & FlipBuffers
    
    ClearScreen(#Red)
    GrabSprite(0, 0, 0, ScreenW, ScreenH) ; After ClearScreen, Before FlipBuffers
    
    FlipBuffers()
    GrabSprite(0, 0, 0, ScreenW, ScreenH) ; After ClearScreen & FlipBuffers
    Delay(1000)
    
    ClearScreen(#Green)
    GrabSprite(0, 0, 0, ScreenW, ScreenH) ; Another ClearScreen
    
    FlipBuffers()
    GrabSprite(0, 0, 0, ScreenW, ScreenH) ; Another FlipBuffers
    Delay(1000)
    
  Else
    Debug "No screen."
  EndIf
Else
  Debug "No sprite."
EndIf
Last edited by kenmo on Mon Feb 28, 2011 8:38 pm, edited 1 time in total.
User avatar
kenmo
Addict
Addict
Posts: 2083
Joined: Tue Dec 23, 2003 3:54 am

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by kenmo »

EDIT: sorry for bumping :)
Last edited by kenmo on Thu Sep 01, 2011 9:54 pm, edited 1 time in total.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by DoubleDutch »

I wouldn't be bumping bugs if I were you... (I don't think they like it).
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by Psychophanta »

May be Fred can not reproduce it.
It works here with 16 and 32 bitplanes, no error is reported!
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by gnozal »

Works well here too !
(PB 4.51 x86, Win XP, GeForce 6150LE)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
kenmo
Addict
Addict
Posts: 2083
Joined: Tue Dec 23, 2003 3:54 am

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by kenmo »

Really?

16-bit crashes (always with Invalid Memory Access at address 52) on any of those GrabSprite() calls for me.

I'm on XP Pro SP3, on a Toshiba laptop with cheap Intel integrated graphics.

(I changed the code above so that it tries 16-bit first, in case anyone was running it without uncommenting the 16-bit line.)
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by nco2k »

no crash sorry. i guess its because of the intel igp.

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by Psychophanta »

Tested also now on a crappy benq laptop with VIA/S3G Unichrome pro IGP, and it works.
I doubt the fault is from the igp. Have you tried with a clean PB4.51 installing?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
kenmo
Addict
Addict
Posts: 2083
Joined: Tue Dec 23, 2003 3:54 am

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by kenmo »

Just uninstalled and reinstalled PB 4.51, same thing happens.

But I did try it with different subsystems:

opengl: works fine, no crash
nt4: can't open 640x480x16 screen (never used nt4 before)
directx7: works fine, no crash

So my new questions are:
what is the default subsystem used when none is specified, and
what would be the disadvantages of compiling with the dx7 subsystem?
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by nco2k »

Psychophanta wrote:I doubt the fault is from the igp
intel igps are the biggest pain in the a**. there are a lot of issues with those, not only in pb.
kenmo wrote:what is the default subsystem used when none is specified
by default DirectX9 is used (since pb 4.40).
kenmo wrote:what would be the disadvantages of compiling with the dx7 subsystem?
no aero, higher cpu usage etc.

just out of curiosity, have you tried with pb 4.30?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
kenmo
Addict
Addict
Posts: 2083
Joined: Tue Dec 23, 2003 3:54 am

Re: [4.51 x86] GrabSprite crashes in 16-bit Screen

Post by kenmo »

nco2k wrote:just out of curiosity, have you tried with pb 4.30?
Is dx7 the default in 4.30? Because I just installed and tried it, works fine.
Edit: Oh, okay, you said dx9 has been default since 4.40.

Specifying "directx9" in 4.30 crashes it, so it looks like dx9 + my computer + 16-bit is a bad combination.

(Also, "nt4" works fine in 4.30. But in 4.51, the code above outputs "No screen." implying OpenScreen returns null, despite the screen flickering black for a moment as if it successfully opened. Is this a separate issue??)

Odd stuff going on.
Post Reply