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.

ASM > VRAM writes

#10341 - iq - Tue Sep 02, 2003 9:29 pm

Hi,
So I know that VRAM writes have to in 16/32 bits, but does it require that the data be aligned on a 2 byte boundary? ie, if you were to make a blitter and the destination x was 1, does that mean I have to read back 0,1 or can I just write the consective value?

#10344 - tepples - Tue Sep 02, 2003 11:41 pm

Yes, if you wanted to change only pixel 1, you would have to read back the 16-bit unit containing pixels 0 and 1, modify it, and write it back.

But take a step back a moment. If you're just going to blit images onto the screen as if you were blitting onto a DirectDraw surface, consider using sprites instead. The GBA has as much sprite capability as some of the most powerful 2D arcade systems. The bitmap modes are used primarily for still screens such as title screens and for 3D rendering.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#10351 - Darkain - Wed Sep 03, 2003 4:35 am

or if you are blitting a large image, you can simply write 2 pixels in a single pass, making screen painting much more effecient.

(and some games other than 3d run in mode 3/4/5, not just title screens)
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS