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.

DS development > nds data storage problems

#89164 - dh2050 - Fri Jun 23, 2006 11:30 am

I'm having a problem with retreiving data and pafs and gbfs cant handle the amount of data i put in
is there a way to import a whole (big) text file into a string(char array)

thks in advance

#89179 - tepples - Fri Jun 23, 2006 1:23 pm

Which flash equipment are you using, and how big is the file? At least on the GBA using a GBA flash card, GBFS works fine with 1 MB files (see GSM Player).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#89183 - dh2050 - Fri Jun 23, 2006 1:26 pm

basically the file is bout 4 mb

im considering spilting the file into small chunks of text
but the number of file would be insane

im using supercard ds

#89186 - tepples - Fri Jun 23, 2006 1:34 pm

How are you accessing the .gbfs file from within your code? Are you using bin2s, or are you using the appended method (find_first_gbfs_file())?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#89187 - dh2050 - Fri Jun 23, 2006 1:44 pm

well i use palib to make my program

the code:
sprintf (data,"%s", PA_GetGBFSFile (filestart, str, ""));


well i admit i dont really know how to make a gbfs file or extract the data from it (1st time working with gbfs)

btw is it possible to get all this data into a string (i need to process all these data)

#89200 - silent_code - Fri Jun 23, 2006 2:57 pm

you better read it from rom, not cram it into code (i'm sure you won't get 4mb of anything into ram) ;) so you're right saving it in a filesystem. splitting the file into sevaral categorized and smaller files may improve your access times, as you won't have to scan through the entire 4mb (!) textfile to find your e.g. 20 character string you need to display... for example you could make chapters, or common text and special text files, something like that. i don't know what kind of text you use (it really doen't matter), so you'll have to think for yourself.

happy coding!

#89203 - dh2050 - Fri Jun 23, 2006 3:22 pm

well if i do the "many small text files" method... its gonna be a 5 digit figure of files
(im not so sure whether gbfs can handle that may files in the 1st place but i tried compiling the files using gbfs creator by 7raven studios and the program gave an "overflow" error)

#89391 - silent_code - Sat Jun 24, 2006 5:58 pm

dh2050 wrote:
well if i do the "many small text files" method... its gonna be a 5 digit figure of files
(im not so sure whether gbfs can handle that may files in the 1st place but i tried compiling the files using gbfs creator by 7raven studios and the program gave an "overflow" error)


it's up to you how you split the files... if you can merge it in one file or split it into a "5 digit figure" of files, then you probably can also split it into, let's say 25 files... wouldn't that be possible? i mean, just think of categories!when it's like 10000 files, you can merge each 1000 into one and there you go. then the program needs to check where the data is located (you really should know that by yourself) and opens the file... there you go.

you'll have to find an alternative solution (categories!!! like all speach data, all level infos, all common data, all menu text, all whatever) because neither 1 4mb file nor up to 99999 files are the right thing.

i hope you find a good solution to your problem! :)