User blog:RottenBlock/Decompiling Alice in Kaeru nyo Land

So the big problem with Alice in Kaeru nyo Land is that its bonus characters are distributed in script ALD files, which are already referenced inside the main script ALD file. The decompiler doesn't know what on earth to do with this "split up" source code.

After trying a few angles, I've managed to get the game to cough up most of its code, but there are still a few functions that need to be linked up and a lot of the bonus characters' code has been transformed into hexidecimal vomit for some reason. I'm optimistic that I can clear up the hexidecimal (mostly if not entirely), but I'm going to have to work out what to do with the functions through educated trial and error (I suspect that most are just calls to display and close on-screen messages).

There's also the problem that once this is done, I don't think I'll be able to split the code up again. Right now I'd be happy to get the game running with bonus characters forced into your party, but theoretically someone could whip up a button to have them join when the player chooses, or to even assign them specific reward conditions as though they were normal characters.

Here are the methods I tried to unify the files before getitng to this point, just in case I have to start over, in case someone else comes by with a similar problem, or whatever.
 * 1) The method that got me this far was to just tell Sys3Decompiler to output an error string every time it came across an error, instead of crashing. This leaves me in the state I'm in (I'm still at a loss about the hex number splurge), but it's better than nothing working at all.
 * 2) ALDExplorer2 can extract SCO files from an ALD file. Theoretically, it might be possible to convince Sys3Decompiler to read in those SCO files to fill blanks, or to work entirely from pre-extracted files. Unfortunately for the former, Sys3Decompiler does all its work by referencing addresses inside the ALD file, and external files wouldn't easily apply. This also applies to the latter, and don't forget that the ALD file has additional info in its header, like the names and addresses of functions, though that's workable by, say, loading the ALD(s) as well as the SCOs.
 * 3) ALDExplorer2 also seems to be able to recognize when ALD files are linked, just like in our example. Aren't these made by the same programmer? Why doesn't Sys3Decompiler do the same? I tried to poke around in ALDExplorer2, but it refused to run from source and I decided to put my prorities elsewhere.
 * 4) Surely there might be a way to inject the ALD files together, once they're decrypted. It'd be tedious as shit but it's probably viable.

What's Next?
On paper, cleaning up the hex numbers.

In practice, I'm probably going back to Mamanyonyo the next time I get to work.

Speaking of Mamanyonyo: friendly unit names are localized, and I added a feature to the Mamanyonyo debug menu to output CHR file text to a text file. It'll be easier to translate that way. I still need to do the same for enemies, Kids, and anything else in a CHR file for that matter.