Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - NewRisingSun

Pages: 1 2 3 [4]
46
AGI Community How To's & Tutorials / Re: Official AGI Documentation
« on: October 15, 2016, 04:30:42 PM »
I would say that any 2-D game development system would need to include:
  • Something to edit or convert graphics, including backgrounds and sprites
  • Something to edit or convert music and sound effects
  • Something to edit or convert/assemble/compile game logic
  • Something for the end user to play the finished game
In the case of the "Adventure Game Development System", there's the "Picture Editor" and "Object Editor" for 1., the "Sound Editor" for 2., "CG - the game compiler" for 3., and "AGI", the "Adventure Game Interpreter" for 4. Therefore, the whole thing is the AGDS, and AGI is Part 4 of it.  ;D

47
I have sorted the various fragments of the source code found in the unused sectors of my Space Quest II Version 2.0D 720K into separate files based on what the first line comment said. It's not a complete interpreter source, obviously, but I found it enlightening that the PS/2 models 25 and 30 with their MCGA graphics adapter apparently caused Sierra much trouble (see EQUIPCHK.ASM).

48
Just so you know what I mean by non-standard stack frames: The standard calling convention in all major programming languages for calling a procedure like this:
Code: [Select]
void someProc(1234, 5678)is something like this:
Code: [Select]
caller:
    (... caller doing something)
    MOV AX, 5678
    PUSH AX
    MOV AX, 1234
    PUSH AX
    CALL someProc
    ADD SP, 4
    (... caller doing something else)
someProc:
    PUSH BP
    MOV BP, SP
    MOV AX, [BP+4] ; get arg 1
    MOV DX, [BP+6] ; get arg 2
    (... someProc doing something with the args)
    POP BP
    RET
The Pascal and C calling conventions differ in whether the arguments are pushed onto the stack from left to right, or from right to left, and whether the caller cleans up the stack (as I did with ADD SP, 4) or the callee as part of the RET instruction. King's Quest 1 however does something like this:
Code: [Select]
caller:
    (... caller doing something)
    PUSH BP
    MOV BP, SP
    MOV AX, 5678
    PUSH AX
    MOV AX, 1234
    PUSH AX
    CALL someProc
    MOV SP, BP
    POP BP
    (... caller doing something else)
someProc:
    MOV AX, [BP-2]
    MOV DX, [BP-4]
    (... someProc doing something with the args)
    RET
In other words, the caller sets up the stack frame, rather than the callee. I have never seen any compiler using such a strange calling convention. Obviously, IDA gets confused by this, thinking that BP-4 is a local variable of someProc (which it would be in any normal calling convention), and it makes my head spin as well. Add to that such niceties as one procedure being placed in the middle of another, unrelated, procedure for no apparent reason, with the "outer" procedure JMPing around the "inner" procedure, and you will understand why I cannot go on for longer than 30 minutes at a time. :)

49
I'm being slowed down by the original KQ1's nonstandard way of setting up stack frames (for passing parameters to functions and for local variables) that makes it difficult to see what's going on. So don't expect anything this or next month.

50
Okay, but given that the "I" in "AGI" stands for "interpreter", I would have expected that the minimum standard for anything to be considered substantially similar to it would be to also have a virtual machine with a similar set of opcodes or at least a similar architecture, not just a few library routines. Otherwise Stellar 7 and Silpheed would be similar to King's Quest IV, since the music routines are almost the same. :)

51
Mickey's Space Adventure and Winnie the Pooh in the Hundred Acre Wood are not booters, at least not originally. If you wanted the disks to boot, you would have to transfer DOS onto the floppy disks yourself, which the previous owner of your copy may well have done. Troll's Tale could self-boot but also run from DOS, although there is no means of exiting the game. Self-booting King's Quest has a MAIN.EXE file but does not run under DOS because it assumes to be loaded at a fixed memory location.
Quote from: lskovlun
ScummVM supports PreAGI through the AGI engine which suggests some shared characteristics,
Might be due to oddball modularization choices. Would not be the first time. I certainly will not assume any similarity just because the ScummVM people choose to call it "Pre-AGI".

I have disassemblies of Mickey's Space Adventure and Winnie the Pooh in the Hundred Acre Wood right here, and the only characteristic that vaguely resembles AGI is some code for drawing a picture using vector commands, and the Tandy 3-voice sound routine in the case of Winnie, which is functionally identical and uses the same music files as AGI version 1.x.

