TrekkiesUnite118
Established Member
It's been a while since I posted here but I figured I'd post this project I've been fiddling with lately.
Over at SegaSaturn.co.uk I've been discussing the idea of taking the US PS1 script and audio and somehow putting it into the Saturn game. I'm posting this here as I could use some more experienced Saturn programmers/hackers as I'm in a bit over my head.
From my thread over at SegaSaturn.co.uk, here is what I've figured out so far:
My first attempt with a straight port over failed miserably. The game booted, but crashed when I tried to start a new game. I pretty much expected this but I decided to give it a try anyways just to be sure.
I've been able to extract the files from iso's of the Japanese and English versions of the game as well as my copy of the MPEG version and a BIN I got of the standard Saturn version. Comparing the Saturn files to the Japanese PS1 files they look to be the same for the most part. Comparing with the English versions there's obvious data differences, but the format still appears to be the same.
The problem I've run into appears to be with the Endian difference. The PS1 as far as I know is Little Endian where as the Saturn is Big Endian. The conversion between the two is looking to be a bit of an issue. Comparing the Japanese files is posing more questions than answers at this point. In some cases bytes are just flipped which you would expect with the difference in endian-ness. In other cases data is byte for byte identical. And in some cases it looks as though someone cut the file down the middle and flipped the two sides, so for Example:
ABCDEFGH
Becomes this:
EFGHABCD
The main issue is there's no consistency with in the files themselves. The 3 scenarios I listed above can all happen within the same file. So I'm not sure how to go about converting that with any sense of accuracy or if there even is a way to convert that. I'm not very experienced with this kind of thing so if someone more experienced wants to step in feel free to.
Moving on, this is what I have found out about the files.
The Saturn version is laid out in a very clear and logical manner. Files are stored in clearly marked folders and are organized quite neatly. The Structure for the Saturn version is as follows:
Folders:
BTL_DATA - I assume this is Battle Data. It contains 52 Files called B_DATAXX.CMP, 1 B_PARTY.CMP, 99 EFF_XX.DAT, 61 MXX.PCM, OPEN_BG.CMP, OPEN_OBJ.CMP, and 3 SOUNDXX.DAT files. My guess is this is mostly stats and Sound effects but I could be wrong.
CPK - Holds all the FMVs
MAP - Holds about 153 MAP.DAT files
SOUND - Holds about 3 small files, LUNARMAP.REL, SCSPDRV.BIN, SO_PACK.DAT. My guess is drivers. By the file names maybe instruments or tables pointing to them, but they are awfully small for that.
SYSTEM - This holds a lot of DAT Files, TBL Files, BIN Files, and PAL Files with a few others. Most of these by the names appear to be where all the different Face pictures are stored. It also holds the Map Table, Symbol data, as well as the Shop List among other things.
TBL - Holds 155 Files called PEO_XXX.DAT. I'm not sure what these are. They could be stat Tables, or they might be Kana/Character tables. I'm leaning towards the latter since in the English version these are changed and are dramatically smaller in size. But I'm not 100% sure on what they are.
TEXT - Contains 61 TEX_XXX.DAT files, 2 FONT.DAT files, and AR_BOOK.TXT which appears to be the entire script for the FMVs in plain text. This I'm guessing is where the text is stored. These are also changed heavily in the English version.
Files:
0 - Not sure what this is, its 504K. My best guess is maybe the main program. What I can decipher from it are a few references to files and folder and calls to what appear to be a Cinepak player.
CDDA1 - Flute Song + Luna Singing
CDDA2 - Luna telling Alex that this is a Saturn game and to take it out of his CD Player.
~99 PCM files - Mostly voice clips and sound effects
MAP_TONE.BIN - No idea what this is.
SE_MAP.SEQ - Might be a MIDI Sequence file, but again not really sure
85 SE_MAP.DAT files
SE_SYS.SEQ - Might be a MIDI Sequence file, but again not really sure
68 SOUND.DAT files
SYS_TONE.BIN - 32KB Binary file. Not sure what this is, probably part of the main program.
SYSTEM.DAT - Data file of some kind. Might be for menus and stuff.
The MPEG version differs slightly. The Main difference is the Folders have now been turned in to Archive files. Basically all the files in them are now added together into one big file with a header on top.
From what I've looked at, the Header is pretty straight forward. The First 12 Bytes are the fire name. The Next 2 sets of 4 bytes I'm not sure on. All I know is that when you add them together you get the value of the first 4 bytes in the line after the next (if you have your Hex Editor set to 12 Bytes per line). The final 4 bytes are the file size. After each file there is a padding of 0's to the next 0x800 bytes.
The other big difference is that the FMVs are now MPEGs and stored in the main directory. The SND archive now has the SE_MAP.DAT files along with the two SEQ files and both TONE.BIN files in it along with what was in the SOUND folder. The SYSTEM.DAT file is now in the SYSTEM Archive file. Probably to avoid having two files with the same name.
There is also a file that doesn't correspond to a previous folder in the previous version called NW.DAT. This is where all the PCM data has been moved to. However it has no header like the others. It's header is instead stored in SYSTEM the System archive as a file called NW.DIR.
Finally there is one file that only shows up in the Original Saturn version. It's called TEXT.DIC in the TEXT folder. I don't know what this is and I'm not even sure if it's used. But it's there none the less.
The PS1 version has most of the same files, though the Sound is stored different it seems. There is one PEO Table missing from what I can tell, PEO_255.DAT. I'm not sure if this is actually used though as I said it's missing in both the Japanese and English PS1 versions.
The main difference in the PS1 version is that instead of having folders or archive files, all the files are stored in one big archive file. You can extract them by using a tool called BioFAT. Though it seems only older versions support it.
And here is more info pulled from my thread over at SegaSaturn.co.uk:
Ok, so I've taken a short break to play around with the audio to see what complications are involved in converting the English Audio. So far I've found the following:
M01.PCM - M61.PCM = Battle voices and game sound effects
M62.PCM - M94.PCM = In game cutscene voices
M95.PCM - M99.PCM = Final few sound effects of the game
Audio files are in 8-bit PCM format at 16000Hz in Mono.
The PS1 audio files in comparison are 8-bit PCM Format at 37800Hz in Mono. So right off the bat there's going to be a hit in audio quality. My first attempt at converting the PS1 Files to the above Saturn format didn't quite work. The game crashed when it tried to load the audio. The files were too large for RAM.
My Next test was to try the conversion again only this time cutting off the trailing silence at the end of the files, and slightly reducing some dramatic pauses. This worked and got the files to fit in RAM only there was another problem:
http://www.youtube.com/watch?v=m472VMaPloM
The audio clips were too long and got cut off. The game also got hung up and stopped. My guess is that the files were still too big and the Saturn didn't know what to do with itself.
So I tried reducing the Sample Rate to see if smaller files might fix the issue. This made the samples play a bit longer but the same thing happned. So some hex editing of pointers will probably need to happen at some point is my guess. However this test did have some hilarious results:
http://www.youtube.com/watch?v=m6yjkA4Hrhg
Over at SegaSaturn.co.uk I've been discussing the idea of taking the US PS1 script and audio and somehow putting it into the Saturn game. I'm posting this here as I could use some more experienced Saturn programmers/hackers as I'm in a bit over my head.
From my thread over at SegaSaturn.co.uk, here is what I've figured out so far:
My first attempt with a straight port over failed miserably. The game booted, but crashed when I tried to start a new game. I pretty much expected this but I decided to give it a try anyways just to be sure.
I've been able to extract the files from iso's of the Japanese and English versions of the game as well as my copy of the MPEG version and a BIN I got of the standard Saturn version. Comparing the Saturn files to the Japanese PS1 files they look to be the same for the most part. Comparing with the English versions there's obvious data differences, but the format still appears to be the same.
The problem I've run into appears to be with the Endian difference. The PS1 as far as I know is Little Endian where as the Saturn is Big Endian. The conversion between the two is looking to be a bit of an issue. Comparing the Japanese files is posing more questions than answers at this point. In some cases bytes are just flipped which you would expect with the difference in endian-ness. In other cases data is byte for byte identical. And in some cases it looks as though someone cut the file down the middle and flipped the two sides, so for Example:
ABCDEFGH
Becomes this:
EFGHABCD
The main issue is there's no consistency with in the files themselves. The 3 scenarios I listed above can all happen within the same file. So I'm not sure how to go about converting that with any sense of accuracy or if there even is a way to convert that. I'm not very experienced with this kind of thing so if someone more experienced wants to step in feel free to.
Moving on, this is what I have found out about the files.
The Saturn version is laid out in a very clear and logical manner. Files are stored in clearly marked folders and are organized quite neatly. The Structure for the Saturn version is as follows:
Folders:
BTL_DATA - I assume this is Battle Data. It contains 52 Files called B_DATAXX.CMP, 1 B_PARTY.CMP, 99 EFF_XX.DAT, 61 MXX.PCM, OPEN_BG.CMP, OPEN_OBJ.CMP, and 3 SOUNDXX.DAT files. My guess is this is mostly stats and Sound effects but I could be wrong.
CPK - Holds all the FMVs
MAP - Holds about 153 MAP.DAT files
SOUND - Holds about 3 small files, LUNARMAP.REL, SCSPDRV.BIN, SO_PACK.DAT. My guess is drivers. By the file names maybe instruments or tables pointing to them, but they are awfully small for that.
SYSTEM - This holds a lot of DAT Files, TBL Files, BIN Files, and PAL Files with a few others. Most of these by the names appear to be where all the different Face pictures are stored. It also holds the Map Table, Symbol data, as well as the Shop List among other things.
TBL - Holds 155 Files called PEO_XXX.DAT. I'm not sure what these are. They could be stat Tables, or they might be Kana/Character tables. I'm leaning towards the latter since in the English version these are changed and are dramatically smaller in size. But I'm not 100% sure on what they are.
TEXT - Contains 61 TEX_XXX.DAT files, 2 FONT.DAT files, and AR_BOOK.TXT which appears to be the entire script for the FMVs in plain text. This I'm guessing is where the text is stored. These are also changed heavily in the English version.
Files:
0 - Not sure what this is, its 504K. My best guess is maybe the main program. What I can decipher from it are a few references to files and folder and calls to what appear to be a Cinepak player.
CDDA1 - Flute Song + Luna Singing
CDDA2 - Luna telling Alex that this is a Saturn game and to take it out of his CD Player.
~99 PCM files - Mostly voice clips and sound effects
MAP_TONE.BIN - No idea what this is.
SE_MAP.SEQ - Might be a MIDI Sequence file, but again not really sure
85 SE_MAP.DAT files
SE_SYS.SEQ - Might be a MIDI Sequence file, but again not really sure
68 SOUND.DAT files
SYS_TONE.BIN - 32KB Binary file. Not sure what this is, probably part of the main program.
SYSTEM.DAT - Data file of some kind. Might be for menus and stuff.
The MPEG version differs slightly. The Main difference is the Folders have now been turned in to Archive files. Basically all the files in them are now added together into one big file with a header on top.
From what I've looked at, the Header is pretty straight forward. The First 12 Bytes are the fire name. The Next 2 sets of 4 bytes I'm not sure on. All I know is that when you add them together you get the value of the first 4 bytes in the line after the next (if you have your Hex Editor set to 12 Bytes per line). The final 4 bytes are the file size. After each file there is a padding of 0's to the next 0x800 bytes.
The other big difference is that the FMVs are now MPEGs and stored in the main directory. The SND archive now has the SE_MAP.DAT files along with the two SEQ files and both TONE.BIN files in it along with what was in the SOUND folder. The SYSTEM.DAT file is now in the SYSTEM Archive file. Probably to avoid having two files with the same name.
There is also a file that doesn't correspond to a previous folder in the previous version called NW.DAT. This is where all the PCM data has been moved to. However it has no header like the others. It's header is instead stored in SYSTEM the System archive as a file called NW.DIR.
Finally there is one file that only shows up in the Original Saturn version. It's called TEXT.DIC in the TEXT folder. I don't know what this is and I'm not even sure if it's used. But it's there none the less.
The PS1 version has most of the same files, though the Sound is stored different it seems. There is one PEO Table missing from what I can tell, PEO_255.DAT. I'm not sure if this is actually used though as I said it's missing in both the Japanese and English PS1 versions.
The main difference in the PS1 version is that instead of having folders or archive files, all the files are stored in one big archive file. You can extract them by using a tool called BioFAT. Though it seems only older versions support it.
And here is more info pulled from my thread over at SegaSaturn.co.uk:
Ok, so I've taken a short break to play around with the audio to see what complications are involved in converting the English Audio. So far I've found the following:
M01.PCM - M61.PCM = Battle voices and game sound effects
M62.PCM - M94.PCM = In game cutscene voices
M95.PCM - M99.PCM = Final few sound effects of the game
Audio files are in 8-bit PCM format at 16000Hz in Mono.
The PS1 audio files in comparison are 8-bit PCM Format at 37800Hz in Mono. So right off the bat there's going to be a hit in audio quality. My first attempt at converting the PS1 Files to the above Saturn format didn't quite work. The game crashed when it tried to load the audio. The files were too large for RAM.
My Next test was to try the conversion again only this time cutting off the trailing silence at the end of the files, and slightly reducing some dramatic pauses. This worked and got the files to fit in RAM only there was another problem:
http://www.youtube.com/watch?v=m472VMaPloM
The audio clips were too long and got cut off. The game also got hung up and stopped. My guess is that the files were still too big and the Saturn didn't know what to do with itself.
So I tried reducing the Sample Rate to see if smaller files might fix the issue. This made the samples play a bit longer but the same thing happned. So some hex editing of pointers will probably need to happen at some point is my guess. However this test did have some hilarious results:
http://www.youtube.com/watch?v=m6yjkA4Hrhg