Final Fantasy Hacktics

Modding => Help! => Topic started by: Choto on February 03, 2012, 05:43:29 pm

Title: How does the game access auxilary files?
Post by: Choto on February 03, 2012, 05:43:29 pm
This is one topic I haven't been able to find any kind of info about.

Battle.bin and SCUS are accessed during battle right? How does the game load or initialize other files like effect files? The graphics for the battle menus, status effects, etc. are contained in Frame.bin, so wouldn't they have to be accessed as well? Do these files hold addresses in RAM like SCUS and Battle.bin?
Title: Re: How does the game access auxilary files?
Post by: Pickle Girl Fanboy on February 03, 2012, 07:02:06 pm
I think SCUS is always loaded.  Parts of it, at least.
Title: Re: How does the game access auxilary files?
Post by: Glain on February 03, 2012, 09:12:53 pm
SCUS, yes, that's the main program and always loaded. I'm actually not sure how it loads/unloads the other files. The big one is swapping BATTLE.BIN and WORLD.BIN and I can't find text strings of either one of those filenames in SCUS (so how does it know the filename of which one to load?)
Title: Re: How does the game access auxilary files?
Post by: RandMuadDib on February 04, 2012, 02:36:50 am
since files can't take up the exact same physical space on the disc, they have to be in a certain order, right? perhaps the game knows exactly where each file is supposed to start and just looks for that position on the disc instead of a filename?
Title: Re: How does the game access auxilary files?
Post by: Pickle Girl Fanboy on February 04, 2012, 05:33:54 pm
Are there a bunch of pointers at the beginning of battle.bin and world.bin, which point to different areas of their respective files?

I ask because maybe scus doesn't call those files themselves, but instead references parts of those files according to whatever those parts are called in their own file.

Like, if the part of battle.bin that holds formulas in battle.bin is called foo1 within battle.bin, then maybe scus just looks for foo1 (this assumes that there is nothing else called foo1 inside any other file).  And then when it needs another part of battle.bin, then it looks for foo2, or foo3, or foo78, or whatever.
Title: Re: How does the game access auxilary files?
Post by: Bosola on February 11, 2012, 06:15:06 pm
The PSOne doesn't use filenames to access file resources. Any filenames in an ISO are artefacts of the compilation process - in fact, later PSOne games typically strip the filenames out completely. FFIX, for instance, turns all data into a single binary blob and flags it as a directory. No filenames there.

No, the PSOne seeks data with raw LBA+Size values. The LBA is usually stored in little-endian format (so LBA 0x123456 will be stored as 0x56 0x34 0x12). You should be able to grab the LBAs of your files easily with a tool like CDMage.

Bear in mind that if any component of the executable is compressed (I don't know the FFT binary), you may need to uncompress those sections to find the lookups. In FFVII, compressed segments are just subject to typical Gzip compression, so I'd expect something similar for Final Fantasy Tactics.
Title: Re: How does the game access auxilary files?
Post by: Pickle Girl Fanboy on February 11, 2012, 06:55:21 pm
Left: Just standing here, watching the forum, hitting F5.
Right: See the name Bosola.
(http://s133702574.onlinehome.us/pictures/blog/poppingeyeballs.jpg)

See the name yojimbo_beta:
(http://imgsrv.worldstart.com/ct-images/soda-spit.jpg)
Title: Re: How does the game access auxilary files?
Post by: Bosola on February 12, 2012, 07:17:56 am
Yes, it is I. FFVII and Rebirth aren't the only things I work on!