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 > including gfx other than c header files

#24902 - daveb - Fri Aug 13, 2004 11:59 am

Hi,
I have written a small program that uses many sprite bitmaps converted to c header files.

I have found if I include one more header file the game corrupts. I assume that I have filled the memory and overwritten something.

So I would like to use a different method to read data into the OAM.

I have seen several utilitys for converting bmps into raw files, but I dont then know how to read the datafrom these.

Basically is there an easy way for replacing reading gfx form a c header array with reading from a raw file?

The simpler the better!

Thanks
david

#24910 - ScottLininger - Fri Aug 13, 2004 2:33 pm

Dave,

Does the game corrupt when you include the header or when you copy it to the sprite tile memory? Does it get hosed on emulation as well as hardware?

It's unlikely that adding another header (i.e. making your ROM larger) is the source of your problem. It's probably because you're running out of space for your sprite tiles, which means that having the data be included into the ROM in a different fashion won't fix your problem, because the same bits and bytes will ultimately still be loaded into RAM and overflow.

Visualboy advance's memory viewer will let you peek into your tiles and confirm whether they are totally filled up.

You may need to reengineer how you're handling your sprites. Load animation every frame rather than all at the start, or only load tiles for the sprites that need to be displayed at that moment.

Cheers,

Scott

#24938 - dagamer34 - Fri Aug 13, 2004 7:04 pm

ScottLininger wrote:

It's unlikely that adding another header (i.e. making your ROM larger) is the source of your problem. It's probably because you're running out of space for your sprite tiles, which means that having the data be included into the ROM in a different fashion won't fix your problem, because the same bits and bytes will ultimately still be loaded into RAM and overflow.


That can happen if you are making a multiboot ROM and it goes over 256kb. It will just show a white screen. But it is probably something else.
_________________
Little kids and Playstation 2's don't mix. :(

#25242 - daveb - Thu Aug 19, 2004 10:15 am

Thanks Guys.
I got round this problem by making the header arrays const.
This seemed to solve my problem.

Thanks
david