VERY HIGH LEVEL OVERVIEW Richburn had developed tools which don't seem to be able to handle pointers changes correctly, and which use their own very specific formats for tables (i.e. characters matching to hex), for text dumped, for translation and opcodes. In my humble opinion, improving them to work ok in terms of pointers would be a real pain. However, the folders which Pablitox has been putting together contain good info, so it is worthy looking into them to understand the info available - with a view to re-creating a dumper and an inserter, with pointers accounted for this time. This is what I will detail here. Wastor, on his end, has done everything ok on Summon Nights 1, and has shared the info of "how" with us. So it is good to read all he gave us, try and get familiar with how it works on Summon Nights 1, and then see how much of that can be applied to hajiamri no ishi.
So step zero is to read all that has been shared. Info that is not useful: - Richburn's tools code is very not easy to read to me. So I wouldn't bother with the code. Do however read any txt/doc that comes with it. - There's a guy who did a font attempt with 2 ASCII characters for each 2-byte code used by the game. That's a waste of time in my opinion, because it was done to reduce the size of the text, and Pablitox's counting of the characters shows that we don't need to worry.
Step 0 should also include reading all the PM's I sent to Pablitox
and looking into the ROM itself while reading them.
REPRODUCING WHAT WASTOR HAS DONE -SIMPLE STEP ALL IN JAPANESE Start with swordcraft story 1. Look into the ROM. Look for "PSI3" and you will find many occurrences. These mark the start of a block of text. There are many of them PSI3's, because the text is split into small sections, each section is "played" by the game when dialogue is presented. It is not 1 section per character chat, but one section for a few. The text is not directly readable, because it has been compressed. To be more precise, there are 2 layers: - PSI3 encapsulation (this one should be a simple matter of cutting out the bytes) - LZsomething compression. (Cue has created tools that handle that one - I haven't tried, so I don't know what parameters to use, but Wastor knows. Maybe you can even read it in one of his PM's. He was referring to http://www.romhacking.net/utilities/826/
if I understood well.) So there you have to: - split the PSI3 sections out of the ROM (write a specific program for that, in your vaforite language) - apply CUE's decompressor to them (batch file calling for each of them thousands of extraced files. Get parameters from Wastor.) - enjoy reading the Japanese text - get Pablitox to confirm this indeed seems to be the script, and point out the first few sentences (for later test). Also, you should be reading here that there are "non-text bytes" in the text. These are "opcodes", i.e. commands given to the game's engine to do extra things while presenting the text. Some typical ones are "press any key to display the next window of text", "change character portrait to show surprised look", etc. Each game has its own set of opcodes. Don't dig too much into these ones here, except for the ones that insert pointers. (See the text file that has some opcodes explained in it for hajimari no ishi .)
And now it's time to re-insert. One complexity here: CUE's encrypter will not produce the same result as the gamer originally did. Right now, it is a pain because, if I got it well, I think it means you have to handle the in-text pointers right away. Not sure. Try to recompress and play directly. If it works, be happy!
To rehash, take the same steps as before in reverse order: - compress the Jap' text with CUE's tool - re-create the PSI3 headers - insert the PSI3 sections back into the ROM. Note: you will probably need to insert useless bytes at the end of the PSI3 sections because the new ones are a bit shorter than the original ones. Play and verify that it works. Debug if it does not.
REPRODUCING WHAT WASTOR HAS DONE - A BIT OF ENGLISH Now that this works, it's time to insert a bit of English and get familiar with these in-text pointers. Translate a bit of text (preferably at the start of the game, for ease of texting), making it longer than it was. the goal is to have longer text in English than when you re-compress with CUE's tool, but stay within the size of the re-compressed Japanese text. Insert line breaks /new window opcodes as needed for it to look ok. There should be pointers in the text. Ask Pablitox about them - from what I understand, they give a "jump" order depending on which of the heros you are playing, and probably other things. The "bad" thing here is that they are really offsets (either relative to the PSI3, or absolute offsetsin the ROM, I am not sure. I was not able to make Wastor explain that correctly, probably because of my limited Spanish, but you can try and be a pain to Pablitox until he gets the right explaination. Right, Pablitox?
) So, because you inserted larger text than in Japanese, the pointers will be wrong. You need to correct them. It's ok to start doing that manually in the insertion process, to test it out. Then re-run the rest of the chain (CUE encryption, PSI3 encapsulation, ROM insertion, play!) until you get them right. Once you have them right, you have to get your program to do it automatically for you (i.e. understand how they are calculated and make the program handle it).
Once that is ok, you will have done all you can with Summon Nights 1. Training is over, it is time to go into the tough part!
Just kidding. Anything from now on is related to Summon Nights 3.
MORE INFO ON CREATING THE DUMPER You need to check the PSI3 struccture, to see if your tool fromswordcraft story 1 to extract them and de-capsulate is still working or needs adapting. After that, you run CUE's tool and cross fingers that it works. If it doesn't, try and understand why (I mean - what difference do you see in the bytes?) and see if you can tweak any parameter the tool takes in order to make it work. If it doesn't, call for Cue's help through Pablitox.
If all goes well, then you have a long japanese text in front of you (split into many files). Get Pablitox to confirm that this is indeed the right thing, jut to be sure. Then you are on for the same thing as we did with Summon Nights 1. Re-insert the japanese as-is in order to get your toolchain ok. (Especially: if you changed things during the dumping, expect to change things during the insertion.) Once that works, translate a small part, correcting the pointers, with the same constrinats (don't get the compressed size bigger than the original compressed Japanese, but do get it bigger than the CUE-re-compressed Japanese.)
FITTING INSIDE THE ROM After that, we are almost done preparing the tools. Almost. The last problem to take care of is to make it that text will fit inside the ROM. A bit of background info here: the ROM size for Summon Nights 3 is already at the maximum accepted by the GBA. So there is no magic here. And you can look for free sections that can be overwritten, but they are not very numerous and not very large, except for about 200KB at the end of the ROM. so keep in mind that you have that space to look forward to for later. You will have to sue 2 techniques to fit inside the ROM: change character encoding to ASCII, and relocate text. Text is currently encoded in SJIS. (You used the table of that name to get to the Japanese.) This means that, when you insert English back into the ROM, it is still encoded in SJIS. SJIS's encoding of A-Z and a-z characters is using 2 bytes for each character, which is a waste of space. So your mission is to replace SJIS with ASCII. What this means is: - you need to get your tool to produce ASCII instead of SJIS. Depends on how your tool is done - I leave that up to you. Maybe you only need to change the encoding of the text files, after text has been translated? (Notepad++ allows that for instance.) - you need to get the game to understand ASCII. This is the trickiest part. . First, locate the font's graphics in the ROM. CrystalTile2 or TileGGD can be used for that. I'm not good at it, so I can only wish you luck. . Then you need to find the routine that translates "character codes" (i.e. bytes in the table) to offsets within the font. You should start from a breakpoint on the location of the text, and step instructions until you find the right calculation. Have the address of the font at hand, it will help recognize an address that is within the range of the font. By "font" I really mean the font's graphics, here. Once you find it, you are ready for changes. The SJIS encoding of "A" is 8260. The ASCII encoding is 41. After that, characters are in the same order. So you need to add 8220 to the characgter codes read byb the game, before it goes on with its usual processing of the letters to display them. And that's it - you just divided by 2 the amount of space required!!!
GETTING ENOUGH SPACE ON SCREEN Of course, there is more to do. One item comes to mind: you will need to use a variable-width font in order for the text to have enough space on screen to be displayed properly. As this is one of the last items you will get to,and i am not really that familiar with it yet, I suggest we tackle it (or you call for help on RHDN) once you get there.
USING THE EXISTING TRANSLATION Pablitox has an existing translation of all of the Japanese text into English. Which is great, right? But we just changed the format in which the text was dumped, in order to match your new tools, and the format that Pablitox used was not insertable anyways, because all of the opcodes were erased... So, time for a new program, right? The translated text takes the following format: Japanese English Translator's name Note also that the name of the file containsthe initial address of the PSI3 block that contained it in the Japanese ROM.
Good news: we don't care about the translator's name (sorry guys
). So you can create a program that will load in RAM all of the text in format "Japanese, original offset, English". Try and match it with the dumped text. Cross fingers that these guys didn't remove too many opcodes. If it doesn't work, then get these guys back to manual work to insert their translations into the dumped text. (After all, this is the only way to get things back into the ROM.)