User blog:RottenBlock/System 1 Compiliation, Part 1

Short version: part-way through the process now, going to shove a few usability concerns to the front of the line after all so it's going to take just a little longer.

Long Version
I got started by compiling verbs and objects. These go into the file AG00.dat, which is practically plain text and the logical place to start. AG00 begins with 4 ints giving information about the file, but TTSys doesn't seem to use the first and fourth, so I'll probably just kill them. I'm sure the original executibles use them for something, but my changes are already going to make these files incompatible with the original executibles, so TTSys should be my only priority.

TTSys doesn't have any technical problems loading ASCII verbs and objects, but I swiftly discovered that Sys1 uses "full-width" (zenkaku) characters at all times, something I should have guessed at given its total lack of support for ASCII text in message boxes. Thankfully, System 3 added support for half-width (hankaku) characters via extend command Y 240 (ZH in 3.5). I'm going to implement Y 240 universally (even in LV, which otherwise doesn't support Y commands). For the time being, I'll leave zenkaku on, since it will remind me to add Y 240: in the appropriate places in the code once compilation is operational.

The limitation of the verb->object system is evident even here in Little Vampire, the first System game, with several nouns being used as "verbs" simply because the game needed them to show up in an earlier menu. I'm curious what so-called "verbs" like "bracelet" and "telescope" are doing in this list, but only time will tell.

Compilation is half-written (I spent most of my time writing up a parser for calculations), but I've decided to move the compiler from C++ to C# so that I can combine my efforts with SomeLoliCatgirl's tools. It might seem logical to build on top of Sys3Decompiler, but I think it's kind of a dead end. For starters, it doesn't support the .DAT archive format, but more importantly, source code is encoded and stored in an entirely different fashion, and the code itself is wildly different. The shorthand code used to represent calcuations may also be different, which makes me feel better about spending so much time on my own version. Thankfully, ALDExplorer is compatible with .DAT archives and could be used as part of the compile process.

The plan is to build a either gutted variant of ALDExplorer to work as my compiler, or to start my own thing and borrow .DAT related code from ALDExplorer, whatever's direction seems easier after some investigation. Got to include a nice credits screen too, with so much open source sharing going on.

By the way, ALDExplorer itself seems to be able to read and even convert VSP image files for System 3.0, and I'm not yet sure why it's failing on the older (Sys1-2) VSP files. Between SLC and Toshiya, it's probably possible to work out what's going wrong, but tracking down whatever teeny change has shit the bed is going to be a chore. Since images are part of the localization process, I'll get to it eventually, but it's not my first priority.

Code Update
Discovered a few decompile errors in the previous release. Since I have too much clutter to justify a full code release just to fix three typos, I'll describe them in full for anyone who might need them. Firstly, I forgot that older versions of System, even 3.5, do not use ==, but instead =. I made two mistake with $ calls. Firstly, I forgot the prefix "lbl" on the label string. I also forgot to close the command. Toshiya has $ calls followed by a comma for some reason, but this is out of keeping with every other call in the game, so I changed it to a colon for consistency. Might want to investigate this in the future. Fortunately/unfortunately, LV doesn't use them, so I have none to investigate.