Author Topic: Decompilation Archive  (Read 94326 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Re: Decompilation Archive
« Reply #15 on: November 24, 2018, 09:31:01 PM »
So, an SCI01 template game?
Brass Lantern Prop Competition

Online EricOakford

Re: Decompilation Archive
« Reply #16 on: December 10, 2018, 11:06:29 PM »
Here is my work on QFG1VGA.

With the exceptions of a few scripts, everything seems to compile okay. I even enabled the hidden "Where to, Hero?" dialog at startup, so you can test each individual room!

I was thinking of doing a patch that would fix various script bugs in the game, and restore some unused messages and interactivity. This source could work well as the basis.

This code is best compiled without any SCR and HEP patch files in the directory, so you can be sure that the game only uses the RESOURCE files. The scripts, of course, were decompiled from the patches to ensure that all official bug fixes are present.

Here is the compile log:
Code: [Select]
Error: (WizardGame.sc) Duplicate label 'code_0448'  Line: 145, col: 0
Error: (WizardGame.sc) Duplicate label 'code_0453'  Line: 152, col: 0
Error: (inputBox.sc) Undeclared identifier '--UNKNOWN-PROP-NAME--' .  Line: 1281, col: 32
Error: (egoFight.sc) Undeclared identifier '--UNKNOWN-PROP-NAME--' .  Line: 332, col: 32
252 scripts compiled.
--------------------------------
Time elapsed: 7.56 seconds.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Online EricOakford

Re: Decompilation Archive
« Reply #17 on: December 14, 2018, 09:52:30 PM »
Here we go again, my new and improved decompile of QFG2! This time, I used 1.105 from the QFG Anthology, to be sure that I had the latest code. The only difference I could see is that the import patch was integrated into the resource files. The game seems to compile and run okay, but going into the actual game, it freezes when attempting to enter the maze of alleys! This might be a tough one for us to crack, but thankfully, "suck blue frog" and the EGA 1990 Christmas interpreter's internal debugger are there to help us.
Credit goes to Omer Mor for unearthing the original import and export scripts for the game. This helped me identify quite a bit of the original defines for the game, and the export script even has the original "saveHero" (which SCI Companion can't decompile).
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Online EricOakford

Re: Decompilation Archive
« Reply #18 on: January 14, 2019, 09:27:07 PM »
Here is a decompile of the Slater and Charlie demo. Surprisingly, it has nearly all of the system scripts! Which is odd, since it's a demo version of an interactive storybook, and would have no use for all of them. So I nabbed the original system scripts from the SCI16 archive, adapted them for Companion, and compiled them. Everything seems to work okay.

The only script I couldn't adapt for Companion was SMOOPER, since it frequently uses equational defines, which Companion doesn't support.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline Collector

Re: Decompilation Archive
« Reply #19 on: January 14, 2019, 10:18:48 PM »
The only script I couldn't adapt for Companion was SMOOPER, since it frequently uses equational defines, which Companion doesn't support.

Perhaps make a mention of this in the Companion thread for Phil?
KQII Remake Pic

Online EricOakford

Re: Decompilation Archive
« Reply #20 on: January 27, 2019, 05:42:20 PM »
Here are decompiles of the demos for SQ1VGA, PQ3, Conquests of the Longbow, and Ms. Astro Chicken. They seem to be good stock for a possible SCI1.0 template. Ms. Astro Chicken's main script even seems to have been largely taken from the full floppy version of SQ4!
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline MusicallyInspired

Re: Decompilation Archive
« Reply #21 on: January 27, 2019, 10:37:24 PM »
Somewhat off-topic possibly, but I decided to look for the text in SQ4EGA (the alternate floppy version) that gives different text dialogue for the Monochrome Bikers on your appearance whether you're playing with the EGA, CGA, or Hercules Monochrome drivers. Strangely, while the VGA floppy version lists the text in the Display kernel function as strings right in the script (620), in the EGA version the string doesn't appear at all and just shows up as "LOOKUP_ERROR". Now, I haven't searched through all the TEXT resources yes to find the actual line if it wasn't a string like in the VGA floppy version, and I couldn't find if LOOKUP_ERROR was a mislabeled variable for a TEXT resource (it didn't seem to be defined in the 620 script), or if it's some kind of error that Companion returns on trying to decompile. Now, the fact that in the VGA floppy version it's a fixed string (not included in any TEXT resources, from what I can tell) and that in the EGA version it's possibly some kind of variable makes sense because it's based on what driver you're running.

Any ideas on how to find these text strings?
Brass Lantern Prop Competition

Offline Kawa

Re: Decompilation Archive
« Reply #22 on: January 28, 2019, 03:47:27 AM »
Decompilation error. The text is in the scripts like in the VGA version but it messes up. It's there in the script's string pool. The logic goes like this:
Code: [Select]
register 1:
  global105 > 16: "Well, lookee here! If it ain't Mister Look-at-me-I'm-in-VGA."
  else: "Well, lookee here! If it ain't Mister Look-at-me-I'm-in-EGA."
register 2: "Whatsamatter, monochrome not good enough for you?"
register 3:
  global105 > 16: "What's dis? 256 colors all for one little bitmapped WIMP?! Whatta waste of VGA. Har, har!"
  else: "What's dis? 16 colors all for one little bitmapped WIMP?! Whatta waste of EGA. Har, har!"
Even though by all means the EGA version should never have global105 be higher than 16.

Online EricOakford

Re: Decompilation Archive
« Reply #23 on: March 22, 2019, 08:45:32 PM »
And here we go again! A decompile of the Freddy Pharkas floppy demo! Everything compiles without error, and the game has been tested to completion  without any problems that I could see.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Online EricOakford

Re: Decompilation Archive
« Reply #24 on: March 28, 2019, 08:33:59 PM »
Can't seem to stop... here are decompiles of both the demo and full game of the other SCI01 game, KQ1SCI!

Both compile without errors, and have been tested to completion.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline MusicallyInspired

Re: Decompilation Archive
« Reply #25 on: March 29, 2019, 09:18:37 AM »
Excellent.
Brass Lantern Prop Competition

Online EricOakford

Re: Decompilation Archive
« Reply #26 on: April 07, 2019, 07:57:35 PM »
Okay, here are some new decompiles for the QFG2 demo and Seasoned Professional. I have managed to put together a list of DoSound defines in the KERNEL.SH file that correspond to those games specifically. I'll have to implement those in the SCI01 template soon.

Also, Seasoned Professional has no VOCAB.900 file, making Companion crash when it attempts to decompile the User script. The required file is included in the archive, taken from the QFG2 demo.

4/9/2019 UPDATE: And here are new decompiles for Ms. Astro Chicken and the PQ3 demo! The DoSound defines closely match that of SCI1.1, so the only thing I really need to do is change them to Sierra's original names in the SCI1.0 template.
« Last Edit: April 09, 2019, 11:36:04 AM by EricOakford »
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Online EricOakford

Re: Decompilation Archive
« Reply #27 on: April 27, 2019, 07:43:48 PM »
And here are decompiles of the Codename Iceman and Hero's Quest demos!
The tricky part here was that important VOCAB files were missing. Iceman had the Vocab.999 file (kernel function list), so that was used in both decompiles. Neither had the VOCAB.997 (selector list), so I had to use the one from the SCI0 version of Mixed-Up Mother Goose, which uses the same interpreter version (0.000.685, which is also the newest SCI0 interpreter).

With the exception of the DiceRm script, everything compiles and plays with no obvious issues.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline Charles

Re: Decompilation Archive
« Reply #28 on: May 06, 2019, 01:17:49 PM »
I've done a bit of touch-up work on Eric's excellent QFG1EGA src (v3).  A lot of minor changes:
  • replaced all view reference numbers with defines
  • replaced all OnControl and IllegalBits with defines
  • replaced all EncRoom::entrances with defines
  • replaced some StudioScript constants with SSCI constante (evKEYBOARD->keyDown, evJOYSTICK->direction)
  • gave names to all default global variables
  • renamed gCast, gRegions, gSounds, etc to their original SSCI names
  • fixed the (= controls controls) bug I mentioned in another thread
  • converted FLAGS to enum instead of individual defines
  • converted all Btst, Bclr, Bset flags to use the enum constant instead of a number. If I didn't know what the flag did, i named it FLAG_#, to make it easier to search for and trace later
  • added comments describing how the TrySkill and SkillUsed functions work
  • added defines for certain hardcoded values, like Ogre, kobold, Brutus Max HP; and the skill level needed to solve certain puzzles
  • I think that's the gist of it, but there were many little touches here and there so I may have missed mentioning something

It compiles, and I've done a quick play-through of a couple rooms without noticing any problems, but I haven't done an extensive start-to-finish run yet.

Offline Charles

Re: Decompilation Archive
« Reply #29 on: May 22, 2019, 01:59:35 PM »
Made some more improvements:
  • fixed two incorrect decompilation lines in rm171 (arenaBearChange)
  • split game.sh into multiple headers
  • manually decompiled Main.sc::EgoDead asm into Sierra Script (script 0)
  • manually decompiled BoxSelector.sc::chAlloc::init asm into Sierra Script (script 203)
  • manually decompiled TargetRange.sc::rm73::init asm into Sierra Script (script 73)

edit: fixed a variable name I copy/pasted incorrectly in arenaBearChange.sc, and fixed a long-standing bug in RandomEncounter.sc, where escaping from a fight sets Ego to Walk instead of Run.
« Last Edit: May 24, 2019, 01:22:50 PM by Charles »


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.061 seconds with 23 queries.