Routines
Address
Label
Description
6000
ENTRY
Entry point, and the second half of the tape protection
7C19
TITLE_SCREEN
Title screen: draw the menu and poll for a selection
7C90
HIGHLIGHT_LINE
Flash or unflash a whole menu line
7CA1
SET_HIGHLIGHT
Mark the menu line under the cursor
7CA4
UNHIGHLIGHT
Take the highlight off a menu cell
7CA8
CLEAR_HIGHLIGHT
Unmark it again
7CAB
HIGHLIGHT
Put the highlight on a menu cell
7CAF
DRAW_MENU
Draw the title screen's list of options
7D8A
PRINT_MENU_LINE
Print one line of the menu
7D9A
START_GAME
Set a new game up
7DC3
MAIN_LOOP
The loop the whole game runs in
7E13
MAIN_LOOP_MONSTERS
The second pass: the monsters
7E7E
DISPATCH_ACTOR
Jump to the handler for whatever this actor is
7E93
DISPATCH_FROM_LIST
Dispatch a record named in a room's list
7EB2
FRAME_TICK
The work that happens once per frame
7EC5
FRAME_TICK_NEXT
On to the next of the three, then the clock
807A
INERT_SPRITE
A sprite that does nothing at all
8093
CLEAR_PLAY_AREA
Clear the play area, leaving the status panel alone
809A
FILL_BLOCK
Fill a rectangular block of the display file
80AA
CLEAR_SCREEN
Blank everything and black the border
80B4
CLEAR_DISPLAY
Blank the display file
80C2
CLEAR_ATTRIBUTES
Blank the attribute file
80CB
CLEAR_VARIABLES
Blank the game's variables
80D2
UPDATE_WIZARD
Per-frame update for the wizard
8134
KNIGHT_FIRE
The knight fires his axe
814B
WIZARD_FIRE
The wizard fires his spell
817C
FIRE_WEAPON
Launch the player's weapon
81DB
SPIN_AXE
Drive the spinning axe
81F0
SPIN_SPELL
Drive the wizard's spell
8283
SERF_FIRE
The serf fires his sword
82C3
SIGN_TO_DIRECTION
Turn a signed value into a direction code
82F1
AIM_SWORD
Aim the serf's sword the way it flies
8301
MOVE_ARCS
Drive the second bat, which flies in arcs
83BA
ARC_STEP
Look up the second bat's next step
83EA
SPAWN_MONSTER_INTO_ROOM
Put a new monster into the room
845F
MOVE_ACTOR
Drive the pumpkin and the spider: move, bounce off the walls, animate
8566
CHECK_SHOT_HIT
Has the player's shot hit this monster?
8598
RANDOM_POSITION
A random coordinate near the middle of the room
85B2
CHECK_HIT
Has this monster caught the player?
85EA
MONSTER_CAUGHT_PLAYER
A creature caught the player: thirty-two off, and the creature dies
85F0
ACTOR_TICK_TIMER
Count down the actor's timer, and act when it expires
85F7
SPAWN_MONSTER
The sprite a monster arrives as
862E
MOVE_BAT
Drive a bat
8672
MOVE_HOPPER
Drive the hoppers: the spiky creature and the second ghost
86F2
RANDOM_VELOCITY
Give a creature a random velocity
871A
MOVE_FACE
Drive the small face at $60-$61
8787
COUNTDOWN_ACTOR
The burst a destroyed creature becomes
87A6
MOVE_GHOST
Drive a ghost
882D
HOME_IN
Set a heading towards the player
8862
MOVE_MUMMY
Drive the mummy
8906
MOVE_DRACULA
Drive Dracula
897D
ROOM_SHAPE_OF
Find a room's shape number
8988
MOVE_FRANKENSTEIN
Drive Frankenstein's monster
89ED
MOVE_DEVIL
Drive the devil
8A15
LOSE_FOOD_SIXTEEN
Take sixteen off the life force
8A1E
LOSE_FOOD_EIGHT
Take eight off the life force
8A2F
MOVE_WITCH
Drive the witch
8A80
MOVE_FACING_FLYER
Drive the cloaked figure and the third bat, facing the way they fly
8ADB
SCAN_COLLECTABLES
Walk the eight records at $EB18
8AFF
MOVE_HUMPBACK
Drive the humpback
8B8A
DRAW_FOOD
Redraw the roast on the scroll
8C35
GAME_OVER
Clear the castle away and show how it went
8C63
EAT_FOOD
The handler for a piece of food
8C8C
FLASH_SCORE
Flash the score line while a countdown runs
8CB7
MATERIALISING
Raise the player back out of the floor
8D32
FINISH_MATERIALISING
Turn back into the character and clear the animation
8D45
DYING
Sink the player into the floor
8D61
LOAD_INITIAL_STATE
Put the castle back the way it started
8D6D
TICK_LOW_NIBBLE
Count down the low nibble of +$02
8D77
MOVE_PLAYER
Turn the controls into movement
8DC4
UPDATE_SERF
Per-frame update for the serf
8E26
UPDATE_KNIGHT
Per-frame update for the knight
8EA0
LOSE_LIFE
Take a life and start the player sinking
8ED7
LOSE_FOOD_THIRTY_TWO
Take thirty-two off the life force
8EEF
STEER
Move a heading towards a target, within limits
8F66
APPLY_HEADING
Move a creature, on the axes it is allowed to move on
8F80
SCALE_SIGNED
Divide a signed value by sixteen
8F96
DECAY_HEADING
Let a heading fall back towards nothing
8FCA
TEST_STEP_IN_ROOM
Test the player's step against the room's walk rectangle, axis by axis
8FE9
ALLOW_IF_IN_ROOM
Allow a step that stays inside the walk rectangle
900A
TEST_STEP_BOXES
Test the player's step against the doorways and tables, axis by axis
902B
TEST_ROOM_BOXES
Test one axis of the player's step against the room's doorways and tables
90CC
PLAYER_AT_DOOR
Is the player standing in this doorway?
90FB
NEAR_PLAYER
Is the player within 12 pixels of this thing?
9117
ENTER_ROOM
Move the player through a door and redraw everything
915F
TIMED_DOOR_OPEN
A timed door, open (types $21 and $23)
917D
TIMED_DOOR_SHUT
A timed door, shut (types $20 and $22)
91BC
TRAPDOOR_CLOSED
A trapdoor, closed (type $18): it opens every 256 passes
91F2
DOOR
An ordinary door
9222
DOOR_NEEDS_KEY
Will this locked door open?
9244
DOOR_LOCKED_A
A locked door of the first sort
9252
DOOR_LOCKED_B
A locked door of the second sort
9260
SET_BOTH_HALVES
Give both halves of a door the same sprite
926C
ADD_A_TO_HL
Add an unsigned byte to HL
9273
FIND_CARRIED
Is the player carrying this?
9286
DOOR_OTHER_SIDE
Swap IX to the far side of a door
9291
DRAW_ROOM_CONTENTS
Draw everything in the player's room
92D8
CLEAR_DRAW_FLAG
Clear bit 1 of the drawing flags
92E0
DRAW_AT_POSITION
Draw a thing where its record says it is
92F5
PICK_UP
Pick a collectable up
9326
REMEMBER_CARRIED
Record what has just been picked up
934C
SHIFT_CARRIED
Move the carried items along one slot
9358
DROP_CARRIED
Put the oldest carried thing back in the room
938B
READ_PICKUP_KEY
Read the pick-up key, SYMBOL SHIFT
9398
READ_CURSOR_KEYS
Read the cursor keys
93BE
READ_CONTROLS
Read the player's controls, whichever kind they chose
93E3
PUT_DOWN
Put a carried object down
9421
DOOR_SERF
A door the serf can use
9443
PLACE_PLAYER
Build the player's record from scratch
9489
PAUSE
Pause while SPACE is pressed on its own
94B6
PLACE_ACG_KEY
Hide the three pieces of the A.C.G. key
94F5
CHOOSE_TIMED_DOORS
Turn about half the plain doors into timed doors
9546
DOOR_OPEN_OR_SHUT
Open or shut a door, according to its type
954D
OPEN_DOOR
Open a door, both halves at once
9565
SHUT_DOOR
Shut a door, both halves at once
957D
CHECK_IN_DOORWAY
Note whether the player is standing in a doorway
95A9
DROP_GRAVESTONE
Leave an object where the player is standing
95D7
GRAVESTONE
The gravestone left where the player died
95DA
TICK_CLOCK
Advance the elapsed-time clock
961B
ACG_DOOR
The A.C.G. door: it opens only for the whole of the A.C.G. key
9641
DRAW_SUMMARY
Print the three end-of-game figures
96AF
MARK_ROOM_VISITED
Mark a room as seen, by writing the instruction that does it
96C9
COUNT_ROOMS_EXPLORED
Work out how much of the castle has been seen
96EC
SHOW_END_SCREEN
Draw the screen shown when a game ends
9731
TRAPDOOR_FALL
Fall through a trapdoor
986A
SET_ARRIVAL_HEADING
Head the player into the room, away from the arrival door
988B
MUSHROOM
The mushroom that drains you
98B1
MUSHROOM_DRAIN
Drain a unit of life force and go round again
98C8
MUSHROOM_KILLED_PLAYER
Rub the mushroom out and take the life
98D2
PLACE_KEYS
Put three of the keys, and the mummy, in rooms chosen for this game
9904
TABLE_LOOKUP_3BIT
Pick one of eight from a table
9924
REGROW_FOOD
Grow the food back, one slot every 512 passes
9962
DRAW_SPRITE_PIXELS
Draw a sprite, choosing the routine from the drawing mode
9980
DRAW_SPRITE_COLOURS
Draw a sprite from the other set of eight routines
9995
FETCH_SPRITE
Look up a sprite's bitmap and work out where it goes
99AF
FETCH_SPRITE_ATTRS
Look up a sprite's colours
99C9
BLIT_SPRITE
Copy a sprite to the screen, combining it however the caller asked
99E5
BLIT_SPRITE_MIRRORED
Copy a sprite to the screen, back to front
9A0A
DRAW_TURNED_RIGHT
Drawing mode 2: furniture's pixels turned a quarter clockwise
9A50
DRAW_FLIP_ANTIDIAGONAL
Drawing mode 3: furniture's pixels mirrored across the bottom-left to top-right diagonal
9A92
REVERSE_BITS
Turn a byte back to front
9A9D
NEXT_SPRITE_ROW
Step the sprite pointer on by one row
9AA5
PREVIOUS_SPRITE_ROW
Step the sprite pointer back one row
9AAD
MULTIPLY
Multiply DE by A
9ABA
START_AT_LAST_ROW
Point at the bottom row of a sprite
9ACB
DRAW_UPSIDE_DOWN
Drawing mode 4: furniture's pixels upside down
9AEF
BLIT_SPRITE_FLIPPED
Drawing mode 5: furniture turned a half turn (mirrored and upside down)
9B14
DRAW_FLIP_DIAGONAL
Drawing mode 6: furniture's pixels mirrored across the top-left to bottom-right diagonal
9B5D
DRAW_TURNED_LEFT
Drawing mode 7: furniture's pixels turned a quarter anticlockwise
9BA2
PIXEL_TO_SCREEN
Convert pixel coordinates to a display file address
9BC1
NEXT_PIXEL_ROW
Step a screen address down one pixel row
9BD2
PIXEL_TO_ATTR
Convert pixel coordinates to an attribute file address
9BEA
DRAW_ROOM
Draw the room the player is in
9C2F
DRAW_OUTLINE
Walk the edge list and draw the room's outline
9C61
PLOT_PIXEL
Plot one pixel
9C79
DRAW_LINE
Draw a line between two points
9D19
SPRITE_COMBINE_OPCODE
Choose the instruction that puts a sprite byte on the screen
9D25
COLOURS_AS_STORED
Drawing mode 0: furniture's colours as stored
9D47
COLOURS_MIRRORED
Drawing mode 1: furniture's colours mirrored
9D6F
COLOURS_TURNED_RIGHT
Drawing mode 2: furniture's colours turned a quarter clockwise
9DA0
COLOURS_FLIP_ANTIDIAGONAL
Drawing mode 3: furniture's colours mirrored across the bottom-left to top-right diagonal
9DCE
COLOURS_UPSIDE_DOWN
Drawing mode 4: furniture's colours upside down
9DF8
COLOURS_HALF_TURN
Drawing mode 5: furniture's colours turned a half turn
9E21
COLOURS_FLIP_DIAGONAL
Drawing mode 6: furniture's colours mirrored across the top-left to bottom-right diagonal
9E55
COLOURS_TURNED_LEFT
Drawing mode 7: furniture's colours turned a quarter anticlockwise
9E86
SPRITE_OF_WORKSPACE
Find the graphics for what is in the workspace
9E89
SPRITE_ADDRESS
Find a sprite's graphics
9E96
SPRITE_OF_ACTOR
Find this actor's graphics
9E9B
ERASE_DRAW_ROWS
Erase the old rows and draw the new, interleaved
9ECE
ERASE_UNSHIFTED
XOR two unshifted bytes: the erase path's plot for a thing on a cell boundary
9EDC
FETCH_ROW
Read two bytes of a sprite row
9EE6
ERASE_SHIFT_CHAIN
The erase path's unrolled shift chain
9F03
SCREEN_ROW_UP
Move a display file address up one pixel row
9F13
DRAW_UNSHIFTED
XOR two unshifted bytes: the draw path's plot for a thing on a cell boundary
9F21
SHIFT_AND_PLOT
Shift one row of a sprite into place and draw it
9F2B
SHIFT_CHAIN
Seven shifts, entered part-way down
9F40
SETUP_ALT_ENTRIES
Two short entries into the drawing setup
9F4A
DRAW_THING
Draw a record's sprite
9F56
ERASE_THING
Rub a record's sprite out
9F74
SETUP_BOTH_BANKS
Set up the drawing address in both register banks
9F80
SETUP_ERASE
Work out where a thing used to be
9F9F
SETUP_SPRITE_DRAW
Work out where a sprite goes, and how far to shift it
9FCA
REDRAW_MOVED
Redraw a thing that may have moved
9FFB
ACTOR_TO_WORKSPACE
Copy an actor's position and sprite into the drawing workspace
A00E
WORKSPACE_AND_DRAW
Note where a thing is, then draw it
A07A
COLOUR_STILL
Colour a thing that has not moved
A08D
COLOUR_MOVED_RIGHT
Colour a thing that moved right
A0A3
COLOUR_MOVED_LEFT
Colour a thing that moved left
A0B7
COLOUR_MOVED_DOWN
Colour a thing that moved down
A0D2
COLOUR_MOVED_DOWN_RIGHT
Colour a thing that moved down and right
A0EC
COLOUR_MOVED_UP
Colour a thing that moved up
A0FE
COLOUR_MOVED_UP_LEFT
Colour a thing that moved up and left
A110
COLOUR_MOVED_DOWN_LEFT
Colour a thing that moved down and left
A127
COLOUR_MOVED_UP_RIGHT
Colour a thing that moved up and right
A13B
DRAW_INVENTORY
Draw the three carried objects on the scroll
A14D
DRAW_LIST
Draw a list of things through the scratch record
A185
ERASE_STRIP
Blank twenty bytes where something was
A19C
ADD_SCORE
Add to the score and redraw it
A1D3
PLOT_TILE
Plot one 8x8 tile and step right
A1F3
PRINT_STRING
Print a string of tiles in a single colour
A219
DRAW_SCROLL
Draw the scroll down the side of the screen
A240
PAINT_PANEL
Colour the status panel to go with the room
A2CE
DRAW_LIVES
Draw the remaining lives on the scroll
A311
DRAW_TITLE_ICONS
Draw the nine pictures on the title screen
A379
DIVIDE_SLOPE
Divide, for a line's slope
A39E
NEGATE_HL
Negate HL
A3A8
BEEP
Square wave on the beeper
A3BD
BEEP_ENTRIES
Two more ways into BEEP
A3C7
SOUND_FOOTSTEP
The footstep, two tones alternating
A3E0
SOUND_LIFE_PIP
The pip that goes with the flashing score at the start of a life
A3E5
PLAY_SOUND_CAUGHT
Start sound $64, the one for being caught
A3EF
SOUND_CAUGHT
Sound $64 (being caught), one frame of it
A3FE
END_SOUND
Free the slot when a sound finishes
A403
PLAY_SOUND_NEW_ROOM
Start sound $65
A408
SOUND_NEW_ROOM
Sound $65 (entering a room), one frame of it
A41B
SOUND_SWEEP_A41B
A short sweep
A427
SOUND_SWEEP_UP
A rising sweep
A438
SOUND_SWEEP_DOWN
A short falling sweep
A445
SOUND_WEAPON_GONE
The sound of a weapon's flight ending, or a burst ending
A45F
SOUND_RISE_SINK
The note of the player sinking or rising
A46E
SOUND_NOISE_BURST
A short burst of noise
A485
PLAY_SOUND_EATING
Start sound $A0
A48B
SOUND_EATING
Sound $A0, one frame of it
A4B0
SOUND_BOUNCE
The sound of a weapon bouncing off a wall