Address Length Description
5D0C 64
Game loader - load game code and set execution starting address
7C00 3
Launch the initial game menus
7C03 170
Draw decorative screen border graphics
7CAD 372
Draw game screen decorative border (colours)
7E21 260
Draw the inner border for the intro sequence
7F25 276
Draw the intro sequence landscape
8039 104
Menu 1: Print control options
80A1 32
Menu 1: Scan keyboard input for control option selection
80C1 60
Menu 1: Highlight/store selected control option (1-4)
80FD 30
Menu 1: Check if ENTER pressed to confirm player controls
811B 18
Menu 2: Print the menu
812D 46
Menu 2: Check for ENTER or LOAD keys being pressed
815B 30
Clear the menu screen
8179 65
Menu text PRINT routine
81F3 52
Drawing routine (decorative border and intro sequence background)
8227 56
Drawing routine used for intro sequence graphics
BF1A 25
Initialize game
BF33 45
Load saved game
BF60 61
Start game
BF9D 162
New game initialization - set up game data
C03F 59
Run new game intro sequence
C07A 31
Intro sequence lightning - flashing & sound effects
C099 10
Intro sequence - move Maroc's sprite down one pixel
C0A3 30
Maroc out of energy - clear scroll, calculate & print rank
C0C1 70
Place/replace Maroc in the start room
C107 83
Reset various room-based game data ready for a new room
C15A 102
Room initialization - identify room data set and scenery style, reset room/viewport position
C1C0 32
Set up LEFT vertical wall/floor connector graphics
C1E0 47
Set up room background scenery - part 1
C20F 86
Set up room background scenery - part 2
C265 43
Check for and set up back wall brickwork/rock scenery
C290 50
Set up room floor-wall connector graphics
C2C2 54
Calculate horizontal/vertical room co-ordinates for each room section/components
C2F8 53
Set up RIGHT vertical wall/floor connector graphics
C32D 28
Check room item data sets to see if any doors need setting up
C349 225
New room - door setup
C42A 54
Identify room's interactable objects
C460 161
Set up the room's creatures
C501 112
Set up room foreground scenery objects - part 1
C571 68
Adjust room element co-ordinates based on Maroc's room entry point
C5B5 50
Tunnel room - identify the connecting door set
C5E7 49
Set up tunnel
C618 35
Start of tunnel data setup
C63B 60
Calculate and set current room attribute colours
C677 45
Identify and set up level name for printing on scroll
C6B6 162
Start of game cycle - control checks
C758 11
Pause game routine - check if 'pause' key pressed
C763 55
Pause game routine - play tune and check user input
C79A 43
Pause game routine - save the current game
C7C5 11
Pause game routine - check if 'resume game' key is pressed
C7D0 26
Start of main game loop
C7EA 77
Copy current room item data set into working buffer
C837 104
Adjust room item's position based on the speed and direction of Maroc and the item
C89F 61
Deal with and check room item, creature or scenery
C8DC 131
Determine if creatures will enter the current room
C95F 60
Check which creatures are entering the room
C99B 91
Check for an on-screen door being opened or closed
C9F6 111
Check if Maroc is moving through an open doorway
CA65 41
Maroc is moving through a doorway
CA8E 38
Trigger door opening or closing
CAB4 76
Door opening or closing
CB00 76
Set up 'interactable' objects in current room
CB4C 15
Servant has dropped a held item
CB5B 59
Handle interactable objects that are falling/flying
CB96 18
Check if servant has moved away from Maroc after retrieving an item
CBA8 127
Determine movement of room items/creatures that move around the screen
CC27 75
Check and change object state after positive events match/collision
CC72 54
Check if Maroc has picked up (or been given) a spell or item
CCA8 53
Maroc has picked up a spell
CCDD 68
Maroc has picked up an item
CD21 69
Check for an object trade with warlock
CD66 34
Check for servant picking up an object
CD88 79
Deal with creature in room - create footstep sounds and check for missile collisions
CDD7 154
Change creature behaviour based on Maroc's magic
CE71 64
Maroc is trading items with a warlock
CEB1 35
Maroc has offered an object of insufficient value to a warlock
CED4 55
Decide whether a warlock will fire a missile/bolt at Maroc
CF0B 51
UNSEEN spell effect on creature movement
CF3E 26
Goblin warrior - check if movement is affected by Maroc's magic power
CF58 65
Initialize missile/bolt fired by a creature
CF99 128
Warlock or creature - materialization & disintegration events
D019 50
Warlock - drop carried object
D04B 26
Creature collision check with room boundary and Maroc
D065 23
Creature has collided with Maroc
D07C 31
Maroc has destroyed a creature - initialise disintegration
D09B 81
Missile fired by Maroc or a creature - check for active shield/barrier spells
D0EC 42
Creature's missile has hit Maroc's shield/barrier
D116 24
Check if a missile fired by a creature has hit Maroc, and if so reduce his energy
D12E 51
Check missile room boundary collisions and on-screen lifespan
D161 24
Copy co-ordinates of room's left/right wall connector sections to working buffer
D179 89
Tunnel position & direction
D1D2 45
Check tunnel item type for collision checks and movement (boundary, bats and spiders)
D1FF 28
BAT movement in tunnel section
D21B 32
Tunnel item (boundary or bat/spider) has gone off-screen - reduce on-screen item count
D23B 51
Tunnels - check if Maroc has hit a left/right boundary wall
D26E 15
Start of setting up room routine
D27D 168
Drawing checks and routines for all on-screen room items
D325 12
Start of setting up room routine - part 2
D331 55
Flash the 'MAGIC' text in the bottom left (if Maroc has picked up a spell) and trigger sound effect
D368 222
Determine Maroc's sprite graphic position, height and direction
D446 51
Draw Maroc's sprite graphic
D479 36
Check if Maroc is on a room element/item that drains or restores his energy
D49D 21
Check if Maroc has gone through the portal in room 81
D4B2 74
Draw Maroc's shadow and flickering barrier for SHIELD, PROTECT and DEFENCE spells
D4FC 216
Move and draw the room's foreground scenery items
D5D4 42
Re-calculate room event table data sets
D5FE 60
Prepare data for any creatures that are entering Maroc's room
D63A 23
Gradual energy drain/restore for Maroc's ongoing effect spells
D651 42
Determine whether a warlock should materialize in the room
D67B 41
Prepare a warlock to appear in the room
D6A4 12
Generate a DEMON in the room in the High Temple of Chaos
D6B0 23
Initialize the appearance of a warlock or a demon
D6C7 11
Copy creature, demon or warlock data to room data sets
D6D2 74
Tunnel section - Generate and prepare tunnel items
D71C 20
Tunnel section - Run game timer and randomly generate creatures
D730 100
Tunnel section - Generate a SPIDER or BAT encounter
D794 95
Check for any fired missiles/bolts
D7F3 64
Check which spell has been cast
D833 127
SERVANT spell - check for retrieval of object from Maroc's backpack
D8B2 28
Set up active spell-based room event checks
D8CE 51
HAIL, WAYSTONE, FREEZE, SUMMON or PORTAL spell cast
D901 11
Check/decrement the FREEZE spell timer counter if active
D90C 52
Check if Maroc is carrying too many objects
D940 12
Check if Maroc is out of energy
D94C 190
Deal with room items when Maroc leaves the room
DA0A 67
Maroc's room number has changed - identify new room number
DA4D 59
Maroc is out of energy
DA88 64
Game completion - Maroc has destroyed Avelach, Lord of Chaos
DAC8 20
Object - vertical room position check/adjustment
DADC 18
Fetch object state and prepare graphics for printing
DB06 25
Generate pseudo-random number using ROM address values
DB1F 121
Set up missile data and calculate trajectory
DB98 93
Draw/erase graphics - screen boundary checks
DBF5 76
Draw/erase graphics - calculate screen display address position
DC41 11
Draw/erase graphics - erase graphic bytes
DC4C 7
Draw/erase graphics - draw graphic bytes
DC53 36
Draw/erase graphics - re-calculate screen display address 1 pixel line down
DC77 18
Draw/erase graphics - graphic tile out of bounds
DC89 76
Draw/erase graphics - graphic partly out of bounds - RIGHT border of play area
DCD5 79
Draw/erase graphics - graphic partly out of bounds - LEFT border of play area
DD24 56
Draw the spell pointer arrow, spell charge icons and energy bar on the scroll
DD5C 34
Print the active spell's message text
DD7E 35
Set length of Maroc's energy bar based on his current energy level
DDA1 171
Draw/erase foreground scenery items
DE4C 51
Identify objects for current room
DE7F 56
Identify state of object in current room
DEB7 66
Create data set for interactable room object and copy item/graphic data into it
DEF9 58
Clear the scroll status panel at the bottom of the screen
DF33 137
Print spell names on the scroll
DFBC 17
Calculate servant/icon cursor graphic horizontal/vertical direction & speed
DFCD 108
Check for events/collisions
E039 119
Check if Maroc or room item is within room boundaries
E0B0 18
Copy room item data from item buffer to room data sets
E0C2 51
Setup game graphics
E0F5 117
Create flipped/mirrored version of a particular graphic
E16A 109
Set up data for creature/warlock appearing in Maroc's room
E1D7 48
Play (generic) sound effect
E207 25
Set screen colour for current room
E220 59
Set attribute colours for Maroc
E25B 43
Clear the playing area (pixels)
E286 42
Collision check between creature missile and Maroc's shielding barrier
E2B0 32
Copy room item event data into working buffer
E2D0 42
Set up message text on scroll to print
E2FA 60
Character/text printing
E336 150
Handle creature/graphic animation
E3CC 49
Increase/decrease Maroc's energy and play short beep sound
E3FD 111
Print screen colours for room object/creature
E46C 123
Animation routine for when Maroc is out of energy
E4E7 165
Calculate and print Maroc's rank
E58C 25
Clear the spell message text area on the scroll
E5A5 17
Identify address of message text
E5B6 72
Play music
E5FE 18
Generate sound effect when Maroc picks up a scroll/spell/item
E610 49
Intro sequence - toggle sky colour between blue/yellow
E641 88
Main loop - handle spell menu and keyboard/joystick inputs
E699 97
UP/DOWN controls pressed while in spell menu
E6FA 89
Draw active spell charges and icon on scroll
E753 43
Write active spell message on scroll and draw energy bar
E77E 36
Check for UP/DOWN and FIRE control presses after a spell is selected
E7A2 32
Player has cast a spell
E7C2 43
Print name of ongoing effect spell in small scroll in bottom right of screen
E7ED 16
Set FLASHing attributes for the spell icon in the top right of the scroll
E7FD 85
Check which spell is being cast
E852 14
Check horizontal movement direction & speed (MOVE spell)
E860 32
Increase Maroc's horizonal movement speed
E880 21
Decrease Maroc's horizontal movement speed
E895 11
Check vertical movement direction & speed (MOVE spell)
E8A0 32
Increase Maroc's vertical movement speed
E8C0 21
Decrease Maroc's vertical movement speed
E8D5 25
Set Maroc's speed to zero if FIRE pressed while he is moving
E8EE 59
MOVE spell continued - set viewport scenery speed/movement based on Maroc's
E929 47
Player has cast a spell requiring a controllable cursor (e.g. SERVANT, MISSILE, OPEN)
E958 47
Calculate change to servant/cursor icon horizontal screen position
E987 86
Calculate change to servant/cursor icon vertical screen position
E9DD 64
Check if FIRE pressed when servant or controllable spell cursor is on screen
EA1D 23
Spell selected that is the same as the active 'effect' spell (e.g. SHIELD, UNSEEN)
EA34 109
Deactivate the currently active effect spell
F1FA 28
Code sheet - get the code that the player needs to enter
F21E 66
Code sheet - hash/randomize the security code co-ordinates required for input
F268 12
Code sheet - print code message/character on screen
F274 21
Code sheet - pick a reference co-ordinate for the code that the player has to enter
F289 13
Code sheet - generate 3 random bytes using the FRAMES timer system variable
F296 99
Code sheet - initialize and print security code to enter
F2F9 82
Code sheet - set up and evaluate player code input
F34B 5
Code sheet - set random number seed to generate the random code location address
F350 73
Code sheet - code entry count and validation
FDE8 60
Unencrypt all LOADed game data