So a while back I made a topic here about translating Lunar Silver Star Story for the Saturn. I got stuck early on and wasn't able to make much progress. However recently members over at SegaXtreme such as Ms. Tea have been able to make headway due to a somewhat recent iOS port that is based on the Saturn port. So since it's now at a point where there's not much for me to really help with at the moment with that project, I've been snooping around in Grandia's files for the Saturn and PS1. And it's actually proving to be quite a bit easier to figure out so far due to the following reasons:
- The PS1 version and the Saturn version's files are actually quite similar.
- The English PS1 version's script is completely uncompressed and in ASCII formatting.
- The Saturn version's script is also completely uncompressed, but uses a custom encoding format.
- The Saturn version was somewhat recently translated into Korean which has made it easy to isolate where the script is.
- The Saturn version has 2 fonts stored in FDATA.BIN.
- There's an uncompressed 8x8 font that has a full English ASCII font for menus.
- The rest of the game uses a compressed 16x16 fixed width font. Luckily however members at SegaXtreme made tools to decompress and recompress it years ago. These can be used to replace the font and put it in an order to allow for ASCII formatted text.
- The English PS1 version uses a fixed width 8x16 font instead.
The games file structure also seems to be pretty straight forward. The FIELD directory has the following files of interest:
Most of these guesses were made by comparing the Korean, Japanese, and English versions.
- Numerous .MDT files - These contain the games script. In the PS1 version they're now .MDP files.
- ITGET.BIN - I'm guessing this is where the menu text lives. This is probably the equivalent of the ITEM.BIN file in the PS1 version.
- CMDMN.BIN Again this looks like either Menu text, guessing command related based on what's in it and the name.
- CNFIG.BIN This again looks to be like menu text, guessing Config menu based on the name.
- SHOP.BIN This is most likely Shop Menu text by the looks of things.
- SVLD.BIN Again looks to be Menu text, I'm guessing this is for the Save/Load screen based on whats in it and the name.
- AMAP#.ADD - I'm not sure what these are, but they were modified in the Korean translation. I'm guessing Map screens?
- WDATA.DAT - I'm guessing this is Weapons Data.
So with that out of the way, here's some of more fun stuff I've been able to figure out. First of all, I was able to figure out how at least some of the text encoding works in the Saturn version. Basically the game uses the position in the font table + 31 as the code for the font characters in the .MDT files. And going further, the Japanese PS1 uses this same method. So let's say you want to display the letter A. This is the 11th character in the font table. So to display it, you use the hex value 2A. This is because 11 + 31 = 42, which is 2A in hex. With this knowledge I was able to modify the file BA38.MDT and change some text in the intro cutscene:
Next, using tools made by CyberWarriorX on SegaXtreme, I was able to extract the font for both the Japanese and Korean Saturn versions:
And I was also able to get the English PS1 font:
Using the tool TileMolester, I was able to stretch the English PS1 font to 16x16, and place it in the Saturn font file in ASCII order. This allowed me to use ASCII encoding to change the text to English:
Currently, I've been working on two things. First I've been making a Kanji table based on the games Font File. Basically this should at the very least make viewing the script easier in hex editors as the Japanese characters will be displayed correctly. I'd imagine it will also make dumping the script easier. Next I've been figuring out the control codes for the text boxes. So far I've been able to determine the following, which I hope is correct:
x09 = Pause in writing the text. Seems to correspond to pauses in voiced sequences.
0FXX = These seem to correspond to various different things. XX I've seen range from 01 up to 0A.
0F03 = This seems to control the Left Character Portrait.
0F21 = This seems to control the Right Character Portrait.
0A0C 00XX = This seems to control which portrait is being displayed, and appears to be called when we change portraits as well.
So for example if you see this:
0F03 0A0C 00XX
It means change the Left Character Portrait to portrait XX. I was able to confirm this by changing the values of XX to arbitrary values which gave the following results:
So the area I think I'm going to get stuck on is the issue of dealing with the font size. I'd imagine some kind of ASM Hack will be needed to change the game to use an 8x16 font so the English PS1 font can be used. That's an area that I really have no experience in and it's simply a skill set I just don't have. There's an old thread over at SegaXtreme that goes into some details on how the Font Compression works, which might also shed some light on how text is rendered:https://segaxtreme.net/threads/saturn-hacking-notes.4934/
After that however, I think it's just a matter of figuring out the rest of the control codes for the games scripts as well as figuring out formatting of the menu text files. Once that's figured out I think making tools to dump the script and inject new values shouldn't be too difficult to do.
Obviously I don't think this will be a trivial matter, but I figured I'd share my findings none the less.[/list]