User blog:RottenBlock/Little Vampire Decompile, Decompiler

Over the past few days, I've been working with Takeda Toshiya's 32 versions of System 1, 2 and 3 executables, especially to see if I could get it to decompile the source of a sample game, namely, Little Vampire, Alicesoft's oldest and arguably simplest System 1 game. This isn't a dedicated program like Sys3Decompiler, it's literally just the System 1 exe jury-rigged to output the code and then close. Sometimes you'll even hear it play the first note of the music. Note that I haven't completed the key step of actually recompiling the code, which will take a few more days, so at the moment the decompiled source is little more than a curiosity, but once the compiler is working the game will be able to be localized for the first time ever.

The decompiled code is a little strange, but I'm mostly satisfied that the weird elements are either just the peculiarities of the early coding style, or of System's limitations. Every file ends with two calls to open the menu, even though the second will never be reached. Several files, such as page0006, have large, stupidly pointless blocks of code that redirect multiple label jumps to the same source... instead of jumping to the same source in the first place. It's so sloppy that at first I had made a mistake but after some investigation, I think it's from the original! I should probably decompile a few later Sys1 games to see if shows up again, maybe even go so far as to set up the Sys3 decompiler to make sure the problem's not on my side before working on the compiler (Toshiya's Sys2 code seems incomplete, I plan to work at it in reverse by backporting Sys3 features as a jump-start).

Pre-Sys3.5 code has a major obstacle to western localization: until 3.5, text that went to the messsage box was just "anything that wasn't a programming command" (which is absurd), and since the programming commands are just ASCII text, we literally can't use ASCII text without a workaround (and using the incomplete, caps-only Shift-JIS equivalents to Latin text isn't a really viable option). For that reason, I've been adding quotes to output text in the decompile (like any other programming language, including 3.5), and will have to add processing for the quotes on both recompile and execution, after their fashions. The downside to this is that it's going to make the recompiles wholly reliant on my modified version of Toshiya's exe. No going back to PC-98 or Sharp, so god help us if we hit incompatible hardware problems.

Since I want to make sure none of my work is lost, I'm going to be attaching my project files as I go along. I've attached my modified version of Toshiya's sys32src file, the project I've been working on is adv_vampire.sln (not vampire.vcproj). Little Vampire's code can be found in the Decompile folder. To disable the decompiling, you'll need to modify the preprocessor commands. Sorry if that's a lot of overhead, but I have no intention of making the decompile process more user-friendly until it's finished (if ever, as the process relies so heavily on source code modification and variant apps for every possible game), so if you aren't familiar with C++/VS... well, I'm sorry, but for the time being it's unavoidable.

Download