Memory map
Address
Length
Description
23820
64
Game loader - load game code and set execution starting address
23884
1117
Unused
25001
1383
Room data - standard rooms
26384
128
Room data - vertical tunnel sections
26512
1020
Room data - connecting doors
27532
240
Room data - creatures
27772
96
Warlock and other creatures - stats and attributes
27868
72
Missile data
27940
216
Graphics - character set A-Z
28156
448
Spells list
28604
438
Spell text messages
29042
164
Level names
29206
227
Level ranks
29433
90
Game completion and start messages
29523
28
Save game message
29551
2149
Room objects
31700
44
Unidentified code (unused)
31744
3
Launch the initial game menus
31747
170
Draw decorative screen border graphics
31917
372
Draw game screen decorative border (colours)
32289
260
Draw the inner border for the intro sequence
32549
276
Draw the intro sequence landscape
32825
104
Menu 1: Print control options
32929
32
Menu 1: Scan keyboard input for control option selection
32961
60
Menu 1: Highlight/store selected control option (1-4)
33021
30
Menu 1: Check if ENTER pressed to confirm player controls
33051
18
Menu 2: Print the menu
33069
46
Menu 2: Check for ENTER or LOAD keys being pressed
33115
30
Clear the menu screen
33145
65
Menu text PRINT routine
33210
57
Unused colour/attribute fill routine
33267
52
Drawing routine (decorative border and intro sequence background)
33319
56
Drawing routine used for intro sequence graphics
33375
443
Graphics: Intro sequence inner border & backdrop
33818
1936
Graphics: Game screen (decorative border)
35754
24
Menu screens - data store
35778
216
First menu screen text
35994
51
Second menu screen text
36045
21
Load saved game text
36066
2785
Unused
38851
370
Data - sprite and graphic address pointer table
39221
26
Unused
39247
897
Graphics - Maroc the Mage
40144
248
Graphics - Doors
40392
123
Graphics - Wall/floor connector sections
40515
165
Graphics - Door frames
40680
91
Graphics - Brickwork graphics
40771
105
Graphics - Wall/floor connector sections 2
40876
137
Graphics - Door frames 2
41013
101
Graphics - Cavern back wall background graphics
41114
65
Graphics - Tunnels
41179
41
Graphics - Servant
41220
60
Graphics - Eye cursor
41280
36
Graphics - Scroll
41316
26
Graphics - Caliburn
41342
125
Graphics - Spell icons
41467
240
Graphics - Missiles & bolts
41707
214
Graphics - Warlock
41921
219
Graphics - Guardian of Chaos
42140
177
Graphics - Goblin warrior
42317
211
Graphics - Goblin missile thrower
42528
174
Graphics - Wraith
42702
377
Graphics - Demon
43079
144
Graphics - Warlock/demon materialization effect
43223
271
Graphics - Disintegration animation
43494
116
Graphics - Shield spell barrier
43610
53
Graphics - Foreground scenery - skeleton
43663
259
Graphics - Foreground scenery items 1
43922
122
Graphics - Foreground scenery items 2
44044
237
Graphics - Foreground scenery items 3
44281
142
Graphics - Foreground scenery items 4
44423
20
Graphics - Maroc's shadow
44443
6
Graphics - 'Dummy' graphic
44449
139
Graphics - Spider
44588
186
Graphics - Bat
44774
13
Graphics - Scroll display icon for spell charges
44787
178
Graphics - Energy bar (on scroll)
44965
74
Graphics - Scroll pointer arrow
45039
81
Graphics - Key and Chest
45120
66
Graphics - Buried bottle and Lever
45186
59
Graphics - Cheese & Mouse Hole
45245
59
Graphics - Keys (key 2 and hanging key)
45304
53
Graphics - Star
45357
105
Graphics - Various
45462
73
Graphics - Scorpion
45535
126
Graphics - Axe, Bone, Orb, Sabre
45661
41
Graphics - Mouse
45702
49
Graphics - Sabre - animated
45751
116
Graphics - Trapdoor
45867
48
Graphics - Lady
45915
111
Graphics - Key 3, Oil Jar, Gem, Idol
46026
79
Graphics - Fire
46105
150
Graphics - Elemental Symbols
46255
18
Graphics - Pick Axe
46273
120
Graphics - Portal Floor Symbol and Door
46393
44
Graphics - Avelach, Lord of Chaos
46437
64
Graphics - Elemental Symbol (blank) and Healing Star
46501
2419
Unused
48920
2
Controls choice and game flag
48922
25
Initialize game
48947
45
Load saved game
48992
61
Start game
49053
162
New game initialization - set up game data
49215
59
Run new game intro sequence
49274
31
Intro sequence lightning - flashing & sound effects
49305
10
Intro sequence - move Maroc's sprite down one pixel
49315
30
Maroc out of energy - clear scroll, calculate & print rank
49345
70
Place/replace Maroc in the start room
49415
83
Reset various room-based game data ready for a new room
49498
102
Room initialization - identify room data set and scenery style, reset room/viewport position
49600
32
Set up LEFT vertical wall/floor connector graphics
49632
47
Set up room background scenery - part 1
49679
86
Set up room background scenery - part 2
49765
43
Check for and set up back wall brickwork/rock scenery
49808
50
Set up room floor-wall connector graphics
49858
54
Calculate horizontal/vertical room co-ordinates for each room section/components
49912
53
Set up RIGHT vertical wall/floor connector graphics
49965
28
Check room item data sets to see if any doors need setting up
49993
225
New room - door setup
50218
54
Identify room's interactable objects
50272
161
Set up the room's creatures
50433
112
Set up room foreground scenery objects - part 1
50545
68
Adjust room element co-ordinates based on Maroc's room entry point
50613
50
Tunnel room - identify the connecting door set
50663
49
Set up tunnel
50712
35
Start of tunnel data setup
50747
60
Calculate and set current room attribute colours
50807
45
Identify and set up level name for printing on scroll
50852
18
Lookup table - room numbers and their corresponding level names & warlocks
50870
162
Start of game cycle - control checks
51032
11
Pause game routine - check if 'pause' key pressed
51043
55
Pause game routine - play tune and check user input
51098
43
Pause game routine - save the current game
51141
11
Pause game routine - check if 'resume game' key is pressed
51152
26
Start of main game loop
51178
77
Copy current room item data set into working buffer
51255
104
Adjust room item's position based on the speed and direction of Maroc and the item
51359
61
Deal with and check room item, creature or scenery
51420
131
Determine if creatures will enter the current room
51551
60
Check which creatures are entering the room
51611
91
Check for an on-screen door being opened or closed
51702
111
Check if Maroc is moving through an open doorway
51813
41
Maroc is moving through a doorway
51854
38
Trigger door opening or closing
51892
76
Door opening or closing
51968
76
Set up 'interactable' objects in current room
52044
15
Servant has dropped a held item
52059
59
Handle interactable objects that are falling/flying
52118
18
Check if servant has moved away from Maroc after retrieving an item
52136
127
Determine movement of room items/creatures that move around the screen
52263
75
Check and change object state after positive events match/collision
52338
54
Check if Maroc has picked up (or been given) a spell or item
52392
53
Maroc has picked up a spell
52445
68
Maroc has picked up an item
52513
69
Check for an object trade with warlock
52582
34
Check for servant picking up an object
52616
79
Deal with creature in room - create footstep sounds and check for missile collisions
52695
154
Change creature behaviour based on Maroc's magic
52849
64
Maroc is trading items with a warlock
52913
35
Maroc has offered an object of insufficient value to a warlock
52948
55
Decide whether a warlock will fire a missile/bolt at Maroc
53003
51
UNSEEN spell effect on creature movement
53054
26
Goblin warrior - check if movement is affected by Maroc's magic power
53080
65
Initialize missile/bolt fired by a creature
53145
128
Warlock or creature - materialization & disintegration events
53273
50
Warlock - drop carried object
53323
26
Creature collision check with room boundary and Maroc
53349
23
Creature has collided with Maroc
53372
31
Maroc has destroyed a creature - initialise disintegration
53403
81
Missile fired by Maroc or a creature - check for active shield/barrier spells
53484
42
Creature's missile has hit Maroc's shield/barrier
53526
24
Check if a missile fired by a creature has hit Maroc, and if so reduce his energy
53550
51
Check missile room boundary collisions and on-screen lifespan
53601
24
Copy co-ordinates of room's left/right wall connector sections to working buffer
53625
89
Tunnel position & direction
53714
45
Check tunnel item type for collision checks and movement (boundary, bats and spiders)
53759
28
BAT movement in tunnel section
53787
32
Tunnel item (boundary or bat/spider) has gone off-screen - reduce on-screen item count
53819
51
Tunnels - check if Maroc has hit a left/right boundary wall
53870
15
Start of setting up room routine
53885
168
Drawing checks and routines for all on-screen room items
54053
12
Start of setting up room routine - part 2
54065
55
Flash the 'MAGIC' text in the bottom left (if Maroc has picked up a spell) and trigger sound effect
54120
222
Determine Maroc's sprite graphic position, height and direction
54342
51
Draw Maroc's sprite graphic
54393
36
Check if Maroc is on a room element/item that drains or restores his energy
54429
21
Check if Maroc has gone through the portal in room 81
54450
74
Draw Maroc's shadow and flickering barrier for SHIELD, PROTECT and DEFENCE spells
54524
216
Move and draw the room's foreground scenery items
54740
42
Re-calculate room event table data sets
54782
60
Prepare data for any creatures that are entering Maroc's room
54842
23
Gradual energy drain/restore for Maroc's ongoing effect spells
54865
42
Determine whether a warlock should materialize in the room
54907
41
Prepare a warlock to appear in the room
54948
12
Generate a DEMON in the room in the High Temple of Chaos
54960
23
Initialize the appearance of a warlock or a demon
54983
11
Copy creature, demon or warlock data to room data sets
54994
74
Tunnel section - Generate and prepare tunnel items
55068
20
Tunnel section - Run game timer and randomly generate creatures
55088
100
Tunnel section - Generate a SPIDER or BAT encounter
55188
95
Check for any fired missiles/bolts
55283
64
Check which spell has been cast
55347
127
SERVANT spell - check for retrieval of object from Maroc's backpack
55474
28
Set up active spell-based room event checks
55502
51
HAIL, WAYSTONE, FREEZE, SUMMON or PORTAL spell cast
55553
11
Check/decrement the FREEZE spell timer counter if active
55564
52
Check if Maroc is carrying too many objects
55616
12
Check if Maroc is out of energy
55628
190
Deal with room items when Maroc leaves the room
55818
67
Maroc's room number has changed - identify new room number
55885
59
Maroc is out of energy
55944
64
Game completion - Maroc has destroyed Avelach, Lord of Chaos
56008
20
Object - vertical room position check/adjustment
56028
18
Fetch object state and prepare graphics for printing
56046
11
Store for base address pointers
56057
13
Unused
56070
25
Generate pseudo-random number using ROM address values
56095
121
Set up missile data and calculate trajectory
56216
93
Draw/erase graphics - screen boundary checks
56309
76
Draw/erase graphics - calculate screen display address position
56385
11
Draw/erase graphics - erase graphic bytes
56396
7
Draw/erase graphics - draw graphic bytes
56403
36
Draw/erase graphics - re-calculate screen display address 1 pixel line down
56439
18
Draw/erase graphics - graphic tile out of bounds
56457
76
Draw/erase graphics - graphic partly out of bounds - RIGHT border of play area
56533
79
Draw/erase graphics - graphic partly out of bounds - LEFT border of play area
56612
56
Draw the spell pointer arrow, spell charge icons and energy bar on the scroll
56668
34
Print the active spell's message text
56702
35
Set length of Maroc's energy bar based on his current energy level
56737
171
Draw/erase foreground scenery items
56908
51
Identify objects for current room
56959
56
Identify state of object in current room
57015
66
Create data set for interactable room object and copy item/graphic data into it
57081
58
Clear the scroll status panel at the bottom of the screen
57139
137
Print spell names on the scroll
57276
17
Calculate servant/icon cursor graphic horizontal/vertical direction & speed
57293
108
Check for events/collisions
57401
119
Check if Maroc or room item is within room boundaries
57520
18
Copy room item data from item buffer to room data sets
57538
51
Setup game graphics
57589
117
Create flipped/mirrored version of a particular graphic
57706
109
Set up data for creature/warlock appearing in Maroc's room
57815
48
Play (generic) sound effect
57863
25
Set screen colour for current room
57888
59
Set attribute colours for Maroc
57947
43
Clear the playing area (pixels)
57990
42
Collision check between creature missile and Maroc's shielding barrier
58032
32
Copy room item event data into working buffer
58064
42
Set up message text on scroll to print
58106
60
Character/text printing
58166
150
Handle creature/graphic animation
58316
49
Increase/decrease Maroc's energy and play short beep sound
58365
111
Print screen colours for room object/creature
58476
123
Animation routine for when Maroc is out of energy
58599
165
Calculate and print Maroc's rank
58764
25
Clear the spell message text area on the scroll
58789
17
Identify address of message text
58806
72
Play music
58878
18
Generate sound effect when Maroc picks up a scroll/spell/item
58896
49
Intro sequence - toggle sky colour between blue/yellow
58945
88
Main loop - handle spell menu and keyboard/joystick inputs
59033
97
UP/DOWN controls pressed while in spell menu
59130
89
Draw active spell charges and icon on scroll
59219
43
Write active spell message on scroll and draw energy bar
59262
36
Check for UP/DOWN and FIRE control presses after a spell is selected
59298
32
Player has cast a spell
59330
43
Print name of ongoing effect spell in small scroll in bottom right of screen
59373
16
Set FLASHing attributes for the spell icon in the top right of the scroll
59389
85
Check which spell is being cast
59474
14
Check horizontal movement direction & speed (MOVE spell)
59488
32
Increase Maroc's horizonal movement speed
59520
21
Decrease Maroc's horizontal movement speed
59541
11
Check vertical movement direction & speed (MOVE spell)
59552
32
Increase Maroc's vertical movement speed
59584
21
Decrease Maroc's vertical movement speed
59605
25
Set Maroc's speed to zero if FIRE pressed while he is moving
59630
59
MOVE spell continued - set viewport scenery speed/movement based on Maroc's
59689
47
Player has cast a spell requiring a controllable cursor (e.g. SERVANT, MISSILE, OPEN)
59736
47
Calculate change to servant/cursor icon horizontal screen position
59783
86
Calculate change to servant/cursor icon vertical screen position
59869
64
Check if FIRE pressed when servant or controllable spell cursor is on screen
59933
23
Spell selected that is the same as the active 'effect' spell (e.g. SHIELD, UNSEEN)
59956
109
Deactivate the currently active effect spell
60065
6
Data buffer - scroll text and icon data
60071
3
Data buffer - attributes/colours
60074
33
Data buffer - game data (various)
60107
22
Data buffer - graphic working data
60129
14
Data buffer - spell data
60143
14
Data buffer - general (mainly room/scenery related)
60157
9
Data buffer - Maroc/servant/spell cursor controls and position data
60166
61
Keyboard/joystick control method and port checking values
60227
16
Data buffer - for each room object, creature, scenery item
60243
8
Data buffer - music and sound effects
60251
25
Data buffer - general address and spell pointers
60276
14
Data buffer - room co-ordinate data and pointers
60290
15
Data buffer - room objects
60305
20
Data buffer - missile data
60325
8
Data buffer - creature attributes
60333
13
Game data buffer - warlock and creature attributes/data
60346
7
Data buffer - Maroc's inventory address pointers
60353
4
Missile & creature data pointers for start of game
60357
17
Store for currently selected spell data
60374
26
Room item/creature attribute colour patterns
60400
164
Music data
60564
14
Data buffer - various bits of spell and tunnel data
60578
22
Unused
60600
1346
Code sheet - full code sheet data values
61946
28
Code sheet - get the code that the player needs to enter
61974
8
Code sheet - bytes used to randomize code sheet co-ordinates choice
61982
66
Code sheet - hash/randomize the security code co-ordinates required for input
62048
2
Code sheet - store for code value co-ordinates (for code sheet)
62050
6
Unused
62056
12
Code sheet - print code message/character on screen
62068
21
Code sheet - pick a reference co-ordinate for the code that the player has to enter
62089
13
Code sheet - generate 3 random bytes using the FRAMES timer system variable
62102
99
Code sheet - initialize and print security code to enter
62201
82
Code sheet - set up and evaluate player code input
62283
5
Code sheet - set random number seed to generate the random code location address
62288
73
Code sheet - code entry count and validation
62361
1639
Unused
64000
1000
Unused
65000
60
Unencrypt all LOADed game data
65060
476
Unused