Hydrofool
Routines
Address
Description
61A7
JP (HL) trampoline
61A8
Initialize the object free list: chain B 24-byte records starting at DE (each record's first word points to the next)
61C1
Reset object system
61E3
New-game initialization
6254
Set object position (IX+5/+6) from grid index A (cell centre: row*8+4, col*8+4)
6269
Set current room to A: locate its description record and build the room
62F9
Test whether the current room is this level's Plug Room
630D
Plug Room grid setup
6329
Build the door/exit bitfield at $612B from the room description's byte1
6344
Draw single-piece doors, for $612B bits 0 and 3
6377
Draw three-piece doors, for $612B bits 1 and 2
63D0
Clear shadow screen
642F
Draw the fixed wall/decoration layout selected by $6129
6470
Redraw one terrain grid cell (index in BC), used to restore terrain hidden behind an object's sprite
64BB
Draw loop shared with
6470
: resolve a grid/terrain value to a sprite via the
74CE
/
750B
tables and draw it
64F3
Redraw the whole room's terrain grid
6503
Per-frame rust/oil tick: advances the rust timer, killing the player at $52
6543
Draw one rust-gauge segment: compute its screen column from A and its sprite from table $653F, then draw via
8128
655E
Draw the rust/oil gauge: base icon plus repeated
6543
icons, scaled by the rust timer $6502
6580
Tick the rust/oil gauge
6593
Draw the message window's border/frame: corner icon plus 8-wide top and bottom edge strips, all via
8128
65DB
Draw message window: room/creature title line + rotating clue/joke message line
6622
Use an oil can (kind $6E pickup, see
8AFB
): resets rust timer, decrements oil-can count, plays sound
663B
Draw the oil-can icon and its remaining count on HUD ($6198)
6653
Prepare room with color 0
6657
Get room color from room description and store to 6175
6663
Spawn the room's creature (dynamic object)
6692
Insert a record pointer (DE) into the draw queue (
60EC
), sorted by the record's offset+2 byte
66CE
Room build: spawn each active object then settle it to the ground (height field +0x07, via collision test
9BF0
)
6728
Queue this room's dropped items for drawing
6743
Draw the room title, awarding a first-visit bonus the first time this room is entered
676D
Draw current room
67F1
Attempt to move to an adjacent room (horizontal, via a door) in the direction given by ($8DC1)
6880
Count item-table entries whose room byte matches A
6895
Draw the currently-held item's icon, and its ammo count if it's a weapon, on HUD
68C1
Consume one shot of ammo; auto-drop the weapon when empty
69AC
Draw the room's background
6AAA
Interrupt service routine: advance the frame counter, drive the AY music chip, then run per-frame game logic
6AE7
ISR continuation setup: latch the resume address and clear the frame-ready flag
6AF1
Idle loop: enable interrupts, drive the sound-effect player each pass
6AF8
Jump to new-game initialization
6AFB
Self-modified per-frame hook, called by the ISR
6AAA
(currently a RET stub, patched by
6AFC
)
6AFC
Patch
6AFB
to RET (disabling the hook), then jump to new-game initialization
6B05
New-game initialization
6B71
Main game loop
7CEC
Print engine entry point
7CF9
Print char routine (default mode)
7D32
Print engine mode: set inverse video flag
7D3F
Print engine mode: dispatch control code $16
7D48
Print engine mode: set cursor row
7D57
Print engine mode: set cursor column
7D68
Print string routine
7DC7
Print engine: plot one character glyph into the shadow-screen font buffer, then blit it
7E4F
Flip sprite horizontally
7EA9
Scan all 6 keyboard half-rows into the row-snapshot buffer at $6184 down to $617F, used by
7EBE
's input reader
7EBE
Read input: normalize the active control method into the 5-bit mask at
6186
7F8E
Reset the redraw bounding-box trackers ($6194-$6197) to empty
7F9B
Fold a screen rectangle (DE = top/left, HL = bottom/right pair) into the running redraw bounding box $6194-$6197
7FC0
Reset the sprite-draw clip window ($610A-$610D) to the full play-field
7FCD
Compute the current sprite's own screen bounding box, clamped to the play-field, and fold it into the redraw tracker
8011
Sprite draw: clip the current sprite against the screen window ($610A-$610D), adjusting its data pointer and dimensions
809D
Sprite draw: build the per-row blit queue for the shadow screen, from the clipped sprite
8107
Sprite draw: execute the blit queue built by
809D
, copying 2 planes (pixels+attributes?) per queued row
8128
Draw sprite C with its mask at screen position DE (mask sprite number from the table at
6C06
; A bit 7 = mirror flag)
8230
Sprite draw: masked blit (AND mask, OR sprite data) into the shadow screen -- full-width and partial-width paths
82A6
Non-aligned sprite blit: copy the nibble-merged buffer (built by
82DB
) to the destination, row by row
82DB
Sprite draw: RRD nibble-shift tail for 5 planes, non-byte-aligned blit variant
82F0
Sprite draw: full-width unmasked row copy (no mask needed, direct LDIR per row)
8315
Draw a wall/decoration piece
835E
Flush the queued redraw requests at $9D3C: draw each piece via
8315
, then clear the queue
8445
Per-frame sound-effect player: step the currently-playing effect's tone commands
848E
Request sound effect A (queued at $61A2, gated by the $61A0/$61A1 flags)
84AE
Dynamic object allocator
84ED
Load a sprite's
A5DC
record into the "current sprite" scratch variables at
618D
, ready for
8128
to draw it
8501
Print string at HL until terminator byte $5E or $2B
850E
Print an inline string embedded right after the caller's CALL instruction
8513
Print a message-window string
8523
Print a BCD number
854C
Print one digit (JP target self-modified by
8523
)
854F
Print BCD byte A as two digits, high digit blanked to a space if zero
8596
System/interrupt setup before the main menu
85A1
Main menu screen: title, entry list A-D, controls menu; loops until a selection starts the game
86CC
Draw the end-game stats screen
885A
Redraw the score display on HUD (last 4 BCD digits of
611B
via
8523
)
8879
Add a 5-digit BCD value at
8874
to the score (
611B
)
888E
Add a bonus (HL, 5-digit BCD) to the score, then redraw the score display
8894
Subtract a BCD value from the score
88B9
Read the next value from a small circular queue, head pointer at IY+0/1, wrap pointer at IY+2/3, advancing the head
88D7
Add a bonus to the score, value from a circular queue via
88B9
88DD
Subtract a BCD value from the score, value from a circular queue via
88B9
88E3
Search the buffer at $7C83 for byte A (CPIR, length from $7C88)
8968
PLAYER per-frame behaviour handler
8A87
Attempt to move to an adjacent room (vertical, via whirlpool/bubble)
8ABB
Apply the object's facing direction to its position (IX+5/+6), returning the OLD position in BC
8AD9
Take one walk step
8AFB
Fire/pick-up button handler: attack with the held weapon, or pick up/drop an item
8C35
Weapon hit-response text: print "BLOCKED" via
8513
, then return
8CDF
Player dive-depth step
8D11
Alternate PLAYER behaviour handler (swapped into $8DB9 by
9564
; see
8968
and
8DB6
)
8D8D
Attack: fire the held weapon (reached from
8AFB
when a weapon is held)
8E3F
Special grid-value spawn routine (value $68) -- rearing snake
8E6E
Creature spawn: compute initial height
8EA7
Special grid-value spawn routine (values $66/$6A) -- bubble source ($6A full-strength, $66 weak; see
9602
)
8EF2
Special grid-value spawn routine (value $67) -- plant/coral
8F1E
Special grid-value spawn routine (value $69) -- whirlpool
8F4C
Special grid-value spawn routine (value $6B) -- plug
8F82
Spawn room-membership-gated decoration pairs
9021
Per-frame animation-table stepper
9085
Object type stub: dispatch into
90A8
's creature AI setup
90A8
Creature idle/wander AI
91A6
Creature pause/transform step
9208
Object type stub: dispatch into
9232
's shared setup
9232
Object type stub: dispatch into
90A8
's creature AI setup
923E
Save continuation
925C
Creature waypoint movement
9341
Room-creature per-frame behaviour handler
9401
Creature hit/defeat sequence, called from
9341
when the "just hit" flag (bit 2 of +0x0D) is set
9471
Behaviour handler of the fixed object record at $8E0F (object identity not yet known)
949E
Behaviour handler of the fixed object record at $8E27 (object identity not yet known)
94CA
Object lifetime tick
94EE
Per-frame behaviour handler for value-$67 objects -- plant/coral
94F4
Plug Room win-condition trigger
952D
Per-frame behaviour handler for value-$69 objects -- whirlpool
957C
Per-frame behaviour handler for value-$66/$6A objects -- bubble source
9602
Per-frame behaviour handler for the individual rising-bubble particle spawned by
957C
9684
Per-frame behaviour handler for value-$68 objects -- rearing snake
9745
Mark and redraw the static terrain cells behind an object's sprite, so moving objects don't leave trails
97BA
Draw an object's sprite
97FC
Change current room to A = new room number
9808
Per-frame main loop entry
983C
Per-frame dynamic object dispatcher (walks the active object list from the head at
610E
)
9900
Draw all queued objects: walk the record-pointer list at $60EC (count at $60EB), drawing each via
97BA
9923
Spawn the weapon projectile object (thrown from the player's position, facing $8DC1), handler
9963
9963
Weapon projectile per-frame handler: move (double step) and detect a hit on collision
99A1
Direction-indexed sprite-animation stepper
99D1
NEG / not NEG
99D5
Sprite-animation stepper: read next entry from a per-object sprite-number table, advancing a phase counter
9A49
Snap the object's position (IX+5/+6) to its grid-cell centre, then finalize via
9A60
9A60
Dynamic object finalizer
9AAB
Search the (key,data) pair table at $74CE for key A; returns Z with HL pointing at the matched pair's data byte
9ABC
Terrain collision test for one screen point (B,C): convert to a grid cell and check its content
9AFD
Terrain sub-cell shape resolver
9B5A
Collision/overlap scan
9BD4
Depth-tie resolver
9BF0
Collision test
9C35
End-of-frame screen flip
FB90
Menu tune + key-wait driver
FBB4
Melody-index table reader/advancer, used by
FBD7
FBC1
Melody-index to period lookup, used by
FBD7
FBCF
Continuation of
FBB4
FBD7
Play one note / check key selection
FC34
Tone generator loop (continued)
FC46
Plain delay loop (no sound)