08-11-2015, 01:49 AM
They seem to work fine for me. However I did fix it up a bit to handle the different possible file extensions in any of the files. E.g. it handles .wav files in DATA001.BIN now, in the other version WAVs were only present in DATA003.BIN and it assumed that. It also handles .btex or whatever else in DATA003.BIN, even though they're not there they might be in future versions.
It's mostly the same though. Make sure you're running it on DATA000.BIN specifically, not the whole folder all the files are in.
Code:
goto 0x20
getdstring FILE1 0x10
getdstring FILE2 0x10
getdstring FILE3 0x10
open FDSE FILE1 1
#open FDSE FILE2 2
open FDSE FILE3 3
open FDSE "DATA000.NAM" 4
savepos POS
set NMPOS POS
math NMPOS -= 0x50
get FSIZE asize 4
for NMPOS = NMPOS < FSIZE
get v1 short
get NUM short
math NUM += 1
get SIZE long
get OFFSET long
get DUMMY long
goto NMPOS 4
getct NM string 0x2E 4
if v1 == 0x8000
if NUM == 1
set NAME FILE1
string NAME -= 4
string NAME += "/"
string NAME += NM
goto OFFSET 1
getdstring EXT 4 1
if EXT == "TEX1"
string NAME += ".btex"
elif EXT == "BFNT"
string NAME += ".bfnt"
elif EXT == "DMSG"
string NAME += ".bin"
elif EXT == "RIFF"
string NAME += ".wav"
else
string NAME += ".unk"
endif
log NAME OFFSET SIZE 1
/*elif NUM == 2
set NAME FILE2
string NAME -= 4
string NAME += "/"
string NAME += NM
goto OFFSET 2
getdstring EXT 4 2
if EXT == "TEX1"
string NAME += ".btex"
elif EXT == "BFNT"
string NAME += ".bfnt"
elif EXT == "DMSG"
string NAME += ".bin"
elif EXT == "RIFF"
string NAME += ".wav"
else
string NAME += ".unk"
endif
log NAME OFFSET SIZE 2*/
elif NUM == 3
set NAME FILE3
string NAME -= 4
string NAME += "/"
string NAME += NM
goto OFFSET 3
getdstring EXT 4 3
if EXT == "TEX1"
string NAME += ".btex"
elif EXT == "BFNT"
string NAME += ".bfnt"
elif EXT == "DMSG"
string NAME += ".bin"
elif EXT == "RIFF"
string NAME += ".wav"
else
string NAME += ".unk"
endif
log NAME OFFSET SIZE 3
endif
endif
savepos POS
math NMPOS = POS
math NMPOS -= 0x50
next
It's mostly the same though. Make sure you're running it on DATA000.BIN specifically, not the whole folder all the files are in.