52
I've lost sight of the various alpha versions flying around, but I'm using the SCICompanion.exe dated July 20th 2016. When recompiling the decompiled script 998 (original name "ACTOR.SC") of SQ1, the following sequence in Actor.setLoop:
Code: [Select]
(method (setLoop param1 &tmp theLooper)
(if
(= theLooper
(cond
((== argc 0) (super setLoop:) 0)
((not (IsObject param1)) (super setLoop: param1 &rest) 0)
((& (param1 -info-?) $8000) (param1 new:))
(else param1)
)
)
(if looper (looper dispose:))
((= looper theLooper) init: self &rest)
is properly decompiled, but after recompilation, it becomes:
Code: [Select]
(method (setLoop param1 &tmp theLooper)
(if
(= theLooper
(cond
((== argc 0) 0)
((not (IsObject param1)) 0)
((& (param1 -info-?) $8000) (param1 new:))
(else param1)
)
)
(if looper (looper dispose:))
((= looper theLooper) init: self &rest)
)
In other words,  the "super setLoop" in the first two conds somehow gets lost, which results in the wrong loops being displayed in SQ1's intro. Right now, I am working around this bug by rewriting the code as
Code: [Select]
(method (setLoop param1 &tmp theLooper)
(cond ((== argc 0) (super setLoop:) (= theLooper 0))
((not (IsObject param1)) (super setLoop: param1 &rest) (= theLooper 0))
((& (param1 -info-?) $8000) (= theLooper (param1 new:)))
(else (= theLooper param1))
)
(if theLooper
(if looper (looper dispose:))
((= looper theLooper) init: self &rest)
)
)
The other problem I had was that "Replace all" sometimes would never finish. The last issue is more of a small quibble: When recompiling an existing script that I opened by double-clicking on the resource in the Explorer, the selection in the Explorer is reset to the start after compiling. I understand that recompiling causes the list to be refreshed, but it would be great if the selection could stay on the resource on which it was before the list is refreshed.  Otherwise, SCI Companion works great for me.

If I may request an additional feature: the ability to produce a RESOURCE.TXT file from an existing set of RESOURCE.* packages, so I can use it with Sierra's MAKEVOLS to repackage a changed game with compression. This could be implemented as an option in the "Extract all resources" window. I have, more or less manually, written a file for SQ1 that MAKEVOLS will accept and yields identical RESOURCE.* files to the released game when fed with extracted unmodified resources.

53
I suppose it's a good idea then for me to start commenting and annotating the IDA-produced disassembly I already have. (You might think that a non-annotated disassembly is trivial to produce, but if you have ever tried to recompile/reassemble a disassembly after making changes to it, you know that it's not trivial at all. Because if you fail to assign just one hexadecimal number as a reference to the data segment, or assign it to the wrong segment, or assign a number that is not a reference as if it were a reference, your recompiled executable will be useless.)
Doing so will allow me to study the engine more closely, and compare it both to AGI and to the two Hi-Res Adventure PC ports (Adventure in Serenia and Ulysses and the Golden Fleece). Unless Omer suddenly finds an original source code, that is... ;)

So far, I have only disassembled the "PCjr" disk of the Sierra On-Line release, which seems to be identical to the Radio Shack release in that it runs both on PCjr and Tandy 1000, the only difference to the Radio Shack release being that the latter says "Licensed to Tandy Corp.". I also have the August 1984 PC-CGA release as an original disk and the only IBM release for PCjr ("release" refererring to what's on the disk; I'm aware that there were two kinds of keyboard overlays) as well as the Radio Shack release as disk images. There is an earlier PC release that can be identified in the boot sector saying "BOOT v1.1" rather than "BOOT v1.2", and has "King's Quest" printed in gray rather than in yellow/orange at the side of the box. I don't have that version, so unless someone provides it to me, my annotated source will only cover the differences between the versions I have. One difference I already know of is that the Sierra On-Line PCjr disk, upon "restarting" a game, resets all variables by hand, while the PC-CGA version loads a "startup" saved game from the diskette instead.

54
I feel it needs to be pointed out that contrary to most (even Sierra's) reports, the original self-booting version of King's Quest 1 was not an AGI game, at all. I have used IDA on its executable to produce a source file that can be reassembled with changes, and it's absolutely nothing like AGI. King's Quest 2 was the first AGI game, and even in its 128K self-booting versions is very much like AGI. King's Quest 1 was explicitly ported to AGI in 1986 with the release of its 256K version 1.0U. "Explicitly ported" referring to the fact that the 256K version says "New version" on the title screen.

55
SCI Development Tools / Re: SQ5 preliminary decompiled source
« on: December 22, 2015, 02:38:01 AM »
Quote from: MusicallyInspired
However, apparently in NRS's SQ4 patch he re-enabled the "Time-O-Matic" which is attached to the frog instance. But I can't get it to work...care to take a look at his script with your decompiler?
Quote from: MusicallyInspired
However, I discovered that his patch does not include the Time-O-Matic time warp after all, it was another script written by someone called the "Time Pod Debug patch" available on the archived SQ.Net website.
My patch does include it, but it is disabled by default. To enable my additional debug features, create a file named "DEBUG.FLG" in the game's directory, and start a new game.
Quote from: troflip
It's difficult to change the length of a script if you're just directly editing bytecode, so it makes sense that he had to "replace" one object with another.
For that patch, I was not editing bytecode, but disassembling and reassembling with the ability to change script lengths. Remember that the "room of deleted items" (room 271) had no script at all so I had to write one from scratch, and I could not have done that by directly hacking bytecode into a hex editor.

Pages: 1 2 3 [4]

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

Page created in 0.044 seconds with 20 queries.