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.

Coding > Games crashes if I add 4 sprite tiles...

#46038 - Lideln - Sat Jun 18, 2005 5:20 pm

Hi !

I have a weird (or maybe not, maybe its because I'm a big noob in GBA programming :D) and serious problem with sprites.
At the moment I have 2 sprites : a "Jelly" with 4 tiles (4 faces, or whatever it should be called), and a hero, with 16 tiles (16 positions, 16 faces, or whatever :D).
Everything was OK, my hero could stand (animated), walk, and punch a jelly.
But when I added the "kick" animation (which takes 4 tiles, or 4 faces, or whatever :p), the game crashes : screen is white then quickly black, then nothing...
All my sprites (and by extension my tiles) are 32*32.
I tried to change the hero tiles from 32*32 to 64*64 (for the hero to take more place in the screen) and the games crashes more !! (the screen is only white, nothing else happening).

I precise that I don't load all the sprite tiles in the memory, just the ones needed.

Does someone know where the problem is ? It s***s if I am limited to 16 tiles.... :(

Thanks a lot in advance :)

Lideln

#46040 - tepples - Sat Jun 18, 2005 6:25 pm

Are the cels const? If not, you may be overflowing IWRAM, and you should make them const.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#46051 - Lideln - Sat Jun 18, 2005 11:42 pm

Hi !

I tried what you told me, and it works !! Thanks ! In fact, I already tried it by myself, but I put the "const" for the palette as well, and it may be the error source.

Thanks a lot, and sorry for my noob question ! :)

By the way, what are the consequences for the game (to add the "const") ?
(I will search if pcx2sprite allows to put the const automatically)

Thanks again,

Lideln

#46055 - poslundc - Sun Jun 19, 2005 1:15 am

Lideln wrote:
By the way, what are the consequences for the game (to add the "const") ?


The const qualifier indicates that the data is not loaded into main RAM, which you only have 32K of. If you are making a multiboot game it goes into EWRAM (256K); if you're making it to run off of a cartridge it goes into the ROM (up to 32 MB).

Dan.