Repository navigation
Game analysis
🇺🇸 English · 🇫🇷 Français · Overview: technical documentation
Where this document comes from. It is the reverse-engineering notebook kept while studying the game, before and during the recompilation: disassembly of
TUCKER.EXE(Ghidra, a home-made disassembler), reading the data files, comparison with the original game under DOSBox. It is published as is, with a few corrections. This is a translation of the French original (ANALYSE.md), which remains the reference.
- When it talks about "the engine" (Bud's walk, x86 interpreter in Python,
tucker/core/…), it means thetucker-viewerprototype, a Python reimplementation written first to understand the game. The current recompilation, on the other hand, runs the original code: it does not need to reproduce these behaviours, they come straight fromTUCKER.EXE.- The addresses are those of the French version of the CD. The other versions have a
TUCKER.EXEwhose code is shifted (see technical documentation, § Versions).- The files cited in
extracted\pe\(disassembly, call graph, tools) are local working files, not published: they are derived from the game's executable.- No game code, image or sound is reproduced here: only addresses, formats, behaviours and short quotes of text, useful for interoperability and preservation.
- Game text is quoted from the French version, with an English gloss.
The addresses are LE linear addresses: object 1 (code) is at 0x10000 and object 2 (data) at 0x40000.
They are also the addresses of extracted\pe\TUCKER_flat.exe in Ghidra.
Conventions: names in quotes ("loadFile") are mine. Arguments follow the Watcom convention EAX, EDX,
EBX, ECX. Ghidra wrongly shows them as param_n and extraout_ECX.
The CD (591 MB ISO image) holds 5,841 files, mostly in TUCKER\.
| Ext. | Count | Role |
|---|---|---|
| WAV | 4,758 | voices SPEECH\SAM####.WAV (4,196), music MUSIC\, effects FX\
|
| SPR | 654 | sprites SPRITES\A##_## (Bud), C##_## (characters), others |
| PCX | 317 | backgrounds, walk masks, interface: all 320×200, 8-bit |
| C | 28 | not C code: tables and text scripts (see §4.5) |
| FLC/FLR/PIC | 16 | intro animations (INTRO.EXE) |
| DIG | 9 | Miles AIL 3.02 sound drivers (SB, SB Pro, SB16, GUS…) |
| EXE | 5 |
TUCKER.EXE (the game), INTRO.EXE, SETSOUND.EXE, INSTALL.EXE, DOS4GW.EXE
|
| DTA/DAT/CFG/INI/TXT | 7 |
CHARSIZE.DTA, TUCKER.CFG, DIG.INI, INFOBAR.TXT… |
The main executable is TUCKER\TUCKER.EXE (284,677 bytes). TUCK.BAT and BUD.BAT start it after
INTRO.EXE.
- It starts with an MZ header whose
e_lfanewis 0x2A50. At that offset is an LE (Linear Executable) header: 32-bit protected mode, started by the DOS/4GW extender. The compiler is Watcom C/C++32: the string "WATCOM C/C++32 Run-Time system … 1988-1994" follows the entry point. - The LE header describes 53 pages of 4 KB, with no name table and no debug info.
- Object 1: code, base 0x10000, size 0x2DA9A, 32-bit.
- Object 2: data, base 0x40000, size 0x12330. The stack is at the top of this object (ESP = obj2:0x12330).
-
Entry point: obj1:0x1E318, i.e. 0x2E318 (Watcom's
_cstart_). - 8,389 relocations, all of type "internal 32-bit offset".
-
REA rejects the LE (
unsupported LE executable in MZ image), even though Ghidra 12.2 is available in REA. So I wroteextracted\pe\outils\le2pe.py. It rebuilds the memory image, applies the relocations and wraps everything in a flat PE32. REA/Ghidra always load it at base 0x1000, so I placed the sections at RVA = LE base − 0x1000: Ghidra addresses are then equal to LE addresses.
_cstart_ 0x2E318 ──► __CMain 0x37474 ──► main 0x12300 (EAX=argc, EDX=argv) ──► exit 0x28892
main 0x12300
├─ mouse(0) 0x113E0 ............. int386(0x33) fn 0: missing → "NO MOUSE DRIVER DETECTED"
├─ malloc(0x563650) 0x10010 ..... a single 5.6 MB block, split into ~18 fixed areas
│ (+0x15E00 load buffer [0x46858], background buffers, sprites…)
├─ initSound 0x114D4 / timer 0x12274: AIL_register_timer(0x12250) + AIL_set_timer_frequency(46 Hz)
├─ getVideoMode 0x10098 ......... int386(0x10) AH=0Fh, stored in [0x4FD0C]
├─ initGame 0x12528 ............. tucker.cfg, infobar.txt, .enc/.c texts, nofiles.dta
├─ setVideoMode(0x13) 0x10064 ... int386(0x10) AH=0: VGA 320×200×256
├─ gameLoop 0x129DC
└─ stop timer 0x122C8, restore video mode, stop sound 0x11598, free 0x10040
The game code spans roughly 0x10010–0x27200. Beyond that are the Watcom C library and Miles AIL
3.02. All the hard-coded int 21h (48 sites) and int 31h (DPMI, 30 sites) are in these
libraries (addresses ≥ 0x27D98). The game code contains no int instruction: it goes through
int386(n, &in, &out) at 0x27D03, which ends in the _DoINTR dispatcher (0x377CC, one int
instruction for each of the 256 values), or through the C library.
| Service | Function | Detail |
|---|---|---|
| Mouse int 33h |
0x113E0(fn=EAX, &x=EDX, &y=EBX, &buttons=ECX) |
fn 0 = reset/detection, 3 = position+buttons, 4 = set cursor. 0x113A8 checks the 33h vector (int 21h AX=3533h). |
| Keyboard |
0x10D30 → _bios_keybrd 0x28B43 (int 16h) |
returns the scancode (AX>>8) |
| Video int 10h |
0x10064 (mode), 0x10098 (read mode) |
|
| VGA palette | 0x10204 |
outp(0x3C6,0xFF), outp(0x3C8,i), outp(0x3C9,r/g/b)
|
| Whole palette | 0x10CCC |
256 entries from R 0x46010, G 0x46210, B 0x46410
|
| Fades |
0x1053C (in), 0x1062C (out) |
±5 per step and per component |
| Video memory 0xA0000 |
0x10D88 (display), 0x10820 (clear) |
copies 200 lines × 320 from a work buffer 640 px wide (pitch 0x280) |
| Rectangle copy |
0x112DC, 0x1133C
|
destination or source with pitch 640 |
| RLE sprite |
0x10F18(dst=EAX, src=EDX, w=EBX, h=ECX) |
see §4.4 |
| Timer | callback 0x12250
|
[0x46634]++ (frame pacing), [0x46804]++
|
An inner loop runs once per logical "tick", and an outer loop handles rendering and input:
-
Pacing:
[0x46808]counts the ticks. After[0x4228C]ticks, the loop waits for the 46 Hz timer[0x46634]to catch up. -
Input: mouse
0x13560(int 33h fn 3), scrolling and cursor. -
Logic:
- opening fades (
[0x4ECB8]); - cutscene script if
[0x4FB34](0x21BA8then the interpreter0x20A00); - Bud's animation
0x17B80, characters0x19200and0x19100, objects0x200E4and0x16C78; - location change
0x178C4if[0x47A24]changed; - interface panel in mode 0x8C (game area 140 lines high).
- opening fades (
-
Rendering: copy of the background (
[0x46890], animated image if[0x42290+loc*4]≥ 4), objects0x16DE0, sprites0x1A4A8into the 640 px buffer, cursor, texts, then0x10D88which sends it all to 0xA0000. -
Keyboard
0x10D30:- P (0x19) → pause (
0x25CC0and0x25D20). It ends on a new press of P; keys 1 to 5 are read during it. - In debug mode (
[0x46714]≠ 0):- F1 "next location";
- F2: displays;
- F3 "object number";
- F4: quit;
- F5 to F10: force Bud's animation no. 1 to 6;
- Esc:
0x2693C, then exit.
- P (0x19) → pause (
- Ends when
[0x4681C]is 1 (quit) or[0x47990]is 1 (victory:congrat.pcx).
- The name is prepared beforehand in the global buffer
0x41F68bystrcpy(0x27D1E). The digits in it are often rewritten byte by byte. - If
level > [0x46718](the first byte oftucker.cfg), the path is prefixed with the CD path[0x46720]= "X:\tucker", with X =tucker.cfg[1]+ 0x40. - The function chains
open(O_BINARY)0x27D74,read0x27FC2 (int 21h) andclose0x280D5. It returns the size read, also stored in[0x46614]. - Writing is
0x10184(src=EAX, size=EDX).
-
fopen(name,"rb"), then the 128 header bytes are skipped without being read. The format is ZSoft v5, 8-bit, 1 plane, always 320×200 (checked on all 317 PCX files). - PCX RLE: a byte ≥ 0xC0 gives
n = byte − 0xC0repetitions of the next byte, otherwise it is a literal pixel. Decoding stops at 64,001 bytes (0xFA01). - If
mode ≠ 0:fseek(-768, SEEK_END), then 256 × 8-bit RGB are read and reduced to 6 bits (>>2) for the DAC in0x46010/0x46210/0x46410. The 0x0C marker before the palette is ignored. Withmode = 2, the sound is kept fed during the read (0x12208). - On failure: black screen, then "READ ERROR READING FILE:" followed by the name, then
exit.
-
[0x42290 + loc*4]gives the number of images of the location (1 to 4). The names arelocNN.pcxorlocNNa/b/c/d.pcx, plus the maskspathNN[a|b].pcx. - Each PCX is decoded into the load buffer, then copied line by line (
[0x4FD04]= 140 lines, or 200 beyond location 0x48) into the 640 px work buffer[0x4685C]at x = 0 or 320. Thepathmasks go to[0x4689C]. - Each 320×140 panel (0xAF00 bytes) is then stored in
[0x4688C]at positions +0, +0xAF00, +0x15E00 and +0x20D00. These are the images the loop alternates for animated backgrounds. -
Role of the layers (checked in
0x1383Cand0x129DC):- 1 image:
locNN.pcx+pathNN.pcx, 320 px room; - 2 images:
aat x=0 andbat x=320, 640 px room, withpathNNa/b. Scrolling is only allowed in this case (0x19100); - 4 images (locations 15, 22, 40, 46, 52, 63, 64, 70): 320 px room; a counter 0..39
[0x4FCE0]picks imagecounter/10, so a→b→c→d every 10 frames; - no location has 3 images.
LOC15.PCXexists next toLOC15A..Dbut is never loaded.
- 1 image:
-
pathmask:0x17310(x, y) answers "walkable" if the mask byte is > 0, or if a script forces the walk ([0x4F050],[0x4FBA4]). In locations 0x1A and 0x20, it tests y−3.- Values 1, 2 and 255 are therefore equivalent for walking.
- The 150 pixels at 255 in
PATH09B.PCX(x 307–319, y 116–135) form a walkable strip on the right edge, with no special handling.
-
ROCHPATH.PCX(location 1 only) is loaded in place of the 3rd panel ([0x46800]). It is not used for Bud:0x221A8moves small creatures over its pixels > 0, trying 8 directions (0x2206C) and avoiding the other positions in0x420E4…. The code never distinguishes 2 from 1.
- Loading Bud's animations:
0x19F98. ForaLL_NN.spr(location LL, animation NN = 1..[0x44414+loc]), all the files are concatenated into[0x4ED14], with their offsets in0x4ECC4[]. - Characters use
cLL_NN.spr. - The format was checked on all 654 files: 17,021 frames out of 17,022 decode exactly. The only
exception is frame 19 of
C24_09.SPR: a final transparent run overflows by 51 pixels (2,781 instead of 2,730) and spills 3 bytes into the next frame. It has no visible effect.
uint32 frameCount
uint32 offset[frameCount] ; from the start of the file, offset[0] = 4 + 4*n
for each frame, at offset[i]:
+0 uint16 width (w)
+2 uint16 height (h)
+4 int16 ax ; offset from the animation's anchor point: IGNORED by the engine
+6 int16 ay ; same, IGNORED
+8 int16 x ; absolute position of the top-left corner (0..319, or x in the 640 px room)
+10 int16 y ; absolute position of the top-left corner (0..199)
+12 RLE data: 0x00, n → n transparent pixels
other b → 1 pixel of colour b
-
Role of the 4 fields (checked):
- The engine reads
x/y(+8/+10) only in the two drawing routines. -
0x1A4A8(characters,cLL_NN.spr): destination =y*640 + x + 0x4F1A8[i], where0x4F1A8[i]is a per-character offset, advanced on each frame by0x4F228[i](speed). Clipping takes the scroll[0x46854]into account. -
0x1A0A4(Bud's special animations,aLL_NN.spr): destination =[0x4685C] + y*640 + x + [0x4ED24]. 320 is added if Bud is in the right half, plus three hard-coded corrections: location 0x1D, location 0x3A and location 0x16 (for the latter, y +=[0x4B558]). -
ax/ay(+4/+6) are read into local variables ([ebp-0x10]/[ebp-0xC]in 0x1A0A4,[ebp-0x20]/[ebp-0x1C]in 0x1A4A8) and then never read again. No other code reads bytes +4..+7. - Check against the data: in the 455 files where
ax/ayare not zero,(x − ax, y − ay)is constant over every frame of the file. They are therefore offsets from an anchor point specific to the animation, left by the cutting tool, and the engine uses the absolute positions directly. - No collision box is stored in the SPR files. Clickable areas come from
CHARPOS.CandDATA4.C. - Across the 17,022 frames,
x + w ≤ 320andy + h ≤ 200.
- The engine reads
- Display:
0x10F18(dst, src = frame + 12, w, h) as a plain copy. The variant0x11038is used if0x4F94C[i] == 99, and the mirrored version0x11168otherwise (flip0x4F96C[i]). - Bud's walk does not use SPR files. It cuts rectangles out of
bud_N.pcx,peg_N.pcxormac_N.pcx, described byCTABLE01.C(see 4.9).0x17B80is Bud's state machine: direction, CTABLE sequence or special animation.
- For each file, the game first tries
xxx.enc, thenxxx.c. Decoding0x124E0(buf=EAX, len=EDX) subtracts 0x80 from each byte if[0x41FBC]is set. The French CD only has.cfiles, so plain text; the English, German and Spanish versions ship.encfiles (same text, each byte + 0x80). - Common structure:
-
!!NNsections (location number), found by0x15ED8; -
dw a,b,c,…lines, found by0x15F70, which searches for "dw" up to 110,000 bytes; - fixed-width decimal numbers read by
0x15DC0(buf=EAX, offset=EDX, digitCount=BX). The function reads exactly 2, 3 or 4 characters:- a
-gives −1; - a space in the last position counts as 9;
- a result outside 0..10000 gives −2.
- a
- The loaders advance by a fixed number of characters (width + 1) without looking at the
separator.
,,-,.or;are therefore equivalent: the file containsdw 04-178,040orbus,014;wa+;. A modern parser must read by fixed columns, not withsplit(','). - Everything after the last field read is ignored (
;and//comments, free text). - The text is in CP437 (é = 0x82, à = 0x85…).
-
Loaders, found through the references to the file names:
| File | Loader | Contents |
|---|---|---|
INFOBAR.TXT, DATA5.C, BGTEXT.C, CHARNAME.C, CSDATA.C
|
0x12528 (init) |
loaded raw into memory |
OBJTXTn.C, PTnTEXT.C
|
0x12858 |
texts of part n (the digit is replaced in the name) |
DATA.C |
0x16654 |
rectangles of the scenery objects in scrobjNN.pcx
|
DATA3.C |
0x168F4 |
pick-up objects per location |
DATA4.C |
0x15FDC |
clickable areas without an object, and exits |
CTABLE01.C |
0x17690 |
rectangles of Bud's frames in bud/peg/mac_N.pcx
|
CTABLE02.C |
0x17A00 |
Bud's standard animation sequences |
ACTION1/2/3.C |
0x18594 |
"verb + target → result" rules |
CHARPOS.C |
0x20354 |
characters per location, plus their animation lists |
FX.C (named fx.enc) |
0x2578C |
per-location sound ambience |
CHARSIZE.DTA |
0x270EC |
256 character widths, into 0x42408[]
|
CREDITS.TXT |
0x2693C |
credits |
- Files not referenced by the executable:
ACTION.C,DATA2.C,EXIT.C,COMMON.C,PT1.C,TEST.C,OBJTXT.C,CSDATA1.C. They are development leftovers or earlier versions. The engine only loadscsdata.c. - Free-text files, one entry per
\r\nline:0x140A4(n, buf) returns the start of the n-th line. Lines of dialogue are located bytpo(base) + number (see 4.8). The matching voice isSPEECH\SAMxxxx.WAV, with xxxx =(part−1)*3000 + base + n − 1. -
INFOBAR.TXTholds the verbs of the bar (in the French version: Aller, Regarder, Parler, Ouvrir, Fermer, Donner, Prendre, Déplacer, Utiliser, "avec", "à" = Go, Look, Talk, Open, Close, Give, Take, Move, Use, "with", "to"), followed by the location names. - The cutscene interpreter is
0x20A00(see 4.8).0x21BA8finds the!!NNtable, advances to the n-thdwline (n =[0x4FB34]), then calls0x20A00as long as it returns 0. It prints "Table not found", "dw not found" or "Instruction not recognised" on error.
-
savegm.NNis 2,000 bytes, i.e. 500 dwords:- [0..299]: game flags
0x47800[300]; - [300..339]: copy of
0x4B5E8(40 dwords); - [340..459]: copy of
0x4B3C8(120 dwords); - +0x730: location number
[0x4680C]; - +0x734 and +0x738: Bud's position
[0x43F0C]and[0x43F10]; - +0x73C and +0x740:
[0x4B688].
- [0..299]: game flags
-
nofiles.dtais 10 bytes: byte 0 is the highest save number, byte 4 the last one used. - Loading
0x255D0then0x2572E: flags, inventory, object state, location[0x468C8]and Bud's position, then the location is loaded. The format is reused as is bytucker/core/savegame.py, and the files stay readable by the game under DOS. - Menu: click on inventory object 30 (
0x15C56,[0x468D4] = 2), then LOAD / SAVE / play / QUIT (CHARGER / SAUVEGARDER / jouer / QUITTER in the French version) and choice of the number (mode 3,0x1524C). Detail of the areas intucker/core/savemenu.py.
- Voices:
0x11F64(n=EAX). The file isX:\tucker\speech\samNNNN.wav, where X is the CD drive and NNNN is written at positions 0x14 to 0x17. It is opened in binary mode, its WAV header is read, then it is streamed by AIL. - Music
music\musN.wav(0x11AE8), effectsfx\fxN.wav(0x11784), driver chosen inDIG.INI(Miles AIL 3.02). AIL volumes from 0 to 127. -
FX.C, read by0x2578Eon each location change. Section!!NN, firstdwline:-
count(2), then count entriesfx(3) volume(3) type(2)into0x46CE4,0x46D5C,0x46DD4, plus fields depending on the type:- type 5:
x(3) slope(3)into0x46838,0x4683C(the slot is noted in0x46830); - types 6 and 8:
anim(2) frame(3) source(2)into0x46F3C,0x46FB4,0x46EC4; - type 7: like 6, then
flag(3) value(2) anim2(2) frame2(3) value2(2)into0x4702C,0x470A4,0x47194,0x4711C,0x4720C.
- type 5:
- Between two entries, control characters are skipped (
0x25AA4): the list can continue on the following lines (location 40: 26 effects over 13 lines). - Type 8: no file; the slot reuses the sound of slot number
fx, already loaded, then becomes type 6. - Next
dwline (0x25B56), music:count(2), then count entriesflag(3) value(2) music(3) volume(3) type(2). Only those where0x47800[flag] == valueare loaded, into0x47288,0x47298,0x472A8(count in0x47284). Example in location 2:mus9once while flag 195 is 0, thenmus51looping. - Data errors kept as they are: location 40, slot 12 of type 8 pointing to slot 16, not loaded yet;
location 68,
///122;fx226.wavmissing (location 54).
-
-
Effect types:
- playback
0x118B0(sound, slot, volume): looped for types 2, 5 and 7 (type of the slot played), once otherwise; - on arrival (
0x25D20, first 29 slots): types 1, 2, 5, and 7 ifflag == value; then the loaded music with type > 0 (0x11C14, looped if type 2); - types 3 and 4, on each tick (
0x25E28), if slot 0 is not playing ([0x46644]): each type 3 (or 4) effect plays in slot 0 ifrand() > 0x7E2C(or> 0x7FFB), only one per tick. These draws use the samerand()as the characters; - type 5, on each tick (
0x25EEC): volume = volume − |Bud's x − x| × slope / 10, at least 0; - types 6 and 7: sound tied to an animation frame. Source 0: Bud's special animation (
[0x4ED18]= number,[0x4ED1C]= frame,0x25F74); source 1: any character (0x4F104[j]= state,0x4F144[j]= frame,0x260C4). Type 7 setsflag := valuewhen the sound starts, and on(anim2, frame2)setsflag := value2and stops it (location 8:fx186looping until frame 22 of special animation 2). The EXE restarts the sound on every tick while the frame stays on screen; the engine only triggers it once per arrival on the frame; - type 0: played only on request (
fx,NNin scripts,fxcolumn ofACTIONn.C).
- playback
- Location change:
0x25CC0stops all the effects (0x11614) and all the music (0x115DC). - Order within a tick: characters (
0x200E4), character sounds (0x260C4), camera (0x19100), Bud's sounds (0x25F74), …, random ambience (0x25E28), type 5 volume (0x25EEC).
Mechanism:
- Decoding tests
P[0], thenP[1]orP[2], against the letter table0x44790(a b c d e f g h l m n o p r s t v w x +). -
Nis a character digit (0 to 5),NNNa 3-digit number,NNa 2-digit number. The width is imposed by how far the pointer[0x4FB40]advances. - Return code:
- 0: next instruction in the same tick;
- 1: yields until the next tick, or until the wait is over;
- 2: end;
- 3: jump (
sse).
| Instr. | Format | Effect | Var. |
|---|---|---|---|
pan |
pan,NN |
interface panel mode (00 = bar hidden during the scene) |
0x468D4, 0x468D8=1
|
bua |
bua,NNN |
Bud plays special animation NNN (aLL_NNN.spr) from the 1st frame |
0x4ED18 |
bub |
bub,NNN |
Bud plays standard sequence NNN of CTABLE02
|
0x4D7D4=0x4CE04[NNN] |
buc |
buc,NNN |
plays list NNN (counted from 0) of Bud's lists in CHARPOS: 1st number = aLL_NN.spr file, then the frames (from 1), 99 = end |
0x2084C |
b?d |
bsd,NN (bcd) |
Bud's direction: 1 = frame 0x11, 2 = 0x10, 4 = 0xF, other = 0x10 mirrored | 0x4D7D8 |
bof / bon
|
— | hides / shows Bud again | 0x4FB48=1/0 |
buh |
buh,NN |
if ≠ 0, freezes the special animation | 0x4FCE8 |
bso |
bso,NNN |
X offset of the special animation (used by 0x1A0A4) |
0x4ED24 |
bus |
bus,NNN |
Bud says line tpo+NNN−1 of PTnTEXT.C (colour 1); voice samMMMM.wav with MMMM = (part−1)·3000 + tpo + NNN − 1; bubble at (xBud, yBud−64) |
0x11F64, 0x4EC98 (duration) |
buv |
buv,NNN |
volume of Bud's voice (127 by default, 2nd argument of 0x11F64) |
0x4214C |
buw |
buw,XXX,YYY |
Bud walks to (X,Y) |
0x4B564/68, 0x4B56C=1
|
bux |
bux,XXX,YYY |
puts Bud at (X,Y) without walking | 0x43F0C/10 |
cNa |
c0a,NNN |
character N: animation list NNN, 999 = none (−1). Without cNa, the active list is set by the per-location code (0x1A78F…) |
0x4F104[N] |
cNc |
c0c,NNN |
character N: restarts its animation list (CHARPOS, ended by 99) |
0x208B8 |
cNs |
c0s,NNN |
character N says line tpo+NNN−1, in colour 0xB5+N; bubble at ssp, or at sNp if [0x4FBA8] ≠ 0 |
0x4FBEC, 0x4FBF0=N
|
cNv |
c0v,NNN |
volume of character N's voice | 0x42150[N] |
end |
— | end of the script | returns 2 |
fad |
fad,NN |
fade counter: 20 = fade to black in 14 steps, 00 = opening fade (see 4.18) | 0x4ECB8 |
fx |
fx,NN |
plays slot NN (counted from 0) of the location's FX.C list: fxF.wav, F = 0x46CE4[NN]
|
0x118B0, 0x4FD08
|
flx |
flx,NN |
effect NN looped (type 2) | 0x46DD4[NN]=2 |
f?x |
fsx,NN |
stops effect NN if it is playing | 0x11614 |
fm |
— | makes the inventory flash | 0x4FBE0=50 |
fw |
fw,NN |
Bud goes to area NN of the location (0x14798); if it is an exit, he takes it |
0x477F8 |
gfg |
gfg,NNN,VV |
game flag [NNN] = VV (300 flags, saved) |
0x47800[] |
gv |
gv,NN |
chains CTABLE02 sequence NN at the end of the current sequence |
0x467DC |
loc |
loc,NN |
changes location on the next tick; the script continues in the new location (loading 0x136DC does not reset [0x4FB34] to 0), e.g. bof,loc,70 then loc,36,bon,…
|
0x468C8, returns 1 |
ofg |
ofg,NNN,VV |
VV ≠ 0: adds object NNN to the inventory (0x16F94); VV = 0: removes it (0x17008) |
0x4B5E8[] |
opt |
opt,NN,{TTT,EEE}×NN |
dialogue menu: NN choices; text = line tpo+TTT−1; leads to dw entry EEE (counted from 1) |
0x4FB64/68/84 |
opf |
opf,NN,{FFF,VV,TTT,EEE}×NN |
same, but a choice only appears if flag FFF equals VV | same |
sse |
sse,NNN |
jumps to dw entry NNN of the current table |
0x4FB34, returns 3 |
ssp |
ssp,XXX,YYY |
bubble position for all characters | 0x4FB5C/60 |
sNp |
s0p,XXX,YYY |
bubble position for character N | 0x4FBAC/C4[N] |
sp |
— | special pose of Bud: while his sequence has 2 parts, a counter goes up to 121, then back to 0, and picks frames 0x77 to 0x7A by direction (0x17B80) |
0x467D4=1 |
s?c |
— |
0x4F2E8=0; never used |
— |
tpo |
tpo,NNNN |
base for lines of dialogue (line number in PTnTEXT) |
0x4FCD0 |
wa+ |
— | waits for the end of the line, then 20 ticks |
0x4FB4C, 0x4FB44=20
|
was |
— | waits for the end of the line | 0x4FB4C |
wat |
wat,NNN |
waits NNN ticks | 0x4FB44 |
wsm |
— | waits until Bud has finished walking | 0x4FBA0 |
wfx |
— | waits for the end of the last slot played by fx ([0x4FD08]) |
0x467D8 |
wNa/wba
|
— | waits for the end of the animation of character N or of Bud. The pointer does not advance, so the instruction is unusable and absent from the data | 0x4FB54 |
xhr / xhm
|
— | camera follows Bud (scroll = xBud − 200) / normal camera | 0x4FCE4 |
Frequencies found in CSDATA.C (42 different mnemonics): wa+ 1,866, bus 1,054, c0s 796, sse
271, was 247, c1s 174, gfg 147, opt 146, wat 124… All these instructions are covered by the
table.
Anomalies in the data:
-
CSDATA.Cline 500 containsbud,004. The name is recognised asb?d, but the argument has 3 digits instead of 2: the pointer lands on,and the engine prints "Instruction not recognised". -
CSDATA1.C, not loaded, also containsc0+andcos. - A modern engine must report these cases without crashing.
-
DATA.C(!!NN= number ofscrobjNN.pcx):id(3) xs(3) ys(3) w(3) h(3) xd(3) yd(3).- Destinations:
0x4AB94[id] = ys*320+xs,0x49424 = w,0x49BF4 = h,0x48484 = xd,0x48C54 = yd. - The two trailing
0are ignored.
- Destinations:
-
DATA3.C(!!NN= location):graphic(3) sequence(3) takeable(2) inventoryNo(2) flag(3) value(2) textNo(3) xStand(3) yStand(3).- Destinations:
0x474D4, local,0x475C4,0x47614,0x47664,0x476B4,0x4B378,0x47758,0x477A8. - The sequence (0 = none) refers to a run of the EXE's animation table
0x4260C(§4.11). The code handles neither flipping nor the value 999: the file's comment "High=Flip, Low=Seq" matches nothing in the EXE. - "At most 19 objects": the loader stops when the index reaches 0x13 (
0x16B8A). - Mistyped lines (
w 220,…,d 007,…) are skipped, because0x15F70looks for "dw".
- Destinations:
-
DATA4.C:- Header:
dw NN,NN, into0x46714and0x46798. - Then, per location, up to 10 areas ended by
dw -1:x(3) y(3) w(3) h(3) xStand(3) yStand(3) textNo(3) cursor(2) destLoc(2) x1(3) y1(3) x2(3) y2(3) xWalk2(3) ?(3). - 10-entry arrays, from
0x472F4to0x474AC.
- Header:
-
CTABLE01.C(!!00):-
dw 999,file,locselects thebud_N.pcxsheet; - then
xs(3) ys(3) w(3) h(3) xOff(3) yOff(3), into0x4B694 = ys*320+xs,0x4B9B4,0x4BCD4,0x4BFF4,0x4C314. A value > 300 meansvalue − 500.
-
-
CTABLE02.C(no section, one line per sequence):-
partCount(2) rotation(2) loc(2), then the frame numbers in 4 columns, ended by 999; - destinations:
0x4D124,0x4D444, then the list0x4C634[]; the start of each sequence is in0x4CE04[seq].
-
-
ACTION1/2/3.C(!!NN= location), in two parts:- key:
verb(2) targetType1(2) target1(3) targetType2(2) target2(3), encoded astype*1000 + no; - result:
flag1(3) val1(2) flag2(3) val2(2) budSeq(3) ?(2) line(3) duration(2) flagToSet(3) value(2) fx(2) fxDelay(2), into0x4D9A4 … 0x4EAD4(100-entry arrays).
- key:
-
CHARPOS.C(!!NN= location):- up to 8 characters:
x(3) y(3) w(3) h(3) xWalk(3) yWalk(3) flag(3) value(2) direction(2) nameNo(3) descriptionNo(2), into0x4F9D0 … 0x4FB10; - then two blocks of animation lists, each ended by
dw -1(loader0x20354):- Bud's special animations go, flattened, into
0x4ED2C[](one list per line, end = 99); - the characters' ones go into
0x4F2EC[]. A line ends with 99 (end of list) or with 98, which means "the list continues on the next line": the 98 is overwritten (index decremented), then reading resumes at the nextdwline. Example: the dentist in location 13 has a 91-frame list over 4 lines. - List format:
nSPR, frame1, frame2, …, with frame numbers counted from 1.
- Bud's special animations go, flattened, into
- up to 8 characters:
-
FX.C(!!NN= location): see §4.7 (read by0x2578E).
-
Font:
-
0x13FC0cutsCHARSET.PCXinto 10×10 cells (32 per row, 7 rows, codes 0x20..0xFF in CP437 order: é = 0x82, à = 0x85, ç = 0x87…). Each glyph is compressed (0x10DF0) into[0x46868], with the offsets in0x468DC[]. - Drawing a character
0x141B0(dst, code, pitch, colour): 0 = transparent, 0x80 = outline kept as is, any other value takes the requested colour. -
0x14384draws a line of text advancing bywidth[code].CHARSIZE.DTAcontains 256 2-digit widths, read by0x270ECinto0x42408[];0x14144measures a line.
-
-
Panel:
0x13BCCloadsPANEL1.PCX(written verbs) if[0x468D0]= 0, otherwisePANEL2.PCX(icons). Initialisation (0x12554) sets[0x468D0]to 1: the game therefore starts with the icons. F1 (code 0x3B,0x18FED) toggles between the two.0x13D8Cfills the 320×60 bar[0x46864], displayed at y = 140, according to thepanmode[0x468D4]:- 0: lines 0..49 to 10..59, then the inventory (
0x1716C); - 1: lines 51..110 to 0..59;
- 2: like 1, plus lines 172..187 to 20..35 (LOAD / SAVE / PLAY / QUIT);
- 3: lines 110..169 to 0..59 (OK / CANCEL).
- 0: lines 0..49 to 10..59, then the inventory (
-
Verb under the mouse (
0x15A14, screen coordinates):- y < 150: 0 (Go); x > 195: 1;
- with
PANEL1,((y−150) div 17)·3 + x div 67, which gives the grid Go to / Look / Talk to // Open / Close / Give // Take / Move / Use; -
PANEL2has irregular areas.
-
Sentence (
0x14404) on lines 0..9 of the bar, colour 1:- verb = line
verb+1ofINFOBAR.TXT; - then the object name = line
n+1of the file chosen by[0x472DC]: 0 =DATA5.C(DATA4 areas), 1 =BGTEXT.C(scenery objects), 2 =CHARNAME.C(characters), 3 =OBJTXTn.C(inventory); - where relevant, "with" or "to" (line 11, or line 12 for Give), then the second object;
- words 4 px apart, the whole centred:
x = 0x9F − width/2.
- verb = line
-
Game part
[0x46814](0x12858):- locations 1–23 → 1;
- 24–40, 70–72 and 79–82 → 2;
- 41–69 and 73–78 → 3.
- It selects the
DATA.Csections, theOBJTXTn.C,PTnTEXT.CandPANOBJSn.PCXfiles, and the base of the object descriptions[0x4FD00](0xA4F, 0xA77 or 0xA9F).
-
DATA.C(0x16654):- sections
!!P0,!!P1… read up to the first missing one; section k describes thescrobjPk.pcxsheet; - the id is global to the part, and
0x4A3C4[id]gives its sheet; -
0x16598recompresses each rectangle as RLE (0 = transparent).
- sections
-
Starting inventory (
0x2624C, on each part change0x128EF): if flag 219 is 1 (new game0x1280E, orgfg,219,01in scripts), it resets it to 0, empties the inventory and0x4B3C8[0..49], gives the floppy disk (object 30), then in part 1 or 3 the map (1) and the matches (0). A new game also sets flag 105 to 1. -
Visibility (
0x16BA8):- hidden if
flag > 0andflags[flag] ≠ value; - otherwise, a takeable object is only visible if
0x4B3C8[inventoryNo] = 0; - otherwise visible.
- hidden if
-
Animation (
0x16C78, once per pass through the loop):- the EXE table
0x4260Ccontains 169 runs ended by 999 (1,323 dwords); - on each tick, the position advances by 1 and goes back to the start after the end;
- the value 998, f, v does
flags[f] = v, goes back to the start and hides the object; - any other value read becomes the object's graphic.
- the EXE table
-
Drawing (
0x16DE0): transparent copy into the room (pitch 640) at (xdest, ydest), after the background and before the characters. -
Hover (
0x16450):- objects are tested from last to first;
- if the mouse is inside the rectangle of a visible object, its text number is returned (
BGTEXT.C, line n+1); - an object with text 0 stops the search among objects, but the
DATA4areas are still tested. - Full order in
0x15670: characters0x206DC, objects0x16450, areas0x1631C, inventory0x15BA0.
-
Verb rules (
0x15670):- the right button moves to the next verb (0..8) and locks it; otherwise the verb follows the mouse
(
0x15A14); - "Talk" only accepts characters; "Give" only accepts the inventory for the first object;
- verb not locked and mouse over a character (except no. 0x15) → "Talk";
- in location 63, "Go" becomes "Use".
- the right button moves to the next verb (0..8) and locks it; otherwise the verb follows the mouse
(
-
Inventory:
- list
0x4B5E8, count0x4B688, scroll0x4B68C(a word) in steps of 3. The arrows are at x 200–211: click up if y < 175, down otherwise; - at the start: object 30 (the options floppy disk), plus objects 1 and 0 in part 3 (
0x2629D); - 32×24 icons in
PANOBJSn.PCX, 10 per row (0x16EB4); - 2 × 3 slots drawn at (212 + 34c, 150 + 26r) (
0x1716C); the clickable area has a 36 × 25 pitch (0x15BA0).
- list
-
"Look" (
0x18920,0x150F0): the line is spoken by Bud, and its voice has the same number.-
DATA4area: line 0x749 + textNo. If that line starts with*E,*Mor*R, Bud says a generic line 0x749 + 0x106 (resp. 0x10C, 0x119) + k, with a shared counter0x47B20(1..6 or 1..10). - Takeable object or inventory object:
[0x4FD00]+ inventoryNo. - Character: 0x87F +
CHARPOSdescription number (0 = no line). - Other cases:
ACTIONn.Ctable.
-
-
Voice
0x11F64(n, volume):speech\samNNNN.wav. The bubble lasts[0x4EC98]=[0x420E0]= 1 tick, extended while the voice is playing (0x19056→0x12208). -
Line breaking
0x19C8C(text, start, maxWidth):- characters are added while
width ≤ max, and each space remembers (count, width); - CR or LF ends the text;
- if the text overflows, it is cut at the last space, and the next line starts after it.
- characters are added while
-
Placement
0x19D74(x, y, text, colour):- max width = 2·min(x − scroll, scroll + 320 − x), replaced by 220 outside [150, 180];
- at most 4 lines, each centred on x and clamped to the screen; if 10·count > y, then y = 10·count; line i is at y − 10·(count − i);
- colours: 1 for Bud, 0xB5 + N for character N.
-
Dialogue menu
0x21EB4, active when[0x4FB64]> 0:- drawn on the bar, after the panel copy;
- choices from y = 141, x = 0, max width 319, lines going down;
- colour 0x6C, and 0x6A for the hovered choice;
- a click jumps to entry
0x4FB84[i](0x21DFB).
-
CTABLE01.C(0x176A0, section!!00): 172 frames.dw 999,FF,LLopens thebud_FF.pcxsheet. -
CTABLE02.C(0x17A00): frame numbers read as 3 digits every 5 characters. The few truncated lines of the file give −2 values.- Base sequences: 0 walk right, 1 stand right, 2 walk up, 3 stand back, 4 walk down, 5 stand front.
- Left is right mirrored (
[0x4D7F0]).
-
Drawing
0x12E74→0x11168:- position x + xOff − 14, or mirrored x − w − xOff + 14; line y − 54 + yOff (+
[0x4B558]); two frames stacked for 2-part sequences; - a pixel is not written if the background under it is ≥ 0xF8, nor if it is ≥ 0xE0 on lines where
line + yOff ≥ 0x442D4[loc](Bud's top goes in front, his bottom behind; test at0x11293) (60 in locations 2, 3, 9, 16, 18, 51, 54; 28 in location 1; 48 in location 64); - the high colours of the palette therefore act as a depth layer.
- position x + xOff − 14, or mirrored x − w − xOff + 14; line y − 54 + yOff (+
-
Pose when Bud is not walking (
0x17B80):[0x4D7E4]is 0 when stopped, 1..4 while walking, 5 during an action, 6 when Bud talks; the orientation is[0x4D7D8](1 up, 2 right, 3 left, 4 down). The pose is chosen again when[0x4D7E4]changes or when the sequence ends (999).[0x4D7DC]is 1 during a CSDATA script (0x21CB6, reset to 0 at0x21E80):- stopped outside a script, random front pose:
rand() < 2000→ 0xD; otherwiserand() < 3000→ 0xE (0x12 in location 57); otherwiserand() < 20000→ 0x12; otherwise 6. Checked under DOSBox: Bud turns to face the player as soon as he stops, even after walking in profile; - stopped within a script, pose by orientation: 3 (up), 1 (right), 1 mirrored (left), 5 (down);
- when Bud talks: 0xF outside a script; within a script 0x11 (up), 0x10 (right), 0xF (down), 0x10 mirrored (left).
- stopped outside a script, random front pose:
- The original walk (
0x17B80: speeds, choice of direction, detours) is not reproduced. The engine runs a breadth-first path search on the mask (2 px grid, no corner cutting), smooths it with lines of sight, then Bud follows the segments (at most 4 px in x and 2 px in y per tick).
-
Camera (
0x19100, called every frame at0x12B8D; scroll[0x46854], reset to 0 on entering a location at0x194FF):- single-background room (
0x42290[loc]≠ 2): scroll 0; -
xhr([0x4FCE4]= 1): scroll = Bud's x − 200, unclamped; - location 16 with special animation 6: +1 px per frame while scroll + 200 < x, at most 320;
- otherwise dead zone: if scroll + 120 > x, scroll = x − 120 (at least 0); if scroll + 200 < x, scroll = x − 200 (at most 320). The adjustment is immediate. Example checked under DOSBox: arrival in location 3 at x = 496, scroll 296.
- single-background room (
-
Loading
0x18594:ACTIONn.C(n = part), section!!LLof the location, at most 100 lines, into the arrays0x4D9A4…0x4EAD4.- A line contains: verb(2) type1(2) target1(3) type2(2) target2(3), then flag1(3) val1(2) flag2(3) val2(2) budSeq(3) mirror(2) csdataEntry(3) delay(2) flag(3) value(2) fx(2) fxDelay(2).
- Key:
type1·1000 + target1 + verb·10000 + type2·100000 + target2·1000000. - Target types: 0 = DATA4 area (text number), 1 = DATA3 object (text number), 2 = character (CHARPOS name number), 3 = inventory object.
-
Execution
0x18BC4: the first line with the same key whose two conditions hold is kept. A conditiond < 500requiresflags[d] == v, a conditiond ≥ 500requires0x4B3C8[d − 500] == v, andd = 0requires nothing.- budSeq 6: nothing;
- budSeq < 100: CTABLE02 sequence, the next field giving the mirroring;
- budSeq ≥ 100: special animation
[0x4ED18] = budSeq − 100. - The deferred result is stored at
0x4EC68…0x4EC80.
-
No line: default answer
0x14B94(verb).- The first lines are at
0x447E0(0, 2235, 2235, 2251, 2261, 2276, 2294, 2312, 2235) and the number of variants at0x423E4. - A counter per verb rotates: the line spoken is
base + counter. - "Use" on inventory object 6 gives 0x95B.
- The first lines are at
-
Deferred result
0x18EDC, called when[0x4D7E0] == 0, i.e. one loop pass out of 4:- after "delay" passes, verbs 2, 3, 4 and 8 do
flags[d] = v; verb 6 with v = 1 adds objectdto the inventory (0x16F94); - then, if the CSDATA entry is > 0,
[0x4FB34]starts the script. -
FX
0x18E84: after "fxDelay" passes (0 = never), plays slotfxofFX.C(same arrays0x46D5Cand0x46E4Cas thefxscript instruction).
- after "delay" passes, verbs 2, 3, 4 and 8 do
-
What happens on a click (
0x14B20,0x14798,0x14FC4):- On a scenery target, Bud first walks to the target's point: the area's
stand(the clicked point if its text is 0), the object'sstand_x/y, the character'swalk_x/y, or the clicked point if y = 0. - "Go" only walks.
- On the inventory, there is no walking: "Look" describes, "Give" and "Use" open the two-object sentence, and the other verbs give the default answer.
- "Look" (
0x18920) answers without walking: description of the area, takeable object, inventory object or character; failing that, the ACTION table (verb 1).
- On a scenery target, Bud first walks to the target's point: the area's
-
Characters: a CHARPOS character can only be hovered if
flags[flag] == value(0x206DC). -
Exits
0x14864/0x19299: "Go" (or "Use") on an area whosedest_loc > 0. Bud goes tostand, then:- he walks to (
walk_x2,unk), or plays special animationwalk_x2 − 900if the value is above 800; - location
dest_locis loaded and Bud is placed at (to_x,to_y); - he walks to (
to_x2,to_y2), or plays animationto_x2 − 900; - destination 99 is the map (
0x195C4, not reproduced).
- he walks to (
-
Special animations:
-
0x19F98loadsaLL_01.SPR … aLL_nn.SPR(n = byte0x44414[loc]) into a bank;0x4ECC4[k]gives the offset of file k, and k = 0 falls on the first file; -
0x17B80/0x1A0A4play every frame of the file once, in place of Bud. The coordinates are those of the sprite, with +320 if320 < Bud's x < 640(hard-coded exceptions in locations 22, 29 and 58); - examples: location 1,
A01_02(Bud climbs over the window sill); location 2,A02_01(he climbs down the drainpipe).
-
-
Fields per character i (dword arrays):
-
0x4F104state = number of theCLL_ss.SPRfile played (−1: none),0x4F188previous state; -
0x4F144current frame (1..n),0x4F124frame count (first word of the file); -
0x4F1C8wait before deciding,0x4F268ticks per frame,0x4F1E8reverse playback,0x4F208ping-pong; -
0x4F248"change when speech starts or ends",0x4F92Cposition in the CHARPOS lists,0x4F1A8x offset (0 or 320).
-
-
0x200E4, every tick, for each character:- a running CHARPOS list advances, and 99 ends it;
- otherwise,
0x1F594is called if the state is −1, if the character starts talking ([0x4EC98] > 0and[0x4FBF0] == i) or if speech has ended while0x4F248 > 0; - otherwise, the frame advances (wait, speed, ping-pong) and
0x1F594is called at the end of the animation.
-
0x1F594resets these fields, then calls the routine of the location and the character:- location 2:
0x1A770; - location 3:
0x1AA60(Vera, the bouncer),0x1AB58(Tony, offset 320),0x1C160(Dave); - these routines pick the next state from the flags,
rand()(0x2E2E2, Watcom) and speech.
- location 2:
-
Link with the scripts:
-
cNa,NNN(0x20F05) sets state NNN (999 = none); -
cNc,NNN(0x20FA9→0x208B8) plays list NNN ofCHARPOS.C(file, frames…, 99). - The CHARPOS lists are therefore not the default animation. The engine could not draw Vera, the
bouncer of location 3 (
C03_01…05), who does not appear in them.
-
-
Peculiarities:
-
[0x4D7DC]= conversation in progress, set to 1 and 0 by the dialogue menu; -
0x47B1C…0x47B3Care flags (199, 203, 205, 207); - flag
0x4F98Cmakes the EXE write the frame count into the state (0x200A3). The engine reproduces this behaviour as is.
-
-
Number of animated characters:
0x44600[loc](0x1A3E5). The fields are reset on loading (0x1A3F0, including0x4F228,0x4F94Cand0x4F9B0). -
Execution rather than translation: the dispatcher
0x1F594and the hundred or so routines from0x1A770to0x1F594are run as they are.-
tucker/core/x86.pyis a 32-bit interpreter limited to the instructions of this Watcom code. Its decoding was compared with the disassembly: same length for the 4,898 instructions of the area. - The code comes from the user's EXE, relocated at startup by
LEImage.relocated(). -
tucker/core/exe_routines.pycopies the engine state into the emulated memory before the call, then reads it back after:- copied: flags
0x47800[300], inventory0x4B3C8, location, Bud's position, speech0x4EC98/0x4FBF0, running script0x4D7DC, special animation0x4ED18, character fields; - read back: the same, plus
0x4FCD8,0x4F98Cand the requested script0x4FB34.
- copied: flags
- Intercepted calls:
0x208B8(CHARPOS list, in Python) and the sound driver (0x118B0play,0x11614stop,0x11D78volume), turned into events.[0x41F90] = 0disables the native part. -
rand()(0x2E2E2) runs natively (Watcom LCG ×0x41C64E6D + 0x3039).
-
-
Validation: the routines of locations 2 and 3, translated by hand, give exactly the same states as
the emulated execution over 1,000 ticks, with the same seed. All 82 locations run without errors.
- Characters absent at the start of the game are absent because of their flags (example: location 4, Mr Pastry only if flag 9 is 2).
-
Comparison with the game under DOSBox (locations 1 to 3): a game played from the bedroom to Seedy
street. DOSBox's native captures (Ctrl+F5, indexed 320×200 PNG) are compared with the engine's
rendering, pixel by pixel. Characters are identified by counting only the sprite pixels that differ
from the bare background (some frames, like
C03_14no. 2, are already painted into the background).- Location 1: same start (160, 125) and same stopping points ("Go bed"; washbasin at 115, 101). Differences fixed: the standing pose (4.13) and the starting panel (4.10).
- Location 2: arrival at (220, 112); background, animated laundry and Mr Pastry (
C02_01) identical to the pixel. Frames 7 = 1 and 5 = 3 ofC02_01are the same: frame 7 is never shown (end of animation atnum_frames − 1, 0x200E4). - Location 3: Bud arrives at x = 496, feet at y = 120 in both versions. Difference fixed: the camera
(4.14). Vera (
C03_01…05, mostly state 5), Tony (+320, states 6, 10 and 11) and Dave (C03_14/C03_15, about 60/40) have the same states and the same proportions as the emulated execution. - DOSBox mouse (mouse not captured,
autolock=false): absolute position, x_game = 10 + 1.754·(x − 170) and y_game = 3 + 0.882·(y − 182), in the tool's screen coordinates. A click must last about 0.25 s to be seen by the game.
-
Opening:
- exit to location 99 (
0x19411, with[0x4FCF8] = 1: "from an exit"); locations 3, 9, 16, 19, 20 and their equivalents 65, 66, 61, 62, 68; - "Use" object 1 (the map) in the inventory (
0x15CE8), if the table0x42170[loc]is 1. Locations 41 to 52 are added when flag 223 is set (0x23F95, and on loading a save). Otherwise Bud answers with line0x8BB(2235).
- exit to location 99 (
-
Image:
map2.pcx(blank map), onto which0x19530(x, y, w, h) copies rectangles ofmap1.pcx:- flag 7 > 0: (0, 0, 140, 86); > 1: (0, 60, 122, 120); > 2: (122, 114, 97, 86); = 4: (140, 0, 88, 125);
- flag 120 = 1: (220, 0, 100, 180).
-
Areas (strict bounds, screen coordinates), name = line of
INFOBAR.TXTin colour 0x60, placed like a bubble (0x19D74) at (mouse x + 8, mouse y − 10):Area Condition Line Location (part 1 / 2-3) Bud 30 < x < 86, 36 < y < 86 flag 7 > 0 13 Seedy street 3 / 65 (620, 130) 60 < x < 120, 120 < y < 170 flag 7 > 1 14 shopping centre 9 / 66 (344, 120) 160 < x < 210, 110 < y < 160 flag 7 > 2 15 Park 16 / 61 (590, 130) 150 < x < 200, 20 < y < 70 flag 7 = 4 or 6 16 Museum 20 / 68 (20, 130) 240 < x < 290, 35 < y < 90 flag 120 = 1 17 Docks 19 / 62 (20, 124) 135 < x < 185, 170 < y < 200 always 18 Go back current location see below -
"Go back": from an exit, Bud is placed according to the location he left (3/65: (620, 130); 9/66: (344, 120); 16/61: (590, 130); 20/68: (20, 130); otherwise (20, 124)). From the inventory, he keeps his position. In both cases the location is reloaded (
[0x468C8]). -
Arriving from an exit in location 9: Bud's special animation 2; in location 66: animation 1 (
0x19B7E). -
While the map is open the game stops running: opening fade in 14 steps (
0x1053C), loop until a click on an area, closing fade.
- Called every tick from the loop (
0x12DF7): a chain ofcmp [0x4680C], nleads to 46 routines, for locations 1-6, 9-16, 19, 21, 22, 24-36, 38, 41-44, 49, 52, 53, 57, 58, 61, 63-66 and 70. Location 14 is called conditionally. - These routines read and write the game variables directly:
- flags
0x47800 + 4n(many "globals" are flags:0x47A3C= flag 143); - areas (
0x472F4…, 10 per location); - FX slots (volume
0x46D5C, type0x46DD4); - Bud's depth table
0x442D4and the map table0x42170; - walk target
[0x4B56C]; requested script[0x4FB34]; - DAC (
0x10270,0x103F8) and walk mask (0x13A28, e.g.PATH02Bin location 2); - location init
[0x4FBF4], reset to 0 on loading.
- flags
- Some draw directly into the 640 buffer
[0x4685C]from theDATA.Cgraphics:- buffer
[0x48480]filled by0x16598, sheet by sheet and by increasing id; each rectangle is compressed by0x10DF0(byte ≠ 0 copied, run of 0 →0, n, split beyond 200); - tables per id (
0x16654): offset0x4AB94, x0x48484, y0x48C54, width0x49424, height0x49BF4, sheet0x4A3C4; - location 6: the stage curtain (graphic 238, 8 × 51 with no transparent pixel) is copied strip by
strip by
0x2279Cand0x22880according to flag 27.
- buffer
- The modern engine runs them as they are in its x86 emulator (
tucker/core/x86.py, memory shared with the characters0x1F594); graphics and sound calls are intercepted and handed to the engine. - Location 70, terminal:
- scancode
[0x4EC8C]translated by the table0x41FF8, at most 19 characters, Backspace0x0E/0x53, Enter0x1C; - the first 16 characters are compared with line 24 of
INFOBAR.TXT(in the French version "GRAND PANTALON JAUNE", "big yellow trousers"); - result in flag 143 (1 = right, lines 25-26; 2 = wrong, lines 27-28), then script 1.
- scancode
- Fades (
0x12A5B, steps0x1053C/0x1062C): counter[0x4ECB8], + 1 per tick.- c < 16 and c > 1: each DAC component + 5 (6-bit) towards the target colour; loading a location sets c = 0, i.e. 14 steps.
- 19 < c < 34: − 5 per component. An exit fades to black before loading; the map opens and closes the same way.
- Pause: P key (except in location 70),
[0x467B0].- All sounds stop and the bar shows line 36 ("EN PAUSE", "paused").
- Keys 1 to 5 replay Bud's last 5
buslines (history0x467B8…). - P resumes the game and the sounds.
- F3 help (
0x26ECC): active only if the 2nd number of theDATA4.Cheader is ≠ 0. The shipped version hasdw 00,00, so no help.- Steps: 0 → 1 (flag 3), → 2 (12), → 3 (20), → 4 (9), → 5 (23); flag 19 → 6 (end).
- Help is ready after 1,500 ticks in the step. If the mouse has not moved for 1,000 ticks, the bar shows line 29 ("Press F3").
- F3 shows line 30 + step.
- Ghidra's decompiler does not know the Watcom convention: the arguments were re-read in the assembly,
provided in
extracted\pe\dis.txt. REA is read-only under Windows, so no function could be renamed in Ghidra. -
fwandspare now described; the behaviour ofspwas re-read in0x17B80, that offwin0x14798.
Working files produced locally in extracted\pe\ (not published): TUCKER_flat.exe, dis.txt (full
disassembly), callgraph.txt, procs.txt, strings.txt, decompile\*.c (Ghidra output via REA),
rea_evidence.json (REA evidence), outils\ (le2pe.py, dis.py, show.py, pseudo.py).
Page générée depuis docs/ANALYSE.en.md.