These are amazing. Awesome work. I'm guessing once you've worked out the flow control, you could generate the source in any format? e.g. original SCI vs. SCIStudio vs. Java-ish vs. <other language here>, etc.? - There's a lot of switch statements in there, isn't there? It seems like a lot of the scripts were based around that and state changes.
Yeah, it's fairly straightforward to generate in any format. I currently have code that outputs the underlying code structure in the 3 formats you mentioned, but I'm just focusing on the SCIStudio thing for now. And of course, recompiling it only works in SCIStudio-format now too. I'd do have a syntax parser for the java/c# style syntax - and it was mostly working - but I haven't picked up that code in a long time. In the end, I don't think java/c# is a great fit for SCI code, given the message-passing stuff that exists even down at the byte-code level.
As for "original SCI" syntax, that's on my radar, but isn't an immediate goal. It's similar enough to current SCIStudio syntax that writing the syntax parser might only be a few days work though. Although I'm not sure if having another "esoteric" language to code these games in is a good idea? I'd also like to have a firmer grasp on the exact syntax before bothering to get that working. And I'm not sure we will ever know...
Then again, the decompiled code might have to break a bit from SCIStudio syntax, and "original SCI" syntax could be a good way to formalize/clarify that break. One pretty frequent thing I see in the decompiled scripts is switch statements embedded in other expressions (for instance, passed as a parameter value to a function). SCI Studio doesn't handle these properly (to be fair, nor did SCI Companion prior to my latest updates), and the results crash the interpreter. It would be a bunch of extra work to restructure the code so that it is in a form that plays well with SCI Studio.
Another problem is with compound conditions (nested ands/ors). SCI Studio ignores any attempt to enforce a certain order of operations with parentheses. It basically just ignores parentheses (and so SCI Companion does this to right now, to ensure compatibility). But my decompiler generates compound conditions that need proper nesting. The only way to get the identical logic with SCI Studio syntax is to break things into multiple if statements, and I'm not sure whether I really want to bother with that extra work.
It is possible, and maybe even probable, that it wasn't updated as often and got out of sync sometimes, particularly I'm guessing when the same game is released on a newer interpreter version.
Yeah, vocab.999 isn't reliable (it's also missing from many games). For support for writing SCI1.1 games, I figure I'll finalize on a specific interpreter version (probably SQ5 or LSL6), and hardcode the set of kernels that work with that interpreter.