Author Topic: Recreating complete QFG1 EGA source code  (Read 49242 times)

0 Members and 1 Guest are viewing this topic.

Offline Collector

Re: Recreating complete QFG1 EGA source code
« Reply #75 on: October 10, 2018, 10:01:29 AM »
I assume that S.old.114 has support for fonts with diacritics.
KQII Remake Pic

Offline Kawa

Re: Recreating complete QFG1 EGA source code
« Reply #76 on: October 10, 2018, 11:24:53 AM »
It's funny you should say that. The 0.685 terp from SQ3 doesn't, yet not 24 hours ago I produced this screenshot?


That's KQ4 1988, SIERRA.EXE 0.274 with the green buttons, not 1989 SCIV.EXE 0.502 with the white buttons.

This is my 1252 font, but that makes no difference in the matter of i]support[/i].

Actually, I think I get what I did wrong just now when I tested SQ3's 0.685 for extended font support...

Edit: nope, still won't show 'em. Weird, huh?
« Last Edit: October 10, 2018, 11:28:05 AM by Kawa »

Offline lskovlun

Re: Recreating complete QFG1 EGA source code
« Reply #77 on: October 10, 2018, 05:06:25 PM »
Well, one difference between SCI0 and SCI01 is the encoding of the vocab resource. The latter uses a standard NUL terminator, the former sets the high bit on the last character. Which means that you can't have 8-bit stuff in the vocab resource at least. It's possible they thought they weren't quite ethnocentric enough in their font decoding and changed it.

Offline Kawa

Re: Recreating complete QFG1 EGA source code
« Reply #78 on: October 10, 2018, 05:15:47 PM »
And yet that's the chronologically first SCI0 game correctly asking for lööps :D

Offline Collector

Re: Recreating complete QFG1 EGA source code
« Reply #79 on: October 11, 2018, 02:44:10 PM »
I have added your SQ3 source to the Wiki. Didn't troflip successfully decompile SQ4 CD for the SCI1.1 template?
KQII Remake Pic

Offline Kawa

Re: Recreating complete QFG1 EGA source code
« Reply #80 on: October 11, 2018, 03:01:49 PM »
SQ5 actually. Older releases included leftover object files like Droole.sco, and had SQ5 Roger and UI views and all that.

I should know :)

Offline Collector

Re: Recreating complete QFG1 EGA source code
« Reply #81 on: October 11, 2018, 07:34:47 PM »
That's it. Now I remember about the simulator at the beginning of the game came up. I wonder if he has the source intact before it was modified for the template or if we would need to decompile it again.
KQII Remake Pic

Offline lskovlun

Re: Recreating complete QFG1 EGA source code
« Reply #82 on: October 27, 2018, 08:05:40 PM »
The S.old.xxx series is SCI01. The KQ1 remake used one; it was playable for quite a while under FreeSCI back when it had no support for the newer memory model. We can't know for sure, but it's possible that these games were developed initially under SCI0 and gradually upgraded, so that only a few rooms take advantage of the extra memory.

We saw the same thing with the QFG4, GK1 and PQ4 demos, which are SCI1.1 unlike the final games. With these it is less likely that the whole game was developed under SCI1.1 initially. While Sierra took some pains to make the high-level interfaces compatible, the graphics systems underneath are entirely different. It still could be true, though.

Offline EricOakford

Re: Recreating complete QFG1 EGA source code
« Reply #83 on: November 01, 2018, 10:22:27 PM »
After weeks of combing the code and identifying many local variables, I now have the decompiled source code for QFG1EGA, version 1.200! Obviously, some things were changed between 1.200 and 1.000, so I overhauled the game.sh file to reflect this, as well as gave more readable names for the event flags and shorter, more concise names for the inventory items.

I made sure to put as much of the comments from the HQ1 code into the QFG1EGA code. The names of some of the variables and procedures were changed, either to be consistent with Sierra's original names (such as Bclr and Btst) or to be more accurate (HasLockPickTools has been changed to CanPickLocks, for example)

The code compiles without any errors (save for warnings about duplicate case values, which are in the original scripts anyway). I have not yet played through the game to see if anything went awry.

11/3/2018 EDIT: Apparently, something DID go awry - the menu bar stopped working (because I removed the "The" from the menu bar class name by mistake) and the stats on the character sheet are over black boxes (the HQ1 code had that mistake by using the wrong define) Here's the new code with these mistakes fixed. Sorry for the inconvenience.
« Last Edit: November 03, 2018, 09:04:59 PM by EricOakford »
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline Kawa

Re: Recreating complete QFG1 EGA source code
« Reply #84 on: November 01, 2018, 10:34:27 PM »
either to be consistent with Sierra's original names (such as Bclr and Btst)
I'm curious. How exactly do you know that's what they're supposed to be called?

Offline EricOakford

Re: Recreating complete QFG1 EGA source code
« Reply #85 on: November 01, 2018, 11:53:00 PM »
The original names are based on the code snippets that OmerMor provided previously. Also, in the Main.sc of the HQ1 source zip, it is stated that Bclr and Btst are their original names.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline Kawa

Re: Recreating complete QFG1 EGA source code
« Reply #86 on: November 02, 2018, 08:56:10 AM »
It's just, SCI16.zip doesn't have a main.sc, last I checked.

Offline Charles

Re: Recreating complete QFG1 EGA source code
« Reply #87 on: November 02, 2018, 12:11:59 PM »
He means in the main.sc of the decompiled HQ1 v1.000 source I did.  I'd commented that they were originally called Bclr and Btst.  My comments were based on OmerMor's code snippets, so it's just a single source confirmation.

That's awesome work Eric, I'm looking forward to comparing the differences between HQ1 v1.000 and QFG1 v1.200.

When you do get to test the game, give a look at Henry's Outlook. I know I had decompiler issues with that room, when I did HQ1 v1.000.

Offline Kawa

Re: Recreating complete QFG1 EGA source code
« Reply #88 on: November 02, 2018, 01:53:28 PM »
So I ask again, what snippets?

Offline Charles

Re: Recreating complete QFG1 EGA source code
« Reply #89 on: November 02, 2018, 08:48:43 PM »
Thanks for the update - very interesting!

Btst and Bclr are used in many SCI games, and it's not limited to event flags, so you if you don't like the original names, you might want to use bitTest and bitClear etc. Names like getEventFlag is too specific.
EDIT: So I noticed that these functions are actually tied to a specific global flags array. Here's the version from QfG2:
Code: [Select]
(procedure (Btst flagEnum)
   (& [gameFlags (/ flagEnum 16)] (>> $8000 (mod flagEnum 16)))
;; (DisposeScript FLAGS)
)

(procedure (Bset flagEnum  &tmp oldState)
   (= oldState (Btst flagEnum))
   (|= [gameFlags (/ flagEnum 16)] (>> $8000 (mod flagEnum 16)))
   oldState
;; (DisposeScript FLAGS)
)

(procedure (Bclr flagEnum  &tmp oldState)
   (= oldState (Btst flagEnum))
   (&= [gameFlags (/ flagEnum 16)] (~ (>> $8000 (mod flagEnum 16))))
   oldState
;; (DisposeScript FLAGS)
)

From OmerMor on the 1st page of this very thread.


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

Page created in 0.039 seconds with 23 queries.