Page 1 of 1

[4.51 x86] GrabSprite crashes in 16-bit Screen

Posted: Thu Feb 24, 2011 5:59 am
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

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

Posted: Sat Feb 26, 2011 6:21 pm
by kenmo
EDIT: sorry for bumping :)

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

Posted: Sun Feb 27, 2011 11:52 pm
by DoubleDutch
I wouldn't be bumping bugs if I were you... (I don't think they like it).

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

Posted: Mon Feb 28, 2011 1:32 pm
by Psychophanta
May be Fred can not reproduce it.
It works here with 16 and 32 bitplanes, no error is reported!

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

Posted: Mon Feb 28, 2011 1:51 pm
by gnozal
Works well here too !
(PB 4.51 x86, Win XP, GeForce 6150LE)

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

Posted: Mon Feb 28, 2011 8:43 pm
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.)

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

Posted: Mon Feb 28, 2011 8:48 pm
by nco2k
no crash sorry. i guess its because of the intel igp.

c ya,
nco2k

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

Posted: Tue Mar 01, 2011 10:31 am
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?

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

Posted: Tue Mar 01, 2011 5:57 pm
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?

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

Posted: Tue Mar 01, 2011 7:16 pm
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

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

Posted: Tue Mar 01, 2011 8:23 pm
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.