The fascinating Korean version of SADX PC and release of the Korean mod

TLDR version: There was a Korean version of SADX PC released back in 2004. I ported the Korean translation to the Mod Loader, so you can now play SADX in Korean if you install this mod. The mod is compatible with Dreamcast Conversion and Dreamcast DLC but incompatible with HD GUI.

Four years ago I got my hands on a somewhat rare version of SADX PC. I was completely unaware of its existence until I accidentally ran into a listing on an auction, so I got it right away. I’ve mentioned it before in a previous post, and today’s mod release brings the occasion to finally talk about it again.

Introduction and game package

This version was released in July 2004 in Korea by a game and toy company called Sonokong. It’s a complete Korean translation of the game with English voices. The game comes in a box with a fully translated manual, which is also in color! It looks a lot better than black-and-white Japanese and US manuals I’ve seen until now. Here are some pictures of the box, the discs and the manual. Please excuse the poor picture quality, maybe someday I’ll get to scanning these properly.

Installation and initial testing

Just like the US version, the game comes on two CDs. The simple CD check is also the same, so you can install and run the game on Windows 10 and above, unlike the Japanese version which no longer works because of SafeDisc. With the Korean version, you can pass the CD check even with the US version’s CD 2.

The autorun and the installer are also fully translated.

I can’t comment on the quality of the localization since I don’t read Korean, but I can say for sure a lot of work was put into it. Unlike French, Spanish and German translations that come with the US and Japanese versions, this one translates not only all textual data, but also all menu textures, the title screen and the main menu background. But the most impressive part is the Korean font used for subtitles and Chao Garden messages. To my knowledge, this is the only official release of SADX that introduces both asset and programming changes to accommodate a language that wasn’t in the original game. It’s also executed in an interesting way, which we will get to a bit later.

As amazing as this version is, it’s still the 2004 PC port of SADX at its core, so the game has terrible graphics with no mipmaps, broken windowed mode at non-4:3 resolutions, poor music quality etc. It’s pretty hard on the eyes, especially in motion.

(From now on, I’ll be using screenshots from the US version with the Mod Loader and the Korean mod)

Korean localization and option menu differences

Korean text replaces Japanese in this version. English text is also available, although the title screen and the main menu background will always use the Korean versions of the textures. The game doesn’t let you pick Japanese voice language, so only English voices can be used. Interestingly enough, Japanese voices are still included with the game: it just doesn’t show the voice language setting in the options menu and overrides the voice language variable with English as soon as a save file is loaded. However, before a save file is loaded the game still plays the “Select a file” voice from the Japanese voices folder. To work around it, the developers replaced that voice with its English counterpart. The rest of the Japanese voices are untouched.

I’m not entirely sure, but I think such elaborate workarounds to make sure no Japanese is heard in the game may have had something to do with Korean laws regarding Japanese media, which were stricter when the game came out.

Funnily enough the texture for the option was still translated, so when you use the mod on the US version with the Mod Loader, you can select Japanese voices as if the option was intended to be there originally (although it says “Korean” instead of “Japanese”). You can also select other languages for text (not sure if you’d really need to if you’re playing this!), which the Korean version doesn’t let you do.

The localization has everything you’d expect, including character tutorials, Mini Game Collection etc.:

Reverse engineering the Korean font

The implementation of the font used in the last two screenshots is intriguing. What caught my attention initially was the large size of the FONTDATA0.BIN file, which is used for Japanese characters in the original version (1.72MB vs 759KB in the original). My first guess was that they either replaced Japanese characters with Korean ones, or added them to the end of the file with the IDs matching the Korean codepage 949.

I started inspecting the file in SADXFontEdit in SA Tools. As expected, this file contains Hangul characters used to display Korean subtitles and Chao texts. However, apart from those, the file also has some characters from other languages, including Greek, Russian, Chinese and Japanese, which amounts to a total of 20609 characters (for comparison, the original file used for Japanese has only 8836, and almost all of those are Kanji, although Cyrillic and some other characters are present as part of the Japanese codepage). On top of that, soon I realized that character IDs stored in the file matched those of the codepage 1200 (UTF-16).

Yes, you read that right. In the Korean version of the game the subtitle font is an actual Unicode font. Although it only supplies specific blocks of the Basic Multilingual Plane, in theory you could add back the other blocks to implement any language included in the plane. Back in 2020 when I first discovered this, I updated SADXFontEdit with some new functionality, including support for the Unicode layout, so when you select the correct codepage you can see the matching character next to its ID.

As we know, the US and JP versions don’t support Unicode, so how does this work? The game’s dialog texts, menu prompts etc. were compiled into the game as strings encoded with the Korean codepage 949, not Unicode. However, when the game processes text data to create a subtitle texture, it parses the characters and assigns them Unicode IDs to be used to pick graphics from the font data you see in the screenshots above.

This was where I ran into an issue I didn’t understand at first. When I first ran the game, it would either display garbage text in place of subtitles, or just crash. That was how I found out that the Korean version required the system locale (language for non-Unicode programs) to be set to Korean for subtitles to render properly.

If the game already knows it’s converting Korean to Unicode, why does it need that? Eventually I found the answer when I was looking at the game’s font related functions in the disassembly that I quickly cobbled together. The Korean version uses the function MultiByteToWideChar to convert “C strings” (in this case Korean strings in the local codepage) to UTF-16 “wide strings”. It’s an interesting solution considering that other versions have a custom function to parse characters and assign font IDs to them.

So why does it fail when the system locale isn’t set to Korean? The developers call the function with the default first argument (0), which takes the current system locale as the source codepage. As a result, Korean text is converted to Unicode as if its original codepage is whatever you have set as the language for non-Unicode programs. If the developers of the Korean version set the first argument of MultiByteToWideChar to 949, the Korean version would display subtitles correctly on any system regardless of the locale. I think a lot of people would’ve never caught this issue because the game was meant to be sold only in Korea. Anyway, we can fix this on the mod’s side.

