Author Topic: Decompilation Archive  (Read 4008 times)

0 Members and 1 Guest are viewing this topic.

Offline Collector

Decompilation Archive
« on: October 13, 2018, 09:39:47 PM »
Rather than continuing to hijack the QfG1 EGA source thread I thought we could have a separate thread for the decompilation and archiving of the SCI game scripts.

Here is Iceman version 1.023, interpreter 0.000.668. It has two compile errors that I have yet to track down.


KQII Remake Pic

Offline Kawa

Re: Decompilation Archive
« Reply #1 on: October 14, 2018, 03:47:40 AM »
In my own fresh Iceman decompile, I see an --UNKNOWN-PROP-NAME-- in Feature.sc Act::canBeHere. Comparing this against SQ3, that should be ignAct.

The other error is in secondCoordsScript.sc secondCoordsScript::changeState: (13 (checkThrottle active: 1 value: 1 0))
From what I can tell, this should just be value: 1.

Offline lskovlun

Re: Decompilation Archive
« Reply #2 on: October 14, 2018, 07:38:32 AM »
The other error is in secondCoordsScript.sc secondCoordsScript::changeState: (13 (checkThrottle active: 1 value: 1 0))
From what I can tell, this should just be value: 1.
This is a script bug, not a decompilation bug.

Offline Kawa

Re: Decompilation Archive
« Reply #3 on: October 14, 2018, 08:16:04 AM »
This is a script bug, not a decompilation bug.
Considering the PMachine code literally pushes those two values and a parameter count of two, I think I'd agree. Did I say it was a decompilation bug, though?

Code: [Select]
(13
; KAWA -- There was an extra push here making a mess of this case:
; (asm
; pushi #active
; push1
; push1
; pushi #value
; push2
; push1
; push0
; lofsa checkThrottle
; send 14
; )
; correctly decompiles to the uncompilable
; (checkThrottle active: 1 value: 1 0)
(checkThrottle active: 1 value: 1)
)

(Edit to correct asm annotation, had the lofsa and send switched around)
« Last Edit: October 14, 2018, 08:28:09 AM by Kawa »

Offline Kawa

Re: Decompilation Archive
« Reply #4 on: October 14, 2018, 01:40:20 PM »
Here's my take on Iceman, with those two fixes and a bunch of renamed globals and procedures in Main and Print.

Offline Collector

Re: Decompilation Archive
« Reply #5 on: October 14, 2018, 08:03:55 PM »
Added.
KQII Remake Pic

Offline Kawa

Re: Decompilation Archive
« Reply #6 on: October 15, 2018, 05:35:23 PM »
When I recompile KQ1, the remake of course, everything seems to work... until the portcullis is closed and I get handsOn.

Suddenly, Graham turns invisible (cyan outline) and the goat's there, trying to pathfind its way around the portcullis.

It's not one of my hacks that did it either -- I have an unaltered SCI Companion in the archives that ended up with the same thing. And a freshly-unzipped KQ1 doesn't do it either. So that's something to investigate before I bother to upload a copy of KQ1_v1.000.051_intS.old.010_SRC.zip

Offline Collector

Re: Decompilation Archive
« Reply #7 on: October 16, 2018, 06:44:42 PM »
that was the next one I was thinking about.
KQII Remake Pic

Offline Kawa

Re: Decompilation Archive
« Reply #8 on: October 16, 2018, 07:27:26 PM »
Strange minds think alike.

Offline Collector

Re: Decompilation Archive
« Reply #9 on: October 16, 2018, 08:48:39 PM »
Must be.
KQII Remake Pic

Offline EricOakford

Re: Decompilation Archive
« Reply #10 on: October 19, 2018, 12:44:56 PM »
Here is my work on Quest for Glory II v1.102 (from GOG.com). I managed to write up a game.sh file to go with it, which lists all the skills, ego walk modes, and much of the event flags. Thanks go to Charles for the QFG1EGA code (which helped me identify procedures and global variables, and whose game.sh file I based mine off of) and OmerMor for some code snippets he posted previously. The scripts compile fine, with a few exceptions listed below.

Code: [Select]
Error: (CharSheet.sc) The rest modifier must be followed by a parameter name.  Line: 27, col: 9
Error: (CharSheet.sc) The rest modifier must be followed by a parameter name.  Line: 42, col: 9
Warning: (rm130.sc) Duplicate case values. Already encountered a case for '54'  Line: 1003, col: 5
Error: (BoxSelector.sc) The rest modifier must be followed by a parameter name.  Line: 32, col: 9
239 scripts compiled.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1

Offline troflip

Re: Decompilation Archive
« Reply #11 on: October 19, 2018, 01:04:28 PM »
Interesting... that seems like a bug in the compiler, actually. It always assumes &rest is the last thing in a function call (not sure why), or is followed by a parameter name. But I guess this is valid usage.

I wonder how difficult this is to fix...
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline troflip

Re: Decompilation Archive
« Reply #12 on: October 19, 2018, 02:32:11 PM »
To work around it, you can replace
Code: [Select]
(procedure (SomeProc x y)
    (Display &rest #at x y ....)
)

with

Code: [Select]
(procedure (SomeProc x y moreParams)
    (Display &rest moreParams #at x y ....)
)
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline EricOakford

Re: Decompilation Archive
« Reply #13 on: November 15, 2018, 11:01:07 PM »
Here is my work on LSL1VGA. Some tweaks were made to allow the game to compile fully. I played though the entire game with no known issues (except maybe for sometimes freezing when entering the casino, but I think that's an original speed bug)
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1

Offline EricOakford

Re: Decompilation Archive
« Reply #14 on: November 24, 2018, 09:23:44 PM »
And now for something a little different...
Here is decompiled code for the QFG2 demo! So far, everything seems to run fine... up until the Iblis Unleashed scene, where it immediately crashes with an "Oops!" error!

By the way, I've been working on a new EGA template game, using the QFG2 demo as the foundation and the interpreter from the EGA 1990 Christmas Card (it's compatible with QFG2, and still has its internal debugger!). So far, things seem to work okay. I'll upload this template sometime soon.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.098 seconds with 23 queries.