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 > read from files

#1264 - whodoo - Thu Jan 16, 2003 1:21 am

this might be a stupid question..
if I wanna run my game on a real GBA...do I have to store Everything in One file where the levels and everything are included..or can I do like Im doing on a PC, having the levels in text-files that I?m reading from when the game starts?..so I dont have to re-compile everytime editing a level..

#1266 - whodoo - Thu Jan 16, 2003 1:30 am

I mean the GBA?s got no own filsystem but can I get around this in some way..

#1267 - ampz - Thu Jan 16, 2003 1:50 am

No, you link it all into one binary file.

There are tons of bmp2gba converters out there that converts graphics into a a array in a .h file.
You can also setup your compiler to link resource files so that the compiler doesn't have to compile large arrays.

#1274 - tepples - Thu Jan 16, 2003 3:50 am

Actually, it's straightforward to put a filesystem in a GBA game. Just use GBFS.

Drawback of GBFS: You can't use gdb. But because I generally use what has been called "printf debugging" on other platforms, where I use an extra BG layer to display some select struct contents, I don't even use gdb.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#1286 - Sweex - Thu Jan 16, 2003 10:56 am

I think you should just program your own file system "emulation" functions.

I'm planning to include a step in the makefile which will compile all files in a given directory into a binary that then gets linked. By also storing the filenames inside it, I will be able to access the binary data using the same filename as it is on my harddrive. Just putting new files in the specific directory will get it linked into the ROM then...

Additionally I want to add some conversion, so PCX/TGA files will be converted to a GBA format (Don't want to unpack anything realtime, except when ROMsize is becoming an issue)

Not telling I'm going to make the greatest system ever, just to give you an idea what you could do.

Haven't tried GBFS, so maybe that's pretty similar to the idea described above...?