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.

C/C++ > Odd Problem... Dunno the cause. Might be mode switching...

#27330 - Ter13 - Sun Oct 10, 2004 3:06 pm

I made a demo that switches from one screen mode to the next, this is the entire .zip of the source, and a running gba here.

http://www.freewebs.com/ter13_byond/running.zip

Okay, when I force it into mode 4 at startup, and tell it to load a single image, there is not problem, but when it changes into screen mode 3, it screws up entirely. Only a portion of the screen is drawn to from then on, and it is ignoring the double buffering. What is wrong with this? I have tried for about three days to figure out where I screwed it up, but just plain can't seem to. Is this caused by a change in the video and backbuffer? Do I need to redefine the video and backbuffer?

Thank you.
_________________
~Ter

#27332 - yaustar - Sun Oct 10, 2004 3:49 pm

Can you include your headers as well?
_________________
[Blog] [Portfolio]

#27334 - gb_feedback - Sun Oct 10, 2004 5:53 pm

Without looking at your code - just your description...

Mode 3 uses twice as much video RAM so there isn't space for a backbuffer - if by this you mean an alternative start address for the video RAM. So what you describe would be the result.

Of course I may have misunderstood
_________________
http://www.bookreader.co.uk/

#27354 - Ter13 - Mon Oct 11, 2004 6:47 am

Well, I figured the problem out... Not sleeping has kind of deprived me of the ability to read properly.

as gb_feedback said, mode3 uses twice as much video memory. I wanted to be using mode 4 in its place. However, I probably shouldn't be using mode4 either, except for the fact that it does indeed allow for double buffering. It would probably be better to do the title screen in a tile mode, and use large group of tiles to represent the title screen, and share a palette with a few specific sprites for the user windows.

When I switched to mode 4, I encountered another problem. The windows were now drawing much faster, and were drawing on the whole screen, but the lines seemed split into vertical lines, two pixels with different colours. Well, again, the problem for this was mode 4 itself. Since it groups two colours together, I could not use simple mode 3 colours.

Thanks to anybody who responded.
_________________
~Ter