Malenko’s Game Patching Guide: Vol. 1

Original Source: Lets localize Terra Phantastica! – (at SegaXtreme.net)

Lets start with the obvious. The likelihood of me actually finishing this [ Terra Phantastica ] is pretty much non-existent. I saw the game featured on a Sega Lord X video and thought it looked neat…

However, there is an immense amount of text, and my knowledge of Japanese is laughable at best. That said, I am going to do my best to figure out how all the data is stored and how to change it so that maybe some others will help by making tools and offering translation help.

I thought this thread could also double as some sort of quasi-tutorial so people can see my terrible method for figuring these games out.

I almost always start with the menus. For me its the most important part because navigating around and knowing what to pick to even start a game is pretty high up on the priority list. So for Terra the screen you get is this:

1660649237540.png

Now I’ve played enough import games to know the second one is options, and since I know I don’t have a save game for this title I was confident the top one was something like “start game”. After finding the data , I did use DeepL and Google to machine translate just to make sure. Machine translation is absolutely fine for most menu items but you’ll need a real translator for story and dialog!

So what I did was look for the options screen text by searching it’s shift-JIS value in Derek (ateam)‘s byte-search tool. If you are unsure how to get the shift-JIS value the easiest way is to use google translate on your phone, then copy/paste the text and email yourself the Japanese. Then just copy 1 letter at a time and search a shift-jis table ( like https://mattsmessyroom.com/uploads/sjis.tbl ) I found it in 0.bin . So I opened 0.bin up in a hex editor and found the value:

1660649510943.png

You can see on the right that the Japanese text matches perfectly. The CLUTCH thing to notice is that the word EXIT further down is in English in Shift-JIS value. So the first thing I tried was just using English values for the main menu. With with wxMEdit you can type on the right or put values in on the left, other editors may vary. I always try to use the 2 byte value first because then you get double the letters. if it doesn’t work you just go back and use the 4 byte values.

1660649662921.png

Without knowing too much about the way the data is presented; I always try to use the same number (or fewer) letters, then pad out the rest with either 20 (single space) or 8140 (double space) in this particular case I padded out “Options” with 208140 which is a total of 3 spaces. Then I used Knight0fDragon‘s SSP program to make a new patch and apply it so I can test. I have started a new thing where I keep vanilla versions of the files and ISO, just incase I need to go back to untouched files. I use the Vanilla ISO to patch against when testing:

1660650812857.png

The important thing is to be fine with it not working and not to get discouraged. It not working is not a failure, its eliminating what doesn’t work, so that you can narrow down what DOES work. I got lucky this time and it worked first try:

1660649970188.png

I then repeated the same process for the options screen, which was made easy by the fact it already had some English on the screen:

1660650250227.png

Find the values (I didn’t byte search this, since I figured the menu text was all together) in 0.bin…

1660650440491.png

And then change them to English:

1660650556170.png

Since I was using the 2 digit JIS values I was able to put more letters on each line and better flesh out what the options were and what they do.

There is ZERO tile editing on these screens, these fonts are already part of the game. The 2 digit JIS values here gave me false hope that I could use them for the entire game. SPOILER: I could not and had to make custom tiles.

And the result of the patch on the options screen:

1660650206223.png

In your head-cannon you probably think this took 5 minutes but in reality it took me probably 2 hours to get it all sorted. All of these projects are big time sinks so you do have to mentally prepare for that. Don’t get burnt out, take breaks, hop in discord to ask for help, hop in discord to hang out and relax.

Continuing on the “get the menu’s done first” trend, the next screen you get after the intro video is the name entry screen:

1660652496328.png

Just gobs of Japanese eh? Well name entry in a localized game will probably need to have English letters right? 

So again this is where playing a lot of import games has me recognizing some of the Japanese which will make finding this data a little easier.

On the bottom row, below ! and ? is “backspace” , so I just searched for those values in 0.bin (again assuming all the menu data is in 1 file) if the value wasn’t in there I would have used byte-search again. Unfortunately the Backspace and Exit text wasn’t near the alphabet, but everything was easily found:

1660653276998.png

Since this is a single tile using a 4 byte value, I used the same thing for the English:

1660653349560.png

It may look a little wonky in the hex editor, but you have to keep in mind what is there on the game screen. I have not decided what to do with the excess Japanese glyphs on the right, I’m sort of ok with them there unless I have to eventually edit their tiles to be used for English (spoiler, I had to edit some later). Save the file again, make a new patch, and test:

1660653584384.png

TADA! So with little to zero Japanese knowledge, the game now has its main menu and name entry screen in English.

Now the hard(er) part begins.

I will give a little warning in advance, this game does something very weird with some text values. It takes known used 2 byte values and re-uses them to display a different Japanese glyph than normal. This is not common in any of the games I’ve messed around with BUT the important thing to take note of is, lots of games do weird undocumented one-off things like this. There is no “standard” that will work for every game and its very likely you’re the first person trying to figure this stuff out for this game.

To expand on what I mean by using a 2 byte value differently than normal, it goes something like this.

Typically in JIS, the Value 41 is a capital A .
In the non-gameplay menus, this game uses 41 as a capital A.
However, IN GAME, the value of 41 is a small question mark that usually has the value of 3F.
3F however is a big question mark that usually has a JIS value of 8148

I made a spread sheet which helps with the visual:

Which brings me to my next point: DOCUMENT EVERYTHING YOU CAN!
Make documentation, try to keep it organized as best you can. Take lots of notes. I used to take notes for me, but now I take notes under the pretext that someone else is going to need to read them, even if no one else ever will.

So after the main menu, and name entry the next thing we see is the intro battle. It shows the pre-fight dialog, a non-interactive fight, then more dialog.

1660654746393.png

If you know as much Japanese as I do, then you know nothing about what’s going on.

Using context clues you can probably discern that some the red guy with horns probably has his name in yellow and is talking to the girl and the text is white.

What I did next was take a screen grab like the one above, and then I also opened up Yaba Sanshiro’s VPD1 debug so I could see the tile.

Now Yaba Sanshiro shows that its 1 big sprite, and while its completely possible that it is 1 giant sprite (like the menu descriptions in Street Fighter Zero 3) its just not likely in a game with this much text.

1660655098802.png

So what I did next was use byte-search again to try and find the values for the glyphs in yellow
ザイタン (Zaitan a Satan pun I guess?)

And no dice. byte finder couldn’t find it. I thought maybe there’s some weird spaces or padded value between characters, so then I started searching for various combinations of 4 byte values 2 byte values and a mix of box but couldn’t find the whole word in any file. So I eventually tried to search for the 2 byte values and parts of the word.

To explain タ has a JIS value of 835E. タ looks like a squashed version of the same tile but has a value of C0. So what I did was look for 2 “squished tile” values from the middle of that word and got a bunch of hits, so I figured I was on the right track. When I added the first letter I got nothing, so on a whim I added the 4 byte value of the first character (8355) to the B2, CO, and DD values and 3 or 4 hits so I opened each of the files and took a look.

I was able to find 8355 B2 C0 DD in a few files, but I had no idea which one was the correct one. What I did was change the value of 8355 to 8260 (4 byte value of a capital A) save the file, patch and then keep testing until I found the right one. The file I needed ended up being EV_MA001.MXE This basically told me that the MXE files are likely the files that contain the pre and post fight dialog, and the map data for the fights.

So to recap:
ザイタン and ザイタン make look different in a web browser and hex editor, and have different values, but this game displays them to look the same.

We can start looking at the other values by starting at where the 8355 B2 C0 DD value is in the file.

1660657449617.png

We can see strings of other values mixed in with some other Japanese. We know from the screen shot that after Zaitan’s name there are 3 characters, a space, then 5 more characters including the ! Next there is another line of text with 16 characters including its ending !

Since we know 8355 B2 C0 DD is the name in yellow we can use this section as a test bed to figure out other values. B2 C0 is a great place to test because it gives you room to test 2 2byte values or 1 4 byte value. I used up using all the spaces to test. I started by plugging in 10 11 and then saving, patching, and testing.

A value of 10 hard crashed the game, like… HARD.

1660658500132.png

The positive take away from this is that we now know the game has a debugger!
Eventually I got through all the 2 byte values in that google doc up there and started testing all the spaces:

1660658631097.png

Changing 8355 B2 C0 DD to D0 D0 D0 D0 D0 yielded me that result.
So the next step is to put his actual name in there. Zaitan requires 6 spaces but we only have 5 characters, so we will have to either use an alternate spelling, or start editing tiles. I chose to do the latter.

FINDING THE FONT:
Now before we get too far into the weeds on this, a very important thing to do when you start working on a game like this is to extract all the files. You can do this with Knight’s SSP patcher or you can use a program like CDMage. Again, Terra is a little outside of the norm in that there are zero folders in this game. All 2,242 files are in the root of the CD. What I did in this case was sort by file type. then just glance at the files by their group. There are some standards that apply to *most* games, like CPK files are almost always Cinepak video files. That eliminates them from being the font file. In this game we discovered MXE files are the gameplay maps, so its unlikely the font is stored there. So I always look for something called FONT or ASCII or anything of that ilk and then open it up in Crystal Tile; for Terra the file was called FONT12.DAT

1660659171839.png

I know your looking at that thinking “no way that’s a font!” But you cant just give up like that 

I know from working on other Saturn games that fonts are usually 8×16, 16×16, or 12×12. Since this File was called FONT12.DAT I thought 12×12 was a pretty safe bet. So I plugged those values in and scrolled around, and bingo!

You can see the in game font! I just need to hold CTRL and left arrow it to fix alignment:

1660659321018.png

At the top of the file there was still a bunch of garbled dots, so I adjusted the width until there was some clarity:

1660659554534.png

You may recognize this font from the main menu and options screen, when you plug in a 2 byte value the game uses this table to display the text. If you were to draw a smiley face to replace the letter C, anytime you put in the value for C, you’d get a smiley face. This is the premise of tile replacement in this game.

Since we need an extra letter for Zaitan’s name we will be putting 2 6×12 letters inside the space of a single 12×12 tile. If you are looking at the 2 byte value sheet from before you can see that I used the value of “AB” to replace ボ with “Za”, the value of AA to replace ベ with it and then 97E0 , which is on a different sheet for 4 byte values, to replace his name with Zaitan.

1660659854472.png

Save, patch, test. I saved all my changed files in a different folder (edited files) then make a new patch against the vanilla ISO just like before. If you are making lots of changes you may want to make a back up of your already edited files in case you need to revert. Test thoroughly as well. Just because the screen loads and shows the text you want doesn’t mean the the game will proceed to the next screen ; a lesson I learned the hard way on this game.

If you did everything right, didn’t fat finger any values and drew good tiles (or in this case made a 12×12 tile based on the 2 6×12 tiles). It should look something like this:

1660661083008.png

This game has some odd kerning , so all you can do is your best!

You can then apply the values you discovered to flesh out the rest of the text. I wont be updating this thread for a few days, I want to grind through all the intro fight text and get that part functioning before showing you how I figured out the battle menus, though to be honest its just more of the same.


Malenko has been a fixture of the Sega Saturn scene over the past several years, having done a handful of English patches for Saturn games. He has also been a helpful and active member of the SHIRO! & SegaXtreme communities. Follow him on SegaXtreme to keep up to date on his latest projects.

Readers Comments (5)

  1. SoloNerfherder 2022-08-18 @ 23:37

    Hi, very interesting to see an example of English patching a game!
    Do you need any help with translating? I’m a smartphone game translator for a company here in Japan, but would like to work on console games, even old classics like this!

    • Arve Eriksson 2022-08-20 @ 02:15

      I got in touch with him on the quick, and I got the impression that Malenko won’t even attempt a full translation. However, he’ll try to compile the information that *someone* with more time to spare won’t need to do the technical investigation.
      I’d love to pitch in as well, but I really can’t do much more than proofreading…

      • I don’t want to attempt translating this encyclopedia of a game without some ASM and translation help.

        Even if everything works out, this is going to be a “slow burn” not in a rush to get this done. My free time is still precious to me and I dont want to spend toooooooo much of it on these projects. 🙂

    • I need pretty much everything translated. Hop on discord and Pm me.

  2. Shadowmask 2024-04-02 @ 21:37

    This is amazing and thank you for taking the time to make it, Senpai.

Leave a comment

Your email address will not be published.


*