Doctor Who and the Mines of Terror disassembly ============================================== Doctor Who and the Mines of terror was written by Gary Partis, and was published by Micropower for the BBC Micro in 1985. It is a platform game in which the player must stop the domination of the universe by disabling a Time Instant Replay Unit (TIRU), located in a mining base. The following disassembly was created by reverse engineering binary images, without access to any source code. It is nevertheless reasonably complete, allowing the technical approaches used to be understood. The author of this disassembly imposes no additional copyright restrictions beyond those already present on the game itself. It is provided for educational purposes only, and it is hoped that the original authors will accept it in the good faith it was intended - as a tribute to their skills. Technical notes =============== The game is notable for requiring a ROM. This contains sprite and map data. A delay loop slows down the game considerably. This can be removed with a poke. A check is made to prevent tampering with the number of lives. Game-play notes =============== The pick allows the player to remove walls made of Heatonite ore. The detonator allows the player to temporarily disable controllers, and also to destabilise the reactor. It can be used up to three times. Explosives can be added to the detonator to increase the area of effect eightfold. The cloth can be dropped to permanently disable a single controller. The pass card allows the player to move through doors that have a code reader. Symbols from the decoder card, a physical object included with the game, must be entered for the player to access the room that contains the pass card. Hatches can only be picked up if the player is carrying the electronic spanner. The antigravity mat allows the player to climb a single tile of empty space. The oxygen is required for the player to go out into space without dying. Rearranging the circuit boards from "START" to " STOP" stops the factory. The test tube, not mentioned in the instructions, can be dropped in a tank of coolant to permanently disable the controllers that protect the TIRU. The power cell, not mentioned in the instructions, can be put to the right of the central lift to make the player move quicker on the lift and conveyor. The crystal and the packing cases are red herrings. There are only four Splinx markers, not the six shown in the instructions. The stool shown in the instructions is not present in the game. The escape pod activator allows the player to leave in an escape pod. Otherwise, the player must be carrying the TIRU lattice to leave in the TARDIS. An escape bonus is awarded for each of the TIRU lattice, Splinx and memory capsule that the player is carrying when leaving. A further escape bonus is awarded for permanently stopping the factory, either by carrying the A circuit board, or by destroying the reactor by detonating its central pillar. Interesting pokes ================= &18ca = &60 always run game at full speed &2d30 = &a5. &21cf = &00 player is invulnerable to controllers, Madrag and eggs &1bcf = &00 player can breathe in space without oxygen &08fb = &a5, &08fc = &76 infinite lives (bypassing check) Loader disassembly ================== ; $.Who1 ; FF2A00 FF4170 002500 # &2a00 - &2aff is moved to &0a00 - &0aff at &4326 ; unused &0a00 00 00 00 00 00 ; unpack_loading_screen &0a05 a9 16 LDA #&16 # Change to MODE 1 &0a07 20 ee ff JSR &ffee ; OSWRCH &0a0a a9 01 LDA #&01 &0a0c 20 ee ff JSR &ffee ; OSWRCH &0a0f a9 0a LDA #&0a ; R10: Cursor start register &0a11 8d 00 fe STA &fe00 ; video register number &0a14 a9 20 LDA #&20 # Disable cursor &0a16 8d 01 fe STA &fe01 ; video register value &0a19 a2 01 LDX #&01 ; R1: Number of characters per line &0a1b 8e 00 fe STX &fe00 ; video register number &0a1e ca DEX &0a1f 8e 01 fe STX &fe01 ; video register value &0a22 a2 00 LDX #&00 ; &1200 = load_who2_string # Load WHO2 at &4b24 - &7fff (first loading screen) &0a24 a0 12 LDY #&12 &0a26 20 f7 ff JSR &fff7 ; OSCLI ; unpack_packed_screen_data &0a29 a9 13 LDA #&13 # Change colour 2 to blue &0a2b 20 ee ff JSR &ffee ; OSWRCH &0a2e a9 02 LDA #&02 &0a30 20 ee ff JSR &ffee ; OSWRCH &0a33 a9 04 LDA #&04 ; B &0a35 20 ee ff JSR &ffee ; OSWRCH &0a38 a9 00 LDA #&00 &0a3a 20 ee ff JSR &ffee ; OSWRCH &0a3d 20 ee ff JSR &ffee ; OSWRCH &0a40 20 ee ff JSR &ffee ; OSWRCH &0a43 a9 00 LDA #&00 ; &3000 = screen_memory &0a45 85 80 STA &80 ; screen_address_low &0a47 a9 30 LDA #&30 &0a49 85 81 STA &81 ; screen_address_high &0a4b ad fe 7f LDA &7ffe # Last two bytes of packed data specify start address &0a4e 85 82 STA &82 ; data_address_low &0a50 ad ff 7f LDA &7fff &0a53 85 83 STA &83 ; data_address_high ; unpack_packed_screen_data_loop &0a55 a0 00 LDY #&00 &0a57 b1 82 LDA (&82),Y ; data_address # Get two bytes of packed data for length of run &0a59 85 84 STA &84 ; run_length_low &0a5b c8 INY &0a5c b1 82 LDA (&82),Y ; run_length_high &0a5e 08 PHP ; run type &0a5f 29 7f AND #&7f # Lowest fifteen bits of two bytes set length of run &0a61 85 85 STA &85 ; run_length_high &0a63 28 PLP ; run type &0a64 30 06 BMI &0a6c ; to_write_run_of_identical_bytes # Top bit of second byte sets type of run &0a66 20 b6 0a JSR &0ab6 ; write_run_of_different_bytes &0a69 4c 6f 0a JMP &0a6f ; consider_next_run ; to_write_run_of_identical_bytes &0a6c 20 89 0a JSR &0a89 ; write_run_of_identical_bytes ; consider_next_run &0a6f a5 83 LDA &83 ; data_address_high &0a71 10 e2 BPL &0a55 ; unpack_packed_screen_data_loop &0a73 a0 00 LDY #&00 &0a75 98 TYA &0a76 91 80 STA (&80),Y ; screen_address # Fill rest of screen &0a78 e6 80 INC &80 ; screen_address_low &0a7a d0 fa BNE &0a76 ; unpack_run_loop &0a7c e6 81 INC &81 ; screen_address_high &0a7e 10 f6 BPL &0a76 ; unpack_run_loop &0a80 60 RTS ; unused # Unused code &0a81 e6 82 INC &82 ; data_address_low &0a83 d0 d0 BNE &0a55 ; unpack_packed_screen_data_loop &0a85 e6 83 INC &83 ; data_address_high &0a87 d0 e6 BNE &0a6f ; consider_next_run ; write_run_of_identical_bytes &0a89 c8 INY &0a8a b1 82 LDA (&82),Y ; data_address &0a8c 85 86 STA &86 ; value &0a8e a0 00 LDY #&00 ; write_run_of_identical_bytes_loop &0a90 c6 84 DEC &84 ; run_length_low &0a92 a5 84 LDA &84 ; run_length_low &0a94 c9 ff CMP #&ff &0a96 d0 04 BNE &0a9c ; skip_underflow &0a98 c6 85 DEC &85 ; run_length_high &0a9a 30 0c BMI &0aa8 ; end_of_run ; skip_underflow &0a9c a5 86 LDA &86 ; value &0a9e 91 80 STA (&80),Y ; screen_address &0aa0 e6 80 INC &80 ; screen_address_low &0aa2 d0 ec BNE &0a90 ; write_run_of_identical_bytes_loop &0aa4 e6 81 INC &81 ; screen_address_high &0aa6 d0 e8 BNE &0a90 ; write_run_of_identical_bytes_loop # Always branches ; end_of_run &0aa8 a5 82 LDA &82 ; data_address_low &0aaa 18 CLC &0aab 69 03 ADC #&03 &0aad 85 82 STA &82 ; data_address_low &0aaf a5 83 LDA &83 ; data_address_high &0ab1 69 00 ADC #&00 &0ab3 85 83 STA &83 ; data_address_high &0ab5 60 RTS ; write_run_of_different_bytes &0ab6 a5 82 LDA &82 ; data_address_low &0ab8 18 CLC &0ab9 69 02 ADC #&02 &0abb 85 82 STA &82 ; data_address_low &0abd a5 83 LDA &83 ; data_address_high &0abf 69 00 ADC #&00 &0ac1 85 83 STA &83 ; data_address_high &0ac3 a0 00 LDY #&00 ; write_run_of_different_bytes_loop &0ac5 c6 84 DEC &84 ; run_length_low &0ac7 a5 84 LDA &84 ; run_length_low &0ac9 c9 ff CMP #&ff &0acb d0 04 BNE &0ad1 ; skip_underflow &0acd c6 85 DEC &85 ; run_length_high &0acf 30 12 BMI &0ae3 ; end_of_run ; skip_underflow &0ad1 b1 82 LDA (&82),Y ; data_address &0ad3 91 80 STA (&80),Y ; screen_address &0ad5 e6 82 INC &82 ; data_address_low &0ad7 d0 02 BNE &0adb ; skip_page &0ad9 e6 83 INC &83 ; data_address_high ; skip_page &0adb e6 80 INC &80 ; screen_address_low &0add d0 e6 BNE &0ac5 ; write_run_of_different_bytes_loop &0adf e6 81 INC &81 ; screen_address_high &0ae1 d0 e2 BNE &0ac5 ; write_run_of_different_bytes_loop ; end_of_run &0ae3 60 RTS ; unused &0ae4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0af4 00 00 00 00 00 00 00 00 00 00 00 00 # &2b00 - &32ff is moved to &1200 - &19ff at &432d ; load_who2_string &1200 4c 2e 57 68 6f 32 0d 00 ; "L.Who2" ; load_who3_string &1208 4c 2e 57 68 6f 33 0d 00 ; "L.Who3" ; load_who4_string &1210 4c 2e 57 68 6f 34 0d 00 ; "L.Who4" ; unused &1218 00 00 00 00 00 00 00 00 ; load_r_dr_string # Unused; would be used at &420f &2b20 4c 2e 52 2e 44 72 0d 00 ; "L.R.Dr" ; unused &1228 00 00 00 00 00 00 00 00 00 00 ; loading_screen &1232 78 SEI &1233 a2 ff LDX #&ff &1235 9a TXS &1236 a9 14 LDA #&14 ; Implode user-defined font &1238 a2 00 LDX #&00 &123a 20 f4 ff JSR &fff4 ; OSBYTE &123d a9 01 LDA #&01 ; Normal ESCAPE effect, normal reset effect &123f 8d 58 02 STA &0258 ; ESCAPE/BREAK effect &1242 a9 04 LDA #&04 ; Define action of cursor editing keys &1244 a2 01 LDX #&01 ; Cursor keys return ASCII values 135-139 &1246 20 f4 ff JSR &fff4 ; OSBYTE &1249 a9 0b LDA #&0b ; Set auto-repeat delay &124b a2 00 LDX #&00 &124d 20 f4 ff JSR &fff4 ; OSBYTE &1250 ad fc ff LDA &fffc ; os_reset_address_low &1253 8d 02 02 STA &0202 ; brk_vector_low &1256 ad fd ff LDA &fffd ; os_reset_address_high &1259 8d 03 02 STA &0203 ; brk_vector_high &125c 58 CLI &125d a9 00 LDA #&00 &125f 85 70 STA &70 ; space_pressed # Set to zero to indicate SPACE not pressed &1261 a0 28 LDY #&28 ; initial width &1263 a9 ff LDA #&ff ; direction &1265 20 34 13 JSR &1334 ; roll_screen # Roll up MODE 7 screen &1268 0e 47 13 ASL &1347 ; roll_sync_one &126b 0e 4f 13 ASL &134f ; roll_sync_two &126e a9 30 LDA #&30 ; &3000 = screen_memory &1270 85 01 STA &01 ; screen_address_high &1272 a0 00 LDY #&00 &1274 98 TYA &1275 85 00 STA &00 ; screen_address_low ; wipe_screen_loop # Wipe &3000 - &7fff (screen memory) &1277 91 00 STA (&00),Y ; screen_address &1279 c8 INY &127a d0 fb BNE &1277 ; wipe_screen_loop &127c e6 01 INC &01 ; screen_address_high &127e 10 f7 BPL &1277 ; wipe_screen_loop &1280 ea NOP &1281 ea NOP &1282 ea NOP &1283 ea NOP &1284 ea NOP &1285 ea NOP &1286 ea NOP &1287 ea NOP &1288 20 05 0a JSR &0a05 ; unpack_loading_screen # Load first loading screen &128b a0 00 LDY #&00 ; initial width &128d a9 01 LDA #&01 ; direction &128f 20 34 13 JSR &1334 ; roll_screen # Unroll first loading screen &1292 ea NOP &1293 ea NOP &1294 ea NOP &1295 ea NOP &1296 20 29 28 JSR &2829 ; initialise_tune ; loading_screen_loop &1299 a2 bc LDX #&bc ; &14bc = loading_screen_scrolltext_data &129b a0 14 LDY #&14 &129d 20 4e 14 JSR &144e ; loading_screen_scrolltext &12a0 a9 14 LDA #&14 &12a2 85 71 STA &71 ; count ; delay_outer_loop # Delay after end of scrolltext &12a4 a2 00 LDX #&00 ; delay_loop &12a6 a0 00 LDY #&00 ; delay_inner_loop &12a8 a5 70 LDA &70 ; space_pressed # Non-zero if SPACE was pressed &12aa d0 0c BNE &12b8 ; space_was_pressed &12ac c8 INY &12ad d0 f9 BNE &12a8 ; delay_inner_loop &12af e8 INX &12b0 d0 f4 BNE &12a6 ; delay_loop &12b2 c6 71 DEC &71 ; count &12b4 d0 ee BNE &12a4 ; delay_outer_loop &12b6 f0 e1 BEQ &1299 ; loading_screen_loop # Always branches ; space_was_pressed &12b8 a0 50 LDY #&50 ; initial width &12ba a9 ff LDA #&ff ; direction &12bc 20 34 13 JSR &1334 ; roll_screen # Roll up first loading screen &12bf a9 13 LDA #&13 &12c1 20 0d 13 JSR &130d ; write_character_with_escape_condition # Set colour 3 to yellow &12c4 a9 03 LDA #&03 &12c6 20 0d 13 JSR &130d ; write_character_with_escape_condition &12c9 a9 03 LDA #&03 ; Y &12cb 20 0d 13 JSR &130d ; write_character_with_escape_condition &12ce a9 00 LDA #&00 &12d0 20 0d 13 JSR &130d ; write_character_with_escape_condition &12d3 20 0d 13 JSR &130d ; write_character_with_escape_condition &12d6 20 0d 13 JSR &130d ; write_character_with_escape_condition &12d9 a2 08 LDX #&08 ; &1208 = load_who3_string # Load WHO3 at &6bfc - &7fff (second loading screen) &12db a0 12 LDY #&12 &12dd 20 f7 ff JSR &fff7 ; OSCLI # Load second loading screen &12e0 a2 06 LDX #&06 ; R6: Vertical displayed register &12e2 a9 10 LDA #&10 &12e4 20 1d 13 JSR &131d ; set_video_register &12e7 a2 0c LDX #&0c ; R12: Displayed screen start address register (high) &12e9 a9 0b LDA #&0b # Set screen start address to *5800 &12eb 20 1d 13 JSR &131d ; set_video_register &12ee a2 07 LDX #&07 ; R7: Vertical sync position &12f0 a9 1a LDA #&1a &12f2 20 1d 13 JSR &131d ; set_video_register &12f5 a2 02 LDX #&02 ; R2: Horizontal sync position register &12f7 a9 62 LDA #&62 &12f9 20 1d 13 JSR &131d ; set_video_register &12fc 20 29 0a JSR &0a29 ; unpack_packed_screen_data # Unpack second loading screen &12ff a0 00 LDY #&00 ; initial width &1301 a9 01 LDA #&01 ; direction &1303 20 34 13 JSR &1334 ; roll_screen # Unroll second loading screen &1306 ea NOP &1307 ea NOP &1308 a0 00 LDY #&00 &130a 4c 24 13 JMP &1324 ; relocate_load_main_binary ; write_character_with_escape_condition &130d 48 PHA ; tmp_a &130e a9 ff LDA #&ff # Set ESCAPE condition &1310 85 ff STA &ff ; os_escape_condition &1312 68 PLA ; tmp_a &1313 48 PHA ; tmp_a &1314 20 ee ff JSR &ffee ; OSWRCH &1317 a9 00 LDA #&00 # Clear ESCAPE condition &1319 85 ff STA &ff ; os_escape_condition &131b 68 PLA ; tmp_a &131c 60 RTS ; set_video_register &131d 8e 00 fe STX &fe00 ; video register number &1320 8d 01 fe STA &fe01 ; video register value &1323 60 RTS ; relocate_load_main_binary ; relocate_load_main_binary_loop &1324 b9 00 19 LDA &1900,Y ; unrelocated_load_main_binary &1327 99 00 4f STA &4f00,Y ; load_main_binary &132a c8 INY &132b d0 f7 BNE &1324 ; relocate_load_main_binary_loop &132d 4c 00 4f JMP &4f00 ; load_main_binary ; unused &1330 00 00 00 00 ; roll_screen # Called with A = roll direction, X = initial width &1334 85 03 STA &03 ; direction ; roll_screen_loop &1336 84 00 STY &00 ; width &1338 a9 13 LDA #&13 ; Wait for vertical retrace &133a 20 f4 ff JSR &fff4 ; OSBYTE &133d a2 01 LDX #&01 ; R1: Number of characters per line &133f a5 00 LDA &00 ; width &1341 20 1d 13 JSR &131d ; set_video_register &1344 a2 02 LDX #&02 ; R2: Horizontal sync position register &1346 a9 28 LDA #&28 # actually LDA roll_sync_one &1348 38 SEC &1349 e5 00 SBC &00 ; width &134b 4a LSR A &134c 85 01 STA &01 ; tmp &134e a9 31 LDA #&31 # actually LDA roll_sync_two &1350 38 SEC &1351 e5 01 SBC &01 ; tmp &1353 20 1d 13 JSR &131d ; set_video_register &1356 a5 00 LDA &00 ; width &1358 0a ASL A &1359 85 02 STA &02 ; width_times_two &135b a9 00 LDA #&00 &135d 38 SEC &135e e5 02 SBC &02 ; width_times_two &1360 8d 8c 13 STA &138c ; roll_sound_1 + 4 (pitch) &1363 a2 88 LDX #&88 ; &1388 = roll_sound_1 &1365 a0 13 LDY #&13 &1367 a9 07 LDA #&07 ; Generate a sound &1369 20 f1 ff JSR &fff1 ; OSWORD &136c a2 90 LDX #&90 ; &1390 = roll_sound_2 &136e a0 13 LDY #&13 &1370 a9 07 LDA #&07 ; Generate a sound &1372 20 f1 ff JSR &fff1 ; OSWORD &1375 a5 00 LDA &00 ; width &1377 18 CLC &1378 65 03 ADC &03 ; direction &137a a8 TAY &137b 30 04 BMI &1381 ; finished_rolling_screen &137d c9 51 CMP #&51 &137f d0 b5 BNE &1336 ; roll_screen_loop ; finished_rolling_screen &1381 a9 0f LDA #&0f ; Flush buffers &1383 a2 00 LDX #&00 ; Flush all buffers &1385 4c f4 ff JMP &fff4 ; OSBYTE ; roll_sound_1 ; chan vol pitch dur &1388 11 00 00 00 00 00 01 00 # Pitch is modified ; roll_sound_2 ; chan vol pitch dur &1390 10 00 f1 ff 07 00 02 00 ; change_mode # Unused code &1398 48 PHA ; mode &1399 a9 13 LDA #&13 ; Wait for vertical retrace &139b 20 f4 ff JSR &fff4 ; OSBYTE &139e a9 16 LDA #&16 # Change to MODE &13a0 20 0d 13 JSR &130d ; write_character_with_escape_condition &13a3 68 PLA ; mode &13a4 20 0d 13 JSR &130d ; write_character_with_escape_condition &13a7 a9 0a LDA #&0a ; R10: Cursor start register &13a9 8d 00 fe STA &fe00 ; video register number &13ac a9 20 LDA #&20 # Hide cursor &13ae 8d 01 fe STA &fe01 ; video register value &13b1 20 bc 13 JSR &13bc ; write_string &13b4 13 02 04 00 00 00 ; Set colour 2 to blue &13ba 40 ; end of string &13bb 60 RTS ; write_string # Unused code &13bc 68 PLA # String follows call to function &13bd 85 16 STA &16 ; string_address_low &13bf 68 PLA &13c0 85 17 STA &17 ; string_address_high &13c2 a0 00 LDY #&00 ; write_string_loop &13c4 e6 16 INC &16 ; string_address_low &13c6 d0 02 BNE &13ca ; skip_page &13c8 e6 17 INC &17 ; string_address_high ; skip_page &13ca b1 16 LDA (&16),Y ; string_address &13cc c9 40 CMP #&40 ; "@" # &40 indicates end of string &13ce f0 06 BEQ &13d6 ; end_of_string &13d0 20 e2 13 JSR &13e2 ; write_character &13d3 4c c4 13 JMP &13c4 ; write_string_loop ; end_of_string &13d6 e6 16 INC &16 ; string_address_low &13d8 d0 02 BNE &13dc ; skip_page &13da e6 17 INC &17 ; string_address_high ; skip_page &13dc 6c 16 00 JMP (&0016) ; string_address ; is_special_character # Unused code &13df 4c 0d 13 JMP &130d ; write_character_with_escape_condition ; write_character &13e2 c9 20 CMP #&20 ; " " &13e4 90 f9 BCC &13df ; is_special_character &13e6 c9 7f CMP #&7f ; DELETE &13e8 b0 f5 BCS &13df ; is_special_character &13ea 86 f8 STX &f8 ; tmp_x &13ec a2 00 LDX #&00 &13ee 20 0c 14 JSR &140c ; convert_character_to_double_height &13f1 a6 f8 LDX &f8 ; tmp_x ; write_double_height_character &13f3 a9 e0 LDA #&e0 # Write top of character &13f5 20 0d 13 JSR &130d ; write_character_with_escape_condition &13f8 a9 08 LDA #&08 ; move left one character &13fa 20 0d 13 JSR &130d ; write_character_with_escape_condition &13fd a9 0a LDA #&0a ; move down one character &13ff 20 0d 13 JSR &130d ; write_character_with_escape_condition &1402 a9 e1 LDA #&e1 # Write bottom of character &1404 20 0d 13 JSR &130d ; write_character_with_escape_condition &1407 a9 0b LDA #&0b ; move up one character &1409 4c 0d 13 JMP &130d ; write_character_with_escape_condition ; convert_character_to_double_height &140c 38 SEC &140d e9 20 SBC #&20 ; " " &140f 85 18 STA &18 ; font_address_low &1411 a9 00 LDA #&00 &1413 85 19 STA &19 ; font_address_high &1415 06 18 ASL &18 ; font_address_low &1417 26 19 ROL &19 ; font_address_high &1419 06 18 ASL &18 ; font_address_low &141b 26 19 ROL &19 ; font_address_high &141d 06 18 ASL &18 ; font_address_low &141f 26 19 ROL &19 ; font_address_high &1421 a5 18 LDA &18 ; font_address_low &1423 18 CLC &1424 69 08 ADC #&08 ; &1608 = font_data &1426 85 18 STA &18 ; font_address_low &1428 a5 19 LDA &19 ; font_address_high &142a 69 16 ADC #&16 &142c 85 19 STA &19 ; font_address_high &142e 98 TYA &142f 48 PHA ; tmp_y &1430 a0 00 LDY #&00 ; convert_character_to_double_height_loop &1432 b1 18 LDA (&18),Y ; font_data &1434 9d 00 0c STA &0c00,X ; os_user_defined_characters &1437 9d 01 0c STA &0c01,X ; os_user_defined_characters + 1 &143a e8 INX &143b e8 INX &143c c8 INY &143d c0 08 CPY #&08 &143f d0 f1 BNE &1432 ; convert_character_to_double_height_loop &1441 68 PLA ; tmp_y &1442 a8 TAY &1443 60 RTS ; define_text_colour # Unused code &1444 48 PHA ; colour &1445 a9 11 LDA #&11 ; define text colour &1447 20 0d 13 JSR &130d ; write_character_with_escape_condition &144a 68 PLA ; colour &144b 4c 0d 13 JMP &130d ; write_character_with_escape_condition ; loading_screen_scrolltext &144e 86 28 STX &28 ; scrolltext_address_low &1450 84 29 STY &29 ; scrolltext_address_high &1452 a9 0f LDA #&0f ; Flush buffers &1454 a2 01 LDX #&01 ; Flush input buffer &1456 20 f4 ff JSR &fff4 ; OSBYTE &1459 a9 00 LDA #&00 &145b 85 2a STA &2a ; scrolltext_state &145d aa TAX ; wipe_0c00_to_0cff_loop &145e 9d 00 0c STA &0c00,X ; os_user_defined_characters &1461 e8 INX &1462 d0 fa BNE &145e ; wipe_0c00_to_0cff_loop ; loading_screen_scrolltext_loop &1464 a5 70 LDA &70 ; space_pressed # Zero if SPACE not pressed &1466 f0 01 BEQ &1469 ; space_not_pressed &1468 60 RTS ; space_not_pressed &1469 a9 13 LDA #&13 ; Wait for vertical retrace &146b 20 f4 ff JSR &fff4 ; OSBYTE &146e a2 00 LDX #&00 ; &7600 &1470 a0 76 LDY #&76 &1472 20 82 14 JSR &1482 ; scroll_group &1475 a2 80 LDX #&80 ; &7880 &1477 a0 78 LDY #&78 &1479 20 82 14 JSR &1482 ; scroll_group &147c 20 36 15 JSR &1536 ; update_scrolltext # Leaves with carry set at end of scrolltext &147f 90 e3 BCC &1464 ; loading_screen_scrolltext_loop &1481 60 RTS ; scroll_group &1482 86 1e STX &1e ; target_address_low &1484 84 1f STY &1f ; target_address_high &1486 a2 05 LDX #&05 ; scroll_group_section_loop &1488 a5 1e LDA &1e ; target_address_low &148a 18 CLC &148b 69 08 ADC #&08 # Move four pixels right &148d 85 20 STA &20 ; source_address_low &148f a5 1f LDA &1f ; target_address_high &1491 69 00 ADC #&00 &1493 85 21 STA &21 ; source_address_high &1495 a0 00 LDY #&00 ; scroll_group_byte_loop &1497 b1 20 LDA (&20),Y ; source_address &1499 91 1e STA (&1e),Y ; target_address &149b c8 INY &149c 10 f9 BPL &1497 ; scroll_group_byte_loop &149e a5 1e LDA &1e ; target_address_low &14a0 18 CLC &14a1 69 80 ADC #&80 &14a3 85 1e STA &1e ; target_address_low &14a5 a5 1f LDA &1f ; target_address_high &14a7 69 00 ADC #&00 &14a9 85 1f STA &1f ; target_address_high &14ab ca DEX &14ac d0 da BNE &1488 ; scroll_group_section_loop &14ae a9 00 LDA #&00 &14b0 a2 07 LDX #&07 ; wipe_end_of_group_loop &14b2 9d 78 78 STA &7878,X &14b5 9d f8 7a STA &7af8,X &14b8 ca DEX &14b9 10 f7 BPL &14b2 ; wipe_end_of_group_loop &14bb 60 RTS ; loading_screen_scrolltext_data &14bc 20 20 20 20 20 7c 31 4d 69 63 72 6f 20 50 6f 77 ; " |1Micro Pow" &14cc 65 72 20 70 72 65 73 65 6e 74 2e 2e 2e 2e 2e 2e ; "er present......" &14dc 2e 2e 2e 2e 20 20 7c 33 44 6f 63 74 6f 72 20 57 ; ".... |3Doctor W" &14ec 68 6f 20 61 6e 64 20 74 68 65 20 4d 69 6e 65 73 ; "ho and the Mines" &14fc 20 6f 66 20 54 65 72 72 6f 72 21 24 7c 31 41 6c ; " of Terror!$|1Al" &150c 6c 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 ; "l rights reserve" &151c 64 2e 24 7c 32 20 5c 20 4d 69 63 72 6f 20 50 6f ; "d.$|2 \ Micro Po" &152c 77 65 72 20 31 39 38 35 20 40 a9 02 85 d0 a5 2a ; "wer 1985 @" ; update_scrolltext &1536 a9 02 LDA #&02 # Disable scrolling &1538 85 d0 STA &d0 ; os_vdu_status &153a a5 2a LDA &2a ; scrolltext_state &153c c9 04 CMP #&04 # &00 - &03 if scrolling character &153e f0 04 BEQ &1544 ; is_new_character &1540 c9 3c CMP #&3c &1542 d0 2c BNE &1570 ; not_new_character ; is_new_character &1544 a9 00 LDA #&00 &1546 85 2a STA &2a ; scrolltext_state # Set to &00 at start of new character &1548 ad ce 15 LDA &15ce ; scrolltext_byte &154b c9 24 CMP #&24 ; "$" &154d d0 0b BNE &155a ; get_next_character &154f a9 e6 LDA #&e6 &1551 85 2a STA &2a ; scrolltext_state # Set to &e6 to delay next character for another &1e updates &1553 8d ce 15 STA &15ce ; scrolltext_byte &1556 a9 20 LDA #&20 ; " " # Unnecessary code &1558 d0 16 BNE &1570 ; not_new_character # Always branches ; get_next_character &155a 20 c0 15 JSR &15c0 ; get_byte_of_scrolltext &155d c9 40 CMP #&40 ; "@" # &40 ("@") indicates end of scrolltext &155f d0 02 BNE &1563 ; not_end_of_scrolltext &1561 38 SEC # Leave with carry set to indicate end of scrolltext &1562 60 RTS ; not_end_of_scrolltext &1563 c9 24 CMP #&24 ; "$" # &24 ("$") adds blank spaces &1565 f0 40 BEQ &15a7 ; set_scrolltext_state &1567 c9 7c CMP #&7c ; "|" # &7c ("|") sets colour of scrolltext &1569 f0 44 BEQ &15af ; set_scrolltext_colour ; convert_character &156b a2 10 LDX #&10 &156d 20 0c 14 JSR &140c ; convert_character_to_double_height # Populate &0c10 - &0c1f (second, hidden character) ; not_new_character &1570 e6 2a INC &2a ; scrolltext_state &1572 a9 34 LDA #&34 &1574 85 18 STA &18 ; double_width # Set to non-zero to double column &1576 a0 01 LDY #&01 ; shift_character_count_loop &1578 a2 0f LDX #&0f ; shift_character_row_loop &157a 1e 10 0c ASL &0c10,X ; os_user_defined_characters + 16 # Scroll one column of second character &157d 08 PHP ; pixel in column &157e 3e 00 0c ROL &0c00,X ; os_user_defined_characters # into first character &1581 a5 18 LDA &18 ; double_width &1583 f0 07 BEQ &158c ; is_single_width # Never branches &1585 28 PLP ; pixel in column &1586 3e 00 0c ROL &0c00,X ; os_user_defined_characters &1589 4c 8d 15 JMP &158d ; next_row ; is_single_width &158c 28 PLP ; pixel in column ; next_row &158d ca DEX &158e 10 ea BPL &157a ; shift_character_row_loop &1590 88 DEY &1591 10 e5 BPL &1578 ; shift_character_count_loop &1593 a9 1f LDA #&1f # TAB(&27, &1c) &1595 20 0d 13 JSR &130d ; write_character_with_escape_condition &1598 a9 27 LDA #&27 &159a 20 0d 13 JSR &130d ; write_character_with_escape_condition &159d a9 1c LDA #&1c &159f 20 0d 13 JSR &130d ; write_character_with_escape_condition &15a2 20 f3 13 JSR &13f3 ; write_double_height_character # Plot first character at end of line &15a5 18 CLC # Leave with carry clear to indicate not end of scrolltext &15a6 60 RTS ; set_scrolltext_state &15a7 a9 04 LDA #&04 &15a9 85 2a STA &2a ; scrolltext_state # Set to &04 to delay next character for &38 updates &15ab a9 20 LDA #&20 ; " " &15ad d0 bc BNE &156b ; convert_character # Always branches ; set_scrolltext_colour &15af a9 11 LDA #&11 ; define text colour &15b1 20 0d 13 JSR &130d ; write_character_with_escape_condition &15b4 20 c0 15 JSR &15c0 ; get_byte_of_scrolltext &15b7 38 SEC &15b8 e9 30 SBC #&30 ; "0" &15ba 20 0d 13 JSR &130d ; write_character_with_escape_condition &15bd 4c 5a 15 JMP &155a ; get_next_character ; get_byte_of_scrolltext &15c0 a0 00 LDY #&00 &15c2 b1 28 LDA (&28),Y ; scrolltext_address &15c4 e6 28 INC &28 ; scrolltext_address_low &15c6 d0 02 BNE &15ca ; skip_page &15c8 e6 29 INC &29 ; scrolltext_address_high ; skip_page &15ca 8d ce 15 STA &15ce ; scrolltext_byte &15cd 60 RTS ; scrolltext_byte &15ce 00 ; unused &15cf 65 7a 7b 78 79 7e 7f 7c 7d 72 73 70 71 76 77 74 &15df 75 4a 4b 48 49 4e 4f 4c 4d 42 43 40 41 46 47 44 &15ef 45 5a 5b 58 59 5e 5f 5c 5d 52 53 50 51 56 57 54 &15ff 55 ; unused &1600 00 00 00 00 00 00 00 00 ; font_data &1608 00 00 00 00 00 00 00 00 ; " " &1610 18 18 18 18 18 00 18 00 ; "!" &1618 6c 6c 6c 00 00 00 00 00 ; """ &1620 6c 6c fe 7c fe 6c 6c 00 ; "#" &1628 18 3e 58 3c 1a 7c 18 00 ; "$" &1630 00 c6 cc 18 30 66 c6 00 ; "%" &1638 38 6c 38 76 dc cc 76 00 ; "&" &1640 18 18 30 00 00 00 00 00 ; "'" &1648 0c 18 30 30 30 18 0c 00 ; "(" &1650 30 18 0c 0c 0c 18 30 00 ; ")" &1658 00 66 3c ff 3c 66 00 00 ; "*" &1660 00 18 18 7e 18 18 00 00 ; "+" &1668 00 00 00 00 00 18 18 30 ; "," &1670 00 00 00 7e 00 00 00 00 ; "-" &1678 00 00 00 00 00 18 18 00 ; "." &1680 06 0c 18 30 60 c0 80 00 ; "/" &1688 7c c6 ce d6 e6 c6 7c 00 ; "0" &1690 18 38 18 18 18 18 7e 00 ; "1" &1698 3c 66 06 3c 60 66 7e 00 ; "2" &16a0 3c 46 06 1c 06 66 3c 00 ; "3" &16a8 18 38 58 98 fe 18 3c 00 ; "4" &16b0 7e 62 60 3c 06 66 3c 00 ; "5" &16b8 3c 66 60 7c 66 66 3c 00 ; "6" &16c0 7e 46 06 0c 18 18 18 00 ; "7" &16c8 3c 66 66 3c 66 66 3c 00 ; "8" &16d0 3c 66 66 3e 06 66 3c 00 ; "9" &16d8 00 00 18 18 00 18 18 00 ; ":" &16e0 00 00 18 18 00 18 18 30 ; ";" &16e8 0c 18 30 60 30 18 0c 00 ; "<" &16f0 00 00 7e 00 00 7e 00 00 ; "=" &16f8 60 30 18 0c 18 30 60 00 ; ">" &1700 3c 66 06 0c 18 00 18 00 ; "?" &1708 7c c6 de de de c0 7c 00 ; "@" &1710 18 3c 66 66 7e 66 66 00 ; "A" &1718 fc 66 66 7c 66 66 fc 00 ; "B" &1720 3c 66 c0 c0 c0 66 3c 00 ; "C" &1728 f8 6c 66 66 66 6c f8 00 ; "D" &1730 fe 62 68 78 68 62 fe 00 ; "E" &1738 fe 62 68 78 68 60 f0 00 ; "F" &1740 3c 66 c0 c0 ce c6 7e 00 ; "G" &1748 66 66 66 7e 66 66 66 00 ; "H" &1750 7e 18 18 18 18 18 7e 00 ; "I" &1758 1e 0c 0c 0c cc cc 78 00 ; "J" &1760 e6 66 6c 78 6c 66 e6 00 ; "K" &1768 f0 60 60 60 62 66 7e 00 ; "L" &1770 c6 ee fe fe d6 c6 c6 00 ; "M" &1778 c6 e6 f6 de ce c6 c6 00 ; "N" &1780 38 6c c6 c6 c6 6c 38 00 ; "O" &1788 fc 66 66 78 60 60 f0 00 ; "P" &1790 38 6c c6 c6 da cc 76 00 ; "Q" &1798 fc 66 66 7c 6c 66 e2 00 ; "R" &17a0 3c 66 60 3c 06 66 3c 00 ; "S" &17a8 7e 5a 18 18 18 18 3c 00 ; "T" &17b0 66 66 66 66 66 66 3c 00 ; "U" &17b8 66 66 66 66 66 3c 18 00 ; "V" &17c0 c6 c6 c6 d6 fe ee c6 00 ; "W" &17c8 c6 6c 38 38 6c c6 c6 00 ; "X" &17d0 66 66 66 3c 18 18 3c 00 ; "Y" &17d8 fe c6 8c 18 32 66 fe 00 ; "Z" &17e0 3c 30 30 30 30 30 3c 00 ; "[" &17e8 3c 42 bd a1 bd 42 3c 00 ; "\", actually (c) &17f0 3c 0c 0c 0c 0c 0c 3c 00 ; "]" &17f8 18 3c 7e 18 18 18 18 00 ; "^", actually up arrow &1800 00 00 00 00 00 00 00 ff ; "_" &1808 00 30 18 0c 00 00 00 00 ; "`" &1810 00 00 78 0c 7c cc 76 00 ; "a" &1818 e0 e0 7c 66 66 66 bc 00 ; "b" &1820 00 00 3c 66 60 66 3c 00 ; "c" &1828 1c 0c 7c cc cc cc 76 00 ; "d" &1830 00 00 3c 66 7e 60 3c 00 ; "e" &1838 1c 36 30 78 30 30 78 00 ; "f" &1840 00 00 3e 66 66 3e 06 7c ; "g" &1848 e0 60 6c 76 66 66 e6 00 ; "h" &1850 18 00 38 18 18 18 3c 00 ; "i" &1858 02 00 0e 06 06 66 66 3c ; "j" &1860 e0 60 66 6c 78 6c e6 00 ; "k" &1868 38 18 18 18 18 18 3c 00 ; "l" &1870 00 00 6c fe d6 d6 c6 00 ; "m" &1878 00 00 d8 66 66 66 66 00 ; "n" &1880 00 00 3c 66 66 66 3c 00 ; "o" &1888 00 00 dc 66 66 7c 60 f0 ; "p" &1890 00 00 76 cc cc 7c 0c 1e ; "q" &1898 00 00 d8 6c 60 60 f0 00 ; "r" &18a0 00 00 3c 60 3c 06 7c 00 ; "s" &18a8 30 30 7c 30 30 36 1c 00 ; "t" &18b0 00 00 66 66 66 66 3e 00 ; "u" &18b8 00 00 66 66 66 3c 18 00 ; "v" &18c0 00 00 c6 d6 d6 fe 6c 00 ; "w" &18c8 00 00 c6 6c 38 6c c6 00 ; "x" &18d0 00 00 66 66 66 3e 06 7c ; "y" &18d8 00 00 7e 4c 18 32 7e 00 ; "z" &18e0 0e 18 18 70 18 18 0e 00 ; "{" &18e8 18 18 18 18 18 18 18 00 ; "|" &18f0 70 18 18 0e 18 18 70 00 ; "}" &18f8 76 d8 00 00 00 00 00 00 ; "~" # &1900 - &19ff is moved to &4f00 - &4fff at &1324 ; load_main_binary &4f00 a2 ff LDX #&ff &4f02 9a TXS &4f03 78 SEI &4f04 a9 00 LDA #&00 &4f06 8d 59 02 STA &0259 ; econet_keyboard_disable # Enable keyboard &4f09 a9 87 LDA #&87 ; &0287 = BREAK intercept code &4f0b 8d 88 02 STA &0288 ; BREAK intercept code + 1 &4f0e a9 02 LDA #&02 &4f10 8d 89 02 STA &0289 ; BREAK intercept code + 2 &4f13 a9 03 LDA #&03 # Clear memory on break &4f15 8d 58 02 STA &0258 ; ESCAPE/BREAK effect &4f18 a2 10 LDX #&10 ; &1210 = load_who4_string &4f1a a0 12 LDY #&12 &4f1c 20 f7 ff JSR &fff7 ; OSCLI # Load WHO4 at &1200 - &4eff (main binary) &4f1f 78 SEI &4f20 a2 35 LDX #&35 ; reset_vector_table_loop &4f22 bd 40 d9 LDA &d940,X ; os_default_vector_table &4f25 9d 00 02 STA &0200,X ; os_vector_table &4f28 ca DEX &4f29 10 f7 BPL &4f22 ; reset_vector_table_loop &4f2b a2 01 LDX #&01 ; R1: Number of characters per line &4f2d a9 00 LDA #&00 # Hide screen &4f2f 20 95 4f JSR &4f95 ; set_video_register &4f32 a9 50 LDA #&50 ; &5000 &4f34 85 01 STA &01 ; wipe_address_high &4f36 a0 00 LDY #&00 &4f38 84 00 STY &00 ; wipe_address_low &4f3a 98 TYA ; wipe_5000_to_7fff_loop # Wipe &5000 - &7fff &4f3b 91 00 STA (&00),Y ; wipe_address &4f3d c8 INY &4f3e d0 fb BNE &4f3b ; wipe_5000_to_7fff_loop &4f40 e6 01 INC &01 ; wipe_address_high &4f42 10 f7 BPL &4f3b ; wipe_5000_to_7fff_loop &4f44 a2 00 LDX #&00 ; copy_select_mode_code_loop &4f46 bd 33 cb LDA &cb33,X ; os_select_mode # Copy code from the OS to change screen mode &4f49 9d 00 01 STA &0100,X ; select_mode &4f4c e8 INX &4f4d e0 bd CPX #&bd &4f4f d0 f5 BNE &4f46 ; copy_select_mode_code_loop &4f51 a9 60 LDA #&60 ; RTS &4f53 8d bd 01 STA &01bd ; select_mode + &bd # Set the equivalent of &cbf0 to RTS &4f56 a9 02 LDA #&02 &4f58 20 00 01 JSR &0100 ; select_mode # Change to MODE 2 without clearing screen memory &4f5b a2 01 LDX #&01 ; R1: Number of characters per line &4f5d a9 00 LDA #&00 # Hide screen &4f5f 20 95 4f JSR &4f95 ; set_video_register &4f62 a9 01 LDA #&01 &4f64 8d 56 03 STA &0356 ; os_screen_memory_type &4f67 a9 04 LDA #&04 # Set addressable latch B4 to 0 &4f69 20 f8 e9 JSR &e9f8 ; os_rom_write_to_via_register_B # Writes A to &fe40, system VIA port B input/output register &4f6c a9 05 LDA #&05 # Set addressable latch B5 to 0, i.e. scroll from &4000 &4f6e 20 f8 e9 JSR &e9f8 ; os_rom_write_to_via_register_B # Writes A to &fe40, system VIA port B input/output register &4f71 a9 40 LDA #&40 &4f73 8d 54 03 STA &0354 ; os_screen_memory_length &4f76 a2 06 LDX #&06 ; R6: Vertical displayed register &4f78 a9 19 LDA #&19 &4f7a 20 95 4f JSR &4f95 ; set_video_register &4f7d a2 04 LDX #&04 ; R4: Vertical total register &4f7f a9 26 LDA #&26 &4f81 20 95 4f JSR &4f95 ; set_video_register &4f84 a2 0a LDX #&0a ; R10: Cursor start register &4f86 a9 20 LDA #&20 # Disable cursor &4f88 20 95 4f JSR &4f95 ; set_video_register &4f8b a2 07 LDX #&07 ; R7: Vertical sync position &4f8d a9 1e LDA #&1e &4f8f 20 95 4f JSR &4f95 ; set_video_register &4f92 4c 00 4e JMP &4e00 ; main_binary_entry_point ; set_video_register &4f95 8e 00 fe STX &fe00 ; video register number &4f98 8d 01 fe STA &fe01 ; video register value &4f9b 60 RTS ; unused &4f9c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4fac 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4fbc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4fcc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4fdc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4fec 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4ffc 00 00 00 00 # &3300 - &3cff is moved to &2000 - &29ff at &4334 ; play_loading_screen_sound &2000 78 SEI &2001 a9 01 LDA #&01 &2003 85 80 STA &80 ; unused # Unused variable &2005 85 81 STA &81 ; unused # Unused variable &2007 a9 00 LDA #&00 &2009 85 70 STA &70 ; time_low &200b 85 71 STA &71 ; time_high &200d a9 ff LDA #&ff # Set all bits to to output &200f 8d 43 fe STA &fe43 ; System VIA data direction register A ; play_loading_screen_sound_loop &2012 20 6c 20 JSR &206c ; calculate_frequency &2015 a5 72 LDA &72 ; frequency_low &2017 29 0f AND #&0f &2019 09 80 ORA #&80 # Set channel 3 frequency &201b 20 59 20 JSR &2059 ; write_byte_to_sound_chip &201e a5 73 LDA &73 ; frequency_high &2020 29 03 AND #&03 &2022 a0 04 LDY #&04 ; shift_loop &2024 26 72 ROL &72 ; frequency_low &2026 2a ROL A &2027 85 73 STA &73 ; frequency_high &2029 88 DEY &202a d0 f8 BNE &2024 ; shift_loop &202c 20 59 20 JSR &2059 ; write_byte_to_sound_chip &202f a9 90 LDA #&90 # Set channel 3 to maximum volume &2031 20 59 20 JSR &2059 ; write_byte_to_sound_chip &2034 a9 64 LDA #&64 &2036 38 SEC &2037 e5 70 SBC &70 ; time_low &2039 85 90 STA &90 ; delay_low &203b a9 07 LDA #&07 &203d e5 71 SBC &71 ; time_high &203f 85 91 STA &91 ; delay_high &2041 a4 90 LDY &90 ; delay_low &2043 a6 91 LDX &91 ; delay_high ; delay_loop &2045 88 DEY &2046 d0 fd BNE &2045 ; delay_loop &2048 ca DEX &2049 d0 fa BNE &2045 ; delay_loop &204b e6 70 INC &70 ; time_low &204d d0 c3 BNE &2012 ; play_loading_screen_sound_loop &204f e6 71 INC &71 ; time_high &2051 a5 71 LDA &71 ; time_high &2053 c9 04 CMP #&04 &2055 d0 bb BNE &2012 ; play_loading_screen_sound_loop &2057 58 CLI &2058 60 RTS ; write_byte_to_sound_chip &2059 8d 41 fe STA &fe41 ; System VIA output register A &205c a9 00 LDA #&00 # Set sound chip write pin low &205e 8d 40 fe STA &fe40 ; System VIA port B input/output register &2061 a0 03 LDY #&03 ; delay_loop &2063 88 DEY &2064 d0 fd BNE &2063 ; delay_loop &2066 a9 08 LDA #&08 # Set sound chip write pin high &2068 8d 40 fe STA &fe40 ; System VIA port B input/output register &206b 60 RTS ; calculate_frequency &206c a5 71 LDA &71 ; time_high &206e 85 73 STA &73 ; frequency_high &2070 a5 70 LDA &70 ; time_low &2072 29 03 AND #&03 &2074 aa TAX &2075 bd 86 20 LDA &2086,X ; wobble_table &2078 85 81 STA &81 &207a a5 70 LDA &70 ; time_low &207c 18 CLC &207d 65 81 ADC &81 ; wobble &207f 85 72 STA &72 ; frequency_low &2081 90 02 BCC &2085 ; leave &2083 e6 73 INC &73 ; frequency_high ; leave &2085 60 RTS ; wobble_table &2086 00 10 20 10 ; unused &208a 60 ; envelope_data &208b 01 00 00 00 00 00 00 7e ff ff ff 7e 7e 00 00 00 ; envelope 1 (unused) &209b 81 08 f8 00 03 03 00 28 ff 00 ff 7e 64 15 21 ff ; envelope 2 (unused) &20ab 0a fc 01 04 01 00 01 7f ff 00 ff 7e 00 1a 37 ff ; envelope 3 &20bb 04 00 00 00 00 00 00 7f f7 00 ed 7e 00 64 6f ff ; envelope 4 (unused) &20cb 14 7e 7e 7f 29 1a 14 2a ff fc f1 7e 4e 59 33 9e ; envelope 5 (unused) &20db 04 01 ff 01 01 02 01 7f ff 00 ff 7e 00 64 6f ff ; envelope 6 &20eb 02 01 ff 01 01 02 01 7f ff 00 ff 7e 00 64 6f ff ; envelope 7 &20fb 01 01 ff 01 01 02 01 7f ff 00 ff 7e 00 64 6f ff ; envelope 8 (unused) &210b 83 ff 02 ff 01 01 01 7f fb 00 fb 7e 37 64 6f ff ; envelope 9 (unused) &211b 7a 00 00 00 00 00 00 7f f7 00 ed 7e 00 10 c7 ff ; envelope 10 (unused) &212b 01 01 ff 01 01 02 01 06 f1 00 f1 7e 00 64 6f ff ; envelope 11 (unused) &213b 01 00 31 00 09 01 03 3f ff 00 ff 7e 00 64 01 ff ; envelope 12 (unused) &214b 01 00 31 00 02 01 02 3f ff 00 ff 7e 00 64 01 ff ; envelope 13 (unused) &215b 05 ff fd 01 02 97 15 7f ff 00 00 7e 0a ff b4 ff ; envelope 14 &216b 81 00 08 00 00 7e 00 7f ff 00 ff 7e 00 44 01 ff ; envelope 15 ; channel_1_data ; e p d &217b 00 9d 30 &217e 00 9d 30 &2181 00 9d 30 &2184 00 9d 30 &2187 00 9d 18 &218a 06 91 0c &218d 06 c5 0c &2190 06 c1 48 &2193 06 9d 0c &2196 06 89 0c &2199 06 91 60 &219c 06 c1 0c &219f 06 b1 0c &21a2 06 91 15 &21a5 06 91 03 &21a8 06 9d 15 &21ab 06 95 03 &21ae 06 91 18 &21b1 06 91 0c &21b4 06 59 0c &21b7 06 61 10 &21ba 06 65 04 &21bd 06 6d 04 &21c0 06 61 15 &21c3 06 95 03 &21c6 06 91 78 &21c9 00 9d 18 &21cc 06 b9 0c &21cf 06 c5 0c &21d2 06 c1 48 &21d5 06 b1 0c &21d8 06 c1 0c &21db 06 b9 10 &21de 06 b1 04 &21e1 06 ad 04 &21e4 06 b1 30 &21e7 06 81 0c &21ea 06 9d 0c &21ed 06 a5 10 &21f0 06 9d 04 &21f3 06 95 04 &21f6 06 9d 0c &21f9 06 81 09 &21fc 06 9d 03 &21ff 06 a5 10 &2202 06 9d 04 &2205 06 95 04 &2208 06 9d 0c &220b 06 b1 09 &220e 06 c1 03 &2211 06 b9 28 &2214 06 b1 04 &2217 06 ad 04 &221a 06 b1 60 &221d 0f 75 0c &2220 0f 81 0c &2223 0f 91 0c &2226 0f 9d 0c &2229 0f ad 0c &222c 0f b9 0c &222f 0f c5 0c &2232 0f d5 0c &2235 06 c1 0c &2238 06 b1 0c &223b 06 91 15 &223e 06 91 03 &2241 06 9d 15 &2244 06 95 03 &2247 06 91 18 &224a 06 91 0c &224d 06 65 0c &2250 06 61 10 &2253 06 65 04 &2256 06 6d 04 &2259 06 61 15 &225c 06 95 03 &225f 06 91 90 &2262 06 b9 0c &2265 06 c5 0c &2268 06 c1 48 &226b 06 b1 0c &226e 06 c1 0c &2271 06 b9 10 &2274 06 b1 04 &2277 06 ad 04 &227a 06 b1 30 &227d 06 81 0c &2280 06 9d 0c &2283 06 a5 10 &2286 06 9d 04 &2289 06 95 04 &228c 06 9d 0c &228f 06 81 09 &2292 06 9d 03 &2295 06 a5 10 &2298 06 9d 04 &229b 06 95 04 &229e 06 9d 0c &22a1 06 b1 09 &22a4 06 c1 03 &22a7 06 b9 28 &22aa 06 b1 04 &22ad 06 ad 04 &22b0 06 a5 60 &22b3 00 9d 04 &22b6 06 75 04 &22b9 06 75 04 &22bc 06 75 06 &22bf 00 9d 06 &22c2 00 9d 04 &22c5 06 75 04 &22c8 06 75 04 &22cb 06 75 06 &22ce 00 9d 06 &22d1 00 9d 04 &22d4 06 75 04 &22d7 06 75 04 &22da 06 75 06 &22dd 00 9d 06 &22e0 06 61 0c &22e3 06 95 0c &22e6 06 91 18 &22e9 06 91 15 &22ec 06 cd 03 &22ef 06 c1 3c &22f2 0f 45 54 &22f5 0f 45 60 ; channel_2_data ; e p d &22f8 00 3d 18 &22fb 00 3d 0c &22fe 00 3d 06 &2301 00 3d 03 &2304 06 3d 03 &2307 06 45 09 &230a 06 45 03 &230d 06 45 09 &2310 06 3d 03 &2313 06 45 09 &2316 06 45 03 &2319 06 45 09 &231c 06 3d 03 &231f 06 45 09 &2322 06 45 03 &2325 06 45 09 &2328 06 4d 03 &232b 06 51 09 &232e 06 51 03 &2331 06 51 09 &2334 06 3d 03 &2337 06 45 09 &233a 06 45 03 &233d 06 45 09 &2340 06 3d 03 &2343 06 45 09 &2346 06 45 03 &2349 06 45 09 &234c 06 3d 03 &234f 06 45 09 &2352 06 45 03 &2355 06 45 09 &2358 06 4d 03 &235b 06 51 09 &235e 06 51 03 &2361 06 51 09 &2364 06 3d 03 &2367 06 45 09 &236a 06 45 03 &236d 06 45 09 &2370 06 3d 03 &2373 06 45 09 &2376 06 45 03 &2379 06 45 09 &237c 06 29 03 &237f 06 31 09 &2382 06 31 03 &2385 06 31 09 &2388 06 29 03 &238b 06 31 09 &238e 06 31 03 &2391 06 31 04 &2394 06 35 04 &2397 06 3d 04 &239a 06 45 09 &239d 06 45 03 &23a0 06 45 09 &23a3 06 3d 03 &23a6 06 45 09 &23a9 06 45 03 &23ac 06 45 09 &23af 06 29 03 &23b2 06 31 09 &23b5 06 31 03 &23b8 06 31 09 &23bb 06 29 03 &23be 06 31 09 &23c1 06 31 03 &23c4 06 31 04 &23c7 06 35 04 &23ca 06 3d 04 &23cd 06 45 09 &23d0 06 45 03 &23d3 06 45 09 &23d6 06 3d 03 &23d9 06 45 09 &23dc 06 45 03 &23df 06 45 09 &23e2 06 4d 03 &23e5 06 51 09 &23e8 06 51 03 &23eb 06 51 09 &23ee 06 29 03 &23f1 06 31 09 &23f4 06 31 03 &23f7 06 31 04 &23fa 06 35 04 &23fd 06 3d 04 &2400 06 45 0c &2403 06 29 0c &2406 06 31 0c &2409 06 31 04 &240c 06 35 04 &240f 06 3d 04 &2412 06 31 09 &2415 06 31 03 &2418 06 31 09 &241b 06 29 03 &241e 06 31 09 &2421 06 31 03 &2424 06 31 09 &2427 06 29 03 &242a 06 31 09 &242d 06 31 03 &2430 06 31 09 &2433 06 35 03 &2436 06 3d 09 &2439 06 3d 03 &243c 06 3d 04 &243f 06 35 04 &2442 06 29 04 &2445 06 31 09 &2448 06 31 03 &244b 06 31 09 &244e 06 29 03 &2451 06 31 09 &2454 06 31 03 &2457 06 31 09 &245a 06 29 03 &245d 06 31 09 &2460 06 31 03 &2463 06 31 09 &2466 06 35 03 &2469 06 3d 09 &246c 06 3d 03 &246f 06 3d 04 &2472 06 35 04 &2475 06 29 04 &2478 06 21 09 &247b 06 21 03 &247e 06 21 09 &2481 06 1d 03 &2484 06 21 09 &2487 06 21 03 &248a 06 21 09 &248d 06 1d 03 &2490 06 21 09 &2493 06 21 03 &2496 06 21 09 &2499 06 1d 03 &249c 06 21 09 &249f 06 21 03 &24a2 06 21 09 &24a5 06 21 03 &24a8 06 1d 09 &24ab 06 1d 03 &24ae 06 1d 09 &24b1 06 1d 03 &24b4 06 21 09 &24b7 06 21 03 &24ba 06 21 09 &24bd 06 1d 03 &24c0 06 21 09 &24c3 06 21 03 &24c6 06 21 09 &24c9 06 1d 03 &24cc 06 21 09 &24cf 06 21 03 &24d2 06 21 09 &24d5 06 21 03 &24d8 06 35 09 &24db 06 35 03 &24de 06 35 09 &24e1 06 35 03 &24e4 06 21 09 &24e7 06 21 03 &24ea 06 21 09 &24ed 06 21 03 &24f0 06 35 09 &24f3 06 35 03 &24f6 06 35 09 &24f9 06 35 03 &24fc 06 21 09 &24ff 06 21 03 &2502 06 21 09 &2505 06 21 03 &2508 06 31 09 &250b 06 31 03 &250e 06 31 09 &2511 06 29 03 &2514 06 31 09 &2517 06 31 03 &251a 06 31 09 &251d 06 31 03 &2520 06 45 09 &2523 06 45 03 &2526 06 45 09 &2529 06 3d 03 &252c 06 45 09 &252f 06 45 03 &2532 06 45 09 &2535 06 29 03 &2538 06 31 09 &253b 06 31 03 &253e 06 31 09 &2541 06 29 03 &2544 06 31 09 &2547 06 31 03 &254a 06 31 04 &254d 06 35 04 &2550 06 3d 04 &2553 00 3d 30 &2556 00 3d 30 &2559 06 1d 09 &255c 06 1d 03 &255f 06 1d 09 &2562 06 1d 03 &2565 06 1d 09 &2568 06 1d 03 &256b 06 1d 09 &256e 06 1d 03 &2571 06 21 09 &2574 06 21 03 &2577 06 21 09 &257a 06 29 03 &257d 06 31 09 &2580 06 31 03 &2583 06 31 04 &2586 06 35 04 &2589 06 3d 04 &258c 06 1d 09 &258f 06 1d 03 &2592 06 1d 09 &2595 06 1d 03 &2598 06 1d 09 &259b 06 1d 03 &259e 06 1d 09 &25a1 06 1d 03 &25a4 06 31 09 &25a7 06 31 03 &25aa 06 31 09 &25ad 06 29 03 &25b0 06 31 09 &25b3 06 31 03 &25b6 06 31 09 &25b9 06 29 03 &25bc 06 31 09 &25bf 06 31 03 &25c2 06 31 09 &25c5 06 35 03 &25c8 06 3d 09 &25cb 06 3d 03 &25ce 06 3d 04 &25d1 06 35 04 &25d4 06 29 04 &25d7 06 31 09 &25da 06 31 03 &25dd 06 31 09 &25e0 06 29 03 &25e3 06 31 09 &25e6 06 31 03 &25e9 06 31 09 &25ec 06 29 03 &25ef 06 31 09 &25f2 06 31 03 &25f5 06 31 09 &25f8 06 35 03 &25fb 06 3d 09 &25fe 06 3d 03 &2601 06 3d 04 &2604 06 35 04 &2607 06 29 04 &260a 06 21 09 &260d 06 21 03 &2610 06 21 09 &2613 06 1d 03 &2616 06 21 09 &2619 06 21 03 &261c 06 21 09 &261f 06 1d 03 &2622 06 21 09 &2625 06 21 03 &2628 06 21 09 &262b 06 1d 03 &262e 06 21 09 &2631 06 21 03 &2634 06 21 09 &2637 06 21 03 &263a 06 1d 09 &263d 06 1d 03 &2640 06 1d 09 &2643 06 1d 03 &2646 06 21 09 &2649 06 21 03 &264c 06 21 09 &264f 06 1d 03 &2652 06 21 09 &2655 06 21 03 &2658 06 21 09 &265b 06 1d 03 &265e 06 21 09 &2661 06 21 03 &2664 06 21 09 &2667 06 21 03 &266a 06 35 09 &266d 06 35 03 &2670 06 35 09 &2673 06 35 03 &2676 06 21 09 &2679 06 21 03 &267c 06 21 09 &267f 06 21 03 &2682 06 35 09 &2685 06 35 03 &2688 06 35 09 &268b 06 35 03 &268e 06 21 09 &2691 06 21 03 &2694 06 21 09 &2697 06 21 03 &269a 06 31 09 &269d 06 31 03 &26a0 06 31 09 &26a3 06 29 03 &26a6 06 31 09 &26a9 06 31 03 &26ac 06 31 09 &26af 06 31 03 &26b2 06 45 09 &26b5 06 45 03 &26b8 06 45 09 &26bb 06 3d 03 &26be 06 45 09 &26c1 06 45 03 &26c4 06 45 09 &26c7 06 3d 03 &26ca 06 45 09 &26cd 06 45 03 &26d0 06 45 09 &26d3 06 4d 03 &26d6 06 51 09 &26d9 06 51 03 &26dc 06 51 04 &26df 06 4d 04 &26e2 06 3d 04 &26e5 06 45 15 &26e8 06 3d 03 &26eb 06 45 15 &26ee 06 3d 03 &26f1 06 45 15 &26f4 06 4d 03 &26f7 06 51 09 &26fa 06 51 03 &26fd 06 4d 09 &2700 06 4d 03 &2703 06 31 3c &2706 00 3d 0c &2709 00 3d 18 &270c 00 3d 0c &270f 06 1d 54 &2712 06 1d 60 &2715 06 1d 60 ; channel_3_data ; e p d &2718 0e 1d 60 &271b 00 9d 30 &271e 00 3d 30 &2721 00 3d 30 &2724 00 3d 30 &2727 00 3d 30 &272a 00 3d 30 &272d 00 3d 30 &2730 00 3d 30 &2733 00 3d 30 &2736 00 3d 30 &2739 00 3d 30 &273c 00 3d 30 &273f 00 3d 30 &2742 00 3d 30 &2745 00 3d 30 &2748 00 3d 30 &274b 00 3d 30 &274e 00 3d 30 &2751 00 3d 30 &2754 00 3d 30 &2757 00 3d 30 &275a 00 3d 30 &275d 00 3d 30 &2760 03 6d 0c &2763 03 7d 0c &2766 03 89 0c &2769 03 95 0c &276c 03 a5 0c &276f 03 b1 0c &2772 03 c1 0c &2775 03 cd 0c &2778 07 b1 0c &277b 07 91 0c &277e 07 81 15 &2781 07 81 03 &2784 07 91 15 &2787 07 89 03 &278a 07 7d 18 &278d 07 81 0c &2790 07 59 0c &2793 07 51 10 &2796 00 3d 04 &2799 00 3d 04 &279c 07 51 15 &279f 07 89 03 &27a2 07 81 90 &27a5 07 ad 0c &27a8 07 b9 0c &27ab 07 b1 48 &27ae 07 9d 18 &27b1 07 95 18 &27b4 07 91 30 &27b7 00 9d 18 &27ba 07 95 10 &27bd 00 9d 04 &27c0 00 9d 04 &27c3 07 81 0c &27c6 00 9d 0c &27c9 07 95 10 &27cc 00 9d 04 &27cf 00 9d 04 &27d2 07 81 0c &27d5 00 9d 0c &27d8 07 ad 28 &27db 00 9d 04 &27de 00 9d 04 &27e1 07 91 60 &27e4 00 9d 04 &27e7 07 61 04 &27ea 07 61 04 &27ed 07 61 06 &27f0 00 3d 06 &27f3 00 3d 04 &27f6 07 61 04 &27f9 07 61 04 &27fc 07 61 06 &27ff 00 3d 06 &2802 00 3d 04 &2805 07 61 04 &2808 07 61 04 &280b 07 61 06 &280e 00 3d 06 &2811 00 3d 0c &2814 00 3d 0c &2817 07 81 18 &281a 00 9d 18 &281d 00 9d 30 &2820 00 9d 0c &2823 0e 91 54 &2826 0e 91 60 ; initialise_tune &2829 a9 0f LDA #&0f ; Flush buffers &282b a2 00 LDX #&00 ; Flush all buffers &282d 20 f4 ff JSR &fff4 ; OSBYTE &2830 a2 00 LDX #&00 ; copy_envelope_data_loop &2832 bd 8b 20 LDA &208b,X ; envelope_data &2835 9d c0 08 STA &08c0,X ; os_envelope_storage &2838 e8 INX &2839 d0 f7 BNE &2832 ; copy_envelope_data_loop &283b ad 62 02 LDA &0262 ; os_sound_suppression &283e d0 03 BNE &2843 ; skip_loading_screen_sound &2840 20 00 20 JSR &2000 ; play_loading_screen_sound ; skip_loading_screen_sound &2843 20 6b 28 JSR &286b ; initialise_channels &2846 78 SEI &2847 ad 20 02 LDA &0220 ; event_vector_low &284a 8d 78 29 STA &2978 ; previous_event_vector_low &284d ad 21 02 LDA &0221 ; event_vector_high &2850 8d 79 29 STA &2979 ; previous_event_vector_high &2853 a9 9e LDA #&9e ; &289e = tune_event_handler &2855 8d 20 02 STA &0220 ; event_vector_low &2858 a9 28 LDA #&28 &285a 8d 21 02 STA &0221 ; event_vector_high &285d a9 0e LDA #&0e ; Enable event &285f a2 04 LDX #&04 ; v-sync event &2861 20 f4 ff JSR &fff4 ; OSBYTE &2864 a9 1e LDA #&1e &2866 8d 47 fe STA &fe47 ; System VIA timer 1 latch MSB &2869 58 CLI &286a 60 RTS ; initialise_channels &286b a9 7b LDA #&7b ; &217b = channel_1_data &286d 85 10 STA &10 ; channels_data_address_low &286f a9 21 LDA #&21 &2871 85 11 STA &11 ; channels_data_address_high &2873 a9 f8 LDA #&f8 ; &22f8 = channel_2_data &2875 85 12 STA &12 ; channels_data_address_low + 2 &2877 a9 22 LDA #&22 &2879 85 13 STA &13 ; channels_data_address_high + 2 &287b a9 18 LDA #&18 ; &2718 = channel_3_data &287d 85 14 STA &14 ; channels_data_address_low + 4 &287f a9 27 LDA #&27 &2881 85 15 STA &15 ; channels_data_address_high + 4 &2883 a2 7c LDX #&7c ; &297c = silence_channel_1_sound &2885 a0 29 LDY #&29 &2887 a9 07 LDA #&07 ; Generate a sound &2889 20 f1 ff JSR &fff1 ; OSWORD &288c a2 84 LDX #&84 ; &297c = silence_channel_2_sound &288e a0 29 LDY #&29 &2890 a9 07 LDA #&07 ; Generate a sound &2892 20 f1 ff JSR &fff1 ; OSWORD &2895 a2 8c LDX #&8c ; &297c = silence_channel_3_sound &2897 a0 29 LDY #&29 &2899 a9 07 LDA #&07 ; Generate a sound &289b 4c f1 ff JMP &fff1 ; OSWORD ; tune_event_handler &289e 48 PHA ; tmp_a &289f 8a TXA &28a0 48 PHA ; tmp_x &28a1 98 TYA &28a2 48 PHA ; tmp_y &28a3 a5 ec LDA &ec ; os_most_recently_pressed_key &28a5 c9 e2 CMP #&e2 ; SPACE &28a7 d0 20 BNE &28c9 ; space_not_pressed &28a9 85 70 STA &70 ; space_pressed # Set to non-zero to indicate SPACE was pressed &28ab ad 78 29 LDA &2978 ; previous_event_vector_low &28ae 8d 20 02 STA &0220 ; event_vector_low &28b1 ad 79 29 LDA &2979 ; previous_event_vector_high &28b4 8d 21 02 STA &0221 ; event_vector_high &28b7 a9 0d LDA #&0d ; Disable event &28b9 a2 04 LDX #&04 ; v-sync event &28bb 20 f4 ff JSR &fff4 ; OSBYTE &28be a9 27 LDA #&27 &28c0 8d 47 fe STA &fe47 ; System VIA timer 1 latch MSB &28c3 20 6b 28 JSR &286b ; initialise_channels &28c6 4c 0b 29 JMP &290b ; leave_event_handler ; space_not_pressed &28c9 c9 90 CMP #&90 ; Q &28cb d0 0d BNE &28da ; q_not_pressed &28cd ad 62 02 LDA &0262 ; os_sound_suppression &28d0 d0 11 BNE &28e3 ; s_not_pressed &28d2 a9 01 LDA #&01 &28d4 8d 62 02 STA &0262 ; os_sound_suppression # Set to non-zero to disable sound &28d7 20 6b 28 JSR &286b ; initialise_channels ; q_not_pressed &28da c9 d1 CMP #&d1 ; S &28dc d0 05 BNE &28e3 ; s_not_pressed &28de a9 00 LDA #&00 &28e0 8d 62 02 STA &0262 ; os_sound_suppression # Set to zero to enable sound ; s_not_pressed &28e3 ad 7b 29 LDA &297b ; tune_cooldown_high &28e6 d0 2b BNE &2913 ; consider_restarting_tune &28e8 a2 00 LDX #&00 # Channel 1 &28ea 20 21 29 JSR &2921 ; consider_playing_note &28ed a2 01 LDX #&01 # Channel 2 &28ef 20 21 29 JSR &2921 ; consider_playing_note &28f2 a2 02 LDX #&02 # Channel 3 &28f4 20 21 29 JSR &2921 ; consider_playing_note &28f7 a5 10 LDA &10 ; channels_data_address_low &28f9 c9 fb CMP #&fb ; &22fb # Is this the end of the tune? &28fb d0 0e BNE &290b ; leave_event_handler &28fd a5 11 LDA &11 ; channels_data_address_high &28ff c9 22 CMP #&22 &2901 d0 08 BNE &290b ; leave_event_handler &2903 a9 03 LDA #&03 # If so, pause before starting again &2905 8d 7a 29 STA &297a ; tune_cooldown_low &2908 8d 7b 29 STA &297b ; tune_cooldown_high ; leave_event_handler &290b 68 PLA ; tmp_y &290c a8 TAY &290d 68 PLA ; tmp_x &290e aa TAX &290f 68 PLA ; tmp_a &2910 6c 78 29 JMP (&2978) ; previous_event_vector ; consider_restarting_tune &2913 20 6b 28 JSR &286b ; initialise_channels &2916 ce 7a 29 DEC &297a ; tune_cooldown_low &2919 d0 f0 BNE &290b ; leave_event_handler &291b ce 7b 29 DEC &297b ; tune_cooldown_high &291e 4c 0b 29 JMP &290b ; leave_event_handler ; consider_playing_note &2921 86 00 STX &00 ; channel &2923 e8 INX &2924 8e 70 29 STX &2970 ; tune_sound + 0 (channel) &2927 a9 fa LDA #&fa &2929 38 SEC &292a e5 00 SBC &00 ; channel &292c aa TAX &292d a9 80 LDA #&80 ; Read I/O device &292f a0 ff LDY #&ff &2931 20 f4 ff JSR &fff4 ; OSBYTE &2934 e0 00 CPX #&00 &2936 f0 37 BEQ &296f ; leave # Has the previous note on this channel finished? &2938 06 00 ASL &00 ; channel &293a a6 00 LDX &00 ; channel &293c b5 10 LDA &10,X ; channels_data_address_low &293e 85 01 STA &01 ; note_address_low &2940 b5 11 LDA &11,X ; channels_data_address_high &2942 85 02 STA &02 ; note_address_high &2944 a0 00 LDY #&00 &2946 b1 01 LDA (&01),Y ; note_address &2948 8d 72 29 STA &2972 ; tune_sound + 2 (volume) &294b c8 INY ; 1 &294c b1 01 LDA (&01),Y ; note_address &294e 8d 74 29 STA &2974 ; tune_sound + 4 (pitch) &2951 c8 INY ; 2 &2952 b1 01 LDA (&01),Y ; note_address &2954 8d 76 29 STA &2976 ; tune_sound + 6 (duration) &2957 a2 70 LDX #&70 ; &2970 = tune_sound &2959 a0 29 LDY #&29 &295b a9 07 LDA #&07 ; Generate a sound &295d 20 f1 ff JSR &fff1 ; OSWORD &2960 a6 00 LDX &00 ; channel &2962 b5 10 LDA &10,X ; channels_data_address_low &2964 18 CLC &2965 69 03 ADC #&03 &2967 95 10 STA &10,X ; channels_data_address_low &2969 b5 11 LDA &11,X ; channels_data_address_high &296b 69 00 ADC #&00 &296d 95 11 STA &11,X ; channels_data_address_high ; leave &296f 60 RTS ; tune_sound ; chan vol pitch dur &2970 00 00 00 00 00 00 00 00 # Channel, volume, pitch and duration modified ; previous_event_vector_low &2978 00 ; previous_event_vector_high &2979 00 ; tune_cooldown_low &297a 00 ; tune_cooldown_high &297b 00 ; silence_channel_1_sound ; chan vol pitch dur &297c 11 00 00 00 00 00 00 00 ; silence_channel_2_sound ; chan vol pitch dur &2984 12 00 00 00 00 00 00 00 ; silence_channel_3_sound ; chan vol pitch dur &298c 13 00 00 00 00 00 00 00 ; unused &2994 41 20 62 69 67 20 27 48 49 27 20 66 72 6f 6d 20 ; "A big 'HI' from " &29a4 49 4c 54 44 4e 20 74 68 65 20 4d 65 67 61 20 42 ; "ILTDN the Mega B" &29b4 65 69 6e 67 2e 2e 2e 20 ; "eing... " ; unused # Not meaningful &29bc b5 4a 4f 72 b4 01 a6 01 d2 2b 31 72 93 01 b2 ef &29cc 91 3d 63 08 4f fc 10 88 f2 a6 d1 32 b8 27 72 b5 &29dc f1 df 9f 13 72 4d cd d9 70 df 58 19 a1 8b 5d 00 &29ec 0c df 37 16 9f 29 e3 1d f7 13 f8 7e 46 7c 4f 2b &29fc b3 20 1e d1 ; title_screen_data &3d00 94 9a 9d 91 20 20 20 20 20 20 20 20 20 20 20 20 ; ".... " &3d10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ".... .Micro Power bring you... " &3d20 20 20 20 20 20 20 20 20 94 9a 9d 91 20 20 20 20 ; ".... " &3d30 83 4d 69 63 72 6f 20 50 6f 77 65 72 20 62 72 69 ; "....... . .. ... " &3d40 6e 67 20 79 6f 75 2e 2e 2e 20 20 20 20 20 20 20 ; "..... .................. ........... " &3d50 94 9a 9d 92 20 20 20 20 20 20 20 20 20 20 20 20 ; ".............. ....... ........... " &3d60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ".... " &3d70 20 20 20 20 20 20 20 20 94 9a 9d 93 fc ec b0 20 ; ".... . . .. " &3d80 20 20 20 20 20 20 20 fc 20 20 20 20 20 20 20 20 ; ".... .......... .......... " &3d90 20 20 20 e8 b4 20 fc e8 b4 20 20 20 20 20 20 20 ; ".... .......... ......... " &3da0 94 9a 9d 95 ff 20 ff e8 b7 eb b4 fe a3 ad a2 ff ; ".... " &3db0 a3 e8 b7 eb b4 ff a6 ad 20 20 20 ea f5 f5 ff ea ; ".... .... . ... " &3dc0 b7 eb b4 fe a3 fd 20 20 94 9a 9d 91 af ae a1 a2 ; ".... ...... .......... ....... " &3dd0 ad ae a1 ab ac a7 20 ab ac a2 ad ae a1 af 20 20 ; ".... . ...... .... ... ...... " &3de0 20 20 20 aa a7 a2 af aa a5 aa a5 ab ac a7 20 20 ; ".... " &3df0 94 9a 9d 91 20 20 20 20 20 20 20 20 20 20 20 20 ; ".... ..................... .. " &3e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ".... .. .................... " &3e10 20 20 20 20 20 20 20 20 94 9a 9d 92 20 20 20 20 ; ".... . ..... ............ . " &3e20 20 20 20 20 20 20 20 20 20 20 fc 20 20 20 20 fc ; ".... " &3e30 20 e8 b4 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ".... " &3e40 94 9a 9d 93 20 20 20 20 20 e2 f3 fd ea b7 eb b4 ; ".... " &3e50 fe a3 ff 20 20 20 a2 ff a3 ea b7 eb b4 fe f3 fd ; ".... ...Please wait - loading now! .. " &3e60 20 20 20 20 20 20 20 20 94 9a 9d 95 20 20 20 20 ; ".... " &3e70 20 ab ac af aa a5 aa a5 ab ac af 20 20 20 20 ab ; ".... " &3e80 ac aa a5 aa a5 ab ac a4 20 20 20 20 20 20 20 20 ; ".... .ILTDN " &3e90 94 9a 9d 91 20 20 20 20 20 20 20 20 20 20 20 20 ; " " &3ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &3eb0 20 20 20 20 20 20 20 20 94 9a 9d 91 20 20 20 fc &3ec0 b0 f8 b4 20 ac 20 20 20 20 20 20 20 20 20 20 20 &3ed0 20 20 20 20 20 20 20 e0 bc a4 20 20 20 20 20 20 &3ee0 94 9a 9d 92 20 20 20 ff eb eb b5 a2 ff 20 ff a3 &3ef0 fd e8 f7 fb b4 ee f3 b3 20 20 20 e8 b7 eb b4 ee &3f00 bd a4 20 20 20 20 20 20 94 9a 9d 93 20 20 20 af &3f10 20 aa a5 a8 af a4 af 20 af a2 ad ac 20 ac ac a7 &3f20 20 20 20 a2 ad ae a1 aa a5 20 20 20 20 20 20 20 &3f30 94 9a 9d 95 20 20 20 20 20 20 20 20 20 20 20 20 &3f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &3f50 20 20 20 20 20 20 20 20 94 9a 9d 91 20 20 20 20 &3f60 20 a8 fc ac e4 bc ac ac f8 ac fc e0 bc ec b4 f0 &3f70 ac fc e0 bc ec b4 20 f8 a4 20 20 20 20 20 20 20 &3f80 94 9a 9d 91 20 20 20 20 20 e8 b7 20 fe ad a4 e8 &3f90 bf fc a3 fe ed b6 e9 b7 e8 b7 fe ed b6 a1 e8 b7 &3fa0 20 20 20 20 20 20 20 20 94 9a 9d 92 20 20 20 20 &3fb0 20 af 20 aa ad ac a4 af 20 af aa a5 aa a5 ab ac &3fc0 a7 aa a5 aa a5 20 ac 20 20 20 20 20 20 20 20 20 &3fd0 94 9a 9d 93 20 20 20 20 20 20 20 20 20 20 20 20 &3fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &3ff0 20 20 20 20 20 20 20 20 94 9a 9d 95 20 20 20 20 &4000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4020 94 9a 9d 91 20 20 20 20 20 20 20 20 20 20 20 20 &4030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4040 20 20 20 20 20 20 20 20 94 9a 9d 91 20 81 9d 83 &4050 50 6c 65 61 73 65 20 77 61 69 74 20 2d 20 6c 6f &4060 61 64 69 6e 67 20 6e 6f 77 21 20 94 9d 20 20 20 &4070 94 9a 9d 92 20 20 20 20 20 20 20 20 20 20 20 20 &4080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4090 20 20 20 20 20 20 20 20 94 9a 9d 93 20 20 20 20 &40a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &40b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &40c0 94 9a 9d 95 20 20 20 20 20 20 20 20 20 20 20 20 &40d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &40e0 20 86 49 4c 54 44 4e 20 20 20 20 20 20 20 20 20 &40f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; write_error_message &4100 68 PLA # Error follows call to function &4101 85 a8 STA &a8 ; error_address_low &4103 68 PLA &4104 85 a9 STA &a9 ; error_address_high &4106 a9 01 LDA #&01 &4108 20 49 fa JSR &fa49 ; os_write_null_terminated_string &410b 1a ; Restore default windows &410c 0c ; Clear screen &410d 1f 07 01 ; TAB(&07, &01) &4110 8d 85 ; DOUBLE_HEIGHT, MAGENTA &4112 53 79 73 74 65 6d 20 65 72 72 6f 72 20 64 65 74 ; "System error detected" &4122 65 63 74 65 64 &4127 1f 07 02 ; TAB(&07, &02) &412a 8d 85 ; DOUBLE_HEIGHT, MAGENTA &412c 53 79 73 74 65 6d 20 65 72 72 6f 72 20 64 65 74 ; "System error detected" &413c 65 63 74 65 64 &4141 0d ; CR &4142 0d ; CR &4143 00 ; end of string &4144 a0 ff LDY #&ff ; find_end_of_error_loop &4146 c8 INY &4147 b1 a8 LDA (&a8),Y ; error_address &4149 d0 fb BNE &4146 ; find_end_of_error_loop &414b 20 e7 ff JSR &ffe7 ; OSNEWL &414e 20 e7 ff JSR &ffe7 ; OSNEWL &4151 84 ab STY &ab ; length &4153 a9 28 LDA #&28 &4155 38 SEC &4156 e5 ab SBC &ab ; length &4158 4a LSR A &4159 a8 TAY &415a a9 20 LDA #&20 ; " " ; write_padding_loop &415c 20 ee ff JSR &ffee ; OSWRCH # Centre error message &415f 88 DEY &4160 d0 fa BNE &415c ; write_padding_loop &4162 a5 a9 LDA &a9 ; error_address_high &4164 48 PHA &4165 a5 a8 LDA &a8 ; error_address_low &4167 48 PHA &4168 a9 01 LDA #&01 &416a 4c 49 fa JMP &fa49 ; os_write_null_terminated_string # Write error message ; who_string &416d 57 48 4f ; "WHO" ; entry_point &4170 a2 03 LDX #&03 &4172 20 b0 4e JSR &4eb0 ; set_break_effect &4175 a9 c9 LDA #&c9 ; Read/Write keyboard Enable/Disable &4177 a2 01 LDX #&01 ; disable keyboard &4179 20 b2 4e JSR &4eb2 ; osbyte_with_zero_Y &417c a9 16 LDA #&16 # Change to MODE 7 &417e 20 ee ff JSR &ffee ; OSWRCH &4181 a9 07 LDA #&07 &4183 20 ee ff JSR &ffee ; OSWRCH &4186 a2 00 LDX #&00 ; copy_title_screen_loop # Display MODE 7 title screen &4188 bd 00 3d LDA &3d00,X ; title_screen_data &418b 9d 00 7c STA &7c00,X ; screen_memory &418e bd 00 3e LDA &3e00,X ; title_screen_data + &100 &4191 9d 00 7d STA &7d00,X ; screen_memory + &100 &4194 bd 00 3f LDA &3f00,X ; title_screen_data + &200 &4197 9d 00 7e STA &7e00,X ; screen_memory + &200 &419a bd 00 40 LDA &4000,X ; title_screen_data + &300 &419d 9d 00 7f STA &7f00,X ; screen_memory + &300 &41a0 e8 INX &41a1 d0 e5 BNE &4188 ; copy_title_screen_loop &41a3 a2 02 LDX #&02 ; R2: Horizontal sync position register &41a5 a9 35 LDA #&35 &41a7 20 46 43 JSR &4346 ; set_video_register &41aa a2 0a LDX #&0a ; R10: Cursor start register &41ac a9 20 LDA #&20 # Disable cursor &41ae 20 46 43 JSR &4346 ; set_video_register ; check_roms # For each ROM, &41b1 a2 0f LDX #&0f ; check_roms_loop &41b3 a0 02 LDY #&02 &41b5 8e 30 fe STX &fe30 ; Paged ROM latch ; check_rom_string_loop &41b8 b9 24 80 LDA &8024,Y ; rom_data + &24 &41bb 29 df AND #&df # Convert to uppercase &41bd d9 6d 41 CMP &416d,Y ; who_string &41c0 d0 05 BNE &41c7 ; consider_next_rom # Is it the Doctor Who and the Mines of Terror ROM? &41c2 88 DEY &41c3 10 f3 BPL &41b8 ; check_rom_string_loop &41c5 30 03 BMI &41ca ; found_rom # If so, don't check any further ; consider_next_rom &41c7 ca DEX &41c8 10 e9 BPL &41b3 ; check_roms_loop ; found_rom &41ca a5 f4 LDA &f4 ; os_ram_copy_of_currently_selected_rom_number &41cc 8d 30 fe STA &fe30 ; Paged ROM latch &41cf e0 ff CPX #&ff &41d1 d0 4b BNE &421e ; incoming_message # Did any of the ROMs match? &41d3 a9 b4 LDA #&b4 ; Read/Write OSHWM &41d5 a2 00 LDX #&00 &41d7 a0 ff LDY #&ff &41d9 ea NOP # Probably a NOPed out JSR &fff4 ; OSBYTE &41da ea NOP &41db ea NOP &41dc e0 19 CPX #&19 # If it was, is this a disk system? (i.e. PAGE >= &1900) &41de 90 05 BCC &41e5 ; skip_load &41e0 ad c5 4e LDA &4ec5 ; r_dr_load_attempted # If so, and it hasn't already been attempted, &41e3 d0 22 BNE &4207 ; attempt_r_dr_load # possibly attempt to load the ROM (never branches) ; skip_load &41e5 20 c0 4e JSR &4ec0 ; wait_for_keypress &41e8 20 00 41 JSR &4100 ; write_error_message &41eb 81 ; RED &41ec 4e 6f 20 27 44 72 20 57 68 6f 27 20 52 4f 4d 20 ; "No 'Dr Who' ROM present" &41fc 70 72 65 73 65 6e 74 &4203 00 ; end of string ; infinite_loop &4204 4c 04 42 JMP &4204 ; infinite_loop ; attempt_r_dr_load # Probably attempt to load the ROM into sideways RAM &4207 ce c5 4e DEC &4ec5 ; r_dr_load_attempted # Set to zero to indicate load attempted &420a a9 30 LDA #&30 &420c 8d 18 fe STA &fe18 ; econet_station_id &420f a2 20 LDX #&20 ; &2b20 = load_r_dr_string &4211 a0 2b LDY #&2b &4213 20 f7 ff JSR &fff7 ; OSCLI # *LOAD R.DR &4216 a9 00 LDA #&00 &4218 8d 18 fe STA &fe18 ; econet_station_id &421b 4c b1 41 JMP &41b1 ; check_roms ; incoming_message &421e 20 c0 4e JSR &4ec0 ; wait_for_keypress &4221 20 c0 43 JSR &43c0 ; write_string &4224 1f 03 15 ; TAB(&03, &15) &4227 87 ; WHITE &4228 49 6e 63 6f 6d 69 6e 67 20 6d 65 73 73 61 67 65 ; "Incoming message" &4238 20 2d 20 72 65 63 65 69 76 65 20 28 59 2f 4e 29 ; " - receive (Y/N)" &4248 3f ; "?" &4249 00 ; end of string ; wait_for_y_or_n &424a a5 ec LDA &ec ; os_most_recently_pressed_key &424c c9 c4 CMP #&c4 ; "Y" &424e f0 07 BEQ &4257 ; display_incoming_message &4250 c9 d5 CMP #&d5 ; "N" &4252 d0 f6 BNE &424a ; wait_for_y_or_n &4254 4c 0e 43 JMP &430e ; to_loading_screen_after_removing_roms ; display_incoming_message &4257 a9 16 LDA #&16 # Change to MODE 6 &4259 20 ee ff JSR &ffee ; OSWRCH &425c a9 06 LDA #&06 &425e 20 ee ff JSR &ffee ; OSWRCH &4261 a2 0a LDX #&0a ; R10: Cursor start register &4263 a9 20 LDA #&20 # Disable cursor &4265 20 46 43 JSR &4346 ; set_video_register &4268 a9 13 LDA #&13 # Set colour 0 to blue &426a 20 ee ff JSR &ffee ; OSWRCH &426d a9 00 LDA #&00 &426f 20 ee ff JSR &ffee ; OSWRCH &4272 a9 04 LDA #&04 ; B &4274 20 ee ff JSR &ffee ; OSWRCH &4277 a9 00 LDA #&00 &4279 20 ee ff JSR &ffee ; OSWRCH &427c 20 ee ff JSR &ffee ; OSWRCH &427f 20 ee ff JSR &ffee ; OSWRCH &4282 a9 1f LDA #&1f # TAB(&01, &18) &4284 20 ee ff JSR &ffee ; OSWRCH &4287 a9 01 LDA #&01 &4289 20 ee ff JSR &ffee ; OSWRCH &428c a9 18 LDA #&18 &428e 20 ee ff JSR &ffee ; OSWRCH &4291 78 SEI &4292 a9 c5 LDA #&c5 ; &43c5 = message_event_handler &4294 8d 20 02 STA &0220 ; event_vector_low &4297 a9 43 LDA #&43 &4299 8d 21 02 STA &0221 ; event_vector_high &429c a9 0e LDA #&0e ; Enable event &429e a2 04 LDX #&04 ; v-sync event &42a0 20 f4 ff JSR &fff4 ; OSBYTE &42a3 58 CLI &42a4 a2 00 LDX #&00 &42a6 8a TXA ; wipe_character_states &42a7 9d 00 0a STA &0a00,X ; characters_state # Set to zero to indicate slot not used &42aa e8 INX &42ab d0 fa BNE &42a7 ; wipe_character_states &42ad a9 d8 LDA #&d8 ; &44d8 = message_data &42af 85 70 STA &70 ; message_address_low &42b1 a9 44 LDA #&44 &42b3 85 71 STA &71 ; message_address_high ; write_message_loop &42b5 a2 0a LDX #&0a ; R10: Cursor start register &42b7 a9 20 LDA #&20 # Disable cursor &42b9 20 46 43 JSR &4346 ; set_video_register &42bc a2 06 LDX #&06 ; R6: Vertical displayed register &42be a9 18 LDA #&18 &42c0 20 46 43 JSR &4346 ; set_video_register &42c3 a2 07 LDX #&07 ; R7: Vertical sync position &42c5 a9 1a LDA #&1a &42c7 20 46 43 JSR &4346 ; set_video_register &42ca a5 ec LDA &ec ; os_most_recently_pressed_key &42cc c9 f0 CMP #&f0 ; ESCAPE &42ce f0 2b BEQ &42fb ; end_of_message_without_delay &42d0 a0 00 LDY #&00 &42d2 b1 70 LDA (&70),Y ; message_address &42d4 c9 23 CMP #&23 ; "#" # &23 ("#") indicates end of message &42d6 f0 1e BEQ &42f6 ; end_of_message &42d8 c9 40 CMP #&40 ; "@" # &40 ("@") sets delay &42da d0 0f BNE &42eb ; not_delay &42dc e6 70 INC &70 ; message_address_low &42de d0 02 BNE &42e2 ; skip_page &42e0 e6 71 INC &71 ; message_address_high &42e2 b1 70 LDA (&70),Y ; message_address &42e4 38 SEC &42e5 e9 30 SBC #&30 ; "0" &42e7 0a ASL A &42e8 20 4d 43 JSR &434d ; delay ; not_delay &42eb 20 5e 43 JSR &435e ; write_message_character &42ee e6 70 INC &70 ; message_address_low &42f0 d0 c3 BNE &42b5 ; write_message_loop &42f2 e6 71 INC &71 ; message_address_high &42f4 d0 bf BNE &42b5 ; write_message_loop # Always branches ; end_of_message &42f6 a9 28 LDA #&28 &42f8 20 4d 43 JSR &434d ; delay ; end_of_message_without_delay &42fb 78 SEI &42fc a9 a6 LDA #&a6 ; &ffa6 = os_event_handler &42fe 8d 20 02 STA &0220 ; event_vector_low &4301 a9 ff LDA #&ff &4303 8d 21 02 STA &0221 ; event_vector_high &4306 a9 0d LDA #&0d ; Disable event &4308 a2 04 LDX #&04 ; v-sync event &430a 20 f4 ff JSR &fff4 ; OSBYTE &430d 58 CLI ; to_loading_screen_after_removing_roms &430e a9 00 LDA #&00 &4310 a0 0f LDY #&0f ; remove_roms_loop &4312 99 a1 02 STA &02a1,Y ; os_paged_rom_type_table # Remove paged ROMs from ROM information table &4315 88 DEY &4316 10 fa BPL &4312 ; remove_roms_loop &4318 a9 2a LDA #&2a ; &2a00 &431a a0 00 LDY #&00 &431c 84 70 STY &70 ; source_address_low &431e 85 71 STA &71 ; source_address_high &4320 84 72 STY &72 ; target_address_low &4322 a9 0a LDA #&0a ; &0a00 &4324 a2 01 LDX #&01 ; pages &4326 20 d0 4e JSR &4ed0 ; move_memory # Move &2a00 - &2aff to &0a00 - &0aff &4329 a9 12 LDA #&12 ; &1200 &432b a2 08 LDX #&08 ; pages &432d 20 d0 4e JSR &4ed0 ; move_memory # Move &2b00 - &32ff to &1200 - &19ff &4330 a9 20 LDA #&20 ; &2000 &4332 a2 0a LDX #&0a ; pages &4334 20 d0 4e JSR &4ed0 ; move_memory # Move &3300 - &3cff to &2000 - &29ff &4337 4c 32 12 JMP &1232 ; loading_screen ; unused &433a 00 00 00 00 00 00 00 00 00 00 00 00 ; set_video_register &4346 8e 00 fe STX &fe00 ; video register number &4349 8d 01 fe STA &fe01 ; video register value &434c 60 RTS ; delay &434d 85 72 STA &72 ; count ; delay_outer_loop &434f a2 fa LDX #&fa ; delay_middle_loop &4351 a0 00 LDY #&00 ; delay_inner_loop &4353 88 DEY &4354 d0 fd BNE &4353 ; delay_inner_loop &4356 ca DEX &4357 d0 f8 BNE &4351 ; delay_middle_loop &4359 c6 72 DEC &72 ; count &435b d0 f2 BNE &434f ; delay_outer_loop &435d 60 RTS ; write_message_character &435e c9 20 CMP #&20 ; " " &4360 90 4b BCC &43ad ; is_special_character &4362 48 PHA ; character &4363 a2 00 LDX #&00 ; find_free_slot_loop &4365 bd 00 0a LDA &0a00,X ; characters_state # Zero if no character in slot &4368 f0 03 BEQ &436d ; found_free_slot &436a e8 INX &436b d0 f8 BNE &4365 ; find_free_slot_loop ; found_free_slot &436d ad 4a 03 LDA &034a ; os_text_cursor_address_low &4370 9d 00 05 STA &0500,X ; characters_screen_address_low &4373 ad 4b 03 LDA &034b ; os_text_cursor_address_high &4376 10 03 BPL &437b ; skip_wraparound &4378 38 SEC &4379 e9 20 SBC #&20 ; skip_wraparound &437b 9d 00 06 STA &0600,X ; characters_screen_address_high &437e a9 00 LDA #&00 &4380 85 00 STA &00 ; font_address_high &4382 68 PLA ; character &4383 48 PHA ; character &4384 38 SEC &4385 e9 20 SBC #&20 ; " " &4387 0a ASL A &4388 26 00 ROL &00 ; font_address_high &438a 0a ASL A &438b 26 00 ROL &00 ; font_address_high &438d 0a ASL A &438e 26 00 ROL &00 ; font_address_high &4390 69 91 ADC #&91 ; &4b91 = message_font_data &4392 9d 00 07 STA &0700,X ; characters_font_address_low &4395 a5 00 LDA &00 ; font_address_high &4397 69 4b ADC #&4b &4399 9d 00 09 STA &0900,X ; characters_font_address_high &439c a9 04 LDA #&04 &439e 9d 00 0a STA &0a00,X ; characters_state &43a1 a9 0a LDA #&0a &43a3 9d 00 0c STA &0c00,X ; characters_cooldown &43a6 a9 09 LDA #&09 ; move right one character &43a8 20 ee ff JSR &ffee ; OSWRCH &43ab 68 PLA ; character &43ac 60 RTS ; is_special_character &43ad c9 0d CMP #&0d ; CR &43af d0 0c BNE &43bd ; not_carriage_return &43b1 48 PHA ; character &43b2 a9 03 LDA #&03 &43b4 20 4d 43 JSR &434d ; delay &43b7 68 PLA ; character &43b8 20 ee ff JSR &ffee ; OSWRCH &43bb a9 09 LDA #&09 ; move right one character ; not_carriage_return &43bd 4c ee ff JMP &ffee ; OSWRCH ; write_string &43c0 a9 01 LDA #&01 &43c2 4c 49 fa JMP &fa49 ; os_write_null_terminated_string ; message_event_handler &43c5 a2 00 LDX #&00 ; update_line_loop &43c7 bd 00 0a LDA &0a00,X ; characters_state &43ca f0 43 BEQ &440f ; consider_next_byte # Is this byte of the buffer fully displayed? &43cc de 00 0c DEC &0c00,X ; characters_cooldown &43cf d0 3e BNE &440f ; consider_next_byte # If not, is it time to update it? &43d1 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB &43d4 29 0f AND #&0f # Set random delay before next update &43d6 18 CLC &43d7 69 0d ADC #&0d &43d9 9d 00 0c STA &0c00,X ; characters_cooldown &43dc de 00 0a DEC &0a00,X ; characters_state &43df bd 00 05 LDA &0500,X ; characters_screen_address_low &43e2 85 40 STA &40 ; screen_address_low &43e4 bd 00 06 LDA &0600,X ; characters_screen_address_high &43e7 85 41 STA &41 ; screen_address_high &43e9 bd 00 07 LDA &0700,X ; characters_font_address_low &43ec 85 42 STA &42 ; font_address_low &43ee bd 00 09 LDA &0900,X ; characters_font_address_high &43f1 85 43 STA &43 ; font_address_high &43f3 bc 00 0a LDY &0a00,X ; characters_state &43f6 b9 17 44 LDA &4417,Y ; character_state_last_rows &43f9 85 44 STA &44 ; last_row &43fb b9 1b 44 LDA &441b,Y ; character_state_masks &43fe 85 45 STA &45 ; mask &4400 b9 13 44 LDA &4413,Y ; character_state_first_rows &4403 a8 TAY ; update_character_loop &4404 b1 42 LDA (&42),Y ; font_address &4406 25 45 AND &45 ; mask &4408 91 40 STA (&40),Y ; screen_address &440a c8 INY &440b c4 44 CPY &44 ; last_row &440d d0 f5 BNE &4404 ; update_character_loop ; consider_next_byte &440f e8 INX &4410 d0 b5 BNE &43c7 ; update_line_loop &4412 60 RTS ; character_state_first_rows &4413 00 01 02 03 ; character_state_last_rows &4417 08 07 06 05 ; character_state_masks &441b ff 7e 3c 18 ; unused &441f 41 6c 6c 20 63 6f 64 65 20 69 6e 20 74 68 69 73 ; "All code in this" &442f 20 67 61 6d 65 20 77 68 69 63 68 20 64 69 64 20 ; " game which did " &443f 6e 6f 74 20 6f 72 69 67 69 6e 61 74 65 20 66 72 ; "not originate fr" &444f 6f 6d 20 4d 69 63 72 6f 20 50 6f 77 65 72 20 4c ; "om Micro Power L" &445f 54 44 20 69 73 20 64 65 64 69 63 61 74 65 64 20 ; "TD is dedicated " &446f 74 6f 20 54 72 61 63 65 79 20 44 69 61 6e 6e 65 ; "to Tracey Dianne" &447f 20 4e 69 63 68 6f 6c 73 6f 6e 2e 2e 2e 20 28 43 ; " Nicholson... (C" &448f 29 20 4d 69 63 72 6f 20 50 6f 77 65 72 20 4c 54 ; ") Micro Power LT" &449f 44 20 61 6e 64 20 77 72 69 74 74 65 6e 20 62 79 ; "D and written by" &44af 20 47 61 72 79 20 50 61 72 74 69 73 20 2d 20 49 ; " Gary Partis - I" &44bf 4c 54 44 4e 20 74 68 65 20 4d 65 67 61 20 42 65 ; "LTDN the Mega Be" &44cf 69 6e 67 2e 2e 2e 2e 2e 20 4d 65 73 73 61 67 65 ; "ing..... " ; message_data &44d8 4d 65 73 73 61 67 65 20 20 20 66 72 6f 6d 20 20 ; "Message from the Time Lords on" &44e8 20 74 68 65 20 20 20 54 69 6d 65 20 20 4c 6f 72 &44f8 64 73 20 20 6f 6e 0a 0d &4500 47 61 6c 6c 69 66 72 65 79 20 20 66 6f 72 20 74 ; "Gallifrey for the immediate attention" &4510 68 65 20 69 6d 6d 65 64 69 61 74 65 20 61 74 74 &4520 65 6e 74 69 6f 6e 0a 0d &4528 6f 66 20 74 68 65 20 44 6f 63 74 6f 72 20 3a 0a ; "of the Doctor :" &4538 0d &4539 0a 0d &453b 40 35 0a 0d ; pause for 5 &453f 0a 0d &4541 4e 65 77 73 20 68 61 73 20 20 72 65 61 63 68 65 ; "News has reached us of a plan to" &4551 64 20 20 75 73 20 20 6f 66 20 20 61 20 20 70 6c &4561 61 6e 20 20 74 6f 0a 0d &4569 64 6f 6d 69 6e 61 74 65 20 20 74 68 65 20 20 55 ; "dominate the Universe using a Time" &4579 6e 69 76 65 72 73 65 20 20 75 73 69 6e 67 20 20 &4589 61 20 54 69 6d 65 0a 0d &4591 49 6e 73 74 61 6e 74 20 52 65 70 6c 61 79 20 55 ; "Instant Replay Unit (TIRU) being built" &45a1 6e 69 74 20 28 54 49 52 55 29 20 62 65 69 6e 67 &45b1 20 62 75 69 6c 74 0a 0d &45b9 6f 6e 20 74 68 65 20 32 6e 64 20 6d 6f 6f 6e 20 ; "on the 2nd moon of the planet Rijar." &45c9 6f 66 20 20 74 68 65 20 20 70 6c 61 6e 65 74 20 &45d9 52 69 6a 61 72 2e 0a 0d &45e1 41 6e 20 65 76 69 6c 20 66 6f 72 63 65 20 68 61 ; "An evil force has taken control of the" &45f1 73 20 74 61 6b 65 6e 20 63 6f 6e 74 72 6f 6c 20 &4601 6f 66 20 74 68 65 0a 0d &4609 6d 69 6e 69 6e 67 20 62 61 73 65 20 61 6e 64 20 ; "mining base and is refining the rare" &4619 69 73 20 72 65 66 69 6e 69 6e 67 20 20 74 68 65 &4629 20 20 72 61 72 65 0a 0d &4631 6d 69 6e 65 72 61 6c 20 20 27 48 65 61 74 6f 6e ; "mineral 'Heatonite'. Regain 'Memory" &4641 69 74 65 27 2e 20 20 52 65 67 61 69 6e 20 20 27 &4651 4d 65 6d 6f 72 79 0a 0d &4659 43 61 70 73 75 6c 65 27 20 20 20 20 63 6f 6e 74 ; "Capsule' containing TIRU plans." &4669 61 69 6e 69 6e 67 20 20 20 54 49 52 55 20 20 20 &4679 70 6c 61 6e 73 2e 0a 0d &4681 44 69 73 61 62 6c 65 20 20 54 49 52 55 2e 20 20 ; "Disable TIRU. This message has been" &4691 54 68 69 73 20 20 6d 65 73 73 61 67 65 20 68 61 &46a1 73 20 62 65 65 6e 0a 0d &46a9 70 6c 61 63 65 64 20 69 6e 20 4c 69 62 72 61 72 ; "placed in Library Computer memory." &46b9 79 20 43 6f 6d 70 75 74 65 72 20 6d 65 6d 6f 72 &46c9 79 2e 0a 0d &46cd 0a 0d &46cf 45 6e 64 20 6f 66 20 6d 65 73 73 61 67 65 2e 0a ; "End of message" &46df 0d &46e0 0a 0d &46e2 40 39 0a 0d ; pause for 9 &46e6 0a 0d &46e8 4d 6f 72 65 20 66 72 6f 6d 20 47 61 6c 6c 69 66 ; "More from Gallifrey :" &46f8 72 65 79 20 3a 0a 0d &46ff 0a 0d &4701 40 32 0a 0d ; pause for 2 &4705 0a 0d &4707 20 20 20 20 20 4c 61 74 65 73 74 20 20 20 20 69 ; " Latest intelligence suggests" &4717 6e 74 65 6c 6c 69 67 65 6e 63 65 20 20 20 73 75 &4727 67 67 65 73 74 73 0a 0d &472f 74 68 61 74 20 20 20 74 68 65 20 20 20 52 69 6a ; "that the Rijan moon complex is" &473f 61 6e 20 20 20 6d 6f 6f 6e 20 20 63 6f 6d 70 6c &474f 65 78 20 20 69 73 0a 0d &4757 69 6e 74 65 6e 64 65 64 20 20 74 6f 20 20 6c 75 ; "intended to lure the Doctor into the" &4767 72 65 20 74 68 65 20 44 6f 63 74 6f 72 20 69 6e &4777 74 6f 20 74 68 65 0a 0d &477f 4d 61 73 74 65 72 27 73 20 63 6c 75 74 63 68 65 ; "Master's clutches. Master is thought" &478f 73 2e 20 4d 61 73 74 65 72 20 20 69 73 20 20 74 &479f 68 6f 75 67 68 74 0a 0d &47a7 74 6f 20 62 65 20 70 6c 61 6e 6e 69 6e 67 20 74 ; "to be planning to incorporate Doctor's" &47b7 6f 20 69 6e 63 6f 72 70 6f 72 61 74 65 20 44 6f &47c7 63 74 6f 72 27 73 0a 0d &47cf 62 72 61 69 6e 20 20 61 73 20 20 61 20 63 6f 6d ; "brain as a component in the modified" &47df 70 6f 6e 65 6e 74 20 69 6e 20 74 68 65 20 6d 6f &47ef 64 69 66 69 65 64 0a 0d &47f7 54 49 52 55 2e 20 20 20 54 68 69 73 20 20 77 6f ; "TIRU. This would give effective" &4807 75 6c 64 20 20 20 67 69 76 65 20 20 20 65 66 66 &4817 65 63 74 69 76 65 0a 0d &481f 63 6f 6e 74 72 6f 6c 20 6f 66 20 74 68 65 20 20 ; "control of the future as well as the" &482f 66 75 74 75 72 65 20 20 61 73 20 77 65 6c 6c 20 &483f 61 73 20 74 68 65 0a 0d &4847 70 61 73 74 2e 20 20 50 65 72 68 61 70 73 20 20 ; "past. Perhaps capable of making the" &4857 63 61 70 61 62 6c 65 20 20 6f 66 20 6d 61 6b 69 &4867 6e 67 20 74 68 65 0a 0d &486f 4d 61 73 74 65 72 20 61 62 73 6f 6c 75 74 65 20 ; "Master absolute tyrant of the entire" &487f 74 79 72 61 6e 74 20 6f 66 20 20 74 68 65 20 20 &488f 65 6e 74 69 72 65 0a 0d &4897 43 6f 73 6d 6f 73 20 66 6f 72 20 61 6c 6c 20 74 ; "Cosmos for all time. Immortality would" &48a7 69 6d 65 2e 20 49 6d 6d 6f 72 74 61 6c 69 74 79 &48b7 20 77 6f 75 6c 64 0a 0d &48bf 67 75 61 72 61 6e 74 65 65 20 20 64 65 73 63 65 ; "guarantee descent into absolute evil." &48cf 6e 74 20 69 6e 74 6f 20 61 62 73 6f 6c 75 74 65 &48df 20 65 76 69 6c 2e 0a 0d &48e7 45 76 69 64 65 6e 63 65 20 69 73 20 67 72 6f 77 ; "Evidence is growing that the Master is" &48f7 69 6e 67 20 74 68 61 74 20 74 68 65 20 4d 61 73 &4907 74 65 72 20 69 73 0a 0d &490f 69 6e 20 67 72 69 70 20 20 6f 66 20 70 73 79 63 ; "in grip of psycho-paranoid fantasy of" &491f 68 6f 2d 70 61 72 61 6e 6f 69 64 20 66 61 6e 74 &492f 61 73 79 20 6f 66 0a 0d &4937 6c 69 76 69 6e 67 20 6f 75 74 20 65 61 72 6c 79 ; "living out early solar myth of 'The" &4947 20 20 73 6f 6c 61 72 20 20 6d 79 74 68 20 20 6f &4957 66 20 27 54 68 65 0a 0d &495f 44 65 76 69 6c 27 20 20 2d 20 20 74 68 65 20 20 ; "Devil' - the eternal, non-material" &496f 65 74 65 72 6e 61 6c 2c 20 20 6e 6f 6e 2d 6d 61 &497f 74 65 72 69 61 6c 0a 0d &4987 65 6d 62 6f 64 69 6d 65 6e 74 20 20 6f 66 20 20 ; "embodiment of chaos. It is Critical" &4997 63 68 61 6f 73 2e 20 20 49 74 20 69 73 20 43 72 &49a7 69 74 69 63 61 6c 0a 0d &49af 74 68 61 74 20 6d 61 78 69 6d 75 6d 20 76 69 67 ; "that maximum vigilance is exercised by" &49bf 69 6c 61 6e 63 65 20 69 73 20 65 78 65 72 63 69 &49cf 73 65 64 20 62 79 0a 0d &49d7 61 6c 6c 20 20 69 6e 76 6f 6c 76 65 64 2e 20 56 ; "all involved. Vital that TIRU plans" &49e7 69 74 61 6c 20 74 68 61 74 20 20 54 49 52 55 20 &49f7 20 70 6c 61 6e 73 0a 0d &49ff 61 72 65 20 20 72 65 67 61 69 6e 65 64 2e 20 20 ; "are regained. It is impossible to" &4a0f 49 74 20 20 69 73 20 20 69 6d 70 6f 73 73 69 62 &4a1f 6c 65 20 20 74 6f 0a 0d &4a27 73 74 72 65 73 73 20 74 6f 6f 20 66 75 6c 6c 79 ; "stress too fully the importance of the" &4a37 20 74 68 65 20 69 6d 70 6f 72 74 61 6e 63 65 20 &4a47 6f 66 20 74 68 65 0a 0d &4a4f 52 69 6a 61 6e 20 4d 69 73 73 69 6f 6e 2e 0a 0d ; "Rijan Mission." &4a5f 0a 0d &4a61 20 20 20 20 20 53 70 6c 69 6e 78 20 20 68 61 73 ; " Splinx has now an improved" &4a71 20 20 20 6e 6f 77 20 20 20 61 6e 20 20 20 69 6d &4a81 70 72 6f 76 65 64 0a 0d &4a89 70 72 6f 67 72 61 6d 6d 69 6e 67 20 6c 61 6e 67 ; "programming language known as CYBAL." &4a99 75 61 67 65 20 20 6b 6e 6f 77 6e 20 20 61 73 20 &4aa9 43 59 42 41 4c 2e 0a 0d &4ab1 54 6f 20 20 75 73 65 20 20 74 68 69 73 20 20 68 ; "To use this highly structured but" &4ac1 69 67 68 6c 79 20 20 73 74 72 75 63 74 75 72 65 &4ad1 64 20 20 62 75 74 0a 0d &4ad9 73 69 6d 70 6c 65 20 20 6c 61 6e 67 61 75 67 65 ; "simple langauge, use the 'Z' & 'X'" &4ae9 2c 20 75 73 65 20 74 68 65 20 20 27 5a 27 20 20 &4af9 26 20 20 27 58 27 0a 0d &4b01 6b 65 79 73 20 74 6f 20 20 63 68 61 6e 67 65 20 ; "keys to change the programming cell." &4b11 20 74 68 65 20 70 72 6f 67 72 61 6d 6d 69 6e 67 &4b21 20 63 65 6c 6c 2e 0a 0d &4b29 41 6e 64 20 27 2a 27 20 26 20 27 3f 27 20 20 74 ; "And '*' & '?' to select the required" &4b39 6f 20 20 73 65 6c 65 63 74 20 74 68 65 20 72 65 &4b49 71 75 69 72 65 64 0a 0d &4b51 69 6e 73 74 72 75 63 74 69 6f 6e 2e 20 20 54 6f ; "instruction. To enter an instruction" &4b61 20 20 65 6e 74 65 72 20 61 6e 20 69 6e 73 74 72 &4b71 75 63 74 69 6f 6e 0a 0d &4b79 70 72 65 73 73 20 27 52 45 54 55 52 4e 27 2e 20 ; "press 'RETURN'. " &4b89 20 20 0a 0d &4b8d 0a 0d &4b8f 0d &4b90 23 ; end of message ; message_font_data &4b91 00 00 00 00 00 00 00 00 ; " " &4b99 18 18 18 18 18 00 18 00 ; "!" &4ba1 6c 6c 6c 00 00 00 00 00 ; """ &4ba9 6c 6c fe 7c fe 6c 6c 00 ; "#" &4bb1 18 3e 58 3c 1a 7c 18 00 ; "$" &4bb9 00 c6 cc 18 30 66 c6 00 ; "%" &4bc1 38 6c 38 76 dc cc 76 00 ; "&" &4bc9 18 18 30 00 00 00 00 00 ; "'" &4bd1 0c 18 30 30 30 18 0c 00 ; "(" &4bd9 30 18 0c 0c 0c 18 30 00 ; ")" &4be1 00 66 3c ff 3c 66 00 00 ; "*" &4be9 00 18 18 7e 18 18 00 00 ; "+" &4bf1 00 00 00 00 00 18 18 30 ; "," &4bf9 00 00 00 7e 00 00 00 00 ; "-" &4c01 00 00 00 00 00 18 18 00 ; "." &4c09 06 0c 18 30 60 c0 80 00 ; "/" &4c11 7c c6 ce d6 e6 c6 7c 00 ; "0" &4c19 18 38 18 18 18 18 7e 00 ; "1" &4c21 3c 66 06 3c 60 66 7e 00 ; "2" &4c29 3c 46 06 1c 06 66 3c 00 ; "3" &4c31 18 38 58 98 fe 18 3c 00 ; "4" &4c39 7e 62 60 3c 06 66 3c 00 ; "5" &4c41 3c 66 60 7c 66 66 3c 00 ; "6" &4c49 7e 46 06 0c 18 18 18 00 ; "7" &4c51 3c 66 66 3c 66 66 3c 00 ; "8" &4c59 3c 66 66 3e 06 66 3c 00 ; "9" &4c61 00 00 18 18 00 18 18 00 ; ":" &4c69 00 00 18 18 00 18 18 30 ; ";" &4c71 0c 18 30 60 30 18 0c 00 ; "<" &4c79 00 00 7e 00 00 7e 00 00 ; "=" &4c81 60 30 18 0c 18 30 60 00 ; ">" &4c89 3c 66 06 0c 18 00 18 00 ; "?" &4c91 7c c6 de de de c0 7c 00 ; "@" &4c99 18 3c 66 66 7e 66 66 00 ; "A" &4ca1 fc 66 66 7c 66 66 fc 00 ; "B" &4ca9 3c 66 c0 c0 c0 66 3c 00 ; "C" &4cb1 f8 6c 66 66 66 6c f8 00 ; "D" &4cb9 fe 62 68 78 68 62 fe 00 ; "E" &4cc1 fe 62 68 78 68 60 f0 00 ; "F" &4cc9 3c 66 c0 c0 ce c6 7e 00 ; "G" &4cd1 66 66 66 7e 66 66 66 00 ; "H" &4cd9 7e 18 18 18 18 18 7e 00 ; "I" &4ce1 1e 0c 0c 0c cc cc 78 00 ; "J" &4ce9 e6 66 6c 78 6c 66 e6 00 ; "K" &4cf1 f0 60 60 60 62 66 7e 00 ; "L" &4cf9 c6 ee fe fe d6 c6 c6 00 ; "M" &4d01 c6 e6 f6 de ce c6 c6 00 ; "N" &4d09 38 6c c6 c6 c6 6c 38 00 ; "O" &4d11 fc 66 66 78 60 60 f0 00 ; "P" &4d19 38 6c c6 c6 da cc 76 00 ; "Q" &4d21 fc 66 66 7c 6c 66 e2 00 ; "R" &4d29 3c 66 60 3c 06 66 3c 00 ; "S" &4d31 7e 5a 18 18 18 18 3c 00 ; "T" &4d39 66 66 66 66 66 66 3c 00 ; "U" &4d41 66 66 66 66 66 3c 18 00 ; "V" &4d49 c6 c6 c6 d6 fe ee c6 00 ; "W" &4d51 c6 6c 38 38 6c c6 c6 00 ; "X" &4d59 66 66 66 3c 18 18 3c 00 ; "Y" &4d61 fe c6 8c 18 32 66 fe 00 ; "Z" &4d69 3c 30 30 30 30 30 3c 00 ; "[" &4d71 3c 42 bd a1 bd 42 3c 00 ; "\", actually (c) &4d79 3c 0c 0c 0c 0c 0c 3c 00 ; "]" &4d81 18 3c 7e 18 18 18 18 00 ; "^", actually up arrow &4d89 00 00 00 00 00 00 00 ff ; "_" &4d91 00 30 18 0c 00 00 00 00 ; "`" &4d99 00 00 78 0c 7c cc 76 00 ; "a" &4da1 e0 e0 7c 66 66 66 bc 00 ; "b" &4da9 00 00 3c 66 60 66 3c 00 ; "c" &4db1 1c 0c 7c cc cc cc 76 00 ; "d" &4db9 00 00 3c 66 7e 60 3c 00 ; "e" &4dc1 1c 36 30 78 30 30 78 00 ; "f" &4dc9 00 00 3e 66 66 3e 06 7c ; "g" &4dd1 e0 60 6c 76 66 66 e6 00 ; "h" &4dd9 18 00 38 18 18 18 3c 00 ; "i" &4de1 02 00 0e 06 06 66 66 3c ; "j" &4de9 e0 60 66 6c 78 6c e6 00 ; "k" &4df1 38 18 18 18 18 18 3c 00 ; "l" &4df9 00 00 6c fe d6 d6 c6 00 ; "m" &4e01 00 00 d8 66 66 66 66 00 ; "n" &4e09 00 00 3c 66 66 66 3c 00 ; "o" &4e11 00 00 dc 66 66 7c 60 f0 ; "p" &4e19 00 00 76 cc cc 7c 0c 1e ; "q" &4e21 00 00 d8 6c 60 60 f0 00 ; "r" &4e29 00 00 3c 60 3c 06 7c 00 ; "s" &4e31 30 30 7c 30 30 36 1c 00 ; "t" &4e39 00 00 66 66 66 66 3e 00 ; "u" &4e41 00 00 66 66 66 3c 18 00 ; "v" &4e49 00 00 c6 d6 d6 fe 6c 00 ; "w" &4e51 00 00 c6 6c 38 6c c6 00 ; "x" &4e59 00 00 66 66 66 3e 06 7c ; "y" &4e61 00 00 7e 4c 18 32 7e 00 ; "z" &4e69 0e 18 18 70 18 18 0e 00 ; "{" &4e71 18 18 18 18 18 18 18 00 ; "|" &4e79 70 18 18 0e 18 18 70 00 ; "}" &4e81 76 d8 00 00 00 00 00 00 ; "~" ; unused &4e89 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4e99 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4ea9 00 00 00 00 00 00 00 ; set_break_effect &4eb0 a9 c8 LDA #&c8 ; osbyte_with_zero_Y &4eb2 a0 00 LDY #&00 &4eb4 4c f4 ff JMP &fff4 ; OSBYTE ; unused &4eb7 00 00 00 00 00 00 00 00 00 ; wait_for_keypress &4ec0 a9 81 LDA #&81 &4ec2 a2 00 LDX #&00 &4ec4 a0 01 LDY #&01 # actually LDY r_dr_load_attempted &4ec6 4c f4 ff JMP &fff4 ; OSBYTE ; unused &4ec9 00 00 00 00 00 00 00 ; move_memory # Called with X = number of pages to move &4ed0 85 73 STA &73 ; target_address_high ; move_memory_loop &4ed2 b1 70 LDA (&70),Y ; source_address &4ed4 91 72 STA (&72),Y ; target_address &4ed6 c8 INY &4ed7 d0 f9 BNE &4ed2 ; move_memory_loop &4ed9 e6 71 INC &71 ; source_address_low &4edb e6 73 INC &73 ; target_address_high &4edd ca DEX &4ede d0 f2 BNE &4ed2 ; move_memory_loop &4ee0 60 RTS ; unused &4ee1 00 00 00 00 01 01 89 ; unused # Either time travel or a cracked version! &4ee8 28 43 29 20 31 39 38 39 42 45 45 42 53 4f 46 54 ; "(C) 1989BEEBSOFT" ; unused &4ef8 00 00 00 00 00 00 00 00 Game disassembly ================ ; $.Who4 ; FF1200 000000 003D00 # &1200 - &497f is moved to &0880 - &3fff at &4e1d ; play_game &0880 78 SEI &0881 ad 20 02 LDA &0220 ; event_vector_low &0884 8d c1 0e STA &0ec1 ; previous_event_vector_low &0887 a9 c4 LDA #&c4 ; &0ec4 = event_handler &0889 8d 20 02 STA &0220 ; event_vector_low &088c ad 21 02 LDA &0221 ; event_vector_high &088f 8d c2 0e STA &0ec2 ; previous_event_vector_high &0892 a9 0e LDA #&0e &0894 8d 21 02 STA &0221 ; event_vector_high &0897 a9 0e LDA #&0e ; Enable event &0899 a2 04 LDX #&04 ; v-sync event &089b 20 f4 ff JSR &fff4 ; OSBYTE &089e 20 a6 13 JSR &13a6 ; reset_security_code &08a1 58 CLI ; new_life &08a2 20 36 09 JSR &0936 ; restore_player_state &08a5 a9 00 LDA #&00 ; SPRITE_PLAYER &08a7 85 60 STA &60 ; allow_loading # Set to zero to allow loading &08a9 8d e9 07 STA &07e9 ; player_sprite &08ac 85 d0 STA &d0 ; os_vdu_status # Clear VDU status byte &08ae 85 40 STA &40 ; player_movement_flags # Set to zero to indicate not jumping or falling &08b0 85 16 STA &16 ; player_killed # Set to zero to indicate player not killed &08b2 85 90 STA &90 ; distance_fallen &08b4 85 13 STA &13 ; player_direction &08b6 85 8f STA &8f ; player_is_climbing # Set to zero to indicate player is not climbing &08b8 85 f5 STA &f5 ; suppress_player_input # Set to zero to permit player input &08ba 20 66 14 JSR &1466 ; reset_player_and_redraw_screen ; main_game_loop &08bd a5 ec LDA &ec ; os_most_recently_pressed_key &08bf c9 d6 CMP #&d6 ; L &08c1 d0 0a BNE &08cd ; skip_loading &08c3 a5 60 LDA &60 ; allow_loading # Non-zero if game has just been saved &08c5 d0 06 BNE &08cd ; skip_loading &08c7 20 42 15 JSR &1542 ; load_or_save_screen &08ca 4c a2 08 JMP &08a2 ; new_life ; skip_loading &08cd e6 43 INC &43 ; frame_counter &08cf 20 b2 17 JSR &17b2 ; update_player &08d2 20 bf 20 JSR &20bf ; update_objects &08d5 20 85 26 JSR &2685 ; update_movers &08d8 a9 01 LDA #&01 # Set to non-zero to indicate player is supported &08da 85 8e STA &8e ; player_is_supported # Unnecessary code &08dc 20 c3 22 JSR &22c3 ; update_thrown_object &08df a9 01 LDA #&01 # Set to non-zero to indicate player is supported &08e1 85 8e STA &8e ; player_is_supported # Unnecessary code &08e3 20 c3 22 JSR &22c3 ; update_thrown_object &08e6 20 a6 2e JSR &2ea6 ; update_detonator &08e9 20 02 0a JSR &0a02 ; consider_vertical_scrolling &08ec a5 16 LDA &16 ; player_killed &08ee f0 cd BEQ &08bd ; main_game_loop # Zero if player has not been killed, &08f0 10 06 BPL &08f8 ; is_dead # negative if game has been completed &08f2 20 87 2d JSR &2d87 ; consider_completion_screen &08f5 4c 23 09 JMP &0923 ; reset_event_vector ; is_dead &08f8 20 00 1d JSR &1d00 ; kill_player ; decrease_player_lives &08fb c6 15 DEC &15 ; player_lives # &08fb and &08fc are checked at entry point &08fd d0 a3 BNE &08a2 ; new_life &08ff 20 98 1c JSR &1c98 ; restore_default_windows &0902 20 82 09 JSR &0982 ; write_string &0905 1f 01 0e ; TAB(&01, &0e) &0908 08 ; move left one character &0909 72 65 63 61 6c 6c 20 74 6f 20 47 61 6c 6c 69 66 ; "recall to Gallifrey!" &0919 72 65 79 21 &091d 00 ; end of string &091e a9 0e LDA #&0e &0920 20 b9 1d JSR &1db9 ; delay_for_A ; reset_event_vector &0923 ad c1 0e LDA &0ec1 ; previous_event_vector_low &0926 8d 20 02 STA &0220 ; event_vector_low &0929 ad c2 0e LDA &0ec2 ; previous_event_vector_high &092c 8d 21 02 STA &0221 ; event_vector_high &092f a9 0d LDA #&0d ; Disable event &0931 a2 04 LDX #&04 ; v-sync event &0933 4c f4 ff JMP &fff4 ; OSBYTE ; restore_player_state &0936 a2 00 LDX #&00 ; restore_player_state_loop &0938 bd 00 01 LDA &0100,X ; saved_variables &093b f0 0c BEQ &0949 ; leave &093d 8d 44 09 STA &0944 ; variable_address &0940 bd 01 01 LDA &0101,X ; saved_variables + 1 &0943 85 00 STA &00 # actually STA variable_address &0945 e8 INX &0946 e8 INX &0947 d0 ef BNE &0938 ; restore_player_state_loop &0949 60 RTS ; wait_for_two_vsyncs &094a a9 13 LDA #&13 ; Wait for vertical retrace &094c 20 f4 ff JSR &fff4 ; OSBYTE ; wait_for_vsync &094f a9 13 LDA #&13 ; Wait for vertical retrace &0951 4c f4 ff JMP &fff4 ; OSBYTE ; delay_between_frames &0954 ea NOP # also RTS if player is on quick conveyor or lift &0955 a2 07 LDX #&07 # Wait for at most seven v-syncs &0957 ad 40 02 LDA &0240 ; os_cfs_timeout_counter &095a 85 00 STA &00 ; previous_timeout_counter ; delay_between_frames_loop &095c 58 CLI &095d 78 SEI &095e ad 40 02 LDA &0240 ; os_cfs_timeout_counter # Decreased once per v-sync &0961 c5 00 CMP &00 ; previous_timeout_counter &0963 f0 05 BEQ &096a ; skip_count &0965 85 00 STA &00 ; previous_timeout_counter &0967 ca DEX &0968 f0 05 BEQ &096f ; end_of_delay ; &096a cd 7a 09 CMP &097a ; timeout_counter_for_next_frame &096d d0 ed BNE &095c ; delay_between_frames_loop ; end_of_delay &096f ad 40 02 LDA &0240 ; os_cfs_timeout_counter &0972 38 SEC &0973 e9 06 SBC #&06 # Wait for six v-syncs between frames &0975 8d 7a 09 STA &097a ; timeout_counter_for_next_frame &0978 58 CLI &0979 60 RTS ; timeout_counter_for_next_frame &097a 00 ; set_video_register &097b 8e 00 fe STX &fe00 ; video register number &097e 8d 01 fe STA &fe01 ; video register value &0981 60 RTS ; write_string &0982 a9 01 LDA #&01 &0984 4c 49 fa JMP &fa49 ; os_write_null_terminated_string ; calculate_screen_and_tile_addresses &0987 a6 0f LDX &0f ; screen_left_x &0989 a4 0e LDY &0e ; screen_top_y &098b 20 e7 0c JSR &0ce7 ; calculate_tile_address # Returns tile address in XY &098e 86 2a STX &2a ; screen_top_left_tile_address_low &0990 84 2b STY &2b ; screen_top_left_tile_address_high &0992 a6 11 LDX &11 ; screen_right_x &0994 a4 0e LDY &0e ; screen_top_y &0996 20 e7 0c JSR &0ce7 ; calculate_tile_address # Returns tile address in XY &0999 86 2c STX &2c ; screen_top_right_tile_address_low &099b 84 2d STY &2d ; screen_top_right_tile_address_high &099d a6 0f LDX &0f ; screen_left_x &099f a5 0e LDA &0e ; screen_top_y &09a1 18 CLC &09a2 69 06 ADC #&06 # Screen is six tiles high &09a4 a8 TAY &09a5 20 e7 0c JSR &0ce7 ; calculate_tile_address # Returns tile address in XY &09a8 86 2e STX &2e ; screen_bottom_left_tile_address_low &09aa 84 2f STY &2f ; screen_bottom_left_tile_address_high &09ac a6 0a LDX &0a ; player_x &09ae a4 0b LDY &0b ; player_y &09b0 20 e7 0c JSR &0ce7 ; calculate_tile_address # Returns tile address in XY &09b3 86 30 STX &30 ; player_tile_address_low &09b5 84 31 STY &31 ; player_tile_address_high &09b7 a5 20 LDA &20 ; screen_start_address_low &09b9 85 00 STA &00 ; screen_address_low &09bb a5 21 LDA &21 ; screen_start_address_high &09bd 85 01 STA &01 ; screen_address_high &09bf a2 40 LDX #&40 ; &0040 &09c1 a0 00 LDY #&00 &09c3 a9 05 LDA #&05 # player_relative_x = 5 &09c5 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address # Add player_relative_x * &0040 &09c8 a2 00 LDX #&00 ; &0a00 = &280 * 4 &09ca a0 0a LDY #&0a &09cc a5 3a LDA &3a ; player_relative_y &09ce 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address # Add player_relative_y * &0280 * 4 &09d1 a2 80 LDX #&80 &09d3 a0 02 LDY #&02 &09d5 a5 0d LDA &0d ; player_relative_y_fraction &09d7 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address # Add player_relative_y_fraction * &280 &09da a5 00 LDA &00 ; screen_address_low &09dc 85 3e STA &3e ; player_screen_address_low &09de a5 01 LDA &01 ; screen_address_high &09e0 85 3f STA &3f ; player_screen_address_high &09e2 60 RTS ; add_A_times_XY_to_screen_address &09e3 85 02 STA &02 ; count ; add_A_times_XY_to_screen_address_loop &09e5 a5 02 LDA &02 ; count &09e7 f0 13 BEQ &09fc ; leave &09e9 8a TXA &09ea 18 CLC &09eb 65 00 ADC &00 ; screen_address_low &09ed 85 00 STA &00 ; screen_address_low &09ef 98 TYA &09f0 65 01 ADC &01 ; screen_address_high &09f2 29 7f AND #&7f # Keep address within screen memory &09f4 09 40 ORA #&40 &09f6 85 01 STA &01 ; screen_address_high &09f8 c6 02 DEC &02 ; count &09fa 10 e9 BPL &09e5 ; add_A_times_XY_to_screen_address_loop ; leave &09fc 60 RTS ; play_sound &09fd a9 07 LDA #&07 ; Generate a sound &09ff 4c f1 ff JMP &fff1 ; OSWORD ; consider_vertical_scrolling &0a02 a5 3a LDA &3a ; player_relative_y &0a04 a6 0d LDX &0d ; player_relative_y_fraction &0a06 e0 03 CPX #&03 &0a08 d0 04 BNE &0a0e ; not_bottom &0a0a c9 ff CMP #&ff # Is the player at the top &0a0c f0 05 BEQ &0a13 ; scroll_vertically ; not_bottom &0a0e c9 06 CMP #&06 # or the bottom of the screen? &0a10 f0 01 BEQ &0a13 ; scroll_vertically &0a12 60 RTS ; scroll_vertically &0a13 20 be 0f JSR &0fbe ; unplot_player &0a16 20 19 26 JSR &2619 ; calculate_screen_edges &0a19 ae e2 07 LDX &07e2 ; inventory + 5 (HAND) &0a1c f0 16 BEQ &0a34 ; not_carrying_object &0a1e a9 ff LDA #&ff &0a20 8d b1 1f STA &1fb1 ; suppressed_object_type # Allow all objects to be plotted or unplotted &0a23 ca DEX &0a24 20 21 22 JSR &2221 ; use_objects_X_position &0a27 20 50 20 JSR &2050 ; check_if_object_is_on_screen # Returns carry clear if object is on screen &0a2a b0 03 BCS &0a2f ; skip_unplotting_held_object &0a2c 20 9a 1f JSR &1f9a ; unplot_object skip_unplotting_held_object &0a2f a9 19 LDA #&19 ; OBJECT_TYPE_SPLINX &0a31 8d b1 1f STA &1fb1 ; suppressed_object_type # Prevent Splinx from being plotted or unplotted ; not_carrying_object &0a34 a5 42 LDA &42 ; unused # Unused variable &0a36 49 06 EOR #&06 &0a38 85 42 STA &42 ; unused &0a3a a9 00 LDA #&00 # Set to zero to indicate no obstacle to right &0a3c 85 51 STA &51 ; player_is_blocked_to_right # Unnecessary code &0a3e a5 3a LDA &3a ; player_relative_y &0a40 10 06 BPL &0a48 ; is_scrolling_down ; is_scrolling_up &0a42 20 e0 0b JSR &0be0 ; scroll_up &0a45 4c 4b 0a JMP &0a4b ; replot_after_scrolling ; is_scrolling_down &0a48 20 95 0b JSR &0b95 ; scroll_down ; replot_after_scrolling &0a4b 85 3a STA &3a ; player_relative_y &0a4d 86 0d STX &0d ; player_relative_y_fraction &0a4f 20 43 26 JSR &2643 ; plot_movers_and_objects &0a52 20 87 09 JSR &0987 ; calculate_screen_and_tile_addresses &0a55 4c c1 0f JMP &0fc1 ; plot_player ; splinx_status_screen &0a58 20 b3 14 JSR &14b3 ; reset_screen &0a5b 20 82 09 JSR &0982 ; write_string &0a5e 1f 01 0e ; TAB(&01, &0e) &0a61 11 01 ; COLOUR 1 &0a63 08 ; move left one character &0a64 53 70 6c 69 6e 78 20 6f ; "Splinx o" &0a6c 00 ; end of string &0a6d a9 6e LDA #&6e ; "n" &0a6f ae ed 06 LDX &06ed ; splinx_active # Non-zero if Splinx is active &0a72 d0 05 BNE &0a79 ; is_active &0a74 a9 66 LDA #&66 ; "f" &0a76 20 ee ff JSR &ffee ; OSWRCH # Write "off" ; is_active &0a79 20 ee ff JSR &ffee ; OSWRCH # or "on" &0a7c 20 82 09 JSR &0982 ; write_string &0a7f 20 50 6f 77 65 72 3a ; " Power:" &0a86 00 ; end of string &0a87 a9 00 LDA #&00 &0a89 a8 TAY ; number_high &0a8a ae f1 07 LDX &07f1 ; splinx_power &0a8d 20 3e 0d JSR &0d3e ; write_number # Write Splinx power &0a90 20 ca 1d JSR &1dca ; write_hit_spc_to_play &0a93 a9 00 LDA #&00 &0a95 85 99 STA &99 ; first_update # Set to zero to plot everything &0a97 85 85 STA &85 ; last_key_pressed ; splinx_status_screen_loop &0a99 20 98 1c JSR &1c98 ; restore_default_windows &0a9c a5 92 LDA &92 ; splinx_slot &0a9e 29 07 AND #&07 # Keep slot within range &0aa0 85 92 STA &92 ; splinx_slot &0aa2 a6 93 LDX &93 ; splinx_command &0aa4 10 02 BPL &0aa8 ; skip_underflow &0aa6 a2 09 LDX #&09 # Keep command within range ; skip_underflow &0aa8 e0 0a CPX #&0a &0aaa 90 02 BCC &0aae ; skip_overflow &0aac a2 00 LDX #&00 # Keep command within range ; skip_overflow &0aae 86 93 STX &93 ; splinx_command &0ab0 a0 00 LDY #&00 ; y &0ab2 a2 00 LDX #&00 ; command ; write_commands_loop # For each command, &0ab4 98 TYA &0ab5 48 PHA ; y &0ab6 a9 1f LDA #&1f ; TAB # TAB(&01 + &0a * (command DIV 5), (command % 5) * 2 + 1) &0ab8 20 ee ff JSR &ffee ; OSWRCH &0abb 8a TXA &0abc a0 01 LDY #&01 &0abe c9 05 CMP #&05 &0ac0 90 05 BCC &0ac7 ; not_right_side &0ac2 a0 0b LDY #&0b &0ac4 38 SEC &0ac5 e9 05 SBC #&05 ; not_right_side &0ac7 48 PHA ; y &0ac8 98 TYA &0ac9 20 ee ff JSR &ffee ; OSWRCH &0acc 68 PLA ; y &0acd 0a ASL A &0ace 18 CLC &0acf 69 01 ADC #&01 &0ad1 20 ee ff JSR &ffee ; OSWRCH &0ad4 68 PLA &0ad5 a8 TAY &0ad6 a9 04 LDA #&04 ; B &0ad8 e4 93 CPX &93 ; splinx_command &0ada d0 02 BNE &0ade ; not_active_command &0adc a9 03 LDA #&03 ; Y ; not_active_command &0ade 20 90 1f JSR &1f90 ; set_text_colour &0ae1 8a TXA ; command &0ae2 18 CLC &0ae3 69 40 ADC #&40 ; "@" &0ae5 20 ee ff JSR &ffee ; OSWRCH # Write character for command &0ae8 a9 20 LDA #&20 ; " " &0aea 20 ee ff JSR &ffee ; OSWRCH &0aed a5 99 LDA &99 ; first_update # Zero if plotting everything &0aef d0 18 BNE &0b09 ; skip_writing_command &0af1 a9 11 LDA #&11 ; define text colour &0af3 20 ee ff JSR &ffee ; OSWRCH &0af6 a9 02 LDA #&02 &0af8 20 ee ff JSR &ffee ; OSWRCH ; write_command_string_loop &0afb b9 75 07 LDA &0775,Y ; splinx_command_strings &0afe c8 INY &0aff c9 40 CMP #&40 ; "@" # &40 ("@") indicates end of string &0b01 f0 06 BEQ &0b09 ; end_of_command_string &0b03 20 ee ff JSR &ffee ; OSWRCH &0b06 4c fb 0a JMP &0afb ; write_command_string_loop ; end_of_command_string ; skip_writing_command &0b09 e8 INX &0b0a e0 0a CPX #&0a &0b0c d0 a6 BNE &0ab4 ; write_commands_loop &0b0e e6 99 INC &99 ; first_update # Set to non-zero to only plot command characters &0b10 a2 07 LDX #&07 ; slot ; plot_splinx_program_loop # For each slot, &0b12 8a TXA &0b13 48 PHA ; slot &0b14 a9 01 LDA #&01 ; R &0b16 e4 92 CPX &92 ; splinx_slot &0b18 d0 02 BNE &0b1c ; not_active_slot &0b1a a9 06 LDA #&06 ; C ; not_active_slot &0b1c 20 90 1f JSR &1f90 ; set_text_colour &0b1f a9 1f LDA #&1f ; TAB # TAB(2 + (slot * 2), &13) &0b21 20 ee ff JSR &ffee ; OSWRCH &0b24 8a TXA &0b25 0a ASL A &0b26 18 CLC &0b27 69 02 ADC #&02 &0b29 20 ee ff JSR &ffee ; OSWRCH &0b2c 85 33 STA &33 ; box_x &0b2e a9 13 LDA #&13 &0b30 20 ee ff JSR &ffee ; OSWRCH &0b33 bd cc 07 LDA &07cc,X ; splinx_program &0b36 f0 04 BEQ &0b3c ; use_space &0b38 69 40 ADC #&40 ; "@" &0b3a d0 02 BNE &0b3e ; write_character ; use_space &0b3c a9 20 LDA #&20 ; " " ; write_character &0b3e 20 ee ff JSR &ffee ; OSWRCH # Write command for slot &0b41 a9 01 LDA #&01 ; R &0b43 a0 12 LDY #&12 &0b45 a6 33 LDX &33 ; box_x &0b47 20 e4 1e JSR &1ee4 ; draw_box &0b4a 68 PLA ; slot &0b4b aa TAX &0b4c ca DEX &0b4d 10 c3 BPL &0b12 ; plot_splinx_program_loop &0b4f a5 92 LDA &92 ; splinx_slot &0b51 0a ASL A &0b52 18 CLC &0b53 69 02 ADC #&02 &0b55 aa TAX &0b56 a0 12 LDY #&12 &0b58 a9 06 LDA #&06 ; C &0b5a 20 e4 1e JSR &1ee4 ; draw_box # Draw cyan box for active slot ; get_key &0b5d 20 17 17 JSR &1717 ; check_keyboard &0b60 a5 84 LDA &84 ; player_movement_key &0b62 c5 85 CMP &85 ; last_key_pressed &0b64 f0 f7 BEQ &0b5d ; get_key &0b66 85 85 STA &85 ; last_key_pressed &0b68 c9 e1 CMP #&e1 ; Z &0b6a d0 02 BNE &0b6e ; not_left &0b6c c6 92 DEC &92 ; splinx_slot ; not_left &0b6e c9 c2 CMP #&c2 ; X &0b70 d0 02 BNE &0b74 ; not_right &0b72 e6 92 INC &92 ; splinx_slot ; not_right &0b74 c9 c8 CMP #&c8 ; ' &0b76 d0 02 BNE &0b7a ; not_up &0b78 c6 93 DEC &93 ; splinx_command ; not_up &0b7a c9 e8 CMP #&e8 ; / &0b7c d0 02 BNE &0b80 ; not_down &0b7e e6 93 INC &93 ; splinx_command ; not_down &0b80 c9 c9 CMP #&c9 ; ENTER &0b82 d0 07 BNE &0b8b ; not_enter &0b84 a5 93 LDA &93 ; splinx_command &0b86 a6 92 LDX &92 ; splinx_slot &0b88 9d cc 07 STA &07cc,X ; splinx_program ; not_enter &0b8b c9 e2 CMP #&e2 ; SPACE &0b8d f0 03 BEQ &0b92 ; to_reset_player_and_redraw_screen &0b8f 4c 99 0a JMP &0a99 ; splinx_status_screen ; to_reset_player_and_redraw_screen &0b92 4c 66 14 JMP &1466 ; reset_player_and_redraw_screen ; scroll_down &0b95 c6 0e DEC &0e ; screen_top_y &0b97 a2 00 LDX #&00 ; scroll_down_loop &0b99 8a TXA &0b9a 48 PHA ; count &0b9b 29 03 AND #&03 &0b9d d0 02 BNE &0ba1 ; not_next_tile &0b9f e6 0e INC &0e ; screen_top_y ; not_next_tile &0ba1 20 87 09 JSR &0987 ; calculate_screen_and_tile_addresses &0ba4 68 PLA ; count &0ba5 48 PHA ; count &0ba6 f0 11 BEQ &0bb9 ; skip_scrolling &0ba8 a2 50 LDX #&50 ; &0050 # &0050 = &0280 / 8 &0baa a0 00 LDY #&00 &0bac 20 10 0d JSR &0d10 ; add_XY_to_crtc_start_address &0baf 20 4f 09 JSR &094f ; wait_for_vsync &0bb2 a2 80 LDX #&80 ; &0280 # Scroll down one group &0bb4 a0 02 LDY #&02 &0bb6 20 9f 0c JSR &0c9f ; scroll_screen ; skip_scrolling &0bb9 a5 2e LDA &2e ; screen_bottom_left_tile_address_low &0bbb 85 00 STA &00 ; tile_address_low &0bbd a5 2f LDA &2f ; screen_bottom_left_tile_address_high &0bbf 85 01 STA &01 ; tile_address_high &0bc1 a5 28 LDA &28 ; screen_bottom_address_low &0bc3 85 02 STA &02 ; screen_address_low &0bc5 a5 29 LDA &29 ; screen_bottom_left_address_high &0bc7 85 03 STA &03 ; screen_address_high &0bc9 68 PLA ; count &0bca 48 PHA ; count &0bcb 29 03 AND #&03 &0bcd 0a ASL A &0bce 0a ASL A &0bcf 0a ASL A &0bd0 85 04 STA &04 ; tile_chunks_data_address_offset &0bd2 20 32 0c JSR &0c32 ; plot_row_of_tiles &0bd5 68 PLA ; count &0bd6 aa TAX &0bd7 e8 INX &0bd8 e0 19 CPX #&19 &0bda d0 bd BNE &0b99 ; scroll_down_loop &0bdc a9 00 LDA #&00 # Set player_relative_y to 0 &0bde aa TAX # Set player_relative_y_fraction to 0 &0bdf 60 RTS ; scroll_up &0be0 a5 0e LDA &0e ; screen_top_y &0be2 d0 01 BNE &0be5 ; not_top_of_world &0be4 60 RTS ; not_top_of_world &0be5 a2 19 LDX #&19 ; scroll_up_loop &0be7 8a TXA &0be8 48 PHA ; count &0be9 29 03 AND #&03 &0beb d0 02 BNE &0bef ; not_next_tile &0bed c6 0e DEC &0e ; screen_top_y ; not_next_tile &0bef 20 87 09 JSR &0987 ; calculate_screen_and_tile_addresses &0bf2 68 PLA ; count &0bf3 48 PHA ; count &0bf4 c9 19 CMP #&19 &0bf6 f0 11 BEQ &0c09 ; skip_scrolling &0bf8 a2 b0 LDX #&b0 ; &ffb0 # &ffb0 = &fd80 / 8 &0bfa a0 ff LDY #&ff &0bfc 20 10 0d JSR &0d10 ; add_XY_to_crtc_start_address &0bff 20 4f 09 JSR &094f ; wait_for_vsync &0c02 a2 80 LDX #&80 ; &fd80 # Scroll up one group &0c04 a0 fd LDY #&fd &0c06 20 9f 0c JSR &0c9f ; scroll_screen ; skip_scrolling &0c09 a5 2a LDA &2a ; screen_top_left_tile_address_low &0c0b 85 00 STA &00 ; tile_address_low &0c0d a5 2b LDA &2b ; screen_top_left_tile_address_high &0c0f 85 01 STA &01 ; tile_address_high &0c11 a5 20 LDA &20 ; screen_start_address_low &0c13 85 02 STA &02 ; screen_address_low &0c15 a5 21 LDA &21 ; screen_start_address_high &0c17 85 03 STA &03 ; screen_address_high &0c19 68 PLA ; count &0c1a 48 PHA ; count &0c1b 38 SEC &0c1c e9 01 SBC #&01 &0c1e 29 03 AND #&03 &0c20 0a ASL A &0c21 0a ASL A &0c22 0a ASL A &0c23 85 04 STA &04 ; tile_chunks_data_address_offset &0c25 20 32 0c JSR &0c32 ; plot_row_of_tiles &0c28 68 PLA ; count &0c29 aa TAX &0c2a ca DEX &0c2b d0 ba BNE &0be7 ; scroll_up_loop &0c2d a9 05 LDA #&05 # Set player_relative_y to 5 &0c2f a2 03 LDX #&03 # Set player_relative_y_fraction to 3 &0c31 60 RTS ; plot_row_of_tiles &0c32 a5 10 LDA &10 ; screen_x_fraction &0c34 85 38 STA &38 ; tile_x_fraction &0c36 a9 02 LDA #&02 &0c38 85 39 STA &39 ; column &0c3a a2 0b LDX #&0b ; plot_row_of_tiles_tile_loop &0c3c 8a TXA &0c3d 48 PHA ; tiles_remaining &0c3e 20 12 0e JSR &0e12 ; calculate_tile_chunks_data_address &0c41 a5 32 LDA &32 ; tile_chunks_data_address_low &0c43 18 CLC &0c44 65 04 ADC &04 ; tile_chunks_data_address_offset &0c46 85 32 STA &32 ; tile_chunks_data_address_low &0c48 a5 33 LDA &33 ; tile_chunks_data_address_high &0c4a 69 00 ADC #&00 &0c4c 85 33 STA &33 ; tile_chunks_data_address_high &0c4e a6 38 LDX &38 ; tile_x_fraction ; plot_row_of_tiles_chunk_loop &0c50 8a TXA &0c51 48 PHA ; tile_x_fraction &0c52 a8 TAY &0c53 20 75 0e JSR &0e75 ; calculate_chunk_address &0c56 a5 39 LDA &39 ; column &0c58 c9 52 CMP #&52 &0c5a b0 09 BCS &0c65 ; skip_plotting_column &0c5c a0 07 LDY #&07 ; plot_row_of_tiles_byte_loop &0c5e b1 35 LDA (&35),Y ; chunk_address &0c60 91 02 STA (&02),Y ; screen_address &0c62 88 DEY &0c63 10 f9 BPL &0c5e ; plot_row_of_tiles_byte_loop ; skip_plotting_column &0c65 a5 02 LDA &02 ; screen_address_low &0c67 18 CLC &0c68 69 08 ADC #&08 # Move right two pixels &0c6a 85 02 STA &02 ; screen_address_low &0c6c a5 03 LDA &03 ; screen_address_high &0c6e 69 00 ADC #&00 &0c70 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &0c73 85 03 STA &03 ; screen_address_high &0c75 e6 39 INC &39 ; column &0c77 68 PLA ; tile_x_fraction &0c78 aa TAX &0c79 e8 INX &0c7a e0 08 CPX #&08 &0c7c d0 d2 BNE &0c50 ; plot_row_of_tiles_chunk_loop &0c7e a9 00 LDA #&00 &0c80 85 38 STA &38 ; tile_x_fraction &0c82 e6 00 INC &00 ; tile_address_low &0c84 d0 02 BNE &0c88 ; skip_page &0c86 e6 01 INC &01 ; tile_address_high ; skip_page &0c88 68 PLA ; tiles_remaining &0c89 aa TAX &0c8a ca DEX &0c8b d0 af BNE &0c3c ; plot_row_of_tiles_tile_loop &0c8d 60 RTS ; scale_coordinates # Multiply coordinates by 2 ** Y &0c8e c0 00 CPY #&00 &0c90 f0 07 BEQ &0c99 ; leave &0c92 16 00 ASL &00,X ; coordinates &0c94 36 01 ROL &01,X ; coordinates + 1 &0c96 88 DEY &0c97 10 f5 BPL &0c8e ; scale_coordinates ; leave &0c99 60 RTS ; keep_screen_address_within_screen &0c9a 29 7f AND #&7f &0c9c 09 40 ORA #&40 &0c9e 60 RTS ; scroll_screen # Called with XY = offset to scroll &0c9f 8a TXA &0ca0 18 CLC &0ca1 65 20 ADC &20 ; screen_start_address_low &0ca3 85 20 STA &20 ; screen_start_address_low &0ca5 85 28 STA &28 ; screen_bottom_address_low &0ca7 98 TYA &0ca8 65 21 ADC &21 ; screen_start_address_high &0caa 29 7f AND #&7f # Keep address within screen memory &0cac 09 40 ORA #&40 &0cae 85 21 STA &21 ; screen_start_address_high &0cb0 a5 23 LDA &23 ; crtc_start_address_high &0cb2 29 0f AND #&0f # Keep address within screen memory &0cb4 09 08 ORA #&08 &0cb6 85 23 STA &23 ; crtc_start_address_high &0cb8 a5 21 LDA &21 ; screen_start_address_high &0cba 18 CLC &0cbb 69 3c ADC #&3c ; &3c00 = &280 * 18 # Calculate address of bottom left of screen &0cbd 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &0cc0 85 29 STA &29 ; screen_bottom_left_address_high &0cc2 a5 20 LDA &20 ; screen_start_address_low &0cc4 18 CLC &0cc5 69 78 ADC #&78 ; &0278 # Calculate address of top right of screen &0cc7 85 26 STA &26 ; screen_top_right_screen_low &0cc9 a5 21 LDA &21 ; screen_start_address_high &0ccb 69 02 ADC #&02 &0ccd 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &0cd0 85 27 STA &27 ; screen_top_right_screen_high &0cd2 a9 0c LDA #&0c ; R12: Displayed screen start address register (high) &0cd4 8d 00 fe STA &fe00 ; video register number &0cd7 a5 23 LDA &23 ; crtc_start_address_high &0cd9 8d 01 fe STA &fe01 ; video register value &0cdc a9 0d LDA #&0d ; R13: Displayed screen start address register (low) &0cde 8d 00 fe STA &fe00 ; video register number &0ce1 a5 22 LDA &22 ; crtc_start_address_low &0ce3 8d 01 fe STA &fe01 ; video register value &0ce6 60 RTS ; calculate_tile_address # Called with X = x, Y = y &0ce7 a9 00 LDA #&00 &0ce9 85 00 STA &00 ; tile_address_low &0ceb a9 a5 LDA #&a5 ; &a500 = map_data &0ced 85 01 STA &01 ; tile_address_high ; calculate_tile_address_row_loop &0cef 88 DEY &0cf0 30 05 BMI &0cf7 ; calculate_tile_address_row_loop &0cf2 20 02 0d JSR &0d02 ; move_down_a_row_of_tiles # &a500 + y * 128 + x &0cf5 d0 f8 BNE &0cef ; calculate_tile_address_row_loop &0cf7 8a TXA &0cf8 18 CLC &0cf9 65 00 ADC &00 ; tile_address_low &0cfb aa TAX &0cfc a5 01 LDA &01 ; tile_address_high &0cfe 69 00 ADC #&00 &0d00 a8 TAY &0d01 60 RTS # Leaves with tile address in XY ; move_down_a_row_of_tiles &0d02 a5 00 LDA &00 ; tile_address_low &0d04 18 CLC &0d05 69 80 ADC #&80 &0d07 85 00 STA &00 ; tile_address_low &0d09 a5 01 LDA &01 ; tile_address_high &0d0b 69 00 ADC #&00 &0d0d 85 01 STA &01 ; tile_address_high &0d0f 60 RTS ; add_XY_to_crtc_start_address &0d10 8a TXA &0d11 18 CLC &0d12 65 22 ADC &22 ; crtc_start_address_low &0d14 85 22 STA &22 ; crtc_start_address_low &0d16 98 TYA &0d17 65 23 ADC &23 ; crtc_start_address_high &0d19 85 23 STA &23 ; crtc_start_address_high &0d1b 60 RTS ; add_XY_to_screen_tile_addresses &0d1c 8a TXA &0d1d 18 CLC &0d1e 65 2a ADC &2a ; screen_top_left_tile_address_low &0d20 85 2a STA &2a ; screen_top_left_tile_address_low &0d22 98 TYA &0d23 65 2b ADC &2b ; screen_top_left_tile_address_high &0d25 85 2b STA &2b ; screen_top_left_tile_address_high &0d27 8a TXA &0d28 18 CLC &0d29 65 2c ADC &2c ; screen_top_right_tile_address_low &0d2b 85 2c STA &2c ; screen_top_right_tile_address_low &0d2d 98 TYA &0d2e 65 2d ADC &2d ; screen_top_right_tile_address_high &0d30 85 2d STA &2d ; screen_top_right_tile_address_high &0d32 8a TXA &0d33 18 CLC &0d34 65 2e ADC &2e ; screen_bottom_left_tile_address_low &0d36 85 2e STA &2e ; screen_bottom_left_tile_address_low &0d38 98 TYA &0d39 65 2f ADC &2f ; screen_bottom_left_tile_address_high &0d3b 85 2f STA &2f ; screen_bottom_left_tile_address_high &0d3d 60 RTS ; write_number &0d3e 86 00 STX &00 ; number_low &0d40 84 01 STY &01 ; number_high &0d42 a0 00 LDY #&00 ; convert_number_to_digits_digit_loop &0d44 a2 10 LDX #&10 &0d46 a9 00 LDA #&00 ; convert_number_to_digits_count_loop &0d48 06 00 ASL &00 ; number_low &0d4a 26 01 ROL &01 ; number_high &0d4c 2a ROL A &0d4d c9 0a CMP #&0a &0d4f 90 04 BCC &0d55 ; skip_overflow &0d51 e9 0a SBC #&0a &0d53 e6 00 INC &00 ; number_low ; skip_overflow &0d55 ca DEX &0d56 d0 f0 BNE &0d48 ; convert_number_to_digits_count_loop &0d58 48 PHA ; digit &0d59 c8 INY &0d5a a5 01 LDA &01 ; number_high &0d5c 05 00 ORA &00 ; number_low &0d5e d0 e4 BNE &0d44 ; convert_number_to_digits_digit_loop ; write_digits_loop &0d60 68 PLA ; digit &0d61 18 CLC &0d62 69 30 ADC #&30 ; "0" &0d64 20 ee ff JSR &ffee ; OSWRCH &0d67 88 DEY &0d68 d0 f6 BNE &0d60 ; write_digits_loop &0d6a 60 RTS ; scroll_right &0d6b a2 01 LDX #&01 ; &0001 &0d6d 86 3b STX &3b ; scrolling_direction &0d6f a0 00 LDY #&00 &0d71 20 10 0d JSR &0d10 ; add_XY_to_crtc_start_address # Scroll right two pixels &0d74 a2 08 LDX #&08 ; &0008 # Scroll right two pixels &0d76 a0 00 LDY #&00 &0d78 20 9f 0c JSR &0c9f ; scroll_screen &0d7b a5 2c LDA &2c ; screen_top_right_tile_address_low &0d7d 85 00 STA &00 ; tile_address_low &0d7f a5 2d LDA &2d ; screen_top_right_tile_address_high &0d81 85 01 STA &01 ; tile_address_high &0d83 a5 26 LDA &26 ; screen_top_right_screen_low &0d85 85 02 STA &02 ; screen_address_low &0d87 a5 27 LDA &27 ; screen_top_right_screen_high &0d89 85 03 STA &03 ; screen_address_high &0d8b a6 10 LDX &10 ; screen_x_fraction &0d8d 86 04 STX &04 ; x_fraction &0d8f 20 fd 0d JSR &0dfd ; plot_column_of_screen &0d92 e6 10 INC &10 ; screen_x_fraction &0d94 a5 10 LDA &10 ; screen_x_fraction &0d96 c9 08 CMP #&08 &0d98 d0 0f BNE &0da9 ; not_next_tile_right &0d9a a9 00 LDA #&00 &0d9c 85 10 STA &10 ; screen_x_fraction &0d9e e6 0f INC &0f ; screen_left_x &0da0 e6 11 INC &11 ; screen_right_x &0da2 a2 01 LDX #&01 &0da4 a0 00 LDY #&00 &0da6 20 1c 0d JSR &0d1c ; add_XY_to_screen_tile_addresses ; not_next_tile_right &0da9 a9 ff LDA #&ff # Unnecessary code &0dab 60 RTS ; scroll_left &0dac a2 ff LDX #&ff ; &ffff &0dae 86 3b STX &3b ; scrolling_direction &0db0 a0 ff LDY #&ff &0db2 20 10 0d JSR &0d10 ; add_XY_to_crtc_start_address # Scroll left two pixels &0db5 a2 f8 LDX #&f8 ; &fff8 # Scroll left two pixels &0db7 a0 ff LDY #&ff &0db9 20 9f 0c JSR &0c9f ; scroll_screen &0dbc a5 2a LDA &2a ; screen_top_left_tile_address_low &0dbe 85 00 STA &00 ; tile_address_low &0dc0 a5 2b LDA &2b ; screen_top_left_tile_address_high &0dc2 85 01 STA &01 ; tile_address_high &0dc4 a5 20 LDA &20 ; screen_start_address_low &0dc6 85 02 STA &02 ; screen_address_low &0dc8 a5 21 LDA &21 ; screen_start_address_high &0dca 85 03 STA &03 ; screen_address_high &0dcc a6 10 LDX &10 ; screen_x_fraction &0dce ca DEX &0dcf 10 0f BPL &0de0 ; not_next_tile_left &0dd1 a5 00 LDA &00 ; tile_address_low &0dd3 38 SEC &0dd4 e9 01 SBC #&01 &0dd6 85 00 STA &00 ; tile_address_low &0dd8 a5 01 LDA &01 ; tile_address_high &0dda e9 00 SBC #&00 &0ddc 85 01 STA &01 ; tile_address_high &0dde a2 07 LDX #&07 ; not_next_tile_left &0de0 86 04 STX &04 ; x_fraction &0de2 20 fd 0d JSR &0dfd ; plot_column_of_screen &0de5 c6 10 DEC &10 ; screen_x_fraction &0de7 a5 10 LDA &10 ; screen_x_fraction &0de9 10 0f BPL &0dfa ; not_next_tile_left_two &0deb a9 07 LDA #&07 &0ded 85 10 STA &10 ; screen_x_fraction &0def c6 0f DEC &0f ; screen_left_x &0df1 c6 11 DEC &11 ; screen_right_x &0df3 a2 ff LDX #&ff &0df5 a0 ff LDY #&ff &0df7 20 1c 0d JSR &0d1c ; add_XY_to_screen_tile_addresses ; not_next_tile_left_two &0dfa a9 00 LDA #&00 # Unnecessary code &0dfc 60 RTS ; plot_column_of_screen &0dfd a9 06 LDA #&06 &0dff 85 50 STA &50 ; tiles_to_plot ; plot_column_of_screen_loop &0e01 a0 04 LDY #&04 # Plot four groups of top six tiles &0e03 20 89 0e JSR &0e89 ; plot_column_of_tile &0e06 20 02 0d JSR &0d02 ; move_down_a_row_of_tiles &0e09 c6 50 DEC &50 ; tiles_to_plot &0e0b d0 f4 BNE &0e01 ; plot_column_of_screen_loop &0e0d a0 01 LDY #&01 # Plot single group of bottom tile &0e0f 4c 89 0e JMP &0e89 ; plot_column_of_tile ; calculate_tile_chunks_data_address &0e12 a0 00 LDY #&00 &0e14 a5 01 LDA &01 ; tile_address_high &0e16 c9 c0 CMP #&c0 ; &c000 = map_data + &36 * 128 # Is the tile below the bottom of the map? &0e18 90 04 BCC &0e1e ; not_below_map &0e1a a9 da LDA #&da ; TILE_HEATONITE # If so, use Heatonite &0e1c d0 2a BNE &0e48 ; use_tile # Always branches ; not_below_map &0e1e c9 bc CMP #&bc ; &bc1c = map_data + &2e * 128 + &1c # Is this (&1c, &2e) (the TARDIS in the mine workings)? &0e20 d0 0f BNE &0e31 ; not_tardis_in_mine &0e22 a5 00 LDA &00 ; tile_address_low &0e24 c9 1c CMP #&1c &0e26 d0 09 BNE &0e31 ; not_tardis_in_mine &0e28 ad ea 07 LDA &07ea ; tardis_location # Zero if TARDIS is in mine workings &0e2b f0 04 BEQ &0e31 ; not_tardis_in_mine &0e2d a9 1b LDA #&1b ; TILE_BLACK_BACKGROUND # Remove TARDIS &0e2f d0 17 BNE &0e48 ; use_tile # Always branches ; not_tardis_in_mine &0e31 a5 01 LDA &01 ; tile_address_high &0e33 c9 b2 CMP #&b2 ; &b2f5 = map_data + &1b * 128 + &75 # Is this (&75, &1b) (the TARDIS in the unmapped area)? &0e35 d0 0f BNE &0e46 ; use_map &0e37 a5 00 LDA &00 ; tile_address_low &0e39 c9 f5 CMP #&f5 &0e3b d0 09 BNE &0e46 ; use_map &0e3d ad ea 07 LDA &07ea ; tardis_location # Non-zero if TARDIS is in unmapped area &0e40 d0 04 BNE &0e46 ; use_map &0e42 a9 1c LDA #&1c ; TILE_BLUE_BACKGROUND # Remove TARDIS &0e44 d0 02 BNE &0e48 ; use_tile # Always branches ; use_map &0e46 b1 00 LDA (&00),Y ; tile_address ; use_tile ; calculate_tile_chunks_data_address_for_tile_A &0e48 c5 5e CMP &5e ; last_tile_plotted &0e4a 85 5e STA &5e ; last_tile_plotted &0e4c f0 1e BEQ &0e6c ; use_cached_value &0e4e 84 33 STY &33 ; tile_chunks_data_address_high # &8100 + tile * 32 &0e50 0a ASL A &0e51 26 33 ROL &33 ; tile_chunks_data_address_high &0e53 0a ASL A &0e54 26 33 ROL &33 ; tile_chunks_data_address_high &0e56 0a ASL A &0e57 26 33 ROL &33 ; tile_chunks_data_address_high &0e59 0a ASL A &0e5a 26 33 ROL &33 ; tile_chunks_data_address_high &0e5c 0a ASL A &0e5d 26 33 ROL &33 ; tile_chunks_data_address_high &0e5f 85 32 STA &32 ; tile_chunks_data_address_low &0e61 85 80 STA &80 ; cached_tile_chunks_data_address_low &0e63 a5 33 LDA &33 ; tile_chunks_data_address_high &0e65 69 81 ADC #&81 ; &8100 = tile_chunks &0e67 85 33 STA &33 ; tile_chunks_data_address_high &0e69 85 81 STA &81 ; cached_tile_chunks_data_address_high &0e6b 60 RTS ; use_cached_value &0e6c a5 80 LDA &80 ; cached_tile_chunks_data_address_low &0e6e 85 32 STA &32 ; tile_chunks_data_address_low &0e70 a5 81 LDA &81 ; cached_tile_chunks_data_address_high &0e72 85 33 STA &33 ; tile_chunks_data_address_high &0e74 60 RTS ; calculate_chunk_address &0e75 b1 32 LDA (&32),Y ; tile_chunks_data_address &0e77 85 35 STA &35 ; chunk_address_low &0e79 a9 00 LDA #&00 &0e7b 06 35 ASL &35 ; chunk_address_low # &9d00 + chunk * 8 &0e7d 2a ROL A &0e7e 06 35 ASL &35 ; chunk_address_low &0e80 2a ROL A &0e81 06 35 ASL &35 ; chunk_address_low &0e83 2a ROL A &0e84 69 9d ADC #&9d ; &9d00 = chunk_data &0e86 85 36 STA &36 ; chunk_address_high &0e88 60 RTS ; plot_column_of_tile # Called with Y = groups to plot &0e89 84 05 STY &05 ; groups_to_plot &0e8b a5 04 LDA &04 ; x_fraction &0e8d 85 34 STA &34 ; chunk_offset &0e8f 20 12 0e JSR &0e12 ; calculate_tile_chunks_data_address ; plot_column_of_tile_group_loop &0e92 84 18 STY &18 ; group &0e94 a4 34 LDY &34 ; chunk_offset &0e96 20 75 0e JSR &0e75 ; calculate_chunk_address &0e99 a0 07 LDY #&07 ; plot_column_of_tile_byte_loop &0e9b b1 35 LDA (&35),Y ; chunk_address &0e9d 91 02 STA (&02),Y ; screen_address &0e9f 88 DEY &0ea0 10 f9 BPL &0e9b ; plot_column_of_tile_byte_loop &0ea2 a5 02 LDA &02 ; screen_address_low &0ea4 18 CLC &0ea5 69 80 ADC #&80 # Move down one group &0ea7 85 02 STA &02 ; screen_address_low &0ea9 a5 03 LDA &03 ; screen_address_high &0eab 69 02 ADC #&02 &0ead 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &0eb0 85 03 STA &03 ; screen_address_high &0eb2 a5 34 LDA &34 ; chunk_offset &0eb4 18 CLC &0eb5 69 08 ADC #&08 # Move down one chunk &0eb7 85 34 STA &34 ; chunk_offset &0eb9 a4 18 LDY &18 ; group &0ebb c8 INY &0ebc c4 05 CPY &05 ; groups_to_plot &0ebe d0 d2 BNE &0e92 ; plot_column_of_tile_group_loop ; leave &0ec0 60 RTS ; previous_event_vector_low &0ec1 00 ; previous_event_vector_high &0ec2 00 ; palette_change_cooldown &0ec3 01 ; event_handler &0ec4 ad LDA &3596 ; suppress_events &0ec7 d0 f7 BNE &0ec0 ; leave &0ec9 ce c3 0e DEC &0ec3 ; palette_change_cooldown &0ecc d0 66 BNE &0f34 ; skip_changing_palette &0ece a9 05 LDA #&05 &0ed0 8d c3 0e STA &0ec3 ; palette_change_cooldown &0ed3 ad bc 07 LDA &07bc ; changing_palette_values # Animate TARDIS light &0ed6 85 b2 STA &b2 ; tmp &0ed8 ad bd 07 LDA &07bd ; changing_palette_values + 1 &0edb 8d bc 07 STA &07bc ; changing_palette_values &0ede ad be 07 LDA &07be ; changing_palette_values + 2 &0ee1 8d bd 07 STA &07bd ; changing_palette_values + 1 &0ee4 a5 b2 LDA &b2 ; tmp &0ee6 8d be 07 STA &07be ; changing_palette_values + 2 &0ee9 ad ec 07 LDA &07ec ; factory_stopped # Non-zero if factory has been stopped &0eec d0 16 BNE &0f04 ; skip_animating_factory_conveyor_belt &0eee ad bf 07 LDA &07bf ; changing_palette_values + 3 # If not, animate factory conveyor belt &0ef1 85 b2 STA &b2 ; tmp &0ef3 ad c0 07 LDA &07c0 ; changing_palette_values + 4 &0ef6 8d bf 07 STA &07bf ; changing_palette_values + 3 &0ef9 ad c1 07 LDA &07c1 ; changing_palette_values + 5 &0efc 8d c0 07 STA &07c0 ; changing_palette_values + 4 &0eff a5 b2 LDA &b2 ; tmp &0f01 8d c1 07 STA &07c1 ; changing_palette_values + 5 ; skip_animating_factory_conveyor_belt &0f04 a9 e0 LDA #&e0 # Set colour 14 (TARDIS light) &0f06 0d bc 07 ORA &07bc ; changing_palette_values &0f09 8d 21 fe STA &fe21 ; video ULA palette register &0f0c a9 d0 LDA #&d0 # Set colour 13 (TARDIS light) &0f0e 0d bd 07 ORA &07bd ; changing_palette_values + 1 &0f11 8d 21 fe STA &fe21 ; video ULA palette register &0f14 a9 c0 LDA #&c0 # Set colour 12 (TARDIS light) &0f16 0d be 07 ORA &07be ; changing_palette_values + 2 &0f19 8d 21 fe STA &fe21 ; video ULA palette register &0f1c a9 80 LDA #&80 # Set colour 8 (factory conveyor belt) &0f1e 0d bf 07 ORA &07bf ; changing_palette_values + 3 &0f21 8d 21 fe STA &fe21 ; video ULA palette register &0f24 a9 90 LDA #&90 # Set colour 9 (factory conveyor belt) &0f26 0d c0 07 ORA &07c0 ; changing_palette_values + 4 &0f29 8d 21 fe STA &fe21 ; video ULA palette register &0f2c a9 a0 LDA #&a0 # Set colour 10 (factory conveyor belt) &0f2e 0d c1 07 ORA &07c1 ; changing_palette_values + 5 &0f31 8d 21 fe STA &fe21 ; video ULA palette register ; skip_changing_palette &0f34 ce f6 07 DEC &07f6 ; time_fraction &0f37 10 1b BPL &0f54 ; skip_reducing_time &0f39 ad f5 07 LDA &07f5 ; time_high &0f3c 30 16 BMI &0f54 ; skip_reducing_time &0f3e ad f4 07 LDA &07f4 ; time_low &0f41 38 SEC &0f42 e9 01 SBC #&01 &0f44 8d f4 07 STA &07f4 ; time_low &0f47 ad f5 07 LDA &07f5 ; time_high &0f4a e9 00 SBC #&00 &0f4c 8d f5 07 STA &07f5 ; time_high &0f4f a9 34 LDA #&34 &0f51 8d f6 07 STA &07f6 ; time_fraction ; skip_reducing_time &0f54 a9 f7 LDA #&f7 # Set colour 15 to black &0f56 8d 21 fe STA &fe21 ; video ULA palette register &0f59 60 RTS ; flip_sprite &0f5a 78 SEI &0f5b a2 02 LDX #&02 &0f5d a5 12 LDA &12 ; sprite_height # &ff = 1 group, &01 = 2 groups, &00 = 3 groups &0f5f f0 01 BEQ &0f62 ; is_three_groups &0f61 ca DEX ; is_three_groups &0f62 29 80 AND #&80 &0f64 f0 01 BEQ &0f67 ; is_three_or_two_groups &0f66 ca DEX ; is_three_or_two_groups ; flip_sprite_group_loop &0f67 8a TXA &0f68 48 PHA ; groups &0f69 a9 07 LDA #&07 &0f6b 85 de STA &de ; flipped_offset &0f6d 85 df STA &df ; bytes_to_flip &0f6f a4 76 LDY &76 ; sprite_size &0f71 88 DEY ; flip_sprite_byte_loop &0f72 b1 00 LDA (&00),Y ; sprite_address &0f74 85 db STA &db ; right_value &0f76 29 55 AND #&55 &0f78 0a ASL A &0f79 85 da STA &da ; right_value_right_pixel_as_left_pixel &0f7b a5 db LDA &db ; right_value &0f7d 29 aa AND #&aa &0f7f 4a LSR A &0f80 05 da ORA &da ; right_value_left_pixel_as_right_pixel &0f82 84 dd STY &dd ; offset &0f84 a4 de LDY &de ; flipped_offset &0f86 99 80 03 STA &0380,Y ; flipped_sprite_buffer &0f89 a4 dd LDY &dd ; offset &0f8b c6 de DEC &de ; flipped_offset &0f8d c6 df DEC &df ; bytes_to_flip &0f8f 10 0b BPL &0f9c ; not_next_row &0f91 a9 07 LDA #&07 &0f93 85 df STA &df ; bytes_to_flip &0f95 a5 de LDA &de ; flipped_offset &0f97 18 CLC &0f98 69 10 ADC #&10 &0f9a 85 de STA &de ; flipped_offset ; not_next_row &0f9c 88 DEY &0f9d 10 d3 BPL &0f72 ; flip_sprite_byte_loop &0f9f a4 76 LDY &76 ; sprite_size &0fa1 88 DEY ; copy_flipped_sprite_from_buffer_loop &0fa2 b9 80 03 LDA &0380,Y ; flipped_sprite_buffer &0fa5 91 00 STA (&00),Y ; sprite_address &0fa7 88 DEY &0fa8 10 f8 BPL &0fa2 ; copy_flipped_sprite_from_buffer_loop &0faa a5 00 LDA &00 ; sprite_address_low &0fac 18 CLC &0fad 65 76 ADC &76 ; sprite_size &0faf 85 00 STA &00 ; sprite_address_low &0fb1 a5 01 LDA &01 ; sprite_address_high &0fb3 69 00 ADC #&00 &0fb5 85 01 STA &01 ; sprite_address_high &0fb7 68 PLA ; groups &0fb8 aa TAX &0fb9 ca DEX &0fba 10 ab BPL &0f67 ; flip_sprite_group_loop &0fbc 58 CLI &0fbd 60 RTS ; unplot_player &0fbe 38 SEC # Set carry to unplot sprite &0fbf b0 01 BCS &0fc2 ; plot_or_unplot_player # Always branches ; plot_player &0fc1 18 CLC # Clear carry to plot sprite ; plot_or_unplot_player &0fc2 08 PHP ; plotting or unplotting &0fc3 20 bb 23 JSR &23bb ; use_player_position &0fc6 a5 3e LDA &3e ; player_screen_address_low &0fc8 85 04 STA &04 ; plot_screen_address_low &0fca a5 3f LDA &3f ; player_screen_address_high &0fcc 85 05 STA &05 ; plot_screen_address_high &0fce a5 13 LDA &13 ; player_direction &0fd0 ae e9 07 LDX &07e9 ; player_sprite &0fd3 e0 03 CPX #&03 ; SPRITE_PLAYER_CLIMBING &0fd5 d0 06 BNE &0fdd ; not_climbing &0fd7 a5 0d LDA &0d ; player_relative_y_fraction &0fd9 45 0c EOR &0c ; player_tile_x_fraction &0fdb 6a ROR A # Use lowest bit of position to set flip if climbing &0fdc 6a ROR A &0fdd 28 PLP ; plotting or unplotting ; not_climbing ; plot_or_unplot_sprite # Called with carry clear to plot, carry set to unplot, &0fde ac 2e 1e LDY &1e2e ; suppress_sprite_plotting # X = sprite, A = direction &0fe1 f0 01 BEQ &0fe4 ; not_suppressed &0fe3 60 RTS ; not_suppressed &0fe4 08 PHP ; plotting or unplotting &0fe5 b0 10 BCS &0ff7 ; skip_considering_flipping # Carry set if unplotting sprite &0fe7 a0 ff LDY #&ff &0fe9 29 80 AND #&80 &0feb dd 56 33 CMP &3356,X ; sprites_flipped_state &0fee d0 02 BNE &0ff2 ; set_sprite_flipped &0ff0 a0 00 LDY #&00 ; set_sprite_flipped &0ff2 84 8c STY &8c ; sprite_flipped &0ff4 9d 56 33 STA &3356,X ; sprites_flipped_state ; skip_considering_flipping &0ff7 bd 46 32 LDA &3246,X ; sprite_sizes_table &0ffa 85 76 STA &76 ; sprite_size &0ffc 4a LSR A &0ffd 4a LSR A &0ffe 4a LSR A &0fff 85 77 STA &77 ; sprite_width_in_columns &1001 bd 2b 33 LDA &332b,X ; sprite_heights_table &1004 85 12 STA &12 ; sprite_height &1006 28 PLP ; plotting or unplotting &1007 90 03 BCC &100c ; plot_sprite &1009 4c a9 10 JMP &10a9 ; unplot_sprite ; plot_sprite # Called with X = sprite &100c 8a TXA &100d 0a ASL A &100e aa TAX &100f bc 72 32 LDY &3272,X ; sprite_addresses_table + 1 &1012 84 01 STY &01 ; sprite_address_high &1014 bd 71 32 LDA &3271,X ; sprite_addresses_table &1017 85 00 STA &00 ; sprite_address_low &1019 8d 6f 10 STA &106f ; sprite_address_for_plotting_one_low # Calculate sprite addresses for each of three groups &101c 8c 70 10 STY &1070 ; sprite_address_for_plotting_one_high &101f 18 CLC &1020 65 76 ADC &76 ; sprite_size &1022 90 01 BCC &1025 ; skip_page_two &1024 c8 INY ; skip_page_two &1025 8d 7b 10 STA &107b ; sprite_address_for_plotting_two_low &1028 8c 7c 10 STY &107c ; sprite_address_for_plotting_two_high &102b 18 CLC &102c 65 76 ADC &76 ; sprite_size &102e 90 01 BCC &1031 ; skip_page_three &1030 c8 INY ; skip_page_three &1031 8d 87 10 STA &1087 ; sprite_address_for_plotting_three_low &1034 8c 88 10 STY &1088 ; sprite_address_for_plotting_three_high &1037 a5 8c LDA &8c ; sprite_flipped &1039 10 03 BPL &103e ; skip_flipping &103b 20 5a 0f JSR &0f5a ; flip_sprite ; skip_flipping &103e a9 00 LDA #&00 &1040 85 34 STA &34 ; column_offset ; plot_sprite_column_loop &1042 a6 04 LDX &04 ; plot_screen_address_low &1044 a4 05 LDY &05 ; plot_screen_address_high &1046 8e 74 10 STX &1074 ; screen_address_one_low # Calculate screen addresses for each of three groups &1049 8c 75 10 STY &1075 ; screen_address_one_high &104c 8a TXA &104d 18 CLC &104e 69 80 ADC #&80 &1050 8d 80 10 STA &1080 ; screen_address_two_low &1053 98 TYA &1054 69 02 ADC #&02 &1056 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &1059 8d 81 10 STA &1081 ; screen_address_two_high &105c 8a TXA &105d 18 CLC &105e 8d 8c 10 STA &108c ; screen_address_three_low &1061 98 TYA &1062 69 05 ADC #&05 &1064 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &1067 8d 8d 10 STA &108d ; screen_address_three_high &106a a6 34 LDX &34 ; column_offset &106c a0 07 LDY #&07 ; plot_sprite_row_loop &106e bd 21 fe LDA &fe21,X # actually LDA sprite_address_for_plotting_one,X &1071 f0 03 BEQ &1076 ; skip_plotting_byte_one &1073 99 21 fe STA &fe21,Y # actually STA screen_address_one,X ; skip_plotting_byte_one &1076 a5 12 LDA &12 ; sprite_height # Negative if sprite is one group high &1078 30 14 BMI &108e ; skip_further_plotting &107a bd 21 fe LDA &fe21,X # actually LDA sprite_address_for_plotting_two,X &107d f0 03 BEQ &1082 ; skip_plotting_byte_two &107f 99 21 fe STA &fe21,Y # actually STA screen_address_two,X ; skip_plotting_byte_two &1082 a5 12 LDA &12 ; sprite_height # Non-zero if sprite isn't three groups high &1084 d0 08 BNE &108e ; skip_further_plotting &1086 bd 21 fe LDA &fe21,X # actually LDA sprite_address_for_plotting_three,X &1089 f0 03 BEQ &108e ; skip_plotting_byte_three &108b 99 21 fe STA &fe21,Y # actually STA screen_address_three,X ; skip_plotting_byte_three ; skip_further_plotting &108e e8 INX &108f 88 DEY &1090 10 dc BPL &106e ; plot_sprite_row_loop &1092 86 34 STX &34 ; column_offset &1094 a5 04 LDA &04 ; plot_screen_address_low &1096 18 CLC &1097 69 08 ADC #&08 # Move right two pixels &1099 85 04 STA &04 ; plot_screen_address_low &109b a5 05 LDA &05 ; plot_screen_address_high &109d 69 00 ADC #&00 &109f 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &10a2 85 05 STA &05 ; plot_screen_address_high &10a4 c6 77 DEC &77 ; sprite_width_in_columns &10a6 d0 9a BNE &1042 ; plot_sprite_column_loop &10a8 60 RTS ; unplot_sprite &10a9 a5 49 LDA &49 ; this_tile_y_fraction &10ab 0a ASL A &10ac 0a ASL A &10ad 0a ASL A &10ae 85 49 STA &49 ; this_tile_y_fraction &10b0 20 86 11 JSR &1186 ; calculate_tile_chunks_data_addresses_for_unplot ; unplot_sprite_column_loop &10b3 a6 04 LDX &04 ; plot_screen_address_low &10b5 a4 05 LDY &05 ; plot_screen_address_high &10b7 8e 40 11 STX &1140 ; screen_address_one_low # Calculate screen addresses for each of three groups &10ba 8c 41 11 STY &1141 ; screen_address_one_high &10bd 8a TXA &10be 18 CLC &10bf 69 80 ADC #&80 &10c1 8d 4a 11 STA &114a ; screen_address_two_low &10c4 98 TYA &10c5 69 02 ADC #&02 &10c7 29 7f AND #&7f # Keep address within screen memory &10c9 09 40 ORA #&40 &10cb 8d 4b 11 STA &114b ; screen_address_two_high &10ce 8a TXA &10cf 18 CLC &10d0 8d 54 11 STA &1154 ; screen_address_three_low &10d3 98 TYA &10d4 69 05 ADC #&05 &10d6 29 7f AND #&7f # Keep address within screen memory &10d8 09 40 ORA #&40 &10da 8d 55 11 STA &1155 ; screen_address_three_high &10dd a5 aa LDA &aa ; tile_group_one_y_fraction &10df 18 CLC &10e0 65 48 ADC &48 ; this_tile_x_fraction &10e2 a8 TAY &10e3 b1 a8 LDA (&a8),Y ; tile_group_one_chunks_data_address # Calculate chunk addresses for each of three groups &10e5 85 35 STA &35 ; chunk_data_low &10e7 a9 00 LDA #&00 &10e9 06 35 ASL &35 ; chunk_data_low &10eb 2a ROL A &10ec 06 35 ASL &35 ; chunk_data_low &10ee 2a ROL A &10ef 06 35 ASL &35 ; chunk_data_low &10f1 2a ROL A &10f2 69 9d ADC #&9d ; &9d00 = chunk_data &10f4 8d 3e 11 STA &113e ; sprite_address_for_unplotting_one_high &10f7 a5 35 LDA &35 ; chunk_data_low &10f9 8d 3d 11 STA &113d ; sprite_address_for_unplotting_one_low &10fc a5 ad LDA &ad ; tile_group_two_y_fraction &10fe 18 CLC &10ff 65 48 ADC &48 ; this_tile_x_fraction &1101 a8 TAY &1102 b1 ab LDA (&ab),Y ; tile_group_two_chunks_data_address &1104 85 35 STA &35 ; chunk_data_low &1106 a9 00 LDA #&00 &1108 06 35 ASL &35 ; chunk_data_low &110a 2a ROL A &110b 06 35 ASL &35 ; chunk_data_low &110d 2a ROL A &110e 06 35 ASL &35 ; chunk_data_low &1110 2a ROL A &1111 69 9d ADC #&9d ; &9d00 = chunk_data &1113 8d 48 11 STA &1148 ; sprite_address_for_unplotting_two_high &1116 a5 35 LDA &35 ; chunk_data_low &1118 8d 47 11 STA &1147 ; sprite_address_for_unplotting_two_low &111b a5 b0 LDA &b0 ; tile_group_three_y_fraction &111d 18 CLC &111e 65 48 ADC &48 ; this_tile_x_fraction &1120 a8 TAY &1121 b1 ae LDA (&ae),Y ; tile_group_three_chunks_data_address &1123 85 35 STA &35 ; chunk_data_low &1125 a9 00 LDA #&00 &1127 06 35 ASL &35 ; chunk_data_low &1129 2a ROL A &112a 06 35 ASL &35 ; chunk_data_low &112c 2a ROL A &112d 06 35 ASL &35 ; chunk_data_low &112f 2a ROL A &1130 69 9d ADC #&9d ; &9d00 = chunk_data &1132 8d 52 11 STA &1152 ; sprite_address_for_unplotting_three_high &1135 a5 35 LDA &35 ; chunk_data_low &1137 8d 51 11 STA &1151 ; sprite_address_for_unplotting_three_low &113a a0 07 LDY #&07 ; unplot_sprite_row_loop &113c b9 21 fe LDA &fe21,Y # actually LDA sprite_address_for_unplotting_one,Y &113f 99 21 fe STA &fe21,Y # actually STA screen_address_one &1142 a5 12 LDA &12 ; sprite_height &1144 30 10 BMI &1156 ; skip_further_unplotting # Negative if sprite is one group high &1146 b9 21 fe LDA &fe21,Y # actually LDA sprite_address_for_unplotting_two,Y &1149 99 21 fe STA &fe21,Y # actually STA screen_address_two,Y &114c a5 12 LDA &12 ; sprite_height # Non-zero if sprite isn't three groups high &114e d0 06 BNE &1156 ; skip_further_unplotting &1150 b9 21 fe LDA &fe21,Y # actually LDA sprite_address_for_unplotting_two,Y &1153 99 21 fe STA &fe21,Y # actually STA screen_address_three,Y ; skip_further_unplotting &1156 88 DEY &1157 10 e3 BPL &113c ; unplot_sprite_row_loop &1159 a6 48 LDX &48 ; this_tile_x_fraction &115b e8 INX &115c e0 08 CPX #&08 &115e 90 0b BCC &116b ; not_next_tile &1160 e6 46 INC &46 ; this_tile_address_low &1162 d0 02 BNE &1166 ; skip_page &1164 e6 47 INC &47 ; this_tile_address_high ; skip_page &1166 20 86 11 JSR &1186 ; calculate_tile_chunks_data_addresses_for_unplot &1169 a2 00 LDX #&00 ; not_next_tile &116b 86 48 STX &48 ; this_tile_x_fraction &116d a5 04 LDA &04 ; plot_screen_address_low &116f 18 CLC &1170 69 08 ADC #&08 # Move right two pixels &1172 85 04 STA &04 ; plot_screen_address_low &1174 a5 05 LDA &05 ; plot_screen_address_high &1176 69 00 ADC #&00 &1178 29 7f AND #&7f # Keep address within screen memory &117a 09 40 ORA #&40 &117c 85 05 STA &05 ; plot_screen_address_high &117e c6 77 DEC &77 ; sprite_width_in_columns &1180 f0 03 BEQ &1185 ; leave &1182 4c b3 10 JMP &10b3 ; unplot_sprite_column_loop ; leave &1185 60 RTS ; calculate_tile_chunks_data_addresses_for_unplot &1186 a5 46 LDA &46 ; this_tile_address_low &1188 85 00 STA &00 ; tile_address_low &118a a5 47 LDA &47 ; this_tile_address_high &118c 85 01 STA &01 ; tile_address_high &118e 20 12 0e JSR &0e12 ; calculate_tile_chunks_data_address &1191 a5 32 LDA &32 ; tile_chunks_data_address_low &1193 85 a8 STA &a8 ; tile_group_one_chunks_data_address_low &1195 a5 33 LDA &33 ; tile_chunks_data_address_high &1197 85 a9 STA &a9 ; tile_group_one_chunks_data_address_high &1199 a5 49 LDA &49 ; this_tile_y_fraction &119b 85 aa STA &aa ; tile_group_one_y_fraction &119d a5 49 LDA &49 ; this_tile_y_fraction &119f 18 CLC &11a0 69 08 ADC #&08 &11a2 85 02 STA &02 ; y_fraction &11a4 c9 20 CMP #&20 &11a6 90 03 BCC &11ab ; not_next_tile_two &11a8 20 02 0d JSR &0d02 ; move_down_a_row_of_tiles ; not_next_tile_two &11ab 20 12 0e JSR &0e12 ; calculate_tile_chunks_data_address &11ae a5 32 LDA &32 ; tile_chunks_data_address_low &11b0 85 ab STA &ab ; tile_group_two_chunks_data_address_low &11b2 a5 33 LDA &33 ; tile_chunks_data_address_high &11b4 85 ac STA &ac ; tile_group_two_chunks_data_address_high &11b6 a5 02 LDA &02 ; y_fraction &11b8 29 1f AND #&1f &11ba 85 ad STA &ad ; tile_group_two_y_fraction &11bc 18 CLC &11bd 69 08 ADC #&08 &11bf 85 02 STA &02 ; y_fraction &11c1 c9 20 CMP #&20 &11c3 90 03 BCC &11c8 ; not_next_tile_three &11c5 20 02 0d JSR &0d02 ; move_down_a_row_of_tiles ; not_next_tile_three &11c8 20 12 0e JSR &0e12 ; calculate_tile_chunks_data_address &11cb a5 32 LDA &32 ; tile_chunks_data_address_low &11cd 85 ae STA &ae ; tile_group_two_chunks_data_address_low &11cf a5 33 LDA &33 ; tile_chunks_data_address_high &11d1 85 af STA &af ; tile_group_three_chunks_data_address_high &11d3 a5 02 LDA &02 ; y_fraction &11d5 29 1f AND #&1f &11d7 85 b0 STA &b0 ; tile_group_three_y_fraction &11d9 60 RTS ; use_detonator &11da ad d4 07 LDA &07d4 ; detonator_countdown &11dd d0 0b BNE &11ea ; leave # Can't use detonator if already counting down &11df ad f8 07 LDA &07f8 ; detonator_uses_remaining &11e2 f0 06 BEQ &11ea ; leave # Can't use detonator if exhausted &11e4 ce f8 07 DEC &07f8 ; detonator_uses_remaining &11e7 ce d4 07 DEC &07d4 ; detonator_countdown # Set to non-zero to indicator detonator counting down ; leave &11ea 60 RTS ; plot_security_code_symbol_choices &11eb a2 06 LDX #&06 ; C # Use cyan foreground &11ed a0 84 LDY #&84 ; B # Use blue background &11ef 20 4a 13 JSR &134a ; use_text_colours &11f2 a2 02 LDX #&02 # For each of three choices, ; plot_security_code_symbol_choices_loop &11f4 bd 0b 14 LDA &140b,X ; security_code_symbol_choices &11f7 85 06 STA &06 ; symbol &11f9 8a TXA &11fa 48 PHA ; position &11fb 18 CLC &11fc 69 51 ADC #&51 &11fe aa TAX &11ff a0 10 LDY #&10 &1201 20 5c 13 JSR &135c ; move_cursor_to_tile_X_Y # Plot at (&51 + x, &10) &1204 a5 06 LDA &06 ; symbol &1206 20 26 13 JSR &1326 ; write_security_code_symbol &1209 68 PLA ; position &120a aa TAX &120b ca DEX &120c 10 e6 BPL &11f4 ; plot_security_code_symbol_choices_loop &120e 60 RTS ; use_escape_pod_activator &120f a9 80 LDA #&80 ; KILLED_BY_ESCAPE_POD &1211 85 16 STA &16 ; player_killed # Game completed (left in escape pod) &1213 60 RTS ; use_object &1214 a6 d6 LDX &d6 ; player_middle_tile_x &1216 a4 d7 LDY &d7 ; player_middle_tile_y &1218 e0 51 CPX #&51 # Is the player at (&51, &09)? (security code computer) &121a d0 07 BNE &1223 ; not_using_computer &121c c0 09 CPY #&09 &121e d0 03 BNE &1223 ; not_using_computer &1220 4c e3 12 JMP &12e3 ; use_computer ; not_using_computer &1223 c0 11 CPY #&11 # Is the player at (&51, &11), (&52, &11) or (&53, &11)? &1225 d0 08 BNE &122f ; not_entering_security_code # (security code room) &1227 e0 51 CPX #&51 &1229 90 04 BCC &122f ; not_entering_security_code &122b e0 54 CPX #&54 &122d 90 5e BCC &128d ; enter_security_code ; not_entering_security_code &122f ad e2 07 LDA &07e2 ; inventory + 5 (HAND) &1232 c9 21 CMP #&21 ; OBJECT_DETONATOR + 1 &1234 f0 a4 BEQ &11da ; use_detonator &1236 c9 2d CMP #&2d ; OBJECT_ESCAPE_POD_ACTIVATOR + 1 &1238 d0 10 BNE &124a ; not_using_escape_pod_activator # Can't use escape pods if not carrying activator &123a c0 04 CPY #&04 &123c d0 0c BNE &124a ; not_using_escape_pod_activator &123e e0 68 CPX #&68 # Is the player at (&68, &04)? (left escape pod) &1240 f0 cd BEQ &120f ; use_escape_pod_activator &1242 e0 6c CPX #&6c # Is the player at (&6c, &04)? (middle escape pod) &1244 f0 c9 BEQ &120f ; use_escape_pod_activator &1246 e0 70 CPX #&70 # Is the player at (&70, &04)? (right escape pod) &1248 f0 c5 BEQ &120f ; use_escape_pod_activator ; not_using_escape_pod_activator &124a ae e2 07 LDX &07e2 ; inventory + 5 (HAND) &124d f0 0c BEQ &125b ; not_using_pick &124f bd 0d 34 LDA &340d,X ; objects_type - 1 &1252 29 3f AND #&3f ; OBJECT_TYPE_MASK &1254 c9 12 CMP #&12 ; OBJECT_TYPE_PICK &1256 d0 03 BNE &125b ; not_using_pick &1258 4c 10 14 JMP &1410 ; use_pick ; not_using_pick &125b a0 00 LDY #&00 &125d b1 d8 LDA (&d8),Y ; player_middle_tile_address &125f c9 b2 CMP #&b2 ; TILE_TARDIS_ON_BLACK &1261 f0 05 BEQ &1268 ; use_tardis &1263 c9 be CMP #&be ; TILE_TARDIS_ON_BLUE &1265 f0 01 BEQ &1268 ; use_tardis &1267 60 RTS ; use_tardis &1268 a9 0d LDA #&0d ; OBJECT_TYPE_TIRU_LATTICE &126a 20 74 12 JSR &1274 ; check_if_carrying_object_type # Returns carry clear if carrying object &126d b0 04 BCS &1273 ; leave # Can't use TARDIS if not carrying TIRU lattice &126f a9 81 LDA #&81 ; KILLED_BY_TARDIS &1271 85 16 STA &16 ; player_killed # Game completed (left in TARDIS) ; leave &1273 60 RTS ; check_if_carrying_object_type &1274 85 00 STA &00 ; object_type &1276 a2 05 LDX #&05 ; check_if_carrying_object_type_loop &1278 bd dd 07 LDA &07dd,X ; inventory &127b a8 TAY &127c 88 DEY &127d b9 0e 34 LDA &340e,Y ; objects_type &1280 29 3f AND #&3f ; OBJECT_TYPE_MASK &1282 c5 00 CMP &00 ; object_type &1284 f0 05 BEQ &128b ; leave_with_carry_clear &1286 ca DEX &1287 10 ef BPL &1278 ; check_if_carrying_object_type_loop &1289 38 SEC # Leave with carry set to indicate not carrying object &128a 60 RTS ; leave_with_carry_clear &128b 18 CLC # Leave with carry clear to indicate carrying object &128c 60 RTS ; enter_security_code # Called with X = player_middle_tile_x &128d 8a TXA &128e 38 SEC &128f e9 51 SBC #&51 # Determine which symbol was chosen from player position &1291 aa TAX &1292 ac 0f 14 LDY &140f ; security_code_offset &1295 b9 ae 35 LDA &35ae,Y ; security_code_data &1298 29 0f AND #&0f # Low nibble specifies symbol &129a dd 0b 14 CMP &140b,X ; security_code_symbol_choices &129d d0 26 BNE &12c5 ; is_incorrect_symbol &129f ee 0f 14 INC &140f ; security_code_offset &12a2 ce 0e 14 DEC &140e ; security_code_length_remaining &12a5 f0 03 BEQ &12aa ; is_end_of_code &12a7 4c ce 13 JMP &13ce ; set_security_code_symbol_choices # Randomise symbols for next entry ; is_end_of_code &12aa a2 c9 LDX #&c9 ; &33c9 = sound_9 &12ac a0 33 LDY #&33 &12ae 20 fd 09 JSR &09fd ; play_sound # Play sounds for correctly entered security code &12b1 a2 d1 LDX #&d1 ; &33d1 = sound_10 &12b3 a0 33 LDY #&33 &12b5 20 fd 09 JSR &09fd ; play_sound &12b8 a2 d9 LDX #&d9 ; &33d9 = sound_11 &12ba a0 33 LDY #&33 &12bc 20 fd 09 JSR &09fd ; play_sound &12bf 8d eb 07 STA &07eb ; security_code_correctly_entered # Set to non-zero to indicate code correctly entered &12c2 4c a6 13 JMP &13a6 ; reset_security_code ; is_incorrect_symbol # If an incorrect symbol was chosen, &12c5 20 a6 13 JSR &13a6 ; reset_security_code ; activate_security_code_room_controller &12c8 a2 57 LDX #&57 # Set mover 3 to target (&57, &11) &12ca a0 11 LDY #&11 # i.e. the security code room controller targeting &12cc a9 03 LDA #&03 # the right end of the room right of the code room ; set_mover_A_to_target_tile_X_Y &12ce 85 00 STA &00 ; mover &12d0 8a TXA &12d1 a6 00 LDX &00 ; mover &12d3 9d 27 35 STA &3527,X ; movers_target_x &12d6 98 TYA &12d7 9d 4c 35 STA &354c,X ; movers_target_y &12da bd 97 05 LDA &0597,X ; movers_flags &12dd 09 08 ORA #&08 ; MOVER_FLAG_USE_TARGET &12df 9d 97 05 STA &0597,X ; movers_flags &12e2 60 RTS ; use_computer &12e3 a2 51 LDX #&51 # Move cursor to tile (&51, &08) &12e5 a0 08 LDY #&08 &12e7 20 5c 13 JSR &135c ; move_cursor_to_tile_X_Y &12ea ad 08 14 LDA &1408 ; security_code_start_symbol &12ed 4a LSR A # Top nibble of security code determines colour &12ee 4a LSR A &12ef 4a LSR A &12f0 4a LSR A &12f1 85 00 STA &00 ; colour &12f3 aa TAX &12f4 bd a1 13 LDA &13a1,X ; colour_colours &12f7 aa TAX # Use colour of symbol for foreground &12f8 a0 80 LDY #&80 # Use black background &12fa 20 4a 13 JSR &134a ; use_text_colours &12fd ce 0a 14 DEC &140a ; security_code_computer_state &1300 10 05 BPL &1307 ; skip_wraparound &1302 a9 02 LDA #&02 &1304 8d 0a 14 STA &140a ; security_code_computer_state ; skip_wraparound &1307 ad 0a 14 LDA &140a ; security_code_computer_state &130a d0 09 BNE &1315 ; not_count &130c ad 09 14 LDA &1409 ; security_code_start_count &130f 18 CLC &1310 69 30 ADC #&30 ; "0" &1312 4c ee ff JMP &ffee ; OSWRCH # Third, display the count ; not_count &1315 c9 01 CMP #&01 &1317 d0 08 BNE &1321 ; write_security_code_start_symbol # First, display the start symbol &1319 a6 00 LDX &00 ; colour &131b bd 5b 07 LDA &075b,X ; colour_letters &131e 4c ee ff JMP &ffee ; OSWRCH # Second, display the colour ; write_security_code_start_symbol &1321 ad 08 14 LDA &1408 ; security_code_start_symbol &1324 29 0f AND #&0f ; write_security_code_symbol &1326 48 PHA ; symbol &1327 a2 2f LDX #&2f ; initialise_symbols_loop &1329 bd 00 0c LDA &0c00,X ; code &132c 9d 80 03 STA &0380,X ; code_backup &132f bd ee 06 LDA &06ee,X ; symbol_character_definitions &1332 9d 00 0c STA &0c00,X ; os_user_defined_characters &1335 ca DEX &1336 10 f1 BPL &1329 ; initialise_symbols_loop &1338 68 PLA ; symbol &1339 09 80 ORA #&80 &133b 20 ee ff JSR &ffee ; OSWRCH # Write symbol &133e a2 2f LDX #&2f ; restore_code_loop &1340 bd 80 03 LDA &0380,X ; code &1343 9d 00 0c STA &0c00,X ; code_backup &1346 ca DEX &1347 10 f7 BPL &1340 ; restore_code_loop &1349 60 RTS ; use_text_colours # Called with X and Y = colours &134a a9 11 LDA #&11 ; define text colour &134c 20 ee ff JSR &ffee ; OSWRCH &134f 8a TXA &1350 20 ee ff JSR &ffee ; OSWRCH &1353 a9 11 LDA #&11 ; define text colour &1355 20 ee ff JSR &ffee ; OSWRCH &1358 98 TYA &1359 4c ee ff JMP &ffee ; OSWRCH ; move_cursor_to_tile_X_Y # Called with X = tile_x, Y = tile_y &135c 86 da STX &da ; tile_x &135e a5 20 LDA &20 ; screen_start_address_low &1360 85 00 STA &00 ; screen_address_low &1362 a5 21 LDA &21 ; screen_start_address_high &1364 85 01 STA &01 ; screen_address_high &1366 98 TYA &1367 38 SEC &1368 e5 0e SBC &0e ; screen_top_y &136a a2 00 LDX #&00 ; &0a00 &136c a0 0a LDY #&0a &136e 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address &1371 a5 da LDA &da ; tile_x &1373 38 SEC &1374 e5 0f SBC &0f ; screen_left_x &1376 a2 40 LDX #&40 ; &0040 &1378 a0 00 LDY #&00 &137a 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address &137d a9 07 LDA #&07 &137f 38 SEC &1380 e5 10 SBC &10 ; screen_x_fraction &1382 a2 08 LDX #&08 ; &0008 &1384 a0 00 LDY #&00 &1386 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address &1389 a9 01 LDA #&01 &138b a2 d8 LDX #&d8 ; &04d8 = &0280 * 2 - 8 * 5 # Position cursor in middle of tile &138d a0 04 LDY #&04 &138f 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address &1392 a5 00 LDA &00 ; screen_address_low &1394 8d 50 03 STA &0350 ; os_screen_start_address_low &1397 a5 01 LDA &01 ; screen_address_high &1399 8d 51 03 STA &0351 ; os_screen_start_address_high &139c a9 1e LDA #&1e ; cursor home &139e 4c ee ff JMP &ffee ; OSWRCH ; colour_colours ; R G Y B W &13a1 01 02 03 04 07 ; reset_security_code &13a6 a9 06 LDA #&06 &13a8 8d 0e 14 STA &140e ; security_code_length_remaining &13ab ae 64 fe LDX &fe64 ; User VIA timer 1 counter LSB &13ae e0 b2 CPX #&b2 # Get random offset between &00 and &b1 &13b0 b0 f4 BCS &13a6 ; reset_security_code &13b2 bd ae 35 LDA &35ae,X ; security_code_data # Use this as offset for first symbol &13b5 8d 08 14 STA &1408 ; security_code_start_symbol &13b8 8e 0f 14 STX &140f ; security_code_offset &13bb a0 00 LDY #&00 ; calculate_count &13bd bd ae 35 LDA &35ae,X ; security_code_data &13c0 cd 08 14 CMP &1408 ; security_code_start_symbol &13c3 d0 01 BNE &13c6 ; is_different_symbol &13c5 c8 INY ; is_different_symbol &13c6 ca DEX &13c7 e0 ff CPX #&ff &13c9 d0 f2 BNE &13bd ; calculate_count &13cb 8c 09 14 STY &1409 ; security_code_start_count ; set_security_code_symbol_choices &13ce a2 02 LDX #&02 # For each of three choices, ; set_security_code_symbol_choices_loop &13d0 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB &13d3 29 0f AND #&0f &13d5 c9 06 CMP #&06 # Get random symbol between 0 and 5 &13d7 b0 f7 BCS &13d0 ; set_security_code_symbol_choices_loop &13d9 9d 0b 14 STA &140b,X ; security_code_symbol_choices &13dc ca DEX &13dd 10 f1 BPL &13d0 ; set_security_code_symbol_choices_loop ; set_security_code_actual_symbol_loop &13df ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB &13e2 29 03 AND #&03 # Get random position between 1 and 3 &13e4 f0 f9 BEQ &13df ; set_security_code_actual_symbol_loop &13e6 aa TAX &13e7 ac 0f 14 LDY &140f ; security_code_offset &13ea b9 ae 35 LDA &35ae,Y ; security_code_data &13ed 29 0f AND #&0f &13ef 9d 0a 14 STA &140a,X ; security_code_symbol_choices - 1 # Put correct symbol in random position &13f2 ad 0b 14 LDA &140b ; security_code_symbol_choices &13f5 cd 0c 14 CMP &140c ; security_code_symbol_choices + 1 &13f8 f0 d4 BEQ &13ce ; set_security_code_symbol_choices # Ensure no two choices are the same &13fa cd 0d 14 CMP &140d ; security_code_symbol_choices + 2 &13fd f0 cf BEQ &13ce ; set_security_code_symbol_choices &13ff ad 0c 14 LDA &140c ; security_code_symbol_choices + 1 &1402 cd 0d 14 CMP &140d ; security_code_symbol_choices + 2 &1405 f0 c7 BEQ &13ce ; set_security_code_symbol_choices &1407 60 RTS ; security_code_start_symbol &1408 00 ; security_code_start_count &1409 00 ; security_code_computer_state &140a 00 ; security_code_symbol_choices &140b 00 00 00 ; security_code_length_remaining &140e 00 ; security_code_offset &140f 00 ; use_pick &1410 a5 13 LDA &13 ; player_direction &1412 30 07 BMI &141b ; leave # Is the player facing right? &1414 a2 0a LDX #&0a ; &0a = player_x &1416 20 7a 25 JSR &257a ; check_if_touching_object # Returns carry set if player is touching any object &1419 b0 01 BCS &141c ; is_touching_object ; leave &141b 60 RTS ; is_touching_object # X = object touched &141c bd 0e 34 LDA &340e,X ; objects_type &141f 29 3f AND #&3f ; OBJECT_TYPE_MASK &1421 c9 1b CMP #&1b ; OBJECT_TYPE_HEATONITE_ORE &1423 d0 f6 BNE &141b ; leave &1425 8a TXA &1426 48 PHA ; object &1427 a2 a9 LDX #&a9 ; &33a9 = sound_5 &1429 a0 33 LDY #&33 &142b 20 fd 09 JSR &09fd ; play_sound # Play sound for using pick &142e 68 PLA ; object &142f aa TAX &1430 ce 45 14 DEC &1445 ; effort_required_to_mine_ore &1433 10 e6 BPL &141b ; leave &1435 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB &1438 29 07 AND #&07 &143a 18 CLC &143b 69 04 ADC #&04 # Heatonite ore requires 5 - 12 uses of pick to remove &143d 8d 45 14 STA &1445 ; effort_required_to_mine_ore &1440 8e 44 14 STX &1444 ; object_to_remove &1443 60 RTS ; object_to_remove &1444 00 ; effort_required_to_mine_ore &1445 00 ; check_for_hatch &1446 a2 3c LDX #&3c ; OBJECT_LAST ; check_for_hatch_loop &1448 bd 0e 34 LDA &340e,X ; objects_type &144b 29 3f AND #&3f ; OBJECT_TYPE_MASK &144d c9 17 CMP #&17 ; OBJECT_TYPE_HATCH &144f d0 10 BNE &1461 ; consider_next_object &1451 bd bc 05 LDA &05bc,X ; objects_tile_x &1454 c5 d6 CMP &d6 ; player_middle_tile_x &1456 d0 09 BNE &1461 ; consider_next_object &1458 bd 36 06 LDA &0636,X ; objects_tile_y &145b c5 d7 CMP &d7 ; player_middle_tile_y &145d d0 02 BNE &1461 ; consider_next_object &145f 38 SEC # Leave with carry set to indicate hatch present &1460 60 RTS ; consider_next_object &1461 ca DEX &1462 10 e4 BPL &1448 ; check_for_hatch_loop &1464 18 CLC # Leave with carry clear to indicate hatch not present &1465 60 RTS ; reset_player_and_redraw_screen &1466 20 b3 14 JSR &14b3 ; reset_screen &1469 a5 0f LDA &0f ; screen_left_x &146b 48 PHA ; screen_left_x &146c a5 10 LDA &10 ; screen_x_fraction &146e 48 PHA ; screen_x_fraction &146f a5 11 LDA &11 ; screen_right_x &1471 48 PHA ; screen_right_x &1472 a5 11 LDA &11 ; screen_right_x &1474 38 SEC &1475 e9 0a SBC #&0a # Screen is ten tiles wide &1477 85 11 STA &11 ; screen_right_x &1479 20 95 2e JSR &2e95 ; hide_screen &147c 20 87 09 JSR &0987 ; calculate_screen_and_tile_addresses &147f a2 4f LDX #&4f ; scroll_into_screen_loop &1481 8a TXA &1482 48 PHA ; count &1483 20 6b 0d JSR &0d6b ; scroll_right &1486 68 PLA ; count &1487 aa TAX &1488 ca DEX &1489 10 f6 BPL &1481 ; scroll_into_screen_loop &148b 68 PLA ; screen_right_x &148c 85 11 STA &11 ; screen_right_x &148e 68 PLA ; screen_x_fraction &148f 85 10 STA &10 ; screen_x_fraction &1491 68 PLA ; screen_left_x &1492 85 0f STA &0f ; screen_left_x &1494 20 87 09 JSR &0987 ; calculate_screen_and_tile_addresses &1497 20 43 26 JSR &2643 ; plot_movers_and_objects &149a a2 01 LDX #&01 ; R1: Number of characters per line &149c a9 50 LDA #&50 # Display screen &149e 20 7b 09 JSR &097b ; set_video_register &14a1 4c c1 0f JMP &0fc1 ; plot_player ; add_XY_to_player_screen_address &14a4 8a TXA &14a5 18 CLC &14a6 65 3e ADC &3e ; player_screen_address_low &14a8 85 3e STA &3e ; player_screen_address_low &14aa 98 TYA &14ab 65 3f ADC &3f ; player_screen_address_high &14ad 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &14b0 85 3f STA &3f ; player_screen_address_high &14b2 60 RTS ; reset_screen &14b3 a2 00 LDX #&00 # Use black foreground &14b5 a0 80 LDY #&80 # Use black background &14b7 20 4a 13 JSR &134a ; use_text_colours &14ba 20 4f 09 JSR &094f ; wait_for_vsync &14bd a2 01 LDX #&01 ; R1: Number of characters per line &14bf a9 00 LDA #&00 # Hide screen &14c1 20 7b 09 JSR &097b ; set_video_register &14c4 a8 TAY &14c5 84 00 STY &00 ; wipe_address_low &14c7 a9 40 LDA #&40 ; &4000 = screen memory &14c9 85 21 STA &21 ; screen_start_address_high &14cb 85 01 STA &01 ; wipe_address_high ; wipe_screen_outer_loop &14cd 98 TYA ; wipe_screen_inner_loop &14ce 91 00 STA (&00),Y ; wipe_address # Wipe &4000 - &7fff &14d0 c8 INY &14d1 d0 fb BNE &14ce ; wipe_screen_inner_loop &14d3 e6 01 INC &01 ; wipe_address_high &14d5 10 f6 BPL &14cd ; wipe_screen_outer_loop &14d7 a9 14 LDA #&14 ; restore default logical colours &14d9 20 ee ff JSR &ffee ; OSWRCH &14dc 84 22 STY &22 ; crtc_start_address_low &14de 84 20 STY &20 ; screen_start_address_low &14e0 a2 00 LDX #&00 &14e2 a9 08 LDA #&08 ; &0800 * 8 = &4000 # Screen starts at &4000 &14e4 85 23 STA &23 ; crtc_start_address_high &14e6 20 9f 0c JSR &0c9f ; scroll_screen # XY = 0, so doesn't scroll, but sets screen addresses &14e9 20 98 1c JSR &1c98 ; restore_default_windows &14ec a9 0f LDA #&0f ; Flush buffers &14ee a2 00 LDX #&00 ; Flush all buffers &14f0 20 f4 ff JSR &fff4 ; OSBYTE &14f3 a2 01 LDX #&01 ; R1: Number of characters per line &14f5 a9 50 LDA #&50 # Display screen &14f7 4c 7b 09 JMP &097b ; set_video_register ; check_if_position_is_climbable # Called with X = width in chunks to check &14fa a9 00 LDA #&00 ; check_if_offset_position_is_climbable # Called with A = y fraction offset &14fc 48 PHA ; y_fraction_offset &14fd c6 49 DEC &49 ; this_tile_y_fraction # Move up a tile fraction &14ff 10 0d BPL &150e ; not_tile_above &1501 a5 46 LDA &46 ; this_tile_address_low &1503 38 SEC &1504 e9 80 SBC #&80 # Move up a tile &1506 85 46 STA &46 ; this_tile_address_low &1508 a5 47 LDA &47 ; this_tile_address_high &150a e9 00 SBC #&00 &150c 85 47 STA &47 ; this_tile_address_high ; not_tile_above &150e a5 49 LDA &49 ; this_tile_y_fraction &1510 29 03 AND #&03 &1512 85 49 STA &49 ; this_tile_y_fraction &1514 68 PLA ; y_fraction_offset # Check top of position &1515 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns A = chunk type of last or non-climbable chunk &1518 c9 40 CMP #&40 ; CHUNK_FIRST_CLIMBABLE # Was it an obstacle? If so, not climbable &151a 90 06 BCC &1522 ; leave_with_carry_set &151c c9 60 CMP #&60 ; CHUNK_FIRST_BACKGROUND # Was it only background? If so, not climbable &151e b0 02 BCS &1522 ; leave_with_carry_set &1520 18 CLC # Leave with carry clear to indicate climbable &1521 60 RTS # Leave with A = chunk type ; leave_with_carry_set &1522 38 SEC # Leave with carry clear to indicate not climbable &1523 60 RTS # Leave with A = chunk type ; check_if_player_is_on_antigravity_mat &1524 a5 0a LDA &0a ; player_x &1526 cd c9 05 CMP &05c9 ; objects_tile_x + &0d (OBJECT_ANTIGRAVITY_MAT) &1529 d0 15 BNE &1540 ; leave_with_carry_clear &152b a5 0c LDA &0c ; player_tile_x_fraction &152d cd 06 06 CMP &0606 ; objects_tile_x + &0d (OBJECT_ANTIGRAVITY_MAT) &1530 d0 0e BNE &1540 ; leave_with_carry_clear &1532 a6 0b LDX &0b ; player_y &1534 a5 0d LDA &0d ; player_relative_y_fraction &1536 f0 01 BEQ &1539 ; leave_with_carry_set &1538 e8 INX &1539 ec 43 06 CPX &0643 ; objects_tile_y + &0d (OBJECT_ANTIGRAVITY_MAT) &153c d0 02 BNE &1540 ; leave_with_carry_clear ; leave_with_carry_set &153e 38 SEC # Leave with carry set to indicate on mat &153f 60 RTS ; leave_with_carry_clear &1540 18 CLC # Leave with carry set to indicate not on mat &1541 60 RTS ; load_or_save_screen &1542 ee 96 35 INC &3596 ; suppress_events # Set to non-zero to suppress event handling &1545 a9 8c LDA #&8c ; Select Tape FS &1547 a2 0c LDX #&0c ; 1200 baud &1549 a0 00 LDY #&00 &154b 20 f4 ff JSR &fff4 ; OSBYTE &154e a9 a1 LDA #&a1 ; 1010 0001 # Retry, short messages for files &1550 85 e3 STA &e3 ; cfs_options &1552 20 b3 14 JSR &14b3 ; reset_screen &1555 a9 00 LDA #&00 # Positive to encrypt position for saving &1557 85 e2 STA &e2 ; cfs_status &1559 20 c3 15 JSR &15c3 ; encrypt_or_decrypt_temporary_game_state &155c 20 82 09 JSR &0982 ; write_string &155f 11 05 ; COLOUR 5 &1561 1f 03 02 ; TAB(&03, &02) &1564 7e 28 4c 29 6f 61 64 2f 28 53 29 61 76 65 ; "~(L)oad/(S)ave" &1572 1c 01 15 12 05 ; define text window x:(&01, &12), y:(&05, &15) &1577 11 03 ; COLOUR 3 &1579 00 ; end of string ; wait_for_key_release &157a a5 ec LDA &ec ; os_most_recently_pressed_key &157c d0 fc BNE &157a ; wait_for_key_release ; wait_for_l_or_s &157e a5 ec LDA &ec ; os_most_recently_pressed_key &1580 c9 d6 CMP #&d6 ; L &1582 f0 13 BEQ &1597 ; load_game &1584 c9 d1 CMP #&d1 ; S &1586 d0 f6 BNE &157e ; wait_for_l_or_s ; save_game &1588 a9 ff LDA #&ff &158a 8d f5 7f STA &7ff5 ; encrypted_game_state + &7f5 (time_high) # Set to negative to remove any time bonus &158d a2 b6 LDX #&b6 ; &15b6 = save_command &158f a0 15 LDY #&15 &1591 20 f7 ff JSR &fff7 ; OSCLI &1594 4c a3 15 JMP &15a3 ; finished_loading_or_saving ; load_game &1597 a2 ad LDX #&ad ; &15ad = load_command &1599 a0 15 LDY #&15 &159b 20 f7 ff JSR &fff7 ; OSCLI &159e a9 ff LDA #&ff # Negative to decrypt loaded position &15a0 20 c3 15 JSR &15c3 ; encrypt_or_decrypt_temporary_game_state ; finished_loading_or_saving &15a3 ce 96 35 DEC &3596 ; suppress_events # Set to zero to enable event handling &15a6 a9 19 LDA #&19 # Reveal bottom of screen ; set_vertical_displayed_register &15a8 a2 06 LDX #&06 ; R6: Vertical displayed register &15aa 4c 7b 09 JMP &097b ; set_video_register ; load_command &15ad 4c 2e 80 20 37 38 30 30 0d ; "L.. 7800" ; save_command &14b6 53 2e 80 20 37 38 30 30 2b 38 30 30 0d ; "S.. 7800+800" ; encrypt_or_decrypt_temporary_game_state # Called with A = &ff if loading, &00 if saving &15c3 85 00 STA &00 ; loading &15c5 a9 16 LDA #&16 # Hide bottom of screen (containing game state) &15c7 20 a8 15 JSR &15a8 ; set_vertical_displayed_register &15ca a0 00 LDY #&00 &15cc 84 01 STY &01 ; source_address_low &15ce 84 02 STY &02 ; source_address_high &15d0 84 03 STY &03 ; target_address_low &15d2 a9 78 LDA #&78 ; &7800 = encrypted_game_state &15d4 85 04 STA &04 ; target_address_high ; encrypt_or_decrypt_temporary_game_state_loop # Copy &0000 - &07ff to &7800 - &7fff (or reverse) &15d6 a5 02 LDA &02 ; source_address_high &15d8 f0 12 BEQ &15ec ; is_zero_page &15da c9 02 CMP #&02 &15dc f0 28 BEQ &1606 ; skip_byte # Skip &0200 - &02ff &15de c9 03 CMP #&03 &15e0 f0 24 BEQ &1606 ; skip_byte # Skip &0300 - &03ff &15e2 c9 01 CMP #&01 &15e4 d0 0e BNE &15f4 ; process_byte &15e6 c0 80 CPY #&80 # Skip &0180 - &01ff &15e8 b0 1c BCS &1606 ; skip_byte &15ea 90 08 BCC &15f4 ; process_byte # Always branches ; is_zero_page &15ec c0 a0 CPY #&a0 &15ee b0 16 BCS &1606 ; skip_byte # Skip &00a0 - &00ff &15f0 c0 05 CPY #&05 &15f2 90 12 BCC &1606 ; skip_byte # Skip &0000 - &0004 ; process_byte &15f4 24 00 BIT &00 ; loading # Negative if loading saved position &15f6 30 07 BMI &15ff ; decrypt_game_state ; encrypt_game_state &15f8 b1 01 LDA (&01),Y ; source_address &15fa 59 00 3c EOR &3c00,Y ; save_position_encryption_key # Encrypt position with &3c00 - &3cff when saving &15fd 91 03 STA (&03),Y ; target_address ; decrypt_game_state &15ff b1 03 LDA (&03),Y ; target_address &1601 59 00 3c EOR &3c00,Y ; save_position_encryption_key # Decrypt position with &3c00 - &3cff when loading &1604 91 01 STA (&01),Y ; source_address ; skip_byte &1606 c8 INY &1607 d0 cd BNE &15d6 ; encrypt_or_decrypt_temporary_game_state_loop &1609 e6 02 INC &02 ; source_address_high &160b e6 04 INC &04 ; target_address_high &160d 10 c7 BPL &15d6 ; encrypt_or_decrypt_temporary_game_state_loop &160f 60 RTS ; check_horizontal_range_of_chunks # Called with A = y fraction offset, X = width to check &1610 85 04 STA &04 ; y_fraction_offset &1612 86 ef STX &ef ; width_to_check &1614 a5 46 LDA &46 ; this_tile_address_low &1616 85 00 STA &00 ; tile_address_low &1618 a5 47 LDA &47 ; this_tile_address_high &161a 85 01 STA &01 ; tile_address_high &161c a5 49 LDA &49 ; this_tile_y_fraction &161e 18 CLC &161f 65 04 ADC &04 ; y_fraction_offset &1621 85 f1 STA &f1 ; y_fraction &1623 0a ASL A # chunk offset = y_fraction * 8 + x_fraction &1624 0a ASL A &1625 0a ASL A &1626 18 CLC &1627 65 48 ADC &48 ; this_tile_x_fraction &1629 85 02 STA &02 ; chunk_offset &162b c9 20 CMP #&20 # Is the below the bottom of the tile? &162d 90 07 BCC &1636 ; not_next_tile_down &162f 29 1f AND #&1f # If so, move down a tile &1631 85 02 STA &02 ; chunk_offset &1633 20 02 0d JSR &0d02 ; move_down_a_row_of_tiles ; not_next_tile_down ; check_horizontal_range_of_chunks_loop &1636 20 51 16 JSR &1651 ; check_next_chunk # Returns A = chunk type, carry set if greater than check &1639 90 06 BCC &1641 ; leave_with_carry_set &163b c6 ef DEC &ef ; width_to_check &163d d0 f7 BNE &1636 ; check_horizontal_range_of_chunks_loop &163f 18 CLC # Leave with carry clear if all chunks passed check &1640 60 RTS # Leave with A = chunk type of last chunk checked ; leave_with_carry_set &1641 38 SEC # Leave with carry set if any chunk was less than check &1642 60 RTS # Leave with A = chunk type of chunk that failed check ; diagonal_platform_tile_types &1643 08 ; TILE_DIAGONAL_PLATFORM_TLBR_ON_BLUE &1644 57 ; TILE_DIAGONAL_PLATFORM_BLTR_ON_BLUE &1645 72 ; TILE_DIAGONAL_PLATFORM_BLTR_ON_ROCK &1646 73 ; TILE_DIAGONAL_PLATFORM_TLBR_ON_ROCK &1647 91 ; TILE_DIAGONAL_PLATFORM_BLTR_ON_PLATFORM_BLUE &1648 92 ; TILE_DIAGONAL_PLATFORM_TLBR_ON_PLATFORM_BLUE &1649 93 ; TILE_DIAGONAL_PLATFORM_TLBR_WITH_PIPE &164a 94 ; TILE_DIAGONAL_PLATFORM_BLTR_WITH_PIPE &164b 95 ; TILE_DIAGONAL_PLATFORM_BLTR_ON_PLATFORM_BLACK &164c 96 ; TILE_DIAGONAL_PLATFORM_TLBR_ON_PLATFORM_BLACK &164d 97 ; TILE_DIAGONAL_PLATFORM_TLBR_ON_BLACK &164e 98 ; TILE_DIAGONAL_PLATFORM_BLTR_ON_BLACK &164f 99 ; TILE_DIAGONAL_PLATFORM_BLTR_ON_PLATFORM_BLUE_TWO &1650 9a ; TILE_DIAGONAL_PLATFORM_TLBR_ON_PLATFORM_BLUE_TWO ; check_next_chunk &1651 a5 02 LDA &02 ; chunk_offset &1653 29 18 AND #&18 # Split chunk offset into vertical &1655 85 03 STA &03 ; row_offset &1657 a5 02 LDA &02 ; chunk_offset &1659 29 07 AND #&07 # and horizontal parts &165b 18 CLC &165c 69 01 ADC #&01 # Move right a chunk &165e c9 08 CMP #&08 # Does this move past the right of the tile? &1660 90 06 BCC &1668 ; not_next_tile_right &1662 e6 00 INC &00 ; tile_address_low # If so, move right a tile &1664 d0 02 BNE &1668 ; skip_page &1666 e6 01 INC &01 ; tile_address_high ; skip_page ; not_next_tile_right &1668 29 07 AND #&07 &166a 05 03 ORA &03 ; row_offset &166c 85 02 STA &02 ; chunk_offset # Recombine chunk offset &166e 20 12 0e JSR &0e12 ; calculate_tile_chunks_data_address &1671 a4 02 LDY &02 ; chunk_offset &1673 b1 32 LDA (&32),Y ; tile_chunks_data_address # Get chunk &1675 c9 40 CMP #&40 ; CHUNK_FIRST_CLIMBABLE # Is it an obstacle (chunk type between &00 and &3f)? &1677 90 05 BCC &167e ; is_obstacle ; leave_with_chunk_type &1679 85 4f STA &4f ; chunk_type # Unused variable &167b c9 60 CMP #&60 ; CHUNK_FIRST_BACKGROUND # CHUNK_FIRST_BACKGROUND for all checks apart from when # actually CMP chunk_check_type # checking if player can climb, then CHUNK_FIRST_CLIMBABLE &167d 60 RTS # Leave with A = chunk type, carry set if greater than check ; is_obstacle # If it is an obstacle, &167e a5 f1 LDA &f1 ; y_fraction &1680 c9 03 CMP #&03 &1682 d0 14 BNE &1698 ; treat_as_obstacle # Is it at the bottom of the tile? &1684 a0 80 LDY #&80 &1686 b1 00 LDA (&00),Y ; tile_address # If so, consider the tile below &1688 a2 0d LDX #&0d ; check_tile_loop &168a dd 43 16 CMP &1643,X ; diagonal_platform_tile_types # Is it a diagonal platform? &168d f0 05 BEQ &1694 ; treat_as_downwards_climbable_platform # If so, allow player to climb down through this tile &168f ca DEX &1690 10 f8 BPL &168a ; check_tile_loop &1692 30 04 BMI &1698 ; treat_as_obstacle # Always branches ; treat_as_downwards_climbable_platform &1694 a9 50 LDA #&50 ; CHUNK_DOWNWARDS_CLIMBABLE_PLATFORM # Can climb down, but not up through chunk &1696 d0 e1 BNE &1679 ; leave_with_chunk_type # Always branches ; treat_as_obstacle &1698 a9 01 LDA #&01 ; CHUNK_01 # Obstacle &169a d0 dd BNE &1679 ; leave_with_chunk_type # Always branches ; check_vertical_range_of_chunks_from_left &169c a9 00 LDA #&00 ; check_vertical_range_of_chunks # Called with A = x fraction offset &169e 18 CLC &169f 69 01 ADC #&01 # Move right a chunk ; check_vertical_range_of_chunks_without_right &16a1 18 CLC &16a2 65 48 ADC &48 ; this_tile_x_fraction &16a4 85 48 STA &48 ; this_tile_x_fraction &16a6 c9 08 CMP #&08 # Does this move past the right of this tile? &16a8 90 0a BCC &16b4 ; not_next_tile_right &16aa 29 07 AND #&07 &16ac 85 48 STA &48 ; this_tile_x_fraction &16ae e6 46 INC &46 ; this_tile_address_low # If so, move right a tile &16b0 d0 02 BNE &16b4 ; skip_page &16b2 e6 47 INC &47 ; this_tile_address_high ; skip_page ; not_next_tile_right &16b4 a5 46 LDA &46 ; this_tile_address_low &16b6 85 00 STA &00 ; tile_address_low &16b8 a5 47 LDA &47 ; this_tile_address_high &16ba 85 01 STA &01 ; tile_address_high &16bc a5 49 LDA &49 ; this_tile_y_fraction &16be 0a ASL A # chunk offset = y_fraction * 8 + x_fraction &16bf 0a ASL A &16c0 0a ASL A &16c1 18 CLC &16c2 65 48 ADC &48 ; this_tile_x_fraction &16c4 85 02 STA &02 ; chunk_offset &16c6 20 45 17 JSR &1745 ; consider_special_tiles_and_rocks &16c9 a9 01 LDA #&01 # Set to &01 to indicate background &16cb 85 4b STA &4b ; vertical_chunk_check_results &16cd 85 4c STA &4c ; vertical_chunk_check_results + 1 &16cf 85 4d STA &4d ; vertical_chunk_check_results + 2 &16d1 a6 f3 LDX &f3 ; height_to_check ; check_vertical_range_of_chunks_loop &16d3 a4 02 LDY &02 ; chunk_offset &16d5 b1 32 LDA (&32),Y ; tile_chunks_data_address &16d7 a0 01 LDY #&01 # &01 if chunk is background &16d9 c9 3f CMP #&3f ; CHUNK_FIRST_CLIMBABLE - 1 # Bug: should be CMP #&40 ; CHUNK_FIRST_CLIMBABLE &16db b0 01 BCS &16de ; not_obstacle &16dd 88 DEY ; 0 # &00 if chunk is climbable ; not_obstacle &16de c9 5f CMP #&5f ; CHUNK_FIRST_BACKGROUND - 1 # Bug: should be CMP #&60 ; CHUNK_FIRST_BACKGROUND &16e0 b0 01 BCS &16e3 ; not_obstacle_or_climbable &16e2 88 DEY ; &ff # &ff if chunk is obstacle ; not_obstacle_or_climbable &16e3 94 4b STY &4b,X ; vertical_chunk_check_results &16e5 e0 00 CPX #&00 &16e7 f0 19 BEQ &1702 ; skip_moving_down # Don't move down a chunk if this is the last check &16e9 a5 02 LDA &02 ; chunk_offset &16eb 18 CLC &16ec 69 08 ADC #&08 # Move down a chunk &16ee 85 02 STA &02 ; chunk_offset &16f0 c9 20 CMP #&20 # Does this move past the bottom of this tile? &16f2 90 0e BCC &1702 ; not_next_tile_down &16f4 29 1f AND #&1f &16f6 85 02 STA &02 ; chunk_offset &16f8 20 02 0d JSR &0d02 ; move_down_a_row_of_tiles # If so, move down a tile &16fb 86 f2 STX &f2 ; tmp_x &16fd 20 45 17 JSR &1745 ; consider_special_tiles_and_rocks &1700 a6 f2 LDX &f2 ; tmp_x ; not_next_tile_down ; skip_moving_down &1702 ca DEX &1703 10 ce BPL &16d3 ; check_vertical_range_of_chunks_loop &1705 a5 4b LDA &4b ; vertical_chunk_check_results # Negative if obstacle &1707 10 0b BPL &1714 ; leave_with_zero &1709 a5 4c LDA &4c ; vertical_chunk_check_results + 1 # Negative if obstacle &170b 10 07 BPL &1714 ; leave_with_zero &170d a5 4d LDA &4d ; vertical_chunk_check_results + 2 # Negative if obstacle &170f 10 03 BPL &1714 ; leave_with_zero &1711 a9 01 LDA #&01 # Leave with one to indicate no obstacle &1713 60 RTS ; leave_with_zero &1714 a9 00 LDA #&00 # Leave with zero to indicate obstacle &1716 60 RTS ; check_keyboard &1717 a5 f5 LDA &f5 ; suppress_player_input # Non-zero if player input is suppressed &1719 d0 22 BNE &173d ; is_suppressed &171b a5 ec LDA &ec ; os_most_recently_pressed_key &171d 85 84 STA &84 ; player_movement_key # Used when checking for movement and inventory &171f 85 9f STA &9f ; player_action_key # Used when checking for other actions &1721 05 ed ORA &ed ; os_first_pressed_key &1723 f0 1a BEQ &173f ; set_movement_keys # Zero if no key is being pressed &1725 a5 ed LDA &ed ; os_first_pressed_key &1727 d0 02 BNE &172b ; set_movement_keys_and_consider_escape # Use first pressed key &1729 a5 ec LDA &ec ; os_most_recently_pressed_key ; set_movement_keys_and_consider_escape &172b 85 41 STA &41 ; player_second_movement_key &172d a5 84 LDA &84 ; player_movement_key &172f c9 f0 CMP #&f0 ; ESCAPE &1731 d0 06 BNE &1739 ; escape_not_pressed &1733 85 16 STA &16 ; player_killed # Game quit &1735 a9 e2 LDA #&e2 ; SPACE # Prevent movement or actions if player has quit &1737 d0 06 BNE &173f ; set_movement_keys # Always branches ; escape_not_pressed &1739 a5 40 LDA &40 ; player_movement_flags # Negative if PLAYER_FLAGS_FALLING set &173b 10 06 BPL &1743 ; leave # Prevent player from moving if falling ; is_suppressed &173d a9 00 LDA #&00 ; set_movement_keys &173f 85 41 STA &41 ; player_second_movement_key &1741 85 84 STA &84 ; player_movement_key ; leave &1743 60 RTS ; last_player_second_movement_key &1744 00 ; consider_special_tiles_and_rocks &1745 a0 00 LDY #&00 &1747 b1 00 LDA (&00),Y ; tile_address &1749 c9 b2 CMP #&b2 ; TILE_TARDIS_ON_BLACK &174b f0 5c BEQ &17a9 ; is_passable &174d c9 be CMP #&be ; TILE_TARDIS_ON_BLUE &174f f0 58 BEQ &17a9 ; is_passable &1751 a5 00 LDA &00 ; tile_address_low &1753 c9 d4 CMP #&d4 ; &add4 = map_data + &11 * 128 + &54 # Is this tile (&54, &11)? (right of security code room) &1755 d0 0b BNE &1762 ; not_security_code_room_door &1757 a5 01 LDA &01 ; tile_address_high &1759 c9 ad CMP #&ad &175b d0 05 BNE &1762 ; not_security_code_room_door &175d ad eb 07 LDA &07eb ; security_code_correctly_entered # Zero if security code hasn't been entered &1760 f0 3e BEQ &17a0; is_blocked # Stop player leaving security code room to right ; not_security_code_room_door &1762 a5 00 LDA &00 ; tile_address_low &1764 c9 2f CMP #&2f # Is this tile (&2f, &34)? (right of Madrag) &1766 f0 08 BEQ &1770 ; check_tile_address_high &1768 c9 42 CMP #&42 # Is this tile (&42, &34)? (right of bottom of lift) &176a f0 04 BEQ &1770 ; check_tile_address_high &176c c9 c8 CMP #&c8 # Is this time (&48, &2d)? (cave to left of reactor) &176e d0 2d BNE &179d ; to_calculate_tile_chunks_data_address ; check_tile_address_high &1770 a5 01 LDA &01 ; tile_address_high &1772 c9 bf CMP #&bf # Also check at (&2f, &2c), (&42, &2c) and (&48, &35) &1774 f0 04 BEQ &177a ; check_if_blocked_by_rocks &1776 c9 bb CMP #&bb &1778 d0 23 BNE &179d ; to_calculate_tile_chunks_data_address ; check_if_blocked_by_ore # If so, check if the player is blocked by ore &177a a2 30 LDX #&30 ; OBJECT_POWER_CELL # Bug: should be &31 ; OBJECT_FIRST_HEATONITE_ORE ; check_if_blocked_by_ore_loop &177c bd 1e 07 LDA &071e,X ; objects_tile_address_low &177f c5 00 CMP &00 ; tile_address_low &1781 d0 15 BNE &1798 ; consider_next_object &1783 bd 9a 01 LDA &019a,X ; objects_tile_address_high &1786 c5 01 CMP &01 ; tile_address_high &1788 d0 0e BNE &1798 ; consider_next_object &178a bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &178d c5 48 CMP &48 ; this_tile_x_fraction &178f f0 0f BEQ &17a0 ; is_blocked # Player can't move through Heatonite ore &1791 18 CLC &1792 69 04 ADC #&04 &1794 c5 48 CMP &48 ; this_tile_x_fraction &1796 f0 08 BEQ &17a0 ; is_blocked ; consider_next_object &1798 e8 INX &1799 e0 3d CPX #&3d ; OBJECT_LAST + 1 &179b d0 df BNE &177c ; check_if_blocked_by_ore_loop ; to_calculate_tile_chunks_data_address &179d 4c 12 0e JMP &0e12 ; calculate_tile_chunks_data_address ; is_blocked &17a0 a9 60 LDA #&60 ; &9c60 = tile_chunks_data + &db * 32 # Use TILE_HEATONITE_TWO (&db) &17a2 85 32 STA &32 ; tile_chunks_data_address_low &17a4 a9 9c LDA #&9c &17a6 85 33 STA &33 ; tile_chunks_data_address_high &17a8 60 RTS ; is_passable &17a9 a9 80 LDA #&80 ; &8480 = tile_chunks_data + &1c *32 # Use TILE_BLUE_BACKGROUND (&1c) &17ab 85 32 STA &32 ; tile_chunks_data_address_low &17ad a9 84 LDA #&84 &17af 85 33 STA &33 ; tile_chunks_data_address_high &17b1 60 RTS ; update_player &17b2 a9 02 LDA #&02 # Player is three groups high &17b4 85 f3 STA &f3 ; height_to_check &17b6 a9 00 LDA #&00 &17b8 85 60 STA &60 ; allow_loading # Set to zero to allow loading &17ba 85 3b STA &3b ; scrolling_direction &17bc 85 4a STA &4a ; unused # Unused variable &17be 85 86 STA &86 ; player_is_falling # Set to zero to indicate player is not falling &17c0 a5 0c LDA &0c ; player_tile_x_fraction &17c2 85 eb STA &eb ; player_tile_x_fraction_for_climbing &17c4 20 bb 23 JSR &23bb ; use_player_position &17c7 a9 03 LDA #&03 ; y_fraction_offset # Check chunks underneath player &17c9 a2 04 LDX #&04 ; width &17cb 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns carry set if obstacle, i.e. player supported &17ce 08 PHP ; processor status &17cf 68 PLA ; processor status &17d0 29 01 AND #&01 ; CARRY &17d2 85 8e STA &8e ; player_is_supported # Set to non-zero if player if supported &17d4 a0 00 LDY #&00 &17d6 b1 00 LDA (&00),Y ; tile_address &17d8 c9 74 CMP #&74 ; TILE_HEATONITE_SPIKES &17da f0 04 BEQ &17e0 ; is_spike &17dc c9 51 CMP #&51 ; TILE_ROCK_SPIKES &17de d0 04 BNE &17e4 ; not_spike ; is_spike &17e0 a9 03 LDA #&03 ; KILLED_BY_A_SPIKE &17e2 85 16 STA &16 ; player_killed # Kill the player (touched spikes) ; not_spike &17e4 20 bb 23 JSR &23bb ; use_player_position &17e7 20 9c 16 JSR &169c ; check_vertical_range_of_chunks_from_left # Check for obstacles to left of player &17ea 85 52 STA &52 ; player_is_blocked_to_left # Non-zero if player is blocked to left &17ec a5 4b LDA &4b ; vertical_chunk_check_results &17ee 85 53 STA &53 ; player_feet_blocked_to_left # Store whether there is a slope to the left &17f0 20 bb 23 JSR &23bb ; use_player_position &17f3 a9 03 LDA #&03 ; x_fraction_offset &17f5 20 9e 16 JSR &169e ; check_vertical_range_of_chunks # Check for obstacles to right of player &17f8 85 51 STA &51 ; player_is_blocked_to_right # Non-zero if player is blocked to right ; consider_moving_madrag &17fa ad 5a 06 LDA &065a ; objects_tile_y + &24 (OBJECT_FIRST_EGG) # Have either of the Madrag's eggs moved? &17fd c9 34 CMP #&34 &17ff d0 15 BNE &1816 ; set_madrag_moving &1801 ad 5b 06 LDA &065b ; objects_tile_x + &25 (OBJECT_SECOND_EGG) &1804 c9 34 CMP #&34 &1806 d0 0e BNE &1816 ; set_madrag_moving &1808 ad e0 05 LDA &05e0 ; objects_tile_x + &24 (OBJECT_FIRST_EGG) &180b c9 21 CMP #&21 # If the first egg isn't at (&21, &34), &180d d0 07 BNE &1816 ; set_madrag_moving &180f ad e1 05 LDA &05e1 ; objects_tile_x + &25 (OBJECT_SECOND_EGG) &1812 c9 20 CMP #&20 # or the second egg isn't at (&20, &34), &1814 f0 05 BEQ &181b ; skip_setting_madrag_moving ; set_madrag_moving &1816 a9 01 LDA #&01 &1818 8d ee 07 STA &07ee ; madrag_eggs_disturbed # Set to non-zero to indicate Madrag's eggs have moved ; skip_setting_madrag_moving &181b ad ef 07 LDA &07ef ; stolen_tiru_stun_cooldown &181e f0 03 BEQ &1823 ; consider_moving_tardis &1820 ce ef 07 DEC &07ef ; stolen_tiru_stun_cooldown ; consider_moving_tardis &1823 a5 0a LDA &0a ; player_x &1825 c9 50 CMP #&50 # Is the player at (&50, &11) (left of security code room)? &1827 d0 09 BNE &1832 ; skip_moving_tardis &1829 a5 0b LDA &0b ; player_y &182b c9 11 CMP #&11 &182d d0 03 BNE &1832 ; skip_moving_tardis &182f 8d ea 07 STA &07ea ; tardis_location # If so, set to non-zero to move TARDIS to unmapped area ; skip_moving_tardis &1832 20 17 17 JSR &1717 ; check_keyboard &1835 a9 00 LDA #&00 &1837 a6 0d LDX &0d ; player_relative_y_fraction &1839 d0 02 BNE &183d ; not_at_top_of_tile &183b a9 80 LDA #&80 ; not_at_top_of_tile &183d 85 da STA &da ; top_of_tile_offset &183f a5 30 LDA &30 ; player_tile_address_low # Calculate the tile address for row above the player &1841 38 SEC &1842 e5 da SBC &da ; top_of_tile_offset &1844 85 00 STA &00 ; tile_address_low &1846 a5 31 LDA &31 ; player_tile_address_high &1848 e9 00 SBC #&00 &184a 85 01 STA &01 ; tile_address_high &184c a2 02 LDX #&02 # If moving right, consider the tile two right of player &184e a0 00 LDY #&00 &1850 a5 41 LDA &41 ; player_second_movement_key &1852 c9 e1 CMP #&e1 ; Z &1854 d0 03 BNE &1859 ; left_not_pressed &1856 a2 ff LDX #&ff # If moving left, consider the tile one left of player &1858 88 DEY ; &ff ; left_not_pressed &1859 8a TXA &185a 18 CLC &185b 65 00 ADC &00 ; tile_address_low &185d 85 00 STA &00 ; tile_address_low &185f 98 TYA &1860 65 01 ADC &01 ; tile_address_high &1862 85 01 STA &01 ; tile_address_high &1864 a0 00 LDY #&00 &1866 b1 00 LDA (&00),Y ; tile_address &1868 c9 9f CMP #&9f ; TILE_PASS_CARD_READER # Does that tile contain a pass card reader? &186a d0 10 BNE &187c ; not_pass_card_reader &186c a2 05 LDX #&05 ; check_for_pass_card_loop &186e bd dd 07 LDA &07dd,X ; inventory &1871 c9 1e CMP #&1e ; OBJECT_PASS_CARD + 1 # If so, is the player carrying the pass card? &1873 f0 07 BEQ &187c ; not_pass_card_reader &1875 ca DEX &1876 10 f6 BPL &186e ; check_for_pass_card_loop &1878 86 41 STX &41 ; player_second_movement_key # If not, prevent the player from moving toward reader &187a 86 84 STX &84 ; player_movement_key # by setting movement key variables to zero ; not_pass_card_reader &187c a5 41 LDA &41 ; player_second_movement_key &187e c9 e1 CMP #&e1 ; Z &1880 f0 0c BEQ &188e ; set_last_player_second_movement_key &1882 c9 c2 CMP #&c2 ; X &1884 f0 08 BEQ &188e ; set_last_player_second_movement_key &1886 c9 c8 CMP #&c8 ; ' &1888 f0 04 BEQ &188e ; set_last_player_second_movement_key &188a c9 e8 CMP #&e8 ; / &188c d0 03 BNE &1891 ; skip_set_last_player_second_movement_key ; set_last_player_second_movement_key &188e 8d 44 17 STA &1744 ; last_player_second_movement_key ; skip_set_last_player_second_movement_key &1891 a0 00 LDY #&00 &1893 b1 30 LDA (&30),Y ; player_tile_address &1895 c9 23 CMP #&23 ; TILE_CRYOSTATIC_CHAMBER_BOTTOM # Is the player at a Cryostatic Chamber? &1897 d0 30 BNE &18c9 ; not_cryostatic_chamber &1899 a2 07 LDX #&07 ; find_free_slot_loop &189b bd d5 07 LDA &07d5,X ; used_cryostatic_chambers_tile_address_high &189e f0 10 BEQ &18b0 ; score_for_using_cryostatic_chamber &18a0 c5 31 CMP &31 ; player_tile_address_high # If so, has that chamber already been visited? &18a2 d0 07 BNE &18ab ; consider_next_slot &18a4 bd c4 07 LDA &07c4,X ; used_cryostatic_chambers_tile_address_low &18a7 c5 30 CMP &30 ; player_tile_address_low &18a9 f0 19 BEQ &18c4 ; skip_scoring_for_using_cryostatic_chamber ; consider_next_slot &18ab ca DEX &18ac 10 ed BPL &189b ; find_free_slot_loop &18ae 30 19 BMI &18c9 ; not_cryostatic_chamber # Always branches ; score_for_using_cryostatic_chamber &18b0 a5 30 LDA &30 ; player_tile_address_low # Note that the chamber has been visited &18b2 9d c4 07 STA &07c4,X ; used_cryostatic_chambers_tile_address_low &18b5 a5 31 LDA &31 ; player_tile_address_high &18b7 9d d5 07 STA &07d5,X ; used_cryostatic_chambers_tile_address_high &18ba bd ac 07 LDA &07ac,X ; cryostatic_chambers_score_low # Increase score for visiting chamber &18bd 85 70 STA &70 ; score_low &18bf bd b4 07 LDA &07b4,X ; cryostatic_chambers_score_high &18c2 85 71 STA &71 ; score_high ; skip_scoring_for_using_cryostatic_chamber &18c4 20 f6 2e JSR &2ef6 ; backup_player_state # Use chamber's position for subsequent regenerations &18c7 e6 60 INC &60 ; allow_loading # Set to non-zero to suppress loading ; not_cryostatic_chamber &18c9 a2 ea LDX #&ea ; NOP # Enable delay by default &18cb a5 4b LDA &4b ; vertical_chunk_check_results # Zero if climbable &18cd d0 27 BNE &18f6 ; not_on_conveyor_or_lift &18cf a5 0b LDA &0b ; player_y &18d1 c9 14 CMP #&14 # Is the player on the horizontal conveyor? &18d3 f0 06 BEQ &18db ; is_on_conveyor_or_lift &18d5 a5 0a LDA &0a ; player_x &18d7 c9 40 CMP #&40 # or the vertical lift? &18d9 d0 1b BNE &18f6 ; not_on_conveyor_or_lift ; is_on_conveyor_or_lift &18db a5 41 LDA &41 ; player_second_movement_key &18dd d0 07 BNE &18e6 ; skip_overriding_key &18df ad 44 17 LDA &1744 ; last_player_second_movement_key &18e2 85 41 STA &41 ; player_second_movement_key &18e4 85 84 STA &84 ; player_movement_key ; skip_overriding_key &18e6 ad ec 05 LDA &05ec ; objects_tile_x + &30 (OBJECT_POWER_CELL) &18e9 c9 42 CMP #&42 # If so, is the power cell at (&42, &13) (right of lift)? &18eb d0 09 BNE &18f6 ; not_quick_conveyor_or_lift &18ed ad 66 06 LDA &0666 ; objects_tile_y + &30 (OBJECT_POWER_CELL) &18f0 c9 13 CMP #&13 &18f2 d0 02 BNE &18f6 ; not_quick_conveyor_or_lift &18f4 a2 60 LDX #&60 ; RTS # If so, disable delay to make conveyor or lift quicker ; not_quick_conveyor_or_lift ; not_on_conveyor_or_lift &18f6 8e 54 09 STX &0954 ; delay_between_frames &18f9 ad fb 07 LDA &07fb ; reactor_meltdown_timer_high # Non-zero if reactor was detonated &18fc f0 10 BEQ &190e ; not_killed_by_radiation &18fe a5 0a LDA &0a ; player_x &1900 c9 64 CMP #&64 # If the player is below and right of (&64, &22), &1902 90 0a BCC &190e ; not_killed_by_radiation # i.e. in the large cave with the reactor, &1904 a5 0b LDA &0b ; player_y &1906 c9 22 CMP #&22 &1908 90 04 BCC &190e ; not_killed_by_radiation &190a a9 08 LDA #&08 ; KILLED_BY_RADIATION &190c 85 16 STA &16 ; player_killed # Kill the player (too close to detonated reactor) ; not_killed_by_radiation &190e 20 54 09 JSR &0954 ; delay_between_frames # Slow the game down unless on quick conveyor or lift &1911 20 be 0f JSR &0fbe ; unplot_player &1914 a5 40 LDA &40 ; player_movement_flags &1916 29 01 AND #&01 ; PLAYER_FLAGS_MOVING_RIGHT # If the player was moving right, &1918 d0 0a BNE &1924 ; move_player_right &191a 24 40 BIT &40 ; player_movement_flags # V set if PLAYER_FLAGS_JUMPING set &191c 70 2f BVS &194d ; not_moving_right &191e a5 41 LDA &41 ; player_second_movement_key &1920 c9 c2 CMP #&c2 ; X # or if the player wasn't jumping but wants to move right, &1922 d0 29 BNE &194d ; not_moving_right ; move_player_right &1924 a5 51 LDA &51 ; player_is_blocked_to_right # Non-zero if player blocked to right &1926 d0 25 BNE &194d ; not_moving_right # Don't move right if blocked to right &1928 20 6b 0d JSR &0d6b ; scroll_right &192b a2 08 LDX #&08 ; &0008 # Move right two pixels &192d a0 00 LDY #&00 &192f 20 a4 14 JSR &14a4 ; add_XY_to_player_screen_address &1932 a9 01 LDA #&01 ; PLAYER_FLAGS_MOVING_RIGHT &1934 85 3b STA &3b ; scrolling_direction # Scroll right &1936 05 40 ORA &40 ; player_movement_flags &1938 85 40 STA &40 ; player_movement_flags &193a e6 0c INC &0c ; player_tile_x_fraction # Move right a fraction &193c a5 0c LDA &0c ; player_tile_x_fraction &193e 29 07 AND #&07 &1940 d0 0b BNE &194d ; not_next_tile_right &1942 85 0c STA &0c ; player_tile_x_fraction &1944 e6 0a INC &0a ; player_x &1946 a2 01 LDX #&01 ; &0001 # Move right a tile &1948 a0 00 LDY #&00 &194a 20 2f 1e JSR &1e2f ; add_XY_to_player_tile_address ; not_next_tile_right ; not_moving_right &194d a5 40 LDA &40 ; player_movement_flags &194f 29 02 AND #&02 ; PLAYER_FLAGS_MOVING_LEFT # If the player was moving left, &1951 d0 0a BNE &195d ; move_player_left &1953 24 40 BIT &40 ; player_movement_flags # V set if PLAYER_FLAGS_JUMPING set &1955 70 35 BVS &198c ; not_moving_left &1957 a5 41 LDA &41 ; player_second_movement_key &1959 c9 e1 CMP #&e1 ; Z # or if the player wasn't jumping but wants to move left, &195b d0 2f BNE &198c ; not_moving_left ; move_player_left &195d a5 52 LDA &52 ; player_is_blocked_to_left # Non-zero if player blocked to left &195f d0 2b BNE &198c ; not_moving_left # Don't move left if blocked to left &1961 a5 53 LDA &53 ; player_feet_blocked_to_left &1963 85 4b STA &4b ; vertical_chunk_check_results # Used at &19b7 to move player up slope &1965 20 ac 0d JSR &0dac ; scroll_left &1968 a2 f8 LDX #&f8 ; &fff8 # Move left two pixels &196a a0 ff LDY #&ff &196c 20 a4 14 JSR &14a4 ; add_XY_to_player_screen_address &196f a9 ff LDA #&ff &1971 85 3b STA &3b ; scrolling_direction # Scroll left &1973 a5 40 LDA &40 ; player_movement_flags &1975 09 02 ORA #&02 ; PLAYER_FLAGS_MOVING_LEFT &1977 85 40 STA &40 ; player_movement_flags &1979 c6 0c DEC &0c ; player_tile_x_fraction # Move left a fraction &197b a5 0c LDA &0c ; player_tile_x_fraction &197d 10 0d BPL &198c ; not_next_tile_left &197f a9 07 LDA #&07 &1981 85 0c STA &0c ; player_tile_x_fraction &1983 c6 0a DEC &0a ; player_x &1985 a2 ff LDX #&ff ; &ffff # Move left a tile &1987 a0 ff LDY #&ff &1989 20 2f 1e JSR &1e2f ; add_XY_to_player_tile_address ; not_next_tile_left ; not_moving_left &198c a5 30 LDA &30 ; player_tile_address_low &198e 85 d8 STA &d8 ; player_middle_tile_address_low &1990 a5 31 LDA &31 ; player_tile_address_high &1992 85 d9 STA &d9 ; player_middle_tile_address_high &1994 a6 0a LDX &0a ; player_x &1996 a5 0c LDA &0c ; player_tile_x_fraction &1998 18 CLC &1999 69 03 ADC #&03 # Calculate position of middle of player &199b c9 08 CMP #&08 &199d 90 07 BCC &19a6 ; not_next_tile_down &199f e8 INX &19a0 e6 d8 INC &d8 ; player_middle_tile_address_low &19a2 d0 02 BNE &19a6 ; skip_page &19a4 e6 d9 INC &d9 ; player_middle_tile_address_high ; skip_page ; not_next_tile_down &19a6 86 d6 STX &d6 ; player_middle_tile_x &19a8 29 07 AND #&07 &19aa 85 da STA &da ; player_middle_tile_x_fraction &19ac a5 0b LDA &0b ; player_y &19ae 85 d7 STA &d7 ; player_middle_tile_y &19b0 20 bb 23 JSR &23bb ; use_player_position &19b3 a5 3b LDA &3b ; scrolling_direction &19b5 f0 04 BEQ &19bb ; not_walking_up_slope &19b7 a5 4b LDA &4b ; vertical_chunk_check_results # Negative if obstacle at foot level &19b9 30 28 BMI &19e3 ; move_player_up # Move the player up if walking up a slope ; not_walking_up_slope &19bb a5 40 LDA &40 ; player_movement_flags &19bd 29 04 AND #&04 ; PLAYER_FLAGS_MOVING_UP # If the player is moving up, &19bf d0 22 BNE &19e3 ; move_player_up &19c1 a5 84 LDA &84 ; player_movement_key &19c3 c9 c8 CMP #&c8 ; ' # If the player wants to move up &19c5 d0 5d BNE &1a24 ; not_moving_up &19c7 a9 00 LDA #&00 &19c9 85 40 STA &40 ; player_movement_flags # Set to zero to indicate not jumping or falling &19cb a2 05 LDX #&05 ; width &19cd 20 fa 14 JSR &14fa ; check_if_position_is_climbable # Returns carry clear if climbable &19d0 90 11 BCC &19e3 ; move_player_up &19d2 20 bb 23 JSR &23bb ; use_player_position &19d5 20 24 15 JSR &1524 ; check_if_player_is_on_antigravity_mat # Returns carry set if player is on mat &19d8 b0 09 BCS &19e3 ; move_player_up # Tile containing antigravity mat is considered climbable &19da a9 03 LDA #&03 ; y_fraction_offset &19dc a2 05 LDX #&05 ; width &19de 20 fc 14 JSR &14fc ; check_if_offset_position_is_climbable # Returns carry clear if climbable &19e1 b0 41 BCS &1a24 ; not_moving_up # Can't move up except on climbable tiles ; move_player_up &19e3 20 bb 23 JSR &23bb ; use_player_position &19e6 a9 02 LDA #&02 ; y_fraction_offset &19e8 a2 04 LDX #&04 ; width &19ea 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns A = chunk type of last or failed chunk &19ed c9 50 CMP #&50 ; CHUNK_DOWNWARDS_CLIMBABLE_PLATFORM &19ef f0 33 BEQ &1a24 ; not_moving_up # Can't climb directly up from diagonal platform &19f1 a5 40 LDA &40 ; player_movement_flags &19f3 29 43 AND #&43 ; PLAYER_FLAGS_JUMPING | PLAYER_FLAGS_MOVING_LEFT | PLAYER_FLAGS_MOVING_RIGHT &19f5 d0 06 BNE &19fd ; skip_check # If the player is climbing up or down, not jumping, &19f7 a5 0c LDA &0c ; player_tile_x_fraction &19f9 c9 03 CMP #&03 &19fb b0 27 BCS &1a24 ; not_moving_up # the player can only climb centre of ladder ; skip_check &19fd 20 46 14 JSR &1446 ; check_for_hatch # Returns carry set if hatch present &1a00 b0 22 BCS &1a24 ; not_moving_up # Player can't climb through hatch &1a02 a2 80 LDX #&80 &1a04 86 8f STX &8f ; player_is_climbing # Set to non-zero to indicate player is climbing &1a06 a0 fd LDY #&fd ; &fd80 # Move up a group &1a08 20 a4 14 JSR &14a4 ; add_XY_to_player_screen_address &1a0b c6 0d DEC &0d ; player_relative_y_fraction &1a0d 30 03 BMI &1a12 ; next_tile_up &1a0f 4c c0 1a JMP &1ac0 ; not_moving_down ; next_tile_up &1a12 a9 03 LDA #&03 &1a14 85 0d STA &0d ; player_relative_y_fraction &1a16 c6 0b DEC &0b ; player_y &1a18 c6 3a DEC &3a ; player_relative_y &1a1a a2 80 LDX #&80 ; &ff80 # Move up a tile &1a1c a0 ff LDY #&ff &1a1e 20 2f 1e JSR &1e2f ; add_XY_to_player_tile_address &1a21 4c c0 1a JMP &1ac0 ; not_moving_down ; not_moving_up &1a24 20 bb 23 JSR &23bb ; use_player_position &1a27 a2 04 LDX #&04 ; width &1a29 a9 03 LDA #&03 ; y_fraction_offset # Consider what is underneath the player &1a2b 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns A = chunk type of last or failed chunk &1a2e 85 00 STA &00 ; chunk_beneath_player &1a30 c9 40 CMP #&40 ; CHUNK_FIRST_CLIMBABLE &1a32 90 21 BCC &1a55 ; check_for_more_support # Branch if obstacle &1a34 c9 60 CMP #&60 ; CHUNK_FIRST_BACKGROUND &1a36 90 07 BCC &1a3f ; is_above_climbable_tile # Branch if climbable &1a38 20 24 15 JSR &1524 ; check_if_player_is_on_antigravity_mat # Returns carry set if player is on mat &1a3b b0 4a BCS &1a87 ; check_if_pressing_down # Only fall onto mat if player is pressing down &1a3d 90 3e BCC &1a7d ; consider_moving_down # Always branches ; is_above_climbable_tile &1a3f a5 40 LDA &40 ; player_movement_flags &1a41 29 03 AND #&03 ; PLAYER_FLAGS_MOVING_LEFT | PLAYER_FLAGS_MOVING_RIGHT &1a43 d0 38 BNE &1a7d ; consider_moving_down &1a45 24 40 BIT &40 ; player_movement_flags # V set if PLAYER_FLAGS_JUMPING set &1a47 70 34 BVS &1a7d ; consider_moving_down &1a49 a5 0c LDA &0c ; player_tile_x_fraction # If the player isn't moving horizontally or jumping, &1a4b c9 03 CMP #&03 &1a4d 90 2e BCC &1a7d ; consider_moving_down # and the player isn't in the centre of the tile &1a4f a9 00 LDA #&00 &1a51 85 eb STA &eb ; player_tile_x_fraction_for_climbing # Set to zero to stop player climbing misaligned ladder &1a53 f0 6b BEQ &1ac0 ; not_moving_down # Always branches ; check_for_more_support &1a55 a5 51 LDA &51 ; player_is_blocked_to_right # Non-zero if player blocked to right &1a57 05 52 ORA &52 ; player_is_blocked_to_left # Non-zero if player blocked to left &1a59 f0 65 BEQ &1ac0 ; not_moving_down &1a5b 20 bb 23 JSR &23bb ; use_player_position &1a5e e6 48 INC &48 ; this_tile_x_fraction &1a60 e6 48 INC &48 ; this_tile_x_fraction # Move right two fractions &1a62 a5 48 LDA &48 ; this_tile_x_fraction &1a64 c9 08 CMP #&08 &1a66 90 0a BCC &1a72 ; not_next_tile_right &1a68 a9 00 LDA #&00 &1a6a 85 48 STA &48 ; this_tile_x_fraction &1a6c e6 46 INC &46 ; this_tile_address_low # Move right a tile &1a6e d0 02 BNE &1a72 ; skip_page &1a70 e6 47 INC &47 ; this_tile_address_high ; skip_page ; not_next_tile_right &1a72 a2 01 LDX #&01 ; width &1a74 a9 03 LDA #&03 ; y_fraction_offset &1a76 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns carry set if obstacle (i.e. player supported) &1a79 90 18 BCC &1a93 ; move_player_down &1a7b b0 43 BCS &1ac0 ; not_moving_down # Always branches ; consider_moving_down &1a7d a5 8e LDA &8e ; player_is_supported # Zero if player isn't supported &1a7f f0 0c BEQ &1a8d ; move_player_down_if_not_supported # If the player isn't supported, &1a81 a5 40 LDA &40 ; player_movement_flags &1a83 29 08 AND #&08 ; PLAYER_FLAGS_MOVING_DOWN &1a85 d0 06 BNE &1a8d ; move_player_down_if_not_supported # or the player is moving down ; check_if_pressing_down &1a87 a5 84 LDA &84 ; player_movement_key &1a89 c9 e8 CMP #&e8 ; / # or the player wants to move down, &1a8b d0 33 BNE &1ac0 ; not_moving_down ; move_player_down_if_not_supported &1a8d a5 00 LDA &00 ; chunk_beneath_player # Is there an obstacle beneath the player? &1a8f c9 40 CMP #&40 ; CHUNK_FIRST_CLIMBABLE &1a91 90 2d BCC &1ac0 ; not_moving_down # Branch if obstacle ; move_player_down &1a93 e6 86 INC &86 ; player_is_falling # Set to non-zero to indicate player is falling &1a95 a5 0d LDA &0d ; player_tile_y_fraction &1a97 c9 03 CMP #&03 &1a99 f0 05 BEQ &1aa0 ; skip_checking_for_hatch &1a9b 20 46 14 JSR &1446 ; check_for_hatch # Returns carry set if hatch present &1a9e b0 20 BCS &1ac0 ; not_moving_down # Player can't move down through hatch ; skip_checking_for_hatch &1aa0 a2 80 LDX #&80 &1aa2 86 8f STX &8f ; player_is_climbing # Set to non-zero to indicate player is climbing &1aa4 a0 02 LDY #&02 ; &0280 # Move down a group &1aa6 20 a4 14 JSR &14a4 ; add_XY_to_player_screen_address &1aa9 e6 0d INC &0d ; player_tile_y_fraction # Move down a fraction &1aab a5 0d LDA &0d ; player_tile_y_fraction &1aad c9 04 CMP #&04 &1aaf d0 0f BNE &1ac0 ; not_next_tile_down &1ab1 a9 00 LDA #&00 &1ab3 85 0d STA &0d ; player_tile_y_fraction &1ab5 e6 0b INC &0b ; player_y &1ab7 e6 3a INC &3a ; player_relative_y &1ab9 a2 80 LDX #&80 ; &0080 # Move down a tile &1abb a0 00 LDY #&00 &1abd 20 2f 1e JSR &1e2f ; add_XY_to_player_tile_address ; not_next_tile_down ; not_moving_down &1ac0 ad e9 07 LDA &07e9 ; player_sprite &1ac3 c9 2a CMP #&2a ; SPRITE_PLAYER_DEAD &1ac5 d0 03 BNE &1aca ; not_dead_or_stunned # Player can't climb if stunned or dead &1ac7 4c 64 1b JMP &1b64 ; not_climbing ; not_dead_or_stunned &1aca a5 3b LDA &3b ; scrolling_direction # Zero if player is not moving left or right &1acc f0 0c BEQ &1ada ; set_player_sprite # Probably meant to be BEQ &1adc &1ace 85 13 STA &13 ; player_direction &1ad0 ce e9 07 DEC &07e9 ; player_sprite # Animate player walking &1ad3 10 0a BPL &1adf ; skip_wraparound &1ad5 a9 02 LDA #&02 ; SPRITE_PLAYER_FRAME_THREE &1ad7 8d e9 07 STA &07e9 ; player_sprite ; set_player_sprite &1ada d0 03 BNE &1adf ; skip_wraparound # Unnecessary code &1adc 8d e9 07 STA &07e9 ; player_sprite ; skip_wraparound &1adf a5 40 LDA &40 ; player_movement_flags &1ae1 29 40 AND #&40 ; PLAYER_FLAGS_JUMPING # Is the player jumping? &1ae3 f0 0e BEQ &1af3 ; consider_climbing &1ae5 ad c3 07 LDA &07c3 ; player_was_climbing_at_start_of_jump # Non-zero if player was climbing at start of jump &1ae8 d0 07 BNE &1af1 ; set_player_is_climbing # If so, keep player climbing &1aea a9 02 LDA #&02 ; SPRITE_PLAYER_FRAME_THREE # Otherwise, spread player's legs when jumping &1aec 8d e9 07 STA &07e9 ; player_sprite &1aef d0 6f BNE &1b60 ; stop_climbing # Always branches ; set_player_is_climbing &1af1 85 8f STA &8f ; player_is_climbing # Set to non-zero to indicate player is climbing ; consider_climbing &1af3 a5 8f LDA &8f ; player_is_climbing # Non-zero if player is climbing &1af5 f0 6d BEQ &1b64 ; not_climbing &1af7 a5 eb LDA &eb ; player_tile_x_fraction_for_climbing # If the player is climbing &1af9 c9 07 CMP #&07 &1afb f0 04 BEQ &1b01 ; can_climb &1afd c9 05 CMP #&05 &1aff b0 5f BCS &1b60 ; stop_climbing ; can_climb &1b01 a5 30 LDA &30 ; player_tile_address_low &1b03 85 01 STA &01 ; top_tile_address_low &1b05 a5 31 LDA &31 ; player_tile_address_high &1b07 85 02 STA &02 ; top_tile_address_high &1b09 a5 0c LDA &0c ; player_tile_x_fraction &1b0b c9 05 CMP #&05 &1b0d 90 06 BCC &1b15 ; not_next_tile_right &1b0f e6 01 INC &01 ; top_tile_address_low &1b11 d0 02 BNE &1b15 ; not_next_tile &1b13 e6 02 INC &02 ; top_tile_address_high ; not_next_tile_right &1b15 a9 00 LDA #&00 &1b17 a6 0d LDX &0d ; player_tile_y_fraction &1b19 f0 02 BEQ &1b1d ; skip_tile_address_offset &1b1b a9 80 LDA #&80 ; skip_tile_address_offset &1b1d 18 CLC &1b1e 65 01 ADC &01 ; top_tile_address_low &1b20 85 03 STA &03 ; bottom_tile_address_low &1b22 a5 02 LDA &02 ; top_tile_address_high &1b24 69 00 ADC #&00 &1b26 85 04 STA &04 ; bottom_tile_address_high &1b28 a0 00 LDY #&00 &1b2a b1 01 LDA (&01),Y ; top_tile_address # Consider the tiles for the top &1b2c 85 00 STA &00 ; top_tile &1b2e b1 03 LDA (&03),Y ; bottom_tile_address # and the bottom of the player &1b30 85 05 STA &05 ; bottom_tile &1b32 a2 0a LDX #&0a ; check_for_climbable_tiles_loop &1b34 bd c7 32 LDA &32c7,X ; climbable_tile_types &1b37 c5 00 CMP &00 ; top_tile # Are either of them climbable? &1b39 f0 09 BEQ &1b44 ; is_climbable_tile &1b3b c5 05 CMP &05 ; bottom_tile &1b3d f0 05 BEQ &1b44 ; is_climbable_tile &1b3f ca DEX &1b40 10 f2 BPL &1b34 ; check_for_climbable_tiles_loop &1b42 30 1c BMI &1b60 ; stop_climbing # If not, stop climbing; always branches ; is_climbable_tile &1b44 a9 40 LDA #&40 ; CHUNK_FIRST_CLIMBABLE # When checking, pass if climbable or background &1b46 8d 7c 16 STA &167c ; chunk_check_type &1b49 20 bb 23 JSR &23bb ; use_player_position &1b4c a2 04 LDX #&04 ; width &1b4e a9 03 LDA #&03 ; y_fraction_offset # Consider what is beneath the player &1b50 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns carry set if obstacle &1b53 b0 0b BCS &1b60 ; stop_climbing &1b55 a9 03 LDA #&03 ; SPRITE_PLAYER_CLIMBING &1b57 8d e9 07 STA &07e9 ; player_sprite &1b5a d0 08 BNE &1b64 ; not_climbing # Always branches ; unused # Unused code &1b5c a9 88 LDA #&88 ; PLAYER_FLAGS_FALLING | PLAYER_FLAGS_MOVING_DOWN &1b5e 85 40 STA &40 ; player_movement_flags ; stop_climbing &1b60 a9 00 LDA #&00 &1b62 85 8f STA &8f ; player_is_climbing # Set to zero to indicate player is not climbing ; not_climbing &1b64 a9 60 LDA #&60 ; CHUNK_FIRST_BACKGROUND # When checking, pass if background &1b66 8d 7c 16 STA &167c ; chunk_check_type &1b69 20 dd 23 JSR &23dd ; consider_object_handling_keys &1b6c 20 c1 0f JSR &0fc1 ; plot_player &1b6f a0 00 LDY #&00 # Use top tile if player not more than half way down &1b71 a5 0d LDA &0d ; player_tile_y_fraction &1b73 c9 02 CMP #&02 &1b75 90 02 BCC &1b79 ; skip_tile_address_offset &1b77 a0 80 LDY #&80 # Use bottom tile if player more than half way down ; skip_tile_address_offset &1b79 b1 d8 LDA (&d8),Y ; player_middle_tile_address &1b7b c9 d9 CMP #&d9 ; TILE_ALARM_SENSOR # Does that tile contain an alarm sensor? &1b7d f0 04 BEQ &1b83 ; consider_triggering_alarm &1b7f c9 bd CMP #&bd ; TILE_ALARM_SENSOR_AND_PLATFORM &1b81 d0 25 BNE &1ba8 ; not_triggered_alarm ; consider_triggering_alarm &1b83 a5 da LDA &da ; player_middle_tile_x_fraction &1b85 c9 02 CMP #&02 # If so, is the player in the middle of the tile? &1b87 90 1f BCC &1ba8 ; not_triggered_alarm &1b89 c9 07 CMP #&07 &1b8b f0 1b BEQ &1ba8 ; not_triggered_alarm &1b8d a2 e1 LDX #&e1 ; &33e1 = sound_12 &1b8f a0 33 LDY #&33 &1b91 20 fd 09 JSR &09fd ; play_sound # Play sound for triggering alarm &1b94 a5 0a LDA &0a ; player_x &1b96 c9 56 CMP #&56 # Is it one of the four sensors to the right? &1b98 b0 05 BCS &1b9f ; activate_prison_escort_controller # If so, trigger the prison escort controller &1b9a 20 c8 12 JSR &12c8 ; activate_security_code_room_controller # Otherwise, trigger the security code room controller &1b9d d0 09 BNE &1ba8 ; not_triggered_alarm ; activate_prison_escort_controller &1b9f a2 77 LDX #&77 # Set mover 4 to target tile (&77, &11) &1ba1 a0 11 LDY #&11 # i.e. the prison escort controller targeting the &1ba3 a9 04 LDA #&04 # right end of the corridor with the four sensors &1ba5 20 ce 12 JSR &12ce ; set_mover_A_to_target_tile_X_Y ; not_triggered_alarm &1ba8 a5 0a LDA &0a ; player_x &1baa c9 0e CMP #&0e # If the player isn't in the far left of the factory, &1bac 90 24 BCC &1bd2 ; not_suffocated &1bae a5 0b LDA &0b ; player_y &1bb0 c9 11 CMP #&11 # and the player isn't level with the TIRU, &1bb2 f0 1e BEQ &1bd2 ; not_suffocated &1bb4 c9 24 CMP #&24 # and the player isn't below the planet's surface, &1bb6 b0 1a BCS &1bd2 ; not_suffocated &1bb8 a0 00 LDY #&00 &1bba b1 30 LDA (&30),Y ; player_tile_address &1bbc 20 48 0e JSR &0e48 ; calculate_tile_chunks_data_address_for_tile_A &1bbf a0 02 LDY #&02 &1bc1 b1 32 LDA (&32),Y ; tile_chunks_data_address # is the player in a black tile? &1bc3 c9 60 CMP #&60 ; CHUNK_BLACK &1bc5 d0 0b BNE &1bd2 ; not_suffocated &1bc7 ad e2 07 LDA &07e2 ; inventory + 5 (HAND) # If so, and the player isn't holding the oxygen, &1bca c9 15 CMP #&15 ; OBJECT_OXYGEN + 1 &1bcc f0 04 BEQ &1bd2 ; not_suffocated &1bce a9 04 LDA #&04 ; KILLED_BY_NO_AIR &1bd0 85 16 STA &16 ; player_killed # Kill the player (no air) ; not_suffocated &1bd2 a5 0a LDA &0a ; player_x &1bd4 c9 51 CMP #&51 # Is the player at (&51, &11), (&52, &11) or (&53, &11)? &1bd6 90 0d BCC &1be5 ; skip_plotting_plot_security_code_symbol_choices &1bd8 c9 54 CMP #&54 &1bda b0 09 BCS &1be5 ; skip_plotting_plot_security_code_symbol_choices &1bdc a5 0b LDA &0b ; player_y &1bde c9 11 CMP #&11 &1be0 d0 03 BNE &1be5 ; skip_plotting_plot_security_code_symbol_choices &1be2 20 eb 11 JSR &11eb ; plot_security_code_symbol_choices # If so, plot choices in security code room ; skip_plotting_plot_security_code_symbol_choices &1be5 a5 9f LDA &9f ; player_action_key &1be7 f0 23 BEQ &1c0c ; set_last_key_for_non_autorepeat_actions &1be9 45 9e EOR &9e ; last_key_for_non_autorepeat_actions &1beb f0 21 BEQ &1c0e ; skip_setting_last_key_for_non_autorepeat_actions &1bed a5 9f LDA &9f ; player_action_key &1bef 85 9e STA &9e ; set_last_key_for_non_autorepeat_actions &1bf1 c9 a5 CMP #&a5 ; I &1bf3 d0 03 BNE &1bf8 ; i_not_pressed &1bf5 4c f5 1d JMP &1df5 ; inventory_screen ; i_not_pressed &1bf8 c9 d2 CMP #&d2 ; C &1bfa d0 03 BNE &1bff ; c_not_pressed &1bfc 4c 58 0a JMP &0a58 ; splinx_status_screen ; c_not_pressed &1bff c9 b5 CMP #&b5 ; U &1c01 d0 03 BNE &1c06 ; u_not_pressed &1c03 4c 14 12 JMP &1214 ; use_object ; u_not_pressed &1c06 a5 84 LDA &84 ; player_movement_key &1c08 c9 c9 CMP #&c9 ; ENTER &1c0a f0 6c BEQ &1c78 ; start_jump ; set_last_key_for_non_autorepeat_actions &1c0c 85 9e STA &9e ; last_key_for_non_autorepeat_actions ; skip_setting_last_key_for_non_autorepeat_actions &1c0e 20 bb 23 JSR &23bb ; use_player_position &1c11 a5 40 LDA &40 ; player_movement_flags &1c13 29 40 AND #&40 ; PLAYER_FLAGS_JUMPING # Is the player jumping? &1c15 f0 29 BEQ &1c40 ; not_jumping ; is_jumping &1c17 a2 04 LDX #&04 ; width &1c19 20 fa 14 JSR &14fa ; check_if_position_is_climbable # Returns A = chunk type &1c1c c9 40 CMP #&40 ; CHUNK_FIRST_CLIMBABLE &1c1e b0 05 BCS &1c25 ; continue_jump # Branch if climbable or background, i.e. not obstacle &1c20 a9 00 LDA #&00 # If the player has jumped into an obstacle, &1c22 85 40 STA &40 ; player_movement_flags # Set to zero to indicate not jumping or falling &1c24 60 RTS ; continue_jump &1c25 c6 85 DEC &85 ; jump_timer &1c27 a5 40 LDA &40 ; player_movement_flags &1c29 29 43 AND #&43 ; PLAYER_FLAGS_JUMPING | PLAYER_FLAGS_MOVING_LEFT | PLAYER_FLAGS_MOVING_RIGHT &1c2b a6 85 LDX &85 ; jump_timer &1c2d e0 05 CPX #&05 &1c2f b0 04 BCS &1c35 ; is_jumping_up &1c31 09 08 ORA #&08 ; PLAYER_FLAGS_MOVING_DOWN # Move down in second half of jump &1c33 d0 02 BNE &1c37 ; check_for_end_of_jump ; is_jumping_up &1c35 09 04 ORA #&04 ; PLAYER_FLAGS_MOVING_UP # Move up in first half of jump ; check_for_end_of_jump &1c37 e0 00 CPX #&00 # Is this the end of the jump? &1c39 d0 02 BNE &1c3d ; set_player_movement_flags # If so, clear vertical movement from flags &1c3b 29 03 AND #&03 ; PLAYER_FLAGS_MOVING_LEFT | PLAYER_FLAGS_MOVING_RIGHT ; set_player_movement_flags &1c3d 85 40 STA &40 ; player_movement_flags &1c3f 60 RTS ; not_jumping &1c40 a9 00 LDA #&00 &1c42 8d c2 07 STA &07c2 ; player_is_jumping # Set to zero to indicate player is not jumping &1c45 a5 40 LDA &40 ; player_movement_flags &1c47 85 91 STA &91 ; previous_player_movement_flags # Negative if PLAYER_FLAGS_FALLING set &1c49 10 02 BPL &1c4d ; not_falling &1c4b e6 90 INC &90 ; distance_fallen ; not_falling &1c4d 29 7c AND #&7c ; !(PLAYER_FLAGS_FALLING | PLAYER_FLAGS_MOVING_LEFT | PLAYER_FLAGS_MOVING_RIGHT) &1c4f 85 40 STA &40 ; player_movement_flags &1c51 a9 04 LDA #&04 ; y_fraction_offset &1c53 a2 04 LDX #&04 ; width &1c55 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns A = chunk type of last or failed chunk &1c58 c9 60 CMP #&60 ; CHUNK_FIRST_BACKGROUND &1c5a b0 0b BCS &1c67 ; start_or_continue_fall # Branch if background, not climbable or obstacle ; check_if_fall_was_deadly &1c5c a5 90 LDA &90 ; distance_fallen &1c5e c9 0f CMP #&0f &1c60 90 04 BCC &1c66 ; leave &1c62 a9 01 LDA #&01 ; KILLED_BY_A_FALL &1c64 85 16 STA &16 ; player_killed # Kill the player (falling too far) ; leave &1c66 60 RTS ; start_or_continue_fall &1c67 a5 86 LDA &86 ; player_is_falling # Zero if player is no longer falling &1c69 f0 f1 BEQ &1c5c ; check_if_fall_was_deadly &1c6b a5 91 LDA &91 ; previous_player_movement_flags # Negative if PLAYER_FLAGS_FALLING set &1c6d 30 04 BMI &1c73 ; not_starting_fall &1c6f a9 00 LDA #&00 &1c71 85 90 STA &90 ; distance_fallen ; not_starting_fall &1c73 a9 80 LDA #&80 ; PLAYER_FLAGS_FALLING &1c75 85 40 STA &40 ; player_movement_flags &1c77 60 RTS ; start_jump &1c78 ad c2 07 LDA &07c2 ; player_is_jumping # Non-zero if player is jumping &1c7b d0 15 BNE &1c92 ; set_player_is_jumping &1c7d a5 40 LDA &40 ; player_movement_flags &1c7f 29 c0 AND #&c0 ; PLAYER_FLAGS_FALLING | PLAYER_FLAGS_JUMPING &1c81 d0 0f BNE &1c92 ; set_player_is_jumping # If the player isn't already jumping or falling, &1c83 a5 8f LDA &8f ; player_is_climbing &1c85 8d c3 07 STA &07c3 ; player_was_climbing_at_start_of_jump &1c88 a9 09 LDA #&09 # Start jump &1c8a 85 85 STA &85 ; jump_timer &1c8c a5 40 LDA &40 ; player_movement_flags &1c8e 09 40 ORA #&40 ; PLAYER_FLAGS_JUMPING &1c90 85 40 STA &40 ; player_movement_flags ; set_player_is_jumping &1c92 8d c2 07 STA &07c2 ; player_is_jumping &1c95 4c 0c 1c JMP &1c0c ; set_last_key_for_non_autorepeat_actions ; restore_default_windows &1c98 a9 1a LDA #&1a ; restore default windows &1c9a 20 ee ff JSR &ffee ; OSWRCH &1c9d a5 20 LDA &20 ; screen_start_address_low &1c9f 8d 50 03 STA &0350 ; os_screen_start_address_low &1ca2 a5 21 LDA &21 ; screen_start_address_high &1ca4 8d 51 03 STA &0351 ; os_screen_start_address_low &1ca7 a9 1e LDA #&1e ; cursor home &1ca9 4c ee ff JMP &ffee ; OSWRCH ; plot_dead_or_stunned_player &1cac a9 80 LDA #&80 &1cae 85 f5 STA &f5 ; suppress_player_input # Set to non-zero to suppress player input ; drop_dead_or_stunned_player_loop &1cb0 a9 00 LDA #&00 &1cb2 85 40 STA &40 ; player_movement_flags # Set to zero to indicate player not jumping or falling &1cb4 20 b2 17 JSR &17b2 ; update_player &1cb7 20 bb 23 JSR &23bb ; use_player_position &1cba a2 04 LDX #&04 ; width &1cbc a9 03 LDA #&03 ; y_fraction_offset # Check chunks underneath player &1cbe 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns carry set if obstacle (i.e. player supported) &1cc1 90 ed BCC &1cb0 ; drop_dead_or_stunned_player_loop # Make dead player fall until supported &1cc3 20 be 0f JSR &0fbe ; unplot_player &1cc6 20 43 26 JSR &2643 ; plot_movers_and_objects &1cc9 a9 2a LDA #&2a ; SPRITE_PLAYER_DEAD &1ccb 8d e9 07 STA &07e9 ; player_sprite &1cce a5 3f LDA &3f ; player_screen_address_high &1cd0 18 CLC &1cd1 69 05 ADC #&05 ; &0500 = &0280 * 2 # Plot dead player two groups below usual position &1cd3 29 7f AND #&7f # Keep address within screen memory &1cd5 09 40 ORA #&40 &1cd7 85 3f STA &3f ; player_screen_address_high &1cd9 a2 c1 LDX #&c1 ; &33c1 = sound_8 &1cdb a0 33 LDY #&33 &1cdd 20 fd 09 JSR &09fd ; play_sound # Play sound for dead player &1ce0 4c c1 0f JMP &0fc1 ; plot_player ; unused # Unused entry point &1ce3 a9 80 LDA #&80 # Set to non-zero to suppress player input ; plot_unstunned_player &1ce5 85 f5 STA &f5 ; suppress_player_input &1ce7 20 be 0f JSR &0fbe ; unplot_player &1cea 20 43 26 JSR &2643 ; plot_movers_and_objects &1ced a9 00 LDA #&00 ; SPRITE_PLAYER &1cef 8d e9 07 STA &07e9 ; player_sprite &1cf2 a5 3f LDA &3f ; player_screen_address_high &1cf4 38 SEC &1cf5 e9 05 SBC #&05 ; &0500 = &0280 * 2 # Move up two groups to undo increase at &1cd1 &1cf7 29 7f AND #&7f # Keep address within screen memory &1cf9 09 40 ORA #&40 &1cfb 85 3f STA &3f ; player_screen_address_high &1cfd 4c c1 0f JMP &0fc1 ; plot_player ; kill_player &1d00 20 ac 1c JSR &1cac ; plot_dead_or_stunned_player &1d03 a0 02 LDY #&02 ; THROW_DOWN &1d05 20 50 24 JSR &2450 ; throw_or_drop_object # Returns carry clear if no object thrown or dropped &1d08 90 0f BCC &1d19 ; not_holding_object &1d0a a2 00 LDX #&00 ; drop_object_loop &1d0c 8a TXA &1d0d 48 PHA ; count &1d0e 20 c3 22 JSR &22c3 ; update_thrown_object # Update dropped object &1d11 68 PLA ; count &1d12 aa TAX &1d13 ca DEX &1d14 d0 f6 BNE &1d0c ; drop_object_loop &1d16 20 bf 20 JSR &20bf ; update_objects ; not_holding_object &1d19 a5 16 LDA &16 ; player_killed &1d1b c9 01 CMP #&01 ; KILLED_BY_A_FALL &1d1d d0 18 BNE &1d37 ; not_fall # If the player died by falling, &1d1f a0 0a LDY #&0a ; shudder_screen_loop &1d21 a2 05 LDX #&05 ; R5: Vertical total adjust register # Shudder the screen &1d23 98 TYA &1d24 20 7b 09 JSR &097b ; set_video_register &1d27 20 4a 09 JSR &094a ; wait_for_two_vsyncs &1d2a a2 05 LDX #&05 ; R5: Vertical total adjust register &1d2c a9 00 LDA #&00 &1d2e 20 7b 09 JSR &097b ; set_video_register &1d31 20 4a 09 JSR &094a ; wait_for_two_vsyncs &1d34 88 DEY &1d35 10 ea BPL &1d21 ; shudder_screen_loop ; not_fall &1d37 20 98 1c JSR &1c98 ; restore_default_windows &1d3a a6 16 LDX &16 ; player_killed &1d3c a0 00 LDY #&00 ; find_killer_loop &1d3e b9 4b 34 LDA &344b,Y ; killer_strings &1d41 c8 INY &1d42 c9 20 CMP #&20 ; " " &1d44 b0 f8 BCS &1d3e ; find_killer_loop &1d46 ca DEX &1d47 d0 f5 BNE &1d3e ; find_killer_loop &1d49 88 DEY &1d4a 98 TYA &1d4b 48 PHA ; string_offset &1d4c b9 4b 34 LDA &344b,Y ; killer_strings &1d4f 8d 56 1d STA &1d56 ; killer_string_x &1d52 20 82 09 JSR &0982 ; write_string &1d55 1f 01 0a ; TAB(killer_string_x, &0a) &1d58 08 ; move left one character &1d59 11 81 ; COLOUR 128 + 1 &1d5b 11 07 ; COLOUR 7 &1d5d 00 ; end of string &1d5e 68 PLA ; string_offset &1d5f a8 TAY ; write_killer_loop &1d60 c8 INY &1d61 b9 4b 34 LDA &344b,Y ; killer_strings &1d64 c9 20 CMP #&20 ; " " &1d66 90 06 BCC &1d6e ; finished_writing_killer &1d68 20 ee ff JSR &ffee ; OSWRCH &1d6b 4c 60 1d JMP &1d60 ; write_killer_loop ; finished_writing_killer &1d6e 20 82 09 JSR &0982 ; write_string &1d71 1f 05 0c ; TAB(&05, &0c) &1d74 63 61 75 73 65 73 20 74 68 65 ; "causes the" &1d7e 1f 01 0e ; TAB(&01, &0e) &1d81 7e ; "~" &1d82 00 ; end of string &1d83 a5 15 LDA &15 ; player_lives &1d85 c9 01 CMP #&01 &1d86 d0 01 BNE &1d8a ; not_end_of_game &1d88 60 RTS ; not_end_of_game &1d8a a9 06 LDA #&06 &1d8c 38 SEC &1d8d e5 15 SBC &15 ; player_lives &1d8f 48 PHA ; regeneration &1d90 18 CLC &1d91 69 30 ADC #&30 ; "0" &1d93 20 ee ff JSR &ffee ; OSWRCH # Write regeneration number &1d96 68 PLA ; regeneration &1d97 0a ASL A &1d98 aa TAX &1d99 bd 69 07 LDA &0769,X ; ordinal_suffixes - 2 &1d9c 20 ee ff JSR &ffee ; OSWRCH # Write regeneration suffix &1d9f bd 6a 07 LDA &076a,X ; ordinal_suffixes - 2 + 1 &1da2 20 ee ff JSR &ffee ; OSWRCH &1da5 20 82 09 JSR &0982 ; write_string &1da8 20 72 65 67 65 6e 65 72 61 74 69 6f 6e 21 ; " regeneration!" &1db6 00 ; end of string &1db7 a9 0e LDA #&0e ; delay_for_A &1db9 85 00 STA &00 ; count ; delay_outer_loop &1dbb a2 00 LDX #&00 ; delay_loop &1dbd a0 00 LDY #&00 ; delay_inner_loop &1dbf c8 INY &1dc0 d0 fd BNE &1dbf ; delay_inner_loop &1dc2 e8 INX &1dc3 d0 f8 BNE &1dbd ; delay_loop &1dc5 c6 00 DEC &00 ; count &1dc7 d0 f2 BNE &1dbb ; delay_outer_loop &1dc9 60 RTS ; write_hit_spc_to_play &1dca 20 82 09 JSR &0982 ; write_string &1dcd 1f 02 18 ; TAB(&02, &18) &1dd0 11 08 ; COLOUR 8 &1dd2 00 ; end of string ; write_hit_spc_to_play_without_tab &1dd3 20 82 09 JSR &0982 ; write_string &1dd6 48 69 74 20 53 50 43 20 74 6f 20 70 6c 61 79 21 ; "Hit SPC to play!" &1de6 00 ; end of string &1de7 a2 01 LDX #&01 ; R1: Number of characters per line &1de9 a9 50 LDA #&50 # Display screen &1deb 20 7b 09 JSR &097b ; set_video_register &1dee a9 0f LDA #&0f ; Flush buffers &1df0 a2 00 LDX #&00 ; Flush all buffers &1df2 4c f4 ff JMP &fff4 ; OSBYTE ; inventory_screen &1df5 20 b3 14 JSR &14b3 ; reset_screen &1df8 20 82 09 JSR &0982 ; write_string &1dfb 1f 05 14 ; TAB(&05, &14) &1dfe 11 03 ; COLOUR 3 &1e00 53 63 6f 72 65 20 3a ; "Score :" &1e07 00 ; end of string &1e08 20 ca 1d JSR &1dca ; write_hit_spc_to_play &1e0b ee 2e 1e INC &1e2e ; suppress_sprite_plotting # Set to non-zero to suppress plotting ; replot_inventory &1e0e 20 ef 24 JSR &24ef ; get_next_marker &1e11 20 3b 1e JSR &1e3b ; plot_inventory ; inventory_screen_loop &1e14 20 c3 22 JSR &22c3 ; update_thrown_object &1e17 20 bf 20 JSR &20bf ; update_objects &1e1a 20 dd 23 JSR &23dd ; consider_object_handling_keys &1e1d b0 ef BCS &1e0e ; replot_inventory # Plotting is temporarily re-enabled for inventory &1e1f 20 17 17 JSR &1717 ; check_keyboard &1e22 a5 84 LDA &84 ; player_movement_key &1e24 c9 e2 CMP #&e2 ; SPACE &1e26 d0 ec BNE &1e14 ; inventory_screen_loop &1e28 ce 2e 1e DEC &1e2e ; suppress_sprite_plotting # Set to zero to permit plotting &1e2b 4c 66 14 JMP &1466 ; reset_player_and_redraw_screen ; suppress_sprite_plotting &1e2e 00 ; add_XY_to_player_tile_address &1e2f 8a TXA &1e30 18 CLC &1e31 65 30 ADC &30 ; player_tile_address_low &1e33 85 30 STA &30 ; player_tile_address_low &1e35 98 TYA &1e36 65 31 ADC &31 ; player_tile_address_high &1e38 85 31 STA &31 ; player_tile_address_high &1e3a 60 RTS ; plot_inventory &1e3b a9 03 LDA #&03 ; Y &1e3d 20 90 1f JSR &1f90 ; set_text_colour &1e40 a9 1f LDA #&1f # TAB(&0c, &14) &1e42 20 ee ff JSR &ffee ; OSWRCH &1e45 a9 0c LDA #&0c &1e47 20 ee ff JSR &ffee ; OSWRCH &1e4a a9 14 LDA #&14 &1e4c 20 ee ff JSR &ffee ; OSWRCH &1e4f a6 70 LDX &70 ; score_low &1e51 a4 71 LDY &71 ; score_high &1e53 20 3e 0d JSR &0d3e ; write_number # Write score &1e56 a2 00 LDX #&00 ; plot_inventory_loop # For each position, &1e58 a9 1f LDA #&1f # TAB(&05, 1 + position * 3) &1e5a 20 ee ff JSR &ffee ; OSWRCH &1e5d a9 05 LDA #&05 &1e5f 20 ee ff JSR &ffee ; OSWRCH &1e62 8a TXA &1e63 48 PHA ; position &1e64 85 00 STA &00 ; position &1e66 0a ASL A &1e67 18 CLC &1e68 65 00 ADC &00 ; position &1e6a 69 01 ADC #&01 &1e6c 48 PHA ; y &1e6d 20 ee ff JSR &ffee ; OSWRCH &1e70 a0 01 LDY #&01 ; R &1e72 e4 17 CPX &17 ; selected_pocket &1e74 d0 02 BNE &1e78 ; not_selected &1e76 a0 06 LDY #&06 ; C ; not_selected &1e78 84 00 STY &00 ; colour &1e7a 98 TYA &1e7b 20 90 1f JSR &1f90 ; set_text_colour &1e7e e0 05 CPX #&05 &1e80 d0 0b BNE &1e8d ; not_hand &1e82 20 82 09 JSR &0982 ; write_string &1e85 48 61 6e 64 ; "Hand" &1e89 00 ; end of string &1e8a 4c 99 1e JMP &1e99 ; not_pocket ; not_hand &1e8d a9 66 LDA #&66 ; "f" &1e8f 20 ee ff JSR &ffee ; OSWRCH &1e92 8a TXA &1e93 18 CLC &1e94 69 30 ADC #&30 ; "0" &1e96 20 ee ff JSR &ffee ; OSWRCH ; not_pocket &1e99 a9 1f LDA #&1f # TAB(&0d, 1 + position * 3) &1e9b 20 ee ff JSR &ffee ; OSWRCH &1e9e a9 0d LDA #&0d &1ea0 20 ee ff JSR &ffee ; OSWRCH &1ea3 68 PLA ; y &1ea4 48 PHA ; y &1ea5 20 ee ff JSR &ffee ; OSWRCH &1ea8 a9 20 LDA #&20 ; " " # Clear box &1eaa 20 ee ff JSR &ffee ; OSWRCH &1ead 20 ee ff JSR &ffee ; OSWRCH &1eb0 a9 0a LDA #&0a ; move down one character &1eb2 20 ee ff JSR &ffee ; OSWRCH &1eb5 a9 08 LDA #&08 ; move left one character &1eb7 20 ee ff JSR &ffee ; OSWRCH &1eba 20 ee ff JSR &ffee ; OSWRCH &1ebd a9 20 LDA #&20 ; " " &1ebf 20 ee ff JSR &ffee ; OSWRCH &1ec2 20 ee ff JSR &ffee ; OSWRCH &1ec5 68 PLA ; y &1ec6 a8 TAY &1ec7 88 DEY &1ec8 a2 0d LDX #&0d &1eca a5 00 LDA &00 ; colour &1ecc 20 e4 1e JSR &1ee4 ; draw_box &1ecf a9 04 LDA #&04 ; B &1ed1 20 90 1f JSR &1f90 ; set_text_colour &1ed4 68 PLA ; position &1ed5 48 PHA ; position &1ed6 20 36 22 JSR &2236 ; plot_inventory_object &1ed9 68 PLA ; position &1eda aa TAX &1edb e8 INX &1edc e0 06 CPX #&06 &1ede f0 03 BEQ &1ee3 ; leave &1ee0 4c 58 1e JMP &1e58 ; plot_inventory_loop ; leave &1ee3 60 RTS ; draw_box # Called with A = colour, X Y = character coordinates &1ee4 48 PHA ; colour &1ee5 a9 12 LDA #&12 ; define graphics colour &1ee7 8d 05 03 STA &0305 ; os_graphics_window_left_high &1eea 20 ee ff JSR &ffee ; OSWRCH &1eed a9 00 LDA #&00 &1eef 20 ee ff JSR &ffee ; OSWRCH &1ef2 68 PLA ; colour &1ef3 20 ee ff JSR &ffee ; OSWRCH &1ef6 86 00 STX &00 ; coordinates &1ef8 84 02 STY &02 ; coordinates + 2 &1efa a9 00 LDA #&00 &1efc 85 01 STA &01 ; coordinates + 1 &1efe 85 03 STA &03 ; coordinates + 3 &1f00 8d 56 03 STA &0356 ; os_screen_memory_type # Set to zero to use 20k screen (&3000 - &7fff) &1f03 a9 20 LDA #&20 &1f05 38 SEC &1f06 e5 02 SBC &02 ; coordinates + 2 &1f08 85 02 STA &02 ; coordinates + 2 &1f0a a0 06 LDY #&06 # Multiply x coordinate by 64 &1f0c a2 00 LDX #&00 &1f0e 20 8e 0c JSR &0c8e ; scale_coordinates &1f11 a5 00 LDA &00 ; coordinates &1f13 38 SEC &1f14 e9 18 SBC #&18 &1f16 85 00 STA &00 ; coordinates &1f18 a5 01 LDA &01 ; coordinates + 1 &1f1a e9 00 SBC #&00 &1f1c 85 01 STA &01 ; coordinates + 1 &1f1e a0 05 LDY #&05 # Multiply y coordinate by 32 &1f20 a2 02 LDX #&02 &1f22 20 8e 0c JSR &0c8e ; scale_coordinates &1f25 a5 02 LDA &02 ; coordinates + 2 # Move to (x, y - 20) &1f27 38 SEC &1f28 e9 14 SBC #&14 &1f2a 85 02 STA &02 ; coordinates + 2 &1f2c a5 03 LDA &03 ; coordinates + 3 &1f2e e9 00 SBC #&00 &1f30 85 03 STA &03 ; coordinates + 3 &1f32 a0 04 LDY #&04 ; MOVE &1f34 20 6a 1f JSR &1f6a ; move_or_draw_line &1f37 a2 00 LDX #&00 ; draw_box_loop &1f39 8a TXA &1f3a 0a ASL A &1f3b a8 TAY &1f3c a5 00 LDA &00 ; coordinates &1f3e 18 CLC &1f3f 79 81 1f ADC &1f81,Y ; box_x_deltas &1f42 85 00 STA &00 ; coordinates &1f44 a5 01 LDA &01 ; coordinates + 1 &1f46 79 82 1f ADC &1f82,Y ; box_x_deltas + 1 &1f49 85 01 STA &01 ; coordinates + 1 &1f4b a5 02 LDA &02 ; coordinates + 2 &1f4d 18 CLC &1f4e 79 88 1f ADC &1f88,Y ; box_y_deltas &1f51 85 02 STA &02 ; coordinates + 2 &1f53 a5 03 LDA &03 ; coordinates + 3 &1f55 79 89 1f ADC &1f89,Y ; box_y_deltas + 1 &1f58 85 03 STA &03 ; coordinates + 3 &1f5a a0 05 LDY #&05 ; DRAW &1f5c 20 6a 1f JSR &1f6a ; move_or_draw_line # Draw to (+delta_x, +delta_y) &1f5f e8 INX &1f60 e0 04 CPX #&04 &1f62 d0 d5 BNE &1f39 ; draw_box_loop &1f64 a9 01 LDA #&01 &1f66 8d 56 03 STA &0356 ; os_screen_memory_type # Set to one to use 16k screen (&4000 - &7fff) &1f69 60 RTS ; move_or_draw_line # Called with Y = plot type &1f6a a9 19 LDA #&19 ; PLOT &1f6c 20 ee ff JSR &ffee ; OSWRCH &1f6f 98 TYA &1f70 20 ee ff JSR &ffee ; OSWRCH &1f73 a0 00 LDY #&00 ; write_plot_coordinates_loop &1f75 b9 00 00 LDA &0000,Y ; coordinates &1f78 20 ee ff JSR &ffee ; OSWRCH &1f7b c8 INY &1f7c c0 04 CPY #&04 &1f7e d0 f5 BNE &1f75 ; write_plot_coordinates_loop &1f80 60 RTS ; box_x_deltas &1f81 80 00 ; 128 &1f83 00 00 ; 0 &1f85 80 ff ; -128 &1f87 00 ; 0 # Final value is shared ; box_y_deltas &1f88 00 00 ; 0 &1f8a b0 ff ; -80 &1f8c 00 00 ; 0 &1f8e 50 00 ; 80 ; set_text_colour &1f90 48 PHA ; colour &1f91 a9 11 LDA #&11 ; ; define text colour &1f93 20 ee ff JSR &ffee ; OSWRCH &1f96 68 PLA ; colour &1f97 4c ee ff JMP &ffee ; OSWRCH ; unplot_object # Called with X = object to unplot &1f9a 38 SEC # Set carry to indicate unplotting &1f9b b0 01 BCS &1f9e ; plot_or_unplot_object ; plot_object # Called with X = object to plot &1f9d 18 CLC # Clear carry to indicate plotting ; plot_or_unplot_object &1f9e 8a TXA &1f9f 48 PHA ; object &1fa0 08 PHP ; plotting or unplotting &1fa1 bd 20 01 LDA &0120,X ; objects_screen_address_low &1fa4 85 04 STA &04 ; plot_screen_address_low &1fa6 bd 5d 01 LDA &015d,X ; objects_screen_address_high &1fa9 85 05 STA &05 ; plot_screen_address_high &1fab bd 0e 34 LDA &340e,X ; objects_type &1fae 29 3f AND #&3f ; OBJECT_TYPE_MASK &1fb0 c9 19 CMP #&19 ; OBJECT_TYPE_SPLINX # Don't plot Splinx as object except when scrolling vertically # actually CMP suppressed_object_type &1fb2 f0 10 BEQ &1fc4 ; leave_without_plotting &1fb4 18 CLC &1fb5 69 0b ADC #&0b ; SPRITE_FIRST_OBJECT &1fb7 aa TAX &1fb8 20 aa 23 JSR &23aa ; use_object_position &1fbb a9 00 LDA #&00 &1fbd 28 PLP ; plotting or unplotting &1fbe 20 de 0f JSR &0fde ; plot_or_unplot_sprite &1fc1 68 PLA ; object &1fc2 aa TAX &1fc3 60 RTS ; leave_without_plotting &1fc4 28 PLP ; plotting or unplotting &1fc5 68 PLA ; object &1fc6 aa TAX &1fc7 60 RTS ; get_object_width_and_height &1fc8 86 f9 STX &f9 ; object &1fca bd 0e 34 LDA &340e,X ; objects_type &1fcd 29 3f AND #&3f ; OBJECT_TYPE_MASK &1fcf 18 CLC &1fd0 69 0b ADC #&0b ; SPRITE_FIRST_OBJECT &1fd2 a8 TAY &1fd3 b9 46 32 LDA &3246,Y ; sprite_sizes_table &1fd6 4a LSR A &1fd7 4a LSR A &1fd8 4a LSR A &1fd9 38 SEC &1fda e9 01 SBC #&01 &1fdc 85 f8 STA &f8 ; object_width # Width in two-pixel columns minus one &1fde a2 02 LDX #&02 &1fe0 b9 2b 33 LDA &332b,Y ; sprite_heights_table &1fe3 f0 01 BEQ &1fe6 ; not_one_or_two_groups &1fe5 ca DEX ; not_one_or_two_groups &1fe6 29 80 AND #&80 &1fe8 f0 01 BEQ &1feb ; not_one_group &1fea ca DEX ; not_one_group &1feb 8a TXA &1fec a6 f9 LDX &f9 ; object &1fee 85 f9 STA &f9 ; object_height # Height in groups &1ff0 85 f3 STA &f3 ; height_to_check &1ff2 60 RTS ; calculate_object_screen_and_tile_addresses &1ff3 8a TXA &1ff4 48 PHA ; object &1ff5 bd 73 06 LDA &0673,X ; objects_tile_y_fraction &1ff8 85 03 STA &03 ; relative_y_fraction &1ffa bd bc 05 LDA &05bc,X ; objects_tile_x &1ffd 38 SEC &1ffe e5 0f SBC &0f ; screen_left_x &2000 85 37 STA &37 ; relative_x &2002 bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &2005 38 SEC &2006 e5 10 SBC &10 ; screen_x_fraction &2008 10 02 BPL &200c ; not_negative &200a c6 37 DEC &37 ; relative_x ; not_negative &200c 29 07 AND #&07 &200e 85 04 STA &04 ; relative_x_fraction &2010 bd 36 06 LDA &0636,X ; objects_tile_y &2013 4a LSR A &2014 aa TAX &2015 bd c7 30 LDA &30c7,X ; tile_y_to_relative_y_table &2018 69 00 ADC #&00 &201a 85 05 STA &05 ; relative_y &201c 20 9f 27 JSR &279f ; calculate_screen_address_from_relative_position &201f 68 PLA ; object &2020 aa TAX &2021 bd 0e 34 LDA &340e,X ; objects_type &2024 09 80 ORA #&80 ; OBJECT_PLOTTED # Set top bit to indicate object plotted &2026 9d 0e 34 STA &340e,X ; objects_type &2029 a5 00 LDA &00 ; screen_address_low &202b 9d 20 01 STA &0120,X ; objects_screen_address_low &202e a5 01 LDA &01 ; screen_address_high &2030 9d 5d 01 STA &015d,X ; objects_screen_address_high ; set_object_X_tile_address &2033 8a TXA &2034 48 PHA ; object &2035 bc 36 06 LDY &0636,X ; objects_tile_y &2038 bd bc 05 LDA &05bc,X ; objects_tile_x &203b aa TAX &203c 20 e7 0c JSR &0ce7 ; calculate_tile_address # Returns tile address in XY &203f 86 00 STX &00 ; tile_address_low &2041 84 01 STY &01 ; tile_address_high &2043 68 PLA ; object &2044 aa TAX &2045 a5 00 LDA &00 ; tile_address_low &2047 9d 1e 07 STA &071e,X ; objects_tile_address_low &204a a5 01 LDA &01 ; tile_address_high &204c 9d 9a 01 STA &019a,X ; objects_tile_address_high &204f 60 RTS ; check_if_object_is_on_screen &2050 bd bc 05 LDA &05bc,X ; objects_tile_x &2053 c5 19 CMP &19 ; screen_left_tile_x &2055 90 28 BCC &207f ; leave_with_carry_set &2057 d0 07 BNE &2060 ; skip_left_fraction_check &2059 bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &205c c5 1b CMP &1b ; screen_left_tile_x_fraction &205e 90 1f BCC &207f ; leave_with_carry_set ; skip_left_fraction_check &2060 bd bc 05 LDA &05bc,X ; objects_tile_x &2063 c5 1a CMP &1a ; screen_right_tile_x &2065 f0 02 BEQ &2069 ; consider_fraction &2067 b0 16 BCS &207f ; leave_with_carry_set ; consider_fraction &2069 d0 07 BNE &2072 ; skip_right_fraction_check &206b bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &206e c5 1c CMP &1c ; screen_right_tile_x_fraction &2070 b0 0d BCS &207f ; leave_with_carry_set ; skip_right_fraction_check &2072 bd 36 06 LDA &0636,X ; objects_tile_y &2075 c5 0e CMP &0e ; screen_top_y &2077 90 06 BCC &207f ; leave_with_carry_set &2079 c5 18 CMP &18 ; screen_bottom_y &207b b0 02 BCS &207f ; leave_with_carry_set &207d 18 CLC # Leave with carry clear to indicate object is on screen &207e 60 RTS ; leave_with_carry_set &207f 38 SEC # Leave with carry clear to indicate object is not on screen &2080 60 RTS ; circuit_boards_to_stop_factory &2081 00 ; OBJECT_TYPE_MARKER_1 # Used as dummy; slot must be empty to stop factory &2082 04 ; OBJECT_TYPE_CIRCUIT_BOARD_S &2083 05 ; OBJECT_TYPE_CIRCUIT_BOARD_T &2084 08 ; OBJECT_TYPE_CIRCUIT_BOARD_O &2085 09 ; OBJECT_TYPE_CIRCUIT_BOARD_P ; check_circuit_board_positions &2086 85 07 STA &07 ; y_faction &2088 a2 04 LDX #&04 ; OBJECT_FIRST_CIRCUIT_BOARD # For each circuit board, ; check_circuit_board_positions_loop &208a 8a TXA &208b 18 CLC &208c 69 01 ADC #&01 &208e cd e2 07 CMP &07e2 ; inventory + 5 (HAND) &2091 f0 26 BEQ &20b9 ; consider_next_circuit_board # If it isn't being held, &2093 bd 73 06 LDA &0673,X ; objects_tile_y_fraction &2096 c5 07 CMP &07 ; y_fraction &2098 d0 1f BNE &20b9 ; consider_next_circuit_board &209a bd 36 06 LDA &0636,X ; objects_tile_y &209d c9 1b CMP #&1b &209f d0 18 BNE &20b9 ; consider_next_circuit_board &20a1 bd bc 05 LDA &05bc,X ; objects_tile_x &20a4 c9 0e CMP #&0e # is it between (&0e, &1b) and (&12, &01b)? &20a6 90 11 BCC &20b9 ; consider_next_circuit_board # i.e. in the factory control panel? &20a8 c9 13 CMP #&13 &20aa b0 0d BCS &20b9 ; consider_next_circuit_board &20ac 38 SEC &20ad e9 0e SBC #&0e &20af a8 TAY &20b0 b9 60 07 LDA &0760,Y ; control_panel_boards_object &20b3 10 04 BPL &20b9 ; consider_next_circuit_board &20b5 8a TXA &20b6 99 60 07 STA &0760,Y ; control_panel_boards_object # If so, store in slot corresponding to position ; consider_next_circuit_board &20b9 e8 INX &20ba e0 0d CPX #&0d ; OBJECT_LAST_CIRCUIT_BOARD + 1 &20bc d0 cc BNE &208a ; check_circuit_board_positions_loop &20be 60 RTS ; update_objects &20bf a9 ff LDA #&ff &20c1 a2 04 LDX #&04 ; initialise_control_panel_boards_object &20c3 9d 60 07 STA &0760,X ; control_panel_boards_object # Set to negative to indicate no board in slot &20c6 9d 66 07 STA &0766,X ; control_panel_boards_shuffle # Set to negative to indicate board aligned with slot &20c9 ca DEX &20ca 10 f7 BPL &20c3 ; initialise_control_panel_boards_object &20cc a9 01 LDA #&01 &20ce 20 86 20 JSR &2086 ; check_circuit_board_positions &20d1 a9 02 LDA #&02 &20d3 20 86 20 JSR &2086 ; check_circuit_board_positions &20d6 a2 04 LDX #&04 &20d8 86 00 STX &00 ; out_of_place_circuit_boards ; check_control_panel_boards_object_loop # For each slot in the control panel, &20da bd 60 07 LDA &0760,X ; control_panel_boards_object # Positive if slot contains a circuit board &20dd 30 2e BMI &210d ; consider_next_control_panel_position &20df a8 TAY &20e0 b9 0e 34 LDA &340e,Y ; objects_type &20e3 29 3f AND #&3f ; OBJECT_TYPE_MASK &20e5 dd 81 20 CMP &2081,X ; circuit_boards_to_stop_factory # Is the circuit board the correct one to stop? &20e8 d0 02 BNE &20ec ; not_correct_board &20ea c6 00 DEC &00 ; out_of_place_circuit_boards ; not_correct_board &20ec b9 f9 05 LDA &05f9,Y ; objects_tile_x_fraction # Unnecessary code &20ef c9 03 CMP #&03 &20f1 b9 f9 05 LDA &05f9,Y ; objects_tile_x_fraction # Consider the x fraction of the board &20f4 c9 03 CMP #&03 &20f6 90 10 BCC &2108 ; set_shuffle_to_one # Set shuffle to &01 if 0 - 2 (i.e. left of slot) &20f8 bd 61 07 LDA &0761,X ; control_panel_boards_object + 1 &20fb 30 0b BMI &2108 ; set_shuffle_to_one &20fd b9 f9 05 LDA &05f9,Y ; objects_tile_x_fraction &2100 c9 03 CMP #&03 &2102 f0 09 BEQ &210d ; consider_next_control_panel_board # Keep shuffle as &ff if at 3 (i.e. in slot) &2104 a9 00 LDA #&00 # Set shuffle to &00 if 4 - 7 (i.e. right of slot) &2106 f0 02 BEQ &210a ; set_shuffle # Always branches ; set_shuffle_to_one &2108 a9 01 LDA #&01 ; set_shuffle &210a 9d 66 07 STA &0766,X ; control_panel_boards_shuffle ; consider_next_control_panel_board &210d ca DEX &210e 10 ca BPL &20da ; check_control_panel_boards_object_loop &2110 a5 00 LDA &00 ; out_of_place_circuit_boards # Zero if control panel boards set to " STOP" &2112 d0 08 BNE &211c ; skip_stopping_factory &2114 ad 60 07 LDA &0760 ; control_panel_boards_object # Negative if no object in first slot &2117 10 03 BPL &211c ; skip_stopping_factory &2119 8d ec 07 STA &07ec ; factory_stopped # Set to non-zero to indicate factory stopped ; skip_stopping_factory &211c a9 00 LDA #&00 # Zero to plot and update objects ; update_objects_setting_suppress_updating &211e 85 5f STA &5f ; suppress_updating &2120 20 19 26 JSR &2619 ; calculate_screen_edges &2123 e6 18 INC &18 ; screen_bottom_y &2125 ae e2 07 LDX &07e2 ; inventory + 5 (HAND) # Non-zero if the player is carrying an object &2128 f0 16 BEQ &2140 ; skip_updating_held_object &212a ad e9 07 LDA &07e9 ; player_sprite &212d c9 03 CMP #&03 ; SPRITE_PLAYER_CLIMBING &212f d0 07 BNE &2138 ; not_climbing &2131 a9 ff LDA #&ff &2133 9d 35 06 STA &0635,X ; objects_tile_y - 1 # Set to negative to hide held object while climbing &2136 d0 08 BNE &2140 ; skip_updating_held_object # Always branches ; not_climbing &2138 bd 35 06 LDA &0635,X ; objects_tile_y - 1 &213b 10 03 BPL &2140 ; skip_updating_held_object &213d 20 70 22 JSR &2270 ; set_position_of_held_object ; skip_updating_held_object &2140 ae e2 07 LDX &07e2 ; inventory + 5 (HAND) &2143 ca DEX &2144 86 e3 STX &e3 ; object_being_held &2146 a2 3c LDX #&3c ; OBJECT_LAST ; update_objects_loop # For each object, &2148 ec e3 07 CPX &07e3 ; thrown_object &214b f0 66 BEQ &21b3 ; skip_plotting_object # If it isn't being thrown, &214d 20 21 22 JSR &2221 ; use_objects_X_position &2150 bd 0e 34 LDA &340e,X ; objects_type &2153 85 00 STA &00 ; object_type &2155 29 7f AND #&7f ; !OBJECT_PLOTTED # Clear OBJECT_PLOTTED &2157 9d 0e 34 STA &340e,X ; objects_type &215a e4 e3 CPX &e3 ; object_being_held &215c f0 05 BEQ &2163 ; skip_on_screen_check &215e 20 50 20 JSR &2050 ; check_if_object_is_on_screen # Returns carry clear if object is on screen &2161 b0 76 BCS &21d9 ; consider_unplotting_off_screen_object ; skip_on_screen_check &2163 a5 00 LDA &00 ; object_type # Top bit set if object was plotted (OBJECT_PLOTTED) &2165 10 03 BPL &216a ; skip_unplotting_object &2167 20 9a 1f JSR &1f9a ; unplot_object # Unplot object ; skip_unplotting_object &216a e4 e3 CPX &e3 ; object_being_held &216c d0 0a BNE &2178 ; skip_updating_held_object # If it is the object the player is holding. &216e ad e9 07 LDA &07e9 ; player_sprite &2171 c9 03 CMP #&03 ; SPRITE_PLAYER_CLIMBING &2173 f0 03 BEQ &2178 ; skip_updating_held_object &2175 20 70 22 JSR &2270 ; set_position_of_held_object # plot it next to the player ; skip_updating_held_object &2178 86 01 STX &01 ; object &217a a0 04 LDY #&04 ; check_if_in_control_panel &217c b9 60 07 LDA &0760,Y ; control_panel_boards_object &217f c5 01 CMP &01 ; object &2181 d0 03 BNE &2186 ; consider_next_slot # If it is in the factory control panel, &2183 4c e3 21 JMP &21e3 ; update_control_panel_object # shuffle into position if necessary ; consider_next_slot &2186 88 DEY &2187 10 f3 BPL &217c ; check_if_in_control_panel ; consider_removing_object &2189 ec 44 14 CPX &1444 ; object_to_remove &218c d0 12 BNE &21a0 ; skip_removing_object # If it is the object being removed, &218e a9 ff LDA #&ff &2190 ac 44 14 LDY &1444 ; object_to_remove # Zero if no object needs removing &2193 f0 0b BEQ &21a0 ; skip_removing_object &2195 99 36 06 STA &0636,Y ; objects_tile_y # Move out of the world &2198 99 9a 01 STA &019a,Y ; objects_tile_address_high &219b a9 00 LDA #&00 &219d 8d 44 14 STA &1444 ; object_to_remove # Set to zero to indicate no object needs removing ; skip_removing_object &21a0 20 50 20 JSR &2050 ; check_if_object_is_on_screen # Returns carry clear if object is on screen &21a3 b0 0e BCS &21b3 ; skip_plotting_object &21a5 20 f3 1f JSR &1ff3 ; calculate_object_screen_and_tile_addresses &21a8 20 9d 1f JSR &1f9d ; plot_object # Plot object &21ab bd 0e 34 LDA &340e,X ; objects_type &21ae 09 80 ORA #&80 ; OBJECT_PLOTTED &21b0 9d 0e 34 STA &340e,X ; objects_type ; skip_plotting_object &21b3 bd 0e 34 LDA &340e,X ; objects_type &21b6 29 3f AND #&3f ; OBJECT_TYPE_MASK &21b8 c9 16 CMP #&16 ; OBJECT_TYPE_EGG # Is the object an egg? &21ba d0 16 BNE &21d2 ; not_egg &21bc bd bc 05 LDA &05bc,X ; objects_tile_x # If the player is in the same tile as the egg, &21bf c5 d6 CMP &d6 ; player_middle_tile_x &21c1 d0 0f BNE &21d2 ; not_egg &21c3 bd 36 06 LDA &0636,X ; objects_tile_y &21c6 c5 d7 CMP &d7 ; player_middle_tile_y &21c8 d0 08 BNE &21d2 ; not_egg &21ca a5 5f LDA &5f ; suppress_updating &21cc d0 04 BNE &21d2 ; not_egg &21ce a9 05 LDA #&05 ; KILLED_BY_AN_EGG &21d0 85 16 STA &16 ; player_killed # Kill the player (touching egg) ; not_egg &21d2 ca DEX &21d3 30 03 BMI &21d8 ; leave &21d5 4c 48 21 JMP &2148 ; update_objects_loop ; leave &21d8 60 RTS ; consider_unplotting_off_screen_object &21d9 a5 00 LDA &00 ; object_type # Top bit set if object was plotted (OBJECT_PLOTTED) &21db 10 d6 BPL &21b3 ; skip_plotting_object &21dd 20 9a 1f JSR &1f9a ; unplot_object &21e0 4c b3 21 JMP &21b3 ; skip_plotting_object ; update_control_panel_object &21e3 a9 01 LDA #&01 &21e5 9d 73 06 STA &0673,X ; objects_tile_y_fraction &21e8 b9 66 07 LDA &0766,Y ; control_panel_boards_shuffle # Negative if circuit board is aligned with slot &21eb 30 9c BMI &2189 ; consider_removing_object # If so, nothing more to do &21ed f0 14 BEQ &2203 ; shuffle_circuit_board_left # Zero if circuit board is right of slot &21ef fe f9 05 INC &05f9,X ; objects_tile_x_fraction # Otherwise, circuit board is left of slot &21f2 bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &21f5 c9 08 CMP #&08 &21f7 d0 90 BNE &2189 ; control_panel_boards_shuffle &21f9 a9 00 LDA #&00 &21fb 9d f9 05 STA &05f9,X ; objects_tile_x_fraction &21fe fe bc 05 INC &05bc,X ; objects_tile_x &2201 d0 86 BNE &2189 ; control_panel_boards_shuffle ; shuffle_circuit_board_left &2203 de f9 05 DEC &05f9,X ; objects_tile_x_fraction &2206 10 81 BPL &2189 ; control_panel_boards_shuffle &2208 a9 07 LDA #&07 &220a 9d f9 05 STA &05f9,X ; objects_tile_x_fraction &220d de bc 05 DEC &05bc,X ; objects_tile_x &2210 f0 03 BEQ &2215 ; inventory_screen_addresses_low # Unnecessary code; never branches &2212 4c 89 21 JMP &2189 ; control_panel_boards_shuffle ; inventory_screen_addresses_low &2215 20 a0 20 a0 20 a0 ; inventory_screen_addresses_high &221b 44 4b 53 5a 62 69 ; use_objects_X_position &2221 bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &2224 85 78 STA &78 ; object_tile_x_fraction &2226 bd 73 06 LDA &0673,X ; objects_tile_y_fraction &2229 85 79 STA &79 ; object_tile_y_fraction &222b bd 1e 07 LDA &071e,X ; objects_tile_address_low &222e 85 74 STA &74 ; object_tile_address_low &2230 bd 9a 01 LDA &019a,X ; objects_tile_address_high &2233 85 75 STA &75 ; object_tile_address_high &2235 60 RTS ; plot_inventory_object &2236 aa TAX &2237 bc dd 07 LDY &07dd,X ; inventory # Zero if no object in slot &223a f0 21 BEQ &225d ; leave &223c b9 0d 34 LDA &340d,Y ; objects_type - 1 &223f 29 3f AND #&3f ; OBJECT_TYPE_MASK &2241 48 PHA ; object_type &2242 ce 2e 1e DEC &1e2e ; suppress_sprite_plotting # Set to zero to permit plotting &2245 bd 15 22 LDA &2215,X ; inventory_screen_addresses_low &2248 85 04 STA &04 ; plot_screen_address_low &224a bd 1b 22 LDA &221b,X ; inventory_screen_addresses_high &224d 85 05 STA &05 ; plot_screen_address_high &224f 68 PLA ; object_type &2250 18 CLC &2251 69 0b ADC #&0b ; SPRITE_FIRST_OBJECT &2253 aa TAX &2254 a9 00 LDA #&00 &2256 18 CLC # Clear carry to plot object &2257 20 de 0f JSR &0fde ; plot_or_unplot_sprite # Plot object in inventory &225a ee 2e 1e INC &1e2e ; suppress_sprite_plotting # Set to non-zero to suppress plotting ; leave &225d 60 RTS ; check_if_vertical_range_had_obstacle &225e a9 00 LDA #&00 &2260 a4 4b LDY &4b ; vertical_chunk_check_results # Negative if obstacle &2262 30 09 BMI &226d ; leave_with_one &2264 a4 4c LDY &4c ; vertical_chunk_check_results + 1 # Negative if obstacle &2266 30 05 BMI &226d ; leave_with_one &2268 a4 4d LDY &4d ; vertical_chunk_check_results + 2 # Negative if obstacle &226a 30 01 BMI &226d ; leave_with_one &226c 60 RTS # Leave with zero to indicate no obstacle ; leave_with_one &226d a9 01 LDA #&01 # Leave with non-zero to indicate obstacle &226f 60 RTS ; set_position_of_held_object &2270 86 da STX &da ; tmp_x &2272 ae e2 07 LDX &07e2 ; inventory + 5 (HAND) &2275 ca DEX &2276 20 c8 1f JSR &1fc8 ; get_object_width_and_height &2279 ac e2 07 LDY &07e2 ; inventory + 5 (HAND) &227c f0 3c BEQ &22ba ; leave &227e c6 f8 DEC &f8 ; object_width &2280 a6 0a LDX &0a ; player_x &2282 a5 13 LDA &13 ; player_direction &2284 30 0c BMI &2292 ; is_facing_left ; is_facing_right # If the player is facing right, &2286 a5 0c LDA &0c ; player_tile_x_fraction &2288 18 CLC &2289 69 05 ADC #&05 # put held object to right of player &228b c9 08 CMP #&08 &228d 90 0d BCC &229c ; set_x_fraction &228f e8 INX &2290 d0 0a BNE &229c ; set_x_fraction ; is_facing_left &2292 e6 f8 INC &f8 ; object_width &2294 a5 0c LDA &0c ; player_tile_x_fraction &2296 38 SEC &2297 e5 f8 SBC &f8 ; object_width # otherwise put held object to left of player &2299 10 01 BPL &229c ; set_x_fraction &229b ca DEX ; set_x_fraction &229c 29 07 AND #&07 &229e 99 f8 05 STA &05f8,Y ; objects_tile_x_fraction - 1 &22a1 8a TXA &22a2 99 bb 05 STA &05bb,Y ; objects_tile_x - 1 &22a5 a6 0b LDX &0b ; player_y &22a7 a5 0d LDA &0d ; player_tile_y_fraction &22a9 18 CLC &22aa 69 01 ADC #&01 &22ac c9 04 CMP #&04 &22ae 90 01 BCC &22b1 ; not_next_tile_down &22b0 e8 INX ; not_next_tile_down &22b1 29 03 AND #&03 &22b3 99 72 06 STA &0672,Y ; objects_tile_y_fraction - 1 &22b6 8a TXA &22b7 99 35 06 STA &0635,Y ; objects_tile_y - 1 ; leave &22ba a6 da LDX &da ; tmp_x &22bc 60 RTS ; end_throw &22bd a9 ff LDA #&ff &22bf 8d e3 07 STA &07e3 ; thrown_object # Set to negative to indicate no object being thrown &22c2 60 RTS ; update_thrown_object &22c3 ae e3 07 LDX &07e3 ; thrown_object # Positive if object is being thrown &22c6 10 01 BPL &22c9 ; is_being_thrown &22c8 60 RTS ; is_being_thrown &22c9 20 21 22 JSR &2221 ; use_objects_X_position &22cc 20 c8 1f JSR &1fc8 ; get_object_width_and_height &22cf e6 f8 INC &f8 ; object_width &22d1 bd 0e 34 LDA &340e,X ; objects_type # Top bit set if object was plotted &22d4 10 06 BPL &22dc ; skip_unplotting_object &22d6 20 9a 1f JSR &1f9a ; unplot_object # Unplot thrown object &22d9 bd 0e 34 LDA &340e,X ; objects_type ; skip_unplotting_object &22dc 29 7f AND #&7f ; !OBJECT_PLOTTED # Clear top bit to indicate object not plotted &22de 9d 0e 34 STA &340e,X ; objects_type &22e1 20 19 26 JSR &2619 ; calculate_screen_edges &22e4 e6 18 INC &18 ; screen_bottom_y &22e6 20 e2 2a JSR &2ae2 ; use_object_position_one_fraction_left &22e9 a5 f9 LDA &f9 ; object_height # Check beneath object for obstacles &22eb 18 CLC &22ec 69 01 ADC #&01 # A is used as y_fraction_offset for check &22ee a6 f8 LDX &f8 ; object_width &22f0 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns carry set if obstacle &22f3 b0 c8 BCS &22bd ; end_throw # Stop throw is object has hit ground &22f5 20 e2 2a JSR &2ae2 ; use_object_position_one_fraction_left # Check top of object for obstacles &22f8 a6 f8 LDX &f8 ; object_width &22fa 20 fa 14 JSR &14fa ; check_if_position_is_climbable # Returns A = chunk type &22fd c9 40 CMP #&40 ; CHUNK_FIRST_CLIMBABLE &22ff 08 PHP ; processor status &2300 68 PLA ; processor status &2301 29 01 AND #&01 ; CARRY # Carry is set if obstacle &2303 85 5b STA &5b ; object_hit_obstacle_above &2305 20 aa 23 JSR &23aa ; use_object_position &2308 a5 f8 LDA &f8 ; object_width &230a 38 SEC &230b e9 01 SBC #&01 # A is used as x_fraction_offset for check &230d 20 9e 16 JSR &169e ; check_vertical_range_of_chunks # Check right of object for obstacles &2310 20 5e 22 JSR &225e ; check_if_vertical_range_had_obstacle # Returns non-zero if any obstacles &2313 85 5a STA &5a ; object_hit_obstacle_horizontally &2315 20 e2 2a JSR &2ae2 ; use_object_position_one_fraction_left &2318 a9 00 LDA #&00 ; x_fraction_offset # Check left of object for obstacles &231a 20 a1 16 JSR &16a1 ; check_vertical_range_of_chunks_without_right &231d 20 5e 22 JSR &225e ; check_if_vertical_range_had_obstacle # Returns non-zero if any obstacles &2320 05 5a ORA &5a ; object_hit_obstacle_horizontally &2322 85 5a STA &5a ; object_hit_obstacle_horizontally &2324 ae e3 07 LDX &07e3 ; thrown_object &2327 ac e4 07 LDY &07e4 ; throw_direction &232a 98 TYA &232b 29 01 AND #&01 # &01 set if object is being thrown horizontally &232d f0 04 BEQ &2333 ; move_thrown_object &232f a5 5a LDA &5a ; object_hit_obstacle_horizontally # Non-zero if object hit obstacle horizontally &2331 d0 64 BNE &2397 ; set_thrown_object_falling ; move_thrown_object &2333 c0 00 CPY #&00 ; THROW_UP &2335 d0 11 BNE &2348 ; not_throwing_up &2337 a5 5b LDA &5b ; object_hit_obstacle_above &2339 f0 5c BEQ &2397 ; set_thrown_object_falling &233b de 73 06 DEC &0673,X ; objects_tile_y_fraction &233e 10 08 BPL &2348 ; not_next_tile_up &2340 a9 03 LDA #&03 &2342 9d 73 06 STA &0673,X ; objects_tile_y_fraction &2345 de 36 06 DEC &0636,X ; objects_tile_y ; not_next_tile_up ; not_throwing_up &2348 c0 01 CPY #&01 ; THROW_RIGHT &234a d0 12 BNE &235e ; not_throwing_right &234c fe f9 05 INC &05f9,X ; objects_tile_x_fraction &234f bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &2352 c9 08 CMP #&08 &2354 d0 08 BNE &235e ; not_next_tile_right &2356 a9 00 LDA #&00 &2358 9d f9 05 STA &05f9,X ; objects_tile_x_fraction &235b fe bc 05 INC &05bc,X ; objects_tile_x ; not_next_tile_right ; not_throwing_right &235e ad 92 34 LDA &3492 ; throw_distance_remaining &2361 f0 04 BEQ &2367 ; throwing_down &2363 c0 02 CPY #&02 ; THROW_DOWN &2365 d0 12 BNE &2379 ; not_throwing_down ; throwing_down &2367 fe 73 06 INC &0673,X ; objects_tile_y_fraction &236a bd 73 06 LDA &0673,X ; objects_tile_y_fraction &236d c9 04 CMP #&04 &236f d0 08 BNE &2379 ; not_next_tile_down &2371 a9 00 LDA #&00 &2373 9d 73 06 STA &0673,X ; objects_tile_y_fraction &2376 fe 36 06 INC &0636,X ; objects_tile_y ; not_next_tile_down ; not_throwing_down &2379 c0 03 CPY #&03 ; THROW_LEFT &237b d0 0d BNE &238a ; not_throwing_left &237d de f9 05 DEC &05f9,X ; objects_tile_x_fraction &2380 10 08 BPL &238a ; not_next_tile_left &2382 a9 07 LDA #&07 &2384 9d f9 05 STA &05f9,X ; objects_tile_x_fraction &2387 de bc 05 DEC &05bc,X ; objects_tile_x ; not_next_tile_left ; not_throwing_left &238a ce 92 34 DEC &3492 ; throw_distance_remaining &238d 10 0d BPL &239c ; check_if_thrown_object_is_on_screen &238f a9 07 LDA #&07 &2391 8d 92 34 STA &3492 ; throw_distance_remaining &2394 98 TYA &2395 d0 05 BNE &239c ; check_if_thrown_object_is_on_screen # Always branches ; set_thrown_object_falling &2397 a9 02 LDA #&02 ; THROW_DOWN &2399 8d e4 07 STA &07e4 ; throw_direction ; check_if_thrown_object_is_on_screen &239c 20 50 20 JSR &2050 ; check_if_object_is_on_screen # Returns carry clear if object is on screen &239f 90 03 BCC &23a4 ; plot_thrown_object &23a1 4c 33 20 JMP &2033 ; set_object_X_tile_address ; plot_thrown_object &23a4 20 f3 1f JSR &1ff3 ; calculate_object_screen_and_tile_addresses &23a7 4c 9d 1f JMP &1f9d ; plot_object # Plot thrown object ; use_object_position &23aa a5 74 LDA &74 ; object_tile_address_low &23ac 85 46 STA &46 ; this_tile_address_low &23ae a5 75 LDA &75 ; object_tile_address_high &23b0 85 47 STA &47 ; this_tile_address_high &23b2 a5 78 LDA &78 ; object_tile_x_fraction &23b4 85 48 STA &48 ; this_tile_x_fraction &23b6 a5 79 LDA &79 ; object_tile_y_fraction &23b8 85 49 STA &49 ; this_tile_y_fraction &23ba 60 RTS ; use_player_position &23bb a5 30 LDA &30 ; player_tile_address_low &23bd 85 46 STA &46 ; this_tile_address_low &23bf a5 31 LDA &31 ; player_tile_address_high &23c1 85 47 STA &47 ; this_tile_address_high &23c3 a5 0c LDA &0c ; player_tile_x_fraction &23c5 85 48 STA &48 ; this_tile_x_fraction &23c7 a5 0d LDA &0d ; player_tile_y_fraction &23c9 85 49 STA &49 ; this_tile_y_fraction &23cb 60 RTS ; use_mover_position &23cc a5 55 LDA &55 ; mover_tile_address_low &23ce 85 46 STA &46 ; this_tile_address_low &23d0 a5 56 LDA &56 ; mover_tile_address_high &23d2 85 47 STA &47 ; this_tile_address_high &23d4 a5 57 LDA &57 ; mover_tile_x_fraction &23d6 85 48 STA &48 ; this_tile_x_fraction &23d8 a5 58 LDA &58 ; mover_tile_y_fraction &23da 85 49 STA &49 ; this_tile_y_fraction &23dc 60 RTS ; consider_object_handling_keys &23dd ad e9 07 LDA &07e9 ; player_sprite &23e0 c9 03 CMP #&03 ; SPRITE_PLAYER_CLIMBING &23e2 d0 02 BNE &23e6 ; not_climbing # Can't do anything with objects when climbing &23e4 18 CLC # Leave with carry clear to indicate no replot necessary &23e5 60 RTS ; not_climbing &23e6 20 17 17 JSR &1717 ; check_keyboard &23e9 a5 9f LDA &9f ; player_action_key &23eb a0 00 LDY #&00 &23ed c9 b9 CMP #&b9 ; UP &23ef f0 5f BEQ &2450 ; throw_or_drop_object &23f1 c9 a0 CMP #&a0 ; f0 &23f3 f0 40 BEQ &2435 ; select_pocket &23f5 c8 INY ; 1 &23f6 c9 f9 CMP #&f9 ; RIGHT &23f8 f0 56 BEQ &2450 ; throw_or_drop_object &23fa c9 f1 CMP #&f1 ; f1 &23fc f0 37 BEQ &2435 ; select_pocket &23fe c8 INY ; 2 &23ff c9 a9 CMP #&a9 ; DOWN &2401 f0 4d BEQ &2450 ; throw_or_drop_object &2403 c9 b2 CMP #&b2 ; D &2405 f0 49 BEQ &2450 ; throw_or_drop_object &2407 c9 f2 CMP #&f2 ; f2 &2409 f0 2a BEQ &2435 ; select_pocket &240b c8 INY ; 3 &240c c9 99 CMP #&99 ; LEFT &240e f0 40 BEQ &2450 ; throw_or_drop_object &2410 c9 f3 CMP #&f3 ; f3 &2412 f0 21 BEQ &2435 ; select_pocket &2414 c8 INY ; 4 &2415 c9 94 CMP #&94 ; f4 &2417 f0 1c BEQ &2435 ; select_pocket &2419 c9 b3 CMP #&b3 ; R &241b f0 72 BEQ &248f ; retrieve_object &241d c9 d1 CMP #&d1 ; S &241f d0 03 BNE &2424 ; s_not_pressed &2421 4c aa 24 JMP &24aa ; store_object ; s_not_pressed &2424 c9 a2 CMP #&a2 ; E &2426 f0 18 BEQ &2440 ; execute_splinx_program &2428 c9 d4 CMP #&d4 ; H &242a f0 10 BEQ &243c ; halt_splinx &242c c9 b7 CMP #&b7 ; P &242e d0 03 BNE &2433 ; leave_with_carry_clear &2430 4c 27 25 JMP &2527 ; consider_picking_up_object ; leave_with_carry_clear &2433 18 CLC # Leave with carry clear to indicate no replot necessary &2434 60 RTS ; select_pocket &2435 84 17 STY &17 ; selected_pocket &2437 20 8f 24 JSR &248f ; retrieve_object &243a 38 SEC # Leave with carry set to indicate replot necessary &243b 60 RTS ; halt_splinx &243c a9 00 LDA #&00 # Zero to deactivate Splinx &243e f0 0b BEQ &244b ; set_splinx_active # Always branches ; execute_splinx_program &2440 ae e2 07 LDX &07e2 ; inventory + 5 (HAND) &2443 e0 2c CPX #&2c ; OBJECT_SPLINX + 1 &2445 f0 ec BEQ &2433 ; leave_with_carry_clear # Can't activate Splinx if carrying! &2447 a2 00 LDX #&00 &2449 86 92 STX &92 ; splinx_slot # Otherwise, start Splinx program ; set_splinx_active &244b 8d ed 06 STA &06ed ; splinx_active # Set to zero to indicate Splinx is active &244e 18 CLC # Leave with carry clear to indicate no replot necessary &244f 60 RTS ; throw_or_drop_object # Called with A = key for action &2450 85 00 STA &00 ; action &2452 ae e3 07 LDX &07e3 ; thrown_object # Positive if object is already being thrown or dropped &2455 10 dc BPL &2433 ; leave_with_carry_clear # Leave with carry clear to indicate no object thrown or dropped &2457 ae e2 07 LDX &07e2 ; inventory + 5 (HAND) &245a f0 d7 BEQ &2433 ; leave_with_carry_clear &245c 8c e4 07 STY &07e4 ; throw_direction &245f ca DEX &2460 8e e3 07 STX &07e3 ; thrown_object &2463 b9 8e 34 LDA &348e,Y ; throw_distances_by_direction_table &2466 8d 92 34 STA &3492 ; throw_distance_remaining &2469 a9 00 LDA #&00 &246b 8d e2 07 STA &07e2 ; inventory + 5 (HAND) # Set to zero to indicate player not holding any object &246e a5 00 LDA &00 ; action &2470 c9 b2 CMP #&b2 ; D &2472 d0 10 BNE &2484 ; play_sound_for_dropping_object ; play_sounds_for_throwing_object &2474 a2 91 LDX #&91 ; sound_2 &2476 a0 33 LDY #&33 &2478 20 fd 09 JSR &09fd ; play_sound # Play sounds for throwing object &247b a2 99 LDX #&99 ; sound_3 &247d a0 33 LDY #&33 &247f 20 fd 09 JSR &09fd ; play_sound &2482 38 SEC # Leave with carry set to indicate object thrown or dropped &2483 60 RTS ; play_sound_for_dropping_object &2484 a2 a1 LDX #&a1 ; &33a1 = sound_4 &2486 a0 33 LDY #&33 &2488 a9 07 LDA #&07 ; Generate a sound # Play sound for dropping object &248a 20 f1 ff JSR &fff1 ; OSWORD &248d 38 SEC # Leave with carry set to indicate object thrown or dropped &248e 60 RTS ; retrieve_object &248f ad e2 07 LDA &07e2 ; inventory + 5 (HAND) # Non-zero if player is already holding an object &2492 d0 9f BNE &2433 ; leave_with_carry_clear # Leave with carry clear to indicate no replot necessary &2494 a6 17 LDX &17 ; selected_pocket &2496 f0 70 BEQ &2508 ; retrieve_marker &2498 bd dd 07 LDA &07dd,X ; inventory # Zero if no object in slot &249b f0 96 BEQ &2433 ; leave_with_carry_clear # Leave with carry clear to indicate no replot necessary &249d 8d e2 07 STA &07e2 ; inventory + 5 (HAND) &24a0 a9 00 LDA #&00 &24a2 9d dd 07 STA &07dd,X ; inventory # Set to zero to indicate no object in slot &24a5 20 70 22 JSR &2270 ; set_position_of_held_object &24a8 38 SEC # Leave with carry set to indicate replot necessary &24a9 60 RTS ; store_object &24aa ad e2 07 LDA &07e2 ; inventory + 5 (HAND) &24ad f0 84 BEQ &2433 ; leave_with_carry_clear # Leave with carry clear to indicate no replot necessary &24af 20 ba 24 JSR &24ba ; store_object_in_pocket # Returns carry set if object was stored &24b2 90 04 BCC &24b8 ; leave - 1 # Bug; executes SLO &60 ; allow_loading, then &24ba &24b4 a9 00 LDA #&00 &24b6 8d e2 07 STA &07e2 ; inventory + 5 (HAND) ; leave &24b9 60 RTS ; store_object_in_pocket &24ba c9 05 CMP #&05 ; OBJECT_MARKER_4 + 1 + 1 &24bc 90 28 BCC &24e6 ; store_marker &24be c9 2c CMP #&2c ; OBJECT_SPLINX + 1 &24c0 d0 03 BNE &24c5 ; not_splinx &24c2 68 PLA # Leave store_object on next return &24c3 68 PLA # i.e. don't allow Splinx to be stored or clear hand &24c4 60 RTS ; not_splinx &24c5 a6 17 LDX &17 ; selected_pocket &24c7 f0 10 BEQ &24d9 ; find_free_pocket &24c9 bc dd 07 LDY &07dd,X ; inventory &24cc d0 0b BNE &24d9 ; find_free_pocket ; store_object_in_pocket_X &24ce 9d dd 07 STA &07dd,X ; inventory &24d1 aa TAX &24d2 a9 ff LDA #&ff &24d4 9d 35 06 STA &0635,X ; objects_tile_y - 1 &24d7 38 SEC # Leave with carry set to indicate object stored &24d8 60 RTS ; find_free_pocket &24d9 a2 04 LDX #&04 ; find_free_pocket_loop &24db bc dd 07 LDY &07dd,X ; inventory # Zero if no object in slot &24de f0 ee BEQ &24ce ; store_object_in_pocket_X &24e0 ca DEX &24e1 d0 f8 BNE &24db ; find_free_pocket_loop &24e3 4c 33 24 JMP &2433 ; leave_with_carry_clear # Leave with carry clear to indicate object not stored ; store_marker &24e6 aa TAX &24e7 9d e4 07 STA &07e4,X ; splinx_markers_state - 1 &24ea a9 ff LDA #&ff &24ec 9d 35 06 STA &0635,X ; objects_tile_y - 1 ; get_next_marker &24ef a2 00 LDX #&00 ; find_unused_marker_loop &24f1 bd e5 07 LDA &07e5,X ; splinx_markers_state # Zero if marker has been used &24f4 d0 07 BNE &24fd ; get_marker &24f6 e8 INX &24f7 e0 04 CPX #&04 &24f9 d0 f6 BNE &24f1 ; find_unused_marker_loop &24fb a9 00 LDA #&00 # Set to zero to indicate nothing held ; get_marker &24fd 8d dd 07 STA &07dd ; inventory &2500 38 SEC # Leave with carry set to indicate object stored &2501 60 RTS ; pick_up_egg &2502 a9 05 LDA #&05 ; KILLED_BY_AN_EGG &2504 85 16 STA &16 ; player_killed # Kill the player (picking up egg) &2506 18 CLC # Leave with carry clear to indicate no replot necessary &2507 60 RTS ; retrieve_marker &2508 a2 00 LDX #&00 ; find_unused_marker_loop &250a bd e5 07 LDA &07e5,X ; splinx_markers_state # Zero if marker has been used &250d d0 07 BNE &2516 ; use_marker &250f e8 INX &2510 e0 04 CPX #&04 &2512 d0 f6 BNE &250a ; find_unused_marker_loop &2514 18 CLC # Leave with carry clear to indicate no replot necessary &2515 60 RTS ; use_marker &2516 a9 00 LDA #&00 &2518 9d e5 07 STA &07e5,X ; splinx_markers_state # Set to zero to indicate marker has been used &251b e8 INX &251c 8e e2 07 STX &07e2 ; inventory + 5 (HAND) &251f 20 ef 24 JSR &24ef ; get_next_marker &2522 20 70 22 JSR &2270 ; set_position_of_held_object &2525 38 SEC # Leave with carry set to indicate replot necessary &2526 60 RTS ; consider_picking_up_object &2527 a2 0a LDX #&0a ; &0a = player_x &2529 20 7a 25 JSR &257a ; check_if_touching_object # Returns carry set if touching object &252c b0 01 BCS &252f ; is_touching_object &252e 60 RTS ; is_touching_object # if the player is touching an object, &252f bd 0e 34 LDA &340e,X ; objects_type &2532 29 3f AND #&3f ; OBJECT_TYPE_MASK &2534 c9 0c CMP #&0c ; OBJECT_TYPE_CLOTH &2536 d0 07 BNE &253f ; check_for_player_touching_hatch ; is_touching_cloth &2538 ac ed 07 LDY &07ed ; mover_touching_cloth # Non-zero if a controller is touching the cloth &253b f0 02 BEQ &253f ; check_for_player_touching_hatch # Can't pick up cloth if controller is touching it &253d 18 CLC # Leave with carry clear to indicate no replot necessary &253e 60 RTS ; check_for_player_touching_hatch &253f c9 17 CMP #&17 ; OBJECT_TYPE_HATCH &2541 d0 0d BNE &2550 ; not_hatch &2543 a9 13 LDA #&13 ; OBJECT_TYPE_ELECTRONIC_SPANNER &2545 86 01 STX &01 ; object &2547 20 74 12 JSR &1274 ; check_if_carrying_object_type # Returns carry clear if carrying object &254a a6 01 LDX &01 ; object &254c 90 0a BCC &2558 ; pick_up_object # Can't pick up hatch if not carrying spanner ; suppress_picking_up_object &254e 18 CLC # Leave with carry clear to indicate no replot necessary &254f 60 RTS ; not_hatch &2550 c9 1b CMP #&1b ; OBJECT_TYPE_HEATONITE_ORE &2552 f0 fa BEQ &254e ; suppress_picking_up_object # Can't pick up ore &2554 c9 16 CMP #&16 ; OBJECT_TYPE_EGG &2556 f0 aa BEQ &2502 ; pick_up_egg ; pick_up_object &2558 8a TXA &2559 48 PHA ; object &255a a2 81 LDX #&81 ; &3381 = sound_0 &255c a0 33 LDY #&33 &255e 20 fd 09 JSR &09fd ; play_sound # Play sounds for picking up object &2561 a2 89 LDX #&89 ; &3389 = sound_1 &2563 a0 33 LDY #&33 &2565 20 fd 09 JSR &09fd ; play_sound &2568 68 PLA ; object &2569 aa TAX &256a ad e2 07 LDA &07e2 ; inventory + 5 (HAND) &256d d0 06 BNE &2575 ; is_already_carrying_object &256f e8 INX &2570 8e e2 07 STX &07e2 ; inventory + 5 (HAND) &2573 38 SEC # Leave with carry set to indicate replot necessary &2574 60 RTS ; is_already_carrying_object &2575 e8 INX &2576 8a TXA &2577 4c ba 24 JMP &24ba ; store_object_in_pocket ; check_if_touching_object # Called with X = variables to check &257a b5 00 LDA &00,X ; position_tile_x # X = &00 for tile_, i.e. mover, X = &0a for player_ &257c 85 a3 STA &a3 ; check_min_tile_x &257e 85 a4 STA &a4 ; check_max_tile_x &2580 b5 02 LDA &02,X ; position_tile_x_fraction &2582 85 a5 STA &a5 ; check_min_tile_x_fraction &2584 c6 a3 DEC &a3 ; check_min_tile_x &2586 b5 02 LDA &02,X ; position_tile_x_fraction &2588 18 CLC &2589 69 0b ADC #&0b &258b c9 08 CMP #&08 &258d 90 02 BCC &2591 ; not_next_tile_right &258f e6 a4 INC &a4 ; check_max_tile_x ; not_next_tile_right &2591 29 07 AND #&07 &2593 85 a6 STA &a6 ; check_max_tile_x_fraction &2595 b5 01 LDA &01,X ; position_tile_y &2597 85 00 STA &00 ; check_min_tile_y &2599 85 01 STA &01 ; check_max_tile_y &259b b5 03 LDA &03,X ; position_tile_y_fraction &259d 38 SEC &259e e9 01 SBC #&01 &25a0 10 02 BPL &25a4 ; not_next_tile_up &25a2 c6 00 DEC &00 ; check_min_tile_y ; not_next_tile_up &25a4 29 03 AND #&03 &25a6 85 02 STA &02 ; check_min_tile_y_fraction &25a8 b5 03 LDA &03,X ; position_tile_y_fraction &25aa 18 CLC &25ab 69 03 ADC #&03 &25ad c9 04 CMP #&04 &25af 90 02 BCC &25b3 ; not_next_tile_down &25b1 e6 01 INC &01 ; check_max_tile_y ; not_next_tile_down &25b3 29 03 AND #&03 &25b5 85 03 STA &03 ; check_max_tile_y_fraction &25b7 ae e2 07 LDX &07e2 ; inventory + 5 (HAND) &25ba ca DEX &25bb 86 05 STX &05 ; object_being_held_offset &25bd a2 3c LDX #&3c ; OBJECT_LAST # For each object, ; check_if_touching_object_loop &25bf e4 05 CPX &05 ; object_being_held_offset &25c1 f0 51 BEQ &2614 ; consider_next_object &25c3 bd bc 05 LDA &05bc,X ; objects_tile_x &25c6 c5 a3 CMP &a3 ; check_min_tile_x &25c8 90 4a BCC &2614 ; consider_next_object &25ca d0 07 BNE &25d3 ; skip_min_x_fraction &25cc bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &25cf c5 a5 CMP &a5 ; check_min_tile_x_fraction &25d1 90 41 BCC &2614 ; consider_next_object ; skip_min_x_fraction &25d3 bd bc 05 LDA &05bc,X ; objects_tile_x &25d6 c5 a4 CMP &a4 ; check_max_tile_x &25d8 f0 04 BEQ &25de ; check_max_x_fraction &25da b0 38 BCS &2614 ; consider_next_object &25dc d0 07 BNE &25e5 ; skip_max_x_fraction ; check_max_x_fraction &25de bd f9 05 LDA &05f9,X ; objects_tile_x_fraction &25e1 c5 a6 CMP &a6 ; check_max_tile_x_fraction &25e3 b0 2f BCS &2614 ; consider_next_object ; skip_max_x_fraction &25e5 bd 36 06 LDA &0636,X ; objects_tile_y &25e8 c5 00 CMP &00 ; check_min_tile_y &25ea 90 28 BCC &2614 ; consider_next_object &25ec d0 07 BNE &25f5 ; skip_min_y_fraction &25ee bd 73 06 LDA &0673,X ; objects_tile_y_fraction &25f1 c5 02 CMP &02 ; check_min_tile_y_fraction &25f3 90 1f BCC &2614 ; consider_next_object ; skip_min_y_fraction &25f5 bd 36 06 LDA &0636,X ; objects_tile_y &25f8 c5 01 CMP &01 ; check_max_tile_y &25fa f0 02 BEQ &25fe ; check_max_y_fraction &25fc b0 16 BCS &2614 ; consider_next_object ; check_max_y_fraction &25fe d0 07 BNE &2607 ; skip_max_y_fraction &2600 bd 73 06 LDA &0673,X ; objects_tile_y_fraction &2603 c5 a6 CMP &a6 ; check_max_tile_x_fraction # Bug: should be CMP &03 ; check_max_tile_y_fraction &2605 b0 0d BCS &2614 ; consider_next_object ; skip_max_y_fraction &2607 e0 2b CPX #&2b ; OBJECT_SPLINX &2609 d0 07 BNE &2612 ; leave_with_carry_set &260b ad d8 32 LDA &32d8 ; mover_type_sprites - 1 + 5 (MOVER_TYPE_SPLINX) &260e c9 04 CMP #&04 ; SPRITE_SPLINX_ACTIVE # Splinx can only be touched when inactive &2610 f0 02 BEQ &2614 ; consider_next_object ; leave_with_carry_set &2612 38 SEC # Leave with carry set to indicate touching, X = object &2613 60 RTS ; consider_next_object &2614 ca DEX &2615 10 a8 BPL &25bf ; check_if_touching_object_loop &2617 18 CLC # Leave with carry clear to indicate not touching &2618 60 RTS ; calculate_screen_edges &2619 a5 0f LDA &0f ; screen_left_x &261b 85 19 STA &19 ; screen_left_tile_x &261d a5 11 LDA &11 ; screen_right_x &261f 85 1a STA &1a ; screen_right_tile_x &2621 a6 10 LDX &10 ; screen_x_fraction &2623 e8 INX &2624 e0 08 CPX #&08 &2626 d0 04 BNE &262c ; not_next_tile_right &2628 e6 19 INC &19 ; screen_left_tile_x ; not_next_tile_right &262a a2 00 LDX #&00 &262c 86 1b STX &1b ; screen_left_tile_x_fraction &262e a5 10 LDA &10 ; screen_x_fraction &2630 38 SEC &2631 e9 06 SBC #&06 &2633 10 02 BPL &2637 ; not_next_tile_left &2635 c6 1a DEC &1a ; screen_right_tile_x ; not_next_tile_left &2637 29 07 AND #&07 &2639 85 1c STA &1c ; screen_right_tile_x_fraction &263b a5 0e LDA &0e ; screen_top_y &263d 18 CLC &263e 69 05 ADC #&05 &2640 85 18 STA &18 ; screen_bottom_y &2642 60 RTS ; plot_movers_and_objects &2643 a2 24 LDX #&24 ; MOVER_LAST # For each mover, ; mark_movers_as_unplotted_loop &2645 8a TXA &2646 48 PHA ; mover &2647 bc 25 04 LDY &0425,X ; movers_tile_y &264a bd 00 04 LDA &0400,X ; movers_tile_x &264d aa TAX &264e 20 e7 0c JSR &0ce7 ; calculate_tile_address # Returns tile address in XY &2651 86 00 STX &00 ; tile_address_low &2653 84 01 STY &01 ; tile_address_high &2655 68 PLA ; mover &2656 aa TAX &2657 a5 00 LDA &00 ; tile_address_low &2659 9d dd 34 STA &34dd,X ; movers_tile_address_low &265c a5 01 LDA &01 ; tile_address_high &265e 9d 02 35 STA &3502,X ; movers_tile_address_high &2661 bd 97 05 LDA &0597,X ; movers_flags &2664 29 7f AND #&7f ; !MOVER_FLAG_PLOTTED # Clear MOVER_FLAG_PLOTTED &2666 9d 97 05 STA &0597,X ; movers_flags &2669 ca DEX &266a 10 d9 BPL &2645 ; mark_movers_as_unplotted_loop &266c a2 3c LDX #&3c ; OBJECT_LAST ; mark_objects_as_unplotted_loop &266e 20 f3 1f JSR &1ff3 ; calculate_object_screen_and_tile_addresses &2671 bd 0e 34 LDA &340e,X ; objects_type &2674 29 7f AND #&7f ; !OBJECT_PLOTTED # Clear OBJECT_PLOTTED &2676 9d 0e 34 STA &340e,X ; objects_type &2679 ca DEX &267a 10 f2 BPL &266e ; mark_objects_as_unplotted_loop &267c a9 01 LDA #&01 # Non-zero to plot, but not update objects &267e 20 1e 21 JSR &211e ; update_objects_setting_suppress_updating &2681 a9 01 LDA #&01 # Non-zero to plot, but not update movers &2683 d0 02 BNE &2687 ; update_movers_setting_suppress_updating # Always branches ; update_movers &2685 a9 00 LDA #&00 # Zero to plot and update movers ; update_movers_setting_suppress_updating &2687 85 5f STA &5f ; suppress_updating &2689 20 19 26 JSR &2619 ; calculate_screen_edges &268c ad 97 05 LDA &0597 ; mover_flags + 0 (MOVER_SPLINX) # Unnecessary code; Splinx doesn't use targets &268f 09 0b ORA #&0b ; MOVER_FLAG_USE_TARGET | MOVER_FLAG_TARGET_THREE &2691 8d 97 05 STA &0597 ; mover_flags + 0 (MOVER_SPLINX) &2694 a6 0a LDX &0a ; player_x &2696 a5 0c LDA &0c ; player_tile_x_fraction &2698 18 CLC &2699 69 05 ADC #&05 &269b c9 08 CMP #&08 &269d 90 01 BCC &26a0 ; not_next_tile_right &269f e8 INX ; not_next_tile_right &26a0 29 07 AND #&07 &26a2 85 b8 STA &b8 ; player_x_max_fraction &26a4 86 b9 STX &b9 ; player_x_max &26a6 a6 0a LDX &0a ; player_x &26a8 a5 0c LDA &0c ; player_tile_x_fraction &26aa 38 SEC &26ab e9 05 SBC #&05 &26ad 10 01 BPL &26b0 ; not_next_tile_left &26af ca DEX ; not_next_tile_left &26b0 29 07 AND #&07 &26b2 85 ba STA &ba ; player_x_min_fraction &26b4 86 bb STX &bb ; player_x_min &26b6 a2 24 LDX #&24 ; MOVER_LAST # For each mover, ; update_movers_loop &26b8 bd e9 33 LDA &33e9,X ; movers_type &26bb 85 97 STA &97 ; mover_type &26bd a8 TAY &26be b9 d3 32 LDA &32d3,Y ; mover_type_sprites - 1 &26c1 85 f9 STA &f9 ; mover_sprite &26c3 bd dd 34 LDA &34dd,X ; movers_tile_address_low &26c6 85 55 STA &55 ; mover_tile_address_low &26c8 bd 02 35 LDA &3502,X ; movers_tile_address_high &26cb 85 56 STA &56 ; mover_tile_address_high &26cd bd 71 35 LDA &3571,X ; movers_tile_x_fraction &26d0 85 57 STA &57 ; mover_tile_x_fraction &26d2 bd 4a 04 LDA &044a,X ; movers_tile_y_fraction &26d5 85 58 STA &58 ; mover_tile_y_fraction &26d7 bd 00 04 LDA &0400,X ; movers_tile_x &26da 85 59 STA &59 ; mover_tile_x &26dc bd 25 04 LDA &0425,X ; movers_tile_y &26df 85 5a STA &5a ; mover_tile_y &26e1 bd 97 05 LDA &0597,X ; movers_flags &26e4 0a ASL A &26e5 08 PHP ; mover is plotted # Set carry if mover was plotted (MOVER_FLAG_PLOTTED) &26e6 4a LSR A &26e7 9d 97 05 STA &0597,X ; movers_flags &26ea 85 5b STA &5b ; mover_flags &26ec 28 PLP ; mover is plotted &26ed 90 04 BCC &26f3 ; skip_unplotting_mover &26ef 38 SEC # Set carry to unplot mover &26f0 20 0e 27 JSR &270e ; plot_or_unplot_mover # Unplot mover ; skip_unplotting_mover &26f3 20 cb 27 JSR &27cb ; update_mover &26f6 20 2a 27 JSR &272a ; check_if_mover_is_on_screen # Returns carry clear if mover is on screen &26f9 b0 0f BCS &270a ; skip_plotting_mover &26fb 20 66 27 JSR &2766 ; calculate_mover_screen_address &26fe 18 CLC # Clear carry to unplot mover &26ff 20 0e 27 JSR &270e ; plot_or_unplot_mover # Plot mover &2702 bd 97 05 LDA &0597,X ; movers_flags &2705 09 80 ORA #&80 ; MOVER_FLAG_PLOTTED &2707 9d 97 05 STA &0597,X ; movers_flags ; skip_plotting_mover &270a ca DEX &270b 10 ab BPL &26b8 ; update_movers_loop &270d 60 RTS ; plot_or_unplot_mover &270e 08 PHP ; plotting or unplotting &270f 86 39 STX &39 ; mover &2711 20 cc 23 JSR &23cc ; use_mover_position &2714 bd 93 34 LDA &3493,X ; movers_screen_address_low &2717 85 04 STA &04 ; plot_screen_address_low &2719 bd b8 34 LDA &34b8,X ; movers_screen_address_high &271c 85 05 STA &05 ; plot_screen_address_high &271e a6 f9 LDX &f9 ; mover_sprite &2720 a5 5b LDA &5b ; mover_flags &2722 0a ASL A # Set top bit if MOVER_FLAG_FLIPPED set &2723 28 PLP ; plotting or unplotting &2724 20 de 0f JSR &0fde ; plot_or_unplot_sprite &2727 a6 39 LDX &39 ; mover &2729 60 RTS ; check_if_mover_is_on_screen &272a bd 00 04 LDA &0400,X ; movers_tile_x &272d c5 19 CMP &19 ; screen_left_tile_x &272f 90 2a BCC &275b ; leave_with_carry_set &2731 d0 07 BNE &273a ; skip_left_fraction_check &2733 bd 71 35 LDA &3571,X ; movers_tile_x_fraction &2736 c5 1b CMP &1b ; screen_left_tile_x_fraction &2738 90 21 BCC &275b ; leave_with_carry_set ; skip_left_fraction_check &273a bd 00 04 LDA &0400,X ; movers_tile_x &273d c5 1a CMP &1a ; screen_right_tile_x &273f f0 02 BEQ &2743 ; consider_fraction &2741 b0 18 BCS &275b ; leave_with_carry_set ; consider_fraction &2743 d0 07 BNE &274c ; skip_right_fraction_check &2745 bd 71 35 LDA &3571,X ; movers_tile_x_fraction &2748 c5 1c CMP &1c ; screen_right_tile_x_fraction &274a b0 0f BCS &275b ; leave_with_carry_set ; skip_right_fraction_check &274c bd 25 04 LDA &0425,X ; movers_tile_y &274f c5 0e CMP &0e ; screen_top_y &2751 90 08 BCC &275b ; leave_with_carry_set &2753 c5 18 CMP &18 ; screen_bottom_y &2755 f0 06 BEQ &275d ; consider_y_fraction &2757 b0 02 BCS &275b ; leave_with_carry_set &2759 18 CLC # Leave with carry clear to indicate mover is on screen &275a 60 RTS ; leave_with_carry_set &275b 38 SEC # Leave with carry set to indicate mover is not on screen &275c 60 RTS ; consider_y_fraction &275d bd 4a 04 LDA &044a,X ; movers_tile_y_fraction &2760 c9 03 CMP #&03 &2762 b0 f7 BCS &275b ; leave_with_carry_set &2764 18 CLC # Leave with carry clear to indicate mover is on screen &2765 60 RTS ; calculate_mover_screen_address &2766 8a TXA &2767 48 PHA ; mover &2768 bd 4a 04 LDA &044a,X ; movers_tile_y_fraction &276b 85 03 STA &03 ; relative_y_fraction &276d bd 00 04 LDA &0400,X ; movers_tile_x &2770 38 SEC &2771 e5 0f SBC &0f ; screen_left_x &2773 85 37 STA &37 ; relative_x &2775 bd 71 35 LDA &3571,X ; movers_tile_x_fraction &2778 38 SEC &2779 e5 10 SBC &10 ; screen_x_fraction &277b 10 02 BPL &277f ; not_negative &277d c6 37 DEC &37 ; relative_x ; not_negative &277f 29 07 AND #&07 &2781 85 04 STA &04 ; relative_x_fraction &2783 bd 25 04 LDA &0425,X ; movers_tile_y &2786 4a LSR A &2787 aa TAX &2788 bd c7 30 LDA &30c7,X ; tile_y_to_relative_y_table &278b 69 00 ADC #&00 &278d 85 05 STA &05 ; relative_y &278f 20 9f 27 JSR &279f ; calculate_screen_address_from_relative_position &2792 68 PLA ; mover &2793 aa TAX &2794 a5 00 LDA &00 ; screen_address_low &2796 9d 93 34 STA &3493,X ; movers_screen_address_low &2799 a5 01 LDA &01 ; screen_address_high &279b 9d b8 34 STA &34b8,X ; movers_screen_address_high &279e 60 RTS ; calculate_screen_address_from_relative_position &279f a5 20 LDA &20 ; screen_start_address_low &27a1 85 00 STA &00 ; screen_address_low &27a3 a5 21 LDA &21 ; screen_start_address_high &27a5 85 01 STA &01 ; screen_address_high &27a7 a2 40 LDX #&40 ; &0040 = 8 * 8 &27a9 a0 00 LDY #&00 &27ab a5 37 LDA &37 ; relative_x &27ad 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address # Add relative_x * 8 * 8 &27b0 a2 00 LDX #&00 ; &0a00 = &0280 * 4 &27b2 a0 0a LDY #&0a &27b4 a5 05 LDA &05 ; relative_y &27b6 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address # Add relative_y * &280 * 4 &27b9 a2 80 LDX #&80 ; &0280 &27bb a0 02 LDY #&02 &27bd a5 03 LDA &03 ; relative_y_fraction &27bf 20 e3 09 JSR &09e3 ; add_A_times_XY_to_screen_address # Add relative_y_fraction * &280 &27c2 a2 08 LDX #&08 ; &0008 &27c4 a0 00 LDY #&00 &27c6 a5 04 LDA &04 ; relative_x_fraction &27c8 4c e3 09 JMP &09e3 ; add_A_times_XY_to_screen_address # Add relative_x_fraction * 8 ; update_mover # Called with X = mover &27cb a5 5b LDA &5b ; mover_flags &27cd 85 df STA &df ; previous_mover_flags # Unused variable &27cf 29 3f AND #&3f ; !(MOVER_FLAG_PLOTTED | MOVER_FLAG_FLIPPED) &27d1 85 5b STA &5b ; mover_flags &27d3 29 03 AND #&03 ; MOVER_FLAG_TARGET_MASK &27d5 85 00 STA &00 ; target &27d7 8a TXA &27d8 0a ASL A # Four fixed targets per mover &27d9 0a ASL A &27da 18 CLC &27db 65 00 ADC &00 ; target &27dd a8 TAY &27de b9 6f 04 LDA &046f,Y ; movers_fixed_targets_x &27e1 85 5c STA &5c ; mover_target_x &27e3 b9 03 05 LDA &0503,Y ; movers_fixed_targets_y &27e6 85 5d STA &5d ; mover_target_y &27e8 a5 5b LDA &5b ; mover_flags &27ea 29 08 AND #&08 ; MOVER_FLAG_USE_TARGET # Is the mover using an alternative target? &27ec f0 0a BEQ &27f8 ; skip_using_target &27ee bd 27 35 LDA &3527,X ; movers_target_x &27f1 85 5c STA &5c ; mover_target_x &27f3 bd 4c 35 LDA &354c,X ; movers_target_y &27f6 85 5d STA &5d ; mover_target_y ; skip_using_target &27f8 bc e9 33 LDY &33e9,X ; movers_type &27fb 86 f8 STX &f8 ; mover &27fd b9 d3 32 LDA &32d3,Y ; mover_type_sprites - 1 &2800 85 e8 STA &e8 ; mover_sprite &2802 a2 00 LDX #&00 &2804 86 a0 STX &a0 ; suppress_changing_target # Set to zero to permit changing target &2806 86 cb STX &cb ; mover_reached_target # Set to zero to indicate mover didn't reach target &2808 a5 5c LDA &5c ; mover_target_x &280a c5 59 CMP &59 ; mover_tile_x &280c f0 06 BEQ &2814 ; consider_vertical_movement # If the mover isn't horizontally aligned with target, &280e a2 10 LDX #&10 ; MOVER_DIRECTION_FLAG_LEFT # set the mover moving horizontally towards the target &2810 90 02 BCC &2814 ; consider_vertical_movement &2812 a2 08 LDX #&08 ; MOVER_DIRECTION_FLAG_RIGHT ; consider_vertical_movement &2814 8a TXA &2815 a6 5a LDX &5a ; mover_tile_y &2817 e4 5d CPX &5d ; mover_target_y &2819 f0 08 BEQ &2823 ; set_mover_direction_flags # If the mover isn't vertically aligned with target, &281b 90 04 BCC &2821 ; set_moving_down # set the mover moving vertically towards the target &281d 09 02 ORA #&02 ; MOVER_DIRECTION_FLAG_UP &281f d0 02 BNE &2823 ; set_mover_direction_flags # Always branches ; set_moving_down &2821 09 04 ORA #&04 ; MOVER_DIRECTION_FLAG_DOWN ; set_mover_direction_flags &2823 85 14 STA &14 ; mover_direction_flags &2825 a6 f8 LDX &f8 ; mover &2827 bd b0 06 LDA &06b0,X ; movers_object_carried_or_disabled # Top bit set if mover has been disabled by explosion &282a 10 03 BPL &282f ; not_exploded # If MOVER_DISABLED set, &282c 4c b9 28 JMP &28b9 ; skip_updating_mover # don't move mover ; not_exploded &282f a5 f9 LDA &f9 ; mover_sprite &2831 c9 06 CMP #&06 ; SPRITE_CONTROLLER &2833 d0 56 BNE &288b ; not_controller ; consider_controller_touching_cloth # If the mover is a controller, &2835 ad cc 05 LDA &05cc ; objects_tile_x + &10 (OBJECT_CLOTH) &2838 c5 59 CMP &59 ; mover_tile_x # Is the controller touching the cloth? &283a d0 24 BNE &2860 ; not_touching_cloth &283c ad 09 06 LDA &0609 ; objects_tile_x_fraction + &10 (OBJECT_CLOTH) &283f c5 57 CMP &57 ; mover_tile_x_fraction &2841 d0 1d BNE &2860 ; not_touching_cloth &2843 a6 5a LDX &5a ; mover_tile_y &2845 a5 58 LDA &58 ; mover_tile_y_fraction &2847 18 CLC &2848 69 02 ADC #&02 &284a c9 04 CMP #&04 &284c 90 01 BCC &284f ; not_next_tile_down &284e e8 INX ; not_next_tile_down &284f 29 03 AND #&03 &2851 cd 83 06 CMP &0683 ; objects_tile_y_fraction + &10 (OBJECT_CLOTH) &2854 d0 0a BNE &2860 ; not_touching_cloth &2856 ec 46 06 CPX &0646 ; objects_tile_y + &10 (OBJECT_CLOTH) &2859 d0 05 BNE &2860 ; not_touching_cloth &285b 8e ed 07 STX &07ed ; mover_touching_cloth # Set to non-zero to indicate mover is touching cloth &285e f0 59 BEQ &28b9 ; skip_updating_mover # Always branches ; not_touching_cloth ; consider_controller_touching_detonator &2860 ad dc 05 LDA &05dc ; objects_tile_x + &20 (OBJECT_TYPE_DETONATOR) &2863 c5 59 CMP &59 ; mover_tile_x # Is the controller touching the detonator? &2865 d0 24 BNE &288b ; not_touching_detonator &2867 ad 19 06 LDA &0619 ; objects_tile_x_fraction + &20 (OBJECT_TYPE_DETONATOR) &286a c5 57 CMP &57 ; mover_tile_x_fraction &286c d0 1d BNE &288b ; not_touching_detonator &286e a6 5a LDX &5a ; mover_tile_y &2870 a5 58 LDA &58 ; mover_tile_y_fraction &2872 18 CLC &2873 69 02 ADC #&02 &2875 c9 04 CMP #&04 &2877 90 01 BCC &287a ; not_next_tile_down &2879 e8 INX ; not_next_tile_down &287a 29 03 AND #&03 &287c cd 93 06 CMP &0693 ; objects_tile_y_fraction + &20 (OBJECT_TYPE_DETONATOR) &287f d0 0a BNE &288b ; not_touching_detonator &2881 ec 56 06 CPX &0656 ; objects_tile_y + &20 (OBJECT_TYPE_DETONATOR) &2884 d0 05 BNE &288b ; not_touching_detonator &2886 a9 00 LDA #&00 &2888 8d d4 07 STA &07d4 ; detonator_countdown # Set to zero to stop detonator countdown ; not_touching_detonator ; not_controller &288b a5 16 LDA &16 ; player_killed &288d d0 2a BNE &28b9 ; skip_updating_mover &288f a5 5f LDA &5f ; suppress_updating # Non-zero if only plotting, not updating &2891 d0 26 BNE &28b9 ; skip_updating_mover &2893 98 TYA ; mover_type &2894 c9 0a CMP #&0a ; MOVER_TYPE_LAST + 1 &2896 b0 23 BCS &28bb ; update_mover_position &2898 0a ASL A &2899 a8 TAY &289a b9 a5 28 LDA &28a5,Y ; mover_update_handler_addresses_table - 2 &289d 85 00 STA &00 ; update_handler_address_low &289f b9 a6 28 LDA &28a6,Y ; mover_update_handler_addresses_table - 2 &28a2 85 01 STA &01 ; update_handler_address_high &28a4 6c 00 00 JMP (&0000) ; update_handler_address ; mover_update_handler_addresses_table &28a7 60 2b ; &01 (MOVER_TYPE_FAST_CONTROLLER) : &2b60 ; update_fast_controller &28a9 91 2b ; &02 (MOVER_TYPE_SLOW_CONTROLLER) : &2b91 ; update_slow_controller &28ab a1 2b ; &03 (MOVER_TYPE_COOLED_CONTROLLER) : &2ba1 ; update_cooled_controller &28ad 00 29 ; &04 (MOVER_TYPE_STATIC_CONTROLLER) : &2900 ; update_static_controller &28af bf 29 ; &05 (MOVER_TYPE_SPLINX) : &29bf ; update_splinx &28b1 2f 2b ; &06 (MOVER_TYPE_RIJAN) : &2b2f ; update_rijan &28b3 69 2b ; &07 (MOVER_TYPE_MADRAG) : &2b69 ; update_madrag &28b5 03 29 ; &08 (MOVER_TYPE_MASTER) : &2903 ; update_master &28b7 75 29 ; &09 (MOVER_TYPE_PRISON_ESCORT_CONTROLLER) : &2975 ; update_prison_escort_controller ; skip_updating_mover &28b9 e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target ; update_mover_position &28bb a5 a0 LDA &a0 ; suppress_changing_target &28bd 05 cb ORA &cb ; mover_reached_target &28bf 05 5f ORA &5f ; suppress_updating # Non-zero if only plotting, not updating &28c1 d0 07 BNE &28ca ; not_stalled # If the mover has stalled, &28c3 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB &28c6 29 03 AND #&03 ; MOVER_FLAG_TARGET_MASK # set a random target &28c8 85 5b STA &5b ; mover_flags ; not_stalled &28ca a6 f8 LDX &f8 ; mover &28cc a5 14 LDA &14 ; mover_direction_flags &28ce 29 08 AND #&08 ; MOVER_DIRECTION_FLAG_RIGHT &28d0 d0 06 BNE &28d8 ; not_flipped # If the mover isn't moving right, &28d2 a5 5b LDA &5b ; mover_flags &28d4 09 40 ORA #&40 ; MOVER_FLAG_FLIPPED # flip its sprite &28d6 85 5b STA &5b ; mover_flags ; not_flipped &28d8 a5 55 LDA &55 ; mover_tile_address_low &28da 9d dd 34 STA &34dd,X ; movers_tile_address_low &28dd a5 56 LDA &56 ; mover_tile_address_high &28df 9d 02 35 STA &3502,X ; movers_tile_address_high &28e2 a5 57 LDA &57 ; mover_tile_x_fraction &28e4 9d 71 35 STA &3571,X ; movers_tile_x_fraction &28e7 a5 58 LDA &58 ; mover_tile_y_fraction &28e9 9d 4a 04 STA &044a,X ; movers_tile_y_fraction &28ec a5 59 LDA &59 ; mover_tile_x &28ee 9d 00 04 STA &0400,X ; movers_tile_x &28f1 a5 5a LDA &5a ; mover_tile_y &28f3 9d 25 04 STA &0425,X ; movers_tile_y &28f6 a5 39 LDA &39 ; mover &28f8 f0 05 BEQ &28ff ; leave # If the mover isn't Splinx (MOVER_SPLINX), &28fa a5 5b LDA &5b ; mover_flags &28fc 9d 97 05 STA &0597,X ; movers_flags # update its flags ; leave &28ff 60 RTS ; update_static_controller # Unused &2900 4c bb 28 JMP &28bb ; update_mover_position ; update_master &2903 e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2905 a2 0a LDX #&0a ; SPRITE_MASTER &2907 a5 57 LDA &57 ; mover_tile_x_fraction &2909 29 01 AND #&01 &290b d0 02 BNE &290f ; set_master_sprite &290d a2 29 LDX #&29 ; SPRITE_MASTER_FRAME_TWO ; set_master_sprite &290f 8e db 32 STX &32db ; mover_type_sprites - 1 + 8 (MOVER_TYPE_MASTER) &2912 ad f9 07 LDA &07f9 ; suppress_stealing_tiru_lattice # Non-zero to suppress stealing &2915 d0 2d BNE &2944 ; skip_stealing_tiru_lattice &2917 a5 0a LDA &0a ; player_x &2919 c9 6d CMP #&6d # Is the player at (&6d, &1b) (the Master's column)? &291b d0 e3 BNE &2900 ; to_update_mover_position &291d a5 0b LDA &0b ; player_y &291f c9 1b CMP #&1b &2921 d0 dd BNE &2900 ; to_update_mover_position &2923 a9 0d LDA #&0d ; OBJECT_TYPE_TIRU_LATTICE &2925 20 74 12 JSR &1274 ; check_if_carrying_object_type # Returns carry clear if carrying object &2928 b0 d6 BCS &2900 ; to_update_mover_position # If so, is the player carrying the TIRU lattice? &292a bc dd 07 LDY &07dd,X ; inventory &292d a9 00 LDA #&00 &292f 9d dd 07 STA &07dd,X ; inventory # Set to zero to remove object from inventory &2932 88 DEY &2933 8c 44 14 STY &1444 ; object_to_remove &2936 20 ac 1c JSR &1cac ; plot_dead_or_stunned_player &2939 a9 46 LDA #&46 &293b 8d ef 07 STA &07ef ; stolen_tiru_stun_cooldown # Stun the player for 50 updates &293e 8d f9 07 STA &07f9 ; suppress_stealing_tiru_lattice # Set to non-zero to suppress stealing again &2941 4c bb 28 JMP &28bb ; update_mover_position ; skip_stealing_tiru_lattice &2944 a5 5b LDA &5b ; mover_flags &2946 d0 03 BNE &294b ; skip_resetting_stolen # until the Master is moving right &2948 8d f9 07 STA &07f9 ; suppress_stealing_tiru_lattice # Set to zero to permit stealing again ; skip_resetting_stolen &294b 20 c1 2b JSR &2bc1 ; move_mover &294e ad ef 07 LDA &07ef ; stolen_tiru_stun_cooldown &2951 c9 01 CMP #&01 &2953 d0 1d BNE &2972 ; to_update_mover_position &2955 a9 00 LDA #&00 # Set to zero to allow player movement &2957 20 e5 1c JSR &1ce5 ; plot_unstunned_player &295a a9 80 LDA #&80 # Unnecessary code &295c 85 5a STA &5a ; mover_tile_y # possibly meant to be mover_tile_x to position the Master? &295e a9 1b LDA #&1b &2960 85 5a STA &5a ; mover_tile_y &2962 a9 49 LDA #&49 # Put TIRU lattice at (&49, &02) (top right of tower) &2964 8d cd 05 STA &05cd ; objects_tile_x + &11 (OBJECT_TIRU_LATTICE) &2967 a9 02 LDA #&02 &2969 8d 47 06 STA &0647 ; objects_tile_y + &11 (OBJECT_TIRU_LATTICE) &296c 8d 0a 06 STA &060a ; objects_tile_x_fraction + &11 (OBJECT_TIRU_LATTICE) &296f 8d 84 06 STA &0684 ; objects_tile_y_fraction (OBJECT_TIRU_LATTICE) ; to_update_mover_position &2972 4c bb 28 JMP &28bb ; update_mover_position ; update_prison_escort_controller &2975 e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2977 a5 0b LDA &0b ; player_y &2979 c9 0b CMP #&0b # Is the player at (..., &0b)? (level with prison cell) &297b d0 3f BNE &29bc ; to_update_mover_position &297d a5 5b LDA &5b ; mover_flags &297f c9 01 CMP #&01 ; MOVER_TARGET_ONE # Is the controller escorting the player? &2981 d0 17 BNE &299a ; is_escorting_or_has_escorted &2983 20 c1 2b JSR &2bc1 ; move_mover &2986 a9 01 LDA #&01 ; MOVER_TARGET_ONE # Set controller to target (&69, &0b) &2988 85 5b STA &5b ; mover_flags # (inside room with explosives) &298a a5 16 LDA &16 ; player_killed # Non-zero if player touched controller &298c f0 09 BEQ &2997 ; skip_starting_escort &298e e6 5b INC &5b ; mover_flags ; MOVER_TARGET_TWO # Set controller to target (&5e, &0b) &2990 a2 ff LDX #&ff # (right wall of prison cell, escorting player) &2992 86 f5 STX &f5 ; suppress_player_input # Set to non-zero to suppress player input &2994 e8 INX ; 0 &2995 86 16 STX &16 ; player_killed # Set to zero to indicate player wasn't killed ; skip_starting_escort &2997 4c bb 28 JMP &28bb ; update_mover_position ; is_escorting_or_has_escorted &299a a6 f5 LDX &f5 ; suppress_player_input &299c f0 17 BEQ &29b5 ; has_finished_escorting &299e 20 f6 2e JSR &2ef6 ; backup_player_state &29a1 a9 02 LDA #&02 ; PLAYER_FLAGS_MOVING_LEFT # Move player left into prison cell &29a3 85 40 STA &40 ; player_movement_flags &29a5 a5 0a LDA &0a ; player_x &29a7 c9 5c CMP #&5c # Is the player at (&5c, &0b)? (left wall of prison cell) &29a9 d0 06 BNE &29b1 ; skip_ending_escort &29ab a2 00 LDX #&00 &29ad 86 f5 STX &f5 ; suppress_player_input # Set to zero to allow player to move &29af 86 40 STX &40 ; player_movement_flags # Set to zero to indicate not jumping or falling ; skip_ending_escort &29b1 c9 68 CMP #&68 # Is the player right of (&68, ...)? &29b3 b0 03 BCS &29b8 ; skip_moving # i.e. inside room with explosives? &29b5 20 c1 2b JSR &2bc1 ; move_mover ; skip_moving &29b8 a9 02 LDA #&02 ; MOVER_TARGET_TWO # Set controller to target (&5e, &0b) &29ba 85 5b STA &5b ; mover_flags # (right wall of prison cell, escorting player) ; to_update_mover_position &29bc 4c bb 28 JMP &28bb ; update_mover_position ; update_splinx &29bf ad ed 06 LDA &06ed ; splinx_active # Non-zero if Splinx is active &29c2 d0 20 BNE &29e4 ; is_active ; is_inactive # If splix is inactive, &29c4 ad e7 05 LDA &05e7 ; objects_tile_x + &2b (OBJECT_SPLINX) # Set Splinx as mover position from splinx as object &29c7 85 59 STA &59 ; mover_tile_x &29c9 ad 61 06 LDA &0661 ; objects_tile_y + &2b (OBJECT_SPLINX) &29cc 85 5a STA &5a ; mover_tile_y &29ce ad 24 06 LDA &0624 ; objects_tile_x_fraction + &2b (OBJECT_SPLINX) &29d1 85 57 STA &57 ; mover_tile_x_fraction &29d3 ad 9e 06 LDA &069e ; objects_tile_y_fraction + &2b (OBJECT_SPLINX) &29d6 85 58 STA &58 ; mover_tile_y_fraction &29d8 ad 49 07 LDA &0749 ; objects_tile_address_low + &2b (OBJECT_SPLINX) &29db 85 55 STA &55 ; mover_tile_address_low &29dd ad c5 01 LDA &01c5 ; objects_tile_address_high + &2b (OBJECT_SPLINX) &29e0 85 56 STA &56 ; mover_tile_address_high &29e2 d0 1e BNE &2a02 ; set_updated # Always branches ; is_active # If Splinx is active, &29e4 a5 59 LDA &59 ; mover_tile_x # Set Splinx as object position from splinx as mover &29e6 8d e7 05 STA &05e7 ; objects_tile_x + &2b (OBJECT_SPLINX) &29e9 a5 5a LDA &5a ; mover_tile_y &29eb 8d 61 06 STA &0661 ; objects_tile_y + &2b (OBJECT_SPLINX) &29ee a5 57 LDA &57 ; mover_tile_x_fraction &29f0 8d 24 06 STA &0624 ; objects_tile_x_fraction + &2b (OBJECT_SPLINX) &29f3 a5 58 LDA &58 ; mover_tile_y_fraction &29f5 8d 9e 06 STA &069e ; objects_tile_y_fraction + &2b (OBJECT_SPLINX) &29f8 a5 55 LDA &55 ; mover_tile_address_low &29fa 8d 49 07 STA &0749 ; objects_tile_address_low + &2b (OBJECT_SPLINX) &29fd a5 56 LDA &56 ; mover_tile_address_high &29ff 8d c5 01 STA &01c5 ; objects_tile_address_high + &2b (OBJECT_SPLINX) ; set_updated &2a02 ad dd 32 LDA &32dd ; splinx_ready_for_next_step &2a05 85 a0 STA &a0 ; suppress_changing_target &2a07 a9 00 LDA #&00 &2a09 8d dd 32 STA &32dd ; splinx_ready_for_next_step # Seto to zero to indicate Splinx not ready for next step &2a0c a9 05 LDA #&05 ; SPRITE_SPLINX_INACTIVE &2a0e ae ed 06 LDX &06ed ; splinx_active # Non-zero if Splinx is active &2a11 f0 02 BEQ &2a15 ; set_splinx_sprite &2a13 a9 04 LDA #&04 ; SPRITE_SPLINX_ACTIVE ; set_splinx_sprite &2a15 8d d8 32 STA &32d8 ; mover_type_sprites - 1 + 5 (MOVER_TYPE_SPLINX) &2a18 c9 04 CMP #&04 ; SPRITE_SPLINX_ACTIVE &2a1a f0 03 BEQ &2a1f ; update_active_splinx &2a1c 4c bb 28 JMP &28bb ; update_mover_position # Inactive Splinx doesn't move ; update_active_splinx &2a1f a5 92 LDA &92 ; splinx_slot &2a21 29 07 AND #&07 &2a23 85 92 STA &92 ; splinx_slot &2a25 aa TAX &2a26 bd cc 07 LDA &07cc,X ; splinx_program &2a29 d0 08 BNE &2a33 ; consider_step_of_program ; move_to_next_step_of_splinx_program &2a2b ee dd 32 INC &32dd ; splinx_ready_for_next_step # Set to non-zero to indicate Splinx ready for next step &2a2e e6 92 INC &92 ; splinx_slot ; to_update_mover_position &2a30 4c bb 28 JMP &28bb ; update_mover_position ; consider_step_of_program &2a33 a2 00 LDX #&00 # Unnecessary code &2a35 c9 05 CMP #&05 ; SPLINX_COMMAND_GO_4 + 1 &2a37 90 3a BCC &2a73 ; handle_splinx_go_command &2a39 c9 07 CMP #&07 ; SPLINX_COMMAND_FOLLOW &2a3b d0 43 BNE &2a80 ; consider_staying ; handle_splinx_follow_command &2a3d a6 0a LDX &0a ; player_x &2a3f a4 0b LDY &0b ; player_y ; set_splinx_target &2a41 20 76 2d JSR &2d76 ; set_mover_target # Set Splinx targeting player's position &2a44 ad f3 07 LDA &07f3 ; splinx_reached_target # Non-zero if Splinx reached target &2a47 d0 22 BNE &2a6b ; end_following &2a49 ad f1 07 LDA &07f1 ; splinx_power &2a4c f0 36 BEQ &2a84 ; handle_splinx_stay_command # Deactive Splinx when out of power &2a4e ce f2 07 DEC &07f2 ; splinx_power_fraction # Following player uses energy &2a51 d0 08 BNE &2a5b ; skip_underflow &2a53 a9 1e LDA #&1e ; 30 &2a55 8d f2 07 STA &07f2 ; splinx_power_fraction &2a58 ce f1 07 DEC &07f1 ; splinx_power ; skip_underflow &2a5b 20 c1 2b JSR &2bc1 ; move_mover # Sets suppress_changing_target if Splinx could move &2a5e a5 cb LDA &cb ; mover_reached_target # Non-zero if Splinx reached target &2a60 f0 05 BEQ &2a67 ; not_at_target &2a62 ee f3 07 INC &07f3 ; splinx_reached_target # Set to non-zero to indicate Splinx reached target &2a65 d0 c4 BNE &2a2b ; move_to_next_step_of_splinx_program # Always branches ; not_at_target &2a67 a5 a0 LDA &a0 ; suppress_changing_target # Non-zero if Splinx was able to move &2a69 f0 c0 BEQ &2a2b ; move_to_next_step_of_splinx_program ; end_following &2a6b a9 00 LDA #&00 &2a6d 8d f3 07 STA &07f3 ; splinx_reached_target # Set to zero to indicate Splinx hasn't reached target &2a70 4c bb 28 JMP &28bb ; update_mover_position ; handle_splinx_go_command &2a73 aa TAX # A = marker to go to &2a74 bc 35 06 LDY &0635,X ; objects_tile_y - 1 # Has that marker been dropped? &2a77 30 b2 BMI &2a2b ; move_to_next_step_of_splinx_program # If not, move to next step of program &2a79 bd bb 05 LDA &05bb,X ; objects_tile_x - 1 &2a7c aa TAX &2a7d 4c 41 2a JMP &2a41 ; set_splinx_target # Otherwise, set Splinx targeting that marker ; consider_staying &2a80 c9 08 CMP #&08 ; SPLINX_COMMAND_STAY &2a82 d0 07 BNE &2a8b ; consider_charging ; handle_splinx_stay_command &2a84 a9 00 LDA #&00 &2a86 8d ed 06 STA &06ed ; splinx_active # Set to zero to indicate Splinx is not active &2a89 f0 a0 BEQ &2a2b ; move_to_next_step_of_splinx_program # Always branches ; consider_charging &2a8b c9 09 CMP #&09 ; HANDLE_SPLINX_CHARGE_COMMAND &2a8d d0 0c BNE &2a9b ; consider_dropping_and_picking_up &2a8f ad f1 07 LDA &07f1 ; splinx_power &2a92 c9 63 CMP #&63 &2a94 f0 95 BEQ &2a2b ; move_to_next_step_of_splinx_program # Is Splinx fully charged? &2a96 ee f1 07 INC &07f1 ; splinx_power # Splinx can charge anywhere &2a99 10 95 BPL &2a30 ; to_update_mover_position # Always branches ; consider_dropping_and_picking_up &2a9b c9 06 CMP #&06 ; SPLINX_COMMAND_DROP &2a9d f0 06 BEQ &2aa5 ; handle_splinx_drop_command ; handle_splinx_pick_command &2a9f 20 f4 2a JSR &2af4 ; consider_mover_picking_up_object &2aa2 4c 2b 2a JMP &2a2b ; move_to_next_step_of_splinx_program ; handle_splinx_drop_command &2aa5 20 ad 2a JSR &2aad ; consider_mover_dropping_object # Returns carry set if no object now carried &2aa8 b0 81 BCS &2a2b ; move_to_next_step_of_splinx_program &2aaa 4c bb 28 JMP &28bb ; update_mover_position ; consider_mover_dropping_object &2aad a6 f8 LDX &f8 ; mover &2aaf bc b0 06 LDY &06b0,X ; movers_object_carried_or_disabled # Zero if mover isn't carrying any object &2ab2 f0 2c BEQ &2ae0 ; leave_with_carry_set &2ab4 2c e3 07 BIT &07e3 ; thrown_object # Negative if no object is being thrown &2ab7 30 02 BMI &2abb ; mover_drops_object &2ab9 18 CLC # Leave with carry clear to indicate object still carried &2aba 60 RTS ; mover_drops_object &2abb 88 DEY &2abc a5 59 LDA &59 ; mover_tile_x &2abe 99 bc 05 STA &05bc,Y ; objects_tile_x &2ac1 a5 5a LDA &5a ; mover_tile_y &2ac3 99 36 06 STA &0636,Y ; objects_tile_y &2ac6 a5 57 LDA &57 ; mover_tile_x_fraction &2ac8 99 f9 05 STA &05f9,Y ; objects_tile_x_fraction &2acb a5 58 LDA &58 ; mover_tile_y_fraction &2acd 99 73 06 STA &0673,Y ; objects_tile_y_fraction &2ad0 8c e3 07 STY &07e3 ; thrown_object &2ad3 a9 02 LDA #&02 ; THROW_DOWN &2ad5 8d e4 07 STA &07e4 ; throw_direction &2ad8 8d 92 34 STA &3492 ; throw_distance_remaining &2adb a9 00 LDA #&00 &2add 9d b0 06 STA &06b0,X ; movers_object_carried_or_disabled # Set to zero to indicate mover not carrying object ; leave_with_carry_set &2ae0 38 SEC # Leave with carry set to indicate no object carried &2ae1 60 RTS ; use_object_position_one_fraction_left &2ae2 20 aa 23 JSR &23aa ; use_object_position &2ae5 c6 48 DEC &48 ; this_tile_x_fraction &2ae7 10 0a BPL &2af3 ; not_next_tile_left &2ae9 a9 07 LDA #&07 &2aeb 85 48 STA &48 ; this_tile_x_fraction &2aed c6 46 DEC &46 ; this_tile_address_low &2aef d0 02 BNE &2af3 ; skip_page &2af1 c6 47 DEC &47 ; this_tile_address_high ; skip_page ; not_next_tile_left &2af3 60 RTS ; consider_mover_picking_up_object &2af4 a6 f8 LDX &f8 ; mover &2af6 bd b0 06 LDA &06b0,X ; movers_object_carried_or_disabled # Zero if mover is not carrying an object &2af9 f0 02 BEQ &2afd ; not_carrying_object &2afb 18 CLC # Unnecessary code; carry is unused &2afc 60 RTS ; not_carrying_object &2afd a5 57 LDA &57 ; mover_tile_x_fraction &2aff 85 02 STA &02 ; tile_x_fraction &2b01 a5 58 LDA &58 ; mover_tile_y_fraction &2b03 85 03 STA &03 ; tile_y_fraction &2b05 a5 59 LDA &59 ; mover_tile_x &2b07 85 00 STA &00 ; tile_x &2b09 a5 5a LDA &5a ; mover_tile_y &2b0b 85 01 STA &01 ; tile_y &2b0d a2 00 LDX #&00 ; tile # Use mover's position for check &2b0f 20 7a 25 JSR &257a ; check_if_touching_object # Returns carry set if touching object &2b12 b0 01 BCS &2b15 ; consider_mover_picking_up_object_touched &2b14 60 RTS ; consider_mover_picking_up_object_touched &2b15 bd 0e 34 LDA &340e,X ; objects_type &2b18 29 3f AND #&3f ; OBJECT_TYPE_MASK &2b1a c9 17 CMP #&17 ; OBJECT_TYPE_HATCH &2b1c f0 dd BEQ &2afb ; skip_picking_up_object # Can't pick up hatch &2b1e c9 1b CMP #&1b ; OBJECT_HEATONITE_ORE &2b20 f0 d9 BEQ &2afb ; skip_picking_up_object # Can't pick up ore &2b22 a9 ff LDA #&ff &2b24 9d 36 06 STA &0636,X ; objects_tile_y &2b27 e8 INX &2b28 8a TXA &2b29 a6 f8 LDX &f8 ; mover ; skip_picking_up_object &2b2b 9d b0 06 STA &06b0,X ; movers_object_carried_or_disabled # Set to non-zero to indicate mover carrying object &2b2e 60 RTS ; update_rijan &2b2f a5 57 LDA &57 ; mover_tile_x_fraction &2b31 29 01 AND #&01 ; SPRITE_RIJAN_FRAME_TWO - SPRITE_RIJAN &2b33 18 CLC &2b34 69 07 ADC #&07 ; SPRITE_RIJAN &2b36 8d d9 32 STA &32d9 ; mover_type_sprites - 1 + 6 (MOVER_TYPE_RIJAN) &2b39 a5 59 LDA &59 ; mover_tile_x &2b3b c9 0a CMP #&0a # Is the Rijan at (&0a, &2f) (drop point)? &2b3d d0 17 BNE &2b56 ; move_rijan &2b3f a5 5a LDA &5a ; mover_tile_y &2b41 c9 2f CMP #&2f &2b43 d0 11 BNE &2b56 ; move_rijan &2b45 a5 14 LDA &14 ; mover_direction_flags &2b47 29 08 AND #&08 ; MOVER_DIRECTION_FLAG_RIGHT &2b49 d0 06 BNE &2b51 ; can_drop ; can_pick_up &2b4b 20 f4 2a JSR &2af4 ; consider_mover_picking_up_object # Picks up pick when moving left, drops when moving right &2b4e 4c 56 2b JMP &2b56 ; move_rijan ; can_drop &2b51 20 ad 2a JSR &2aad ; consider_mover_dropping_object # Returns carry clear if mover is still carrying object &2b54 90 07 BCC &2b5d ; to_update_mover_position # Don't move further until pick has been dropped ; move_rijan &2b56 20 c1 2b JSR &2bc1 ; move_mover &2b59 a9 00 LDA #&00 &2b5b 85 16 STA &16 ; player_killed # Set to zero to indicate player wasn't killed ; to_update_mover_position &2b5d 4c bb 28 JMP &28bb ; update_mover_position ; update_fast_controller &2b60 20 c1 2b JSR &2bc1 ; move_mover # Fast controllers move every update &2b63 20 3e 2d JSR &2d3e ; consider_targeting_player &2b66 4c bb 28 JMP &28bb ; update_mover_position ; update_madrag &2b69 ad ee 07 LDA &07ee ; madrag_eggs_disturbed # Non-zero if Madrag's eggs have moved &2b6c f0 0d BEQ &2b7b ; skip_setting_target &2b6e a5 59 LDA &59 ; mover_tile_x &2b70 c9 2c CMP #&2c # Has the Madrag moved from its initial position? &2b72 90 07 BCC &2b7b ; skip_setting_target &2b74 a2 11 LDX #&11 # If not, set Madrag to target tile (&11, &34) &2b76 a0 34 LDY #&34 # (left of cave beyond eggs) &2b78 20 76 2d JSR &2d76 ; set_mover_target ; skip_setting_target &2b7b a2 09 LDX #&09 ; SPRITE_MADRAG &2b7d a5 57 LDA &57 ; mover_tile_x_fraction &2b7f 29 01 AND #&01 &2b81 d0 02 BNE &2b85 ; set_madrag_sprite &2b83 a2 28 LDX #&28 ; SPRITE_MADRAG_FRAME_TWO ; set_madrag_sprite &2b85 8e da 32 STX &32da ; mover_type_sprites - 1 + 7 (MOVER_TYPE_MADRAG) &2b88 20 c1 2b JSR &2bc1 ; move_mover # Madrag moves every update &2b8b 20 3e 2d JSR &2d3e ; consider_targeting_player &2b8e 4c bb 28 JMP &28bb ; update_mover_position ; update_slow_controller &2b91 a5 5b LDA &5b ; mover_flags &2b93 29 08 AND #&08 ; MOVER_FLAG_USE_TARGET &2b95 d0 21 BNE &2bb8 ; move_controller &2b97 a5 43 LDA &43 ; frame_counter &2b99 29 01 AND #&01 &2b9b d0 1b BNE &2bb8 ; move_controller # Move slow controllers one update in two &2b9d e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2b9f d0 1a BNE &2bbb ; to_consider_targeting_player # Always branches ; update_cooled_controller &2ba1 e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2ba3 ad 58 06 LDA &0658 ; objects_tile_y + &22 (OBJECT_TEST_TUBE) # Is the test tube between (&12, &0b) and (&16, &0b)? &2ba6 c9 0b CMP #&0b # i.e. in the tank of coolant? &2ba8 d0 0e BNE &2bb8 ; move_controller &2baa ad de 05 LDA &05de ; objects_tile_x + &22 (OBJECT_TEST_TUBE) &2bad c9 12 CMP #&12 &2baf 90 07 BCC &2bb8 ; move_controller &2bb1 c9 17 CMP #&17 &2bb3 b0 03 BCS &2bb8 ; move_controller # If not, cooled controllers move every update &2bb5 4c bb 28 JMP &28bb ; update_mover_position # If so, cooled controllers don't move ; move_controller &2bb8 20 c1 2b JSR &2bc1 ; move_mover ; to_consider_targeting_player &2bbb 20 3e 2d JSR &2d3e ; consider_targeting_player &2bbe 4c bb 28 JMP &28bb ; update_mover_position ; move_mover &2bc1 a2 00 LDX #&00 ; move_mover &2bc3 86 4a STX &4a ; unused # Unused variable &2bc5 e8 INX ; 1 &2bc6 86 4b STX &4b ; vertical_chunk_check_results # Unnecessary code &2bc8 20 cc 23 JSR &23cc ; use_mover_position &2bcb a6 e8 LDX &e8 ; mover_sprite &2bcd bd 46 32 LDA &3246,X ; sprite_sizes_table # Calculate width and height of mover &2bd0 4a LSR A &2bd1 4a LSR A &2bd2 4a LSR A &2bd3 38 SEC &2bd4 e9 02 SBC #&02 &2bd6 85 ee STA &ee ; mover_width &2bd8 a0 03 LDY #&03 &2bda bd 2b 33 LDA &332b,X ; sprite_heights_table &2bdd f0 01 BEQ &2be0 ; not_one_or_two_groups &2bdf 88 DEY ; not_one_or_two_groups &2be0 29 80 AND #&80 &2be2 f0 01 BEQ &2be5 ; not_one_group &2be4 88 DEY ; not_one_group &2be5 98 TYA # Check underneath mover &2be6 85 f3 STA &f3 ; height_to_check # Used as y fraction offset for horizontal range &2be8 a6 ee LDX &ee ; mover_width # Used as width of horizontal range &2bea 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns A = chunk type of last or failed chunk &2bed c9 60 CMP #&60 ; CHUNK_FIRST_BACKGROUND &2bef b0 0a BCS &2bfb ; move_mover_down # Branch if background, i.e. mover not supported &2bf1 c9 50 CMP #&50 ; CHUNK_DOWNWARDS_CLIMBABLE_PLATFORM &2bf3 d0 29 BNE &2c1e ; not_moving_down # If the mover can climb down a platform, &2bf5 a5 14 LDA &14 ; mover_direction_flags &2bf7 29 04 AND #&04 ; MOVER_DIRECTION_FLAG_DOWN &2bf9 f0 23 BEQ &2c1e ; not_moving_down # climb down that platform if mover is moving down ; move_mover_down &2bfb e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2bfd a5 14 LDA &14 ; mover_direction_flags &2bff 09 80 ORA #&80 ; MOVER_DIRECTION_FLAG_SUPPRESS_UP # Mover can't move up if not supported &2c01 85 14 STA &14 ; mover_direction_flags &2c03 e6 58 INC &58 ; mover_tile_y_fraction # Move mover down a fraction &2c05 a5 58 LDA &58 ; mover_tile_y_fraction &2c07 c9 04 CMP #&04 &2c09 90 13 BCC &2c1e ; not_next_tile_down &2c0b 29 03 AND #&03 &2c0d 85 58 STA &58 ; mover_tile_y_fraction &2c0f e6 5a INC &5a ; mover_tile_y # Move mover down a tile &2c11 a5 55 LDA &55 ; mover_tile_address_low &2c13 18 CLC &2c14 69 80 ADC #&80 # Move address down a tile &2c16 85 55 STA &55 ; mover_tile_address_low &2c18 a5 56 LDA &56 ; mover_tile_address_high &2c1a 69 00 ADC #&00 &2c1c 85 56 STA &56 ; mover_tile_address_high ; not_next_tile_down ; not_moving_down &2c1e c6 f3 DEC &f3 ; height_to_check # Check bottom of mover &2c20 20 cc 23 JSR &23cc ; use_mover_position &2c23 a5 14 LDA &14 ; mover_direction_flags &2c25 29 08 AND #&08 ; MOVER_DIRECTION_FLAG_RIGHT &2c27 f0 23 BEQ &2c4c ; not_moving_right # If mover wants to move right, &2c29 a5 ee LDA &ee ; mover_width # Check right of mover &2c2b 20 9e 16 JSR &169e ; check_vertical_range_of_chunks &2c2e f0 03 BEQ &2c33 ; not_blocked_to_right # If there is an obstacle to the right of the mover, &2c30 4c 34 2d JMP &2d34 ; use_random_target # set the mover moving towards a random target ; not_blocked_to_right &2c33 e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2c35 e6 57 INC &57 ; mover_tile_x_fraction # Move mover right a fraction &2c37 a5 57 LDA &57 ; mover_tile_x_fraction &2c39 c9 08 CMP #&08 &2c3b 90 0c BCC &2c49 ; not_next_tile_right &2c3d 29 07 AND #&07 &2c3f 85 57 STA &57 ; mover_tile_x_fraction # Move mover right a tile &2c41 e6 59 INC &59 ; mover_tile_x &2c43 e6 55 INC &55 ; mover_tile_address_low # Move address right a tile &2c45 d0 02 BNE &2c49 ; to_not_moving_left &2c47 e6 56 INC &56 ; mover_tile_address_high ; to_not_moving_left &2c49 4c 75 2c JMP &2c75 ; not_moving_left ; not_next_tile_right ; not_moving_right &2c4c a5 14 LDA &14 ; mover_direction_flags &2c4e 29 10 AND #&10 ; MOVER_DIRECTION_FLAG_LEFT &2c50 f0 23 BEQ &2c75 ; not_moving_left # If mover wants to move left, &2c52 20 9c 16 JSR &169c ; check_vertical_range_of_chunks_from_left # Check left of mover &2c55 f0 03 BEQ &2c5a ; not_blocked_to_left # If there is an obstacle to the left of the mover, &2c57 4c 34 2d JMP &2d34 ; use_random_target # set the mover moving towards a random target ; not_blocked_to_left &2c5a e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2c5c c6 57 DEC &57 ; mover_tile_x_fraction # Move mover left a fraction &2c5e a5 57 LDA &57 ; mover_tile_x_fraction &2c60 10 13 BPL &2c75 ; not_next_tile_left &2c62 29 07 AND #&07 &2c64 85 57 STA &57 ; mover_tile_x_fraction &2c66 c6 59 DEC &59 ; mover_tile_x # Move mover left a tile &2c68 a5 55 LDA &55 ; mover_tile_address_low &2c6a 38 SEC &2c6b e9 01 SBC #&01 # Move address left a tile &2c6d 85 55 STA &55 ; mover_tile_address_low &2c6f a5 56 LDA &56 ; mover_tile_address_high &2c71 e9 00 SBC #&00 &2c73 85 56 STA &56 ; mover_tile_address_high ; not_next_tile_left ; not_moving_left &2c75 20 cc 23 JSR &23cc ; use_mover_position &2c78 a9 02 LDA #&02 ; y_fraction_offset # Check bottom of mover &2c7a a2 05 LDX #&05 ; width &2c7c 20 10 16 JSR &1610 ; check_horizontal_range_of_chunks # Returns A = chunk type of last or failed chunk &2c7f c9 50 CMP #&50 ; CHUNK_DOWNWARDS_CLIMBABLE_PLATFORM &2c81 f0 2b BEQ &2cae ; not_moving_up # Can't climb directly up from diagonal platform &2c83 a5 14 LDA &14 ; mover_direction_flags # Negative if MOVER_DIRECTION_FLAG_SUPPRESS_UP set &2c85 30 27 BMI &2cae ; not_moving_up &2c87 a6 4b LDX &4b ; vertical_chunk_check_results # Negative if obstacle, zero if climbable &2c89 30 06 BMI &2c91 ; move_mover_up # Move the mover up if walking up a slope &2c8b d0 21 BNE &2cae ; not_moving_up # Don't move the mover up if not climbable &2c8d 29 02 AND #&02 ; MOVER_DIRECTION_FLAG_UP &2c8f f0 1d BEQ &2cae ; not_moving_up # If the mover wants to mover up, ; move_mover_up &2c91 85 08 STA &08 ; unused # Unused variable &2c93 e6 a0 INC &a0 ; suppress_changing_target # Set to non-zero to suppress changing target &2c95 c6 58 DEC &58 ; mover_tile_y_fraction # Move mover up a fraction &2c97 a5 58 LDA &58 ; mover_tile_y_fraction &2c99 10 13 BPL &2cae ; not_next_tile_up &2c9b 29 03 AND #&03 &2c9d 85 58 STA &58 ; mover_tile_y_fraction &2c9f c6 5a DEC &5a ; mover_tile_y # Move mover up a tile &2ca1 a5 55 LDA &55 ; mover_tile_address_low &2ca3 38 SEC &2ca4 e9 80 SBC #&80 # Move address up a tile &2ca6 85 55 STA &55 ; mover_tile_address_low &2ca8 a5 56 LDA &56 ; mover_tile_address_high &2caa e9 00 SBC #&00 &2cac 85 56 STA &56 ; mover_tile_address_high ; not_next_tile_up ; not_moving_up &2cae a5 59 LDA &59 ; mover_tile_x &2cb0 c5 5c CMP &5c ; mover_target_x # Has the mover reached its target? &2cb2 d0 11 BNE &2cc5 ; not_at_target &2cb4 a5 5a LDA &5a ; mover_tile_y &2cb6 c5 5d CMP &5d ; mover_target_y &2cb8 d0 0b BNE &2cc5 ; not_at_target &2cba e6 cb INC &cb ; mover_reached_target # If so, set to non-zero to indicate mover reached target &2cbc a5 5b LDA &5b ; mover_flags &2cbe 18 CLC &2cbf 69 01 ADC #&01 # Change to next target &2cc1 29 03 AND #&03 ; MOVER_FLAG_TARGET_MASK &2cc3 85 5b STA &5b ; mover_flags ; not_at_target &2cc5 a5 97 LDA &97 ; mover_type &2cc7 c9 05 CMP #&05 ; MOVER_TYPE_SPLINX &2cc9 f0 67 BEQ &2d32 ; leave_with_carry_clear # Splinx doesn't kill player if touching &2ccb c9 08 CMP #&08 ; MOVER_TYPE_MASTER &2ccd f0 63 BEQ &2d32 ; leave_with_carry_clear # Master doesn't kill player if touching &2ccf c9 06 CMP #&06 ; MOVER_TYPE_RIJAN &2cd1 d0 05 BNE &2cd8 ; check_if_mover_is_touching_player &2cd3 ad f0 07 LDA &07f0 ; rijans_state # Unnecessary code; always zero &2cd6 f0 5a BEQ &2d32 ; leave_with_carry_clear # Rijans don't kill player if touching ; check_if_mover_is_touching_player &2cd8 a5 b9 LDA &b9 ; player_x_max # Is the mover touching the player? &2cda c5 59 CMP &59 ; mover_tile_x &2cdc 90 54 BCC &2d32 ; leave_with_carry_clear &2cde d0 06 BNE &2ce6 ; skip_x_max_fraction &2ce0 a5 b8 LDA &b8 ; player_x_max_fraction &2ce2 c5 57 CMP &57 ; mover_tile_x_fraction &2ce4 90 4c BCC &2d32 ; leave_with_carry_clear ; skip_x_max_fraction &2ce6 a5 bb LDA &bb ; player_x_min &2ce8 c5 59 CMP &59 ; mover_tile_x &2cea f0 04 BEQ &2cf0 ; check_x_min_fraction &2cec b0 44 BCS &2d32 ; leave_with_carry_clear &2cee d0 06 BNE &2cf6 ; skip_x_min_fraction ; check_x_min_fraction &2cf0 a5 ba LDA &ba ; player_x_min_fraction &2cf2 c5 57 CMP &57 ; mover_tile_x_fraction &2cf4 b0 3c BCS &2d32 ; leave_with_carry_clear ; skip_x_min_fraction &2cf6 a6 0d LDX &0d ; player_relative_y_fraction &2cf8 a4 0b LDY &0b ; player_y &2cfa c4 5a CPY &5a ; mover_tile_y &2cfc d0 04 BNE &2d02 ; check_y_plus &2cfe e4 58 CPX &58 ; mover_tile_y_fraction &2d00 f0 20 BEQ &2d22 ; is_touching_player ; check_y_plus &2d02 e8 INX &2d03 e0 04 CPX #&04 &2d05 90 03 BCC &2d0a ; not_next_tile_down &2d07 c8 INY &2d08 a2 00 LDX #&00 ; not_next_tile_down &2d0a c4 5a CPY &5a ; mover_tile_y &2d0c d0 04 BNE &2d12 ; skip_y_plus_fraction &2d0e e4 58 CPX &58 ; mover_tile_y_fraction &2d10 f0 10 BEQ &2d22 ; is_touching_player ; skip_y_plus_fraction &2d12 e8 INX &2d13 e0 04 CPX #&04 &2d15 90 03 BCC &2d1a ; not_next_tile_down_two &2d17 c8 INY &2d18 a2 00 LDX #&00 ; not_next_tile_down_two &2d1a c4 5a CPY &5a ; mover_tile_y &2d1c d0 14 BNE &2d32 ; leave_with_carry_clear &2d1e e4 58 CPX &58 ; mover_tile_y_fraction &2d20 d0 10 BNE &2d32 ; leave_with_carry_clear ; is_touching_player # If the mover is touching the player, &2d22 a9 02 LDA #&02 ; KILLED_BY_A_SHOCK &2d24 a6 f8 LDX &f8 ; mover &2d26 e0 01 CPX #&01 ; MOVER_MADRAG &2d28 d0 02 BNE &2d2c ; not_madrag &2d2a a9 06 LDA #&06 ; KILLED_BY_A_BITE ; not_madrag &2d2c a6 f5 LDX &f5 ; suppress_player_input # and the player is able to move, &2d2e d0 02 BNE &2d32 ; leave_with_carry_clear &2d30 85 16 STA &16 ; player_killed # kill the player (touching mover) ; leave_with_carry_clear &2d32 18 CLC # Unnecessary code; result not used &2d33 60 RTS ; use_random_target &2d34 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB &2d37 29 03 AND #&03 ; MOVER_FLAG_TARGET_MASK &2d39 85 5b STA &5b ; mover_flags &2d3b 4c 75 2c JMP &2c75 ; not_moving_left ; consider_targeting_player &2d3e a5 f5 LDA &f5 ; suppress_player_input # Non-zero if player is dead or stunned &2d40 f0 01 BEQ &2d43 ; can_target &2d42 60 RTS ; can_target &2d43 a6 5a LDX &5a ; mover_tile_y &2d45 e4 0b CPX &0b ; player_y &2d47 f0 05 BEQ &2d4e ; is_vertically_level_with_player # Is the controller on the same row of tiles, &2d49 ca DEX &2d4a e4 0b CPX &0b ; player_y # or the row of tiles above the player? &2d4c d0 38 BNE &2d86 ; leave # If not, controller ignores player ; is_vertically_level_with_player &2d4e a5 14 LDA &14 ; mover_direction_flags &2d50 29 08 AND #&08 ; MOVER_DIRECTION_FLAG_RIGHT &2d52 d0 08 BNE &2d5c ; is_moving_right ; is_moving_left &2d54 a5 59 LDA &59 ; mover_tile_x &2d56 38 SEC &2d57 e5 0a SBC &0a ; player_x &2d59 4c 61 2d JMP &2d61 ; consider_distance_to_player ; is_moving_right &2d5c a5 0a LDA &0a ; player_x &2d5e 38 SEC &2d5f e5 59 SBC &59 ; mover_tile_x ; consider_distance_to_player &2d61 18 CLC &2d62 69 02 ADC #&02 &2d64 30 20 BMI &2d86 ; leave # Controller ignores player if facing away from player &2d66 c9 07 CMP #&07 &2d68 b0 1c BCS &2d86 ; leave # Controller ignores player if too far away &2d6a a6 0a LDX &0a ; player_x &2d6c 8a TXA &2d6d e8 INX # Set a target one tile right of player &2d6e c5 59 CMP &59 ; mover_tile_x &2d70 b0 04 BCS &2d76 ; set_mover_target &2d72 ca DEX # or one tile left of player, depending on direction &2d73 ca DEX &2d74 a4 0b LDY &0b ; player_y ; set_mover_target &2d76 8a TXA &2d77 a6 f8 LDX &f8 ; mover &2d79 9d 27 35 STA &3527,X ; movers_target_x &2d7c 98 TYA &2d7d 9d 4c 35 STA &354c,X ; movers_target_y &2d80 a5 5b LDA &5b ; mover_flags &2d82 09 08 ORA #&08 ; MOVER_FLAG_USE_TARGET &2d84 85 5b STA &5b ; mover_flags ; leave &2d86 60 RTS ; consider_completion_screen # Called with A = player_killed &2d87 c9 f0 CMP #&f0 ; ESCAPE &2d89 d0 03 BNE &2d8e ; completion_screen &2d8b 4c 94 2e JMP &2e94 ; leave ; completion_screen &2d8e 20 b3 14 JSR &14b3 ; reset_screen &2d91 20 95 2e JSR &2e95 ; hide_screen &2d94 85 02 STA &02 ; escape_bonus &2d96 20 82 09 JSR &0982 ; write_string &2d99 1f 01 01 &2d9c 08 ; move left one character &2d9d 11 03 &2d9f 7e 59 6f 75 20 6c 65 61 76 65 20 73 61 66 65 6c ; "~You leave safely in" &2daf 79 20 69 6e &2db3 1f &2db4 00 ; end of string &2db5 a5 16 LDA &16 ; player_killed &2db7 29 7f AND #&7f &2db9 f0 16 BEQ &2dd1 ; in_an_escape_pod ; in_the_tardis &2dbb 20 82 09 JSR &0982 ; write_string &2dbe 04 03 &2dc0 74 68 65 20 54 41 52 44 49 53 2e ; "the TARDIS." &2dcb 00 ; end of string &2dcc e6 02 INC &02 ; escape_bonus # Bonus for leaving in the TARDIS &2dce 4c e6 2d JMP &2de6 ; calculate_escape_bonus ; in_an_escape_pod &2dd1 20 82 09 JSR &0982 ; write_string &2dd4 02 &2dd5 03 &2dd6 7e 61 6e 20 45 73 63 61 70 65 20 50 6f 64 2e ; "an Escape Pod." &2de5 00 ; end of string ; calculate_escape_bonus &2de6 a9 0d LDA #&0d ; OBJECT_TYPE_TIRU_LATTICE &2de8 20 74 12 JSR &1274 ; check_if_carrying_object_type # Returns carry clear if carrying object &2deb b0 02 BCS &2def ; not_carrying_tiru_lattice &2ded e6 02 INC &02 ; escape_bonus # Bonus for carrying the TIRU lattice ; not_carrying_tiru_lattice &2def a9 19 LDA #&19 ; OBJECT_TYPE_SPLINX &2df1 20 74 12 JSR &1274 ; check_if_carrying_object_type # Returns carry clear if carrying object &2df4 b0 02 BCS &2df8 ; not_carrying_splinx &2df6 e6 02 INC &02 ; escape_bonus # Bonus for carrying Splinx ; not_carrying_splinx &2df8 a9 0b LDA #&0b ; OBJECT_TYPE_MEMORY_CAPSULE &2dfa 20 74 12 JSR &1274 ; check_if_carrying_object_type # Returns carry clear if carrying object &2dfd b0 02 BCS &2e01 ; not_carrying_memory_capsule &2dff e6 02 INC &02 ; escape_bonus # Bonus for carrying memory capsule ; not_carrying_memory_capsule &2e01 ad fb 07 LDA &07fb ; reactor_meltdown_timer_high # Non-zero if reactor was detonated &2e04 d0 0c BNE &2e12 ; stopped_factory &2e06 a9 06 LDA #&06 ; OBJECT_TYPE_CIRCUIT_BOARD_A &2e08 20 74 12 JSR &1274 ; check_if_carrying_object_type # Returns carry clear if carrying object &2e0b b0 07 BCS &2e14 ; not_stopped_factory &2e0d ad ec 07 LDA &07ec ; factory_stopped # Non-zero if factor was stopped &2e10 f0 02 BEQ &2e14 ; not_stopped_factory ; stopped_factory &2e12 e6 02 INC &02 ; escape_bonus # Bonus for rendering factory inoperable ; not_stopped_factory &2e14 a9 01 LDA #&01 &2e16 a6 02 LDX &02 ; escape_bonus &2e18 e8 INX ; power_loop &2e19 0a ASL A # Multiply escape bonus by two for every point &2e1a ca DEX &2e1b 10 fc BPL &2e19 ; power_loop &2e1d 85 02 STA &02 ; escape_bonus &2e1f 20 82 09 JSR &0982 ; write_string &2e22 11 05 &2e24 1f 01 09 &2e27 0d 0a &2e29 45 73 63 61 70 65 20 62 6f 6e 75 73 3a ; "Escape bonus:" &2e36 00 ; end of string &2e37 a2 00 LDX #&00 &2e39 a4 02 LDY &02 ; escape_bonus &2e3b 20 3e 0d JSR &0d3e ; write_number &2e3e a5 71 LDA &71 ; score_high &2e40 18 CLC &2e41 65 02 ADC &02 ; escape_bonus &2e43 85 71 STA &71 ; score_high &2e45 ad f5 07 LDA &07f5 ; time_high &2e48 30 2b BMI &2e75 ; skip_time_bonus &2e4a 20 82 09 JSR &0982 ; write_string &2e4d 0d 0a &2e4e 54 69 6d 65 20 62 6f 6e 75 73 20 20 3a ; "Time bonus :" &2e5c 00 ; end of string &2e5d ae f4 07 LDX &07f4 ; time_low &2e60 ac f5 07 LDY &07f5 ; time_high &2e63 20 3e 0d JSR &0d3e ; write_number &2e66 a5 70 LDA &70 ; score_low &2e68 18 CLC &2e69 6d f4 07 ADC &07f4 ; time_low &2e6c 85 70 STA &70 ; score_low &2e6e a5 71 LDA &71 ; score_high &2e70 6d f5 07 ADC &07f5 ; time_high &2e73 85 71 STA &71 ; score_high ; skip_time_bonus &2e75 20 82 09 JSR &0982 ; write_string &2e78 11 06 &2e7a 0d 0a &2e7c 46 69 6e 61 6c 20 73 63 6f 72 65 20 3a ; "Final score :" &2e89 00 ; end of string &2e8a a6 70 LDX &70 ; score_low &2e8c a4 71 LDY &71 ; score_high &2e8e 20 3e 0d JSR &0d3e ; write_number &2e91 20 9c 2e JSR &2e9c ; wait_for_space ; leave &2e94 60 RTS ; hide_screen &2e95 a2 01 LDX #&01 ; R1: Number of characters per line &2e97 a9 00 LDA #&00 # Hide screen &2e99 4c 7b 09 JMP &097b ; set_video_register ; wait_for_space &2e9c 20 ca 1d JSR &1dca ; write_hit_spc_to_play ; wait_for_space_loop &2e9f a5 ec LDA &ec ; os_most_recently_pressed_key &2ea1 c9 e2 CMP #&e2 ; SPACE &2ea3 d0 fa BNE &2e9f ; wait_for_space_loop &2ea5 60 RTS ; update_detonator &2ea6 ad d4 07 LDA &07d4 ; detonator_countdown # Non-zero if detonator counting down &2ea9 f0 18 BEQ &2ec3 ; skip_detonator_countdown &2eab ce d4 07 DEC &07d4 ; detonator_countdown &2eae c9 01 CMP #&01 &2eb0 f0 7c BEQ &2f2e ; detonate_detonator &2eb2 29 01 AND #&01 &2eb4 0a ASL A &2eb5 0a ASL A &2eb6 18 CLC &2eb7 69 96 ADC #&96 &2eb9 8d b5 33 STA &33b5 ; sound_6 + 4 (pitch) &2ebc a2 b1 LDX #&b1 ; sound_6 &2ebe a0 33 LDY #&33 &2ec0 20 fd 09 JSR &09fd ; play_sound # Play sound for detonator counting down ; skip_detonator_countdown &2ec3 ad f7 07 LDA &07f7 ; disabled_movers_countdown # Non-zero if movers were disabled by explosion &2ec6 f0 15 BEQ &2edd ; skip_reactivating_disabled_movers &2ec8 ce f7 07 DEC &07f7 ; disabled_movers_countdown &2ecb d0 10 BNE &2edd ; skip_reactivating_disabled_movers &2ecd a2 24 LDX #&24 ; MOVER_LAST ; enable_disabled_movers_loop &2ecf bd b0 06 LDA &06b0,X ; movers_object_carried_or_disabled &2ed2 29 7f AND #&7f ; !MOVER_DISABLED # Clear MOVER_DISABLED &2ed4 9d b0 06 STA &06b0,X ; movers_object_carried_or_disabled &2ed7 9d b0 06 STA &06b0,X ; movers_object_carried_or_disabled # Unnecessary code &2eda ca DEX &2edb 10 f2 BPL &2ecf ; enable_disabled_movers_loop ; skip_reactivating_disabled_movers &2edd ad fb 07 LDA &07fb ; reactor_meltdown_timer_high # Non-zero if reactor is unstable &2ee0 f0 13 BEQ &2ef5 ; leave &2ee2 ee fa 07 INC &07fa ; reactor_meltdown_timer_low &2ee5 d0 0e BNE &2ef5 ; leave &2ee7 ee fb 07 INC &07fb ; reactor_meltdown_timer_high &2eea ad fb 07 LDA &07fb ; reactor_meltdown_timer_high &2eed c9 0b CMP #&0b &2eef d0 04 BNE &2ef5 ; leave &2ef1 a9 08 LDA #&08 ; KILLED_BY_RADIATION &2ef3 85 16 STA &16 ; player_killed # Kill player (too long after reactor destroyed) &2ef5 60 RTS ; backup_player_state &2ef6 a2 00 LDX #&00 ; backup_player_state_loop &2ef8 bd 00 01 LDA &0100,X ; saved_variables &2efb f0 0c BEQ &2f09 ; leave &2efd 8d 01 2f STA &2f01 ; variable_address &2f00 a5 00 LDA &00 # actually STA variable_address &2f02 9d 01 01 STA &0101,X ; saved_variables + 1 &2f05 e8 INX &2f06 e8 INX &2f07 d0 ef BNE &2ef8 ; backup_player_state_loop ; leave &2f09 60 RTS ; oswrch_handler &2f0a c9 7e CMP #&7e ; "~" &2f0c f0 03 BEQ &2f11 ; is_tilde ; to_previous_oswrch_vector &2f0e 6c d2 32 JMP (&32d2) ; previous_oswrch_vector ; is_tilde # "~" moves cursor right by half a character &2f11 a9 08 LDA #&08 ; move left one character &2f13 20 0e 2f JSR &2f0e ; to_previous_oswrch_vector &2f16 ad 4a 03 LDA &034a ; os_text_cursor_address_low &2f19 18 CLC &2f1a 69 10 ADC #&10 # Move right four pixels &2f1c 8d 4a 03 STA &034a ; os_text_cursor_address_low &2f1f ad 4b 03 LDA &034b ; os_text_cursor_address_high &2f22 69 00 ADC #&00 &2f24 20 9a 0c JSR &0c9a ; keep_screen_address_within_screen &2f27 8d 4b 03 STA &034b ; os_text_cursor_address_high &2f2a a9 09 LDA #&09 ; move right one character &2f2c d0 e0 BNE &2f0e ; to_previous_oswrch_vector # Always branches ; detonate_detonator &2f2e a9 01 LDA #&01 ; size &2f30 20 49 2f JSR &2f49 ; consider_explosion # Returns carry set if explosives detonated &2f33 a2 04 LDX #&04 ; pitch &2f35 a9 01 LDA #&01 ; size # Detonator affects tiles for radius 1 &2f37 90 04 BCC &2f3d ; skip_bigger_explosion &2f39 a2 06 LDX #&06 ; size &2f3b a9 08 LDA #&08 ; pitch # Explosives affect tiles for radius 8 ; skip_bigger_explosion &2f3d 48 PHA ; explosion_size &2f3e 8e bd 33 STX &33bd ; sound_7 + 4 (pitch) &2f41 a2 b9 LDX #&b9 ; &33b9 = sound_7 &2f43 a0 33 LDY #&33 &2f45 20 fd 09 JSR &09fd ; play_sound # Play sound for detonating detonator or explosives &2f48 68 PLA ; explosion_size ; consider_explosion &2f49 85 00 STA &00 ; explosion_size &2f4b ad dc 05 LDA &05dc ; objects_tile_x + &20 (OBJECT_TYPE_DETONATOR) &2f4e 48 PHA ; detonator_tile_x &2f4f 38 SEC &2f50 e5 00 SBC &00 ; explosion_size &2f52 85 01 STA &01 ; explosion_tile_x_min &2f54 68 PLA ; detonator_tile_x &2f55 38 SEC &2f56 65 00 ADC &00 ; explosion_size &2f58 85 02 STA &02 ; explosion_tile_x_max &2f5a ad 56 06 LDA &0656 ; objects_tile_y + &20 (OBJECT_TYPE_DETONATOR) &2f5d 48 PHA ; detonator_tile_y &2f5e 38 SEC &2f5f e5 00 SBC &00 ; explosion_size &2f61 10 02 BPL &2f65 ; skip_floor &2f63 a9 01 LDA #&01 ; skip_floor &2f65 85 03 STA &03 ; explosion_tile_y_min &2f67 68 PLA ; detonator_tile_y &2f68 38 SEC &2f69 65 00 ADC &00 ; explosion_size &2f6b 85 04 STA &04 ; explosion_tile_y_max ; consider_detonating_explosives &2f6d a2 3c LDX #&3c ; OBJECT_LAST ; consider_detonating_explosives_loop # Has the detonator detonated the explosives? &2f6f bd 0e 34 LDA &340e,X ; objects_type &2f72 29 3f AND #&3f ; OBJECT_TYPE_MASK &2f74 c9 0e CMP #&0e ; OBJECT_TYPE_EXPLOSIVES &2f76 d0 20 BNE &2f98 ; consider_next_object &2f78 bd bc 05 LDA &05bc,X ; objects_tile_x &2f7b c5 01 CMP &01 ; explosion_tile_x_min &2f7d 90 19 BCC &2f98 ; consider_next_object &2f7f c5 02 CMP &02 ; explosion_tile_x_max &2f81 b0 15 BCS &2f98 ; consider_next_object &2f83 bd 36 06 LDA &0636,X ; objects_tile_y &2f86 c5 03 CMP &03 ; explosion_tile_y_min &2f88 90 0e BCC &2f98 ; consider_next_object &2f8a c5 04 CMP &04 ; explosion_tile_y_max &2f8c b0 0a BCS &2f98 ; consider_next_object &2f8e a9 ff LDA #&ff &2f90 9d 36 06 STA &0636,X ; objects_tile_y &2f93 8e 44 14 STX &1444 ; exploded_object &2f96 38 SEC # Leave with carry set to indicate explosives detonated &2f97 60 RTS ; consider_next_object &2f98 ca DEX &2f99 10 d4 BPL &2f6f ; consider_detonating_explosives_loop ; consider_disabling_movers &2f9b a2 24 LDX #&24 ; MOVER_LAST # For each mover, ; consider_disabling_movers_loop &2f9d bd 00 04 LDA &0400,X ; movers_tile_x # has the explosion disabled the mover? &2fa0 c5 01 CMP &01 ; explosion_tile_x_min &2fa2 90 1a BCC &2fbe ; consider_next_mover &2fa4 c5 02 CMP &02 ; explosion_tile_x_max &2fa6 b0 16 BCS &2fbe ; consider_next_mover &2fa8 bd 25 04 LDA &0425,X ; movers_tile_y &2fab c5 03 CMP &03 ; explosion_tile_y_min &2fad 90 0f BCC &2fbe ; consider_next_mover &2faf c5 04 CMP &04 ; explosion_tile_y_max &2fb1 b0 0b BCS &2fbe ; consider_next_mover &2fb3 bd b0 06 LDA &06b0,X ; movers_object_carried_or_disabled &2fb6 09 80 ORA #&80 ; MOVER_DISABLED &2fb8 9d b0 06 STA &06b0,X ; movers_object_carried_or_disabled &2fbb ce f7 07 DEC &07f7 ; disabled_movers_countdown # Set to non-zero to start countdown ; consider_next_mover &2fbe ca DEX &2fbf 10 dc BPL &2f9d ; consider_disabling_movers_loop ; consider_exploding_player # Has the explosion killed the player? &2fc1 a5 0a LDA &0a ; player_x &2fc3 c5 01 CMP &01 ; explosion_tile_x_min &2fc5 90 12 BCC &2fd9 ; consider_exploding_reactor_pillar &2fc7 c5 02 CMP &02 ; explosion_tile_x_max &2fc9 b0 0e BCS &2fd9 ; consider_exploding_reactor_pillar &2fcb a5 0b LDA &0b ; player_y &2fcd c5 03 CMP &03 ; explosion_tile_y_min &2fcf 90 08 BCC &2fd9 ; consider_exploding_reactor_pillar &2fd1 c5 04 CMP &04 ; explosion_tile_y_max &2fd3 b0 04 BCS &2fd9 ; consider_exploding_reactor_pillar &2fd5 a9 07 LDA #&07 ; KILLED_BY_A_BLAST &2fd7 85 16 STA &16 ; player_killed # Kill the player (too close to explosion) ; consider_exploding_reactor_pillar &2fd9 ad dc 05 LDA &05dc ; objects_tile_x + &20 (OBJECT_TYPE_DETONATOR) &2fdc c9 73 CMP #&73 # Is the detonator at (&72, &34) or (&73, &34)? &2fde f0 04 BEQ &2fe4 ; check_tile_y # i.e. at the bottom of the reactor's central pillar &2fe0 c9 72 CMP #&72 &2fe2 d0 0a BNE &2fee ; not_under_reactor ; check_tile_y &2fe4 ad 56 06 LDA &0656 ; objects_tile_y + &20 (OBJECT_TYPE_DETONATOR) &2fe7 c9 34 CMP #&34 &2fe9 d0 03 BNE &2fee ; not_under_reactor &2feb ee fb 07 INC &07fb ; reactor_meltdown_timer_high # Set to non-zero to start reactor meltdown ; not_under_reactor &2fee 18 CLC # Leave with carry clear to indicate explosives not detonated &2fef 60 RTS ; initialise_game &2ff0 a9 03 LDA #&03 ; Enable ESCAPE, clear memory on BREAK &2ff2 8d 58 02 STA &0258 ; ESCAPE/BREAK effect &2ff5 a2 ff LDX #&ff &2ff7 9a TXS &2ff8 58 CLI &2ff9 a9 05 LDA #&05 ; SPRITE_SPLINX_INACTIVE &2ffb 8d d8 32 STA &32d8 ; mover_type_sprites - 1 + 5 (MOVER_TYPE_SPLINX) ; initialise_movers &2ffe a2 24 LDX #&24 ; MOVER_LAST ; initialise_movers_loop &3000 a9 00 LDA #&00 # Set to zero to indicate mover is not carrying any &3002 9d b0 06 STA &06b0,X ; movers_object_carried_or_disabled # object, and hasn't been disabled by an explosion &3005 bd e3 30 LDA &30e3,X ; initial_movers_tile_x &3008 9d 00 04 STA &0400,X ; movers_tile_x &300b bd 08 31 LDA &3108,X ; initial_movers_tile_y &300e 9d 25 04 STA &0425,X ; movers_tile_y &3011 bd 2d 31 LDA &312d,X ; initial_movers_tile_y_fraction &3014 9d 4a 04 STA &044a,X ; movers_tile_y_fraction &3017 a9 01 LDA #&01 ; MOVER_FLAG_TARGET_ONE # Set mover to use second target &3019 9d 97 05 STA &0597,X ; movers_flags &301c 9d 71 35 STA &3571,X ; movers_tile_x_fraction &301f ca DEX &3020 10 de BPL &3000 ; initialise_movers_loop ; initialise_objects &3022 a2 3c LDX #&3c ; OBJECT_LAST ; initialise_objects_loop &3024 bd 52 31 LDA &3152,X ; initial_objects_tile_x &3027 9d bc 05 STA &05bc,X ; objects_tile_x &302a bd cc 31 LDA &31cc,X ; initial_objects_tile_y &302d 9d 36 06 STA &0636,X ; objects_tile_y &3030 bd 8f 31 LDA &318f,X ; initial_objects_tile_x_fraction &3033 9d f9 05 STA &05f9,X ; objects_tile_x_fraction &3036 bd 09 32 LDA &3209,X ; initial_objects_tile_y_fraction &3039 9d 73 06 STA &0673,X ; objects_tile_y_fraction &303c ca DEX &303d 10 e5 BPL &3024 ; initialise_objects_loop &303f a2 00 LDX #&00 &3041 8e ed 06 STX &06ed ; splinx_active # Set to zero to indicate Splinx is inactive ; initialise_variables_loop &3044 bd de 32 LDA &32de,X ; initial_variables &3047 f0 0d BEQ &3056 ; end_of_variables &3049 9d 00 01 STA &0100,X ; saved_variables &304c bd df 32 LDA &32df,X ; initial_variables + 1 &304f 9d 01 01 STA &0101,X ; saved_variables + 1 &3052 e8 INX &3053 e8 INX &3054 d0 ee BNE &3044 ; initialise_variables_loop ; end_of_variables &3056 9d 00 01 STA &0100,X ; saved_variables &3059 a9 05 LDA #&05 # Player starts with five lives # actually LDA initial_player_lives # &305a is checked at entry point &305b 85 15 STA &15 ; player_lives &305d a2 00 LDX #&00 ; initialise_game_state &305f bd fb 32 LDA &32fb,X ; initial_game_state &3062 9d cc 07 STA &07cc,X ; game_state &3065 e8 INX &3066 e0 30 CPX #&30 &3068 d0 f5 BNE &305f ; initialise_game_state &306a 20 36 09 JSR &0936 ; restore_player_state &306d 20 66 14 JSR &1466 ; reset_player_and_redraw_screen &3070 20 98 1c JSR &1c98 ; restore_default_windows &3073 20 82 09 JSR &0982 ; write_string &3076 1c 01 07 12 01 ; define text window x:(&01, &12), y:(&01, &07) &307b 11 83 ; COLOUR 128 + 3 &307d 0c ; clear text area &307e 1a ; restore default windows &307f 11 01 ; COLOUR 1 &3081 1f 03 04 ; TAB(&03, &04) &3084 7e 48 69 74 20 4c 20 74 6f 20 6c 6f 61 64 ; "Hit L to load" &3092 1f 04 02 ; TAB(&04, &02) &3095 53 63 6f 72 65 20 3a ; "Score :" &309c 00 ; end of string &309d a6 70 LDX &70 ; score_low &309f a4 71 LDY &71 ; score_high &30a1 20 3e 0d JSR &0d3e ; write_number # Write score for previous game &30a4 20 82 09 JSR &0982 ; write_string &30a7 1f 02 06 ; TAB(&02, &06) &30aa 00 ; end of string &30ab a9 00 LDA #&00 &30ad 85 70 STA &70 ; score_low &30af 85 71 STA &71 ; score_high &30b1 20 d3 1d JSR &1dd3 ; write_hit_spc_to_play_without_tab ; wait_for_space_or_l &30b4 a5 ec LDA &ec ; os_most_recently_pressed_key &30b6 c9 e2 CMP #&e2 ; SPACE &30b8 f0 07 BEQ &30c1 ; start_new_game &30ba c9 d6 CMP #&d6 ; L &30bc d0 f6 BNE &30b4 ; wait_for_space_or_l &30be 20 42 15 JSR &1542 ; load_or_save_screen ; start_new_game &30c1 20 80 08 JSR &0880 ; play_game &30c4 4c f0 2f JMP &2ff0 ; initialise_game ; tile_y_to_relative_y_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &30c7 00 02 04 00 02 04 00 02 04 00 02 04 00 02 04 00 ; &00 &30d7 02 04 00 02 04 00 02 04 00 02 04 00 ; &10 ; initial_movers_tile_x ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &30e3 1c 2c 6e 43 69 14 27 3c 0d 31 42 4e 6b 73 5a 5d ; &00 &30f3 55 52 45 69 77 56 49 0f 33 2b 1b 1e 44 3c 13 13 ; &10 &3103 25 12 3d 07 ff ; &20 ; initial_movers_tile_y ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3108 2e 34 1b 11 0b 2b 27 2d 2c 2f 28 28 31 2f 09 09 ; &00 &3118 0f 0d 1f 1b 1c 1f 19 11 11 0b 09 07 05 05 05 05 ; &10 &3128 0f 11 29 30 ff ; &20 ; initial_movers_tile_y_fraction ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &312d 02 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &313d 00 00 00 00 03 00 00 00 00 00 00 00 00 00 01 01 ; &10 &314d 01 01 01 01 ff ; &20 ; initial_objects_tile_x ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3152 ff ff ff ff 0e 48 0f 12 10 11 44 40 33 14 1b 77 ; &00 &3162 28 12 6b 3c 30 2a 0d 0a 25 34 61 6d 76 55 0a 31 ; &10 &3172 50 2b 2c 2d 21 20 51 58 6f 71 53 1c 59 69 6d 71 ; &20 &3182 2d 2f 2f 2f 2f 42 42 42 42 48 48 48 48 ; &30 ; initial_objects_tile_x_fraction ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &318f 00 00 00 00 03 02 03 03 03 03 02 02 02 00 00 00 ; &00 &319f 00 03 00 00 00 00 00 00 00 00 00 00 00 04 00 00 ; &10 &31af 00 00 00 00 00 00 00 00 01 01 00 00 00 01 01 01 ; &20 &31bf 00 03 03 03 03 02 02 02 02 03 03 03 03 ; &30 ; initial_objects_tile_y ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &31cc ff ff ff ff 1b 05 1b 1b 1b 1b 02 02 05 05 05 05 ; &00 &31dc 07 11 0b 32 34 23 23 34 23 23 23 23 23 11 2f 1f ; &10 &31ec 0f 09 09 09 34 34 31 30 0b 0b 23 2e 0b 05 05 05 ; &20 &31fc 23 34 34 34 34 34 34 34 34 2d 2d 2d 2d ; &30 ; initial_objects_tile_y_fraction ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3209 00 00 00 00 02 02 02 02 02 02 02 02 02 02 02 02 ; &00 &3219 02 02 02 02 02 02 02 03 02 02 02 02 02 00 02 02 ; &10 &3229 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ; &20 &3239 02 03 02 01 00 03 02 01 00 03 02 01 00 ; &30 ; sprite_sizes_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3246 30 30 30 28 20 20 30 20 20 30 30 18 18 18 18 18 ; &00 &3256 18 18 18 18 18 20 20 20 10 20 10 20 18 20 20 20 ; &10 &3266 18 20 30 18 20 20 20 18 30 30 30 ; &20 ; sprite_addresses_table &3271 68 36 ; &3668 = sprite_00_data &3273 f8 36 ; &36f8 = sprite_01_data &3275 88 37 ; &3788 = sprite_02_data &3277 18 38 ; &3818 = sprite_03_data &3279 90 38 ; &3890 = sprite_04_data &327b d0 38 ; &38d0 = sprite_05_data &327d 10 39 ; &3910 = sprite_06_data &327f a0 39 ; &39a0 = sprite_07_data &3281 e0 39 ; &39e0 = sprite_08_data &3283 20 3a ; &3a20 = sprite_09_data &3285 b0 3a ; &3ab0 = sprite_0a_data &3287 40 3b ; &3b40 = sprite_0b_data &3289 58 3b ; &3b58 = sprite_0c_data &328b 70 3b ; &3b70 = sprite_0d_data &328d 88 3b ; &3b88 = sprite_0e_data &328f a0 3b ; &3ba0 = sprite_0f_data &3291 b8 3b ; &3bb8 = sprite_10_data &3293 d0 3b ; &3bd0 = sprite_11_data &3295 e8 3b ; &3be8 = sprite_12_data &3297 00 3c ; &3c00 = sprite_13_data &3299 18 3c ; &3c18 = sprite_14_data &329b 30 3c ; &3c30 = sprite_15_data &329d 50 3c ; &3c50 = sprite_16_data &329f 70 3c ; &3c70 = sprite_17_data &32a1 90 3c ; &3c90 = sprite_18_data &32a3 a0 3c ; &3ca0 = sprite_19_data &32a5 c0 3c ; &3cc0 = sprite_1a_data &32a7 e0 3c ; &3ce0 = sprite_1b_data &32a9 00 3d ; &3d00 = sprite_1c_data &32ab 18 3d ; &3d18 = sprite_1d_data &32ad 38 3d ; &3d38 = sprite_1e_data &32af 58 3d ; &3d58 = sprite_1f_data &32b1 78 3d ; &3d78 = sprite_20_data &32b3 90 3d ; &3d90 = sprite_21_data &32b5 d0 3d ; &3dd0 = sprite_22_data &32b7 00 3e ; &3e00 = sprite_23_data &32b9 18 3e ; &3e18 = sprite_24_data &32bb 58 3e ; &3e58 = sprite_25_data &32bd 78 3e ; &3e78 = sprite_26_data &32bf 98 3e ; &3e98 = sprite_27_data &32c1 b0 3e ; &3eb0 = sprite_28_data &32c3 40 3f ; &3f40 = sprite_29_data &32c5 d0 3f ; &3fd0 = sprite_2a_data ; climbable_tile_types &32c7 05 ; TILE_LADDER_AND_PLATFORM_ON_BLUE &32c8 06 ; TILE_LADDER_ON_BLUE &32c9 07 ; TILE_TOP_LADDER_PLATFORM_ON_BLUE &32ca 13 ; TILE_LADDER_AND_PIPE_ON_BLUE &32cb 49 ; TILE_LADDER_ON_BLACK &32cc 4a ; TILE_LADDER_AND_HATCHING_ON_BLACK &32cd 4b ; TILE_LADDER_AND_PLATFORM_ON_BLUE &32ce 4d ; TILE_LADDER_AND_PLATFORM_ON_BLACK &32cf 4e ; TILE_TOP_OF_LADDER_AND_PLATFORM_ON_BLACK &32d0 6f ; TILE_LADDER_AND_CONVEYOR &32d1 76 ; TILE_LADDER_AND_PLATFORM_BLUE_TWO ; previous_oswrch_vector_low &32d2 00 ; previous_oswrch_vector_high &32d3 00 ; mover_type_sprites &32d4 06 ; &01 : (MOVER_TYPE_FAST_CONTROLLER) : SPRITE_CONTROLLER &32d5 06 ; &02 : (MOVER_TYPE_SLOW_CONTROLLER) : SPRITE_CONTROLLER &32d6 06 ; &03 : (MOVER_TYPE_COOLED_CONTROLLER) : SPRITE_CONTROLLER &32d7 06 ; &04 : (MOVER_TYPE_STATIC_CONTROLLER) : SPRITE_CONTROLLER &32d8 05 ; &05 : (MOVER_TYPE_SPLINX) : SPRITE_SPLINX_INACTIVE &32d9 07 ; &06 : (MOVER_TYPE_RIJAN) : SPRITE_RIJAN &32da 09 ; &07 : (MOVER_TYPE_MADRAG) : SPRITE_MADRAG &32db 0a ; &08 : (MOVER_TYPE_MASTER) : SPRITE_MASTER &32dc 06 ; &09 : (MOVER_TYPE_PRISON_ESCORT_CONTROLLER) : SPRITE_CONTROLLER ; splinx_ready_for_next_step &32dd 00 ; initial_variables &32de 0a 1b ; player_x = &1b &32e0 0b 2e ; player_y = &2e &32e2 0c 02 ; player_tile_x_fraction = &02 &32e4 0d 01 ; player_tile_y_fraction = &01 &32e6 0e 2a ; screen_top_y = &2a &32e8 0f 16 ; screen_left_x = &16 &32ea 11 20 ; screen_right_x = &20 &32ec 10 02 ; screen_x_fraction = &02 &32ee 17 01 ; selected_pocket = &01 &32f0 12 00 ; sprite_height = &00 &32f2 92 00 ; splinx_slot = &00 &32f4 93 00 ; splinx_command = &00 &32f6 3a 04 ; player_relative_y = &04 &32f8 42 2a ; unused = &2a &32fa 00 ; end of list ; initial_game_state &32fb 00 00 00 00 00 00 00 00 ; splinx_program &3303 00 ; detonator_countdown &3304 00 00 00 00 00 00 00 00 ; used_cryostatic_chambers_tile_address_high &330c 01 00 00 00 00 00 ; inventory (MARKER_1 in first slot, other slots empty) &3312 ff ; thrown_object (no object) &3313 00 ; throw_direction &3314 01 02 03 04 ; splinx_markers_state (all markers available) &3318 00 ; player_sprite &3319 00 ; tardis_location (in mine) &331a 00 ; security_code_correctly_entered (no) &331b 00 ; factory_stopped (no) &331c 00 ; mover_touching_cloth (no) &331d 00 ; madrag_eggs_disturbed (no) &331e 00 ; stolen_tiru_stun_cooldown &331f 00 ; rijans_state &3320 63 ; splinx_power (full power) &3321 1e ; splinx_power_fraction &3322 00 ; splinx_reached_target &3323 31 ; time_low &3324 2a ; time_high &3325 00 ; time_fraction &3326 00 ; disabled_movers_countdown &3327 03 ; detonator_uses_remaining &3328 00 ; suppress_stealing_tiru_lattice &3329 00 ; reactor_meltdown_timer_low &332a 00 ; reactor_meltdown_timer_high ; sprite_heights_table # &ff = 1 group, &01 = 2 groups, &00 = 3 groups ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &332b 00 00 00 00 01 01 00 01 01 00 00 ff ff ff ff ff ; &00 &333b ff ff ff ff ff ff ff ff ff ff 01 ff ff ff ff ff ; &10 &334b ff 01 ff ff 01 ff ff ff 00 00 ff ; &20 ; sprites_flipped_state ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3356 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 ; &00 &3366 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &3376 00 00 00 00 00 00 00 00 80 00 00 ; &20 ; sound_0 # Picking up object ; chan vol pitch dur &3381 11 00 f1 ff 32 00 01 00 ; sound_1 # Picking up object ; chan vol pitch dur &3389 01 00 f1 ff 64 00 01 00 ; sound_2 # Throwing object ; chan vol pitch dur &3391 11 00 f1 ff 64 00 01 00 ; sound_3 # Throwing object ; chan vol pitch dur &3399 01 00 f1 ff 32 00 01 00 ; sound_4 # Dropping object ; chan vol pitch dur &33a1 10 00 f1 ff 04 00 05 00 ; sound_5 # Using pick ; chan vol pitch dur &33a9 11 00 f1 ff ff 00 01 00 ; sound_6 # Detonator counting down ; chan vol pitch dur &33b1 12 00 f8 ff 00 00 01 00 ; sound_7 # Detonating detonator or explosives ; chan vol pitch dur &33b9 10 00 f1 ff 00 00 0f 00 ; sound_8 # Player dying ; chan vol pitch dur &33c1 13 00 f1 ff dc 00 01 00 ; sound_9 # Entering correct security code ; chan vol pitch dur &33c9 11 00 f1 ff 00 00 19 00 ; sound_10 # Entering correct security code ; chan vol pitch dur &33d1 12 00 f1 ff 01 00 19 00 ; sound_11 # Entering correct security code ; chan vol pitch dur &33d9 13 00 f1 ff 02 00 19 00 ; sound_12 # Triggering alarm ; chan vol pitch dur &33e1 10 00 f1 ff 00 00 01 00 ; movers_type ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &33e9 05 07 08 01 09 02 02 02 02 02 02 02 02 02 02 02 ; &00 &33f9 02 02 02 02 02 02 02 03 03 02 01 01 02 02 06 06 ; &10 &3409 06 06 06 06 ff ; &20 ; objects_type # Top bit set if object plotted ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &340e 00 01 02 03 04 04 05 05 06 07 07 08 09 0a 10 0b ; &00 &341e 0c 0d 0e 0e 0f 10 10 10 10 10 10 10 10 11 12 13 ; &10 &342e 14 10 15 18 16 16 16 16 17 17 18 19 1a 17 17 17 ; &20 &343e 1c 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b ; &30 ; killer_strings &344b 08 41 20 66 61 6c 6c ; &01 (KILLED_BY_A_FALL) : at &08, "A fall" &3452 07 7e 41 20 73 68 6f 63 6b ; &02 (KILLED_BY_A_SHOCK) : at &07, "~A shock" &345b 07 7e 41 20 73 70 69 6b 65 ; &03 (KILLED_BY_A_SPIKE) : at &07, "~A spike" &3464 08 4e 6f 20 61 69 72 ; &04 (KILLED_BY_NO_AIR) : at &08, "No air" &346b 08 41 6e 20 65 67 67 ; &05 (KILLED_BY_AN_EGG) : at &08, "An egg" &3472 08 41 20 62 69 74 65 ; &06 (KILLED_BY_A_BITE) : at &08, "A bite" &3479 07 7e 41 20 62 6c 61 73 74 ; &07 (KILLED_BY_A_BLAST) : at &07, "~A blast" &3482 06 7e 52 61 64 69 61 74 69 6f 6e ; &08 (KILLED_BY_RADIATION) : at &06, "~Radiation" &348d 00 ; throw_distances_by_direction_table ; u r d l &348e 08 1e 01 1e ; throw_distance_remaining &3492 00 ; movers_screen_address_low ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3493 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &34a3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &34b3 00 00 00 00 00 ; &20 ; movers_screen_address_high ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &34b8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &34c8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &34d8 00 00 00 00 00 ; &20 ; movers_tile_address_low ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &34dd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &34ed 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &34fd 00 00 00 00 00 ; &20 ; movers_tile_address_high ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3502 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &3512 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &3522 00 00 00 00 00 ; &20 ; movers_target_x ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3527 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &3537 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &3547 00 00 00 00 00 ; &20 ; movers_target_y ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &354c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &355c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &356c 00 00 00 00 00 ; &20 ; movers_tile_x_fraction ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3571 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &3581 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &3591 00 00 00 00 00 ; &20 ; suppress_events &3596 00 ; unused &3597 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &35a7 00 00 00 00 00 00 00 ; security_code_data ; 0 1 2 3 4 5 6 7 8 9 a b c d e f # Top nibble specifies colour, bottom nibble symbol &35ae 45 01 00 31 15 04 42 24 40 22 30 02 03 32 45 24 ; &00 # &00 : red &35be 11 22 00 44 05 34 03 13 45 11 35 12 35 41 14 33 ; &10 # &10 : green &35ce 40 20 11 34 21 35 33 10 12 04 13 15 21 34 30 41 ; &20 # &20 : yellow &35de 15 44 35 14 05 41 42 05 43 31 45 22 11 24 00 04 ; &30 # &30 : blue &35ee 34 13 35 02 24 00 23 35 21 33 44 31 04 30 23 03 ; &40 # &40 : white &35fe 40 01 30 15 43 05 22 14 20 41 32 05 45 41 04 43 ; &50 # &360e 02 25 43 01 10 34 30 05 12 33 24 21 40 35 20 21 ; &60 # &00 : circle &361e 12 13 25 42 11 32 44 43 14 01 02 45 01 20 42 20 ; &70 # &01 : square &362e 32 43 00 33 10 02 23 31 20 10 31 15 01 42 14 22 ; &80 # &02 : diamond &363e 23 30 03 10 32 25 15 33 14 12 44 03 31 10 25 32 ; &90 # &03 : question mark &364e 04 41 21 13 40 23 00 24 11 41 34 02 22 44 03 13 ; &a0 # &04 : plus &365e 23 42 25 12 03 02 30 22 40 24 ; &b0 # &05 : triangle ; sprite_data ; sprite_00_data (SPRITE_PLAYER) &3668 00 00 00 00 00 00 00 00 00 00 00 00 05 05 05 00 &3678 03 3e 11 1b 1b 1b 0f 0f 28 00 00 22 33 22 27 0a &3688 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3698 00 00 00 00 00 00 00 00 03 01 01 01 01 01 01 01 &36a8 07 07 03 02 01 03 03 03 0f 0a 0a 03 03 16 14 28 &36b8 00 00 00 02 02 00 00 00 00 00 00 00 00 00 00 00 &36c8 00 00 00 00 00 01 00 00 00 00 00 01 01 02 03 03 &36d8 03 00 03 02 05 0f 05 02 00 00 00 00 00 0a 0f 0f &36e8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_01_data (SPRITE_PLAYER_FRAME_TWO) &36f8 00 00 00 00 00 00 00 00 01 15 00 05 0f 0f 0f 05 &3708 16 28 22 33 33 33 1b 0f 00 00 00 00 22 00 0a 00 &3718 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3728 01 00 00 00 00 00 00 00 03 03 03 03 02 03 03 03 &3738 0f 0f 0f 01 03 03 16 16 00 00 00 03 03 00 28 00 &3748 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3758 00 00 00 00 00 03 03 01 01 01 00 07 07 05 07 07 &3768 03 02 00 0a 0f 1a 1a 1a 00 00 00 00 00 0a 0a 0a &3778 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_02_data (SPRITE_PLAYER_FRAME_THREE) &3788 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3798 03 15 11 05 0f 0f 05 00 14 28 33 33 33 1b 0f 00 &37a8 00 00 00 22 00 0a 00 00 00 00 00 00 00 00 00 00 &37b8 01 00 00 00 00 00 00 00 03 03 03 01 01 01 01 01 &37c8 0f 03 03 02 01 01 03 03 0a 0a 00 03 03 02 14 14 &37d8 00 00 00 02 02 28 28 00 00 00 00 00 00 00 00 00 &37e8 00 00 01 05 00 00 03 01 03 02 02 0a 0f 0f 01 03 &37f8 00 00 00 00 0a 30 25 0f 01 05 05 05 0f 0f 0a 0a &3808 02 03 0a 0a 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_03_data (SPRITE_PLAYER_CLIMBING) &3818 00 00 00 00 00 00 00 00 01 03 03 03 03 03 3f 11 &3828 03 03 15 0f 0f 0f 05 00 03 03 2a 0f 0f 0f 0a 00 &3838 03 3f 22 00 00 00 00 00 00 00 00 00 00 00 00 00 &3848 05 05 05 00 00 01 01 01 03 03 03 03 03 03 03 03 &3858 0b 03 03 03 03 03 03 03 00 00 00 00 00 00 02 03 &3868 00 00 00 00 00 00 00 00 00 00 00 00 01 00 05 05 &3878 00 00 00 00 02 22 0a 02 03 22 0f 0f 0f 0f 0b 03 &3888 00 00 00 00 00 00 02 02 ; sprite_04_data (SPRITE_SPLINX_ACTIVE) &3890 11 11 11 11 11 00 00 00 33 33 33 3f 3f 37 33 11 &38a0 33 33 33 33 33 3b 3b 33 33 33 33 33 33 22 22 00 &38b0 00 00 00 00 00 00 11 11 00 00 00 11 33 33 33 33 &38c0 00 00 00 33 33 33 33 33 00 00 00 00 22 22 33 33 ; sprite_05_data (SPRITE_SPLINX_INACTIVE) &38d0 00 14 00 00 00 15 15 15 3f 3f 02 3f 2a 35 3f 00 &38e0 3f 2a 00 00 2a 20 2a 2a 00 00 00 00 00 00 00 00 &38f0 00 00 15 2a 2a 00 00 00 00 00 3f 00 2a 2a 2a 3f &3900 00 00 3f 00 3f 3f 3f 3f 00 00 00 2a 2a 2a 2a 00 ; sprite_06_data (SPRITE_CONTROLLER) &3910 00 11 11 11 11 11 3f 15 33 27 0b 03 0b 27 33 00 &3920 1b 07 03 07 1b 33 22 00 22 22 22 22 33 00 00 00 &3930 00 00 00 28 39 28 00 00 00 00 00 28 39 28 00 00 &3940 00 00 00 00 00 00 00 00 f1 11 05 11 05 11 05 33 &3950 f8 33 0f 33 0f 33 0f 33 f6 33 0f 33 0f 33 0f 22 &3960 f1 22 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 &3970 00 00 00 51 a8 a0 a3 54 00 54 a0 00 05 02 03 02 &3980 f2 00 01 03 01 0a 05 05 f9 00 02 03 02 05 0a 0a &3990 00 a8 51 00 0a 01 03 01 00 00 00 a0 54 51 52 a8 ; sprite_07_data (SPRITE_RIJAN) &39a0 00 00 00 00 00 04 04 00 0c 04 00 04 0c 0c 0c 0c &39b0 02 00 0c 08 0c 04 0c 08 00 00 00 08 00 08 00 00 &39c0 00 04 00 00 00 00 00 04 08 00 08 03 00 04 08 01 &39d0 00 00 04 03 03 02 02 06 0c 08 00 00 00 00 08 04 ; sprite_08_data (SPRITE_RIJAN_FRAME_TWO) &39e0 00 00 00 00 00 04 04 00 04 04 00 04 0c 0c 0c 0c &39f0 02 02 0c 08 0c 04 0c 08 00 00 00 08 00 08 00 00 &3a00 00 00 00 00 00 00 00 00 04 04 04 01 04 09 09 0c &3a10 08 00 00 02 02 03 06 02 00 00 00 00 00 00 00 00 ; sprite_09_data (SPRITE_MADRAG) &3a20 04 04 04 01 04 00 00 00 0c 0c 0e 06 06 0d 0c 00 &3a30 08 0d 0e 0c 0c 0c 0e 0c 0d 0c 0e 0c 0f 0c 08 00 &3a40 0c 0d 0a 0a 04 00 08 00 04 00 08 04 00 08 00 00 &3a50 00 00 00 00 00 00 00 04 00 00 0d 04 0d 00 0c 0c &3a60 0c 04 00 0e 0d 0c 04 04 0c 0e 04 08 0d 0e 0d 0c &3a70 0c 0f 0c 0d 0d 0d 0e 0d 0a 0a 0a 0a 00 0c 00 08 &3a80 04 00 00 00 00 00 00 00 0c 0c 04 05 04 05 04 00 &3a90 08 08 08 08 0e 0c 0e 0d 04 00 00 04 00 0f 0c 0d &3aa0 0c 04 08 0c 0c 04 0a 0d 00 08 08 08 00 00 00 00 ; sprite_0a_data (SPRITE_MASTER) &3ab0 00 00 00 00 00 00 00 00 30 30 30 30 30 30 30 30 &3ac0 bb 31 31 ff ff ff 75 30 77 bb 77 33 33 bb ff 30 &3ad0 30 30 30 32 30 30 30 30 00 00 00 00 00 00 00 00 &3ae0 75 30 30 30 00 00 00 00 ff ff ba 75 75 75 75 75 &3af0 ff 75 ff ba 75 75 ba ff ba ba 30 ba ba ba ba ba &3b00 00 00 00 00 00 00 30 ba 00 00 00 00 00 00 00 00 &3b10 30 30 75 75 30 30 75 75 ff ba ba ba ff ff 75 ff &3b20 30 30 30 30 30 30 75 ff 75 75 75 75 ff ff ba ba &3b30 ba ff 30 30 30 30 30 30 30 30 30 00 00 00 00 00 ; sprite_0b_data (SPRITE_MARKER_1) &3b40 00 33 27 33 33 33 27 33 00 33 0f 1b 1b 1b 1b 33 &3b50 00 22 22 22 22 22 22 22 ; sprite_0c_data (SPRITE_MARKER_2) &3b58 00 33 27 27 27 33 27 33 00 33 0f 33 0f 27 0f 33 &3b68 00 22 22 22 22 22 22 22 ; sprite_0d_data (SPRITE_MARKER_3) &3b70 00 33 27 33 33 33 27 33 00 33 0f 27 0f 27 0f 33 &3b80 00 22 22 22 22 22 22 22 ; sprite_0e_data (SPRITE_MARKER_4) &3b88 00 33 33 33 27 27 27 33 00 33 27 27 0f 27 27 33 &3b98 00 22 22 22 22 22 22 22 ; sprite_0f_data (SPRITE_CIRCUIT_BOARD_S) &3ba0 03 17 03 17 17 17 03 00 03 3f 17 3f 03 3f 03 00 &3bb0 02 02 02 02 02 02 02 00 ; sprite_10_data (SPRITE_CIRCUIT_BOARD_T) &3bb8 03 03 03 03 03 17 03 00 03 2b 2b 2b 2b 3f 03 00 &3bc8 02 02 02 02 02 02 02 00 ; sprite_11_data (SPRITE_CIRCUIT_BOARD_A) &3bd0 03 17 17 17 17 17 03 00 03 17 17 3f 17 3f 03 00 &3be0 02 02 02 02 02 02 02 00 ; sprite_12_data (SPRITE_CIRCUIT_BOARD_R) &3be8 03 17 17 17 17 17 03 00 03 17 17 2b 17 3f 03 00 &3bf8 02 02 02 02 02 02 02 00 ; save_position_encryption_key ; sprite_13_data (SPRITE_CIRCUIT_BOARD_O) &3c00 03 17 17 17 17 17 03 00 03 3f 17 17 17 3f 03 00 &3c10 02 02 02 02 02 02 02 00 ; sprite_14_data (SPRITE_CIRCUIT_BOARD_P) &3c18 03 17 17 17 17 17 03 00 03 03 03 3f 17 3f 03 00 &3c28 02 02 02 02 02 02 02 00 ; sprite_15_data (SPRITE_ANTIGRAVITY_MAT) &3c30 03 01 3c 38 3c 00 00 00 02 00 3c 30 3c 00 00 00 &3c40 01 00 3c 30 3c 00 00 00 03 02 3c 34 3c 00 00 00 ; sprite_16_data (SPRITE_MEMORY_CAPSULE) &3c50 3f 2a 2a 2a 2a 3f 00 00 3f 3f 00 2a 00 3f 00 00 &3c60 3f 2a 00 2a 00 3f 00 00 2a 2a 2a 2a 2a 2a 00 00 ; sprite_17_data (SPRITE_CLOTH) &3c70 01 03 00 00 00 00 00 00 03 01 00 00 00 00 00 00 &3c80 00 03 03 00 00 00 00 00 02 02 00 00 00 00 00 00 ; sprite_18_data (SPRITE_TIRU_LATTICE) &3c90 11 37 3b 37 3b 37 11 00 00 22 2a 22 2a 22 00 00 ; sprite_19_data (SPRITE_EXPLOSIVES) &3ca0 27 07 07 05 27 07 07 00 33 03 03 00 33 03 03 00 &3cb0 27 07 07 05 27 07 07 00 22 37 02 00 22 37 02 00 ; sprite_1a_data (SPRITE_OXYGEN) &3cc0 28 3c 28 14 14 14 28 3c 14 3c 14 28 28 28 14 3c &3cd0 00 00 00 00 3c 3c 28 3c 00 00 00 00 3c 3c 14 3c ; sprite_1b_data (SPRITE_PACKING_CASE) &3ce0 3f 2a 3f 3f 2a 3f 2a 3f 3f 3f 15 2a 3f 15 2a 3f &3cf0 3f 15 2a 3f 15 2a 3f 3f 3f 15 3f 15 3f 3f 15 3f ; sprite_1c_data (SPRITE_PASS_CARD) &3d00 03 06 06 06 03 00 00 00 03 0c 0c 0c 03 00 00 00 &3d10 02 02 02 02 02 00 00 00 ; sprite_1d_data (SPRITE_PICK) &3d18 00 00 00 00 00 28 14 00 05 05 05 05 05 05 05 3c &3d28 00 00 00 00 00 00 14 28 00 00 00 00 00 28 00 00 ; sprite_1e_data (SPRITE_ELECTRONIC_SPANNER) &3d38 3c 3c 00 00 00 00 00 00 3c 36 00 00 00 00 00 00 &3d48 33 11 01 00 00 00 00 00 22 00 02 00 00 00 00 00 ; sprite_1f_data (SPRITE_DETONATOR) &3d58 33 03 03 00 15 15 15 00 33 03 03 3f 37 3f 3d 3f &3d68 33 03 03 2a 35 3f 1d 2a 22 27 02 00 00 00 00 00 ; sprite_20_data (SPRITE_TEST_TUBE) &3d78 00 15 15 15 15 15 15 2a 3f 03 03 03 03 00 00 00 &3d88 00 2a 2a 2a 2a 2a 2a 15 ; sprite_21_data (SPRITE_EGG) &3d90 3f 15 15 15 15 00 00 00 3f 15 15 00 2a 2a 3f 15 &3da0 3f 3f 3f 3f 3f 3f 3f 2a 3f 2a 2a 2a 2a 00 00 00 &3db0 00 00 00 15 15 3f 3f 3f 00 00 3f 3f 3f 3f 3f 3f &3dc0 00 00 3f 3f 3f 3f 3f 3f 00 00 00 2a 2a 3f 3f 3f ; sprite_22_data (SPRITE_HATCH) &3dd0 00 3f 3f 15 00 00 00 00 00 3f 2e 3f 17 00 00 00 &3de0 00 3f 3f 0c 3f 2a 2a 15 00 3f 3f 0c 3f 15 15 2a &3df0 00 3f 1d 3f 2b 00 00 00 00 3f 3f 2a 00 00 00 00 ; sprite_23_data (SPRITE_CRYSTAL) &3e00 00 14 39 14 00 00 00 00 28 36 39 3c 00 00 00 00 &3e10 00 00 28 00 00 00 00 00 ; sprite_24_data (SPRITE_SPLINX_AS_OBJECT) &3e18 00 14 00 00 00 15 15 15 3f 3f 02 3f 2a 35 3f 00 &3e28 3f 2a 00 00 2a 20 2a 2a 00 00 00 00 00 00 00 00 &3e38 00 00 15 2a 2a 00 00 00 00 00 3f 00 2a 2a 2a 3f &3e48 00 00 3f 00 3f 3f 3f 3f 00 00 00 2a 2a 2a 2a 00 ; sprite_25_data (SPRITE_ESCAPE_POD_ACTIVATOR) &3e58 03 00 00 00 00 00 00 00 02 02 03 00 00 00 00 00 &3e68 01 01 03 00 00 00 00 00 03 00 00 00 00 00 00 00 ; sprite_26_data (SPRITE_HEATONITE_ORE) &3e78 00 0e 05 05 05 05 0e 04 0e 0f 00 0d 08 05 0a 0c &3e88 0e 05 0d 0f 00 0f 08 05 08 0f 00 0a 08 0e 0d 0a ; sprite_27_data (SPRITE_POWER_CELL) &3e98 3f 15 01 01 01 01 15 3f 3f 3f 09 09 09 09 3f 3f &3ea8 2a 00 00 00 00 00 00 2a ; sprite_28_data (SPRITE_MADRAG_FRAME_TWO) &3eb0 04 10 04 04 00 05 00 00 0c 0c 0e 03 09 0d 0c 00 &3ec0 0c 0d 0e 0c 0c 0c 0e 0c 05 0c 0e 0c 0f 0c 08 00 &3ed0 0c 0d 0a 0a 04 00 08 00 04 00 08 04 00 08 00 00 &3ee0 00 00 00 00 00 00 00 04 04 0c 05 00 00 00 0c 0c &3ef0 00 0c 0c 0c 04 00 08 0c 04 04 08 0c 0c 0c 0d 04 &3f00 0c 0f 0c 05 05 0d 0e 0d 0a 0a 0a 0a 00 0c 00 08 &3f10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 &3f20 0c 04 00 00 04 0c 0c 0d 0c 0c 04 0c 04 05 04 0d &3f30 08 08 08 08 0c 0c 0e 0d 00 00 00 00 00 00 08 08 ; sprite_29_data (SPRITE_MASTER_FRAME_TWO) &3f40 00 00 00 00 00 00 00 00 30 30 30 30 75 75 75 30 &3f50 ff ff 75 bb bb bb ff ff ba 75 32 ba 33 32 32 ba &3f60 30 30 30 30 30 30 00 00 00 00 00 00 00 00 00 00 &3f70 30 30 30 30 30 30 30 00 ff ff ba 75 ff ba ff 75 &3f80 ff 75 ff ff 75 ff 75 ff ba ba ba ba ba ba ba ba &3f90 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3fa0 00 00 30 30 30 75 75 30 30 30 30 75 75 75 ba ba &3fb0 ff ff ff ff ff ff ff ff ba 30 30 30 ba ff 75 75 &3fc0 00 00 00 00 30 30 30 30 00 00 00 00 00 00 00 00 ; sprite_2a_data (SPRITE_PLAYER_DEAD) &3fd0 05 0f 0f 0f 1b 1b 00 00 00 0a 1b 33 33 33 22 00 &3fe0 03 13 01 02 29 3c 14 00 03 33 03 03 03 28 00 00 &3ff0 07 07 07 02 00 00 00 00 0b 0b 0b 01 00 00 00 00 # &4980 - &4d7f is moved to &0400 - &07ff at &4e36 # Movers # ====== # target 0 target 1 target 2 target 3 # mover &00 at (&1c, &2e.2), type &05 (MOVER_TYPE_SPLINX) (&1c, &2e), (&00, &00), (&00, &00), (&00, &00) # mover &01 at (&2c, &34.1), type &07 (MOVER_TYPE_MADRAG) (&2c, &34), (&2e, &34), (&2c, &34), (&2e, &34) # mover &02 at (&6e, &1b.1), type &08 (MOVER_TYPE_MASTER) (&6e, &1b), (&6e, &1b), (&5a, &1b), (&6e, &1b) # mover &03 at (&43, &11.0), type &01 (MOVER_TYPE_FAST_CONTROLLER) (&43, &11), (&43, &11), (&43, &11), (&43, &11) # mover &04 at (&69, &0b.0), type &09 (MOVER_TYPE_PRISON_ESCORT_CONTROLLER) (&69, &0b), (&69, &0b), (&5e, &0b), (&69, &0b) # mover &05 at (&14, &2b.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&14, &2b), (&0d, &2d), (&09, &2f), (&0d, &2f) # mover &06 at (&27, &27.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&27, &27), (&36, &29), (&3a, &27), (&30, &27) # mover &07 at (&3c, &2d.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&3c, &2d), (&31, &2d), (&0d, &2c), (&25, &29) # mover &08 at (&0d, &2c.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&0d, &2c), (&25, &29), (&3c, &2d), (&31, &2d) # mover &09 at (&31, &2f.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&31, &2f), (&3c, &32), (&36, &34), (&3c, &32) # mover &0a at (&42, &28.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&42, &28), (&4e, &28), (&42, &28), (&4e, &28) # mover &0b at (&4e, &28.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&4e, &28), (&63, &28), (&4e, &28), (&63, &28) # mover &0c at (&6b, &31.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&6b, &31), (&73, &34), (&7a, &31), (&73, &2f) # mover &0d at (&73, &2f.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&73, &2f), (&6b, &2d), (&7a, &2d), (&76, &2f) # mover &0e at (&5a, &09.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&5a, &09), (&44, &0f), (&5a, &09), (&44, &0f) # mover &0f at (&5d, &09.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&5d, &09), (&62, &09), (&5d, &09), (&62, &09) # mover &10 at (&55, &0f.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&55, &0f), (&67, &0f), (&6d, &11), (&67, &0f) # mover &11 at (&52, &0d.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&52, &0d), (&6d, &11), (&5a, &11), (&5e, &11) # mover &12 at (&45, &1f.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&45, &1f), (&59, &1b), (&48, &1b), (&54, &1b) # mover &13 at (&69, &1b.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&69, &1b), (&5d, &1b), (&6f, &19), (&5d, &1b) # mover &14 at (&77, &1c.3), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&77, &1c), (&61, &1d), (&77, &1c), (&61, &1d) # mover &15 at (&56, &1f.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&56, &1f), (&61, &1f), (&56, &1f), (&61, &1f) # mover &16 at (&49, &19.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&49, &19), (&5a, &19), (&49, &19), (&5a, &19) # mover &17 at (&0f, &11.0), type &03 (MOVER_TYPE_COOLED_CONTROLLER) (&0f, &11), (&33, &11), (&0f, &11), (&33, &11) # mover &18 at (&33, &11.0), type &03 (MOVER_TYPE_COOLED_CONTROLLER) (&33, &11), (&0f, &11), (&33, &11), (&0f, &11) # mover &19 at (&2b, &0b.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&2b, &0b), (&17, &0b), (&2b, &0b), (&17, &0b) # mover &1a at (&1b, &09.0), type &01 (MOVER_TYPE_FAST_CONTROLLER) (&1b, &09), (&1b, &09), (&1b, &09), (&1b, &09) # mover &1b at (&1e, &07.0), type &01 (MOVER_TYPE_FAST_CONTROLLER) (&1e, &07), (&1e, &07), (&1e, &07), (&1e, &07) # mover &1c at (&44, &05.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&44, &05), (&44, &05), (&44, &05), (&44, &05) # mover &1d at (&3c, &05.0), type &02 (MOVER_TYPE_SLOW_CONTROLLER) (&3c, &05), (&39, &05), (&3c, &05), (&39, &05) # mover &1e at (&13, &05.1), type &06 (MOVER_TYPE_RIJAN) (&13, &05), (&0c, &07), (&13, &09), (&0d, &07) # mover &1f at (&13, &05.1), type &06 (MOVER_TYPE_RIJAN) (&13, &05), (&1c, &07), (&13, &09), (&1c, &07) # mover &20 at (&25, &0f.1), type &06 (MOVER_TYPE_RIJAN) (&25, &0f), (&12, &11), (&25, &0f), (&12, &11) # mover &21 at (&12, &11.1), type &06 (MOVER_TYPE_RIJAN) (&12, &11), (&25, &0f), (&12, &11), (&25, &0f) # mover &22 at (&3d, &29.1), type &06 (MOVER_TYPE_RIJAN) (&3d, &29), (&1c, &29), (&07, &30), (&1c, &29) # mover &23 at (&07, &30.1), type &06 (MOVER_TYPE_RIJAN) (&07, &30), (&1c, &29), (&3d, &29), (&1c, &29) # mover &24 is unused ; movers_tile_x # &0400 - &0424 is a copy of &30e3 - &3107 ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &0400 1c 2c 6e 43 69 14 27 3c 0d 31 42 4e 6b 73 5a 5d ; &00 &0410 55 52 45 69 77 56 49 0f 33 2b 1b 1e 44 3c 13 13 ; &10 &0420 25 12 3d 07 ff ; &20 ; movers_tile_y # &0425 - &0449 is a copy of &3108 - &312c ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &0425 2e 34 1b 11 0b 2b 27 2d 2c 2f 28 28 31 2f 09 09 ; &00 &0435 0f 0d 1f 1b 1c 1f 19 11 11 0b 09 07 05 05 05 05 ; &10 &0445 0f 11 29 30 ff ; &20 ; movers_tile_y_fraction # &044a - &046e is a copy of &312d - &3151 ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &044a 02 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &045a 00 00 00 00 03 00 00 00 00 00 00 00 00 00 01 01 ; &10 &046a 01 01 01 01 ff ; &20 ; movers_fixed_targets_x &046f 1c 00 00 00 ; &00 &0473 2c 2e 2c 2e ; &01 &0477 6e 6e 5a 6e ; &02 &047b 43 43 43 43 ; &03 &047f 69 69 5e 69 ; &04 &0483 14 0d 09 0d ; &05 &0487 27 36 3a 30 ; &06 &048b 3c 31 0d 25 ; &07 &048f 0d 25 3c 31 ; &08 &0493 31 3c 36 3c ; &09 &0497 42 4e 42 4e ; &0a &049b 4e 63 4e 63 ; &0b &049f 6b 73 7a 73 ; &0c &04a3 73 6b 7a 76 ; &0d &04a7 5a 44 5a 44 ; &0e &04ab 5d 62 5d 62 ; &0f &04af 55 67 6d 67 ; &10 &04b3 52 6d 5a 5e ; &11 &04b7 45 59 48 54 ; &12 &04bb 69 5d 6f 5d ; &13 &04bf 77 61 77 61 ; &14 &04c3 56 61 56 61 ; &15 &04c7 49 5a 49 5a ; &16 &04cb 0f 33 0f 33 ; &17 &04cf 33 0f 33 0f ; &18 &04d3 2b 17 2b 17 ; &19 &04d7 1b 1b 1b 1b ; &1a &04db 1e 1e 1e 1e ; &1b &04df 44 44 44 44 ; &1c &04e3 3c 39 3c 39 ; &1d &04e7 13 0c 13 0d ; &1e &04eb 13 1c 13 1c ; &1f &04ef 25 12 25 12 ; &20 &04f3 12 25 12 25 ; &21 &04f7 3d 1c 07 1c ; &22 &04fb 07 1c 3d 1c ; &23 &04ff ff ff ff ff ; &24 ; movers_fixed_targets_y &0503 2e 00 00 00 ; &00 &0507 34 34 34 34 ; &01 &050b 1b 1b 1b 1b ; &02 &050f 11 11 11 11 ; &03 &0513 0b 0b 0b 0b ; &04 &0517 2b 2d 2f 2f ; &05 &051b 27 29 27 27 ; &06 &051f 2d 2d 2c 29 ; &07 &0523 2c 29 2d 2d ; &08 &0527 2f 32 34 32 ; &09 &052b 28 28 28 28 ; &0a &052f 28 28 28 28 ; &0b &0533 31 34 31 2f ; &0c &0537 2f 2d 2d 2f ; &0d &053b 09 0f 09 0f ; &0e &053f 09 09 09 09 ; &0f &0543 0f 0f 11 0f ; &10 &0547 0d 11 11 11 ; &11 &054b 1f 1b 1b 1b ; &12 &054f 1b 1b 19 1b ; &13 &0553 1c 1d 1c 1d ; &14 &0557 1f 1f 1f 1f ; &15 &055b 19 19 19 19 ; &16 &055f 11 11 11 11 ; &17 &0563 11 11 11 11 ; &18 &0567 0b 0b 0b 0b ; &19 &056b 09 09 09 09 ; &1a &056f 07 07 07 07 ; &1b &0573 05 05 05 05 ; &1c &0577 05 05 05 05 ; &1d &057b 05 07 09 07 ; &1e &057f 05 07 09 07 ; &1f &0583 0f 11 0f 11 ; &20 &0587 11 0f 11 0f ; &21 &058b 29 29 30 29 ; &22 &058f 30 29 29 29 ; &23 &0593 ff ff ff ff ; &24 ; mover_flags # &0597 - &05bb is a copy of &30e3 - &3107 ; 0 1 2 3 4 5 6 7 8 9 a b c d e f # Values are overwritten &0597 1c 2c 6e 43 69 14 27 3c 0d 31 42 4e 6b 73 5a 5d ; &00 &05a7 55 52 45 69 77 56 49 0f 33 2b 1b 1e 44 3c 13 13 ; &10 &05b7 25 12 3d 07 ff ; &20 # Objects # ======= # object &00 at (&ff.0, &ff.0), type &00 (OBJECT_TYPE_MARKER_1) # object &01 at (&ff.0, &ff.0), type &01 (OBJECT_TYPE_MARKER_2) # object &02 at (&ff.0, &ff.0), type &02 (OBJECT_TYPE_MARKER_3) # object &03 at (&ff.0, &ff.0), type &03 (OBJECT_TYPE_MARKER_4) # object &04 at (&0e.3, &1b.2), type &04 (OBJECT_TYPE_CIRCUIT_BOARD_S) # object &05 at (&48.2, &05.2), type &04 (OBJECT_TYPE_CIRCUIT_BOARD_S) # object &06 at (&0f.3, &1b.2), type &05 (OBJECT_TYPE_CIRCUIT_BOARD_T) # object &07 at (&12.3, &1b.2), type &05 (OBJECT_TYPE_CIRCUIT_BOARD_T) # object &08 at (&10.3, &1b.2), type &06 (OBJECT_TYPE_CIRCUIT_BOARD_A) # object &09 at (&11.3, &1b.2), type &07 (OBJECT_TYPE_CIRCUIT_BOARD_R) # object &0a at (&44.2, &02.2), type &07 (OBJECT_TYPE_CIRCUIT_BOARD_R) # object &0b at (&40.2, &02.2), type &08 (OBJECT_TYPE_CIRCUIT_BOARD_O) # object &0c at (&33.2, &05.2), type &09 (OBJECT_TYPE_CIRCUIT_BOARD_P) # object &0d at (&14.0, &05.2), type &0a (OBJECT_TYPE_ANTIGRAVITY_MAT) # object &0e at (&1b.0, &05.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &0f at (&77.0, &05.2), type &0b (OBJECT_TYPE_MEMORY_CAPSULE) # object &10 at (&28.0, &07.2), type &0c (OBJECT_TYPE_CLOTH) # object &11 at (&12.3, &11.2), type &0d (OBJECT_TYPE_TIRU_LATTICE) # object &12 at (&6b.0, &0b.2), type &0e (OBJECT_TYPE_EXPLOSIVES) # object &13 at (&3c.0, &32.2), type &0e (OBJECT_TYPE_EXPLOSIVES) # object &14 at (&30.0, &34.2), type &0f (OBJECT_TYPE_OXYGEN) # object &15 at (&2a.0, &23.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &16 at (&0d.0, &23.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &17 at (&0a.0, &34.3), type &10 (OBJECT_TYPE_PACKING_CASE) # object &18 at (&25.0, &23.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &19 at (&34.0, &23.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &1a at (&61.0, &23.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &1b at (&6d.0, &23.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &1c at (&76.0, &23.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &1d at (&55.4, &11.0), type &11 (OBJECT_TYPE_PASS_CARD) # object &1e at (&0a.0, &2f.2), type &12 (OBJECT_TYPE_PICK) # object &1f at (&31.0, &1f.2), type &13 (OBJECT_TYPE_ELECTRONIC_SPANNER) # object &20 at (&50.0, &0f.2), type &14 (OBJECT_TYPE_DETONATOR) # object &21 at (&2b.0, &09.2), type &10 (OBJECT_TYPE_PACKING_CASE) # object &22 at (&2c.0, &09.2), type &15 (OBJECT_TYPE_TEST_TUBE) # object &23 at (&2d.0, &09.2), type &18 (OBJECT_TYPE_CRYSTAL) # object &24 at (&21.0, &34.2), type &16 (OBJECT_TYPE_EGG) # object &25 at (&20.0, &34.2), type &16 (OBJECT_TYPE_EGG) # object &26 at (&51.0, &31.2), type &16 (OBJECT_TYPE_EGG) # object &27 at (&58.0, &30.2), type &16 (OBJECT_TYPE_EGG) # object &28 at (&6f.1, &0b.2), type &17 (OBJECT_TYPE_HATCH) # object &29 at (&71.1, &0b.2), type &17 (OBJECT_TYPE_HATCH) # object &2a at (&53.0, &23.2), type &18 (OBJECT_TYPE_CRYSTAL) # object &2b at (&1c.0, &2e.2), type &19 (OBJECT_TYPE_SPLINX_AS_OBJECT) # object &2c at (&59.0, &0b.2), type &1a (OBJECT_TYPE_ESCAPE_POD_ACTIVATOR) # object &2d at (&69.1, &05.2), type &17 (OBJECT_TYPE_HATCH) # object &2e at (&6d.1, &05.2), type &17 (OBJECT_TYPE_HATCH) # object &2f at (&71.1, &05.2), type &17 (OBJECT_TYPE_HATCH) # object &30 at (&2d.0, &23.2), type &1c (OBJECT_TYPE_POWER_CELL) # object &31 at (&2f.3, &34.3), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &32 at (&2f.3, &34.2), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &33 at (&2f.3, &34.1), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &34 at (&2f.3, &34.0), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &35 at (&42.2, &34.3), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &36 at (&42.2, &34.2), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &37 at (&42.2, &34.1), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &38 at (&42.2, &34.0), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &39 at (&48.3, &2d.3), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &3a at (&48.3, &2d.2), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &3b at (&48.3, &2d.1), type &1b (OBJECT_TYPE_HEATONITE_ORE) # object &3c at (&48.3, &2d.0), type &1b (OBJECT_TYPE_HEATONITE_ORE) ; objects_tile_x # &05bc - &05f8 is a copy of &3152 - &318e ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &05bc ff ff ff ff 0e 48 0f 12 10 11 44 40 33 14 1b 77 ; &00 &05cc 28 12 6b 3c 30 2a 0d 0a 25 34 61 6d 76 55 0a 31 ; &10 &05dc 50 2b 2c 2d 21 20 51 58 6f 71 53 1c 59 69 6d 71 ; &20 &05ec 2d 2f 2f 2f 2f 42 42 42 42 48 48 48 48 ; &30 ; objects_tile_x_fraction # &05f9 - &0635 is a copy of &318f - &31cb ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &05f9 00 00 00 00 03 02 03 03 03 03 02 02 02 00 00 00 ; &00 &0609 00 03 00 00 00 00 00 00 00 00 00 00 00 04 00 00 ; &10 &0619 00 00 00 00 00 00 00 00 01 01 00 00 00 01 01 01 ; &20 &0629 00 03 03 03 03 02 02 02 02 03 03 03 03 ; &30 ; objects_tile_y # &0636 - &0672 is a copy of &31cc - &3208 ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &0636 ff ff ff ff 1b 05 1b 1b 1b 1b 02 02 05 05 05 05 ; &00 &0646 07 11 0b 32 34 23 23 34 23 23 23 23 23 11 2f 1f ; &10 &0656 0f 09 09 09 34 34 31 30 0b 0b 23 2e 0b 05 05 05 ; &20 &0666 23 34 34 34 34 34 34 34 34 2d 2d 2d 2d ; &30 ; objects_tile_y_fraction # &0673 - &06af is a copy of &3209 - &3246 ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &0673 00 00 00 00 02 02 02 02 02 02 02 02 02 02 02 02 ; &00 &0683 02 02 02 02 02 02 02 03 02 02 02 02 02 00 02 02 ; &10 &0693 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ; &20 &06a3 02 03 02 01 00 03 02 01 00 03 02 01 00 ; &30 ; movers_object_carried_or_disabled # Top bit set if mover disabled by explosion ; 0 1 2 3 4 5 6 7 8 9 a b c d e f # Non-zero if moving is carrying object &06b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &06c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &06d0 00 00 00 00 00 ; &20 ; unused &06d5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &06e5 00 00 00 00 00 00 00 00 ; splinx_active &06ed 00 # Non-zero if Splinx is active ; symbol_character_definitions &06ee 18 7e ff ff ff ff 7e 18 ; 0 : circle &06f6 ff ff ff ff ff ff ff ff ; 1 : square &06fe 18 3c 7e ff 7e 3c 18 00 ; 2 : diamond &0706 3c 66 0c 0c 18 00 18 18 ; 3 : question mark &070e 18 18 18 ff ff 18 18 18 ; 4 : plus &0716 18 18 3c 3c 7e 7e ff ff ; 5 : triangle ; objects_tile_address_low ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &071e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &00 &072e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &10 &073e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &20 &074e 00 00 00 00 00 00 00 00 00 00 00 00 00 ; &30 ; colour_letters ; 0 1 2 3 4 ; R G Y B W &075b 52 47 59 42 57 ; "RGYBW" ; control_panel_boards_object &0760 20 20 20 20 20 ; unused &0765 00 ; control_panel_boards_shuffle &0766 ff ff ff ff ff ; ordinal_suffixes &076b 73 74 ; "st" &076d 6e 64 ; "nd" &076f 72 64 ; "rd" &0771 74 68 ; "th" &0773 74 68 ; "th" ; splinx_command_strings &0775 42 6c 61 6e 6b 40 ; &00 : "Blank@" &077b 47 6f 23 31 40 ; &01 : "Go#1@" &0780 47 6f 23 32 40 ; &02 : "Go#2@" &0785 47 6f 23 33 40 ; &03 : "Go#3@" &078a 47 6f 23 34 40 ; &04 : "Go#4@" &078f 50 69 63 6b 40 ; &05 : "Pick@" &0794 44 72 6f 70 40 ; &06 : "Drop@" &0799 46 6f 6c 6c 6f 77 40 ; &07 : "Follow@" &07a0 53 74 61 79 40 ; &08 : "Stay@" &07a5 43 68 61 72 67 65 40 ; &09 : "Charge@" ; cryostatic_chambers_score_low &07ac 00 00 00 00 00 00 00 80 ; cryostatic_chambers_score_high &07b4 40 20 10 08 04 02 01 00 ; changing_palette_values ; e d c 8 9 a ; B B W M Y M &07bc 03 03 00 02 04 02 ; player_is_jumping &07c2 00 ; player_was_climbing_at_start_of_jump &07c3 00 ; used_cryostatic_chambers_tile_address_low &07c4 20 20 20 20 20 20 20 20 ; game_state ; splinx_program &07cc 00 00 00 00 00 00 00 00 ; detonator_countdown &07d4 00 ; used_cryostatic_chambers_tile_address_high &07d5 00 00 00 00 00 00 00 00 ; inventory &07dd 00 00 00 00 00 00 ; thrown_object &07e3 00 ; throw_direction &07e4 00 ; splinx_markers_state &07e5 00 00 00 00 ; player_sprite &07e9 00 ; tardis_location &07ea 00 # Zero in mine workings, non-zero in unmapped area ; security_code_correctly_entered &07eb 00 # Non-zero if security code has been correctly entered ; factory_stopped &07ec 00 # Non-zero if factory has been stopped ; mover_touching_cloth &07ed 00 # Non-zero if controller is touching cloth ; madrag_eggs_disturbed &07ee 00 # Non-zero if Madrag's eggs have moved ; stolen_tiru_stun_cooldown &07ef 00 # Non-zero if TIRU lattice has been stolen ; rijans_state &07f0 00 # Always zero; would make Rijans kill player if not ; splinx_power &07f1 00 ; splinx_power_fraction &07f2 00 ; splinx_reached_target &07f3 00 ; time_low &07f4 00 ; time_high &07f5 00 ; time_fraction &07f6 00 ; disabled_movers_countdown &07f7 00 ; detonator_uses_remaining &07f8 00 ; suppress_stealing_tiru_lattice &07f9 00 ; reactor_meltdown_timer_low &07fa 00 ; reactor_meltdown_timer_high &07fb 00 ; end of game state ; unused &07fc 00 00 00 00 ; unused &4d80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4d90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4da0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4db0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4dc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4dd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4de0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4df0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; entry_point &4e00 a9 00 LDA #&00 &4e02 8d 62 02 STA &0262 ; os_sound_suppression # Set to zero to enable sound &4e05 85 70 STA &70 ; score_low &4e07 85 71 STA &71 ; score_high &4e09 85 00 STA &00 ; source_address_low &4e0b a9 12 LDA #&12 ; &1200 &4e0d 85 01 STA &01 ; source_address_high &4e0f a9 80 LDA #&80 ; &0880 &4e11 85 02 STA &02 ; target_address_low &4e13 a9 08 LDA #&08 &4e15 85 03 STA &03 ; target_address_high &4e17 a9 00 LDA #&00 ; &4000 &4e19 85 04 STA &04 ; end_address_low &4e1b a9 40 LDA #&40 &4e1d 20 bf 4e JSR &4ebf ; move_memory # Move &1200 - &497f to &0880 - &3fff &4e20 a9 80 LDA #&80 ; &4980 &4e22 85 00 STA &00 ; source_address_low &4e24 a9 49 LDA #&49 &4e26 85 01 STA &01 ; source_address_high &4e28 a9 00 LDA #&00 ; &0400 &4e2a 85 02 STA &02 ; target_address_low &4e2c a9 04 LDA #&04 &4e2e 85 03 STA &03 ; target_address_high &4e30 a9 00 LDA #&00 &4e32 85 04 STA &04 ; end_address_low &4e34 a9 08 LDA #&08 ; &0800 &4e36 20 bf 4e JSR &4ebf ; move_memory # Move &4980 - &4d7f to &0400 - &07ff &4e39 ad 0e 02 LDA &020e ; oswrch_vector_low &4e3c 8d d2 32 STA &32d2 ; previous_oswrch_vector_low &4e3f ad 0f 02 LDA &020f ; oswrch_vector_high &4e42 8d d3 32 STA &32d3 ; previous_oswrch_vector_high &4e45 a9 0a LDA #&0a ; &2f0a = oswrch_handler &4e47 8d 0e 02 STA &020e ; oswrch_vector_low &4e4a a9 2f LDA #&2f &4e4c 8d 0f 02 STA &020f ; oswrch_vector_high &4e4f a9 04 LDA #&04 ; Define action of cursor editing keys &4e51 a2 01 LDX #&01 ; Cursor keys return ASCII values 135-139 &4e53 20 f4 ff JSR &fff4 ; OSBYTE &4e56 a9 0b LDA #&0b ; Set auto-repeat delay &4e58 a2 00 LDX #&00 &4e5a 20 f4 ff JSR &fff4 ; OSBYTE ; check_roms &4e5d a2 0f LDX #&0f # For each ROM, ; check_roms_loop &4e5f a0 00 LDY #&00 &4e61 84 00 STY &00 ; rom_address_low &4e63 84 02 STY &02 ; checksum &4e65 a9 80 LDA #&80 ; &8000 = rom_data &4e67 85 01 STA &01 ; rom_address_high &4e69 86 f4 STX &f4 ; os_ram_copy_of_currently_selected_rom_number &4e6b 8e 30 fe STX &fe30 ; Paged ROM latch &4e6e ad 24 80 LDA &8024 ; rom_data + &24 &4e71 29 df AND #&df &4e73 c9 57 CMP #&57 ; "W" # Is it the Doctor Who and the Mines of Terror ROM? &4e75 d0 2f BNE &4ea6 ; consider_next_rom &4e77 ad 25 80 LDA &8025 ; rom_data + &25 &4e7a 29 df AND #&df ; "H" &4e7c c9 48 CMP #&48 &4e7e d0 26 BNE &4ea6 ; consider_next_rom &4e80 ad 26 80 LDA &8026 ; rom_data + &26 &4e83 29 df AND #&df &4e85 c9 4f CMP #&4f ; "O" &4e87 d0 1d BNE &4ea6 ; consider_next_rom ; checksum_rom_loop # If so, checksum &8000 - &bfff &4e89 b1 00 LDA (&00),Y ; rom_address &4e8b 18 CLC &4e8c 65 02 ADC &02 ; checksum &4e8e 85 02 STA &02 ; checksum &4e90 c8 INY &4e91 d0 f6 BNE &4e89 ; checksum_rom_loop &4e93 e6 01 INC &01 ; rom_address_high &4e95 a5 01 LDA &01 ; rom_address_high &4e97 c9 c0 CMP #&c0 &4e99 d0 ee BNE &4e89 ; checksum_rom_loop &4e9b a5 02 LDA &02 ; checksum &4e9d 38 SEC &4e9e ed ff 80 SBC &80ff ; expected_checksum &4ea1 cd ff 80 CMP &80ff ; expected_checksum &4ea4 f0 06 BEQ &4eac ; rom_is_ok ; consider_next_rom &4ea6 ca DEX &4ea7 10 b6 BPL &4e5f ; check_roms_loop &4ea9 6c fc ff JMP (&fffc) ; os_reset_address_low # Reset system if ROM has been modified ; rom_is_ok &4eac ad 5a 30 LDA &305a ; initial_player_lives &4eaf 4d fb 08 EOR &08fb ; decrease_player_lives &4eb2 4d fc 08 EOR &08fc ; decrease_player_lives + 1 &4eb5 c9 d6 CMP #&d6 &4eb7 f0 03 BEQ &4ebc ; to_initialise_game &4eb9 6c fc ff JMP (&fffc) ; os_reset_address_low # Reset system if tampering with lives detected ; to_initialise_game &4ebc 4c f0 2f JMP &2ff0 ; initialise_game ; move_memory &4ebf 85 05 STA &05 ; end_address_high &4ec1 a0 00 LDY #&00 ; move_memory_loop &4ec3 b1 00 LDA (&00),Y ; source_address &4ec5 91 02 STA (&02),Y ; target_address &4ec7 e6 00 INC &00 ; source_address_low &4ec9 d0 02 BNE &4ecd ; skip_page_source &4ecb e6 01 INC &01 ; source_address_high ; skip_page_source &4ecd e6 02 INC &02 ; target_address_low &4ecf d0 02 BNE &4ed3 ; skip_page_target &4ed1 e6 03 INC &03 ; target_address_high ; skip_page_target &4ed3 a5 02 LDA &02 ; target_address_low &4ed5 c5 04 CMP &04 ; end_address_low &4ed7 d0 ea BNE &4ec3 ; move_memory_loop &4ed9 a5 03 LDA &03 ; target_address_high &4edb c5 05 CMP &05 ; end_address_high &4edd d0 e4 BNE &4ec3 ; move_memory_loop &4edf 60 RTS ; unused &4ee0 44 6f 63 74 6f 72 20 57 68 6f 20 61 6e 64 20 74 ; "Doctor Who and t" &4ef0 68 65 20 4d 69 6e 65 73 20 6f 66 20 54 65 72 72 ; "he Mines of Terr" Rom disassembly =============== ; rom_language_entry &8000 00 00 00 ; rom_service_entry &8003 4c 28 80 JMP &8028 ; service_entry_point ; rom_type &8006 81 # &80 set to indicate ROM has service entry ; rom_copyright_offset &8007 15 ; &8016 = rom_copyright_string ; rom_version &8008 01 ; rom_title_string &8009 44 6f 63 74 6f 72 20 57 68 6f 0d 0a 00 ; "Doctor Who" ; rom_copyright_string &8016 28 43 29 38 35 00 ; "(C)85" ; run_boot &801c 2f 21 42 4f 4f 54 0d ; "/!BOOT" ; run_who &8023 2f 57 48 4f 0d ; "/WHO" ; service_entry_point &8028 48 PHA ; tmp_a &8029 8a TXA &802a 48 PHA ; tmp_a &802b 98 TYA &802c 48 PHA ; tmp_x &802d ba TSX &802e bd 03 01 LDA &0103,X ; stack + 3 # Get A (service type requested) from stack &8031 c9 03 CMP #&03 &8033 f0 1c BEQ &8051 ; handle_auto_boot &8035 c9 04 CMP #&04 &8037 f0 2b BEQ &8064 ; handle_unrecognised_command &8039 c9 09 CMP #&09 &803b f0 06 BEQ &8043 ; handle_help ; leave_after_restoring_registers &803d 68 PLA ; tmp_y &803e a8 TAY &803f 68 PLA ; tmp_x &8040 aa TAX &8041 68 PLA ; tmp_a &8042 60 RTS ; handle_help &8043 20 e7 ff JSR &ffe7 ; OSNEWL &8046 20 56 80 JSR &8056 ; write_doctor_who &8049 a9 0b LDA #&0b ; move up one character &804b 20 ee ff JSR &ffee ; OSWRCH &804e 4c 3d 80 JMP &803d ; leave_after_restoring_registers ; handle_auto_boot &8051 20 56 80 JSR &8056 ; write_doctor_who &8054 f0 e7 BEQ &803d ; leave_after_restoring_registers # Always branches ; write_doctor_who &8056 a2 00 LDX #&00 ; write_doctor_who_loop &8058 bd 09 80 LDA &8009,X ; rom_title_string &805b 20 e3 ff JSR &ffe3 ; OSASCI &805e e8 INX &805f c9 00 CMP #&00 &8061 d0 f5 BNE &8058 ; write_doctor_who_loop &8063 60 RTS ; handle_unrecognised_command &8064 a2 00 LDX #&00 ; check_if_who_command_loop &8066 b1 f2 LDA (&f2),Y ; command_address &8068 c8 INY &8069 29 df AND #&df # Convert to upper case &806b dd 24 80 CMP &8024,X ; run_who + 1 &806e d0 cd BNE &803d ; leave_after_restoring_registers &8070 e8 INX &8071 e0 04 CPX #&04 &8073 d0 f1 BNE &8066 ; check_if_who_command_loop &8075 a9 00 LDA #&00 ; Read filing system number &8077 a8 TAY ; no file handle &8078 20 da ff JSR &ffda ; OSARGS # Get filing system type &807b c9 01 CMP #&01 ; 1200 baud cassette filing system &807d f0 07 BEQ &8086 ; is_tape &807f c9 04 CMP #&04 ; Disk filing system &8081 f0 07 BEQ &808a ; is_disk &8083 6c fc ff JMP (&fffc) ; os_reset_address_low ; is_tape &8086 a2 23 LDX #&23 ; &8023 = run_who &8088 d0 02 BNE &808c ; set_command_address_low # Always branches ; is_disk &808a a2 1c LDX #&1c ; &801c = run_boot ; set_command_address_low &808c 86 f8 STX &f8 ; command_address_low &808e a9 01 LDA #&01 ; Normal ESCAPE effect, normal reset effect &8090 8d 58 02 STA &0258 ; ESCAPE/BREAK effect &8093 20 49 fa JSR &fa49 ; os_write_null_terminated_string &8096 16 07 ; change to MODE 7 &8098 0d 0d 0d &809b 49 6e 73 65 72 74 20 74 61 70 65 2f 64 69 73 63 ; "Insert tape/disc and press RETURN when" &80ab 20 61 6e 64 20 70 72 65 73 73 20 52 45 54 55 52 &80bb 4e 20 77 68 65 6e &80c1 0d 0d &80c3 72 65 61 64 79 2e 2e 2e ; "ready..." &80cb 00 ; end of string ; wait_for_return &80cc e0 ff JSR &ffe0 ; OSRDCH &80cf c9 0d CMP #&0d ; CR &80d1 d0 f9 BNE &80cc ; wait_for_return &80d3 a9 01 LDA #&01 &80d5 20 49 fa JSR &fa49 ; os_write_null_terminated_string &80d8 0d 0d &80da 4f 4b ; "OK" &80dc 0d 0d &80de 00 ; end of string &80df a9 80 LDA #&80 &80e1 85 f9 STA &f9 ; command_address_high &80e3 a0 0a LDY #&0a ; copy_command_loop &80e5 b1 f8 LDA (&f8),Y ; command_address &80e7 99 00 01 STA &0100,Y ; command &80ea 88 DEY &80eb 10 f8 BPL &80e5 ; copy_command_loop &80ed a0 01 LDY #&01 ; &0100 = command &80ef a2 00 LDX #&00 &80f1 4c f7 ff JMP &fff7 ; OSCLI ; unused &80f4 23 d6 df 0d a9 d4 8d fb 5c 78 8c ; expected_checksum &80ff a0 ; tile_chunks_data ; tile_00 # Outer shell bottom &8100 fc fd fc fd fc fd fc ; ....... &8108 fc fd fc fd fc fd fc ; ....... &8110 16 16 16 16 16 16 16 ; OOOOOOO &8118 60 60 60 60 60 60 60 ; ....... ; tile_01 # Outer shell bottom left corner &8120 00 00 01 fd fc fd fc ; OOO.... &8128 60 63 00 00 01 fd fc ; ..OOO.. &8130 60 60 60 63 00 00 00 ; ....OOO &8138 60 60 60 60 60 60 60 ; ....... ; tile_02 # Outer shell bottom left diagonal &8140 00 00 01 fd fc fd fc ; OOO.... &8148 60 02 00 00 01 fd fc ; .OOOO.. &8150 60 60 60 02 00 00 01 ; ...OOOO &8158 60 60 60 60 60 02 00 ; .....OO ; tile_03 # TIRU sign &8160 62 62 62 62 62 62 62 ; ....... &8168 62 d9 da d4 d5 e4 e5 ; ....... &8170 62 62 62 62 62 62 62 ; ....... &8178 a0 a0 a0 a0 a0 a0 a0 ; ....... ; tile_04 # Platform on blue &8180 fc fd fc fd fc fd fc ; ....... &8188 fc fd fc fd fc fd fc ; ....... &8190 fc fd fc fd fc fd fc ; ....... &8198 14 15 14 15 14 15 14 ; OOOOOOO ; tile_05 (TILE_LADDER_AND_PLATFORM_ON_BLUE) # Ladder and platform on blue &81a0 fc fd 48 49 49 40 fc ; ..CCCC. &81a8 fc fd 48 49 49 40 fc ; ..CCCC. &81b0 fc fd 48 49 49 40 fc ; ..CCCC. &81b8 14 4a 48 4b 4b 40 4c ; OCCCCCC ; tile_06 (TILE_LADDER_ON_BLUE) # Ladder on blue &81c0 fc fd 48 49 49 40 fc ; ..CCCC. &81c8 fc fd 48 49 49 40 fc ; ..CCCC. &81d0 fc fd 48 49 49 40 fc ; ..CCCC. &81d8 fc fd 48 49 49 40 fc ; ..CCCC. ; tile_07 (TILE_TOP_LADDER_PLATFORM_ON_BLUE) # Top of ladder and platform on blue &81e0 fc fd fc fd fc fd fc ; ....... &81e8 fc fd fc fd fc fd fc ; ....... &81f0 fc fd fc fd fc fd fc ; ....... &81f8 14 15 48 51 51 40 14 ; OOCPPCO ; tile_08 (TILE_DIAGONAL_PLATFORM_TLBR_ON_BLUE) # Diagonal platform on blue &8200 14 15 21 61 fc fd fc ; OOO.... &8208 fc 22 14 15 21 fd fc ; .OOOO.. &8210 fc fd fc 22 14 15 21 ; ...OOOO &8218 fc fd fc fd fc 22 14 ; .....OO ; tile_09 # TIRU numbers (2391) &8220 a0 a0 a0 a0 a0 a0 a0 ; ....... &8228 62 f7 62 f9 62 f8 62 ; ....... &8230 a0 a0 a0 a0 a0 a0 a0 ; ....... &8238 a0 a0 a0 a0 a0 a0 a0 ; ....... ; tile_0a # TIRU base on platform &8240 9f 9f 9f 9f 9f 9f 9f ; ....... &8248 a0 a0 a0 a0 a0 a0 a0 ; ....... &8250 a0 a0 a0 a0 a0 a0 a0 ; ....... &8258 14 15 14 15 14 15 14 ; OOOOOOO ; tile_0b # Left wall on blue &8260 07 0a fc fd fc fd fc ; OO..... &8268 07 0a fc fd fc fd fc ; OO..... &8270 07 0a fc fd fc fd fc ; OO..... &8278 07 0a fc fd fc fd fc ; OO..... ; tile_0c # TIRU body &8280 a0 a0 a0 a0 a0 a0 a0 ; ....... &8288 a0 a0 a0 a0 a0 a0 a0 ; ....... &8290 a0 a0 a0 a0 a0 a0 a0 ; ....... &8298 a0 a0 a0 a0 a0 a0 a0 ; ....... ; tile_0d # Vertical pipe and platform on blue &82a0 fc fd fc f3 62 fd fc ; ....... &82a8 fc 6f 70 71 72 70 73 ; ....... &82b0 fc fd fc f3 62 61 fc ; ....... &82b8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_0e # Pipe bottom right corner on blue &82c0 fc fd fc f3 62 fd fc ; ....... &82c8 c0 c0 7e 64 62 fd fc ; ....... &82d0 67 67 67 77 7f fd fc ; ....... &82d8 fc fd fc fd fc fd fc ; ....... ; tile_0f # TIRU top left corner &82e0 fc fd fc fd a0 a0 a0 ; ....... &82e8 fc fd fc a0 a0 a0 a0 ; ....... &82f0 fc a0 a0 a0 a0 a0 a0 ; ....... &82f8 a0 a0 9f 9f 9f 9f 9f ; ....... ; tile_10 # TIRU top right corner &8300 a0 a0 a0 a0 fc fd fc ; ....... &8308 a0 a0 a0 a0 a0 fd fc ; ....... &8310 a0 a0 a0 a0 a0 a0 a0 ; ....... &8318 9f 9f 9f 9f 9f 9f a0 ; ....... ; tile_11 # Horizontal pipe with T junction pointing down on blue &8320 fc fd fc fd fc fd fc ; ....... &8328 c0 c0 c0 c0 c0 c0 c0 ; ....... &8330 67 67 81 69 62 82 67 ; ....... &8338 fc fd fc f3 62 fd fc ; ....... ; tile_12 # Horizontal pipe on blue &8340 fc fd fc fd fc fd fc ; ....... &8348 c0 c0 c0 c0 66 c0 c0 ; ....... &8350 67 67 67 67 68 67 67 ; ....... &8358 fc fd fc fd fc fd fc ; ....... ; tile_13 (TILE_LADDER_AND_PIPE_ON_BLUE) # Ladder and horizontal pipe on blue &8360 fc fd 48 49 49 40 fc ; ..CCCC. &8368 c0 c0 48 4d 4e 40 c0 ; ..CCCC. &8370 67 67 48 4f 50 40 67 ; ..CCPC. &8378 fc fd 48 49 49 40 fc ; ..CCCC. ; tile_14 # Horizontal and vertical pipe junction on blue &8380 fc fd fc f3 97 fd fc ; ....... &8388 74 8c 8d 8c 8d 8c 8d ; ....... &8390 76 8e 8f 8e 8f 8e 8f ; ....... &8398 fc fd fc f3 f3 fd fc ; ....... ; tile_15 # Pipe bottom left corner on blue &83a0 fc fd fc f3 62 fd fc ; ....... &83a8 fc fd fc f3 6a 85 c0 ; ....... &83b0 fc fd fc 80 76 67 67 ; ....... &83b8 fc fd fc fd fc fd fc ; ....... ; tile_16 # Pipe bottom right corner above hatching &83c0 c0 c0 7e f3 62 fd fc ; ....... &83c8 67 67 67 77 7f fd fc ; ....... &83d0 09 09 09 09 09 09 09 ; OOOOOOO &83d8 60 60 60 60 60 60 60 ; ....... ; tile_17 # Horizontal pipe above hatching &83e0 c0 c0 c0 c0 66 c0 c0 ; ....... &83e8 67 67 67 67 68 67 67 ; ....... &83f0 09 09 09 09 09 09 09 ; OOOOOOO &83f8 60 60 60 60 60 60 60 ; ....... ; tile_18 # Left end of pipe above hatching &8400 00 00 05 60 04 c0 c0 ; OOO.O.. &8408 0f 02 00 00 04 67 67 ; OOOOO.. &8410 60 60 0f 63 09 09 09 ; ..O.OOO &8418 60 60 60 60 60 60 60 ; ....... ; tile_19 # Left edge of blue &8420 60 60 60 60 04 fd fc ; ....O.. &8428 60 60 60 60 04 fd fc ; ....O.. &8430 60 60 60 60 04 fd fc ; ....O.. &8438 60 60 60 60 04 fd fc ; ....O.. ; tile_1a # Outer shell top right diagonal &8440 00 00 05 60 60 60 60 ; OOO.... &8448 60 02 00 00 05 60 60 ; .OOOO.. &8450 60 60 60 02 00 00 05 ; ...OOOO &8458 60 60 60 60 60 02 00 ; .....OO ; tile_1b (TILE_BLACK_BACKGROUND) # Black background &8460 60 60 60 60 60 60 60 ; ....... &8468 60 60 60 60 60 60 60 ; ....... &8470 60 60 60 60 60 60 60 ; ....... &8478 60 60 60 60 60 60 60 ; ....... ; tile_1c (TILE_BLUE_BACKGROUND) # Blue background &8480 fc fd fc fd fc fd fc ; ....... &8488 fc fd fc fd fc fd fc ; ....... &8490 fc fd fc fd fc fd fc ; ....... &8498 fc fd fc fd fc fd fc ; ....... ; tile_1d # Vertical pipe on blue &84a0 fc fd fc f3 62 fd fc ; ....... &84a8 fc 6f 70 71 72 70 73 ; ....... &84b0 fc fd fc f3 62 fd fc ; ....... &84b8 fc fd fc f3 62 fd fc ; ....... ; tile_1e # Pipe top left corner on blue &84c0 fc fd fc fd fc fd fc ; ....... &84c8 fc fd fc 83 74 c0 c0 ; ....... &84d0 fc fd fc f3 62 82 67 ; ....... &84d8 fc fd fc f3 62 61 fc ; ....... ; tile_1f # Outer shell top &84e0 60 60 60 60 60 60 60 ; ....... &84e8 60 60 60 60 60 60 60 ; ....... &84f0 60 60 60 60 60 60 60 ; ....... &84f8 17 18 17 18 17 18 17 ; OOOOOOO ; tile_20 # Blue left and platform &8500 60 64 fc fd fc fd fc ; ....... &8508 60 64 fc fd fc fd fc ; ....... &8510 60 64 fc fd fc fd fc ; ....... &8518 14 15 14 15 14 15 14 ; OOOOOOO ; tile_21 # Blue left and hatching &8520 07 0a fc fd fc fd fc ; OO..... &8528 07 0a 09 09 09 09 09 ; OOOOOOO &8530 60 64 fc fd fc fd fc ; ....... &8538 60 64 fc fd fc fd fc ; ....... ; tile_22 # Blue right and platform &8540 fc fd fc fd fc fd 64 ; ....... &8548 fc fd fc fd fc fd 64 ; ....... &8550 fc fd fc fd fc fd 64 ; ....... &8558 14 15 14 15 14 15 14 ; OOOOOOO ; tile_23 (TILE_CRYOSTATIC_CHAMBER_BOTTOM) # Cryostatic chamber bottom &8560 7b c7 cd cd cd cd c7 ; ....... &8568 7b c7 cd cd cd cd c7 ; ....... &8570 7b c7 cd cd cd cd c7 ; ....... &8578 14 15 14 15 14 15 14 ; OOOOOOO ; tile_24 # Cryostatic chamber top &8580 62 62 62 62 62 62 62 ; ....... &8588 62 d3 ff d7 d8 d3 ff ; ....... &8590 62 c7 c7 cd cd c7 c7 ; ....... &8598 7b c7 cd cd cd cd c7 ; ....... ; tile_25 # TIRU dials &85a0 a0 a5 a6 a5 a6 a5 a6 ; ....... &85a8 a0 a5 a6 a5 a6 a5 a6 ; ....... &85b0 a0 a5 a6 a5 a6 a5 a6 ; ....... &85b8 a0 a0 a0 a0 a0 a0 a0 ; ....... ; tile_26 # TIRU horizontal graphs &85c0 a0 a2 a2 a2 a2 a2 a2 ; ....... &85c8 a0 a2 a2 a2 a2 a2 a4 ; ....... &85d0 a0 a2 a2 a4 a4 a4 a4 ; ....... &85d8 a0 a0 a0 a0 a0 a0 a0 ; ....... ; tile_27 # Right wall on blue &85e0 fc fd fc fd fc fd 07 ; ......O &85e8 fc fd fc fd fc fd 07 ; ......O &85f0 fc fd fc fd fc fd 07 ; ......O &85f8 fc fd fc fd fc fd 07 ; ......O ; tile_28 # Top platform and divider on blue &8600 14 15 14 15 14 15 14 ; OOOOOOO &8608 fc fd fc f3 62 fd fc ; ....... &8610 fc fd fc f3 62 fd fc ; ....... &8618 fc fd fc f3 62 fd fc ; ....... ; tile_29 # Left wall and platform on blue &8620 07 0a fc fd fc fd fc ; OO..... &8628 07 0a fc fd fc fd fc ; OO..... &8630 07 0a fc fd fc fd fc ; OO..... &8638 07 0a 14 15 14 15 14 ; OOOOOOO ; tile_2a # Outer shell steep top left diagonal bottom &8640 60 60 05 00 03 fd fc ; ..OOO.. &8648 60 05 00 03 fc fd fc ; .OOO... &8650 05 00 03 fd fc fd fc ; OOO.... &8658 00 03 fc fd fc fd fc ; OO..... ; tile_2b # Outer shell steep top left diagonal top &8660 60 60 60 60 60 60 05 ; ......O &8668 60 60 60 60 60 05 00 ; .....OO &8670 60 60 60 60 05 00 03 ; ....OOO &8678 60 60 60 05 00 03 fc ; ...OOO. ; tile_2c # Outer shell top left diagonal &8680 60 60 60 60 60 05 00 ; .....OO &8688 60 60 60 05 00 00 03 ; ...OOOO &8690 60 05 00 00 03 fd fc ; .OOOO.. &8698 00 00 03 fd fc fd fc ; OOO.... ; tile_2d # Outer shell shallow top left diagonal bottom &86a0 60 60 60 60 60 60 60 ; ....... &86a8 60 60 60 60 60 60 60 ; ....... &86b0 60 60 60 05 05 00 00 ; ...OOOO &86b8 05 00 00 03 03 fd fc ; OOOOO.. ; tile_2e # Outer shell shallow top left diagonal top &86c0 60 60 60 05 05 00 00 ; ...OOOO &86c8 05 00 00 03 03 fd fc ; OOOOO.. &86d0 03 fd fc fd fc fd fc ; O...... &86d8 fc fd fc fd fc fd fc ; ....... ; tile_2f # Top platform on blue &86e0 14 15 14 15 14 15 14 ; OOOOOOO &86e8 fc fd fc fd fc fd fc ; ....... &86f0 fc fd fc fd fc fd fc ; ....... &86f8 fc fd fc fd fc fd fc ; ....... ; tile_30 # Outer shell shallow top right diagonal top &8700 03 00 00 05 05 60 60 ; OOOOO.. &8708 fc fd fc 03 03 00 00 ; ...OOOO &8710 fc fd fc fd fc fd fc ; ....... &8718 fc fd fc fd fc fd fc ; ....... ; tile_31 # Outer shell shallow top right diagonal bottom &8720 60 60 60 60 60 60 60 ; ....... &8728 05 60 60 60 60 60 60 ; O...... &8730 03 00 00 05 05 60 60 ; OOOOO.. &8738 fc fd fc 03 03 00 00 ; ...OOOO ; tile_32 # Outer shell top right diagonal &8740 00 00 05 60 60 60 60 ; OOO.... &8748 fc 03 00 00 05 60 60 ; .OOOO.. &8750 fc fd fc 03 00 00 05 ; ...OOOO &8758 fc fd fc fd fc 03 00 ; .....OO ; tile_33 # Outer shell steep top right diagonal top &8760 00 05 60 60 60 60 60 ; OO..... &8768 03 00 05 60 60 60 60 ; OOO.... &8770 fc 03 00 05 60 60 60 ; .OOO... &8778 fc fd 03 00 05 60 60 ; ..OOO.. ; tile_34 # Outer shell steep top right diagonal bottom &8780 fc fd fc 03 00 05 60 ; ...OOO. &8788 fc fd fc fd 03 00 05 ; ....OOO &8790 fc fd fc fd fc 03 00 ; .....OO &8798 fc fd fc fd fc fd 03 ; ......O ; tile_35 # TIRU vertical graphs &87a0 a0 a0 a0 a0 a0 a0 a0 ; ....... &87a8 a7 a8 a7 a8 a8 a7 a7 ; ....... &87b0 a7 a8 a8 a8 a8 a8 a8 ; ....... &87b8 a0 a0 a0 a0 a0 a0 a0 ; ....... ; tile_36 # Outer shell inner corner &87c0 fc fd fc fd fc fd 00 ; ......O &87c8 fc fd fc fd fc fd fc ; ....... &87d0 fc fd fc fd fc fd fc ; ....... &87d8 fc fd fc fd fc fd fc ; ....... ; tile_37 # Partial ladder on blue &87e0 fc fd 48 49 49 40 fc ; ..CCCC. &87e8 fc fd 48 49 49 40 fc ; ..CCCC. &87f0 fc fd 48 49 49 40 fc ; ..CCCC. &87f8 fc fd fc fd fc fd fc ; ....... ; tile_38 # Pipe top right corner on blue &8800 fc fd fc fd fc fd fc ; ....... &8808 c0 c0 c0 75 84 fd fc ; ....... &8810 67 67 81 f3 62 fd fc ; ....... &8818 fc fd 61 f3 62 fd fc ; ....... ; tile_39 # Platform on black &8820 60 60 60 60 60 60 60 ; ....... &8828 60 60 60 60 60 60 60 ; ....... &8830 60 60 60 60 60 60 60 ; ....... &8838 1a 1b 1a 1b 1a 1b 1a ; OOOOOOO ; tile_3a # Pipe equipment &8840 86 79 79 79 79 79 79 ; ....... &8848 62 7c 7c 7c 7c 7c 7c ; ....... &8850 62 7d 62 7d 62 7d 78 ; ....... &8858 88 89 8a 8b 88 89 8a ; ....... ; tile_3b # Guard post top left on blue &8860 61 90 62 62 62 62 62 ; ....... &8868 62 62 62 a9 aa a9 ab ; ....... &8870 62 62 62 62 d5 d6 d3 ; ....... &8878 79 79 79 79 79 79 79 ; ....... ; tile_3c # Pipe top right and right wall &8880 fc fd fc fd fc fd 00 ; ......O &8888 fc fd fc cb c0 c0 00 ; ......O &8890 fc fd fc f3 62 67 00 ; ......O &8898 fc fd fc f3 62 61 00 ; ......O ; tile_3d # Lift &88a0 43 43 43 43 43 43 43 ; CCCCCCC &88a8 43 43 43 43 43 43 43 ; CCCCCCC &88b0 43 43 43 43 43 43 43 ; CCCCCCC &88b8 43 43 43 43 43 43 43 ; CCCCCCC ; tile_3e # Horizontal pipe with T junction pointing up on blue &88c0 fc fd fc f3 62 fd fc ; ....... &88c8 c0 c0 7e f3 62 85 c0 ; ....... &88d0 67 67 67 67 67 67 67 ; ....... &88d8 fc fd fc fd fc fd fc ; ....... ; tile_3f # Air lock bottom &88e0 64 60 64 60 64 60 64 ; ....... &88e8 64 60 64 60 64 60 64 ; ....... &88f0 6e 60 6e 60 6e 60 6e ; ....... &88f8 09 09 09 09 09 09 09 ; OOOOOOO ; tile_40 # Air lock top &8900 60 60 60 60 60 60 60 ; ....... &8908 60 60 60 60 60 60 60 ; ....... &8910 09 09 09 09 09 09 09 ; OOOOOOO &8918 6e 60 6e 60 6e 60 6e ; ....... ; tile_41 # Pipe top right and left wall &8920 07 0a fc fd fc fd fc ; OO..... &8928 07 0a c0 c0 cb fd fc ; OO..... &8930 07 0a 67 f3 62 fd fc ; OO..... &8938 07 0a 61 f3 62 fd fc ; OO..... ; tile_42 # Guard post top right on blue &8940 62 62 62 62 62 62 90 ; ....... &8948 ac a9 ad a9 ae 62 62 ; ....... &8950 d7 d8 d9 da 62 62 62 ; ....... &8958 79 79 79 79 79 79 79 ; ....... ; tile_43 # Rock &8960 2f 36 bc 37 34 2f bf ; OO.OOO. &8968 37 2f fc bd 3a c5 34 ; OO..O.O &8970 33 c1 36 c6 c6 c4 37 ; O.O...O &8978 34 37 c2 35 36 2f 38 ; OO.OOOO ; tile_44 # Rock top left diagonal &8980 60 60 60 60 60 60 12 ; ......O &8988 60 60 60 0f 12 09 09 ; ...OOOO &8990 60 60 23 34 11 29 26 ; ..OOOOO &8998 12 09 09 29 34 26 bc ; OOOOOO. ; tile_45 # Rock top right diagonal &89a0 13 0b 60 60 60 60 60 ; OO..... &89a8 2a 37 11 09 60 60 60 ; OOOO... &89b0 35 bd 2a 09 0b 12 0f ; O.OOOOO &89b8 37 bb c2 2a 09 34 09 ; O..OOOO ; tile_46 # Rock bottom left diagonal &89c0 13 0b 09 39 34 c5 3b ; OOOOO.O &89c8 60 09 13 09 10 09 39 ; .OOOOOO &89d0 60 60 60 60 09 0e 3a ; ....OOO &89d8 60 60 60 60 60 60 09 ; ......O ; tile_47 # Rock bottom right diagonal &89e0 c2 2c c3 2a 10 34 09 ; .O.OOOO &89e8 35 09 2c 09 10 09 60 ; OOOOOO. &89f0 34 09 0e 09 60 60 60 ; OOOO... &89f8 0e 13 60 60 60 60 60 ; OO..... ; tile_48 # Rock top &8a00 60 60 60 60 60 60 60 ; ....... &8a08 60 60 60 60 60 60 60 ; ....... &8a10 60 60 60 60 60 60 60 ; ....... &8a18 12 0a 09 0b 11 12 0a ; OOOOOOO ; tile_49 (TILE_LADDER_ON_BLACK) # Ladder on black &8a20 60 60 40 45 45 40 60 ; ..CCCC. &8a28 60 60 40 45 45 40 60 ; ..CCCC. &8a30 60 60 40 45 45 40 60 ; ..CCCC. &8a38 60 60 40 45 45 40 60 ; ..CCCC. ; tile_4a (TILE_LADDER_AND_HATCHING_ON_BLACK) # Ladder and top hatching on black &8a40 09 09 40 46 46 40 09 ; OOCCCCO &8a48 60 60 40 45 45 40 60 ; ..CCCC. &8a50 60 60 40 45 45 40 60 ; ..CCCC. &8a58 60 60 40 45 45 40 60 ; ..CCCC. ; tile_4b (TILE_LADDER_AND_PLATFORM_ON_BLUE) # Ladder and platform on blue &8a60 fc fd 48 49 49 40 fc ; ..CCCC. &8a68 fc fd 48 49 49 40 fc ; ..CCCC. &8a70 fc fd 48 49 49 40 fc ; ..CCCC. &8a78 14 15 14 15 14 15 14 ; OOOOOOO ; tile_4c # Vertical pipe with T junction pointing right on blue &8a80 fc fd fc f3 62 fd fc ; ....... &8a88 fc fd fc f3 69 75 c0 ; ....... &8a90 fc fd fc f3 62 82 67 ; ....... &8a98 fc fd fc f3 62 fd fc ; ....... ; tile_4d (TILE_LADDER_AND_PLATFORM_ON_BLACK) # Ladder and platform on black &8aa0 60 60 40 45 45 40 60 ; ..CCCC. &8aa8 60 60 40 45 45 40 60 ; ..CCCC. &8ab0 60 60 40 45 45 40 60 ; ..CCCC. &8ab8 1a 1b 1a 1b 1a 1b 1a ; OOOOOOO ; tile_4e (TILE_TOP_OF_LADDER_AND_PLATFORM_ON_BLACK) # Top of ladder and platform on black &8ac0 60 60 60 60 60 60 60 ; ....... &8ac8 60 60 60 60 60 60 60 ; ....... &8ad0 60 60 60 60 60 60 60 ; ....... &8ad8 1a 1b 40 45 45 40 1a ; OOCCCCO ; tile_4f # Guard post base on platform &8ae0 79 79 79 79 79 79 79 ; ....... &8ae8 79 79 79 79 79 79 79 ; ....... &8af0 79 79 79 79 79 79 79 ; ....... &8af8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_50 # Outer shell bottom right diagonal &8b00 fc fd fc fd fc 90 00 ; ......O &8b08 fc fd fc 90 00 0e 9a ; ....OO. &8b10 fc 90 00 0e 9a 60 60 ; ..OO... &8b18 00 0e 9a 60 60 60 60 ; OO..... ; tile_51 (TILE_ROCK_SPIKES) # Rock spikes &8b20 60 60 06 60 60 09 60 ; ..O..O. &8b28 60 60 08 09 60 09 09 ; ..OO.OO &8b30 60 09 0b 09 0b 11 09 ; .OOOOOO &8b38 0a 11 2a c3 29 34 c2 ; OOO.OO. ; tile_52 # Rock top left and Heatonite bottom right &8b40 fc fd fc fd fc fd 05 ; ......O &8b48 fc fd fc fd 01 01 0b ; ....OOO &8b50 fc fd 10 09 0a 09 0d ; ..OOOOO &8b58 10 0a 0a 09 09 0a 09 ; OOOOOOO ; tile_53 # Rock top right and Heatonite bottom left &8b60 0a 10 fc fd fc fd fc ; OO..... &8b68 0a 00 0a 09 fc fd fc ; OOOO... &8b70 06 09 0a 09 0b 09 fc ; OOOOOO. &8b78 0a 09 0a 09 09 0a 0b ; OOOOOOO ; tile_54 # Rock bottom left and Heatonite top right &8b80 11 0a 08 09 06 0a 0b ; OOOOOOO &8b88 fc 09 0c 0e 0c 09 0b ; .OOOOOO &8b90 fc fd 09 fd 09 0a 0d ; ..O.OOO &8b98 fc fd fc fd fc fd 11 ; ......O ; tile_55 # Rock bottom right and Heatonite top left &8ba0 06 07 08 09 06 0a 0a ; OOOOOOO &8ba8 0a 00 08 09 0a 09 09 ; OOOOOOO &8bb0 06 09 0a 09 09 fd fc ; OOOOO.. &8bb8 0a 11 09 fd fc fd fc ; OOO.... ; tile_56 # X box &8bc0 c3 b0 b1 b1 b1 b2 b3 ; ....... &8bc8 af b4 b5 b6 b7 b8 61 ; ....... &8bd0 af ba bb bc bd be 61 ; ....... &8bd8 c5 bf c0 c0 c0 c1 c2 ; ....... ; tile_57 (TILE_DIAGONAL_PLATFORM_BLTR_ON_BLUE) # Diagonal platform on blue &8be0 fc fd fc fd fc 21 14 ; .....OO &8be8 fc fd fc 21 14 15 22 ; ...OOOO &8bf0 fc 21 14 15 22 fd fc ; .OOOO.. &8bf8 14 15 22 fd fc fd fc ; OOO.... ; tile_58 # Box and cryostan plant &8c00 c3 b0 cb c7 c8 b2 b3 ; ....... &8c08 af a0 b5 c9 c7 cb 61 ; ....... &8c10 af ba bb c7 c8 be a0 ; ....... &8c18 c5 bf c0 c0 c7 c1 c2 ; ....... ; tile_59 # Pipe, hatching and left wall on blue &8c20 07 0a 61 f3 62 fd fc ; OO..... &8c28 07 0a 70 71 72 70 73 ; OO..... &8c30 07 0a 61 f3 62 fd fc ; OO..... &8c38 09 09 09 09 09 09 09 ; OOOOOOO ; tile_5a # Conveyor belt enclosed at bottom on blue &8c40 fc fd fc fd fc fd fc ; ....... &8c48 fc fd fc fd fc fd fc ; ....... &8c50 ec ed ec ed ec ed ec ; ....... &8c58 62 64 62 64 62 64 62 ; ....... ; tile_5b # Pipe, hatching and right wall on blue &8c60 fc fd fc f3 62 61 07 ; ......O &8c68 fc 6f 70 71 72 70 07 ; ......O &8c70 fc fd fc f3 62 61 07 ; ......O &8c78 09 09 09 09 09 09 09 ; OOOOOOO ; tile_5c # Pipe bottom right and left wall on blue &8c80 07 0a 61 f3 62 fd fc ; OO..... &8c88 07 0a c0 f3 62 fd fc ; OO..... &8c90 07 0a 67 67 f2 fd fc ; OO..... &8c98 07 0a fc fd fc fd fc ; OO..... ; tile_5d # Vertical pipe with T junction pointing left on blue &8ca0 fc fd fc f3 62 fd fc ; ....... &8ca8 c0 c0 7e 64 62 fd fc ; ....... &8cb0 67 67 81 f3 62 fd fc ; ....... &8cb8 fc fd fc f3 62 fd fc ; ....... ; tile_5e # Battery &8cc0 86 7a ef 7a 62 7a 7a ; ....... &8cc8 62 7b 7b 7b 7b 7b 7b ; ....... &8cd0 62 7b 7b 7b 7b 7b 7b ; ....... &8cd8 88 89 8a 8b 88 89 8a ; ....... ; tile_5f # Cryostan plant with leaves &8ce0 fc fd fc c7 fc fd fc ; ....... &8ce8 c9 c7 fc c9 c7 cb fc ; ....... &8cf0 c7 c7 fc c7 c8 fd c7 ; ....... &8cf8 ca fd fc fd c7 fd c7 ; ....... ; tile_60 # Cryostan plant with red fruit &8d00 fc fd fc c7 c8 fd fc ; ....... &8d08 fc cd 9f c9 c7 cb fc ; ....... &8d10 fc fd fc c7 c8 fd cd ; ....... &8d18 fc cd 9f fd c7 fd fc ; ....... ; tile_61 # Pipe bottom left and right wall on blue &8d20 fc fd fc f3 62 61 07 ; ......O &8d28 fc fd fc f3 62 c0 07 ; ......O &8d30 fc fd fc f0 67 67 07 ; ......O &8d38 fc fd fc fd fc fd 07 ; ......O ; tile_62 # Horizontal pipe and left wall on blue &8d40 07 0a fc fd fc fd fc ; OO..... &8d48 07 0a c0 c0 66 c0 c0 ; OO..... &8d50 07 0a 67 67 68 67 67 ; OO..... &8d58 07 0a fc fd fc fd fc ; OO..... ; tile_63 # Cryostan plant with yellow fruit &8d60 fc fd fc c7 c8 fd fc ; ....... &8d68 fc cf 6d c9 c7 cb fc ; ....... &8d70 fc fd fc c7 c8 fd cf ; ....... &8d78 fc cf 6d fd c7 fd fc ; ....... ; tile_64 # Cryostan plant without leaves &8d80 fc fd fc c7 c8 fd fc ; ....... &8d88 fc fd fc c9 c7 fd fc ; ....... &8d90 fc fd fc c7 c8 fd fc ; ....... &8d98 fc fd fc fd c7 fd fc ; ....... ; tile_65 # Cryostan plant with yellow fruit and top platform &8da0 14 15 14 15 14 15 14 ; OOOOOOO &8da8 fc cf 6d c9 c7 cb ce ; ....... &8db0 fc fd fc c7 c8 fd cf ; ....... &8db8 fc cf 6d fd c7 fd fc ; ....... ; tile_66 # X box on platform &8dc0 c3 b0 b1 b1 b1 b2 b3 ; ....... &8dc8 af b4 b5 b6 b7 b8 61 ; ....... &8dd0 af ba bb bc bd be 61 ; ....... &8dd8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_67 # Top hatching &8de0 09 09 09 09 09 09 09 ; OOOOOOO &8de8 60 60 60 60 60 60 60 ; ....... &8df0 60 60 60 60 60 60 60 ; ....... &8df8 60 60 60 60 60 60 60 ; ....... ; tile_68 # Hatching and right wall &8e00 fc fd fc fd fc fd 07 ; ......O &8e08 09 09 09 09 09 09 09 ; OOOOOOO &8e10 fc fd fc fd fc fd 64 ; ....... &8e18 fc fd fc fd fc fd 64 ; ....... ; tile_69 # Cryostan plant with red fruit and bottom platform &8e20 fc cc fc c7 c8 fd fc ; ....... &8e28 fc cd 9f c9 c7 cb fc ; ....... &8e30 fc fd fc c7 c8 61 cd ; ....... &8e38 14 15 14 15 14 15 14 ; OOOOOOO ; tile_6a # Horizontal pipe and left wall &8e40 3e fd fc fd fc fd fc ; O...... &8e48 3e c0 c0 c0 66 c0 c0 ; O...... &8e50 3e 67 67 67 68 67 67 ; O...... &8e58 3e fd fc fd fc fd fc ; O...... ; tile_6b # Cryostan plant and horizontal pipe &8e60 fc cc cb c7 c8 fd fc ; ....... &8e68 65 cd 9f c9 c7 65 65 ; ....... &8e70 67 67 67 c7 62 67 cd ; ....... &8e78 fc fd fc 61 c7 fd fc ; ....... ; tile_6c # Outer shell inner conner &8e80 00 00 fc fd fc fd fc ; OO..... &8e88 fc fd fc fd fc fd fc ; ....... &8e90 fc fd fc fd fc fd fc ; ....... &8e98 fc fd fc fd fc fd fc ; ....... ; tile_6d # Heatonite bottom on blue &8ea0 06 07 08 09 00 0a 0b ; OOOOOOO &8ea8 0a 00 08 09 0c 09 0b ; OOOOOOO &8eb0 fc fd fc fd fc fd fc ; ....... &8eb8 fc fd fc fd fc fd fc ; ....... ; tile_6e # Conveyor belt enclosed at top and bottom on blue &8ec0 65 65 65 65 65 65 65 ; ....... &8ec8 67 63 63 67 67 63 63 ; ....... &8ed0 ec ed ec ed ec ed ec ; ....... &8ed8 62 64 62 64 62 64 62 ; ....... ; tile_6f (TILE_LADDER_AND_CONVEYOR) # Ladder and horizontal conveyor &8ee0 9c 64 48 46 46 40 64 ; ..CCCC. &8ee8 60 64 48 46 46 40 64 ; ..CCCC. &8ef0 60 64 48 46 46 40 64 ; ..CCCC. &8ef8 92 64 48 46 46 40 64 ; ..CCCC. ; tile_70 # Vertical conveyor with bottom floor &8f00 64 64 64 64 64 64 64 ; ....... &8f08 64 64 64 64 64 64 64 ; ....... &8f10 91 ea eb 9e 9e eb ea ; ....... &8f18 00 00 00 00 00 00 00 ; OOOOOOO ; tile_71 # Vertical conveyor with top floor &8f20 00 00 00 00 00 00 00 ; OOOOOOO &8f28 64 64 64 64 64 64 64 ; ....... &8f30 91 91 9e 9e 9e 9e 91 ; ....... &8f38 64 64 64 64 64 64 64 ; ....... ; tile_72 (TILE_DIAGONAL_PLATFORM_BLTR_ON_ROCK) # Diagonal platform on rock and black &8f40 60 60 60 60 60 1f 1a ; .....OO &8f48 60 60 60 1f 1a 1b 34 ; ...OOOO &8f50 60 1f 1a 1b 34 33 25 ; .OOOOOO &8f58 1a 1b 38 29 2a 38 36 ; OOOOOOO ; tile_73 (TILE_DIAGONAL_PLATFORM_TLBR_ON_ROCK) # Diagonal platform on rock and black &8f60 1a 1b 1f 60 60 60 60 ; OOO.... &8f68 2c 34 1a 1b 1f 60 60 ; OOOOO.. &8f70 37 2a 36 38 1a 1b 1f ; OOOOOOO &8f78 34 36 37 34 2c 2a 1a ; OOOOOOO ; tile_74 (TILE_HEATONITE_SPIKES) # Heatonite spikes &8f80 fc 09 fc 09 fc 09 fc ; .O.O.O. &8f88 fc 09 09 09 fc 0a 09 ; .OOO.OO &8f90 09 09 0a 09 0b 09 10 ; OOOOOOO &8f98 0a 09 0a 09 09 0a 09 ; OOOOOOO ; tile_75 # Horizontal conveyor &8fa0 9c 64 64 64 64 64 64 ; ....... &8fa8 60 64 64 64 64 64 64 ; ....... &8fb0 60 64 64 64 64 64 64 ; ....... &8fb8 92 64 64 64 64 64 64 ; ....... ; tile_76 (TILE_LADDER_AND_PLATFORM_BLUE_TWO) # Ladder and platform on blue &8fc0 14 15 48 51 51 40 14 ; OOCPPCO &8fc8 fc fd 48 49 49 40 fc ; ..CCCC. &8fd0 fc fd 48 49 49 40 fc ; ..CCCC. &8fd8 fc fd 48 49 49 40 fc ; ..CCCC. ; tile_77 # Vertical conveyor &8fe0 64 64 64 64 64 64 64 ; ....... &8fe8 64 64 64 64 64 64 64 ; ....... &8ff0 91 ea eb 9e 9e eb ea ; ....... &8ff8 64 64 64 64 64 64 64 ; ....... ; tile_78 # Horizontal pipe on blue &9000 fc fd fc fd fc fd fc ; ....... &9008 65 65 65 65 66 65 65 ; ....... &9010 ca ca ca ca 68 ca ca ; ....... &9018 fc fd fc fd fc fd fc ; ....... ; tile_79 # Pipe bottom right on blue &9020 fc fd fc 64 c7 fd fc ; ....... &9028 65 65 7e 64 c7 fd fc ; ....... &9030 ca ca ca 77 7f fd fc ; ....... &9038 fc fd fc fd fc fd fc ; ....... ; tile_7a # Vertical pipe on blue &9040 fc fd fc 64 c7 fd fc ; ....... &9048 fc 6f 70 71 72 70 73 ; ....... &9050 fc fd fc 64 c7 fd fc ; ....... &9058 fc fd fc 64 c7 fd fc ; ....... ; tile_7b # Pipe top left on blue &9060 fc fd fc fd fc fd fc ; ....... &9068 fc fd fc 83 74 65 65 ; ....... &9070 fc fd fc 64 c7 ca ca ; ....... &9078 fc fd fc 64 c7 fd fc ; ....... ; tile_7c # Vertical pipe and platform on blue &9080 fc fd fc 64 c7 fd fc ; ....... &9088 fc 6f 70 71 72 70 73 ; ....... &9090 fc fd fc 64 c7 fd fc ; ....... &9098 14 15 14 15 14 15 14 ; OOOOOOO ; tile_7d # Reactor top left &90a0 fc fd fc fd fc fd d0 ; ....... &90a8 fc fd fc fd d0 a0 d0 ; ....... &90b0 fc fd fc a0 d0 a0 d0 ; ....... &90b8 d0 a0 d0 a0 d0 a0 d0 ; ....... ; tile_7e # Reactor top right &90c0 d0 a0 fc fd fc fd fc ; ....... &90c8 d0 a0 d0 a0 fc fd fc ; ....... &90d0 d0 a0 d0 a0 d0 a0 fc ; ....... &90d8 d0 a0 d0 a0 d0 a0 d0 ; ....... ; tile_7f # Reactor bottom left &90e0 d0 a0 d0 a0 d0 a0 d0 ; ....... &90e8 fc fd d0 a0 d0 a0 d0 ; ....... &90f0 fc fd fc fd d0 a0 d0 ; ....... &90f8 fc fd fc fd fc fd d0 ; ....... ; tile_80 # Reactor bottom right &9100 d0 a0 d0 a0 d0 a0 d0 ; ....... &9108 d0 a0 d0 a0 d0 a0 fc ; ....... &9110 d0 a0 d0 a0 fc fd fc ; ....... &9118 d0 a0 fc fd fc fd fc ; ....... ; tile_81 # Reactor bottom &9120 e7 e8 d0 d0 d0 d0 e8 ; ....... &9128 d0 d0 e7 e8 e8 e7 d0 ; ....... &9130 d0 d0 e8 e7 e7 e8 d0 ; ....... &9138 e8 e7 d0 d0 d0 d0 e7 ; ....... ; tile_82 # Reactor side &9140 d0 a0 d0 a0 d0 a0 d0 ; ....... &9148 d0 a0 d0 a0 d0 a0 d0 ; ....... &9150 d0 a0 d0 a0 d0 a0 d0 ; ....... &9158 d0 a0 d0 a0 d0 a0 d0 ; ....... ; tile_83 # Reactor middle &9160 d1 e9 d1 e9 d1 e9 d1 ; ....... &9168 d1 e9 d1 e9 d1 e9 d1 ; ....... &9170 d1 e9 d1 e9 d1 e9 d1 ; ....... &9178 d1 e9 d1 e9 d1 e9 d1 ; ....... ; tile_84 # Platform and right wall on blue &9180 fc fd fc fd fc fd 07 ; ......O &9188 fc fd fc fd fc fd 07 ; ......O &9190 fc fd fc fd fc fd 07 ; ......O &9198 14 15 14 15 14 15 07 ; OOOOOOO ; tile_85 # Right wall on black &91a0 60 60 60 60 60 60 07 ; ......O &91a8 60 60 60 60 60 60 07 ; ......O &91b0 60 60 60 60 60 60 07 ; ......O &91b8 60 60 60 60 60 60 07 ; ......O ; tile_86 # Reactor fins &91c0 90 90 90 90 90 90 90 ; ....... &91c8 90 90 90 90 90 90 90 ; ....... &91d0 90 90 90 90 90 90 90 ; ....... &91d8 90 90 90 90 90 90 90 ; ....... ; tile_87 # Top platform and right wall on blue &91e0 14 15 14 15 14 15 14 ; OOOOOOO &91e8 fc fd fc fd fc fd 07 ; ......O &91f0 fc fd fc fd fc fd 07 ; ......O &91f8 fc fd fc fd fc fd 07 ; ......O ; tile_88 # Top platform and left wall on blue &9200 14 15 14 15 14 15 14 ; OOOOOOO &9208 07 0a fc fd fc fd fc ; OO..... &9210 07 0a fc fd fc fd fc ; OO..... &9218 07 0a fc fd fc fd fc ; OO..... ; tile_89 # Outer shell bottom and right wall &9220 fc fd fc fd fc fd 07 ; ......O &9228 fc fd fc fd fc fd 07 ; ......O &9230 16 16 16 16 16 16 07 ; OOOOOOO &9238 60 60 60 60 60 60 07 ; ......O ; tile_8a # Reactor middle and platform &9240 d1 e9 d1 e9 d1 e9 d1 ; ....... &9248 d1 e9 d1 e9 d1 e9 d1 ; ....... &9250 d0 a0 d0 a0 d0 a0 d0 ; ....... &9258 14 15 14 15 14 15 14 ; OOOOOOO ; tile_8b # Reactor side pillar top &9260 fc fd d0 d0 a0 a0 fc ; ....... &9268 fc fd d0 d0 a0 a0 fc ; ....... &9270 fc fd d0 d0 a0 a0 fc ; ....... &9278 fc fd d0 d0 a0 a0 fc ; ....... ; tile_8c # Reactor side pillar bottom and platform &9280 fc fd d0 d0 a0 a0 fc ; ....... &9288 fc fd d0 d0 a0 a0 fc ; ....... &9290 d0 d0 d0 d0 d0 d0 d0 ; ....... &9298 14 15 14 15 14 15 14 ; OOOOOOO ; tile_8d # Outer shell bottom right corner &92a0 fc fd fc fd fc 90 00 ; ......O &92a8 fc fd fc 90 00 00 63 ; ....OO. &92b0 16 16 00 00 63 60 60 ; OOOO... &92b8 60 60 60 60 60 60 60 ; ....... ; tile_8e # Reactor middle pillar left top &92c0 fc fd fc fd fc fd 64 ; ....... &92c8 fc fd fc fd fc fd 64 ; ....... &92d0 fc fd fc fd fc fd 64 ; ....... &92d8 fc fd fc fd fc fd 64 ; ....... ; tile_8f # Reactor middle pillar right top &92e0 a0 a0 fc fd fc fd fc ; ....... &92e8 a0 a0 fc fd fc fd fc ; ....... &92f0 a0 a0 fc fd fc fd fc ; ....... &92f8 a0 a0 fc fd fc fd fc ; ....... ; tile_90 # Platform and left divider on blue &9300 64 fd fc fd fc fd fc ; ....... &9308 64 fd fc fd fc fd fc ; ....... &9310 64 fd fc fd fc fd fc ; ....... &9318 14 15 14 15 14 15 14 ; OOOOOOO ; tile_91 (TILE_DIAGONAL_PLATFORM_BLTR_ON_PLATFORM_BLUE) # Platform and diagonal platform on blue &9320 fc fd fc fd fc 21 14 ; .....OO &9328 fc fd fc 21 14 15 22 ; ...OOOO &9330 fc 54 4c 4a 55 fd fc ; .PCCP.. &9338 14 15 14 15 14 15 14 ; OOOOOOO ; tile_92 (TILE_DIAGONAL_PLATFORM_TLBR_ON_PLATFORM_BLUE) # Platform and diagonal platform on blue &9340 14 15 21 fd fc fd fc ; OOO.... &9348 fc 22 14 15 21 fd fc ; .OOOO.. &9350 fc fd fc 55 4c 4a 54 ; ...PCCP &9358 14 15 14 15 14 15 14 ; OOOOOOO ; tile_93 (TILE_DIAGONAL_PLATFORM_TLBR_WITH_PIPE) # Diagonal platform and horizontal pipe &9360 14 15 fc fd fc fd fc ; OO..... &9368 c0 c0 14 15 66 c0 c0 ; ..OO... &9370 67 67 67 67 14 15 67 ; ....OO. &9378 fc fd fc fd fc fd 14 ; ......O ; tile_94 (TILE_DIAGONAL_PLATFORM_BLTR_WITH_PIPE) # Diagonal platform and horizontal pipe &9380 fc fd fc fd fc fd 14 ; ......O &9388 c0 c0 c0 c0 14 15 c0 ; ....OO. &9390 67 67 14 15 68 67 67 ; ..OO... &9398 14 15 fc fd fc fd fc ; OO..... ; tile_95 (TILE_DIAGONAL_PLATFORM_BLTR_ON_PLATFORM_BLACK) # Platform and diagonal platform on black &93a0 60 60 60 60 60 1f 1a ; .....OO &93a8 60 60 60 1f 1a 1b 20 ; ...OOOO &93b0 60 59 57 58 56 60 60 ; .PPPP.. &93b8 1a 1b 1a 1b 1a 1b 1a ; OOOOOOO ; tile_96 (TILE_DIAGONAL_PLATFORM_TLBR_ON_PLATFORM_BLACK) # Platform and diagonal platform on black &93c0 1a 1b 1f 60 60 60 60 ; OOO.... &93c8 60 20 1a 1b 1f 60 60 ; .OOOO.. &93d0 60 60 60 56 57 58 59 ; ...PPPP &93d8 1a 1b 1a 1b 1a 1b 1a ; OOOOOOO ; tile_97 (TILE_DIAGONAL_PLATFORM_TLBR_ON_BLACK) # Diagonal platform on black &93e0 1a 1b 1f 60 60 60 60 ; OOO.... &93e8 60 20 1a 1b 1f 60 60 ; .OOOO.. &93f0 60 60 60 20 1a 1b 1f ; ...OOOO &93f8 60 60 60 60 60 20 1a ; .....OO ; tile_98 (TILE_DIAGONAL_PLATFORM_BLTR_ON_BLACK) # Diagonal platform on black &9400 60 60 60 60 60 1f 1a ; .....OO &9408 60 60 60 1f 1a 1b 20 ; ...OOOO &9410 60 1f 1a 1b 20 60 60 ; .OOOO.. &9418 1a 1b 20 60 60 60 60 ; OOO.... ; tile_99 (TILE_DIAGONAL_PLATFORM_BLTR_ON_PLATFORM_BLUE_TWO) # Platform and diagonal platform on blue &9420 fc fd fc fd fc 21 14 ; .....OO &9428 fc fd fc 21 14 15 22 ; ...OOOO &9430 fc 54 4c 4a 55 fd fc ; .PCCP.. &9438 14 15 14 15 14 15 14 ; OOOOOOO ; tile_9a (TILE_DIAGONAL_PLATFORM_TLBR_ON_PLATFORM_BLUE_TWO) # Platform and diagonal platform on blue &9440 14 15 21 fd fc fd fc ; OOO.... &9448 fc 22 14 15 21 fd fc ; .OOOO.. &9450 fc fd fc 55 4c 4a 54 ; ...PCCP &9458 14 15 14 15 14 15 14 ; OOOOOOO ; tile_9b # Diagonal platform on Heatonite and blue &9460 fc fd fc fd fc 21 14 ; .....OO &9468 fc fd fc 21 14 15 0b ; ...OOOO &9470 fc 21 14 15 0a 09 0d ; .OOOOOO &9478 14 15 0a 09 09 0a 09 ; OOOOOOO ; tile_9c # Diagonal platform on Heatonite and blue &9480 14 15 21 fd fc fd fc ; OOO.... &9488 0a 00 14 15 21 fd fc ; OOOOO.. &9490 06 09 0a 09 14 15 21 ; OOOOOOO &9498 0a 09 0a 09 09 0a 14 ; OOOOOOO ; tile_9d # Reactor middle pillar left bottom and platform &94a0 fc fd fc fd fc fd 64 ; ....... &94a8 fc fd fc fd fc fd 64 ; ....... &94b0 fc fd fc fd fc fd 64 ; ....... &94b8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_9e # Reactor middle pillar right bottom and platform &94c0 a0 a0 fc fd fc fd fc ; ....... &94c8 a0 a0 fc fd fc fd fc ; ....... &94d0 a0 a0 fc fd fc fd fc ; ....... &94d8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_9f (TILE_PASS_CARD_READER) # Pass card reader on blue &94e0 fc fd fc fd fc fd fc ; ....... &94e8 fc 8c 8d fd fc fd fc ; ....... &94f0 fc 9b 62 fd fc fd fc ; ....... &94f8 fc 97 62 fd fc fd fc ; ....... ; tile_a0 # Vertical pipe and left wall on blue &9500 07 0a fc f3 62 fd fc ; OO..... &9508 07 0a 70 71 72 70 73 ; OO..... &9510 07 0a fc f3 62 fd fc ; OO..... &9518 07 0a fc f3 62 fd fc ; OO..... ; tile_a1 # Vertical pipe and right wall on blue &9520 fc fd fc f3 62 fd 07 ; ......O &9528 fc 6f 70 71 72 70 07 ; ......O &9530 fc fd fc f3 62 fd 07 ; ......O &9538 fc fd fc f3 62 fd 07 ; ......O ; tile_a2 # Pipe bottom right and right wall on blue &9540 fc fd fc f3 62 fd 07 ; ......O &9548 c0 c0 c0 f3 62 fd 07 ; ......O &9550 67 67 67 77 7f fd 07 ; ......O &9558 fc fd fc fd fc fd 07 ; ......O ; tile_a3 # Heatonite &9560 09 0b 0a 0b 09 00 09 ; OOOOOOO &9568 00 08 09 12 0a 08 0b ; OOOOOOO &9570 12 00 08 09 00 12 0e ; OOOOOOO &9578 0a 09 00 12 00 0b fc ; OOOOOO. ; tile_a4 # Pipe top right and right wall on blue &9580 fc fd fc fd fc fd 07 ; ......O &9588 c0 c0 c0 75 84 fd 07 ; ......O &9590 67 67 81 f3 62 fd 07 ; ......O &9598 fc fd fc f3 62 fd 07 ; ......O ; tile_a5 # Pipe top left and left wall on blue &95a0 07 0a fc fd fc fd fc ; OO..... &95a8 07 0a fc 83 74 c0 c0 ; OO..... &95b0 07 0a fc f3 62 82 67 ; OO..... &95b8 07 0a fc f3 62 fd fc ; OO..... ; tile_a6 # Guard post top left on black &95c0 60 d2 62 62 62 62 62 ; ....... &95c8 62 62 62 a9 aa a9 ab ; ....... &95d0 62 62 62 62 d5 d6 d3 ; ....... &95d8 79 79 79 79 79 79 79 ; ....... ; tile_a7 # Guard post top right on black &95e0 62 62 62 62 62 62 d2 ; ....... &95e8 ac a9 ad a9 ae 62 62 ; ....... &95f0 d7 d8 d9 da 62 62 62 ; ....... &95f8 79 79 79 79 79 79 79 ; ....... ; tile_a8 # Guard post bottom and platform &9600 79 79 79 79 79 79 79 ; ....... &9608 79 79 79 79 79 79 79 ; ....... &9610 79 79 79 79 79 79 79 ; ....... &9618 1a 1b 1a 1b 1a 1b 1a ; OOOOOOO ; tile_a9 # Escape pod bottom and platform &9620 fc f3 e7 e7 e7 e7 fb ; ....... &9628 10 f3 62 62 62 62 fb ; O...... &9630 00 00 03 03 03 03 00 ; OOOOOOO &9638 14 15 14 15 14 15 14 ; OOOOOOO ; tile_aa # Escape pod middle &9640 fc f3 e7 e7 e7 e7 fb ; ....... &9648 fc f3 e7 e7 e7 e7 fb ; ....... &9650 fc f3 e7 e7 e7 e7 fb ; ....... &9658 fc f3 e7 e7 e7 e7 fb ; ....... ; tile_ab # Escape pod top &9660 fc 10 62 62 62 62 10 ; .O....O &9668 fc f3 62 62 62 62 fb ; ....... &9670 fc f3 e7 e7 e7 e7 fb ; ....... &9678 fc f3 e7 e7 e7 e7 fb ; ....... ; tile_ac # Coolant tank bottom and platform &9680 db dc db dc db dc db ; ....... &9688 c7 c7 c7 c7 c7 c7 c7 ; ....... &9690 c7 c7 c7 c7 c7 c7 c7 ; ....... &9698 14 15 14 15 14 15 14 ; OOOOOOO ; tile_ad # Light on blue &96a0 fc fd fc 6c fc fd fc ; ....... &96a8 fc fd fc 6c fc fd fc ; ....... &96b0 fc dd de df e0 e1 e2 ; ....... &96b8 fc fd fc fd fc fd fc ; ....... ; tile_ae # Guns on blue &96c0 65 e6 e3 e3 e3 fd fc ; ....... &96c8 fc fd fc 65 e6 e3 e3 ; ....... &96d0 65 e6 e3 e3 e3 fd fc ; ....... &96d8 fc fd fc fd fc fd fc ; ....... ; tile_af # Lift power cell box &96e0 7b 7b 7b 7b 7b 7b 7b ; ....... &96e8 7b c7 c8 fc fd c9 c7 ; ....... &96f0 fc c7 54 54 54 54 c7 ; ..PPPP. &96f8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_b0 # Heatonite top spikes on blue &9700 09 03 09 0b 09 0e fc ; OOOOOO. &9708 fc 09 fc 09 fc fd fc ; .O.O... &9710 fc 09 fc fd fc fd fc ; .O..... &9718 fc fd fc fd fc fd fc ; ....... ; tile_b1 # Heatonite top spikes on blue &9720 09 09 0e 11 0b 09 13 ; OOOOOOO &9728 fc 09 fc fd 09 09 fc ; .O..OO. &9730 fc fd fc fd fc 09 fc ; .....O. &9738 fc fd fc fd fc fd fc ; ....... ; tile_b2 (TILE_TARDIS_ON_BLACK) # TARDIS on black &9740 25 1e 26 27 28 29 2a ; OOOOOOO &9748 0f 1d 2b 2c 2b 2c 2d ; OOOOOOO &9750 0f 1d 2e 2f 2e 2f 2d ; OOOOOOO &9758 30 1d 31 32 31 32 33 ; OOOOOOO ; tile_b3 # Rock top spikes &9760 3a 34 c2 09 2c 3a 38 ; OO.OOOO &9768 60 36 08 c2 39 09 fc ; .OO.OO. &9770 60 09 38 60 60 06 09 ; .OO..OO &9778 60 09 60 60 60 60 3a ; .O....O ; tile_b4 # Heatonite &9780 09 0a 09 00 12 0a 09 ; OOOOOOO &9788 09 d3 09 f9 0e 09 09 ; O.O.OOO &9790 09 0a 0e 12 f8 09 d8 ; OOOO.O. &9798 13 00 09 0a 09 09 0d ; OOOOOOO ; tile_b5 # X box with circle &97a0 c3 b0 b1 b1 b1 b2 b3 ; ....... &97a8 af b4 c3 b0 b3 c4 61 ; ....... &97b0 af ba c5 bf c2 c6 61 ; ....... &97b8 c5 bf c0 c0 c0 c1 c2 ; ....... ; tile_b6 # X box with square &97c0 c3 b0 b1 b1 b1 b1 b3 ; ....... &97c8 af 61 8c 8c 8d 8d 61 ; ....... &97d0 af 61 8e 8e 8f 8f 61 ; ....... &97d8 c5 bf c0 c0 c0 c1 c2 ; ....... ; tile_b7 # X box with circle and platform &97e0 c3 b0 b1 b1 b1 b2 b3 ; ....... &97e8 af b4 c3 b0 b3 c4 61 ; ....... &97f0 af ba c5 bf c2 c6 61 ; ....... &97f8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_b8 # Bed and platform &9800 fc fd fc fd fc fd fc ; ....... &9808 a0 75 ee ee ee ee ee ; ....... &9810 a0 6b 6b 6b 6b 6b 6b ; ....... &9818 14 15 14 15 14 15 14 ; OOOOOOO ; tile_b9 # Heatonite top spikes on black &9820 06 c3 c4 09 c5 0a 0b ; O..O.OO &9828 09 24 0e 09 0e 09 13 ; OOOOOOO &9830 60 0e 60 60 09 60 60 ; .O..O.. &9838 60 60 60 60 60 60 60 ; ....... ; tile_ba # Heatonite top &9840 13 0a 09 09 09 13 0a ; OOOOOOO &9848 60 60 60 60 60 60 60 ; ....... &9850 60 60 60 60 60 60 60 ; ....... &9858 60 60 60 60 60 60 60 ; ....... ; tile_bb # Heatonite top spikes on blue &9860 06 07 08 09 00 0f 0b ; OOOOOOO &9868 fc 00 08 09 0c 09 0b ; .OOOOOO &9870 fc 09 0a fd fc 09 0d ; .OO..OO &9878 fc 09 fc fd fc fd 09 ; .O....O ; tile_bc # Master's column &9880 fc f0 f1 f1 f1 f1 f2 ; ....... &9888 fc fd f3 f3 f3 f3 fc ; ....... &9890 fc fd f3 f3 f3 f3 fc ; ....... &9898 fc f4 f5 f5 f5 f5 f6 ; ....... ; tile_bd (TILE_ALARM_SENSOR_AND_PLATFORM) # Alarm sensor and platform on blue &98a0 fc fd fc fd fc fd fc ; ....... &98a8 fc fd fc fa fa fd fc ; ....... &98b0 fc fd fc fa fa fd fc ; ....... &98b8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_be (TILE_TARDIS_ON_BLUE) # TARDIS on blue &98c0 34 35 36 27 28 37 38 ; OOOOOOO &98c8 2d 1d 2b 2c 2b 2c 2d ; OOOOOOO &98d0 2d 1d 2e 2f 2e 2f 2d ; OOOOOOO &98d8 3a 1d 31 32 31 32 33 ; OOOOOOO ; tile_bf # Thin platform on blue &98e0 fc fd fc fd fc fd fc ; ....... &98e8 fc fd fc fd fc fd fc ; ....... &98f0 fc fd fc fd fc fd fc ; ....... &98f8 11 11 11 11 11 11 11 ; OOOOOOO ; tile_c0 # Thin platform on black &9900 60 60 60 60 60 60 60 ; ....... &9908 60 60 60 60 60 60 60 ; ....... &9910 60 60 60 60 60 60 60 ; ....... &9918 13 13 13 13 13 13 13 ; OOOOOOO ; tile_c1 # Control panel slot and platform on blue &9920 fc fd fc fd fc fd fc ; ....... &9928 6f 6f 6f af fc fd b9 ; ....... &9930 7a 7a 89 89 89 89 89 ; ....... &9938 14 15 14 15 14 15 14 ; OOOOOOO ; tile_c2 # Left control panel slot and platform on blue &9940 fc fd fc fd fc fd fc ; ....... &9948 fc fd 6f af fc fd af ; ....... &9950 fc fb 89 89 89 89 89 ; ....... &9958 14 15 14 15 14 15 14 ; OOOOOOO ; tile_c3 # Table and platform on blue &9960 fc fd fc fd fc fd fc ; ....... &9968 fc 67 67 62 62 67 67 ; ....... &9970 fc fd 65 62 62 65 fc ; ....... &9978 14 15 14 15 14 15 14 ; OOOOOOO ; tile_c4 # Left chair and platform on blue &9980 fc 62 fc fd fc fd fc ; ....... &9988 fc 67 62 90 90 90 fc ; ....... &9990 fc fd 65 62 62 65 fc ; ....... &9998 14 15 14 15 14 15 14 ; OOOOOOO ; tile_c5 # Right chair and platform on blue &99a0 fc fd fc fd fc fd 62 ; ....... &99a8 fc fd 90 90 90 62 67 ; ....... &99b0 fc fd 65 62 62 65 fc ; ....... &99b8 14 15 14 15 14 15 14 ; OOOOOOO ; tile_c6 # Rock &99c0 c5 3a 37 2c 61 c2 2a ; .OOO..O &99c8 34 2c 34 c3 37 c4 32 ; OOO.O.O &99d0 61 35 c5 36 2a be 2c ; .O.OO.O &99d8 35 c2 61 c4 34 61 2a ; O...O.O ; tile_c7 # Rock &99e0 37 34 c6 38 37 3a 2a ; OO.OOOO &99e8 36 2c be 36 be bf 37 ; OO.O..O &99f0 34 38 c5 37 be 32 34 ; OO.O.OO &99f8 3a 34 b7 32 2c 2a c4 ; OO.OOO. ; tile_c8 # Rock top &9a00 09 0b 09 0c 09 11 0e ; OOOOOOO &9a08 3b 11 c5 2a c6 36 29 ; OO.O.OO &9a10 29 3a c1 c8 3b c6 c2 ; OO..O.. &9a18 39 c2 26 2a 32 c5 39 ; O.OOO.O ; tile_c9 # Rock right &9a20 36 25 35 2b 3a c5 0b ; OOOOO.O &9a28 29 c1 2a bf 2a 26 09 ; O.O.OOO &9a30 2c 2a 37 c1 38 c3 08 ; OOO.O.O &9a38 2b c2 38 3a 2c 2a 01 ; O.OOOOO ; tile_ca # Rock bottom &9a40 34 2a bf 38 28 2b 36 ; OO.OOOO &9a48 bd 31 2a 2c c1 29 2b ; .OOO.OO &9a50 38 c6 29 c5 2b c1 c2 ; O.O.O.. &9a58 09 0e 09 13 23 0e 09 ; OOOOOOO ; tile_cb # Partial platform on blue &9a60 fc fd fc fd fc fd fc ; ....... &9a68 fc fd fc fd fc fd fc ; ....... &9a70 fc fd fc fd fc fd fc ; ....... &9a78 21 21 21 21 21 21 21 ; OOOOOOO ; tile_cc # Partial platform and left wall on blue &9a80 3e fd fc fd fc fd fc ; O...... &9a88 3e fd fc fd fc fd fc ; O...... &9a90 3e fd fc fd fc fd fc ; O...... &9a98 3e 21 21 21 21 21 21 ; OOOOOOO ; tile_cd # Conveyor &9aa0 3f 3f 3f 3f 3f 3f 3f ; OOOOOOO &9aa8 fe fe fe fe fe fe fe ; ....... &9ab0 fe fe fe fe fe fe fe ; ....... &9ab8 53 53 53 53 53 53 53 ; PPPPPPP ; tile_ce # Wriggly pipe &9ac0 3c 3d 3c 3d 3c 3d 3c ; OOOOOOO &9ac8 ca ca ca ca ca ca ca ; ....... &9ad0 c4 c3 c4 c3 c4 c3 c4 ; ....... &9ad8 c5 c6 c5 c6 c5 c6 c5 ; ....... ; tile_cf # Vertical conveyor and top wall &9ae0 3c 3c 3c 3c 3c 3c 3c ; OOOOOOO &9ae8 64 64 64 64 64 64 64 ; ....... &9af0 91 ea eb 9e 9e eb ea ; ....... &9af8 64 64 64 64 64 64 64 ; ....... ; tile_d0 # Rock left &9b00 23 11 38 26 2a 29 c4 ; OOOOOO. &9b08 09 23 bd 38 c3 39 c5 ; OO.O.O. &9b10 09 13 36 39 34 c2 35 ; OOOOO.O &9b18 0b 09 bf 36 35 c6 34 ; OO.OO.O ; tile_d1 # Blue passage &9b20 fd fd fd fd fd fd fd ; ....... &9b28 fc fc fc fc fc fc fc ; ....... &9b30 fd fd fd fd fd fd fd ; ....... &9b38 fc fc fc fc fc fc fc ; ....... ; tile_d2 # Platform on blue passage &9b40 fd fd fd fd fd fd fd ; ....... &9b48 fc fc fc fc fc fc fc ; ....... &9b50 fd fd fd fd fd fd fd ; ....... &9b58 14 15 14 15 14 15 14 ; OOOOOOO ; tile_d3 # Heatonite &9b60 0c 00 12 00 00 09 0b ; OOOOOOO &9b68 09 00 ad d2 ae d4 c7 ; OO..... &9b70 00 00 d4 aa d8 d9 00 ; OO....O &9b78 09 00 00 09 12 00 00 ; OOOOOOO ; tile_d4 # Platform and handrail on blue &9b80 fc fd fc fd fc fd fc ; ....... &9b88 91 7d 91 7d 91 7d 91 ; ....... &9b90 b9 fd b9 fd b9 fd b9 ; ....... &9b98 14 15 14 15 14 15 14 ; OOOOOOO ; tile_d5 # Rock corner on black &9ba0 09 07 13 60 60 60 60 ; OOO.... &9ba8 60 60 60 60 60 60 60 ; ....... &9bb0 60 60 60 60 60 60 60 ; ....... &9bb8 60 60 60 60 60 60 60 ; ....... ; tile_d6 # Shelves &9bc0 c4 c4 c4 c4 c4 c4 c4 ; ....... &9bc8 c4 c4 c4 c4 c4 c4 c4 ; ....... &9bd0 c4 c4 c4 c4 c4 c4 c4 ; ....... &9bd8 c4 c4 c4 c4 c4 c4 c4 ; ....... ; tile_d7 # Computer top &9be0 14 15 14 15 14 15 14 ; OOOOOOO &9be8 99 63 63 63 63 63 63 ; ....... &9bf0 78 60 60 60 60 60 60 ; ....... &9bf8 78 60 60 60 60 60 60 ; ....... ; tile_d8 # Computer bottom and platform &9c00 88 89 82 6b 6b 81 8a ; ....... &9c08 6e 77 fc 86 87 fd 76 ; ....... &9c10 6e fd fc 81 82 fd fc ; ....... &9c18 14 15 14 15 14 15 14 ; OOOOOOO ; tile_d9 (TILE_ALARM_SENSOR) # Alarm sensor on blue &9c20 fc fd fc fd fc fd fc ; ....... &9c28 fc fd fc fa fa fd fc ; ....... &9c30 fc fd fc fa fa fd fc ; ....... &9c38 fc fd fc fd fc fd fc ; ....... ; tile_da (TILE_HEATONITE) # Heatonite &9c40 09 0c 0b 09 0a 0b 12 ; OOOOOOO &9c48 06 08 09 0a 0c 09 09 ; OOOOOOO &9c50 05 0b 0a 09 09 0a 0e ; OOOOOOO &9c58 09 06 09 06 08 09 0a ; OOOOOOO ; tile_db (TILE_HEATONITE_TWO) # Heatonite &9c60 13 09 0b 0b 0b 0c 00 ; OOOOOOO &9c68 0e 09 0e 0c 0b 09 00 ; OOOOOOO &9c70 09 05 0b 00 09 09 0b ; OOOOOOO &9c78 09 09 00 09 00 09 0c ; OOOOOOO ; tile_dc # Shelves and left wall &9c80 07 0a c4 c4 c4 c4 c4 ; OO..... &9c88 07 0a c4 c4 c4 c4 c4 ; OO..... &9c90 07 0a c4 c4 c4 c4 c4 ; OO..... &9c98 07 0a c4 c4 c4 c4 c4 ; OO..... ; tile_dd # Long light left on blue &9ca0 fc fd fc b9 fc fd fc ; ....... &9ca8 fc fd fc b9 fc fd fc ; ....... &9cb0 fc 70 72 72 72 72 72 ; ....... &9cb8 fc fd fc fd fc fd fc ; ....... ; tile_de # Long light right on blue &9cc0 fc fd fc fd b9 fd fc ; ....... &9cc8 fc fd fc fd b9 fd fc ; ....... &9cd0 72 72 72 72 72 72 70 ; ....... &9cd8 fc fd fc fd fc fd fc ; ....... ; tile_df # Sensor on blue &9ce0 fc fd fc 94 b9 fd fc ; ....... &9ce8 fc fd fc 8c 8d fd fc ; ....... &9cf0 fc fd fc 8e 8f fd fc ; ....... &9cf8 fc fd fc fd fc fd fc ; ....... ; chunk_data &9d00 0f 0f 0f 0f 0f 0f 0f 0f ; CHUNK_00 &9d08 30 30 30 30 0f 0f 0f 0f ; CHUNK_01 &9d10 0f 0f 0f 0f 00 00 00 00 ; CHUNK_02 &9d18 0f 0f 0f 0f 30 30 30 30 ; CHUNK_03 &9d20 15 15 15 15 15 15 15 15 ; CHUNK_04 &9d28 00 00 00 00 0f 0f 0f 0f ; CHUNK_05 &9d30 05 05 05 05 05 05 05 05 ; CHUNK_06 &9d38 0d 0d 0d 0d 0d 0d 0d 0d ; CHUNK_07 &9d40 08 08 08 08 08 08 08 08 ; CHUNK_08 &9d48 0a 0a 05 05 05 0a 0a 0a ; CHUNK_09 &9d50 0e 0e 0e 0e 0e 0e 0e 0e ; CHUNK_0a &9d58 00 08 0e 0e 0e 0d 0d 0d ; CHUNK_0b &9d60 0d 0d 0d 0d 0d 0f 0f 0f ; CHUNK_0c &9d68 0c 0c 0c 0c 0c 0c 0c 0c ; CHUNK_0d &9d70 0f 0f 0f 0f 0a 0a 0a 0a ; CHUNK_0e &9d78 00 00 00 00 00 00 00 00 ; CHUNK_0f &9d80 30 30 30 30 0e 0e 0e 0e ; CHUNK_10 &9d88 0e 0e 0e 0e 30 30 30 30 ; CHUNK_11 &9d90 00 00 00 00 0e 0e 0e 0e ; CHUNK_12 &9d98 0e 0e 0e 0e 00 00 00 00 ; CHUNK_13 &9da0 0f 03 12 21 30 21 12 03 ; CHUNK_14 &9da8 0f 03 30 21 12 21 30 03 ; CHUNK_15 &9db0 3f 3f 0f 30 0f 0f 0f 0f ; CHUNK_16 &9db8 20 30 10 00 0f 0f 0f 0f ; CHUNK_17 &9dc0 10 10 30 20 0f 0f 0f 0f ; CHUNK_18 &9dc8 3f 3f 3f 3f 3f 3f 3f 3f ; CHUNK_19 (unused) &9dd0 0f 03 02 01 00 01 02 03 ; CHUNK_1a &9dd8 0f 03 00 01 02 01 00 03 ; CHUNK_1b &9de0 03 03 03 03 03 03 03 03 ; CHUNK_1c (unused) &9de8 30 30 30 30 30 30 30 30 ; CHUNK_1d &9df0 00 00 00 30 30 30 30 30 ; CHUNK_1e &9df8 00 00 00 00 0f 03 02 01 ; CHUNK_1f &9e00 00 02 01 03 00 00 00 00 ; CHUNK_20 &9e08 30 30 30 30 0f 03 12 21 ; CHUNK_21 &9e10 30 12 21 03 30 30 30 30 ; CHUNK_22 &9e18 00 0a 0d 0d 0d 0e 0e 0e ; CHUNK_23 &9e20 0a 0a 0a 0a 0a 0a 0a 0a ; CHUNK_24 &9e28 00 00 00 10 10 00 00 00 ; CHUNK_25 &9e30 00 00 30 35 30 10 10 30 ; CHUNK_26 &9e38 41 30 30 3f 30 10 10 30 ; CHUNK_27 &9e40 00 20 30 3f 30 10 10 30 ; CHUNK_28 &9e48 00 00 20 30 30 10 10 30 ; CHUNK_29 &9e50 00 00 00 30 30 20 20 20 ; CHUNK_2a &9e58 10 10 30 30 30 30 30 30 ; CHUNK_2b &9e60 10 10 30 10 10 10 10 10 ; CHUNK_2c &9e68 20 20 20 20 20 20 20 20 ; CHUNK_2d &9e70 00 30 30 30 30 30 30 00 ; CHUNK_2e &9e78 10 30 10 10 10 10 10 10 ; CHUNK_2f &9e80 00 00 00 00 00 00 00 10 ; CHUNK_30 &9e88 30 30 30 30 30 30 00 30 ; CHUNK_31 &9e90 30 10 10 10 10 10 10 30 ; CHUNK_32 &9e98 20 20 20 20 20 20 20 30 ; CHUNK_33 &9ea0 30 30 00 10 10 00 20 20 ; CHUNK_34 &9ea8 30 20 00 30 30 30 30 30 ; CHUNK_35 &9eb0 20 00 30 35 30 10 10 30 ; CHUNK_36 &9eb8 30 00 20 30 30 10 10 30 ; CHUNK_37 &9ec0 30 30 00 30 30 20 20 20 ; CHUNK_38 &9ec8 30 30 10 10 10 10 30 30 ; CHUNK_39 &9ed0 20 20 20 20 20 20 00 10 ; CHUNK_3a &9ed8 30 30 30 30 30 30 10 10 ; CHUNK_3b &9ee0 3c 3c 3c 3c 30 30 30 30 ; CHUNK_3c &9ee8 3c 3c 3c 3c 00 10 10 10 ; CHUNK_3d &9ef0 3c 3c 3c 3c 3c 3c 3c 3c ; CHUNK_3e &9ef8 3c 3c 3c 3c 09 09 09 09 ; CHUNK_3f &9f00 2b 2b 2b 2b 2b 2b 2b 2b ; CHUNK_40 # CHUNK_FIRST_CLIMBABLE &9f08 3f 3f 03 3f 3f 3f 3f 3f ; CHUNK_41 (unused) &9f10 2b 2b 2b 3f 2b 2b 2b 2b ; CHUNK_42 (unused) &9f18 03 03 0c 0c 03 03 0c 0c ; CHUNK_43 &9f20 25 25 25 25 25 25 25 25 ; CHUNK_44 (unused) &9f28 03 3f 00 00 03 3f 00 00 ; CHUNK_45 &9f30 03 3f 0f 0f 03 3f 0f 0f ; CHUNK_46 &9f38 00 00 00 00 00 00 00 00 ; CHUNK_47 (unused) &9f40 2b 3f 2b 2b 2b 3f 2b 2b ; CHUNK_48 &9f48 03 3f 30 30 03 3f 30 30 ; CHUNK_49 &9f50 0f 03 30 21 12 21 30 03 ; CHUNK_4a &9f58 03 3f 12 21 03 3f 21 03 ; CHUNK_4b &9f60 0f 03 12 21 30 21 12 03 ; CHUNK_4c &9f68 03 3f 30 30 03 3f 3f 3f ; CHUNK_4d &9f70 03 3f 00 2f 03 3f 2f 2f ; CHUNK_4e &9f78 03 3f 0f 0f 03 3f 30 30 ; CHUNK_4f &9f80 03 3f 2a 3f 03 3f 00 3f ; CHUNK_50 # CHUNK_DOWNWARDS_CLIMBABLE_PLATFORM &9f88 03 3f 12 21 03 3f 12 03 ; CHUNK_51 &9f90 3c 3c 3c 3c 3f 3f 3f 3f ; CHUNK_52 (unused) &9f98 09 09 09 09 09 09 09 09 ; CHUNK_53 &9fa0 30 30 30 30 0f 03 12 21 ; CHUNK_54 &9fa8 30 12 21 03 30 30 30 30 ; CHUNK_55 &9fb0 00 02 01 03 00 00 00 00 ; CHUNK_56 &9fb8 0f 03 02 01 00 01 02 03 ; CHUNK_57 &9fc0 0f 03 00 01 02 01 00 03 ; CHUNK_58 &9fc8 00 00 00 00 0f 03 02 01 ; CHUNK_59 &9fd0 14 3c 3c 3c 3f 3f 3f 3f ; CHUNK_5a (unused) &9fd8 ff ff ff ff ff ff ff ff ; CHUNK_5b (unused) &9fe0 05 0f 0f 0f 0f 0f 0f 0f ; CHUNK_5c (unused) &9fe8 ff ff ff ff ff ff ff ff ; CHUNK_5d (unused) &9ff0 ff ff ff ff ff ff ff ff ; CHUNK_5e (unused) &9ff8 ff ff ff ff ff ff ff ff ; CHUNK_5f (unused) &a000 00 00 00 00 00 00 00 00 ; CHUNK_60 (CHUNK BLACK) # CHUNK_FIRST_BACKGROUND &a008 30 30 30 30 30 30 30 30 ; CHUNK_61 &a010 0f 0f 0f 0f 0f 0f 0f 0f ; CHUNK_62 &a018 0f 0f 0f 0f 00 00 00 00 ; CHUNK_63 &a020 3f 3f 3f 3f 3f 3f 3f 3f ; CHUNK_64 &a028 30 30 30 30 3f 3f 3f 3f ; CHUNK_65 &a030 3f 00 00 2f 2f 2f 2f 2f ; CHUNK_66 &a038 0f 0f 0f 0f 30 30 30 30 ; CHUNK_67 &a040 2f 2a 2a 3f 3f 00 00 3f ; CHUNK_68 &a048 0f 0f 0f 0f 3f 3f 3f 3f ; CHUNK_69 &a050 0f 0f 0f 0f 1f 1f 1f 1f ; CHUNK_6a &a058 3f 3f 3f 3f 30 30 30 30 ; CHUNK_6b &a060 20 20 20 20 20 20 20 20 ; CHUNK_6c &a068 1a 1a 1a 1a 1a 1a 1a 1a ; CHUNK_6d &a070 2f 2f 2f 2f 2f 2f 2f 2f ; CHUNK_6e &a078 30 30 2a 2a 2a 2a 30 30 ; CHUNK_6f &a080 30 30 3f 3f 3f 3f 30 30 ; CHUNK_70 &a088 3f 3f 3f 3f 00 00 3f 3f ; CHUNK_71 &a090 0f 0f 3f 3f 00 00 0f 0f ; CHUNK_72 &a098 30 30 15 15 15 15 30 30 ; CHUNK_73 &a0a0 30 30 30 30 35 3f 3f 3f ; CHUNK_74 &a0a8 30 30 30 30 3a 3f 3f 3f ; CHUNK_75 &a0b0 0f 0f 0f 25 30 30 30 30 ; CHUNK_76 &a0b8 0f 0f 0f 1a 30 30 30 30 ; CHUNK_77 &a0c0 0a 0a 0a 0a 0a 0a 0a 0a ; CHUNK_78 &a0c8 0b 0b 0b 0b 0b 0b 0b 0b ; CHUNK_79 &a0d0 0f 0f 0f 0f 00 0f 0f 0f ; CHUNK_7a &a0d8 03 30 03 30 03 30 03 30 ; CHUNK_7b &a0e0 0f 0f 00 05 05 0f 0f 0f ; CHUNK_7c &a0e8 00 00 00 00 3f 3f 3f 00 ; CHUNK_7d &a0f0 30 30 30 35 3f 3f 3f 3f ; CHUNK_7e &a0f8 1a 1a 30 30 30 30 30 30 ; CHUNK_7f &a100 35 35 30 30 30 30 30 30 ; CHUNK_80 &a108 0f 0f 0f 0f 25 30 30 30 ; CHUNK_81 &a110 0f 0f 0f 0f 1a 30 30 30 ; CHUNK_82 &a118 30 30 30 30 30 30 35 35 ; CHUNK_83 &a120 30 30 30 30 30 30 1a 1a ; CHUNK_84 &a128 30 30 30 3a 3f 3f 3f 3f ; CHUNK_85 &a130 30 25 0f 0f 0f 0f 0f 0f ; CHUNK_86 &a138 30 1a 0f 0f 0f 0f 0f 0f ; CHUNK_87 &a140 0f 25 30 30 30 30 30 25 ; CHUNK_88 &a148 0f 0f 0f 25 25 25 0f 0f ; CHUNK_89 &a150 0f 0f 0f 1a 1a 1a 0f 0f ; CHUNK_8a &a158 0f 1a 30 30 30 30 30 1a ; CHUNK_8b &a160 0f 0f 0a 0b 0a 0b 0a 0b ; CHUNK_8c &a168 0f 0f 07 05 07 05 07 05 ; CHUNK_8d &a170 0a 0b 0a 0b 0a 0b 0f 0f ; CHUNK_8e &a178 07 05 07 05 07 05 0f 0f ; CHUNK_8f &a180 30 30 30 30 0f 0f 0f 0f ; CHUNK_90 &a188 00 00 00 00 3f 3f 3f 3f ; CHUNK_91 &a190 15 15 15 15 3f 3f 3f 3f ; CHUNK_92 &a198 2a 2a 2a 2a 00 00 00 00 ; CHUNK_93 &a1a0 15 15 15 15 15 15 15 15 ; CHUNK_94 &a1a8 2a 2a 2a 2a 2a 2a 2a 2a ; CHUNK_95 (unused) &a1b0 35 3f 3f 3f 3f 3f 3f 3f ; CHUNK_96 (unused) &a1b8 1a 0f 0f 0f 0f 0f 0f 0f ; CHUNK_97 &a1c0 3f 3f 3f 3f 3f 3f 3f 35 ; CHUNK_98 &a1c8 0f 0f 0f 0f 0f 0f 0f 1a ; CHUNK_99 &a1d0 0a 0a 0a 0a 00 00 00 00 ; CHUNK_9a &a1d8 0f 0f 0a 0a 0a 0a 0a 0f ; CHUNK_9b &a1e0 3f 3f 3f 3f 15 15 15 15 ; CHUNK_9c &a1e8 00 00 00 00 2a 2a 2a 2a ; CHUNK_9d &a1f0 3f 3f 3f 3f 00 00 00 00 ; CHUNK_9e &a1f8 12 12 12 12 12 12 12 12 ; CHUNK_9f &a200 03 03 03 03 03 03 03 03 ; CHUNK_a0 &a208 0f 05 05 05 05 05 0f 0f ; CHUNK_a1 &a210 03 03 03 03 03 01 00 0f ; CHUNK_a2 &a218 03 03 03 03 03 01 01 03 ; CHUNK_a3 &a220 03 03 03 03 03 01 00 03 ; CHUNK_a4 &a228 03 03 03 03 07 0f 0f 06 ; CHUNK_a5 &a230 03 03 03 03 03 09 09 03 ; CHUNK_a6 &a238 03 02 03 02 03 02 03 02 ; CHUNK_a7 &a240 0b 0a 0b 0a 0b 0a 0b 0a ; CHUNK_a8 &a248 0a 0a 0a 0a 0a 0a 0a 0f ; CHUNK_a9 &a250 00 0f 0f 0f 0a 0a 00 0f ; CHUNK_aa &a258 0a 0a 0a 0a 0a 0a 00 0f ; CHUNK_ab &a260 00 0a 0a 00 0a 0a 0a 0f ; CHUNK_ac &a268 00 0a 0a 05 0a 0a 0a 0f ; CHUNK_ad &a270 05 0a 0a 0a 0a 0a 00 0f ; CHUNK_ae &a278 38 38 38 38 38 38 38 38 ; CHUNK_af &a280 3c 3c 30 30 38 3a 3e 35 ; CHUNK_b0 &a288 3c 3c 30 30 30 30 30 30 ; CHUNK_b1 &a290 3c 3c 30 30 30 30 34 35 ; CHUNK_b2 &a298 28 3c 34 35 3d 2a 3a 10 ; CHUNK_b3 &a2a0 35 20 30 30 30 30 30 30 ; CHUNK_b4 &a2a8 38 3a 3e 35 35 20 30 30 ; CHUNK_b5 &a2b0 30 30 30 30 38 3a 3e 35 ; CHUNK_b6 &a2b8 30 30 34 35 3d 2a 10 30 ; CHUNK_b7 &a2c0 3d 2a 3a 10 30 30 30 30 ; CHUNK_b8 &a2c8 28 28 28 28 28 28 28 28 ; CHUNK_b9 &a2d0 30 30 30 30 30 30 34 35 ; CHUNK_ba &a2d8 30 30 34 35 3d 2a 3a 10 ; CHUNK_bb &a2e0 3d 3a 3a 10 30 30 30 30 ; CHUNK_bc &a2e8 38 3a 3e 15 35 30 30 30 ; CHUNK_bd &a2f0 30 30 30 30 38 3a 3e 15 ; CHUNK_be &a2f8 3d 2a 3a 10 30 3c 3c 00 ; CHUNK_bf &a300 30 30 30 30 30 3c 3c 00 ; CHUNK_c0 &a308 35 30 30 30 30 3c 3c 00 ; CHUNK_c1 &a310 38 3a 3e 15 35 3c 28 00 ; CHUNK_c2 &a318 20 14 3c 3d 3d 28 38 38 ; CHUNK_c3 &a320 10 00 28 28 28 28 28 28 ; CHUNK_c4 &a328 38 38 3c 3d 3d 14 00 20 ; CHUNK_c5 &a330 28 28 28 28 28 00 00 10 ; CHUNK_c6 &a338 0c 0c 0c 0c 0c 0c 0c 0c ; CHUNK_c7 &a340 30 30 30 30 18 18 18 18 ; CHUNK_c8 &a348 30 30 30 30 24 24 24 24 ; CHUNK_c9 &a350 0c 0c 0c 0c 30 30 30 30 ; CHUNK_ca &a358 30 30 30 30 30 30 30 0c ; CHUNK_cb &a360 30 30 30 30 30 30 30 21 ; CHUNK_cc &a368 07 03 07 03 07 03 07 03 ; CHUNK_cd &a370 30 30 30 30 30 30 30 25 ; CHUNK_ce &a378 0b 0f 0b 0f 0b 0f 0b 0f ; CHUNK_cf &a380 33 33 33 33 33 33 33 33 ; CHUNK_d0 &a388 33 33 33 33 0f 0f 0f 0f ; CHUNK_d1 &a390 00 00 00 00 0f 0f 0f 0f ; CHUNK_d2 &a398 00 05 05 05 05 05 00 0f ; CHUNK_d3 &a3a0 05 05 05 05 05 05 05 0f ; CHUNK_d4 &a3a8 00 05 05 00 05 05 05 0f ; CHUNK_d5 &a3b0 05 05 05 05 0f 0f 0f 0f ; CHUNK_d6 &a3b8 00 05 05 00 0f 0f 00 0f ; CHUNK_d7 &a3c0 05 0f 0f 05 05 05 05 0f ; CHUNK_d8 &a3c8 00 0a 0a 0a 0a 0a 0a 0f ; CHUNK_d9 &a3d0 05 0f 0f 0f 0f 0f 0f 0f ; CHUNK_da &a3d8 30 30 24 0c 0c 0c 0c 0c ; CHUNK_db &a3e0 30 30 30 18 0c 0c 0c 0c ; CHUNK_dc &a3e8 30 30 30 21 03 30 30 30 ; CHUNK_dd &a3f0 30 21 02 00 03 30 30 30 ; CHUNK_de &a3f8 03 01 03 00 03 0f 25 30 ; CHUNK_df &a400 12 03 03 03 03 1a 30 30 ; CHUNK_e0 &a408 30 30 12 03 03 30 30 30 ; CHUNK_e1 &a410 30 30 30 30 12 30 30 30 ; CHUNK_e2 &a418 30 30 30 3f 3f 30 30 30 ; CHUNK_e3 &a420 05 05 05 0f 05 05 05 0f ; CHUNK_e4 &a428 05 05 05 05 05 05 00 0f ; CHUNK_e5 &a430 30 30 3a 35 3f 3f 3a 30 ; CHUNK_e6 &a438 03 03 03 03 33 33 33 33 ; CHUNK_e7 &a440 33 33 33 33 03 03 03 03 ; CHUNK_e8 &a448 03 03 03 03 0b 0b 0b 0b ; CHUNK_e9 &a450 00 00 00 00 00 00 3f 3f ; CHUNK_ea &a458 3f 3f 00 00 00 00 00 00 ; CHUNK_eb &a460 30 30 30 95 30 30 30 30 ; CHUNK_ec &a468 30 30 30 c9 00 00 00 00 ; CHUNK_ed &a470 30 30 30 30 30 30 3c 3c ; CHUNK_ee &a478 0f 0f 00 00 00 00 00 0f ; CHUNK_ef &a480 3f 35 30 30 30 30 30 30 ; CHUNK_f0 &a488 3f 3f 1e 1e 1e 1e 1e 1e ; CHUNK_f1 &a490 3f 3a 30 30 30 30 30 30 ; CHUNK_f2 &a498 1e 1e 1e 1e 1e 1e 1e 1e ; CHUNK_f3 &a4a0 30 30 30 30 30 30 35 3f ; CHUNK_f4 &a4a8 1e 1e 1e 1e 1e 1e 3f 3f ; CHUNK_f5 &a4b0 30 30 30 30 30 30 3a 3f ; CHUNK_f6 &a4b8 0f 00 0a 0a 05 00 0f 0f ; CHUNK_f7 &a4c0 0f 00 00 00 0a 0a 0f 0f ; CHUNK_f8 &a4c8 0f 00 0a 00 0a 00 0f 0f ; CHUNK_f9 &a4d0 03 03 03 03 30 30 30 30 ; CHUNK_fa &a4d8 25 25 25 25 25 25 25 25 ; CHUNK_fb &a4e0 20 20 20 00 30 30 30 30 ; CHUNK_fc &a4e8 30 30 30 30 00 10 10 10 ; CHUNK_fd &a4f0 09 09 09 09 09 09 09 09 ; CHUNK_fe &a4f8 05 05 0f 0f 0f 05 05 0f ; CHUNK_ff ; map_data # 128 x 54 tiles &a500 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 39 39 &a510 39 39 39 39 39 39 39 39 39 39 39 1b 1b 1b 1b 1b &a520 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a530 1b 1b 1b 1b 1b 1b 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f &a540 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1b 1b 1b 1b 1b 1b &a550 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a560 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a570 1b 1b 1b 1b 1f 1f 1f 1b 1b 1b 1b 1b 1b 1b 1b 1b &a580 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 2d 2e 1e 6b &a590 6b 12 6b 12 6b 12 6b 12 6b 6b 38 30 31 1b 1b 1b &a5a0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a5b0 1b 1b 1b 1b 2d 2e 1e 12 12 12 12 12 12 12 12 12 &a5c0 12 12 12 12 12 12 12 12 12 38 30 31 1b 1b 1b 1b &a5d0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a5e0 1b 1b 1b 1b 1b 1b 1b 2c 2f 2f 32 2c 2f 2f 32 2c &a5f0 2f 2f 32 2c 1e 12 12 30 31 1b 1b 1b 1b 1b 1b 1b &a600 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 2c 1e 6b 0e 65 &a610 76 2f 58 1c 5f 1c 63 65 76 65 15 6b 38 32 1b 1b &a620 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a630 1b 1b 1b 2c 1c 27 0d b7 b7 07 b7 b7 b7 b7 b7 04 &a640 04 04 b7 b7 b7 b7 b7 07 b7 0d 0b 1c 32 1b 1b 1b &a650 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a660 1b 1b 1b 1b 1b 1b 1b 0b ab 06 a1 0b ab 06 a1 0b &a670 ab 06 a1 a5 0e b5 b5 1c 1c 32 1b 1b 1b 1b 1b 1b &a680 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 2b 1e 0e 69 69 66 &a690 05 66 58 1c 63 1c 60 69 05 69 69 69 15 38 33 1b &a6a0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a6b0 1b 1b 2b 1e 12 12 0e b5 b5 06 ad 1c ad 1c 0b cb &a6c0 cd cc 27 1c b5 b5 b5 06 b6 15 12 12 38 33 1b 1b &a6d0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a6e0 1b 1b 1b 1b 1b 1b 1b 0b aa 06 a1 0b aa 06 a1 0b &a6f0 aa 06 a1 a0 1c b5 b5 b5 1c 1c 33 1b 1b 1b 1b 1b &a700 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 2a 1d 5f 63 b5 b5 &a710 06 24 56 1c 64 1c 64 63 06 63 5f 64 63 1d 34 1b &a720 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a730 1b 1b 2a 1d 1c b5 b5 b5 b5 06 1c 1c 9f 68 6c cb &a740 3d cc 36 21 9f b5 b5 06 b5 b6 b5 1c 1d 34 1b 1b &a750 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &a760 1b 1b 1b 1b 1b 1b 1b 0b aa 06 a1 0b aa 06 a1 0b &a770 aa 06 a1 a0 1c b5 b5 b5 1c 24 34 1b 1b 1b 1b 1b &a780 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 29 0d 69 69 66 bf &a790 4b 23 66 04 04 04 04 69 4b bf 69 69 69 0d 84 1f &a7a0 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1b &a7b0 1b 1b 29 0d b7 b7 b7 b7 b7 4b 04 04 04 22 04 04 &a7c0 3d 04 04 20 04 b7 b7 4b b7 b7 b7 07 0d 84 1b 1b &a7d0 1b 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f &a7e0 1f 1f 1f 1f 1f 1f 1f 29 a9 05 5b 29 a9 05 5b 29 &a7f0 a9 05 5b 59 07 b7 b7 b7 b7 23 84 1b 1b 1b 1b 1b &a800 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 5e 12 12 12 94 &a810 12 12 12 12 12 6b 12 6b 12 93 12 6b 12 3e 6b 6b &a820 12 12 6b 6b 12 6b 12 6b 11 12 5e 5e 5e 5e a4 32 &a830 1b 1b 0b 15 12 12 12 12 12 12 12 12 5e 5e 0b cb &a840 3d cc 27 5e 5e 12 12 12 12 12 12 13 0e 27 1b 1b &a850 2c 5e 5e 5e 11 62 12 12 12 12 12 12 12 12 12 12 &a860 12 12 12 12 12 12 12 12 0e 04 4c 12 0e 04 4c 12 &a870 0e 04 4c 3e 13 62 5e 5e 5e 5e 27 1b 1b 1b 1b 1b &a880 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 88 2f 29 04 91 bf &a890 04 04 04 04 69 69 69 69 69 bf 92 69 04 69 69 69 &a8a0 69 04 69 69 04 69 04 69 0d 84 65 65 65 65 a1 1c &a8b0 32 1b 0b 1c 1c 1c 1c 1c 04 07 04 1c 5e 5e 41 cb &a8c0 3d cc 3c 5e 5e 1c 04 07 04 1c 1c 1c 1c 27 1b 2c &a8d0 1e 5e 5e 5e 5e 29 04 bf 04 04 04 04 04 04 04 04 &a8e0 bf 04 04 1c 1c 1c 1c 04 bf 4b 0d 04 04 4b 0d 04 &a8f0 04 4b 0d 04 4b 29 5e 5e 5e 5e a4 1b 1b 1b 1b 1b &a900 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 1c 1c 1c ad 08 &a910 df dd de 1c ad 1c ad 1c ad 57 1c 1c 0b ad 1c ad &a920 1c 5f 60 1c ad 1c 0b 64 1d 63 64 5f 64 63 a1 1c &a930 27 40 67 67 67 67 67 67 29 05 84 67 67 67 a0 cb &a940 3d cc a1 67 67 67 02 05 50 67 67 67 67 67 1b a5 &a950 0e d7 2f 2f 2f 0b 1c 57 1c 0b 3b 42 0b 3b 42 0b &a960 08 1c 1c 1c 1c 1c 1c 1c 57 ad 1c ad 0b ad 1c ad &a970 1c ad 1c ad 1c 27 28 2f 2f 2f a1 1b 1b 1b 1b 1b &a980 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 29 04 04 04 04 bf &a990 92 04 04 07 04 07 04 04 91 bf 04 04 90 04 c4 c3 &a9a0 c5 04 bf c4 c3 c5 90 69 0d 69 04 69 04 69 5b 07 &a9b0 04 3f 4e 1b 1b 1b 1b 1b 0b 37 27 1b 1b 1b a0 cb &a9c0 3d cc a1 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 59 &a9d0 04 d8 04 bf 04 90 91 04 04 90 4f 4f 29 4f 4f 90 &a9e0 bf 92 04 1c 1c 1c 04 99 04 04 04 04 90 04 04 04 &a9f0 04 04 04 04 04 84 0d 04 04 07 5b 1b 1b 1b 1b 1b &aa00 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 3b 42 df 1c 57 &aa10 ad 27 1c 05 04 05 1c 0b ad 08 1c 1c dd de df dd &aa20 de 1c 08 1c 1c df dd de 15 12 12 38 dd de 1d 06 &aa30 27 1b 49 1b 1b 1b 1b 40 0b 1c 27 1b 1b 1b a0 cb &aa40 3d cc a1 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b a0 &aa50 1c 1c 1c 57 1c 0b 1c 1c 1c 1c 1c 1c 0b 1c ad 0b &aa60 08 1c 1c 1c 1c 1c 1c 57 1c 0b 1c ad 1c ad 0b 1c &aa70 ad 1c ad df ad df 1d dd de 06 a1 1b 1b 1b 1b 1b &aa80 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 29 4f 4f 04 91 04 &aa90 04 84 ac ac ac ac ac 29 04 04 92 04 04 04 04 04 &aaa0 04 04 04 92 04 04 04 04 04 04 04 0d 04 bf 0d 4b &aab0 84 1f 1f 1f 1f 1f 1f 3f 04 04 84 39 39 39 a0 cb &aac0 3d cc a1 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 59 &aad0 bf 04 91 04 04 90 04 04 04 04 04 04 29 b8 04 90 &aae0 04 92 04 04 04 04 91 bf 04 90 04 04 04 04 29 07 &aaf0 04 07 04 04 04 04 0d 04 04 05 5b 1b 1b 1b 1b 1b &ab00 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 7b 78 78 78 78 &ab10 78 78 79 1c 1c 1c 1c dd de dd de 1c df b5 b5 b5 &ab20 b5 b5 b5 ad df ad b5 b5 0b b6 b6 1d b6 08 15 12 &ab30 12 12 12 12 12 12 62 11 12 5e 5e 5e 11 12 5c cb &ab40 3d cc 61 12 12 12 12 12 12 12 12 12 12 12 12 3e &ab50 94 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &ab60 12 12 12 12 12 12 12 94 12 12 12 12 12 12 62 13 &ab70 62 12 62 12 12 12 0e 1c 0b 06 a1 1b 1b 1b 1b 1b &ab80 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 29 7c bf 04 57 2f &ab90 2f 2f 2f 2f 2f 2f 08 04 04 04 04 04 bf b7 b7 b7 &aba0 b7 b7 b7 04 04 04 b7 b7 29 b7 b7 0d b7 04 92 04 &abb0 04 04 04 04 04 bf 0b 15 12 5e 5e 5e 0e 1c 0b cb &abc0 3d cc 27 04 04 04 04 04 04 04 04 bf 04 04 04 91 &abd0 04 04 04 04 04 04 04 bf 04 04 04 04 04 04 04 04 &abe0 04 04 04 04 04 04 91 04 04 04 04 04 04 04 29 07 &abf0 29 04 29 04 04 04 07 04 0b 06 a1 1b 1b 1b 1b 1b &ac00 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 7a 08 df 1c 0f &ac10 0a 0a 0a 0a 0a 10 1c df dd de 1c ad 08 56 b5 56 &ac20 b5 56 b5 ad ad ad 56 56 0b dd de 1d dd de ad dd &ac30 de df dd de 0b 08 1c 1c 2f 2f 2f 2f 2f 1c 0b cb &ac40 3d cc 27 3b 42 1c df 0b 1c ad 1c 57 1c 0b ad df &ac50 1c ad ae ae 0b dd de 08 1c dd de d6 d6 d6 dc d6 &ac60 d6 d6 d6 d6 d6 d6 d6 d6 dc d6 d6 d6 d6 d6 dc 06 &ac70 d6 d6 d6 d6 d6 d6 06 d6 dc 06 a1 1b 1b 1b 1b 1b &ac80 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 29 7c 04 9a 1c 0c &ac90 09 03 0c 09 03 0c 1c 04 04 bf 04 04 04 92 66 b7 &aca0 66 b7 66 5a 5a 5a 75 75 75 75 75 75 75 75 75 75 &acb0 75 75 75 70 29 04 92 04 04 bf 04 04 04 04 0b cb &acc0 3d cc 27 4f 4f 04 04 90 bf 04 91 04 04 90 04 04 &acd0 04 04 04 04 29 04 04 04 92 04 04 bf 04 04 90 04 &ace0 04 04 04 04 04 04 04 04 90 04 bf 04 04 04 29 4b &acf0 04 04 04 04 04 04 05 04 0b 06 a1 1b 1b 1b 1b 1b &ad00 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 3b 42 08 1c 25 &ad10 35 25 26 25 35 26 1c 1c 1c 57 b5 56 b5 56 b5 56 &ad20 b5 56 b5 2f 2f 2f 2f 68 2f 2f 2f 28 2f 2f 2f 2f &ad30 2f 2f 2f 77 9f 68 1c ad 1c 08 1c dd de 68 6c cb &ad40 3d cc 36 21 9f 1c 1c 1c 57 1c ad 1c 0b 1c dd de &ad50 1c 0b 1c 1c 0b dd de df 27 3b 42 08 d1 d1 d1 d1 &ad60 d1 d1 d1 d1 d1 d9 d1 d1 d1 d1 08 1c 1c 1c 0b dd &ad70 de 1c 1c dd de df 06 1c 0b 06 a1 1b 1b 1b 1b 1b &ad80 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 29 4f 4f 04 92 0a &ad90 0a 0a 39 0a 0a 0a 04 04 91 b7 66 b7 66 b7 66 b7 &ada0 66 b7 66 b7 66 b7 66 22 04 b7 b7 0d b7 b7 b7 b7 &adb0 b7 b7 b7 70 04 22 04 04 04 04 92 04 04 22 04 04 &adc0 3d 04 04 20 04 04 04 91 04 04 04 04 90 bd 04 04 &add0 04 90 04 04 90 c3 c5 c5 84 4f 4f 04 92 d2 d2 d2 &ade0 d2 bd d2 bd d2 d2 bd d2 d2 d2 d2 92 04 04 90 04 &adf0 04 04 04 04 04 04 4b 04 29 05 5b 1b 1b 1b 1b 1b &ae00 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b df 1e 12 12 12 &ae10 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &ae20 12 12 12 12 12 12 12 12 12 12 12 3e 12 12 12 12 &ae30 12 12 12 77 12 12 12 12 12 12 12 12 12 68 df cb &ae40 3d 6a 11 12 11 11 12 12 12 12 12 12 12 12 12 12 &ae50 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &ae60 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &ae70 12 12 12 12 12 12 12 12 11 13 a2 1b 1b 1b 1b 1b &ae80 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 02 04 0d b7 d4 d4 &ae90 07 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 &aea0 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 &aeb0 d4 d4 d4 70 d4 d4 d4 d4 d4 d4 d4 d4 b7 22 04 04 &aec0 3d 04 af 04 0d 0d d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 &aed0 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 &aee0 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 &aef0 d2 d2 d2 d2 07 d2 d2 d2 0d 4b 50 1b 1b 1b 1b 1b &af00 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 02 5e 5e 38 df &af10 06 1c cd cd cd cd cd cd cd cd cd cd cd cd cd cd &af20 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd &af30 cd cd cd cd cd cd cd cd cd cd 1c 24 1c 68 df cb &af40 3d cc 1c 21 1c cd cd cd cd cd cd cd cd cd cd cd &af50 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd &af60 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd &af70 cd cd cd 1c 06 1c 1e 5e 5e 50 1b 1b 1b 1b 1b 1b &af80 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 02 2f 28 08 &af90 05 57 ce ce ce ce ce ce ce ce ce ce ce ce ce ce &afa0 ce ce ce ce ce ce ce ce ce ce ce ce ce ce ce ce &afb0 ce ce ce cf ce ce ce ce ce ce 08 23 04 22 04 04 &afc0 3d 04 04 20 57 ce ce ce ce ce ce ce ce ce ce ce &afd0 ce ce ce ce ce ce ce ce ce ce ce ce ce ce ce ce &afe0 ce ce ce ce ce ce ce ce ce ce ce ce ce ce ce ce &aff0 ce ce ce 08 05 57 28 2f 50 1b 1b 1b 1b 1b 1b 1b &b000 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b a5 3e 12 &b010 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b020 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b030 12 12 12 77 12 12 12 12 12 12 13 12 12 68 df cb &b040 3d cc 27 38 1e 38 1e 12 12 12 12 12 12 12 12 12 &b050 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b060 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b070 12 12 12 12 13 12 3e a4 1b 1b 1b 1b 1b 1b 1b 1b &b080 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1f 1f 1f 59 04 04 &b090 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 &b0a0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 &b0b0 04 04 04 70 04 07 04 04 04 04 4b 04 04 22 04 04 &b0c0 3d cc 27 0d 0d 0d 0d d4 d4 d4 d4 d4 d4 d4 d4 d4 &b0d0 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 &b0e0 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 d4 &b0f0 d4 d4 d4 d4 4b d4 d4 5b 1f 1f 1f 1b 1b 1b 1b 51 &b100 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 04 04 15 12 12 &b110 13 12 12 12 12 12 12 11 12 12 12 12 12 12 12 12 &b120 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b130 12 12 12 77 12 13 12 12 12 12 12 12 12 11 0b cb &b140 3d cc 27 5d 1d 1d 4c 62 12 12 12 12 12 12 12 12 &b150 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b160 12 12 12 12 11 5e 5e 5e 12 12 12 12 12 12 12 12 &b170 12 12 12 12 12 12 12 0e 1c 1c 27 1b 1b 1b 1b d0 &b180 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 1e 12 13 12 12 &b190 13 12 3a 12 3a 5e 12 14 12 12 12 77 75 75 6e 6e &b1a0 75 75 75 75 75 75 75 75 5a 5a 75 75 75 75 75 75 &b1b0 75 75 75 77 1c 06 1c 1c 1c 1c 1c 1c 1c 1d 0b cb &b1c0 3d cc 27 5e 5e 5e 5e 29 d2 d2 d2 d2 d2 bf d2 d2 &b1d0 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 &b1e0 bf d2 d2 57 28 2f 2f 2f 2f 08 d2 d2 07 d2 d2 d2 &b1f0 d2 d2 d2 d2 d2 d2 d2 d2 d2 d2 84 1b 1b 1b 1b d0 &b200 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 0b 1c 04 05 57 2f &b210 2f 2f 2f 76 28 28 2f 28 2f 2f 76 71 2f 2f 2f 2f &b220 2f 2f 2f 2f 2f 76 2f 2f 2f 88 2f 2f 87 76 2f 2f &b230 2f 2f 2f 2f 2f 2f 2f 2f 87 2f 2f 2f 2f 1d 0b cb &b240 3d cc 27 5e 5e 5e 5e 0b dd de 1c df 1c 57 1c dd &b250 de 1c 1c dd de 1c 1c dd de 1c 0b 1c dd de 1c 1c &b260 57 df 1c 1c 1d 1c 1c 1c 1c 1c 0b 1c 37 1c 1c 1c &b270 1c 1c 1c 1c 1c 1c 1c 1c 24 1c 27 1b 1b 1b 1b d0 &b280 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1a 1b 19 05 c2 c1 &b290 c1 c1 c1 05 4c 0e 07 0d 04 57 76 71 08 04 04 04 &b2a0 57 2f 2f 2f 08 4b 57 2f 2f 0b 1c 1c 27 4b b7 07 &b2b0 b7 b7 b7 b7 07 b7 b7 b7 84 1c 1c 1c 1c 1d 0b cb &b2c0 3d cc 27 5e 5e 5e 5e 29 04 04 04 04 91 04 04 04 &b2d0 04 04 bf 04 04 04 04 04 04 04 29 bf 04 04 04 91 &b2e0 04 04 04 04 0d 04 04 04 04 04 90 1c 1c 1c 1c 1c &b2f0 bc 1c 1c 1c 1c be 1c 07 23 04 50 1b 1b 1b 1b da &b300 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1a 19 06 15 3e &b310 3e 3e 3e 13 14 12 13 14 12 12 13 77 75 75 75 75 &b320 5a 5a 75 75 75 75 75 75 75 75 5a 5a 75 75 75 6f &b330 75 77 dd de 06 dd de df 1c 1e 12 5e 5e 0e 0b cb &b340 3d cc 3c 5e 5e 5e 5e 62 38 1c 1c dd de df dd de &b350 1c 1c 57 1c 0b dd de 1c dd de 1c 08 1c df dd de &b360 1c 0b 1c 1c 1d 1c 1c 1c 1c 1c 1c 2f 2f 2f 2f 2f &b370 2f 2f 2f 2f 2f 2f 2f 06 27 50 1b 1b 1b 1b 1b da &b380 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 18 17 17 17 &b390 17 17 17 17 16 04 04 0d 04 04 4b 04 04 04 04 57 &b3a0 2f 2f 08 07 04 04 04 04 04 57 2f 2f 08 04 04 05 &b3b0 04 70 04 04 4b 04 04 04 04 0d 57 2f 2f 2f 0b cb &b3c0 3d cc a1 2f 2f 2f 2f 08 0d 04 04 04 04 04 bf 04 &b3d0 04 91 04 04 29 04 04 bf 04 04 04 04 92 04 04 04 &b3e0 04 29 04 bf 0d 04 04 04 00 00 00 00 00 00 00 00 &b3f0 00 00 00 00 00 00 00 00 8d 44 45 1b 1b 1b 1b da &b400 c9 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b410 1b 1b 1b 1b 1b 02 b6 5e 5e 62 12 12 12 12 12 12 &b420 12 12 12 13 12 12 12 12 12 12 24 12 12 12 12 13 &b430 12 77 75 75 6e 6e 6e 75 75 75 75 75 75 75 77 cb &b440 3d cc 36 21 9f 1c 1c 1c 15 12 12 12 12 12 94 12 &b450 62 12 12 12 12 12 12 93 12 12 12 12 12 12 12 12 &b460 12 12 12 94 0e 27 1c 50 1b 1b 1b 1b 1b 1b 1b 1b &b470 1b 1b 1b 1b 1b 1b 1b 1b 1b d0 c9 51 51 51 51 da &b480 c6 45 51 51 1b 1b 1b 1b 51 51 1b 1b 1b 1b 1b 1b &b490 1b 1b 1b 1b 1b 1b 02 5e 5e 29 04 04 04 04 04 04 &b4a0 04 04 04 4b 04 04 04 04 04 04 23 04 04 04 04 4b &b4b0 04 04 04 57 2f 2f 2f 2f 2f 2f 2f 2f 2f 87 77 cb &b4c0 3d 04 04 20 07 04 04 04 04 04 04 04 04 91 04 04 &b4d0 29 04 04 04 04 04 04 04 92 04 04 04 04 04 04 04 &b4e0 04 04 91 04 04 84 50 1b 1b 1b 1b 1b 1b 1b 1b 1b &b4f0 1b 1b 1b 1b 1b 1b 1b 1b 1b 46 43 43 43 43 da da &b500 43 c6 c6 c7 c8 c8 c8 c8 c8 c9 51 1b 1b 1b 1b 1b &b510 1b 1b 1b 1b 1b 1b 1b 01 00 00 00 00 00 00 00 00 &b520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &b530 00 00 00 00 00 00 00 00 00 00 00 00 00 89 77 cb &b540 3d cc a1 1c 06 27 00 00 00 00 00 00 00 00 00 00 &b550 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &b560 00 00 00 00 00 8d 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b570 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 46 db 43 43 b4 da &b580 c7 c6 c7 43 c6 c7 c6 43 43 c6 c9 1b 1b 1b 1b 1b &b590 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b5a0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b5b0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 85 77 cb &b5c0 3d cc a1 1c 06 27 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b5d0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b5e0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b5f0 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b b4 da 43 da da &b600 c7 43 c6 c6 c6 43 43 c6 c7 43 c9 1b 1b 1b 1b 1b &b610 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 44 &b620 45 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b630 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 85 77 cb &b640 3d cc a1 24 06 27 40 1b 1b 1b 1b 1b 1b 1b 1b 1b &b650 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b660 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b &b670 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b b4 da db b4 da &b680 c6 c6 c7 43 c7 c6 c6 c6 c6 c7 43 45 48 48 48 48 &b690 48 48 48 48 48 48 48 48 48 48 48 48 48 44 4a d0 &b6a0 43 45 48 48 48 48 48 48 48 48 48 48 48 48 48 48 &b6b0 48 48 48 48 48 48 48 48 48 48 48 48 48 85 77 cb &b6c0 3d cc a1 23 4b 04 3f 1f 1f 48 48 48 48 48 48 48 &b6d0 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 &b6e0 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 &b6f0 48 48 48 48 48 48 48 48 48 48 48 da db b4 da da &b700 43 c6 c6 c6 43 c7 43 b3 c6 c7 43 c6 43 c7 43 c6 &b710 43 c6 c7 43 c6 c7 43 43 ca ca ca ca ca 47 49 46 &b720 47 ba 46 c7 43 c6 c7 c6 c6 c6 c7 43 c6 c7 43 c6 &b730 43 c6 43 c7 43 c7 c6 c7 43 c7 43 c7 c6 c9 77 cb &b740 3d cc db 55 b1 54 db b4 da db b4 d3 55 bb b1 bb &b750 bb b1 b1 bb 54 da db b4 d3 55 bb b1 b1 b1 54 da &b760 b4 db b4 da 55 b1 bb b1 54 da 55 b1 bb bb b4 db &b770 da b1 b4 db da db da db b4 d3 db d3 b4 db b4 da &b780 c6 c7 43 c6 43 43 47 1b 46 43 ca 47 b3 b3 46 c7 &b790 c6 ca ca ca ca ca ca 47 1b 1b 1b 1b 1b 1b 49 1b &b7a0 1b 24 1b d0 c6 c7 ca ca c7 43 c6 c7 43 c6 c7 43 &b7b0 c6 c7 c6 c6 c7 43 c6 c6 c6 c6 c7 43 c7 c9 77 cb &b7c0 3d cc da 12 12 12 82 83 83 83 83 82 12 12 12 12 &b7d0 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b7e0 12 12 12 12 12 12 12 12 12 12 12 12 12 12 14 14 &b7f0 3e 38 54 da d3 b4 da d3 b4 da b4 b4 db b4 da da &b800 c6 43 c6 c7 43 43 45 51 1b b3 1b 1b 1b 1b 1b 46 &b810 47 1b 1b 1b 1b 1b 1b 1b 1b 44 c8 c8 c8 c8 c8 c8 &b820 73 23 72 47 ba ba a6 a7 ba ba ba ba ba ba ba ba &b830 ba ba ba ba ba ba ba ba ba ba ba ba b3 46 77 cb &b840 3d cc b4 12 12 11 82 83 83 83 83 82 12 12 12 12 &b850 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 &b860 12 12 12 12 12 12 12 12 12 12 12 12 12 12 14 14 &b870 38 14 11 14 38 54 db b4 db b4 d3 b4 b4 da db da &b880 43 c6 c6 c6 43 43 43 47 1b 1b 39 1b 1b 4e 1b 1b &b890 1b 1b 1b 44 c8 c8 c8 c8 c8 43 c6 43 43 43 43 c7 &b8a0 43 43 c9 39 c0 39 a8 a8 39 39 39 39 39 c0 39 39 &b8b0 39 39 c0 39 39 39 39 39 c0 39 39 1b 1b 44 77 cb &b8c0 3d cc db 12 12 0e 7f 81 81 81 81 80 1c 1c 1c 1c &b8d0 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c &b8e0 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 04 04 04 bf 04 &b8f0 0d 0d 0d 0d 15 38 3b 42 d3 db da da b4 da db da &b900 c6 c7 c6 43 43 43 47 1b 1b 72 47 1b 1b 49 73 1b &b910 1b 1b 44 43 c6 47 b9 ba ba b9 ba b3 b3 ba b3 1b &b920 b3 b3 ba ba 98 1b 1b 1b 1b 1b 1b 1b 1b 97 1b 1b &b930 1b 1b 97 1b 1b 1b 1b 1b 98 1b 1b 1b 39 d0 77 cb &b940 3d 04 04 04 04 1c 1c 8b 1c 1c 8b 1c 1c 04 04 04 &b950 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 &b960 04 04 04 04 04 1c 1c 1c 1c 1c 57 1c 1c 1c 57 1c &b970 0d 0d 0d 0d 92 0d 4f 4f da da d3 b4 db b4 da da &b980 c7 c6 43 c6 43 43 45 4e 72 c6 51 51 44 c8 b3 d5 &b990 1b 44 43 b3 b3 1b 1b 39 39 39 39 39 39 39 39 39 &b9a0 39 39 39 95 39 39 39 39 1b 1b 1b 1b 1b 1b 96 39 &b9b0 c0 39 39 96 39 39 c0 95 39 39 39 39 39 75 77 cb &b9c0 3d cc 55 bb 1c 08 1c 8b 1c 1c 8b 1c 9b b4 da d3 &b9d0 bb bb b4 da b4 da b4 db d3 b4 b4 db b4 da d3 da &b9e0 db d3 da b4 db 9c 07 04 bf 91 04 04 bf 91 04 91 &b9f0 4c 86 83 83 86 5d 08 1c 54 d3 db da da db b4 da &ba00 c6 43 c6 c7 43 43 47 49 46 c6 43 c8 ca ca 45 1b &ba10 1b 46 b3 1b 1b 1b 72 ca c7 c6 43 c6 c7 43 c6 43 &ba20 c7 c6 43 c7 c6 43 c7 c6 73 39 39 1b 1b 1b 1b 1b &ba30 98 1b 1b 1b 1b 1b 97 1b 1b 1b 1b 1b 1b 46 c9 cb &ba40 3d cc 53 07 04 04 92 8c 04 04 8c 9b db d3 b1 b1 &ba50 1c 1c b1 da da b4 d3 55 bb bb 54 55 b1 b1 bb bb &ba60 b1 bb bb b1 54 b4 06 da 9c 1c ad 1c 08 1c 1c 1e &ba70 3e 86 83 83 86 0e 1c 92 04 54 b4 d3 b4 da db da &ba80 c7 c6 c7 c6 43 c9 1b 49 44 43 c6 c9 a6 a7 b3 1b &ba90 1b 1b 1b 1b 39 95 39 4e d0 c7 c6 43 c7 43 c6 c7 &baa0 43 c7 c6 43 c6 c7 43 c6 c6 c7 43 73 39 39 c0 95 &bab0 39 39 39 39 39 39 39 96 39 c0 39 39 39 44 c9 cb &bac0 3d cc da 06 1c 1c 54 da da 55 bb 54 da 55 1c 1c &bad0 1c 53 1c 54 b4 55 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c &bae0 1c 1c 1c 1c 1c 1c 52 b4 da 9c 04 04 04 92 bf 0d &baf0 7d 81 83 83 81 7e 91 bf 04 04 d3 db da b4 db da &bb00 43 c7 c7 43 c6 43 45 1b 46 b3 46 b3 a8 a8 39 39 &bb10 39 c0 39 72 43 c6 c8 4a b3 46 c6 47 b3 46 47 ba &bb20 ba ba ba 46 47 ba ba ba 46 ca 43 c6 c7 43 73 1b &bb30 1b 1b 1b 1b 1b 1b 1b 1b 1b 98 1b 1b 1b 40 6d cb &bb40 3d cc db 53 1c 1c 1c 54 b4 1c 1c 1c 1c 1c 1c 1c &bb50 1c 54 53 1c 1c 1c 52 b4 d3 bb bb da d3 55 bb db &bb60 53 1c 52 b4 da db da da b4 da 55 1c 1c 1c 57 15 &bb70 82 81 83 83 81 82 1c 08 1c 1c 54 da db da da da &bb80 c6 c6 c7 c7 43 c9 b3 d5 c0 39 39 1b 1b 39 39 c0 &bb90 39 72 43 ca ca ca 47 49 1b 1b b3 1b 1b 1b 1b 1b &bba0 44 c8 45 1b 1b 1b 1b 1b 1b 1b 46 ca 43 c7 c6 73 &bbb0 39 39 39 39 39 c0 39 39 95 39 39 39 39 3f 04 04 &bbc0 3d cc b4 da d3 1c 53 1c 1c 1c 1c 1c 52 53 1c 1c &bbd0 1c 1c 54 da db bb bb 55 07 1c 07 04 04 04 07 54 &bbe0 da b4 da db bb bb bb b4 db da 53 04 bf 91 04 d4 &bbf0 8a 8a 8a 8a 8a 8a d4 04 92 bf 04 db b4 db b4 da &bc00 c7 43 c6 c6 c7 c9 1b 1b 72 47 ba d5 98 1b 1b 72 &bc10 c6 ca 47 1b 1b 1b 1b 49 1b 1b 1b 1b b2 1b 1b 44 &bc20 c7 c6 43 c8 d5 1b 44 45 1b 1b 1b 1b 46 ca 43 c9 &bc30 a6 a7 1b 1b 1b 98 46 b3 b3 43 c6 c7 43 c6 c9 cb &bc40 3d cc da da db 1c 54 da a3 1c 76 b4 da db 74 db &bc50 bb bb 53 55 bb 1c 1c 1c 06 1c 06 bb b1 b1 06 24 &bc60 b4 b4 b4 55 1c 1c 1c 54 b4 db 3b 42 08 1c 1c 86 &bc70 83 83 83 83 83 83 86 1c 1c 57 54 b4 da b4 b4 da &bc80 c6 c7 c6 43 c6 43 45 1b b3 1b 39 95 39 39 72 ca &bc90 47 1b 1b 44 c8 c8 4a c8 45 48 44 c8 c8 c8 c8 43 &bca0 c6 c6 43 c9 51 51 d0 c9 d5 1b 44 45 1b 1b 46 c9 &bcb0 a8 a8 39 39 95 c0 39 39 44 c7 43 c6 c7 c7 c9 cb &bcc0 3d cc db b4 55 1c 1c bb b0 1c 52 db da b4 bb 55 &bcd0 1c 1c 54 53 1c 1c 1c 1c 06 1c 06 1c 1c 1c 4b 23 &bce0 54 55 bb 1c 1c 52 53 1c da b4 4f 4f 04 92 bf d4 &bcf0 8a 8a 8a 8a 8a 8a d4 bf 91 04 52 da da db da da &bd00 43 c7 43 c6 c7 43 c9 1b 4e 72 47 ba ba ba 1b 1b &bd10 1b 44 c8 c7 43 c9 49 d0 c6 c8 c6 43 c7 c6 43 c6 &bd20 c7 43 c6 c7 43 c7 43 c9 1b 1b d0 43 45 1b 1b d0 &bd30 43 47 1b 1b 1b 97 1b 1b 46 43 c6 c7 43 c6 c9 cb &bd40 3d cc b4 55 1c 1c 1c 1c 1c 52 b4 bb bb 55 1c 1c &bd50 1c 1c 1c da 76 1c 52 53 1c 1c 1c 1c 52 53 1c 1c &bd60 1c 1c 1c 1c 76 da 55 1c b4 db 3b 42 1c 1c 57 86 &bd70 83 83 83 83 83 83 86 08 1c 1c 54 db b4 da db da &bd80 c6 c6 c7 c6 c7 c6 c9 72 49 b3 1b 4e 39 1b 44 c8 &bd90 c8 c7 43 47 b3 b3 49 b3 b3 46 43 43 47 b3 c9 46 &bda0 43 c7 47 ba ba 46 c6 c9 51 51 d0 c7 c9 1b 1b d0 &bdb0 c9 4e 44 45 1b 1b 97 1b 1b ba ba ba ba 46 c9 1c &bdc0 3d cc da 07 52 1c 1c 52 d3 da 55 1c 1c 1c 1c 1c &bdd0 52 1c 76 54 53 1c da d3 53 1c 1c 1c 54 db da b4 &bde0 53 1c 1c 1c 06 db 1c 1c 54 b4 4f 4f 04 91 bf d4 &bdf0 82 81 81 81 81 82 d4 04 9a bf 04 b4 da db da da &be00 c7 43 c6 c6 c6 c6 47 b3 49 1b 1b 49 b3 1b d0 c7 &be10 47 d0 b3 1b 1b 1b 49 1b 1b 1b 46 47 1b 1b b3 1b &be20 b3 b3 1b 1b 1b 1b 46 43 47 d0 b3 46 c9 1b 44 c6 &be30 c9 49 46 c9 1b 1b 1b 97 39 c0 39 39 39 44 c9 76 &be40 2f 2f db 06 da 1c 52 55 bb 55 1c 1c 1c 1c 57 76 &be50 db 53 06 1c bb 76 54 db da 53 1c 1c 1c 54 bb db &be60 b4 76 1c 1c 06 54 53 1c 1c 54 b4 db 53 1c 08 1c &be70 7f 81 81 81 81 80 1c 04 04 57 54 da db b4 b4 da &be80 c6 c7 c6 43 c6 c7 45 1b 49 1b 1b 49 1b 1b d0 c9 &be90 1b b3 1b 1b 1b 44 c8 c8 45 1b 1b 1b 1b 1b 1b 1b &bea0 1b 1b 1b 44 45 1b 1b ba 1b b3 1b 1b ba 1b b3 ca &beb0 47 49 44 47 1b 1b 1b 1b 1b 98 1b 1b 46 43 c9 1c &bec0 1c 1c d3 06 db 1c bb 1c 1c 1c 52 1c 76 1c 1c 06 &bed0 b4 d3 53 1c 1c 06 52 d3 b4 da 74 52 53 1c 1c 54 &bee0 da 53 1c 1c 06 52 db b4 53 04 07 b1 bb 53 1c 08 &bef0 1c 8b 8e 8f 8b 1c 9b b4 55 1c 74 db da b4 da da &bf00 c6 43 c6 c7 c6 c6 c7 c8 45 1b 1b 1b 1b 51 d0 c6 &bf10 45 1b 1b 44 c8 43 c6 c7 c6 45 1b 1b 44 c8 c8 45 &bf20 1b 1b 44 c7 43 c8 45 1b 1b 1b 1b 1b 1b 1b 1b 1b &bf30 1b 44 c6 45 39 39 39 39 95 39 39 39 44 c6 c9 53 &bf40 1c 1c 1c 52 da 53 1c 1c 1c 52 db 74 74 74 52 b4 &bf50 d3 db b4 53 52 b4 da db da b4 d3 db da b4 53 1c &bf60 1c 1c 76 1c 52 b4 da d3 da b4 06 1c 1c 1c 1c 04 &bf70 92 8c 9d 9e 8c 9b b4 da 53 52 d3 b4 b4 db da da &bf80 43 c7 43 c7 43 c6 c7 c6 43 c8 c8 c8 c8 c6 c7 43 &bf90 c8 c8 c8 c7 c6 43 c7 43 43 c7 c8 c8 c6 43 c7 43 &bfa0 c8 c8 43 c6 c7 c6 c7 c8 c8 c8 c8 c8 c8 c8 c8 c8 &bfb0 c8 c7 43 c6 c6 c6 c7 c6 c7 43 c7 c6 43 c7 43 da &bfc0 d3 b4 da d3 db b4 da d3 db b4 da d3 db da d3 d3 &bfd0 db da d3 b4 db d3 d3 b4 d3 db da b4 b4 db d3 b4 &bfe0 db da d3 b4 da db d3 b4 db da b4 da db b4 da d3 &bff0 db b4 d3 da db d3 da db b4 da db da db da da da