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
16
Updated my AGI tools (edit: updated again!):
  • Having found out that AGI v2.9xx and above use different note envelopes on the IBM PCjr versus Tandy 1000, AGIsnd2vgm now supports both and allows specifying the desired type on the command line (--pcjrenv vs. --tandyenv).
  • AGIextract now creates text files that can be used to rebuild the VOL files. They are named VOL(number).DRV in the case of AGI v1/2 and (gameId)VOL(number).DRV in the case of AGI v3 games. The name and format has been chosen to be suitable for use with Sierra's MKVOL.
  • AGIdecompile is my new customizable AGI logic decompiler. It requires
    • ..\WORDS.TOK in AGI v2 format. When decompiling an AGI v1 game, take that one file from the respective AGI v2 version of the game you're trying to decompile. This limitation will be removed in a future version. The "../WORDS" file for AGI v1 games, or the "../WORDS.TOK" file for AGI v2 games, which is automatically extracted by AGIextract.
    • GAMEDEFS (that %includes SYSDEFS) in the current directory. Depending on whether you are decompiling an AGI v1 or v2 game, copy template/src/SYSDEFS.v1 or template/src/SYSDEFS.v2 to SYSDEFS.
    Sources are always output to ../src/. AGIdecompile is designed to produce source files that Sierra's CG (of an appropriate version) will compile without complaining. This implies that messages have to be put separately and referenced by number, rather than being specified in-line the way AGI Studio uses them. Whenever AGIdecompile outputs a GOTO, it adds a comment to explain why it resolved the FE jump instruction as a GOTO instead of another ELSE brace. Since AGIdecompile itself does not know which interpreter version to decompile for (it's all defined in SYSDEFS), for AGI v1, variables and flags should be specified with identical names in GAMEDEFS/SYSDEFS. SYSDEFS.v1 now defines all commands in such a way that there are only flags, not variables.
I have successfuly extracted, decompiled, then recompiled and repackaged the game PC KQ2 v2.2. The source codes of these utilities have become a bit messy. I will clean them up (possibly rewrite in C++?) once I know what the final functionality will be and once more knowledge about AGIv1 in particular has been acquired.

17
AGI Development Tools / Re: Pre-AGI2 versions
« on: November 06, 2016, 06:12:27 PM »
From PC KQ2 v1.0W's interpreter:
Code: [Select]
%action assignn(VAR,NUM) 3
CS:0269
mov bx, si
inc si
mov al, [bx]
sub ah, ah
mov [bp-2], ax
mov bx, si
inc si
mov al, [bx]
mov [bp-18], ax
mov bx, [bp-2]
mov al, [bp-18]
mov [bx+0025], al
jmp 0215
%action set(FLAG) 60
CS:0A50:
mov bx, si
inc si
mov al, [bx]
sub ah, ah
mov bx, ax
mov byte ptr [bx+0025], 1
jmp 0215
The BX+0025 is the array on which both "assignn" and "set" operate. This indicates that variables and flags really are identical. Good job spotting that. I debugged that interpreter before but did not notice that the commands operated on the same array.

18
AGI Development Tools / Re: Pre-AGI2 versions
« on: November 05, 2016, 07:44:57 AM »
I'll post my customizable AGI decompiler later, which may be useful to you. Customizable as in allowing (and requiring) you to supply a SYSDEFS file that specifies all action and test commands with parameters. I spent the last few days finding and fixing all edge cases of resolving implicit GOTOs into ELSE block, and keeping them as GOTOs where they cannot be resolved. To do this, I studied rm14 of Donald Duck's Playground --- the dreaded payroll room --- extensively.

I would also like to support Apple II disk images, but am hesitant because it seems that the locations of the various directories are hard-coded somewhere inside the machine code. At least I could not find something similar to the INITDIR that the PC v1.x AGI games have in track 0, sector 9.

19
AGI Development Tools / Re: Pre-AGI2 versions
« on: November 04, 2016, 08:18:28 PM »
I have debugged the PC interpreters of both KQ2 v1.1H (no interpreter version number) and BC v1.1M (interpreter v1.12) and compared my disassembly with that of later game versions. There are a few quite unique commands such as bit test/set/clear commands and the mysterious (tentatively named) "distance.to.water", which seems to only exist in that one interpreter version.
Code: [Select]
%test equaln(VAR,NUM) 1
%test equalv(VAR,VAR) 2
%test lessn(VAR,NUM) 3
%test lessv(VAR,VAR) 4
%test greatern(VAR,NUM) 5
%test greaterv(VAR,NUM) 6
%test isset(FLAG) 7
%test has(OBJECT) 8
%test   said(WORD,WORD) 9
%test posn(OBJECT,NUM,NUM,NUM,NUM) 10
%test controller(NUM) 11
%test obj.in.room(OBJECT, VAR) 12
%test   said3(WORD,WORD,WORD) 13
%test have.key() 14
%test   said1(WORD) 15
%test   bit.set(NUM,VAR) 16

