-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdata-reference.ref
More file actions
54 lines (44 loc) · 2.25 KB
/
data-reference.ref
File metadata and controls
54 lines (44 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
; Glossary of custom terminology used in this disassembly.
;
; These terms were created during reverse engineering to describe game
; structures and concepts. They are not derived from the original game's
; source code or documentation.
[DataReference:viewport:Viewport]
The viewport is the visible portion of the game world displayed on screen.
It contains a fixed-size array of slots that hold active game objects
(enemies, fuel depots, etc.) currently visible or about to scroll into view.
The viewport is implemented as the #R$5F00 array with 15 slots (46 bytes total:
15 × 3 bytes + 1 end marker byte).
[DataReference:slot:Slot]
A slot is a 3-byte entry in the viewport array (#R$5F00) that can hold one
game object. Each slot has the following structure:
#TABLE(default)
{ =h Byte | =h Contents }
{ 0 | X position (0-255 pixels) }
{ 1 | Y position (0-255 pixels, increases as object scrolls down) }
{ 2 | Object definition byte (type, orientation, activation state) }
TABLE#
A slot can be in one of three states:
#TABLE(default)
{ =h State | =h X Value | =h Description }
{ Empty | <code>$00</code> (<code>SET_MARKER_EMPTY_SLOT</code>) | Slot is unused, skipped during iteration }
{ Occupied | <code>$01</code>–<code>$FE</code> | Contains a valid game object }
{ End marker | <code>$FF</code> (<code>SET_MARKER_END_OF_SET</code>) | Marks end of active objects; iterator resets to start via #R$7627 }
TABLE#
The iterator at #R$5F60 traverses slots during
the main object processing loop (#R$708E). It advances through all slots
(including empty ones), checking each slot's state before processing.
[DataReference:objectDefinition:Object Definition Byte]
The object definition byte (byte 2 of each slot) encodes the object's type
and state using bit fields:
#TABLE(default)
{ =h Bit(s) | =h Meaning }
{ 0-2 | Object type (<code>OBJECT_*</code> constants: helicopter, ship, tank, etc.) }
{ 3 | Rock flag (1=rock decoration on land, 0=interactive object) }
{ 4 | Unused }
{ 5 | Tank location (1=river bank, 0=bridge) }
{ 6 | Orientation (1=left-facing, 0=right-facing) }
{ 7 | Activation (1=active/interactive, 0=spawning/inactive) }
TABLE#
Objects spawn with bit 7 clear (inactive). On their first frame in the
viewport, #R$708E sets bit 7 to activate them, enabling movement and collision.