Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Pages: 1
So here's the rub. I have a game with multiple banks. The first bank contains the sprites for my main player. Another bank contains some sprites for other objects I want to load in. I can place one set of sprites or the other but then when I go to place the second set of sprites later it overwrites the sprites in the VRAM with the new ones. I have an area of the VRAM I am not using, so short of simply loading up a sprite set with blank sprites to pad the VRAM out to that point, wasting a lot of valuable storage in the process, how do I put the sprites I also want to display into that area?
Offline
How are you copying your tile data to VRAM? Are you using ASM or GBDK? Are you using a DMA to load your tiles?
Assuming you are using GBDK through just set_sprite_data calls. You would use the first parameter (first_tile) to change the tile position you start writing to in VRAM:
set_sprite_data(UBYTE first_tile,
UBYTE nb_tiles,
unsigned char *data);
For example if your first call loads 10 tiles, use 10 as as the first_tile argument on the second call to append the second set of sprites. Just make sure you account for that offset on anything that uses the sprite.
Offline
Pages: 1