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.

Beginners > Backgrounds, using MODE4.

#12967 - mteccles - Tue Dec 02, 2003 8:47 pm

I am following a tutorial off some other site, and it shows how to make a picture using mode4, which is array of 16 bit pixels 120*160 in size. The example *.h file fills the whole screen, however..

I make a 120*160 bmp, use bmp2gba -8 -w 120 (something like that) and it only covers the top left corner of the gba when I run it in an emulator. I'm confused here..

Thanks to anyone who can explain simply.

#12970 - sajiimori - Tue Dec 02, 2003 9:43 pm

Mode 4 is 240x160 with 8 bit palettized color. Read the pern tutorials.

#12983 - tepples - Tue Dec 02, 2003 11:49 pm

If you're looking for a 16-bit 120x160 pixel display mode, the GBA has two, and they both support page flipping. They can be created from modes 3 or 5 by writing special values to the BG2 rotation matrix.

mode 3 (row major): pa=0x80, pb=0, pc=0, pd=0x100, flip by setting BG2X.
mode 5 (column major): pa=0, pb=0x100, pc=0x80, pd=0, flip by setting the page bit in DISPCNT. Details

(notices OP's nick) I hope you're not an imposter ;-)
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12989 - mteccles - Wed Dec 03, 2003 12:15 am

I knew there was an argument missing, -t 2 :) I understand now that each entry is 2 bytes long . Default is 1.