Implementing code differences

With such changes to the font system, simply replacing FONTDATA0.BIN in a mod wouldn’t make the game support Korean, and a bunch of hacks had to be done first. One thing to do was to introduce calls to MultiByteToWideChar before letting the game parse text data. As I didn’t know the stuff I explained in the previous paragraphs, it took me a while to realize the importance of these calls, and my initial attempt to get the game to display Korean text correctly were unsuccessful. I gave up on the mod for a while, and it was only this month that I gave it another try and figured it out. Another necessary change was in the function that maps character IDs to bitmap data in the font file. There were overrides for , and , but other than that it was pretty straightforward.

I put together a DLL mod that replaces three text-related functions, then I replaced one Japanese hint message in Emerald Coast to test it. The Mod Loader used a hardcoded codepage for strings that are normally in Japanese, so I added global codepage overrides for all languages, which can now be used by other mods.

At first I wasn’t sure how far I could go with this, but when I finally saw the Mod Loader display Korean text, making a Korean mod started looking feasible. I was also driven by the technical challenge and the uniqueness of this version of the game, support for which required several changes to our tools, which I was happy to implement.

Extracting and importing Korean text

Speaking of technical challenges, obviously I had to somehow extract all Korean text from the game and put it into the mod. Finding it all manually was out of the question, which was part of the reason I gave up on the mod last time. However, after my experience with matching assets between different versions of the game, I was tempted by the idea of automatic splitting. Since the game still has English text, it’s possible to scan the EXE to find it, and then work up the structures to get to the start of each item. There were three types of data that had the largest amount of text: cutscene text, Tikal hints and multi-language strings such as character unlock messages, menu prompts etc. I put together a program to make the task easier. Basically it created an INI file for SA Tools’ split tool to extract the text from the Korean EXE. Of course some manual tweaks were required to ensure all addresses were correct, but the program did most of the tedious work. Cutscene text in particular required almost no touch-ups because I made it verify the text in other languages to ensure it’s the same entry in both games.

Building a mod from this data in SA Tools was a challenge. I had to add custom codepage support and fix a few bugs, but mod building in the tools is more stable now and the end result was worth it.

At this point I ran into an issue many retranslation mods had to deal with. There was some text in the game that wasn’t supported by the Mod Loader and/or the SA Tools at the time. It’s still possible to replace such text in a DLL mod, but I wanted all text replacement to be done via the Mod Loader’s INI-based system, so I had to do some work on the tools again. I added support for the following data types, which can now be replaced in mods without code:

  • Tikal hints that show up after you die on a boss. These are different from the hints you see in stages, and they’re stored in different ways depending on the boss, so I had to improvise a bit to make them rippable in the tools and replaceable in the Mod Loader.
  • Mission descriptions for Mission Mode.
  • Mission Mode tutorial text.
  • Single language strings, such as unlock prompts for Game Gear games or Metal Sonic. I added them to the SA Tools a couple years ago but not to the Mod Loader.
  • Multi-language strings, such as character unlock messages or “Welcome to Twinkle Circuit!”. Same as above.

Implementing Chao texts

With all that in place, all Korean text in the game was finally transferred. There was one big obstacle remaining: Chao texts. Although it loads the same font data, the Chao text system in SADX uses completely different code from the system used by subtitles and menu prompts, probably because it was copied from SA2B and duct taped with the SADX font system. So I had to do the same thing I did for the subtitles for the Chao text functions. This was probably the most difficult part of the whole mod. The functions involved with SA2B text were all difficult to hook, and even when I managed to replace them correctly I would only get crashes. It took me a long time to get a working decompilation of the functions that convert strings for the SA2B system. I’d like to thank Kell for a decompilation of these functions in the US version, which I used for reference.

Interestingly enough, the Chao system also uses wide strings internally, but all text is stored in the Japanese codepage, or Korean in this case. The game performs conversion from C strings to wide strings just the same, but the Korean version uses MultiByteToWideChar again instead of the simple parsing function used for Japanese in the original version.

After many hours of debugging I finally figured out the error in my decompiled code that was related to finding character data. In the pseudocode I got by decompiling the Korean version, the cell ID of the character data in the font was calculated by adding 0x776A to the character ID, which made it go out of range. The sign had to be flipped to make it subtract 0x8896 instead. After I fixed that, the text started working.

Now the mod was ready for testing. Out of curiosity I tried it with Dreamcast Conversion and realized that the Dreamcast Chao Garden hints were missing. Luckily they were translated in the Korean version, so I added them to SA Tools, made some changes to DC Conversion to make it more compatible with mods that replace them, and reimported the translated hints. I was happy that even the normally unused Dreamcast hints were translated.

Mod download, compatibility and conclusion

SA Mod Manager 1-click install
Manual download

The mod is compatible with Dreamcast Conversion, but with a few quirks. Since there are no Dreamcast menu textures in Korean, Dreamcast Conversion’s replacement of some GUI textures will be undone by this mod. This is a quick fix, and I might update it with proper compatibility eventually. There may be bugs in the mod, particularly crashes. Please send me crash dumps if you run into any.

For obvious reasons HD GUI is incompatible. If you’re interested in making HD Korean textures and an HD Korean subtitle font, please let me know.

This is the first translation mod that works by replacing the Japanese font, and the first to modify font-related code. I hope this release attracts more Korean players to SADX modding and helps other translation mods. I also think it’s truly amazing that after all these years of research and reverse engineering there are still new things about this game waiting to be discovered.

The mod’s source code is located here.