Address Length Description
23456 1
Random Seed 1
The first seed that the game uses for random numbers. At the start of a game it is set to the low byte of the FRAMES system variable, and it counts up while the menu waits for the player to start. The game uses it to choose the room that the player starts in, the starting places of the special objects and the number of times that the objects that the player must collect are shuffled. This is the top of the stack, which grows down from here.
23458 2
Frame Counter
Counts the frames of the game, which also makes it an address that moves through the ROM, so that the bytes that it finds there can be used as random numbers. The low bits of it time the animations of the game.
23460 1
Control Method
The way that the player chose to control the game on the menu.
Bits Meaning
3 The controls are directional (a joystick that moves the player in the direction that it is pushed)
1-2 0 is the keyboard, 1 is the Kempston joystick, 2 is the Cursor joystick and 3 is the Interface II joystick
23461 1
Random Seed 2
The second seed that the game uses for random numbers. It changes every time that the game updates an object, and every frame, by adding in the refresh register, the frame counter and the byte that the frame counter points at.
23462 1
Previous Control Method
The control method as it was before the keys of the menu were read, so that the menu can tell when a key has changed it and beep.
23464 1
Wiped Area Count
The number of areas of the screen that the game has to copy to the screen at the end of this frame, because the objects in them moved. The variables from here onwards are cleared at the start of every game.
23465 2
Saved Stack Pointer
The stack pointer, which is kept here while the sprite routine is using the stack pointer to read the data of a sprite.
23467 1
Room Size X
The distance in the X direction from the middle of the room (128) to its walls, which comes from the table of room sizes at RoomSizeTable.
23468 1
Room Size Y
The distance in the Y direction from the middle of the room (128) to its walls, which comes from the table of room sizes at RoomSizeTable.
23469 1
Room Attribute
The attribute that the room is coloured with, which is the bright colour that is stored in the room data.
23470 1
Floor Height
The Z coordinate of the floor of the room, which comes from the table of room sizes at RoomSizeTable. It is 128 in every room.
23471 1
Portcullis Moving Flag
Is non-zero while a portcullis is moving up or down.
23472 1
Portcullis Lower Count
The number of times that the portcullis in the room has been lowered since the room was entered.
23473 1
Transform Flag
Is zero when the player is not changing form. The sun and the moon set it to 1 when it is time for the player to change from a human to a wulf or back. Then, when the transformation starts, it is set to the graphic number of the legs of the player, which is used to give the player the right form again when it ends.
23474 1
Not First Room Flag
Is zero until the first frame of the game has been run, and non-zero after that. The game uses it to avoid saving the special objects of a room that the player has not been in yet when it builds the first room.
23475 1
Pickup Drop Pressed Flag
Is non-zero while the control for picking up or dropping an object is held down, so that holding it does not pick up and drop an object on every frame.
23476 1
Objects Carried Changed Flag
Is non-zero when the objects that the player is carrying have changed, to tell the game that it has to show them in the panel again.
23477 1
Controls Pressed
The controls that are pressed, which are read by ReadControls and tested by the routines that need them.
Bit Control
0 Left
1 Right
2 Forward
3 Jump
4 Pick up or drop (or down, with the directional controls)
5 Pick up or drop, with the directional controls
23478 1
Text Attribute
The attribute that the text that is being printed is coloured with.
23479 1
Redraw Panel Flag
Is non-zero when the panel, the border, the sun or moon and the other information of the screen have to be drawn again, which is when a new room has been built. It is cleared when the game loop has drawn them.
23480 1
Border Drawn Flag
Is non-zero when the border has been drawn around the message on the screen. It is cleared when the menu and the end of the game are started, so that they draw the border.
23481 1
Days
The number of days that have passed, as two binary coded decimal digits.
23482 1
Lives
The number of lives that the player has left. It is printed as two binary coded decimal digits, but 53567 and 49629 change it with DEC and INC, so it is only right while it is below 10.
23483 1
Charms
The number of objects that have been put into the cauldron.
23484 1
Fire Seed
A number that is set to the frame counter at the start of every frame and goes up by one for each object that is updated. A fire that stays where it is uses its lowest bit to decide whether to change its graphic.
23485 1
Ball Bounce Height
The Z coordinate that a ball that bounces up and down reaches before it falls again. It is zero until the ball starts to bounce.
23486 1
Objects Drawn
The number of objects that were drawn on this frame, which the game uses to work out how long to wait before the next frame, so that every frame takes about the same time.
23487 1
Spiked Ball Dropping Flag
Is non-zero while the spiked ball is falling.
23488 1
Spiked Ball Hold Flag
Is non-zero when the spiked ball is not allowed to drop. It is set from the first bit of the room number when the room is built, and it is cleared when the player picks up an object.
23489 1
Player Fall Speed
The speed of the player in the Z direction on the last frame, which is kept while the player moves, to find out if it has landed.
23490 1
Ball Fall Speed
The speed of the ball that bounces in the Z direction on the last frame, which is kept while the ball moves, to find out if it has landed.
23491 1
Final Animation Flag
Is non-zero when all of the objects have been put into the cauldron and the game is ending.
23492 1
Object In Cauldron Flag
Is non-zero while an object that the player has dropped is falling into the cauldron.
23493 1
Sparkle Height
The Z coordinate of a sparkle that has moved up on this frame, which the game loop uses to play the sound of rising sparkles. It is cleared on every frame.
23494 1
Rooms Visited
The number of rooms that the player has been in, not counting the first one, which is worked out by PrintPercentageComplete for the results screen.
23495 2
Font Pointer
The address of the font that the text routines use, which is the font at Font.
23497 2
Percent Complete
The percentage of the game that has been completed. It is stored as four binary coded decimal digits, with the digits of hundreds at PercentComplete and the digits of tens and units at 23498.
23499 2
Drawing List Pointer
A pointer into the list of objects to draw, which the routine that wipes the sprites keeps while it works.
23501 2
First List Position
The place in the list of objects that are drawn of the first of the two objects that the depth sort is comparing.
23503 2
Second List Position
The place in the list of objects that are drawn of the second of the two objects that the depth sort is comparing.
23505 1
Tune Played Flag
Is non-zero when the tune that was started with PlayMusicOnce has been played once.
23506 1
Directional Key Pressed Flag
Bit 0 is set while the key that switches on the directional controls is held on the menu, so that holding it does not switch it on and off again.
23507 1
No Room To Drop Flag
Is non-zero when there is not enough room to drop an object where the player stands.
23512 16
Objects Carried
The objects that the player is carrying. There is a place for four of them, each with four bytes, but the first is only used while an object is being picked up, so that the player can carry three. The last of the three is the one that has been carried for longest, and the one that is dropped first.
Byte Contents
0 The graphic number of the object, or 0 if there is not one
1 The flags of the object
2-3 The address of the object in the table of special objects
23528 32
Rooms Visited Bitmap
A bit for each of the 256 rooms of the game, which is set when the player has been in the room. The room number is split in two, with the top five bits choosing the byte and the low three bits choosing the bit in the byte. The bits are counted by PrintPercentageComplete for the results screen.
23560 1272
Objects Table
The table of the objects in the room, with 32 bytes for each of up to 40 objects. The last object in the table has its final eight bytes in the same place as the code of GameEntry, which is not needed once the game has started. The table is cleared at the start of the game, and the room objects are built by RetrieveRoom. The first two objects are the two halves of the player, the next two are the objects that the player can pick up in the room, and after those are the objects that make up the room. The bytes of an object are:
Byte Contents
0 The graphic number (0 if there is no object)
1-3 The X, Y and Z coordinates
4-6 The width, depth and height
7 The flags: bit 0 is set near an arch, bit 1 if the object is ignored, bit 2 if it can be moved, bit 4 to draw it, bit 5 to wipe it, bit 6 to flip it from left to right and bit 7 to flip it upside down
8 The number of the room
9-11 The speeds in the X, Y and Z directions
12 Bits 0-2 are set if the object is blocked in the X, Y and Z directions, bit 3 if it is jumping, and bits 4-7 count while it is entering the room
13 Bit 7 is set if the object destroys what it hits, bit 5 if it is destroyed by what hits it, bit 6 if it has been destroyed and bit 3 if something stands on it
14-15 The speed of the object in the X and Y direction as changed by an arch
16-17 The graphic to use while the player appears, or the address of the object in the table of special objects
18-19 The adjustments to the pixel X and Y coordinates of the sprite
24-25 The width in bytes and the height in lines of the sprite
26-27 The pixel X and Y coordinates of the sprite
28-31 The width, height, pixel X and pixel Y coordinates that the sprite had when it was last drawn
28658 288
Special Objects Table
The special objects of the game, which are the seven objects that the player has to take to the cauldron and the extra life, four of each. Each one has nine bytes, which are described by this table. The graphic numbers are given out at random at the start of a game by InitialiseSpecialObjects, and the current place of each object is copied from where it starts, so that the objects are in a different room each time.
Byte Contents
0 The graphic number, which is 0 while the player is carrying the object or after it has been put in the cauldron
1-4 The X, Y and Z coordinates and the room number where the object starts
5-8 The X, Y and Z coordinates and the room number where the object is now
49115 32
Panel Object
An object that is used for drawing the graphics of the panel (the objects that are carried and the lives). Only its graphic number, its flags and its pixel coordinates are used.
50253 32
Sun Moon Object
The object that is used to draw the sun and the moon.
53601 64
Copy Of Player
A copy of the two objects of the player, as they were when the player entered the room (or as they are at the start of the game), which is put back by LoseLife when a life is lost. The first 32 bytes are the legs and the last 32 bytes are the top half. The byte at PlayerCopy_LegsRoom is the room number of the legs, and the byte at PlayerCopy_TopHalfRoom that of the top half.
55539 6159
Screen Buffer
The buffer that the game draws into before it is copied to the screen by UpdateScreen. It has a byte for every eight pixels of the screen, with 32 bytes to a line, and the lines are in the order from the bottom of the screen to the top, so the first byte is at the bottom left of the screen and a line above is 32 bytes further on. The pixels of the buffer are 0 for a pixel that is not set.
61696 256
Reversed Byte Table
The table of every byte with its bits in the opposite order, which is built by BuildLookupTables. It is used to flip sprites from left to right.
61952 3584
Shifted Byte Tables
The tables of shifted bytes that are built by BuildLookupTables and used to draw a sprite that does not start on a byte boundary. There are two pages for each shift of one to seven bits to the right, with the first page of the pair at 240 plus twice the shift, so the table for a shift of one bit starts at ShiftedByteTables and the table for a shift of seven bits starts at 65024. The first page of a pair has the inverse of the byte after it has been shifted to the right, and the second has the inverse of the bits that were pushed out of the byte, which go into the next byte of the line.