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 > Sprites with various modes

#19478 - CyberSlag5k - Tue Apr 20, 2004 7:46 pm

What considerations must be made when using sprites in the various modes? I do not believe there are any for the tile modes, is this correct? And the bitmap modes require you start at character 512, right? Does that mean I would begin loading my sprites into OAMPosition[512]? And what about if I switch modes while drawing?

For example, I draw my sprites in mode 3, but would like there to be a background image on the screen. If I switch to mode 4, should I have started in OAMPosition[512] in the first place (assuming that is what needs to be done)?

#19481 - DiscoStew - Tue Apr 20, 2004 8:10 pm

If you are using any bitmap modes, it would be best to stick with starting at OAMPosition[512]. The bitmap modes cross over the Sprite VRAM (which you already know), and data written to the bitmap modes would overwrite the current data. Switching modes while keeping sprites at OAMPosition[0] could work, but you would have to continually rewrite the sprite in each frame, which probably isn't a good idea to do.
_________________
DS - It's all about DiscoStew

#19484 - sajiimori - Tue Apr 20, 2004 8:32 pm

"OAMPosition" is a weird name, considering that it doesn't refer to a position in OAM.

Modes 3, 4, and 5 all use the first half of the sprite tiles, so clearly if you are switching between 3 and 4 you should only be using the second half of sprite tile RAM.

If you're going to switch between a tile mode and a bitmap mode, and you'd like to have the first half of the sprite tiles available when you're in the tile mode, that's no problem either. Just use them when you're in the tile mode, and don't when you're in the bitmap mode.

It's perfectly normal to load sprite cels each frame. Check out some games in VBA.

#19488 - CyberSlag5k - Tue Apr 20, 2004 8:39 pm

Cool. Thanks guys.
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...

#19502 - DiscoStew - Tue Apr 20, 2004 11:39 pm

I guess that was my lesson of the day.
_________________
DS - It's all about DiscoStew