gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Pausing the GPU?

#21393 - quickcup - Fri May 28, 2004 6:31 pm

I'd like to know if it is possible (in mode 4) to temporarly halt the gpu from drawing the screen. That way I would be able to make changes to video ram but not see the affects of those changes until allowing the gpu to resume drawing the screen.

I guess what I am looking for is an effect similar to the forced blank except that instead of turning the screen white, I want what was displayed to continue being displayed until I allow redrawing to resume.

Can anyone help me with this? Thanks.

#21397 - poslundc - Fri May 28, 2004 7:27 pm

I don't believe there is any way to do this, but if it existed it would essentially make it possible to triple VBlank time, since you could halt the GPU every other frame and run at 30 FPS. So I'm guessing someone would've documented it by now if there was a technique to do so.

Dan.

#21405 - Lord Graga - Fri May 28, 2004 9:16 pm

In every other mode than mode4, no. But with mode4: YES!


There's a technique called doublebuffering. It's like having two screens to work with. When one is being proceeded, the other is being drawn by hardware. In this way you can do flickerfree stuff.


Look it up. It's a flag in REG_DISPCNT, and a tiny function to know where to draw! Just ask, and I'll show you.

#21413 - quickcup - Fri May 28, 2004 10:10 pm

Yes, I was aware of the double-buffering technique, and it looks like that is what I will ultimately have to implement.

I was just hoping my concept of pausing the gpu was possible because firstly it would be more straightforward. But more importantly, it seems to me that when using a double-buffering system, anything that you want to remain on screen for more than one frame will have to be drawn twice: once to the front and then to the back buffer.

I have made my graphic drawing functions as efficient as I could but I think it will still be just too slow. I will try it and see.

#21416 - Lord Graga - Fri May 28, 2004 10:29 pm

quickcup wrote:
Yes, I was aware of the double-buffering technique, and it looks like that is what I will ultimately have to implement.

I was just hoping my concept of pausing the gpu was possible because firstly it would be more straightforward. But more importantly, it seems to me that when using a double-buffering system, anything that you want to remain on screen for more than one frame will have to be drawn twice: once to the front and then to the back buffer.

I have made my graphic drawing functions as efficient as I could but I think it will still be just too slow. I will try it and see.
Nono. A normal loop could go like this:

SwitchBuffers();
ClearBackBuffer();
WriteStuffToBackBuffer();
WaitForVSync();

no matter how slow it was, it would always display something without glitches.

#21418 - sajiimori - Fri May 28, 2004 10:40 pm

Quote:

In every other mode than mode4, ...

...and 5...

#21466 - tepples - Sat May 29, 2004 4:48 pm

Actually, every GBA background display mode can be coaxed into having a double buffer.

In mode 3, if you stretch the screen and then scroll back and forth between (0.0,0.0) and (120.0,0.0), get a double buffer like that of rot/scale mode 5 but without the rotation.

In modes 0, 1, and 2, you can change the tile data base address or the map base address.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.