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 > Inshort how does gba display bitmaps

#176976 - blessingta@hotmail.co.uk - Sun Nov 13, 2011 10:14 pm

hi

how does gba display bitmaps?

Im still reading on this topic buy I just wanted a quick answer on it.

#176981 - ScottLininger - Mon Nov 14, 2011 8:02 pm

There are a handful of different display modes, and each one does it differently.

But broadly speaking, there are two "kinds" of modes: tiled and untiled. Tiled is for games like Super Mario where you repeat the same little graphic tiles over and over. Untiled is more for displaying full-screen images or interfaces.

Untiled modes are the simplest. There's basically a big block of memory which is a linear representation of the GBA screen. Poke in some numbers in the first memory location and you change the color at the top left pixel. Poke in some numbers in the last location and you change the color at the bottom right. All of the memory addresses in between map to a specific pixel.

Practically speaking, the easiest way to get these kinds of images to display is to use a utility program (there are bunches out there) which convert a PNG or GIF file into a long stream of numbers, then write your GBA code such that it unrolls the numbers into memory. Presto! Image on the screen. (Most of the tutorials out there will start with something like this, actually.)

For tiled modes, there's a big block of memory where you poke in numbers representing colors for each pixel, PER TILE. Then a second block of memory that tells the GBA which tile to display in each "cell" on the screen. You can fill in a whole level or map with tiles that you define once when reuse all over.

That's a high-level overview. Hope that's what you were looking for. :)

-Scott
_________________
Some of my GBA projects