Address Length Description
23578 1
Contact Flag
Cleared by EndSegment, which sets it when the terrain was touched in a way that stops the horizontal speed, and tests it again at the end. Other routines also use it.
23580 1
Scratch Value
One of the values that many routines use for temporary results. The terrain drawing routines keep a screen column in it, for FillSlopeEdge.
23581 1
Tile Number
Which of the four tiles in view is being drawn, from 0 to 3: bit 0 is set for a tile below the first and bit 1 for a tile to the right. DrawTerrain sets it. Other routines use it to count tiles that an object overlaps, and for temporary values.
23582 2
Scratch Values
Two more of the values that many routines use for temporary results.
23584 1
Segments Left
The number of segments of the script of the current tile that are not drawn yet, which DrawTerrain sets from the script. Other routines use it for temporary values.
23586 1
Segment Length
The number of steps in the current segment, from 1 to 16. DrawTerrain reads it from the script.
23588 1
Column Step Size
The column step of the type of the current segment without its sign, set by SetUpSegment. Also used by AdjustTerrainSlope.
23589 1
Horizontal Step Size
The horizontal step of the type of the current segment without its sign, set by SetUpSegment. RunFrame sets it to 255 while the ship is tested against the terrain, and MoveObjectAndStop sets it to 128 when an object should stop.
23590 1
Upside Down Flag
Set to 153 when the current tile is drawn upside down and to zero when it is not, by DrawTerrain.
23591 1
Shape Flag
Cleared at the start of each segment. SetUpFlatPiece stores a shape code in it for a segment that goes the way that the horizontal speed does and that starts at the edge of a cell, and FillSlopeEdge tests it.
23592 4
Scratch Values
Four more of the values that many routines use for temporary results.
23596 1
Segment Screen Column
The pixel column of the current step of a segment on the screen, found by FindSegmentAddress and moved on by NextStep. Other routines use it for the position of an object.
23597 1
Segment Screen Row
The pixel row of the current step of a segment on the screen, found by FindSegmentAddress and moved on by NextStep. Other routines use it for the position of an object.
23598 1
Piece Column
The column where the next piece of a sloped segment starts in its row, set by SetUpPiece and read by DrawSlopeRowsFromEdge. Other routines use the two bytes from here as a word.
23599 1
Flagged Steps
The number of steps of the current segment that have been flagged: it is cleared at the start of each segment and increased by FinishStep_Count.
23600 1
Back To Front Flag
Set to 255 when the current tile is drawn back to front and to zero when it is not, by DrawTerrain. Other routines use the two bytes from here as a word.
23601 1
Contact Flags
Cleared by NextStep_Test for each step of a segment. FlagFloorContact and FlagCeilingContact set bit 7, and then bit 0 or bit 1 instead; FlagLeftContact sets bit 3 and FlagRightContact sets bit 2. NextStep_Flags chooses what to do from the result.
23602 1
Last Contact Flags
A copy of the flags at ContactFlags that FlagFloorContact and FlagCeilingContact make when they set bit 0 or bit 1, cleared at the start of each segment. DrawVerticalEdge tests it.
23603 1
Start Shape
The shape code for the start of a flat segment, read from the script by ReadSegmentShapes and changed when the tile is back to front or upside down.
23604 1
End Shape
The shape code for the end of a flat segment, read from the script by ReadSegmentShapes and changed when the tile is back to front or upside down.
23605 1
Upside Down Segment
Set to 128 by SetSlopeParameters when the current segment is upside down, and cleared at the start of each segment. CheckTerrainCollision also uses it as the collision status: 128 once a rectangle has been hit, bit 6 after a vertical bounce, and bit 4 after a slope has been hit.
23606 1
Scratch Value
Cleared at the start of UpdateShipSpeeds. Left stores 128 here and right stores 3, and RunFrame compares bit 7 with the facing of the ship.
23607 1
Controls
What is pressed on the keyboard or joystick, set by ReadControls (bit 0 is right, bit 1 is left, bit 3 is up, bit 4 is fire and bit 5 is the extra key).
23608 1
Ship Row
A vertical position that BuildShip works out from the height of the ship and that other routines compare with the positions of objects. Also used for the step of the shots.
23609 1
Scratch Value
The number of frames before the ship can fire again. 46900 stores 6 when the ship fires and counts it down, and returns while it is not zero.
23610 1
Top Tile Colour
The attribute value for the terrain of a tile on the top row, set by SetRowAttributes and used by ColourSegment.
23611 1
Bottom Tile Colour
The attribute value for the terrain of a tile on the bottom row, set by SetRowAttributes and used by ColourSegment.
23612 1
Scroll In Flag
Not zero while the world scrolls in at the start of a life: 255 at first and 3 once the ground has been found (see LookForGround). While it is set DrawTerrain treats all of the tiles as changed and ColourSegment does not colour them.
23613 1
Tiles Changed
The number of times that the map position moved in the frame, set by ScrollWorld (and set by DrawTerrain when ScrollInFlag is not zero). When it is not zero DrawTerrain makes the records of the segments of the tiles again.
23614 1
Horizontal Limit
Two normally, and four when the flag at 62961 is set. BuildShip sets it.
23615 1
Vertical Limit
Two normally, and four when the flag at 62962 is set. BuildShip sets it. It is the limit of the vertical scroll speed, used by UpdateVerticalScrollSpeed.
23616 64
Variables
More variables used by the game. The first byte is set to 255 when the ship is hit and is cleared at the start of the next frame. Purpose not yet known for the rest.
39284 216
Enemy Slots
Nine slots of 24 bytes, one for each enemy or similar object. Each slot is laid out as follows:
Offset Contents
0 Type of the object (255 if the slot is free)
1 Map column
2 Horizontal position
4 Map zone
5 Vertical position
7-8 Horizontal speed
9-10 Vertical speed
11-12 Horizontal acceleration
13 Attribute
14-15 Vertical acceleration
16 Flags
17-18 Horizontal and vertical screen position
19-20 State
21 Lifetime
22-23 More flags
39500 24
Crystal Stack Slot
A tenth slot in the same format as the enemy slots, used by UpdateCrystalStack.
39524 2
Frame Counter
A two byte counter that is incremented every frame, for example by RunTitleMenu and RunFrame.
39883 4
Random Numbers
The two random bytes made by the routine at RandomNumber, followed by the address of the next byte of memory it will mix in (high byte first).
39894 4
Beam Variables
The state shared by the four flickering beams drawn by UpdateBeams.
40239 1
Beam Hit Delay
The number of frames that remain before a beam can hurt the ship again.
40259 16
Beam Table
Four entries of four bytes, one for each beam that is currently drawn: the screen address (low byte first), the number of bytes and the pattern.
40361 8
Beam Patterns
The eight patterns that a beam can have.
41427 6
Sprite Positions
The positions and sizes of the two sprites that are drawn together by DrawSprites. The first sprite is the one that is erased and the second sprite is the one that is drawn.
41609 2
Row Offsets
Two vertical positions that are used by DrawSpritesDirectly.
41720 11
Sprite Variables
Variables used by DrawSprites.
43019 154
Map Object Slots
Six slots of 26 bytes for the objects of the planet that are near the ship. They have the same layout as the slots at EnemySlots, with two more bytes at the end: the index in the table at 23700 of the map entry that the object came from (at offsets 24 and 25). A slot with a type of 255 is free. The last slot is cut short by the code at AddToStack.
43940 4
Collision Box
The box of the object that is being tested for a collision: horizontal position, vertical position, width in pixels and height in pixels.
44801 3
Attribute Area
The width in cells, the height in cells and the attribute of the area to fill, as used by FillAttributes.
45856 2
Vertical Scroll Fraction
The fraction of a pixel that is left over from the vertical scroll speed worked out by UpdateVerticalScrollSpeed.
45946 96
Shot Slots
Four slots of 24 bytes for the shots that the ship fires, in the same layout as the slots at EnemySlots. The routine at UpdateShots updates them.
46629 3
Shot Attribute Area
The width in cells, the height in cells and the attribute of the area that SetShotAttributes fills in the same way as SetObjectAttributes.
46896 1
Weapon Toggle
Bit 0 changes every time the ship fires. Bit 2 is flipped by CheckSpecialShot to make LaunchShot launch a special shot.
49023 6
Tile Position
Used while checking the terrain: the map column and horizontal position of the object, then its map zone and vertical position, then a third position that is used by SelectMirroredErase.
49382 4
Star Variables
The addresses of the offsets of the layer and of the position of the current star.
49386 36
Star Positions
The horizontal and vertical positions of the eighteen stars. Bit 0 of the horizontal position is set while the star is being shown.
49540 12
Star Offsets
The distance that each of the three layers of stars has moved, as a horizontal and a vertical offset, followed by a copy that is kept while the layers are being updated.
49577 1
Ship Height
The height of the ship in pixels, which is made taller by parts that are fitted.
49578 2
Ship Buffer Address
The address in the buffer at ShipWorkArea that the ship is drawn from.
49785 6
Piece Variables
Used to draw the pieces that are next to the ship. The first byte has bit 6 set when a piece is being delivered, and otherwise holds the direction that the ship was facing when it started. The second is set to 128 after a piece is drawn, and the others are the positions of the two pieces.
50882 16
Side Flame Object
The object that is used to draw the flame at the side of the ship, followed by a copy that is kept for the other player. The byte at 50896 is set by CheckTerrainCollision when the ship has landed.
51087 12
Main Flame Object
The object that is used to draw the flame under the ship.
51132 12
Ship Top Object
The object that is used to draw the top of the ship: its type, its position on the screen, and some flags. The flag at 51135 has bit 7 set when it faces left, and 51137 is the number of frames for which it is shown as hit. There is a second copy of it that is kept for the other player.
51194 2
Horizontal Scroll Fraction
The fraction of a pixel that is left over from the horizontal speed worked out by UpdateHorizontalScrollSpeed.
51429 32
Ship Object
The player's ship. The first 24 bytes have the layout of an enemy slot, as described at EnemySlots, and then there are some extra fields:
Offset Contents
24 Bit 7 is set when the ship is facing left
25-26 Copy of the horizontal speed (offsets 7 and 8) taken at the end of the frame
27-28 Copy of the vertical speed (offsets 9 and 10) taken at the end of the frame
29-30 Horizontal then vertical position at which the ship was last drawn, which is used to erase it
31 What the ship is about to pick up: 192 plus the number of an item to carry, or the number of a part to fit
51461 1
Stack Height
The height of the stack of units that the ship carries (up to 18). Also see AddToStack.
51462 33
Ship Start State
The state that ResetLife copies to the ship object at ShipObject at the start of each life.
51741 20
Frame Parameters
The values that DrawFrame uses to draw the frame round the playfield. The addresses are screen addresses, and DrawHUD sets up the two tables.
52299 2
Fuel Level
The amount of fuel that is left. The high byte is the row of the fuel gauge: 66 when the tank is full and 190 when it is empty.
52322 1
Fuel Gauge Row
The pixel row that the fuel gauge is currently showing, which UpdateFuelGauge moves one row at a time towards the high byte of the fuel level.
52410 1
Vertical Speed
The vertical scroll speed: how many pixel rows the world moves each frame. It is negative when the ship is going up the screen.
52411 1
Horizontal Speed
The horizontal scroll speed: how many pixels the world moves sideways each frame. It is negative when the ship is going to the left.
52412 1
Star Flags
Flags for the layers of stars. Bit 0 is set when a star has been drawn (see UpdateStarLayer and CheckStarPosition). Purpose not yet known for the other bits.
52413 2
Shape Table Pointer
The address of the table of shapes for the current horizontal scroll offset, which is one of ShapeTableShiftTwo, ShapeTableShiftFour, ShapeTableShiftSix and ShapeTableShiftZero. DrawTerrain sets it.
52789 1
Horizontal Step
The number of pixels that the current type of segment moves across the screen at each step, which is negative if it goes to the left. It is the first of the three steps that SetSlopeParameters loads, and is also used by the routines that draw the ship parts.
52790 1
Column Step
The second of the steps that SetSlopeParameters loads: the number added to the screen address at each step of a segment, which is negative if it goes to the left.
52791 1
Vertical Step
The third of the steps that SetSlopeParameters loads: the number of pixel rows that the current type of segment moves down the screen at each step, which is zero for a flat segment.
52794 4
Scratch Values
Four bytes that many of the routines use for temporary values, and which FindTilesOverlapped uses for the position of an object within a tile.
52798 1
Attribute Rows
The number of rows of attributes that ColourSegment colours at each step of a segment.
52799 1
Vertical Distance
The number of pixel rows that the world moves vertically in a frame, which is the vertical speed without its sign. ScrollWorld sets it. DrawVerticalEdge uses it as the number of rows of the edge to fill, with FillFourEdgeRows if it is four and FillTwoEdgeRows otherwise.
52800 1
Segment Height
Set by SetUpPiece to the pixel row where the picture of a segment starts. LocatePicture reads it.
52801 1
Horizontal Offset
How far the view of the world is across the first tile, from 0 to 32 pixels. ScrollWorld_Horizontal adds the horizontal speed to it. Its bottom three bits choose which of the tables of shifted pictures is used.
52802 1
Vertical Offset
How far the view of the world is down the first tile, from 0 to 160 pixel rows. ScrollWorld_Vertical adds the vertical speed to it.
52803 1
Segment Column
The pixel column where the current segment starts. The script gives it and NextStep adds the horizontal step at each step of the segment.
52804 1
Segment Row
The pixel row where the current segment starts. The script gives it and NextStep subtracts the vertical step at each step of the segment.
52805 1
Position Across
The pixel column that the tests of a segment at DrawTerrain_Test compare the segment with. ScrollWorld_Horizontal subtracts the horizontal speed from it, and when it leaves the range 8 to 232 (the width of the area of the terrain) the map position moves one tile and it wraps round.
52806 1
Position Down
The pixel row that the tests of a segment at DrawTerrain_Test compare the segment with. ScrollWorld_Vertical subtracts the vertical speed from it, and when it leaves the range 23 to 183 (the height of the area of the terrain) the map position moves one tile and it wraps round.
52807 2
Picture Pointer
The address of the picture of the current segment, which SetUpPiece sets and LocatePicture reads.
52809 2
Segment Screen Address
The screen address where the drawing of the current segment is up to.
52811 2
Picture Offsets Pointer
A pointer into PictureOffsets that DrawTerrain sets: to the start of the table when the horizontal offset has no pixels to the side of a whole byte, or one byte on otherwise. SetUpPiece adds the offset of the type to set SegmentPictureOffsets.
52813 2
Script Pointer
The address in the script of the next segment, which ReadSegmentShapes sets.
52815 2
Saved Screen Address
A screen address that SetUpFlatPiece_Skip and FindSegmentAddress store. FinishStep and FillSlopeEdge read it.
52817 2
Segment Picture Offsets
The address of the six bytes in PictureOffsets for the type of the current segment, which SetUpPiece sets.
52819 1
Saved Row
A pixel row that FindSegmentAddress stores. FinishStep and FillSlopeEdge read it.
52820 1
Steps Drawn
The number of steps of the current segment that have been drawn so far.
52821 1
Start Column
The pixel column where the first step that was seen of the current segment started, which NoteSegmentStart stores.
52822 1
Start Row
The pixel row where the first step that was seen of the current segment started, which NoteSegmentStart stores.
52823 2
Map Position
The map column (in the first byte) and map row (in the second) of the tile at the top left of the view of the world.
52825 1
Horizontal Step Copy
A copy of the horizontal step of the type of the current segment. It is zero for a vertical segment.
52826 1
Vertical Step Copy
A copy of the vertical step of the type of the current segment, which is set to 4 when it is zero. Some routines use it as a count of rows.
53436 1
Collision Kind
What the ship has collided with: zero for nothing, 128 for an object, 255 or 1 for the terrain. The routines that detect collisions set it and 50642 clears it each frame.
55389 1
Edge Flag
Set to zero when each segment is started and to 255 by NextStep when the last step of a flat segment is found to be at the right edge of the area. DrawEdgePixels and DrawVerticalEdge test it.
56455 2
Tile Script Pointer
The address in the list at TileScriptAddresses that DrawTerrain reads next.
56457 8
Tile Script Addresses
The addresses of the scripts that draw the four tiles that are on the screen, which MakeTiles gets from the table at TileScriptPointers.
56465 4
Visible Tiles
The numbers of the four tiles that are on the screen, which MakeTiles reads from the map at TileMap. They are the top tile and the bottom tile of the left column and then the same of the right column.
56469 1
Sky Attribute
The attribute for the background of the map rows above row 12, which BeginLife gets from the table at PlanetAttributes.
56470 1
Underground Attribute
The attribute for the background of the map rows from row 12 down, which BeginLife gets from the table at PlanetAttributes.
56818 1
Chequered Floor Flag
Set by BeginLife to one when the horizontal position of the ship is an even number, in which case the bottom of the playfield is filled with a chequered pattern.
56819 2
Unused
Not referenced by the code.
56821 2
Column Counts
The number of map objects in the column that the left side of the screen is in and in the one to its right, set by LoadMapObjects.
56823 1
Next Column
The number of the map column that is to the right of the one that the left side of the screen is in, set by GetTile. It wraps round from 95 to 0.
58395 1
Slope Direction
The direction of the current segment, which is 1 when the second parameter of its slope is negative (the segment goes to the left) and 255 when it is not. It is set by SetSlopeParameters.
61711 3
Playfield Attribute Area
The area of attributes for the background of the playfield, which ColourPlayfield fills: 28 wide and 20 high. BeginLife sets the attribute.
61951 3
Ship Attribute Area
The area of attributes that ColourShip fills: the width, the height in rows and the attribute.
61994 17
Title Frame Parameters
The values that DrawFrame uses to draw the frame of the title screen, which has the same layout as the table at FrameParameters.
62178 1
Two Player Flag
Is zero for a game with one player and not zero for a game with two players, which the menu at RunTitleMenu sets.
62951 29
Current Player State
The state of the player who is up. The state of the other player is at OtherPlayerState in the same layout, and SwapPlayers swaps the two.
62980 76
Item Sites
Nineteen sites for items, of four bytes each, that ChooseItemSites chooses. The sites are the map column, the map row, and the horizontal and vertical positions. The first eleven are for parts and the others for items. The first byte of a site that has been taken has bit 7 set.
63056 105
Other Player State
The state of the other player, in the same layout as CurrentPlayerState.
63161 306
Ship Work Area
Cleared by BeginLife at the start of each life. BuildShip builds the graphic of the ship from ShipBaseGraphic at ShipWorkArea_ShipGraphic.
64000 512
Shift Tables
Tables of shifted bytes built by BuildTables when the game starts, used by the sprite drawing routines. The first table holds two pages of two byte values for each of the shifts by two, four and six bits. The contents at the time of the snapshot are left over from loading and are replaced when the tables are built.
64528 1008
Shift Tables (continued)
The rest of the shift tables.