%action return() 0
%action increment(VAR) 1
%action decrement(VAR) 2
%action assignn(VAR,NUM) 3
%action assignv(VAR,VAR) 4
%action addn(VAR,NUM) 5
%action addv(VAR,VAR) 6
%action subn(VAR,NUM) 7
%action subv(VAR,VAR) 8
%action load.view(VIEW) 9
%action animate.obj(OBJECT) 10
%action new.room(NUM) 11
%action draw.pic(VAR) 12
%action print(MSGNUM) 13
%action status() 14
%action init.game() 15
%action restore.game() 16
%action init.disk() 17
%action restart.game() 18
%action random(VAR) 19
%action get(OBJECT) 20
%action drop(OBJECT) 21
%action draw(OBJECT) 22
%action erase(OBJECT) 23
%action position(OBJECT,NUM,NUM) 24
%action position.f(OBJECT,VAR,VAR) 25
%action get.posn(OBJECT,VAR,VAR) 26
%action set.cel(OBJECT,NUM) 27
%action set.loop(OBJECT,NUM) 28
%action end.of.loop(OBJECT,FLAG) 29
%action reverse.loop(OBJECT,FLAG) 30
%action move.obj(OBJECT,NUM,NUM,NUM,FLAG) 31
%action set.view(OBJECT,VIEW) 32
%action follow.ego(OBJECT,NUM,FLAG) 33
%action block(NUM,NUM,NUM,NUM) 34
%action unblock() 35
%action ignore.blocks(OBJECT) 36
%action observe.blocks(OBJECT) 37
%action wander(OBJECT) 38
%action reposition(OBJECT,VAR,VAR) 39
%action stop.motion(OBJECT) 40
%action start.motion(OBJECT) 41
%action stop.cycling(OBJECT) 42
%action start.cycling(OBJECT) 43
%action stop.update(OBJECT) 44
%action start.update(OBJECT) 45
%action program.control() 46
%action player.control() 47
%action set.priority(OBJECT,NUM) 48
%action release.priority(OBJECT) 49
%action add.to.pic(VIEW,NUM,NUM,NUM,NUM,NUM) 50
%action set.horizon(NUM) 51
%action ignore.horizon(OBJECT) 52
%action observe.horizon(OBJECT) 53
%action load.logics(NUM) 54
%action object.on.water(OBJECT) 55
%action load.pic(VAR) 56
%action load.sound(NUM) 57
%action sound(NUM,FLAG) 58
%action stop.sound() 59
%action set(FLAG) 60
%action reset(FLAG) 61
%action toggle(FLAG) 62
%action new.room.f(VAR) 63
%action call(NUM) 64
%action quit() 65
%action set.speed(VAR) 66
%action move.obj.f(OBJECT,VAR,VAR,VAR,FLAG) 67
%action get.num(MSGNUM,VAR) 68
%action get.f(VAR) 69
%action lindirectv(VAR, VAR) 70
%action print.flag.value(VAR) 71
%action get.priority(OBJECT,VAR) 72
%action ignore.objs(OBJECT) 73
%action observe.objs(OBJECT) 74
%action distance(OBJECT,OBJECT,VAR) 75
%action object.on.land(OBJECT) 76
%action set.priority.f(OBJECT,VAR) 77
%action show.obj(VIEW) 78
%action load.last.logics(NUM) 79
%action display(NUM,NUM,NUM,MSGNUM) 80
%action prevent.input() 81
%action nop1() 82
%action text.screen.attribute(NUM) 83
%action graphics() 84
%action clear.bottom.lines() 85
%action discard.view(VIEW) 86
%action discard.pic(VAR) 87 [ Last command in KQ2 v1.1H
%action set.key(NUM,FLAG) 88
%action reverse.cycle(OBJECT) 89
%action step.size(OBJECT,VAR) 90
%action last.cel(OBJECT,VAR) 91
%action normal.cycle(OBJECT) 92
%action load.view(VIEW) 93 [ Verified duplicate
%action nop2(NUM) 94
%action distance.to.water(NUM,VAR) 95 [ returns 250 if the distance is too great. Seems to take ego's direction into account as well.
%action set.bit(NUM,VAR) 96
%action clear.bit(NUM,VAR) 97 [ Last command in BC v1.1M

%var current.room 1
%var previous.room 2
%var edge.ego.hit 3
%var score 6

%flag have.input 9
%flag init.log 13
%flag restart.in.progress 15
While there is a call command, logics loaded with load.logics seem to simply get appended to an execution queue, while load.last.logics is guaranteed to be executed last.

From what I can see, Donald Duck's Playground version 1.0Q does justice to its v2.001 interpreter version and seems to decompile well with the regular AGI v2.xxx SYSDEFS.

20
AGI Development Tools / AGI v1 resource extractor and sound converter
« on: November 04, 2016, 02:23:32 AM »
I have written a little extracting utility for AGI v1/v2.001 PC disk images (as well as the usual v2 and v3 volume files), and a converter that converts both GAL, AGI v1 and AGI v2/v3 sound files to VGM format for convenient listening. For later v2 and v3 games, you need to specify the --envelopes2 or --envelopes3 command line option to get the same result as in the games, as AGIsnd2vgm has no way of knowing whether envelopes should be applied (AGI v2.9xx) or not (AGI v2.4xx/v2.272/v2.089), and which shape the envelopes should have. Run AGIsnd2vgm without options or file names to see a list of supported options. The "stuck notes" option can best be seen action in King's Quest II's SND.1, which is the wedding music.

I have noticed that AGI v1 files that were converted by Sierra to v2 format sound faster when played back in the latter format. For example, the music in The Black Cauldron versions 2.0 and 2.10 sounds faster than in v1.1J/K/M. The reason is that the playback routine for the v1 format used the PC's default 18.2 MHz timer, while AGI v2 uses a 60 Hz timer, and Sierra's CNVRTSND.EXE multiplies all time values only by three instead of the correct 3.2967. CNVRTSND.EXE is Sierra's utility to convert v1 to v2 format files and what accidently included on the Space Quest I version 1.1A disk #1.

21
GALdecompile:
- Corrected the control flow regarding "else" statements.
- Action command definitions as well as variable and object names are now taken from a GAMEDEFS text file which %includes SYSDEFS. That will allow any user to adjust the output for different game versions, and contribute the meaning of the unknown action commands without having to recompile GALdecompile. GAMEDEFS.CGA-1984-08 is the definition file for the August 1984 PC CGA version, which must be renamed to GAMEDEFS to be used by GALdecompile.

GALextract:
- Now adds the proper two-byte header to GAL sound files. GALsnd2vgm modified to account for that.
- Now extracts the WORDS.BIN file from the disk image.

22
AGI Development Tools / Re: Java AGI Interpreter by Dr Zoltan
« on: October 31, 2016, 12:39:38 PM »
Quote from: OmerMor
I've no idea about the usage of ".f" vs ".v". I see them both.
Heh:
Code: [Select]
[
[ sysdefs.al
[
[ AL'S SYSDEFS RE-DEFINES
[
[ 5/13/86
[



[************   AL'S REDEFINES   **************]
%define new.room.v new.room.f
%define load.logics.v load.logics.f
%define call.v call.f
%define put.v put.f
%define load.view.v load.view.f
%define position.v position.f
%define set.view.v set.view.f
%define set.loop.v set.loop.f
%define set.cel.v set.cel.f
%define set.priority.v set.priority.f

23
SCI Development Tools / Re: Sierra's Internal SCI Tools
« on: October 28, 2016, 02:31:59 PM »
MAKEVOLS is actually quite flexible, which in the case of SCI0/10 with multiple volumes is very useful. Basically, you can have as many lists as you want, with one list calling up another. For example, you could do the following (stylized example):
Code: [Select]
(CDROM ; all resources in one volume file
system
rm1
rm2
)

(360K
volume 0
system

volume 1
rm1

volume 2
rm2
)

(720K
volume 0
system

volume 1
rm1
rm2
)

(system
script 999
script 998
)

(rm1
script 1
pic 1
)

(rm2
script 2
pic 2
)
Anything that is not a recognized keyword is interpreted as a reference to a separate list. When MAKEVOLS is run without a list name, it just takes the first one in RESOURCE.TXT. If you specified "MAKEVOLS 360k" with the RESOURCE.TXT above, only the "360K" list would be built, which puts all resources associated with rm1 and rm2 in separate volumes 1 and 2, whereas "MAKEVOLS 720K" would put them in the same volume 1. That flexibility still exists in MAKEVOLS 3.01, though it is somewhat useless since that version of MAKEVOLS/SCI does not support multiple volumes anymore.

Some early versions of MAKEVOLS, but not 1.10 and not 3.xx, apparently specified the paths in RESOURCE.TXT as well using the "resource" keyword (from INN):
Code: [Select]
resource view     0x80 /app24/ll/view/%d.v56;/app24/appshare/view/%d.v56
It seems that the paths were moved out of RESOURCE.TXT into the WHERE file at some point in time, possibly because SCI.EXE (without V) requires a WHERE file anyway which could be reused.

24
SCI Development Tools / Re: Sierra's Internal SCI Tools
« on: October 28, 2016, 01:40:34 PM »
I have just rebuilt KQ6 floppy using the MAKEVOLS utility from OmerMor's SCI16 archive. The resulting RESOURCE.000 and RESOURCE.MAP are not byte-for-byte identical, as the MAKEVOL.EXE seems to be of a later version that inserts an additional 0x12 0x34 0x00 0x00 into RESOURCE.MAP. A few of the files also compress differently, indicating a different version of the PKWare Data Compression Library. But the result still works nicely with the original interpreter included with the game. Attached find my WHERE and RESOURCE.TXT file for KQ6 Floppy. I put my individual game resources are in a subdirectory named INPUT\ under the current directory from which MAKEVOLS is launched.

25
SCI Development Tools / Re: Sierra's Internal SCI Tools
« on: October 28, 2016, 11:42:31 AM »
Quote from: Kawa
Me, I just want compression and maybe multiple volume files. But I can't get MAKEVOLS to work.
I did get it to work to rebuild Space Quest I with compression. What exactly is your problem, and what version of MAKEVOLS are you using, and for what SCI version are you building?
Quote from: Iskovlun
This reminds me of how the first decompressor I wrote for SCI1.1 abused a command-line tool from Logitech that happened to use the same compression library. Christoph's first comment to that was, predictably, "WTF?" But it worked.
Ah, ye olde PKWare Data Compression Library. I first extracted it from SIERRA.EXE to create a linkable library version of it, then debugged it and wrote my own implementation of the decompressor using assembly language. Of course, with the C implementations available in open-source, that effort has become useless. I'm not positive though whether the compressor has ever been rewritten in Assembly or C as well, or whether an official linkable library has ever been leaked. PKWDCL seems to have been used quite widely --- not only did Sierra use it, but LucasArts would distribute Monkey Island 2 and Indiana Jones 4 using their own custom archive format (LFG) that compressed using the library. And many mid-90s floppy-based games used the INSTALIT installation package. Its built-in decompressor first used the old PAK compression from NoGate Consulting but later switched to PKWDCL in later versions. I know that from writing my own InstalIt .PVL archive extractor.

26
AGI Development Tools / Re: Pre-AGI2 versions
« on: October 28, 2016, 11:30:00 AM »
It would. But the only tests that GAL knows are equal, not equal, posn, and said with two words.

27
AGI Development Tools / Re: Pre-AGI2 versions
« on: October 28, 2016, 01:39:13 AM »
Sierra's original CG does not seem to have action and test commands hard-coded into the compiler. Instead, they are defined in a text file called SYSDEFS, which looks like this:
Code: [Select]
%action increment(VAR) 1
%action decrement(VAR) 2
%action assignn(VAR, NUM) 3
%action assignv(VAR, VAR) 4
And how does one April 1987 time-stamped game source define "said" in that definition file??
Code: [Select]
%test said(WORDLIST) 14
%define said1 said
%define said3 said
Heh.
Quote from: lance.ewing
I'm also starting to realise that there is no "has" test command. Instead it appears to be using flags to keep track of whether an item is in the inventory or not.
GAL has a "get" action but apparently no "has" action either.

28
AGI Development Tools / Re: Pre-AGI2 versions
« on: October 27, 2016, 01:19:51 PM »
For what it's worth, GAL's said test always uses two words.

30
Quick update: added support for the Retrograde station KQ1PCJR.IMG disk image. I have added another program:

GALsnd2vgm converts the sound resources to the .VGM format, which can be played back by many sound players with the right plugin. I have made sure that all tracks that should loop do loop properly. The syntax is GALsnd2vgm infile outfile ["English track title"] ["Japanese track title"]. The track titles are optional. If at least an English track title was given and a GD3.INF file is found in the present directory, then the generated .VGM files will each have a GD3 tag as well. GALsnd2vgm_all.cmd does this already.

Doing this both to the Radio Shack and IBM releases indicates that the IBM release has a few sounds different, notably the witch sound. There are also several unused sound resources.

Pages: 1 [2] 3 4

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

Page created in 0.043 seconds with 19 queries.