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 > Loading a Text File.

#164388 - Jinroh - Thu Oct 30, 2008 4:34 am

Hey all,

Doing some GBA work again and porting some of my code from Win32 to GBA and I have a .txt file with some model data I load in with fstream.h and was wondering how the easiest way of parsing that data with the GBA would be.

Thanks!
_________________
The lone Wolf howls, driven by pride he presses on. Knowing not where he goes, but only where he wants to be.
~Me~

#164397 - moonlightcheese - Thu Oct 30, 2008 1:58 pm

Jinroh wrote:
Hey all,

Doing some GBA work again and porting some of my code from Win32 to GBA and I have a .txt file with some model data I load in with fstream.h and was wondering how the easiest way of parsing that data with the GBA would be.

Thanks!

get libfat, follow these instructions/tutorial: http://chishm.drunkencoders.com/libfat/
use the dldi tool to edit the .gba to use your device or it won't run
dlditool: http://chishm.drunkencoders.com/DLDI/

this should be enough to load the model data.

#164401 - Jinroh - Thu Oct 30, 2008 3:29 pm

Thanks for the reply I'll have to look into it. I've not done a lot of File I/O with the GBA. I was hoping I could just include it with a .S or .O and let the linker/assembler handle the rest.

Thanks again!
_________________
The lone Wolf howls, driven by pride he presses on. Knowing not where he goes, but only where he wants to be.
~Me~

#164405 - kusma - Thu Oct 30, 2008 5:06 pm

A more light-weight file-system solution for the GBA is GBFS. If you want it to work with the standard IO functions (at the cost of a bit more memory usage), have a look here.

#164413 - Jinroh - Fri Oct 31, 2008 2:42 am

^_^ Thank you!

GBFS Looks like it will do the trick quite nicely.

I'll let you know how it goes.

Thanks Again!
_________________
The lone Wolf howls, driven by pride he presses on. Knowing not where he goes, but only where he wants to be.
~Me~