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 > Problem with background tiles getting messed up [Renamed]

#88034 - gs2phateon - Sat Jun 17, 2006 3:12 am

For the project I'm working on, I'll be using a lot of 64x64 sprite frames for animation. I'm not having any trouble getting the sprites to work, or the animation to run. The problem is, as I was putting in more and more animations, my background tiles were getting messed up. I took out some of the extra graphics files, and the background returned to normal.

Is there a limit to how many graphics data the GBA can hold? My problem wasn't that I ran out of room in the VRAM (I was rewriting the a single sprite every loop to save space and tiles), but it seemed like the background array was being overwritten. Is this what was happening, and if so, how do I fix it? I'm planning on using a lot of backgrounds and animation frames, and if I'm stuck with only one background and a few frames, I won't get very far.

#88046 - tepples - Sat Jun 17, 2006 6:37 am

The theoretical limit to the amount of graphics data on a GBA cart is 32 MiB minus the size of the game engine. Are you making sure to declare your sprite cel data arrays as const so that they are kept in ROM rather than being stuffed into RAM?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#88052 - gs2phateon - Sat Jun 17, 2006 7:56 am

Yes, I have been doing that with all of my arrays. I deleted some extra maps, and I guess that cleared up more room. So if I keep declaring <b>const</b>, I should have as much room as I need right? I was getting worried because my ROM is only about 200 KB.

#88053 - poslundc - Sat Jun 17, 2006 8:09 am

Make sure you're not compiling for multiboot...

Dan.

#88086 - tepples - Sat Jun 17, 2006 2:57 pm

Are you using a GBA Movie Player or something else to test your code? If you are using a GBA Movie Player, you'll need to continue to use multiboot linking but you'll need to use Chishm's FAT driver.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#88391 - gs2phateon - Mon Jun 19, 2006 6:58 am

Make sure you're not compiling for multiboot...

Is that the 2 lines that go at the top and say something like:

Code:
#define MULTIBOOT int __gba_multiboot;
MULTIBOOT


If so, then that could be my problem...

And I'm not using a GBA movie player to test the code, only the emulator and a SuperCard SD. I'll try taking out those 2 lines and see if I have any more problems. Thanks for the tip!

#88393 - gs2phateon - Mon Jun 19, 2006 7:10 am

Ok, got it! Man, you guys are awesome!