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 > Mode 5 Sucks?

#1160 - regularkid - Wed Jan 15, 2003 8:32 am

I'm using mode 5, but I thought it would stretch the pixels to fit the gba screen, but it didn't? Does this mean that everytime you use mode 5 you need to stretch the background to fit? Because without it you see the back plain where the background isnt. Am I correct? That sucks.
_________________
- RegularKid

#1162 - tepples - Wed Jan 15, 2003 8:48 am

regularkid wrote:
I'm using mode 5, but I thought it would stretch the pixels to fit the gba screen, but it didn't? Does this mean that everytime you use mode 5 you need to stretch the background to fit? Because without it you see the back plain where the background isnt. Am I correct? That sucks.

Mode 5 is nearly useless. It's possible to use stretched mode 3 for 99% of everything that one would use mode 5 for. You can even do double buffering in stretched mode 3: just use pixels 0-119 as the first buffer and 120-239 as the second and then switch visible buffers using the BG2 affine register.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#1572 - dummer Anf?nger - Mon Jan 20, 2003 10:36 am

Hehehe sure that u not means mode 4 tepples?
_________________
... but im just a dummy Newbie

(sorry for my terrible english)

#1596 - tepples - Mon Jan 20, 2003 5:12 pm

Background: The GBA has three bitmap modes, which can be scaled or rotated using BG2's affine registers.

  • Mode 3 has one 240x160 pixel buffer at 16 bits per pixel.
  • Mode 4 has two 240x160 pixel buffers at 8 bits per pixel.
  • Mode 5 has two 160x128 pixel buffers at 16 bits per pixel.


Mode 5 fills the screen if you rotate it by 90 degrees (to 128x160), stretch it by 2 horizontally (to 256x160), and cut off some pixels on the side (to 240x160). Mode 5 is useful if your graphics data is naturally column-major (such as if you're writing a wolfenstein style raycaster engine) but not for much else.

Myth: "Mode 3 doesn't support double buffering. Among bitmapped modes, mode 4 and 5 do."

Mode 3 fills the screen. If you stretch it by 2 horizontally, it covers two screens. Then by setting the X base register appropriately, you can get two 120x160 pixel buffers.

If you have VisualBoyAdvance, look at the "Beyond the Limits" demo by Vivid Design. Though it uses mode 4 instead of mode 3, it uses the same sort of stretching I described to get two effective video buffers (both on buffer 0) and one temporary buffer (on buffer 1).[/list]
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.