Let me know if you're interested in trying out a build of Companion that includes a bunch of decompiler fixes. I've been slowly plugging away at decompiler bugs - mainly the insidious ones that silently produce code that is incorrect. So that the "dream" of being able to "recompile all" and expect it to work perfectly is closer...
It's not quite there yet, but I've been able to decompile Laura Bow 1, and recompile all scripts (correcting a few errors that the decompiler can't possibly make sense of, like missing scripts), and it works well enough to to get through all the intro stuff, and walk around a few rooms and talk to people. I just tried QFG1, and there are still about 4 compile errors I get that I should be able to get rid of with a little more decompiler/compiler work.
Yeah, I'd be interested in that. When you compile LB1, are you able to watch the Intro? When I tried removing the Copy Protection (and replacing it with QFG1-style "Piracy hurts" dialog) I suddenly wasn't able to view the Intro no matter if I clicked yes or no.
Speaking of compiling QFG1, I hadn't done that before... I was just happily replacing global variable names and public procedures. When I tried to do that yesterday, I wasn't able to compile at all, and it
felt like the biggest reason was because the new names had become decync'd with the .sco file. Actually, speaking of your Manage Decompilation window says:
Decompiling a script will also generate a .sco file. The .sco file tracks procedure and variable names which are not present in the compiled script. By default they are given names such as "local4"
You may edit the names to make them more meaningful, and they will be picked up the next time you decompile the script.
How do you edit the names? Or does that mean I just edit the .sc file and if I click decompile again, it will read in those names and use them? That seems counter-intuitive to "decompile" when I've already got source code... Any way to edit the sco file directly? i.e. is there any documentation on the format?
I'd written q quick'n'dirty program to the more tedious editing... things like renaming script files and updating all
use references to it... or doing global search/replace (with warnings if the new string already exists), or adding in include keys.sh and include game.sh if they're not already there.
That's a cool project!
Would you be sharing your results when you're done? We could all learn from your work.
Yeah, I don't really have a problem sharing when I'm done (or as I go along). I'm doing it all in a personal git server now (GitBlitGO, it's super easy to get up and running), so I can probably open up access to that to a few more people. I think it might be better not putting it on something like GitHub though... it is technically copyrighted material. I mean, sharing among a small community of people who I'm pretty sure already legally own copies of the games anyway is one thing...
Y'know, speaking of SCICompanion updates, there's a couple fixes (some relatively simple, some maybe not so) for issues I've come across that would greatly improve my workflow... the three big ones:
1) When doing a Compile All, showing the file that is causing an error, not just the line/col nums,
2) being able to middle-click (or wheel-click) on a tab to close it... or at the very least including a Close All option under the Window menu, and
3) having an option to compile as external patch files, rather than automatically rebuilding into resource.000... this one really hurts my source control... I'll compile a script to check I've not made any errors, and it will modify my resource.000 (which is about 2-3 MB in these early SCI0 games, but that whole 2MB gets added to my source control... In theory, it should only add the difference, but I've found difference checking to be spotty with binary files.