A stray OUT pages a 128K's memory
Every keyboard read in the game is OUT ($FD),A and then IN A,($FE) with the same A, the half-rows to read. OUT (n),A puts A on the top half of the address bus, so the port is A * 256 + $FD. A 48K ignores it. A 128K takes any port with bits 15 and 1 clear as its paging port $7FFD, so every A with bit 7 clear is a paging write. The title tune's key test (play_tune_until_key) reads with A nought, which pages the 128's editor ROM in -- harmless, since the game never calls the ROM. But the menu's test for B (menu_keys) reads $7F on every pass of the menu, and so do the pause test (test_pause_keys) on every pass of play and the keyboard method's reads of the bottom right half-row; and a joystick's special key reads $7E. $7F puts RAM bank 7 at $C000, where everything from $C000 up is, shows the second screen, and locks the paging. Watched in SkoolKit's 128K machine, the game put in RAM paged as a 128 in 128 mode leaves a machine-code program: the writes to the paging port were $00 to port $00FD and then $7F to port $7FFD. The menu came up after the first; at the second, on the menu's first pass, the call menu_loop makes next, to random, ran into bank 7, and the machine ran off into the ROM; no game started. On a 128 the game must be run in 48 mode. The pokes have the five OUTs to remove.
Two units of ore leave stray pixels on the tank
When the special beam mines a deposit, load_ore adds its ore to the tank, and clears the tank's rows on the screen that are to show it before the ship's picture is redrawn: two bytes a row at x $70, from the old level up. But the loop moves DE up a line (line_up_de) while it writes through HL, so it clears the same two bytes every time. With one unit that is right. With two -- the 10 deposits of kind $0A, and the tough attacker worn down by the beam -- the second new row is never cleared, and since the ship is drawn over itself with OR and rubbed out only when its picture changes (a turn), that row shows the empty tank's pixels and the ore's together. Watched in SkoolKit's simulator: the tank staged with four units and load_ore called as the beam's end calls it, with two. The screen held more than the ship's picture in the tank's ore columns in picture row 5 -- the second new row -- until the ship turned and turned back, after which it matched.
The tank after a two-unit load The same after the ship has turned and turned back
Drawn by the game's own code in SkoolKit's simulator, from the screen, four columns of the tank from its bottom line up: just after the load, with three pixels too many on the sixth line up, in the left half of the ore; and after the ship has turned and turned back.
A pixel stays behind when the tank is delivered
A rocket part hangs under the hook by being XORed into the ship's picture (toggle_carried_part), so that the same call takes it out again. The ore tank is hung empty, frame 6; load_ore writes the ore into it a row at a time, over the tank's middle two bytes; and when the full tank is let go, drop_part has frame 8, the full tank, XORed out. Frame 8 is not quite the empty tank with the ore written in: in the tank's top row it lacks one pixel that the top row of ore has, and that pixel is left in the picture, where the top of the tank was. It stays until the picture is next built (build_ship_sprite, at a new life or an add-on fitted). Watched in SkoolKit's simulator: the empty tank hung in the sky over the rocket's place, filled there by nine calls of load_ore with two units each, which let drop_part deliver it; the ship's picture then differed from the hooked ship's in one byte, picture row 12, byte 3, by one pixel.
A refuel pad under the shield saves the next hit
A refuel pad repairs the ship by setting hit_count to $FF and calling damage_ship (in contact_damage), which counts it on to nought and colours the panel's ship icon white again. But damage_ship does nothing at all while the shield is up, so a pad touched under the shield leaves the count at $FF: the hits already taken are not repaired, the icon keeps its colour, and the next hit after the shield has gone counts the $FF on to nought -- a repair instead of a hit. Watched in SkoolKit's simulator, running the pad's code and damage_ship themselves from a pass of play with two hits taken: without the shield the pad left the count at 0 and the next hit made it 1, the icon yellow; with the shield up the pad left it at $FF and the icon as it was, and the next hit, the shield gone, made the count 0 and the icon white.
Add-on 9 runs one row past the ship's picture
The ship's picture is put together in a buffer of 300 bytes, 50 rows of six, at ship_picture, cleared at each life. build_ship_sprite works out where drawing starts from the tallest add-on and then, for add-on 9, the figure that stands on top, adds 11 rows to the height without moving the start, so the picture's top row is row 50: the six bytes after the buffer, spare_after_ship, into which add-on 9's top row is drawn and which nothing clears. Harmless: nothing else uses them, they are nought on the tape, and the same row is drawn into them every time. Watched in SkoolKit's simulator: with add-on 9 fitted the picture was 25 rows from the bare ship's bottom row, and the spare bytes held the figure's top row and nothing else.
A near miss beside it: an add-on's graphic is followed by $FF or by a mask the size of its picture (fit_addon), and add-on 9's (addon_figure_graphic) has neither -- six bytes of mask, three rows' worth, and then the next graphic. addon_mask_and_draw takes 30 bytes, so the figure's mask runs on through the post (addon_post_graphic) and the next height byte. Those 24 bytes fall on rows of the buffer above the bare ship, which are empty, and on one row where they take away nothing the figure does not put back: built with them set to $FF, the picture was the same (watched in the simulator), and built with no mask at all it was not.
The spawn table stops one tile short
An attacker starts at one of eight spawn points of a map cell near the view, those that the cell's tile allows in spawn_point_masks, a byte a tile (start_at_edge). The table has 169 bytes, tiles $00 to $A8; the map uses tile $A9 once, at map column 63, row 11, and that cell reads its mask from the first byte of the next table, spawn_points: $10, which allows point 4 (x $70, line $37). Tile $AA, which the fly-in draws in place of tile $3E, would read the second, but nothing spawns during the fly-in. Worked out from the snapshot at build time; whether that point suits that cell was not checked.
Type $1B's update routine is a list of graphics
run_sky_object_handler runs a sky object's update by its type, from the twelve words of object_handlers for types $13 to $1E. Type $1B's word is type1b_graphics, the frame list of the animated ground objects, not code: a sky record of type $1B would jump into it. None ever is: the sky records are given types from the wave table, the shots' and the wreck's own, and $1E for a falling rocket part, while graphic $1B is given only to ground objects, which are updated by update_ground_objects and never through the table. Read; latent.
The second pick-up record overlaps load_ore
The six ground-object records at ground_objects are 26 bytes each, 156 bytes, but load_ore starts 154 bytes on: the second pick-up record's +$18 and +$19 are load_ore's first instruction. Those two bytes are a ground object's number in the world's table (map_object_kinds), which only the first four records are given (spawn_objects_from_list), which are read only for objects that are not pick-ups, and which free_object leaves alone. Read; latent.