Ravenskull disassembly ====================== Ravenskull was written by Martin Edmondson and Nick Chamberlain, and was published by Superior Software for the BBC Micro in 1986. It is a scrolling adventure game where the player must collect and use items in a large castle. 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. Superior Interactive sell Ravenskull for modern computers: https://www.superiorinteractive.com/ravenskull/ Technical notes =============== The game has four BASIC loaders, $.LOADER, $.RAVEN, $.CONTROL and $.SKULL. The last of these calls a machine code loader, $.LOAD, which in turn loads the game's main binary, $.MAIN and two data files, $.DATA2 and $.CHRS. $.CHRS contains four sets of character sprites, one of which is copied by $.LOAD. There are unused sprites for each character, including a second treasure item. The game's four levels are stored two tiles to a byte, allowing for sixteen tile types per level. Different tile sprites are used for different levels. The first level is used as the active level, Other levels are swapped in as necessary, and any changes made stored so that they can be undone. Game-play notes =============== The speed and slow scrolls and potions do not affect the rate of health loss. Pokes ===== &3304 = &c9, &3305 = &03, &3306 = &ea jump to any level &1ae3 = &60 player is invulnerable &21c2 = &60 crucifix can be collected without first collecting all the treasure Disassembly =========== ; Minimal BASIC loader 10 MODE 5 20 ?&71=&3C # &38 Warrior, &3c Adventurer, &40 Wizard, &44 Elf 30 ENVELOPE1,0,2,0,8,0,4,60,-71,-1,4,-1,126,81 40 ENVELOPE2,1,2,8,2,2,0,0,-110,-1,6,-2,126,54 50 ENVELOPE3,1,20,54,20,10,5,3,70,-1,0,-1,126,126 60 ENVELOPE4,0,0,0,0,0,0,0,126,-1,-11,-1,97,63 70 VDU23,224,0,0,60,14,54,102,62,0 # &e0 = "a" 80 VDU23,225,0,0,252,102,96,118,60,0 # &e1 = "c" 90 VDU23,226,30,6,62,102,102,118,63,0 # &e2 = "d" 100 VDU23,227,0,0,252,102,110,112,60,0 # &e3 = "e" 110 VDU23,228,0,0,252,102,118,62,6,60 # &e4 = "g" 120 VDU23,229,224,96,102,124,120,108,119,0 # &e5 = "k" 130 VDU23,230,56,24,24,24,24,24,28,0 # &e6 = "l" 140 VDU23,231,0,0,246,126,106,98,115,0 # &e7 = "m" 150 VDU23,232,0,0,252,118,102,102,119,0 # &e8 = "n" 160 VDU23,233,0,0,252,102,102,102,60,0 # &e9 = "o" 170 VDU23,234,0,0,252,118,96,96,112,0 # &ea = "r" 180 VDU23,235,0,0,252,96,60,14,124,0 # &eb = "s" 190 VDU23,236,112,48,124,56,48,48,28,0 # &ec = "t" 200 VDU23,237,0,0,238,102,102,118,63,0 # &ed = "u" 210 VDU23,238,0,0,238,102,102,60,24,0 # &ee = "v" 220 VDU23,239,0,0,238,102,118,62,6,60 # &ef = "y" 230 *RUN LOAD ; $.LOAD 000400 000400 000200 &0400 a9 22 LDA #&22 &0402 85 d1 STA &d1 ; vertical_screen_position &0404 a9 0a LDA #&0a # R10: Cursor start register &0406 8d 00 fe STA &fe00 ; video register number &0409 a9 20 LDA #&20 # Disable cursor &040b 8d 01 fe STA &fe01 ; video register value &040e a9 c8 LDA #&c8 ; Read/Write BREAK/ESCAPE effect &0410 a2 03 LDX #&03 ; Memory cleared on next reset, normal ESCAPE effect &0412 a0 00 LDY #&00 &0414 20 f4 ff JSR &fff4 ; OSBYTE &0417 a2 73 LDX #&73 &0419 a0 05 LDY #&05 ; &0573 = load_data2_string &041b 20 f7 ff JSR &fff7 ; OSCLI # *LOAD DATA2 &041e a2 74 LDX #&74 &0420 a0 05 LDY #&05 ; &0574 = load_data2_string + 1 &0422 20 f7 ff JSR &fff7 ; OSCLI # *OAD DATA2 Bug, or did this once load $.PIC? &0425 a2 89 LDX #&89 &0427 a0 05 LDY #&05 ; &0589 = load_chrs_3800_string &0429 20 f7 ff JSR &fff7 ; OSCLI # *LOAD CHRS 3800 &042c a9 00 LDA #&00 &042e 85 70 STA &70 ; source_address_low &0430 85 72 STA &72 ; target_address_low # &71, target_address_high, is set by BASIC loader &0432 a8 TAY # depending on character chosen by player &0433 a9 58 LDA #&58 &0435 85 73 STA &73 ; target_address_high ; copy_sprites_loop # Copy sprites to &5800-&5bff &0437 b1 70 LDA (&70),Y ; source_address &0439 91 72 STA (&72),Y ; target_address &043b c8 INY &043c d0 f9 BNE &0437 ; copy_sprites_loop &043e e6 71 INC &71 ; source_address_high &0440 e6 73 INC &73 ; target_address_high &0442 a5 73 LDA &73 ; target_address_high &0444 c9 5c CMP #&5c &0446 d0 ef BNE &0437 ; copy_sprites_loop &0448 a2 7f LDX #&7f &044a a0 05 LDY #&05 ; &057f = run_main_string &044c 20 f7 ff JSR &fff7 ; OSCLI # *RUN MAIN (immediately returns, as &123d = 60, RTS) &044f a9 8c LDA #&8c ; Select Tape FS &0451 20 f4 ff JSR &fff4 ; OSBYTE # *TAPE &0454 a2 00 LDX #&00 &0456 a9 1a LDA #&1a ; restore default windows &0458 20 ee ff JSR &ffee ; OSWRCH ; move_one_loop # Copy &6000-&63ff to &0d00-&10ff &045b bd 00 60 LDA &6000,X # &6400-&65ff to &0a00-&0bff &045e 9d 00 0d STA &0d00,X # &6600-&67ff to &0600-&07ff &0461 bd 00 61 LDA &6100,X # &6900-&69ff to &0900-&09ff &0464 9d 00 0e STA &0e00,X &0467 bd 00 62 LDA &6200,X &046a 9d 00 0f STA &0f00,X &046d bd 00 63 LDA &6300,X &0470 9d 00 10 STA &1000,X &0473 bd 00 64 LDA &6400,X &0476 9d 00 0a STA &0a00,X &0479 bd 00 65 LDA &6500,X &047c 9d 00 0b STA &0b00,X &047f bd 00 66 LDA &6600,X &0482 9d 00 06 STA &0600,X &0485 bd 00 67 LDA &6700,X &0488 9d 00 07 STA &0700,X &048b bd 00 69 LDA &6900,X &048e 9d 00 09 STA &0900,X &0491 e8 INX &0492 d0 c7 BNE &045b ; move_one_loop &0494 a2 00 LDX #&00 ; move_two_loop # Copy &5a80-&5aff to &0a00-&0a7f &0496 bd 80 5a LDA &5a80,X # &6c80-&6cff to &0e00-&0e7f &0499 9d 00 0a STA &0a00,X &049c bd 80 6c LDA &6c80,X &049f 9d 00 0e STA &0e00,X &04a2 e8 INX &04a3 e0 80 CPX #&80 &04a5 d0 ef BNE &0496 ; move_two_loop &04a7 a2 00 LDX #&00 ; move_three_loop # Copy &6800-&687f to &0380-&03ff &04a9 bd 00 68 LDA &6800,X # &6a00-&6a7f to &0c80-&0cff &04ac 9d 80 03 STA &0380,X # &6a80-&6aff to &5880-&58ff &04af bd 00 6a LDA &6a00,X # &6b00-&6b7f to &5a80-&5aff &04b2 9d 80 0c STA &0c80,X # &6b80-&6c7f to &5b00-&5bff &04b5 bd 80 6a LDA &6a80,X &04b8 9d 80 58 STA &5880,X &04bb bd 00 6b LDA &6b00,X &04be 9d 80 5a STA &5a80,X &04c1 bd 80 6b LDA &6b80,X &04c4 9d 00 5b STA &5b00,X &04c7 bd 00 6c LDA &6c00,X &04ca 9d 80 5b STA &5b80,X &04cd e8 INX &04ce e0 80 CPX #&80 &04d0 d0 d7 BNE &04a9 ; move_three_loop &04d2 a2 00 LDX #&00 ; move_four_loop # Copy &6880-&68bf to &0100-&013f &04d4 bd 80 68 LDA &6880,X &04d7 9d 00 01 STA &0100,X &04da e8 INX &04db e0 40 CPX #&40 &04dd d0 f5 BNE &04d4 ; move_four_loop &04df a2 00 LDX #&00 ; move_five_loop &04e1 bd 00 6d LDA &6d00,X # Copy &6d00-&6d44 to &0140-&0184 &04e4 9d 40 01 STA &0140,X &04e7 e8 INX &04e8 e0 45 CPX #&45 &04ea d0 f5 BNE &04e1 ; move_five_loop &04ec a0 00 LDY #&00 &04ee 84 72 STY &72 ; address_low &04f0 a9 60 LDA #&60 &04f2 85 73 STA &73 ; address_high ; wipe_loop # Wipe &6000-&7fff (screen memory) &04f4 a9 00 LDA #&00 &04f6 91 72 STA (&72),Y ; address &04f8 c8 INY &04f9 d0 f9 BNE &04f4 ; wipe_loop &04fb e6 73 INC &73 ; address_high &04fd a5 73 LDA &73 ; address_high &04ff c9 80 CMP #&80 &0501 d0 f1 BNE &04f4 ; wipe_loop &0503 a9 0a LDA #&0a &0505 8d 85 01 STA &0185 ; stack_guard &0508 8d 62 fe STA &fe62 ; Data direction register - port B (User) # Set pins 1 and 3 to be outputs, others to be inputs &050b a9 06 LDA #&06 # R6: Vertical displayed register &050d 8d 00 fe STA &fe00 ; video register number &0510 a9 20 LDA #&20 &0512 8d 01 fe STA &fe01 ; video register value &0515 a9 07 LDA #&07 # R7: Vertical sync position &0517 8d 00 fe STA &fe00 ; video register number &051a a9 22 LDA #&22 &051c 8d 01 fe STA &fe01 ; video register value &051f a9 0d LDA #&0d # R13: Displayed screen start address register (low) &0521 8d 00 fe STA &fe00 ; video register number &0524 a9 00 LDA #&00 &0526 8d 01 fe STA &fe01 ; video register value &0529 a9 0c LDA #&0c # B4 = 1 &052b 8d 40 fe STA &fe40 ; System VIA &052e a9 05 LDA #&05 # B5 = 0; set size of screen to be &2000 for scrolling &0530 8d 40 fe STA &fe40 ; System VIA &0533 a9 03 LDA #&03 &0535 8d f8 02 STA &02f8 ; sound_bassline (channel_low) # Set up sound block for bassline &0538 a9 00 LDA #&00 &053a 8d f9 02 STA &02f9 ; sound_bassline + 1 (channel_high) &053d 8d fb 02 STA &02fb ; sound_bassline + 3 (volume_high) &0540 8d fd 02 STA &02fd ; sound_bassline + 5 (pitch_high) &0543 8d ff 02 STA &02ff ; sound_bassline + 7 (duration_high) &0546 a9 04 LDA #&04 &0548 8d fa 02 STA &02fa ; sound_bassline + 2 (volume_low) &054b a2 00 LDX #&00 &054d 86 6d STX &6d ; current_level &054f a9 00 LDA #&00 &0551 85 39 STA &39 ; tune_muted &0553 a9 11 LDA #&11 &0555 85 71 STA &71 ; check_address_high &0557 a0 00 LDY #&00 &0559 84 70 STY &70 ; check_address_high &055b 8c 7e 02 STY &027e ; maximum_completed_level ; checksum_loop # Calculate checksum of &1100-&57ff &055e 51 70 EOR (&70),Y; check_address &0560 c8 INY &0561 d0 fb BNE &055e ; checksum_loop &0563 e6 71 INC &71 ; check_address_high &0565 a6 71 LDX &71 ; check_address_high &0567 e0 58 CPX #&58 &0569 d0 f3 BNE &055e ; checksum_loop &056b c9 60 CMP #&60 &056d f0 01 BEQ &0570 ; checksum_passed &056f 60 RTS ; checksum_passed &0570 4c 00 11 JMP &1100 ; main_entry_point # Jump to start of $.MAIN if checksum passes ; load_data2_string &0573 4c 4f 41 44 20 44 41 54 41 32 0d ; "LOAD DATA2" ; run_main_string &057f 52 55 4e 20 20 4d 41 49 4e 0d ; "RUN MAIN" ; load_chrs_3800_string &0589 4c 4f 41 44 20 43 48 52 53 20 33 38 30 30 0d ; "LOAD CHRS 3800" ; unused &0598 4c 4f 41 44 20 50 49 43 0d ; "LOAD PIC" ; unused &05a1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 &05b0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ; $.MAIN 001100 00123d 004700 ; main_entry_point &1100 20 e5 11 JSR &11e5 ; reset_game &1103 4c 8b 32 JMP &328b ; display_title_screen ; restart_game &1106 20 e5 11 JSR &11e5 ; reset_game &1109 a9 03 LDA #&03 &110b 85 7f STA &7f ; player_lives &110d a9 ff LDA #&ff &110f 85 6a STA &6a ; pocket_object_sprite &1111 85 6b STA &6b ; pocket_object_sprite + 1 &1113 85 6c STA &6c ; pocket_object_sprite + 2 &1115 a9 37 LDA #&37 &1117 85 68 STA &68 ; object_data_address_high &1119 a9 02 LDA #&02 &111b 85 4a STA &4a ; health &111d a9 18 LDA #&18 &111f 85 3b STA &3b ; melody_octave_shift &1121 20 03 12 JSR &1203 ; reset_screen &1124 20 8d 24 JSR &248d ; enable_vsync_events &1127 20 8b 21 JSR &218b ; initialise_bees &112a 4c 0e 2b JMP &2b0e ; level_title_screen ; return_to_game &112d 20 8d 24 JSR &248d ; enable_vsync_events &1130 18 CLC &1131 a5 8d LDA &8d ; player_screen_address_low &1133 69 10 ADC #&10 &1135 85 8d STA &8d ; player_screen_address_low &1137 a5 8e LDA &8e ; player_screen_address_high &1139 69 01 ADC #&01 &113b 10 03 BPL &1140 ; skip_wrap_around &113d 38 SEC &113e e9 20 SBC #&20 ; skip_wrap_around &1140 85 8e STA &8e ; player_screen_address_high &1142 20 73 1d JSR &1d73 ; scroll_onto_game ; main_game_loop &1145 ad 62 fe LDA &fe62 ; Data direction register - port B (User) &1148 cd 85 01 CMP &0185 ; stack_guard # Stop if stack is encroaching on level_title_strings &114b f0 01 BEQ &114e ; stack_not_full &114d 00 BRK ; stack_not_full &114e 20 ff 21 JSR &21ff ; consider_if_time_shaft_open &1151 a5 5d LDA &5d ; changes_offset &1153 85 5e STA &5e ; previous_changes_offset &1155 20 0e 1c JSR &1c0e ; handle_time_door &1158 a5 5e LDA &5e ; previous_changes_offset &115a 85 5d STA &5d ; changes_offset &115c 20 d5 1a JSR &1ad5 ; consider_deadly_tile_contact &115f a5 96 LDA &96 ; player_fraction &1161 d0 18 BNE &117b ; continue_previous_move # Is the player midway through a move? &1163 a5 93 LDA &93 ; player_tile &1165 d0 0a BNE &1171 ; blocked_by_obstacle &1167 20 e3 19 JSR &19e3 ; check_for_player_move &116a 20 65 1a JSR &1a65 ; consider_enter_keypress &116d a5 96 LDA &96 ; player_fraction &116f d0 0a BNE &117b ; continue_previous_move # Has the player just started a new move? ; blocked_by_obstacle &1171 20 77 1c JSR &1c77 ; update_game_with_stationary_player # If not, they're standing still &1174 a9 00 LDA #&00 &1176 85 93 STA &93 ; player_tile &1178 4c 45 11 JMP &1145 ; main_game_loop ; continue_previous_move # If the player was midway through a move, continue it &117b a5 97 LDA &97 ; desired_direction &117d c5 95 CMP &95 ; player_facing &117f f0 26 BEQ &11a7 ; move_through_tile_loop &1181 85 95 STA &95 ; player_facing &1183 c9 00 CMP #&00 &1185 d0 06 BNE &118d ; player_not_moving_right ; player_moving_right &1187 20 02 14 JSR &1402 ; continue_scrolling_screen_right &118a 4c 45 11 JMP &1145 ; main_game_loop ; player_not_moving_right &118d c9 01 CMP #&01 &118f d0 06 BNE &1197 ; player_not_moving_left ; player_moving_left &1191 20 29 16 JSR &1629 ; continue_scrolling_screen_left &1194 4c 45 11 JMP &1145 ; main_game_loop ; player_not_moving_left &1197 c9 02 CMP #&02 &1199 d0 06 BNE &11a1 ; player_moving_down ; player_moving_up &119b 20 65 17 JSR &1765 ; continue_scrolling_screen_up &119e 4c 45 11 JMP &1145 ; main_game_loop ; player_moving_down &11a1 20 b8 18 JSR &18b8 ; continue_scrolling_screen_down &11a4 4c 45 11 JMP &1145 ; main_game_loop ; move_through_tile_loop &11a7 c6 96 DEC &96 ; player_fraction &11a9 d0 0f BNE &11ba ; mid_tile &11ab 20 4f 26 JSR &264f ; plot_objects &11ae 20 bd 29 JSR &29bd ; check_for_position_based_triggers &11b1 20 44 1b JSR &1b44 ; handle_falling_spikes_and_health_loss &11b4 20 6d 22 JSR &226d ; check_for_key_swapping_trigger &11b7 4c 45 11 JMP &1145 ; main_game_loop ; mid_tile &11ba a5 95 LDA &95 ; player_facing &11bc d0 06 BNE &11c4 ; player_not_moving_right ; player_moving_right &11be 20 05 13 JSR &1305 ; move_right &11c1 4c db 11 JMP &11db ; after_move ; player_not_moving_right &11c4 c9 01 CMP #&01 &11c6 d0 06 BNE &11ce ; player_not_moving_left ; player_moving_left &11c8 20 11 15 JSR &1511 ; move_left &11cb 4c db 11 JMP &11db ; after_move ; player_not_moving_left &11ce c9 02 CMP #&02 &11d0 d0 06 BNE &11d8 ; player_moving_down ; player_moving_up &11d2 20 65 16 JSR &1665 ; move_up &11d5 4c db 11 JMP &11db ; after_move ; player_moving_down &11d8 20 c8 17 JSR &17c8 ; move_down ; after_move &11db a5 93 LDA &93 ; player_tile &11dd d0 c8 BNE &11a7 ; move_through_tile_loop &11df 20 7a 1c JSR &1c7a ; update_game_with_moving_player &11e2 4c a7 11 JMP &11a7 ; move_through_tile_loop ; reset_game &11e5 a5 39 LDA &39 ; tune_muted &11e7 85 f7 STA &f7 ; previous_tune_muted &11e9 a9 ff LDA #&ff &11eb 85 f8 STA &f8 ; falling_spikes_timer &11ed a5 6d LDA &6d ; current_level &11ef 85 f6 STA &f6 ; previous_current_level &11f1 a2 00 LDX #&00 &11f3 8a TXA ; wipe_zero_page_loop # Wipe &0000-&009e &11f4 95 00 STA &00,X &11f6 e8 INX &11f7 e0 9f CPX #&9f &11f9 d0 f9 BNE &11f4 ; wipe_zero_page_loop &11fb a5 f6 LDA &f6 ; previous_current_level &11fd 85 6d STA &6d ; current_level &11ff a5 f7 LDA &f7 ; previous_tune_muted &1201 85 39 STA &39 ; tune_muted ; reset_screen &1203 a2 00 LDX #&00 ; write_video_registers_loop &1205 bd f3 12 LDA &12f3,X ; video_register_data &1208 8d 00 fe STA &fe00 ; video register number &120b bd f4 12 LDA &12f4,X ; video_register_data &120e 8d 01 fe STA &fe01 ; video register value &1211 e8 INX &1212 e8 INX &1213 e0 0e CPX #&0e &1215 d0 ee BNE &1205 ; write_video_registers_loop &1217 a2 00 LDX #&00 &1219 86 80 STX &80 ; crtc_screen_low &121b 86 79 STX &79 ; unused # Unused variable &121d 86 82 STX &82 ; screen_start_address_low &121f 86 89 STX &89 ; left_fraction &1221 86 8c STX &8c ; player_nibble &1223 86 95 STX &95 ; player_facing &1225 86 97 STX &97 ; desired_direction &1227 8e 52 03 STX &0352 ; os_bytes_per_line_low # Set to &0100 bytes per line (MODE 5 is usually &0140) &122a 86 93 STX &93 ; player_tile &122c 86 49 STX &49 ; potion_effect &122e e8 INX &122f 86 86 STX &86 ; right_fraction &1231 86 8b STX &8b ; bottom_fraction &1233 86 90 STX &90 ; player_y &1235 e8 INX &1236 86 8a STX &8a ; top_fraction &1238 a9 0c LDA #&0c # &0c00 * 8 = &6000 &123a 85 81 STA &81 ; crtc_screen_high &123c a9 60 LDA #&60 # &123d is entry point of $.MAIN, an immediate return &123e 85 83 STA &83 ; screen_start_address_high &1240 a9 3c LDA #&3c &1242 85 85 STA &85 ; top_right_tile_address_high &1244 a9 1c LDA #&1c &1246 85 84 STA &84 ; top_right_tile_address_low &1248 85 87 STA &87 ; top_left_tile_address_low &124a a9 3b LDA #&3b &124c 85 88 STA &88 ; top_left_tile_address_high &124e a9 18 LDA #&18 &1250 85 8f STA &8f ; player_x &1252 a9 6e LDA #&6e &1254 85 8e STA &8e ; player_screen_address_high &1256 a9 70 LDA #&70 &1258 85 8d STA &8d ; player_screen_address_low &125a a9 9e LDA #&9e &125c 85 91 STA &91 ; player_tile_address_low &125e a9 3b LDA #&3b &1260 85 92 STA &92 ; player_tile_address_high &1262 a9 02 LDA #&02 ; G &1264 8d 03 13 STA &1303 ; logical_colours + 2 &1267 a2 00 LDX #&00 &1269 8e 50 03 STX &0350 ; os_screen_start_address_low &126c 8e 4a 03 STX &034a ; os_text_cursor_address_low &126f a5 6d LDA &6d ; current_level &1271 c9 02 CMP #&02 &1273 d0 05 BNE &127a ; write_logical_colours_loop &1275 a9 03 LDA #&03 ; Y # Level three uses yellow rather than green &1277 8d 03 13 STA &1303 ; logical_colours + 2 ; write_logical_colours_loop &127a a9 13 LDA #&13 &127c 20 ee ff JSR &ffee ; OSWRCH &127f 8a TXA &1280 20 ee ff JSR &ffee ; OSWRCH &1283 bd 01 13 LDA &1301,X ; logical_colours &1286 20 ee ff JSR &ffee ; OSWRCH &1289 a9 00 LDA #&00 &128b 20 ee ff JSR &ffee ; OSWRCH &128e 20 ee ff JSR &ffee ; OSWRCH &1291 20 ee ff JSR &ffee ; OSWRCH &1294 e8 INX &1295 e0 04 CPX #&04 &1297 d0 e1 BNE &127a ; write_logical_colours_loop &1299 a9 03 LDA #&03 &129b 8d 56 03 STA &0356 ; os_screen_memory_map_type &129e a9 0f LDA #&0f &12a0 8d 0a 03 STA &030a ; os_text_window_right &12a3 a9 20 LDA #&20 &12a5 8d 54 03 STA &0354 ; os_screen_memory_length &12a8 a9 60 LDA #&60 &12aa 8d 4e 03 STA &034e ; os_screen_memory_start_high &12ad 8d 4b 03 STA &034b ; os_text_cursor_address_high &12b0 8d 51 03 STA &0351 ; os_screen_start_address_high &12b3 a9 58 LDA #&58 &12b5 8d 20 02 STA &0220 ; evntv_low &12b8 a9 1c LDA #&1c ; &1c58 = event_routine &12ba 8d 21 02 STA &0221 ; evntv_high &12bd a9 01 LDA #&01 &12bf 85 6f STA &6f ; time_door_state &12c1 a9 ff LDA #&ff &12c3 85 4f STA &4f ; energy_drain &12c5 a9 08 LDA #&08 &12c7 85 45 STA &45 ; bee_data_size_per_level # 4 bees on level 1 &12c9 0a ASL A &12ca 85 48 STA &48 ; bee_data_size_per_level + 3 # 8 bees on level 4 &12cc 85 47 STA &47 ; bee_data_size_per_level + 2 # 8 bees on level 3 &12ce a9 c2 LDA #&c2 ; X &12d0 85 3d STA &3d ; key_right &12d2 a9 e1 LDA #&e1 ; Z &12d4 85 4e STA &4e ; key_left &12d6 a9 c8 LDA #&c8 ; * &12d8 85 5c STA &5c ; key_up &12da a9 e8 LDA #&e8 ; ? &12dc 85 3c STA &3c ; key_down &12de a9 34 LDA #&34 &12e0 85 3f STA &3f ; treasure_needed &12e2 a9 4b LDA #&4b &12e4 85 40 STA &40 ; treasure_needed + 1 &12e6 a9 64 LDA #&64 &12e8 85 41 STA &41 ; treasure_needed + 2 &12ea a9 5e LDA #&5e &12ec 85 42 STA &42 ; treasure_needed + 3 &12ee a9 0a LDA #&0a &12f0 85 46 STA &46 ; bee_data_size_per_level + 1 # 5 bees on level 2 &12f2 60 RTS ; video_register_data &12f3 01 20 # R1: horizontal displayed register &12f5 02 2d # R2: horizontal sync position register &12f7 0d 00 # R13: Displayed screen start address register (low) &12f9 0c 0c # R12: Displayed screen start address register (high) &12fb 0f 00 # R15: Memory address of text-cursor (low) &12fd 0e 0c # R14: Memory-address of text-cursor (high) &12fe 0a 20 # R10: Cursor start register ; logical_colours ; K M G B &1301 00 05 02 04 ; move_right &1305 a5 96 LDA &96 ; player_fraction &1307 c9 04 CMP #&04 &1309 d0 30 BNE &133b ; player_midtile_moving_right # Is the player moving onto a new tile? &130b a5 8c LDA &8c ; player_nibble &130d 29 01 AND #&01 &130f 85 70 STA &70 ; tile_nibble &1311 a6 8f LDX &8f ; player_x &1313 e8 INX &1314 a4 90 LDY &90 ; player_y &1316 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_right if tile contains an object &1319 a0 20 LDY #&20 &131b 20 73 1a JSR &1a73 ; consider_tile_player_is_moving_into &131e e0 01 CPX #&01 &1320 d0 17 BNE &1339 ; skip_cask_check # Is the tile a wall or hazard? &1322 a5 93 LDA &93 ; player_tile &1324 c9 0b CMP #&0b ; CASK &1326 f0 01 BEQ &1329 ; consider_pushing_cask_right # If it's not a CASK, the player can't move onto it &1328 60 RTS ; consider_pushing_cask_right &1329 a6 8f LDX &8f ; player_x # Consider the tile two squares to the right &132b e8 INX &132c e8 INX &132d a4 90 LDY &90 ; player_y &132f 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_right if that tile contains an object &1332 20 42 1f JSR &1f42 ; consider_if_player_can_push_cask_right # Leave move_right if the player isn't strong &1335 a9 04 LDA #&04 &1337 85 96 STA &96 ; player_fraction ; skip_cask_check &1339 e6 8f INC &8f ; player_x # Move player onto tile to the right ; player_midtile_moving_right &133b a5 96 LDA &96 ; player_fraction &133d c9 01 CMP #&01 &133f d0 0e BNE &134f ; skip_treasure_check # Is this the final fraction of the move? &1341 18 CLC &1342 a5 91 LDA &91 ; player_tile_address_low # If so, set the player as being on the right tile &1344 69 20 ADC #&20 &1346 85 91 STA &91 ; player_tile_address_low &1348 90 02 BCC &134c &134a e6 92 INC &92 ; player_tile_address_high &134c 20 ab 1a JSR &1aab ; consider_collecting_treasure # and consider it for treasure ; skip_treasure_check &134f 20 dc 20 JSR &20dc ; wait_depending_on_player_speed ; scroll_screen_right &1352 e6 80 INC &80 ; crtc_screen_low # Increase the screen start address by 8 bytes, &1354 d0 0c BNE &1362 ; skip_wrap_around &1356 e6 81 INC &81 ; crtc_screen_high &1358 a5 81 LDA &81 ; crtc_screen_high &135a c9 10 CMP #&10 &135c d0 04 BNE &1362 ; skip_wrap_around &135e a9 0c LDA #&0c # wrapping at the end of screen memory &1360 85 81 STA &81 ; crtc_screen_high ; skip_wrap_around # Push the new screen start address to the CRTC &1362 a9 0c LDA #&0c # R12: Displayed screen start address register (high) &1364 8d 00 fe STA &fe00 ; video register number &1367 a5 81 LDA &81 ; crtc_screen_high &1369 8d 01 fe STA &fe01 ; video register value &136c a9 0d LDA #&0d # R13: Displayed screen start address register (low) &136e 8d 00 fe STA &fe00 ; video register number &1371 a5 80 LDA &80 ; crtc_screen_low &1373 8d 01 fe STA &fe01 ; video register value &1376 18 CLC &1377 a5 82 LDA &82 ; screen_start_address_low # Update the game's version accordingly, &1379 69 08 ADC #&08 &137b 85 82 STA &82 ; screen_start_address_low &137d 90 08 BCC &1387 &137f e6 83 INC &83 ; screen_start_address_high &1381 10 04 BPL &1387 ; skip_wrap_around &1383 a9 60 LDA #&60 # wrapping at the end of screen memory &1385 85 83 STA &83 ; screen_start_address_high ; skip_wrap_around &1387 18 CLC &1388 a5 82 LDA &82 ; screen_start_address_low &138a 69 f8 ADC #&f8 &138c 85 70 STA &70 ; screen_address_low &138e a5 83 LDA &83 ; screen_start_address_high &1390 69 00 ADC #&00 &1392 10 02 BPL &1396 ; skip_wrap_around &1394 a9 60 LDA #&60 ; skip_wrap_around &1396 85 71 STA &71 ; screen_address_high &1398 e6 86 INC &86 ; right_fraction # Move the right edge a fraction of a tile right &139a a5 86 LDA &86 ; right_fraction &139c c9 04 CMP #&04 &139e d0 0f BNE &13af ; not_new_tile_right # Does this put it on a new set of tiles? &13a0 a9 00 LDA #&00 &13a2 85 86 STA &86 ; right_fraction &13a4 18 CLC &13a5 a5 84 LDA &84 ; top_right_tile_address_low # If so, update the address of the top right tile &13a7 69 20 ADC #&20 &13a9 85 84 STA &84 ; top_right_tile_address_low &13ab 90 02 BCC &13af &13ad e6 85 INC &85 ; top_right_tile_address_high ; not_new_tile_right &13af a5 84 LDA &84 ; top_right_tile_address_low &13b1 85 74 STA &74 ; tile_address_low &13b3 a5 85 LDA &85 ; top_right_tile_address_high &13b5 85 75 STA &75 ; tile_address_high &13b7 a5 86 LDA &86 ; right_fraction &13b9 85 76 STA &76 ; tile_fraction &13bb 20 60 14 JSR &1460 ; update_vertical_edge_of_screen &13be e6 89 INC &89 ; left_fraction # Move the left edge a fraction of a tile right &13c0 a5 89 LDA &89 ; left_fraction &13c2 c9 04 CMP #&04 &13c4 d0 0f BNE &13d5 ; not_new_tile_left # Does this put it on a new set of tiles? &13c6 a9 00 LDA #&00 &13c8 85 89 STA &89 ; left_fraction &13ca 18 CLC &13cb a5 87 LDA &87 ; top_left_tile_address_low # If so, update the address of the top left tile &13cd 69 20 ADC #&20 &13cf 85 87 STA &87 ; top_left_tile_address_low &13d1 90 02 BCC &13d5 &13d3 e6 88 INC &88 ; top_left_tile_address_high ; not_new_tile_left &13d5 a5 99 LDA &99 ; scrolling_into_game &13d7 f0 01 BEQ &13da ; not_returning_from_screen # Does the player need plotting? &13d9 60 RTS ; not_returning_from_screen &13da a5 8d LDA &8d ; player_screen_address_low &13dc 85 70 STA &70 ; screen_address_low &13de a5 8e LDA &8e ; player_screen_address_high &13e0 85 71 STA &71 ; screen_address_high &13e2 a9 80 LDA #&80 &13e4 85 72 STA &72 ; sprite_address_low &13e6 a9 5c LDA #&5c ; &5c80 = sprite_space &13e8 85 73 STA &73 ; sprite_address_high &13ea a2 01 LDX #&01 # 4 pixels wide &13ec a0 20 LDY #&20 # 32 pixels high &13ee 20 ae 1b JSR &1bae ; other_sprite_plotter # Wipe left edge of player &13f1 18 CLC &13f2 a5 8d LDA &8d ; player_screen_address_low &13f4 69 08 ADC #&08 &13f6 85 8d STA &8d ; player_screen_address_low &13f8 90 08 BCC &1402 ; continue_scrolling_screen_right &13fa e6 8e INC &8e ; player_screen_address_high &13fc 10 04 BPL &1402 ; continue_scrolling_screen_right &13fe a9 60 LDA #&60 &1400 85 8e STA &8e ; player_screen_address_high ; continue_scrolling_screen_right &1402 a5 8d LDA &8d ; player_screen_address_low &1404 85 70 STA &70 ; screen_address_low &1406 a5 8e LDA &8e ; player_screen_address_high &1408 85 71 STA &71 ; screen_address_high &140a a9 80 LDA #&80 &140c 85 72 STA &72 ; sprite_address_low &140e a9 59 LDA #&59 ; &5980 = sprite_player_right &1410 85 73 STA &73 ; sprite_address_high &1412 a2 04 LDX #&04 # 16 pixels wide &1414 a0 20 LDY #&20 # 32 pixels high &1416 a5 8f LDA &8f ; player_x &1418 29 01 AND #&01 &141a d0 06 BNE &1422 ; plot_regular_sprite &141c 20 5e 19 JSR &195e ; plot_sprite_upside_down # Alternately plot player upside down &141f 4c 25 14 JMP &1425 ; consider_arrow_moving_right ; plot_regular_sprite &1422 20 70 19 JSR &1970 ; plot_sprite # and regularly ; consider_arrow_moving_right &1425 a5 03 LDA &03 ; arrow_timer &1427 f0 12 BEQ &143b ; leave &1429 a5 02 LDA &02 ; arrow_direction &142b d0 08 BNE &1435 ; arrow_not_moving_right &142d c6 03 DEC &03 ; arrow_timer # Make arrow live longer if moving towards it &142f 4c f1 30 JMP &30f1 ; update_arrow &1432 4c 3b 14 JMP &143b ; leave ; arrow_not_moving_right &1435 c9 01 CMP #&01 &1437 d0 02 BNE &143b ; leave &1439 e6 03 INC &03 ; arrow_timer # Make arrow live shorter if moving away from it &143b 60 RTS ; plot_vertical_strip_of_tile &143c a0 00 LDY #&00 ; plot_vertical_strip_of_tile_loop &143e b1 72 LDA (&72),Y ; sprite_address &1440 91 70 STA (&70),Y ; screen_address &1442 c8 INY &1443 c0 08 CPY #&08 &1445 d0 f7 BNE &143e ; plot_vertical_strip_of_tile_loop &1447 a0 00 LDY #&00 &1449 18 CLC &144a a5 72 LDA &72 ; sprite_address_low &144c 69 08 ADC #&08 &144e 85 72 STA &72 ; sprite_address_low &1450 90 02 BCC &1454 &1452 e6 73 INC &73 ; sprite_address_high &1454 e6 71 INC &71 ; screen_address_high &1456 10 04 BPL &145c ; skip_wrap_around &1458 a9 60 LDA #&60 &145a 85 71 STA &71 ; screen_address_high ; skip_wrap_around &145c ca DEX &145d d0 df BNE &143e ; plot_vertical_strip_of_tile_loop &145f 60 RTS ; update_vertical_edge_of_screen &1460 a9 00 LDA #&00 &1462 85 77 STA &77 ; tiles_plotted &1464 a5 8c LDA &8c ; player_nibble &1466 85 78 STA &78 ; tile_nibble ; update_vertical_edge_of_screen_loop &1468 a5 76 LDA &76 ; tile_fraction &146a aa TAX &146b bd cd 14 LDA &14cd,X ; horizontal_sprite_offsets &146e 85 72 STA &72 ; sprite_offset &1470 a0 00 LDY #&00 &1472 a5 78 LDA &78 ; tile_nibble &1474 29 01 AND #&01 &1476 d0 09 BNE &1481 ; use_top_nibble ; use_bottom_nibble &1478 b1 74 LDA (&74),Y ; tile_address &147a 29 0f AND #&0f &147c 0a ASL A &147d aa TAX &147e 4c 8f 14 JMP &148f ; calculate_sprite_address ; use_top_nibble &1481 b1 74 LDA (&74),Y ; tile_address &1483 29 f0 AND #&f0 &1485 4a LSR A &1486 4a LSR A &1487 4a LSR A &1488 aa TAX &1489 e6 74 INC &74 ; tile_address_low &148b d0 02 BNE &148f &148d e6 75 INC &75 ; tile_address_high ; calculate_sprite_address &148f e6 78 INC &78 ; tile_nibble &1491 18 CLC &1492 bd d1 14 LDA &14d1,X ; current_sprite_address_table &1495 65 72 ADC &72 ; sprite_address_low &1497 85 72 STA &72 ; sprite_address_low &1499 bd d2 14 LDA &14d2,X ; current_sprite_address_table + 1 &149c 69 00 ADC #&00 &149e 85 73 STA &73 ; sprite_address_high &14a0 a2 04 LDX #&04 &14a2 a5 77 LDA &77 ; tiles_plotted &14a4 d0 15 BNE &14bb ; not_first_tile &14a6 18 CLC &14a7 a5 72 LDA &72 ; sprite_address_low &14a9 69 10 ADC #&10 &14ab 85 72 STA &72 ; sprite_address_low &14ad a5 73 LDA &73 ; sprite_address_high &14af 69 00 ADC #&00 &14b1 85 73 STA &73 ; sprite_address_high &14b3 a2 02 LDX #&02 &14b5 20 3c 14 JSR &143c ; plot_vertical_strip_of_tile &14b8 4c c4 14 JMP &14c4 ; next_tile ; not_first_tile &14bb c9 08 CMP #&08 &14bd d0 02 BNE &14c1 ; not_last_tile &14bf a2 02 LDX #&02 ; not_last_tile &14c1 20 3c 14 JSR &143c ; plot_vertical_strip_of_tile ; next_tile &14c4 e6 77 INC &77 ; tiles_plotted &14c6 a5 77 LDA &77 ; tiles_plotted &14c8 c9 09 CMP #&09 &14ca d0 9c BNE &1468 ; update_vertical_edge_of_screen_loop &14cc 60 RTS ; horizontal_sprite_offsets &14cd 00 20 40 60 ; current_sprite_address_table &14d1 80 5c ; &5c80 = sprite_space &14d3 00 5c ; &5c00 = sprite_wall_marsh &14d5 00 5d ; &5d00 = sprite_wall_stone &14d7 80 5d ; &5d80 = sprite_spike_turnstile &14d9 00 5e ; &5e00 = sprite_pillar &14db 80 5e ; &5e80 = sprite_coffin &14dd 00 5f ; &5f00 = sprite_wall_triangle_bl &14df 80 5f ; &5f80 = sprite_wall_triangle_br &14e1 00 5b ; &5b00 = sprite_wall_triangle_tl &14e3 80 5a ; &5a80 = sprite_wall_triangle_tr &14e5 80 58 ; &5880 = sprite_door &14e7 80 0c ; &0c80 = sprite_wall_brickwork &14e9 80 0b ; &0b80 = sprite_acid &14eb 00 0b ; &0b00 = sprite_wall_petals &14ed 80 0a ; &0a80 = sprite_wall_splodges &14ef 00 0a ; &0a00 = sprite_treasure ; alternate_sprite_address_table &14f1 80 5c ; &5c80 = sprite_space &14f3 00 5d ; &5d00 = sprite_wall_stone &14f5 00 0d ; &0d00 = sprite_wall_stripes &14f7 80 0d ; &0d80 = sprite_spike_round &14f9 00 10 ; &1000 = sprite_wall_square &14fb 80 5e ; &5e80 = sprite_coffin &14fd 00 5f ; &5f00 = sprite_wall_triangle_bl &14ff 80 5f ; &5f80 = sprite_wall_triangle_br &1501 00 5b ; &5b00 = sprite_wall_triangle_tl &1503 80 5a ; &5a80 = sprite_wall_triangle_tr &1505 80 58 ; &5880 = sprite_door &1507 80 0f ; &0f80 = sprite_cask &1509 00 0f ; &0f00 = sprite_plant &150b 00 0b ; &0b00 = sprite_wall_petals &150d 80 0e ; &0e80 = sprite_earth &150f 00 0a ; &0a00 = sprite_treasure ; move_left &1511 a5 96 LDA &96 ; player_fraction &1513 c9 04 CMP #&04 &1515 d0 4f BNE &1566 ; player_midtile_moving_left # Is the player moving onto a new tile? &1517 a6 8f LDX &8f ; player_x &1519 ca DEX &151a a4 90 LDY &90 ; player_y &151c 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_left if tile contains an object &151f c6 8f DEC &8f ; player_x &1521 38 SEC &1522 a5 91 LDA &91 ; player_tile_address_low # Change the tile address on the assumption of a move &1524 e9 20 SBC #&20 &1526 85 91 STA &91 ; player_tile_address_low &1528 b0 02 BCS &152c &152a c6 92 DEC &92 ; player_tile_address_high &152c a5 8c LDA &8c ; player_nibble &152e 29 01 AND #&01 &1530 85 70 STA &70 ; tile_nibble &1532 a0 00 LDY #&00 &1534 20 73 1a JSR &1a73 ; consider_tile_player_is_moving_into # Leave move_right if tile contains an object &1537 e0 01 CPX #&01 &1539 d0 2b BNE &1566 ; player_midtile_moving_left # Is the tile a wall or hazard? &153b a5 93 LDA &93 ; player_tile &153d c9 0b CMP #&0b ; CASK &153f f0 0e BEQ &154f ; consider_pushing_cask_left # If it's not a CASK, the player can't move onto it ; undo_change_of_tile_address &1541 18 CLC &1542 a5 91 LDA &91 ; player_tile_address_low # Undo previous change to tile address &1544 69 20 ADC #&20 &1546 85 91 STA &91 ; player_tile_address_low &1548 90 02 BCC &154c &154a e6 92 INC &92 ; player_tile_address_high &154c e6 8f INC &8f ; player_x &154e 60 RTS ; consider_pushing_cask_left &154f 20 55 15 JSR &1555 ; consider_pushing_cask_left_subroutine &1552 4c 41 15 JMP &1541 ; undo_change_of_tile_address ; consider_pushing_cask_left_subroutine &1555 a6 8f LDX &8f ; player_x # Consider the tile two squares to the left &1557 a4 90 LDY &90 ; player_y &1559 ca DEX &155a 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_left if that tile contains an object &155d 68 PLA # Remove consider_pushing_cask_left_subroutine from &155e 68 PLA # stack, i.e. don't undo change to tile address on exit &155f 20 87 1f JSR &1f87 ; consider_if_player_can_push_cask_left # Leave move_left if the player isn't strong &1562 a9 04 LDA #&04 &1564 85 96 STA &96 ; player_fraction ; player_midtile_moving_left &1566 a5 96 LDA &96 ; player_fraction &1568 c9 01 CMP #&01 &156a d0 03 BNE &156f ; skip_treasure_check &156c 20 ab 1a JSR &1aab ; consider_collecting_treasure ; skip_treasure_check &156f 20 dc 20 JSR &20dc ; wait_depending_on_player_speed &1572 c6 80 DEC &80 ; crtc_screen_low # Decrease the screen start address by 8 bytes, &1574 a5 80 LDA &80 ; crtc_screen_low &1576 c9 ff CMP #&ff &1578 d0 0c BNE &1586 ; skip_wrap_around &157a c6 81 DEC &81 ; crtc_screen_high &157c a5 81 LDA &81 ; crtc_screen_high &157e c9 0c CMP #&0c &1580 b0 04 BCS &1586 ; skip_wrap_around &1582 a9 0f LDA #&0f # wrapping at the start of screen memory &1584 85 81 STA &81 ; crtc_screen_high ; skip_wrap_around # Push the new screen start address to the CRTC &1586 a9 0c LDA #&0c # R12: Displayed screen start address register (high) &1588 8d 00 fe STA &fe00 ; video register number &158b a5 81 LDA &81 ; crtc_screen_high &158d 8d 01 fe STA &fe01 ; video register value &1590 a9 0d LDA #&0d # R13: Displayed screen start address register (low) &1592 8d 00 fe STA &fe00 ; video register number &1595 a5 80 LDA &80 ; crtc_screen_low &1597 8d 01 fe STA &fe01 ; video register value &159a 38 SEC &159b a5 82 LDA &82 ; screen_start_address_low # Update the game's version accordingly, &159d e9 08 SBC #&08 &159f 85 82 STA &82 ; screen_start_address_low &15a1 b0 0c BCS &15af ; skip_wrap_around &15a3 c6 83 DEC &83 ; screen_start_address_high &15a5 a5 83 LDA &83 ; screen_start_address_high &15a7 c9 60 CMP #&60 &15a9 b0 04 BCS &15af ; skip_wrap_around &15ab a9 7f LDA #&7f # wrapping at the start of screen memory &15ad 85 83 STA &83 ; screen_start_address_high ; skip_wrap_around &15af a5 82 LDA &82 ; screen_start_address_low &15b1 85 70 STA &70 ; screen_address_low &15b3 a5 83 LDA &83 ; screen_start_address_high &15b5 85 71 STA &71 ; screen_address_high &15b7 c6 89 DEC &89 ; left_fraction # Move the left edge a fraction of a tile left &15b9 a5 89 LDA &89 ; left_fraction &15bb c9 ff CMP #&ff &15bd d0 0f BNE &15ce ; not_new_tile_left # Does this put it on a new set of tiles? &15bf a9 03 LDA #&03 &15c1 85 89 STA &89 ; left_fraction &15c3 38 SEC &15c4 a5 87 LDA &87 ; top_left_tile_address_low # If so, update the address of the top left tile &15c6 e9 20 SBC #&20 &15c8 85 87 STA &87 ; top_left_tile_address_low &15ca b0 02 BCS &15ce &15cc c6 88 DEC &88 ; top_left_tile_address_high ; not_new_tile_left &15ce a5 87 LDA &87 ; top_left_tile_address_low &15d0 85 74 STA &74 ; tile_address_low &15d2 a5 88 LDA &88 ; top_left_tile_address_high &15d4 85 75 STA &75 ; tile_address_high &15d6 a5 89 LDA &89 ; left_fraction &15d8 85 76 STA &76 ; tile_fraction &15da 20 60 14 JSR &1460 ; update_vertical_edge_of_screen &15dd c6 86 DEC &86 ; right_fraction # Move the right edge a fraction of a tile right &15df a5 86 LDA &86 ; right_fraction &15e1 c9 ff CMP #&ff &15e3 d0 0f BNE &15f4 ; not_new_tile_right # Does this put it on a new set of tiles? &15e5 a9 03 LDA #&03 &15e7 85 86 STA &86 ; right_fraction &15e9 38 SEC &15ea a5 84 LDA &84 ; top_right_tile_address_low # If so, update the address of the top right tile &15ec e9 20 SBC #&20 &15ee 85 84 STA &84 ; top_right_tile_address_low &15f0 b0 02 BCS &15f4 &15f2 c6 85 DEC &85 ; top_right_tile_address_high ; not_new_tile_right &15f4 18 CLC &15f5 a5 8d LDA &8d ; player_screen_address_low &15f7 69 18 ADC #&18 &15f9 85 70 STA &70 ; screen_address_low &15fb a5 8e LDA &8e ; player_screen_address_high &15fd 69 00 ADC #&00 &15ff 10 02 BPL &1603 ; skip_wrap_around &1601 a9 60 LDA #&60 ; skip_wrap_around &1603 85 71 STA &71 ; screen_address_high &1605 a9 80 LDA #&80 &1607 85 72 STA &72 ; sprite_address_low &1609 a9 5c LDA #&5c ; &5c80 = sprite_space &160b 85 73 STA &73 ; sprite_address_high &160d a2 01 LDX #&01 # 4 pixels wide &160f a0 20 LDY #&20 # 32 pixels high &1611 20 ae 1b JSR &1bae ; other_sprite_plotter # Wipe left edge of player &1614 38 SEC &1615 a5 8d LDA &8d ; player_screen_address_low &1617 e9 08 SBC #&08 &1619 85 8d STA &8d ; player_screen_address_low &161b b0 0c BCS &1629 ; continue_scrolling_screen_left &161d c6 8e DEC &8e ; player_screen_address_high &161f a5 8e LDA &8e ; player_screen_address_high &1621 c9 5f CMP #&5f &1623 d0 04 BNE &1629 ; continue_scrolling_screen_left &1625 a9 7f LDA #&7f &1627 85 8e STA &8e ; player_screen_address_high ; continue_scrolling_screen_left &1629 a5 8d LDA &8d ; player_screen_address_low &162b 85 70 STA &70 ; screen_address_low &162d a5 8e LDA &8e ; player_screen_address_high &162f 85 71 STA &71 ; screen_address_high &1631 a9 00 LDA #&00 &1633 85 72 STA &72 ; sprite_address_low &1635 a9 59 LDA #&59 ; &5900 = sprite_player_left &1637 85 73 STA &73 ; sprite_address_high &1639 a2 04 LDX #&04 # 16 pixels wide &163b a0 20 LDY #&20 # 32 pixels high &163d a5 8f LDA &8f ; player_x &163f 29 01 AND #&01 &1641 d0 06 BNE &1649 ; plot_regular_sprite &1643 20 5e 19 JSR &195e ; plot_sprite_upside_down # Alternately plot player upside down &1646 4c 4c 16 JMP &164c ; consider_arrow_moving_left ; plot_regular_sprite &1649 20 70 19 JSR &1970 ; plot_sprite # and regularly ; consider_arrow_moving_left &164c a5 03 LDA &03 ; arrow_timer &164e f0 14 BEQ &1664 ; leave &1650 a5 02 LDA &02 ; arrow_direction &1652 c9 01 CMP #&01 &1654 d0 08 BNE &165e ; arrow_not_moving_left &1656 c6 03 DEC &03 ; arrow_timer # Make arrow live longer if moving towards it &1658 4c f1 30 JMP &30f1 ; update_arrow &165b 4c 64 16 JMP &1664 ; leave ; arrow_not_moving_left &165e c9 00 CMP #&00 &1660 d0 02 BNE &1664 ; leave &1662 e6 03 INC &03 ; arrow_timer # Make arrow live shorter if moving away from it ; leave &1664 60 RTS ; move_up &1665 a5 96 LDA &96 ; player_fraction &1667 c9 04 CMP #&04 &1669 d0 3e BNE &16a9 ; player_midtile_moving_up # Is the player moving onto a new tile? &166b a6 8f LDX &8f ; player_x &166d a4 90 LDY &90 ; player_y &166f c8 INY &1670 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_up if tile contains an object &1673 a5 8c LDA &8c ; player_nibble &1675 29 01 AND #&01 &1677 d0 02 BNE &167b ; use_same_byte &1679 c6 91 DEC &91 ; player_tile_address_low ; use_same_byte &167b 49 01 EOR #&01 &167d 85 70 STA &70 ; tile_nibble &167f a0 00 LDY #&00 &1681 20 73 1a JSR &1a73 ; consider_tile_player_is_moving_into &1684 e0 01 CPX #&01 # Is the tile a wall or hazard? &1686 d0 1f BNE &16a7 ; skip_cask_check &1688 a5 8c LDA &8c ; player_nibble &168a 29 01 AND #&01 &168c d0 02 BNE &1690 ; use_same_byte_again &168e e6 91 INC &91 ; player_tile_address_low ; use_same_byte_again &1690 a5 93 LDA &93 ; player_tile &1692 c9 0b CMP #&0b ; CASK &1694 f0 01 BEQ &1697 ; consider_pushing_cask_up # If it's not a CASK, the player can't move onto it &1696 60 RTS ; consider_pushing_cask_up &1697 a6 8f LDX &8f ; player_x # Consider the tile two squares up &1699 a4 90 LDY &90 ; player_y &169b c8 INY &169c c8 INY &169d 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_up if that tile contains an object &16a0 20 1d 20 JSR &201d ; consider_if_player_can_push_cask_up # Leave move_up if the player isn't strong &16a3 a9 04 LDA #&04 &16a5 85 96 STA &96 ; player_fraction ; skip_cask_check &16a7 e6 90 INC &90 ; player_y # Move player onto tile above ; player_midtile_moving_up &16a9 a5 96 LDA &96 ; player_fraction &16ab c9 01 CMP #&01 &16ad d0 03 BNE &16b2 ; skip_treasure_check &16af 20 ab 1a JSR &1aab ; consider_collecting_treasure ; skip_treasure_check &16b2 20 dc 20 JSR &20dc ; wait_depending_on_player_speed &16b5 38 SEC &16b6 a5 80 LDA &80 ; crtc_screen_low # Decrease the screen start address by &100 bytes, &16b8 e9 20 SBC #&20 &16ba 85 80 STA &80 ; crtc_screen_low &16bc b0 0c BCS &16ca &16be c6 81 DEC &81 ; crtc_screen_high &16c0 a5 81 LDA &81 ; crtc_screen_high &16c2 c9 0c CMP #&0c &16c4 b0 04 BCS &16ca ; skip_wrap_around &16c6 a9 0f LDA #&0f # wrapping at the start of screen memory &16c8 85 81 STA &81 ; crtc_screen_high ; skip_wrap_around # Push the new screen start address to the CRTC &16ca a9 0c LDA #&0c # R12: Displayed screen start address register (high) &16cc 8d 00 fe STA &fe00 ; video register number &16cf a5 81 LDA &81 ; crtc_screen_high &16d1 8d 01 fe STA &fe01 ; video register value &16d4 a9 0d LDA #&0d # R13: Displayed screen start address register (low) &16d6 8d 00 fe STA &fe00 ; video register number &16d9 a5 80 LDA &80 ; crtc_screen_low &16db 8d 01 fe STA &fe01 ; video register value &16de c6 83 DEC &83 ; screen_start_address_high # Update the game's version accordingly, &16e0 a5 83 LDA &83 ; screen_start_address_high &16e2 c9 5f CMP #&5f &16e4 d0 04 BNE &16ea ; skip_wrap_around &16e6 a9 7f LDA #&7f # wrapping at the start of screen memory &16e8 85 83 STA &83 ; screen_start_address_high ; skip_wrap_around &16ea a5 82 LDA &82 ; screen_start_address_low &16ec 85 70 STA &70 ; screen_address_low &16ee a5 83 LDA &83 ; screen_start_address_high &16f0 85 71 STA &71 ; screen_address_high &16f2 c6 8a DEC &8a ; top_fraction # Move the top edge a fraction of a tile up &16f4 a5 8a LDA &8a ; top_fraction &16f6 c9 03 CMP #&03 &16f8 d0 05 BNE &16ff &16fa c6 8c DEC &8c ; player_nibble # into other tile if necessary &16fc 4c 1d 17 JMP &171d ; not_new_tile_top &16ff c9 ff CMP #&ff &1701 d0 1a BNE &171d ; not_new_tile_top # Does this put it on a new set of tiles? &1703 c6 8c DEC &8c ; player_nibble &1705 a9 07 LDA #&07 &1707 85 8a STA &8a ; top_fraction &1709 c6 87 DEC &87 ; top_left_tile_address_low # If so, update the address of the top left tile &170b a5 87 LDA &87 ; top_left_tile_address_low &170d c9 ff CMP #&ff &170f d0 02 BNE &1713 &1711 c6 88 DEC &88 ; top_left_tile_address_high &1713 c6 84 DEC &84 ; top_right_tile_address_low &1715 a5 84 LDA &84 ; top_right_tile_address_low &1717 c9 ff CMP #&ff &1719 d0 02 BNE &171d &171b c6 85 DEC &85 ; top_right_tile_address_high ; not_new_tile_top &171d a5 87 LDA &87 ; top_left_tile_address_low &171f 85 74 STA &74 ; tile_address_low &1721 a5 88 LDA &88 ; top_left_tile_address_high &1723 85 75 STA &75 ; tile_address_high &1725 a5 8a LDA &8a ; top_fraction &1727 29 03 AND #&03 &1729 85 76 STA &76 ; tile_fraction &172b 20 f0 18 JSR &18f0 ; update_horizontal_edge_of_screen &172e c6 8b DEC &8b ; bottom_fraction # Move the bottom edge a fraction of a tile up &1730 a5 8b LDA &8b ; bottom_fraction &1732 c9 ff CMP #&ff &1734 d0 04 BNE &173a ; not_new_tile_bottom &1736 a9 07 LDA #&07 &1738 85 8b STA &8b ; bottom_fraction ; not_new_tile_bottom &173a a5 8d LDA &8d ; player_screen_address_low &173c 85 70 STA &70 ; screen_address_low &173e 18 CLC &173f a5 8e LDA &8e ; player_screen_address_high &1741 69 03 ADC #&03 &1743 10 03 BPL &1748 ; skip_wrap_around &1745 38 SEC &1746 e9 20 SBC #&20 ; skip_wrap_around &1748 85 71 STA &71 ; screen_address_high &174a a9 80 LDA #&80 &174c 85 72 STA &72 ; sprite_address_low &174e a9 5c LDA #&5c ; &5c80 = sprite_space &1750 85 73 STA &73 ; sprite_address_high &1752 a2 04 LDX #&04 # 16 pixels wide &1754 a0 08 LDY #&08 # 8 pixels high &1756 20 70 19 JSR &1970 ; plot_sprite # Wipe bottom edge of player &1759 c6 8e DEC &8e ; player_screen_address_high &175b a5 8e LDA &8e ; player_screen_address_high &175d c9 5f CMP #&5f &175f d0 04 BNE &1765 ; continue_scrolling_screen_up &1761 a9 7f LDA #&7f &1763 85 8e STA &8e ; player_screen_address_high ; continue_scrolling_screen_up &1765 a5 8e LDA &8e ; player_screen_address_high &1767 85 71 STA &71 ; screen_address_high &1769 a5 8d LDA &8d ; player_screen_address_low &176b 85 70 STA &70 ; screen_address_low &176d a2 04 LDX #&04 # 16 pixels wide &176f a0 20 LDY #&20 # 32 pixels wide &1771 a9 00 LDA #&00 &1773 85 72 STA &72 ; sprite_address_low &1775 a9 58 LDA #&58 ; &5800 = sprite_player_up &1777 85 73 STA &73 ; sprite_address_high &1779 a5 90 LDA &90 ; player_y &177b 29 01 AND #&01 &177d d0 07 BNE &1786 ; use_first_frame &177f 18 CLC &1780 a5 73 LDA &73 ; sprite_address_high &1782 69 02 ADC #&02 ; &5a00 = sprite_player_up_frame_two &1784 85 73 STA &73 ; sprite_address_high ; use_first_frame &1786 20 70 19 JSR &1970 ; plot_sprite &1789 a5 03 LDA &03 ; arrow_timer &178b f0 0d BEQ &179a ; leave &178d a5 02 LDA &02 ; arrow_direction &178f c9 02 CMP #&02 &1791 d0 05 BNE &1798 ; arrow_not_moving_up &1793 c6 03 DEC &03 ; arrow_timer # Make arrow live longer if moving towards it &1795 4c f1 30 JMP &30f1 ; update_arrow ; arrow_not_moving_up &1798 e6 03 INC &03 ; arrow_timer # Bug: reduce life of arrow in all other directions ; leave &179a 60 RTS ; plot_horizontal_strip_of_tile &179b a0 00 LDY #&00 ; plot_horizontal_strip_of_tile_loop &179d b1 72 LDA (&72),Y ; sprite_address &179f 91 70 STA (&70),Y ; screen_address &17a1 c8 INY &17a2 c0 08 CPY #&08 &17a4 d0 f7 BNE &179d ; plot_horizontal_strip_of_tile_loop &17a6 a0 00 LDY #&00 &17a8 18 CLC &17a9 a5 72 LDA &72 ; sprite_address_low &17ab 69 20 ADC #&20 &17ad 85 72 STA &72 ; sprite_address_low &17af 90 02 BCC &17b3 &17b1 e6 73 INC &73 ; sprite_address_high &17b3 18 CLC &17b4 a5 70 LDA &70 ; screen_address_low &17b6 69 08 ADC #&08 &17b8 85 70 STA &70 ; screen_address_low &17ba 90 08 BCC &17c4 ; skip_wrap_around &17bc e6 71 INC &71 ; screen_address_high &17be 10 04 BPL &17c4 ; skip_wrap_around &17c0 a9 60 LDA #&60 &17c2 85 71 STA &71 ; screen_address_high ; skip_wrap_around &17c4 ca DEX &17c5 d0 d6 BNE &179d ; plot_horizontal_strip_of_tile_loop &17c7 60 RTS ; move_down &17c8 a5 96 LDA &96 ; player_fraction &17ca c9 04 CMP #&04 &17cc d0 31 BNE &17ff ; player_midtile_moving_down &17ce a6 8f LDX &8f ; player_x &17d0 a4 90 LDY &90 ; player_y &17d2 88 DEY &17d3 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_down if tile contains an object &17d6 a5 8c LDA &8c ; player_nibble &17d8 29 01 AND #&01 &17da a8 TAY &17db 49 01 EOR #&01 &17dd 85 70 STA &70 ; tile_nibble &17df 20 73 1a JSR &1a73 ; consider_tile_player_is_moving_into &17e2 e0 01 CPX #&01 &17e4 d0 17 BNE &17fd ; skip_cask_check # Is the tile a wall or hazard? &17e6 a5 93 LDA &93 ; player_tile &17e8 c9 0b CMP #&0b ; CASK &17ea f0 01 BEQ &17ed ; consider_pushing_cask_down # If it's not a CASK, the player can't move onto it &17ec 60 RTS ; consider_pushing_cask_down &17ed a6 8f LDX &8f ; player_x # Consider the tiles two squares below &17ef a4 90 LDY &90 ; player_y &17f1 88 DEY &17f2 88 DEY &17f3 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave move_down if that tile contains an object &17f6 20 da 1f JSR &1fda ; consider_if_player_can_push_cask_down # Leave move_down if the player isn't strong &17f9 a9 04 LDA #&04 &17fb 85 96 STA &96 ; player_fraction ; skip_cask_check &17fd c6 90 DEC &90 ; player_y # Move the player onto tile below ; player_midtile_moving_right &17ff a5 96 LDA &96 ; player_fraction &1801 c9 01 CMP #&01 &1803 d0 0b BNE &1810 ; skip_treasure_check # Is this the final fraction of the move? &1805 a5 8c LDA &8c ; player_nibble &1807 29 01 AND #&01 &1809 d0 02 BNE &180d ; use_same_byte &180b e6 91 INC &91 ; player_tile_address_low ; use_same_byte &180d 20 ab 1a JSR &1aab ; consider_collecting_treasure # If so, consider for treasure ; skip_treasure_check &1810 20 dc 20 JSR &20dc ; wait_depending_on_player_speed &1813 18 CLC &1814 a5 80 LDA &80 ; crtc_screen_low # Increase the screen start address by &100 bytes, &1816 69 20 ADC #&20 &1818 85 80 STA &80 ; crtc_screen_low &181a 90 0c BCC &1828 ; skip_wrap_around &181c e6 81 INC &81 ; crtc_screen_high &181e a5 81 LDA &81 ; crtc_screen_high &1820 c9 10 CMP #&10 &1822 90 04 BCC &1828 ; skip_wrap_around &1824 a9 0c LDA #&0c # wrapping at the end of screen memory &1826 85 81 STA &81 ; crtc_screen_high ; skip_wrap_around # Push the new screen start address to the CRTC &1828 a9 0c LDA #&0c # R12: Displayed screen start address register (high) &182a 8d 00 fe STA &fe00 ; video register number &182d a5 81 LDA &81 ; crtc_screen_high &182f 8d 01 fe STA &fe01 ; video register value &1832 a9 0d LDA #&0d # R13: Displayed screen start address register (low) &1834 8d 00 fe STA &fe00 ; video register number &1837 a5 80 LDA &80 ; crtc_screen_low &1839 8d 01 fe STA &fe01 ; video register value &183c e6 83 INC &83 ; screen_start_address_high # Update the game's version accordingly, &183e 10 04 BPL &1844 ; skip_wrap_around &1840 a9 60 LDA #&60 # wrapping at the end of screen memory &1842 85 83 STA &83 ; screen_start_address_high ; skip_wrap_around &1844 a5 82 LDA &82 ; screen_start_address_low &1846 85 70 STA &70 ; screen_address_low &1848 18 CLC &1849 a5 83 LDA &83 ; screen_start_address_high &184b 69 1f ADC #&1f &184d 10 03 BPL &1852 ; skip_wrap_around &184f 38 SEC &1850 e9 20 SBC #&20 ; skip_wrap_around &1852 85 71 STA &71 ; screen_address_high &1854 e6 8b INC &8b ; bottom_fraction # Move the bottom edge a fraction of a tile down &1856 a5 8b LDA &8b ; bottom_fraction &1858 c9 04 CMP #&04 &185a d0 05 BNE &1861 ; not_new_tile_bottom # Does this put it on a new tile, but the same byte? &185c e6 8c INC &8c ; player_nibble &185e 4c 77 18 JMP &1877 ; not_new_byte_bottom &1861 c9 08 CMP #&08 &1863 d0 12 BNE &1877 ; not_new_byte_bottom # or a new tile, and a different byte? &1865 e6 8c INC &8c ; player_nibble &1867 a9 00 LDA #&00 &1869 85 8b STA &8b ; bottom_fraction &186b e6 87 INC &87 ; top_left_tile_address_low # Update tile addresses accordingly &186d d0 02 BNE &1871 &186f e6 88 INC &88 ; top_left_tile_address_high &1871 e6 84 INC &84 ; top_right_tile_address_low &1873 d0 02 BNE &1877 ; not_new_byte_bottom &1875 e6 85 INC &85 ; top_right_tile_address_high ; not_new_byte_bottom &1877 e6 8a INC &8a ; top_fraction &1879 a5 8a LDA &8a ; top_fraction &187b c9 08 CMP #&08 &187d d0 04 BNE &1883 ; not_new_byte_top &187f a9 00 LDA #&00 &1881 85 8a STA &8a ; top_fraction ; not_new_byte_top &1883 18 CLC &1884 a5 87 LDA &87 ; top_left_tile_address_low &1886 69 04 ADC #&04 &1888 85 74 STA &74 ; tile_address_low &188a a5 88 LDA &88 ; top_left_tile_address_high &188c 69 00 ADC #&00 &188e 85 75 STA &75 ; tile_address_high &1890 a5 8b LDA &8b ; bottom_fraction &1892 29 03 AND #&03 &1894 85 76 STA &76 ; tile_fraction &1896 20 f0 18 JSR &18f0 ; update_horizontal_edge_of_screen &1899 a5 8d LDA &8d ; player_screen_address_low &189b 85 70 STA &70 ; screen_address_low &189d a5 8e LDA &8e ; player_screen_address_high &189f 85 71 STA &71 ; screen_address_high &18a1 a9 80 LDA #&80 &18a3 85 72 STA &72 ; sprite_address_low &18a5 a9 5c LDA #&5c ; &5c80 = sprite_space &18a7 85 73 STA &73 ; sprite_address_high &18a9 a2 04 LDX #&04 # 16 pixels wide &18ab a0 08 LDY #&08 # 8 pixels high &18ad 20 70 19 JSR &1970 ; plot_sprite # Wipe top edge of player &18b0 e6 8e INC &8e ; player_screen_address_high &18b2 10 04 BPL &18b8 ; continue_scrolling_screen_down &18b4 a9 60 LDA #&60 &18b6 85 8e STA &8e ; player_screen_address_high ; continue_scrolling_screen_down &18b8 a5 8d LDA &8d ; player_screen_address_low &18ba 85 70 STA &70 ; screen_address_low &18bc a5 8e LDA &8e ; player_screen_address_high &18be 85 71 STA &71 ; screen_address_high &18c0 a9 00 LDA #&00 &18c2 85 72 STA &72 ; sprite_address_low &18c4 a9 58 LDA #&58 ; &5800 = sprite_player_up &18c6 85 73 STA &73 ; sprite_address_high &18c8 a5 90 LDA &90 ; player_y &18ca 29 01 AND #&01 &18cc d0 07 BNE &18d5 ; use_first_frame &18ce 18 CLC &18cf a5 73 LDA &73 ; sprite_address_high &18d1 69 02 ADC #&02 ; &5a00 = sprite_player_up_frame_two &18d3 85 73 STA &73 ; sprite_address_high ; use_first_frame &18d5 a0 20 LDY #&20 # 32 pixels high &18d7 20 5e 19 JSR &195e ; plot_sprite_upside_down # Plot player upside down &18da a5 03 LDA &03 ; arrow_timer &18dc f0 11 BEQ &18ef ; leave &18de a5 02 LDA &02 ; arrow_direction &18e0 c9 03 CMP #&03 &18e2 d0 05 BNE &18e9 ; arrow_not_moving_down &18e4 c6 03 DEC &03 ; arrow_timer # Make arrow live longer if moving towards it &18e6 4c f1 30 JMP &30f1 ; update_arrow ; arrow_not_moving_down &18e9 c9 02 CMP #&02 &18eb d0 02 BNE &18ef ; leave &18ed e6 03 INC &03 ; arrow_timer # Make arrow live shorter if moving away from it ; leave &18ef 60 RTS ; update_horizontal_edge_of_screen &18f0 a9 00 LDA #&00 &18f2 85 77 STA &77 ; tiles_plotted ; update_horizontal_edge_of_screen_loop &18f4 a0 00 LDY #&00 &18f6 a5 76 LDA &76 ; tile_fraction &18f8 aa TAX &18f9 bd 5a 19 LDA &195a,X ; vertical_sprite_offsets &18fc 85 72 STA &72 ; sprite_address_low &18fe a5 8c LDA &8c ; player_nibble &1900 29 01 AND #&01 &1902 d0 09 BNE &190d ; use_top_nibble ; use_bottom_nibble &1904 b1 74 LDA (&74),Y ; tile_address &1906 29 0f AND #&0f &1908 0a ASL A &1909 aa TAX &190a 4c 15 19 JMP &1915 ; calculate_sprite_address ; use_top_nibble &190d b1 74 LDA (&74),Y ; tile_address &190f 29 f0 AND #&f0 &1911 4a LSR A &1912 4a LSR A &1913 4a LSR A &1914 aa TAX ; calculate_sprite_address &1915 bd d1 14 LDA &14d1,X ; current_sprite_address_table &1918 18 CLC &1919 65 72 ADC &72 ; sprite_address_low &191b 85 72 STA &72 ; sprite_address_low &191d bd d2 14 LDA &14d2,X ; current_sprite_address_table + 1 &1920 69 00 ADC #&00 &1922 85 73 STA &73 ; sprite_address_high &1924 a2 04 LDX #&04 &1926 a5 77 LDA &77 ; tiles_plotted &1928 d0 13 BNE &193d ; not_first_tile &192a 18 CLC &192b a5 72 LDA &72 ; sprite_address_low &192d 69 40 ADC #&40 &192f 85 72 STA &72 ; sprite_address_low &1931 90 02 BCC &1935 &1933 e6 73 INC &73 ; sprite_address_high &1935 a2 02 LDX #&02 &1937 20 9b 17 JSR &179b ; plot_horizontal_strip_of_tile &193a 4c 46 19 JMP &1946 ; next_tile ; not_first_tile &193d c9 08 CMP #&08 &193f d0 02 BNE &1943 ; not_last_tile &1941 a2 02 LDX #&02 ; not_last_tile &1943 20 9b 17 JSR &179b ; plot_horizontal_strip_of_tile ; next_tile &1946 18 CLC &1947 a5 74 LDA &74 ; tile_address_low &1949 69 20 ADC #&20 &194b 85 74 STA &74 ; tile_address_low &194d 90 02 BCC &1951 &194f e6 75 INC &75 ; tile_address_high &1951 e6 77 INC &77 ; tiles_plotted &1953 a5 77 LDA &77 ; tiles_plotted &1955 c9 09 CMP #&09 &1957 d0 9b BNE &18f4 ; update_horizontal_edge_of_screen_loop &1959 60 RTS ; vertical_sprite_offsets &195a 00 08 10 18 ; plot_sprite_upside_down &195e a2 04 LDX #&04 # 16 pixels wide &1960 a0 20 LDY #&20 # 32 pixels high &1962 a9 fc LDA #&fc &1964 85 78 STA &78 ; sprite_skip_in_bytes &1966 18 CLC &1967 a5 72 LDA &72 ; sprite_address_low &1969 69 7c ADC #&7c &196b 85 72 STA &72 ; sprite_address_low &196d 4c 72 19 JMP &1972 ; plot_sprite_with_skip ; plot_sprite &1970 86 78 STX &78 ; sprite_skip_in_bytes ; plot_sprite_with_skip &1972 86 76 STX &76 ; sprite_width_in_bytes &1974 84 77 STY &77 ; sprite_height_in_groups &1976 a5 70 LDA &70 ; screen_address_low &1978 85 74 STA &74 ; next_screen_address_low &197a a5 71 LDA &71 ; screen_address_high &197c 85 75 STA &75 ; next_screen_address_high &197e a5 72 LDA &72 ; sprite_address_low &1980 8d 8d 19 STA &198d ; plot_sprite_address_low &1983 a5 73 LDA &73 ; sprite_address_high &1985 8d 8e 19 STA &198e ; plot_sprite_address_high &1988 a0 00 LDY #&00 ; plot_sprite_group_loop &198a a2 00 LDX #&00 ; plot_sprite_byte_loop &198c bd 00 30 LDA &3000,X # actually LDA plot_sprite_address,X &198f 91 70 STA (&70),Y ; screen_address &1991 18 CLC &1992 a5 70 LDA &70 ; screen_address_low &1994 69 08 ADC #&08 &1996 85 70 STA &70 ; screen_address_low &1998 90 08 BCC &19a2 ; skip_wrap_around &199a e6 71 INC &71 ; screen_address_high &199c 10 04 BPL &19a2 ; skip_wrap_around &199e a9 60 LDA #&60 &19a0 85 71 STA &71 ; screen_address_high ; skip_wrap_around &19a2 e8 INX &19a3 e4 76 CPX &76 ; sprite_width_in_bytes &19a5 d0 e5 BNE &198c ; plot_sprite_byte_loop &19a7 c6 77 DEC &77 ; sprite_height_in_groups &19a9 f0 37 BEQ &19e2 ; leave &19ab 18 CLC &19ac a5 72 LDA &72 ; sprite_address_low &19ae 65 78 ADC &78 ; sprite_skip_in_bytes &19b0 85 72 STA &72 ; sprite_address_high &19b2 8d 8d 19 STA &198d ; plot_sprite_address_low &19b5 a5 74 LDA &74 ; next_screen_address_low &19b7 29 07 AND #&07 &19b9 c9 07 CMP #&07 &19bb d0 18 BNE &19d5 ; not_aligned &19bd 38 SEC &19be a5 74 LDA &74 ; next_screen_address_low &19c0 e9 07 SBC #&07 &19c2 85 74 STA &74 ; next_screen_address_low &19c4 85 70 STA &70 ; screen_address_low &19c6 e6 75 INC &75 ; next_screen_address_high &19c8 10 04 BPL &19ce ; skip_wrap_around &19ca a9 60 LDA #&60 &19cc 85 75 STA &75 ; next_screen_address_high ; skip_wrap_around &19ce a5 75 LDA &75 ; next_screen_address_high &19d0 85 71 STA &71 ; screen_address_high &19d2 4c 8a 19 JMP &198a ; plot_sprite_group_loop ; not_aligned &19d5 e6 74 INC &74 ; next_screen_address_low &19d7 a5 74 LDA &74 ; next_screen_address_low &19d9 85 70 STA &70 ; screen_address_low &19db a5 75 LDA &75 ; next_screen_address_high &19dd 85 71 STA &71 ; screen_address_high &19df 4c 8a 19 JMP &198a ; plot_sprite_group_loop ; leave &19e2 60 RTS ; check_for_player_move &19e3 a9 05 LDA #&05 &19e5 85 96 STA &96 ; player_fraction &19e7 a5 ec LDA &ec ; Internal key number of most recently pressed key &19e9 20 f6 19 JSR &19f6 ; check_for_move_keypresses &19ec a5 ed LDA &ed ; Internal key number of first key pressed of those still pressed &19ee 20 f6 19 JSR &19f6 ; check_for_move_keypresses &19f1 a9 00 LDA #&00 &19f3 85 96 STA &96 ; player_fraction &19f5 60 RTS ; check_for_move_keypresses &19f6 c5 3d CMP &3d ; key_right &19f8 d0 07 BNE &1a01 ; right_not_pressed &19fa a9 00 LDA #&00 &19fc 85 97 STA &97 ; desired_direction &19fe 68 PLA # Leave check_for_player_move &19ff 68 PLA &1a00 60 RTS ; right_not_pressed &1a01 c5 4e CMP &4e ; key_left &1a03 d0 07 BNE &1a0c ; left_not_pressed &1a05 a9 01 LDA #&01 &1a07 85 97 STA &97 ; desired_direction &1a09 68 PLA # Leave check_for_player_move &1a0a 68 PLA &1a0b 60 RTS ; left_not_pressed &1a0c c5 5c CMP &5c ; key_up &1a0e d0 07 BNE &1a17 ; up_not_pressed &1a10 a9 02 LDA #&02 &1a12 85 97 STA &97 ; desired_direction &1a14 68 PLA # Leave check_for_player_move &1a15 68 PLA &1a16 60 RTS ; up_not_pressed &1a17 c5 3c CMP &3c ; key_down &1a19 d0 07 BNE &1a22 ; down_not_pressed &1a1b a9 03 LDA #&03 &1a1d 85 97 STA &97 ; desired_direction &1a1f 68 PLA # Leave check_for_player_move &1a20 68 PLA &1a21 60 RTS ; down_not_pressed &1a22 c9 d1 CMP #&d1 ; S &1a24 d0 03 BNE &1a29 ; s_not_pressed &1a26 4c 93 1c JMP &1c93 ; display_status_screen ; s_not_pressed &1a29 c9 b7 CMP #&b7 ; P &1a2b d0 03 BNE &1a30 ; p_not_pressed &1a2d 4c e9 22 JMP &22e9 ; pick_up_object ; p_not_pressed &1a30 c9 b2 CMP #&b2 ; D &1a32 d0 03 BNE &1a37 ; d_not_pressed &1a34 4c 42 27 JMP &2742 ; drop_object ; d_not_pressed &1a37 c9 f0 CMP #&f0 ; ESCAPE &1a39 d0 07 BNE &1a42 ; escape_not_pressed &1a3b 68 PLA # Leave game loop &1a3c 68 PLA &1a3d 68 PLA &1a3e 68 PLA &1a3f 4c 5a 32 JMP &325a ; display_failure_screen ; escape_not_pressed &1a42 c9 e0 CMP #A&e0 ; TAB &1a44 d0 05 BNE &1a4b ; tab_not_pressed &1a46 68 PLA # Leave check_for_player_move &1a47 68 PLA &1a48 4c e3 1a JMP &1ae3 ; kill_player ; tab_not_pressed &1a4b c9 e9 CMP #&e9 ; COPY &1a4d d0 15 BNE &1a64 ; copy_not_pressed &1a4f ad 62 02 LDA &0262 ; sound_muted &1a52 85 70 STA &70 ; previous_sound_muted &1a54 a9 01 LDA #&01 &1a56 8d 62 02 STA &0262 ; sound_muted ; wait_for_delete &1a59 a5 ec LDA &ec ; Internal key number of most recently pressed key &1a5b c9 d9 CMP #&d9 ; DELETE &1a5d d0 fa BNE &1a59 ; wait_for_delete &1a5f a5 70 LDA &70 ; previous_sound_muted &1a61 8d 62 02 STA &0262 ; sound_muted ; copy_not_pressed &1a64 60 RTS ; consider_enter_keypress &1a65 a9 c9 LDA #&c9 ; ENTER &1a67 c5 ec CMP &ec ; Internal key number of most recently pressed key &1a69 f0 05 BEQ &1a70 ; enter_pressed &1a6b c5 ed CMP &ed ; Internal key number of first key pressed of those still pressed &1a6d f0 01 BEQ &1a70 ; enter_pressed &1a6f 60 RTS ; enter_pressed &1a70 4c d9 2c JMP &2cd9 ; use_object ; consider_tile_player_is_moving_into &1a73 a5 70 LDA &70 ; tile_nibble &1a75 c9 01 CMP #&01 &1a77 f0 17 BEQ &1a90 ; use_high_nibble_of_tile &1a79 b1 91 LDA (&91),Y ; player_tile_address &1a7b 29 0f AND #&0f &1a7d 85 93 STA &93 ; player_tile &1a7f 85 94 STA &94 ; other_tile &1a81 f0 04 BEQ &1a87 ; leave_with_zero &1a83 c9 0f CMP #&0f ; TREASURE &1a85 90 03 BCC &1a8a ; leave_with_one ; leave_with_zero # Leave with zero for SPACE and TREASURE &1a87 a2 00 LDX #&00 &1a89 60 RTS ; leave_with_one # Leave with one for all walls and hazards &1a8a a2 01 LDX #&01 &1a8c 8a TXA &1a8d 85 96 STA &96 ; player_fraction &1a8f 60 RTS ; use_high_nibble_of_tile &1a90 b1 91 LDA (&91),Y ; player_tile_address &1a92 29 f0 AND #&f0 &1a94 85 94 STA &94 ; other_tile &1a96 4a LSR A &1a97 4a LSR A &1a98 4a LSR A &1a99 4a LSR A &1a9a 85 93 STA &93 ; player_tile &1a9c f0 04 BEQ &1aa2 ; leave_with_zero &1a9e c9 0f CMP #&0f &1aa0 90 03 BCC &1aa5 ; leave_with_one ; leave_with_zero &1aa2 a2 00 LDX #&00 &1aa4 60 RTS ; leave_with_one &1aa5 a9 01 LDA #&01 &1aa7 aa TAX &1aa8 85 96 STA &96 ; player_fraction &1aaa 60 RTS ; consider_collecting_treasure &1aab a0 00 LDY #&00 &1aad a5 93 LDA &93 ; player_tile &1aaf c9 0f CMP #&0f ; TREASURE &1ab1 d0 21 BNE &1ad4 ; leave &1ab3 b1 91 LDA (&91),Y ; player_tile_address &1ab5 45 94 EOR &94 ; other_tile &1ab7 91 91 STA (&91),Y ; player_tile_address &1ab9 a2 02 LDX #&02 &1abb a0 01 LDY #&01 &1abd 20 6c 21 JSR &216c ; increase_score # 0.1% score for collecting treasure &1ac0 e6 3e INC &3e ; treasure_collected &1ac2 a9 00 LDA #&00 &1ac4 85 93 STA &93 ; player_tile &1ac6 a6 6d LDX &6d ; current_level &1ac8 a5 3e LDA &3e ; treasure_collected &1aca d5 3f CMP &3f,X ; treasure_needed &1acc 90 03 BCC &1ad1 ; more_treasure_needed &1ace 4c 2f 25 JMP &252f ; play_sound_1 ; more_treasure_needed &1ad1 4c 20 25 JMP &2520 ; play_sound_0 ; leave &1ad4 60 RTS ; consider_deadly_tile_contact &1ad5 a5 93 LDA &93 ; player_tile &1ad7 c9 03 CMP #&03 ; SPIKES &1ad9 f0 05 BEQ &1ae0 ; to_kill_player &1adb c9 0c CMP #&0c ; ACID or PLANT &1add f0 01 BEQ &1ae0 ; to_kill_player &1adf 60 RTS ; to_kill_player &1ae0 4c e3 1a JMP &1ae3 ; kill_player ; kill_player &1ae3 20 3e 25 JSR &253e ; play_sound_2 &1ae6 20 15 25 JSR &2515 ; reset_health &1ae9 a2 00 LDX #&00 &1aeb 86 03 STX &03 ; arrow_timer ; find_player_direction_loop # Start with the player's current direction &1aed bd 40 1b LDA &1b40,X ; spin_directions &1af0 e8 INX &1af1 c5 95 CMP &95 ; player_facing &1af3 d0 f8 BNE &1aed ; find_player_direction_loop &1af5 ca DEX &1af6 86 99 STX &99 ; spin_timer ; spin_player_loop # Spin the player around twenty times &1af8 e6 99 INC &99 ; spin_timer &1afa a5 99 LDA &99 ; spin_timer &1afc c9 14 CMP #&14 &1afe b0 13 BCS &1b13 ; plot_coffin &1b00 29 03 AND #&03 &1b02 aa TAX &1b03 bd 40 1b LDA &1b40,X ; spin_directions &1b06 85 95 STA &95 ; player_facing &1b08 20 cf 1d JSR &1dcf ; plot_player &1b0b a9 3c LDA #&3c &1b0d 20 0a 27 JSR &270a ; short_delay &1b10 4c f8 1a JMP &1af8 ; spin_player_loop ; plot_coffin &1b13 68 PLA # Remove caller from stack &1b14 68 PLA &1b15 a6 8f LDX &8f ; player_x &1b17 a4 90 LDY &90 ; player_y &1b19 a9 4c LDA #&4c ; JMP # Don't set tile data, only plot sprite &1b1b 8d 28 29 STA &2928 ; set_tile_operator &1b1e a9 05 LDA #&05 ; COFFIN &1b20 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # Replace player with coffin &1b23 a9 20 LDA #&20 ; JSR # Restore default behaviour &1b25 8d 28 29 STA &2928 ; set_tile_operator &1b28 a9 dc LDA #&dc &1b2a 20 0a 27 JSR &270a ; short_delay &1b2d 20 0a 27 JSR &270a ; short_delay &1b30 c6 7f DEC &7f ; player_lives &1b32 d0 03 BNE &1b37 ; still_alive &1b34 4c 5a 32 JMP &325a ; display_failure_screen ; still_alive &1b37 20 03 12 JSR &1203 ; reset_screen &1b3a 20 80 1c JSR &1c80 ; wipe_screen &1b3d 4c 2d 11 JMP &112d ; return_to_game ; spin_directions ; D L R U &1b40 03 01 02 00 ; handle_falling_spikes_and_health_loss &1b44 a5 93 LDA &93 ; player_tile &1b46 f0 01 BEQ &1b49 ; player_moved_into_space &1b48 60 RTS ; player_moved_into_space &1b49 a2 03 LDX #&03 # Lose tenth of a point of health every move &1b4b 20 97 1b JSR &1b97 ; lose_health &1b4e a5 f8 LDA &f8 ; falling_spikes_timer &1b50 c9 ff CMP #&ff &1b52 f0 23 BEQ &1b77 ; consider_low_health_warning &1b54 c6 f8 DEC &f8 ; falling_spikes_timer &1b56 a5 f8 LDA &f8 ; falling_spikes_timer &1b58 c9 ff CMP #&ff &1b5a d0 1b BNE &1b77 ; consider_low_health_warning &1b5c a9 03 LDA #&03 ; SPIKES &1b5e a2 22 LDX #&22 &1b60 a0 1e LDY #&1e &1b62 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # Restore spikes to (&22, &1e) on level 1 &1b65 20 4d 25 JSR &254d ; play_sound_3 &1b68 a5 8f LDA &8f ; player_x &1b6a c9 22 CMP #&22 &1b6c d0 09 BNE &1b77 ; consider_low_health_warning &1b6e a5 90 LDA &90 ; player_y &1b70 c9 1e CMP #&1e &1b72 d0 03 BNE &1b77 ; consider_low_health_warning &1b74 4c e3 1a JMP &1ae3 ; kill_player # Kill player if they were under spikes ; consider_low_health_warning &1b77 a5 4a LDA &4a ; health &1b79 d0 07 BNE &1b82 ; skip_warning_sound &1b7b a5 4b LDA &4b ; health + 1 &1b7d d0 03 BNE &1b82 ; skip_warning_sound &1b7f 20 91 25 JSR &2591 ; play_sound_6 ; skip_warning_sound &1b82 a5 4a LDA &4a ; health &1b84 c9 09 CMP #&09 &1b86 90 03 BCC &1b8b ; still_has_health &1b88 4c e3 1a JMP &1ae3 ; kill_player ; still_has_health &1b8b a5 4f LDA &4f ; energy_drain &1b8d c9 ff CMP #&ff &1b8f d0 01 BNE &1b92 ; lose_point_of_health # If the player is under the influence of energy drain, &1b91 60 RTS ; lose_point_of_health &1b92 a2 02 LDX #&02 # Lose one point of health per turn &1b94 4c 97 1b JMP &1b97 ; lose_health ; lose_health &1b97 a5 93 LDA &93 ; player_tile &1b99 f0 01 BEQ &1b9c ; lose_health_loop &1b9b 60 RTS ; lose_health_loop &1b9c d6 4a DEC &4a,X ; health &1b9e b5 4a LDA &4a,X ; health &1ba0 c9 ff CMP #&ff &1ba2 d0 09 BNE &1bad ; leave &1ba4 a9 09 LDA #&09 &1ba6 95 4a STA &4a,X ; health &1ba8 ca DEX &1ba9 e0 ff CPX #&ff &1bab d0 ef BNE &1b9c ; lose_health_loop &1bad 60 RTS ; other_sprite_plotter &1bae 86 76 STX &76 ; width &1bb0 84 77 STY &77 ; height &1bb2 a0 00 LDY #&00 &1bb4 a5 70 LDA &70 ; screen_address_low &1bb6 85 74 STA &74 ; previous_screen_address_low &1bb8 a5 71 LDA &71 ; screen_address_high &1bba 85 75 STA &75 ; previous_screen_address_high ; group_loop &1bbc a6 77 LDX &77 ; height ; byte_loop &1bbe b1 72 LDA (&72),Y ; sprite_address &1bc0 91 70 STA (&70),Y ; screen_address &1bc2 e6 72 INC &72 ; sprite_address_low &1bc4 ca DEX &1bc5 f0 28 BEQ &1bef ; end_of_width &1bc7 e6 70 INC &70 ; screen_address_low &1bc9 d0 08 BNE &1bd3 ; skip_wrap_around &1bcb e6 71 INC &71 ; screen_address_high &1bcd 10 04 BPL &1bd3 ; skip_wrap_around &1bcf a9 60 LDA #&60 &1bd1 85 71 STA &71 ; screen_address_high ; skip_wrap_around &1bd3 a5 70 LDA &70 ; screen_address_low &1bd5 29 07 AND #&07 &1bd7 d0 e5 BNE &1bbe ; byte_loop &1bd9 38 SEC &1bda a5 70 LDA &70 ; screen_address_low &1bdc e9 08 SBC #&08 &1bde 85 70 STA &70 ; screen_address_low &1be0 b0 02 BCS &1be4 &1be2 c6 71 DEC &71 ; screen_address_high &1be4 e6 71 INC &71 ; screen_address_high &1be6 10 d6 BPL &1bbe ; byte_loop &1be8 a9 60 LDA #&60 &1bea 85 71 STA &71 ; screen_address_high &1bec 4c be 1b JMP &1bbe ; byte_loop ; end_of_width &1bef c6 76 DEC &76 ; width &1bf1 d0 01 BNE &1bf4 ; move_to_next_column &1bf3 60 RTS ; move_to_next_column &1bf4 18 CLC &1bf5 a5 74 LDA &74 ; previous_screen_address_low &1bf7 69 08 ADC #&08 &1bf9 85 74 STA &74 ; previous_screen_address_low &1bfb 85 70 STA &70 ; screen_address_low &1bfd 90 08 BCC &1c07 ; skip_wrap_around &1bff e6 75 INC &75 ; previous_screen_address_high &1c01 10 04 BPL &1c07 ; skip_wrap_around &1c03 a9 60 LDA #&60 &1c05 85 75 STA &75 ; previous_screen_address_high ; skip_wrap_around &1c07 a5 75 LDA &75 ; previous_screen_address_high &1c09 85 71 STA &71 ; screen_address_high &1c0b 4c bc 1b JMP &1bbc ; group_loop ; handle_time_door &1c0e a5 6d LDA &6d ; current_level &1c10 c9 02 CMP #&02 &1c12 f0 01 BEQ &1c15 ; on_level_three &1c14 60 RTS ; on_level_three &1c15 a5 61 LDA &61 ; timer_low &1c17 c9 f0 CMP #&f0 &1c19 90 16 BCC &1c31 ; consider_open_door &1c1b a5 6f LDA &6f ; time_door_state &1c1d d0 12 BNE &1c31 ; consider_open_door &1c1f 20 5c 25 JSR &255c ; play_time_door_opening_sound &1c22 a9 01 LDA #&01 &1c24 85 6f STA &6f ; time_door_state &1c26 a2 17 LDX #&17 &1c28 a0 28 LDY #&28 &1c2a a9 00 LDA #&00 ; SPACE &1c2c 85 61 STA &61 ; timer_low &1c2e 4c 4b 28 JMP &284b ; plot_tile_a_at_position_x_y ; consider_open_door &1c31 a5 61 LDA &61 ; timer_low &1c33 c9 14 CMP #&14 &1c35 90 20 BCC &1c57 ; leave &1c37 a5 6f LDA &6f ; time_door_state &1c39 f0 1c BEQ &1c57 ; leave &1c3b a9 00 LDA #&00 &1c3d 85 6f STA &6f ; time_door_state &1c3f a9 0a LDA #&0a ; DOOR &1c41 a2 17 LDX #&17 &1c43 a0 28 LDY #&28 &1c45 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &1c48 a5 8f LDA &8f ; player_x &1c4a c9 17 CMP #&17 &1c4c d0 09 BNE &1c57 ; leave &1c4e a5 90 LDA &90 ; player_y &1c50 c9 28 CMP #&28 &1c52 d0 03 BNE &1c57 ; leave &1c54 4c e3 1a JMP &1ae3 ; kill_player # Kill player if time door closes on them ; leave &1c57 60 RTS ; event_routine &1c58 08 PHP &1c59 48 PHA &1c5a a5 39 LDA &39 ; tune_muted &1c5c d0 05 BNE &1c63 ; skip_tune &1c5e 68 PLA &1c5f 20 00 09 JSR &0900 ; play_tune &1c62 48 PHA ; skip_tune &1c63 8a TXA &1c64 48 PHA &1c65 98 TYA &1c66 48 PHA &1c67 e6 61 INC &61 ; timer_low &1c69 d0 02 BNE &1c6d &1c6b e6 62 INC &62 ; timer_high &1c6d 20 72 25 JSR &2572 ; play_time_chime &1c70 68 PLA &1c71 a8 TAY &1c72 68 PLA &1c73 aa TAX &1c74 68 PLA &1c75 28 PLP &1c76 60 RTS ; update_game_with_stationary_player &1c77 20 dc 20 JSR &20dc ; wait_depending_on_player_speed ; update_game_with_moving_player &1c7a 20 f1 30 JSR &30f1 ; update_arrow &1c7d 4c 8d 33 JMP &338d ; update_bees ; wipe_screen &1c80 a9 60 LDA #&60 ; &6000 = start of screen_memory &1c82 85 71 STA &71 ; screen_address_high &1c84 a9 00 LDA #&00 &1c86 85 70 STA &70 ; screen_address_low &1c88 a8 TAY ; wipe_screen_loop &1c89 91 70 STA (&70),Y ; screen_address &1c8b c8 INY &1c8c d0 fb BNE &1c89 ; wipe_screen_loop &1c8e e6 71 INC &71 ; screen_address_high &1c90 10 f7 BPL &1c89 ; wipe_screen_loop &1c92 60 RTS ; display_status_screen &1c93 20 80 1c JSR &1c80 ; wipe_screen &1c96 20 91 25 JSR &2591 ; play_sound_6 &1c99 38 SEC &1c9a a5 80 LDA &80 ; crtc_screen_low &1c9c e9 22 SBC #&22 &1c9e 85 80 STA &80 ; crtc_screen_low &1ca0 b0 0c BCS &1cae ; skip_wrap_around &1ca2 c6 81 DEC &81 ; crtc_screen_high &1ca4 a5 81 LDA &81 ; crtc_screen_high &1ca6 c9 0b CMP #&0b &1ca8 d0 04 BNE &1cae ; skip_wrap_around &1caa a9 0f LDA #&0f &1cac 85 81 STA &81 ; crtc_screen_high ; skip_wrap_around &1cae 38 SEC &1caf a5 82 LDA &82 ; screen_start_address_low &1cb1 e9 10 SBC #&10 &1cb3 85 82 STA &82 ; screen_start_address_low &1cb5 8d 50 03 STA &0350 ; os_screen_start_address_low &1cb8 8d 4a 03 STA &034a ; os_text_cursor_address_low &1cbb a5 83 LDA &83 ; screen_start_address_high &1cbd e9 01 SBC #&01 &1cbf c9 60 CMP #&60 &1cc1 b0 03 BCS &1cc6 ; skip_wrap_around &1cc3 18 CLC &1cc4 69 20 ADC #&20 ; skip_wrap_around &1cc6 85 83 STA &83 ; screen_start_address_high &1cc8 8d 51 03 STA &0351 ; os_screen_start_address_high &1ccb 8d 4b 03 STA &034b ; os_text_cursor_address_high &1cce a9 0e LDA #&0e # R14: Memory-address of text-cursor (high) &1cd0 8d 00 fe STA &fe00 ; video register number &1cd3 a5 81 LDA &81 ; crtc_screen_high &1cd5 8d 01 fe STA &fe01 ; video register value &1cd8 a9 0f LDA #&0f # R15: Memory-address of text-cursor (low) &1cda 8d 00 fe STA &fe00 ; video register number &1cdd a5 80 LDA &80 ; crtc_screen_low &1cdf 8d 01 fe STA &fe01 ; video register value &1ce2 a9 0c LDA #&0c # R12: Displayed screen start address register (high) &1ce4 8d 00 fe STA &fe00 ; video register number &1ce7 a5 81 LDA &81 ; crtc_screen_high &1ce9 8d 01 fe STA &fe01 ; video register value &1cec a9 0d LDA #&0d # R13: Displayed screen start address register (low) &1cee 8d 00 fe STA &fe00 ; video register number &1cf1 a5 80 LDA &80 ; crtc_screen_low &1cf3 8d 01 fe STA &fe01 ; video register value &1cf6 20 ff 20 JSR &20ff ; plot_border &1cf9 20 d5 23 JSR &23d5 ; plot_pockets &1cfc 20 1a 24 JSR &241a ; tab_to_selected_pocket &1cff a9 5f LDA #&5f ; "_" &1d01 20 ee ff JSR &ffee ; OSWRCH &1d04 20 94 20 JSR &2094 ; display_collected_crucifix_sections &1d07 20 96 24 JSR &2496 ; check_for_examine_keypress &1d0a a2 00 LDX #&00 ; write_status_screen_text_loop &1d0c bd b8 5b LDA &5bb8,X ; status_screen_text &1d0f 20 ee ff JSR &ffee ; OSWRCH &1d12 e8 INX &1d13 e0 37 CPX #&37 &1d15 d0 f5 BNE &1d0c ; write_status_screen_text_loop &1d17 20 cb 1e JSR &1ecb ; display_sound_status &1d1a 20 44 21 JSR &2144 ; display_score &1d1d 20 6b 20 JSR &206b ; display_health &1d20 20 e3 1e JSR &1ee3 ; display_tune_status &1d23 a9 1f LDA #&1f &1d25 20 ee ff JSR &ffee ; OSWRCH &1d28 a9 02 LDA #&02 &1d2a 20 ee ff JSR &ffee ; OSWRCH &1d2d a9 18 LDA #&18 &1d2f 20 ee ff JSR &ffee ; OSWRCH &1d32 a2 00 LDX #&00 ; plot_spaces_loop &1d34 a9 20 LDA #&20 ; " " &1d36 20 ee ff JSR &ffee ; OSWRCH &1d39 e8 INX &1d3a e0 0c CPX #&0c &1d3c d0 f6 BNE &1d34 ; plot_spaces_loop ; status_screen_loop &1d3e e6 90 INC &90 ; player_y &1d40 20 85 1e JSR &1e85 ; plot_status_screen_lives &1d43 c6 90 DEC &90 ; player_y &1d45 20 57 1d JSR &1d57 ; check_for_status_screen_keypresses &1d48 20 ed 24 JSR &24ed ; check_for_screen_position_keypresses &1d4b 20 85 1e JSR &1e85 ; plot_status_screen_lives &1d4e 20 57 1d JSR &1d57 ; check_for_status_screen_keypresses &1d51 20 ed 24 JSR &24ed ; check_for_screen_position_keypresses &1d54 4c 3e 1d JMP &1d3e ; status_screen_loop ; check_for_status_screen_keypresses &1d57 a9 78 LDA #&78 &1d59 20 0a 27 JSR &270a ; short_delay &1d5c a5 ec LDA &ec ; Internal key number of most recently pressed key &1d5e 20 40 24 JSR &2440 ; check_for_object_change_keypresses &1d61 20 01 1f JSR &1f01 ; check_for_sound_keypresses &1d64 20 21 1f JSR &1f21 ; check_for_tune_keypresses &1d67 20 96 24 JSR &2496 ; check_for_examine_keypress &1d6a a5 ec LDA &ec ; Internal key number of most recently pressed key &1d6c c9 e2 CMP #&e2 ; SPACE &1d6e f0 01 BEQ &1d71 ; return_to_game &1d70 60 RTS ; return_to_game &1d71 68 PLA # Leave display_status_screen on exit &1d72 68 PLA ; scroll_onto_game &1d73 a5 95 LDA &95 ; player_facing &1d75 85 96 STA &96 ; previous_player_facing &1d77 a9 00 LDA #&00 &1d79 85 95 STA &95 ; player_facing &1d7b 38 SEC &1d7c a5 8f LDA &8f ; player_x &1d7e e9 07 SBC #&07 &1d80 85 8f STA &8f ; player_x &1d82 a9 01 LDA #&01 &1d84 85 99 STA &99 ; scrolling_into_game &1d86 38 SEC &1d87 a5 84 LDA &84 ; top_right_tile_address_low &1d89 e9 20 SBC #&20 &1d8b 85 84 STA &84 ; top_right_tile_address_low &1d8d a5 85 LDA &85 ; top_right_tile_address_high &1d8f e9 01 SBC #&01 &1d91 85 85 STA &85 ; top_right_tile_address_high &1d93 c6 88 DEC &88 ; top_left_tile_address_high &1d95 a9 03 LDA #&03 &1d97 85 86 STA &86 ; right_fraction &1d99 a9 00 LDA #&00 &1d9b 85 89 STA &89 ; left_fraction &1d9d 48 PHA ; scroll_onto_game_loop &1d9e c9 02 CMP #&02 &1da0 f0 0b BEQ &1dad ; skip_objects &1da2 29 03 AND #&03 &1da4 c9 02 CMP #&02 ; skip_objects &1da6 d0 05 BNE &1dad &1da8 20 4f 26 JSR &264f ; plot_objects &1dab e6 8f INC &8f ; player_x ; skip_objects &1dad a9 13 LDA #&13 ; Wait for Vertical Retrace &1daf 20 f4 ff JSR &fff4 ; OSBYTE &1db2 20 52 13 JSR &1352 ; scroll_screen_right &1db5 68 PLA &1db6 aa TAX &1db7 e8 INX &1db8 8a TXA &1db9 48 PHA &1dba c9 22 CMP #&22 &1dbc d0 e0 BNE &1d9e ; scroll_onto_game_loop &1dbe 68 PLA &1dbf 20 4f 26 JSR &264f ; plot_objects &1dc2 a5 96 LDA &96 ; previous_player_facing &1dc4 85 95 STA &95 ; player_facing &1dc6 a9 00 LDA #&00 &1dc8 85 99 STA &99 ; scrolling_into_game &1dca 85 96 STA &96 ; player_fraction &1dcc 4c cf 1d JMP &1dcf ; plot_player ; plot_player &1dcf a5 8d LDA &8d ; player_screen_address_low &1dd1 85 70 STA &70 ; screen_address_low &1dd3 a5 8e LDA &8e ; player_screen_address_high &1dd5 85 71 STA &71 ; screen_address_high &1dd7 a5 95 LDA &95 ; player_facing &1dd9 c9 02 CMP #&02 &1ddb 90 22 BCC &1dff ; facing_left_or_right &1ddd a9 00 LDA #&00 &1ddf 85 72 STA &72 ; sprite_address_low &1de1 a9 58 LDA #&58 ; &5800 = sprite_player_up &1de3 85 73 STA &73 ; sprite_address_high &1de5 a2 04 LDX #&04 # 16 pixels wide &1de7 a0 20 LDY #&20 # 32 pixels high &1de9 a5 90 LDA &90 ; player_y &1deb 29 01 AND #&01 &1ded d0 04 BNE &1df3 ; use_first_frame &1def a9 5a LDA #&5a ; &5a00 = sprite_player_up_frame_two &1df1 85 73 STA &73 ; sprite_address_high ; use_first_frame &1df3 a5 95 LDA &95 ; player_facing &1df5 c9 02 CMP #&02 &1df7 f0 03 BEQ &1dfc ; facing_up ; facing_down &1df9 4c 5e 19 JMP &195e ; plot_sprite_upside_down ; facing_up &1dfc 4c 70 19 JMP &1970 ; plot_sprite ; facing_left_or_right &1dff a9 59 LDA #&59 ; &5900 = sprite_player_left &1e01 85 73 STA &73 ; sprite_address_high &1e03 a2 00 LDX #&00 &1e05 a5 95 LDA &95 ; player_facing &1e07 d0 02 BNE &1e0b ; facing_left ; facing_right &1e09 a2 80 LDX #&80 ; &5980 = sprite_player_right ; facing_left &1e0b 86 72 STX &72 ; sprite_address_low &1e0d a2 04 LDX #&04 # 16 pixels wide &1e0f a0 20 LDY #&20 # 32 pixels high &1e11 a5 90 LDA &90 ; player_y &1e13 29 01 AND #&01 &1e15 f0 03 BEQ &1e1a ; upside_down &1e17 4c 70 19 JMP &1970 ; plot_sprite ; upside_down &1e1a 4c 5e 19 JMP &195e ; plot_sprite_upside_down ; plot_row_of_sprites &1e1d a9 00 LDA #&00 &1e1f 85 9c STA &9c ; sprites_plotted ; plot_row_of_sprites_loop &1e21 a5 9a LDA &9a ; next_screen_address_low &1e23 85 70 STA &70 ; screen_address_low &1e25 a5 9b LDA &9b ; next_screen_address_high &1e27 85 71 STA &71 ; screen_address_high &1e29 a9 00 LDA #&00 &1e2b 85 72 STA &72 ; sprite_address_low &1e2d a5 f9 LDA &f9 ; border_sprite_address_high &1e2f 85 73 STA &73 ; sprite_address_high &1e31 a2 04 LDX #&04 # 16 pixels wide &1e33 a0 20 LDY #&20 # 32 pixels high &1e35 20 ae 1b JSR &1bae ; other_sprite_plotter &1e38 e6 9c INC &9c ; sprites_plotted &1e3a a5 9c LDA &9c ; sprites_plotted &1e3c c9 08 CMP #&08 &1e3e f0 14 BEQ &1e54 ; leave &1e40 18 CLC &1e41 a5 9a LDA &9a ; next_screen_address_low &1e43 69 20 ADC #&20 &1e45 85 9a STA &9a ; next_screen_address_low &1e47 90 d8 BCC &1e21 ; plot_row_of_sprites_loop &1e49 e6 9b INC &9b ; next_screen_address_high &1e4b 10 d4 BPL &1e21 ; plot_row_of_sprites_loop &1e4d a9 60 LDA #&60 &1e4f 85 9b STA &9b ; next_screen_address_high &1e51 4c 21 1e JMP &1e21 ; plot_row_of_sprites_loop &1e54 60 RTS ; plot_column_of_sprites &1e55 a9 00 LDA #&00 &1e57 85 9c STA &9c ; sprites_plotted ; plot_column_of_sprites_loop &1e59 18 CLC &1e5a a5 9b LDA &9b ; next_screen_address_high &1e5c 69 04 ADC #&04 &1e5e 10 03 BPL &1e63 ; skip_wrap_around &1e60 38 SEC &1e61 e9 20 SBC #&20 ; skip_wrap_around &1e63 85 9b STA &9b ; next_screen_address_high &1e65 a5 9a LDA &9a ; next_screen_address_low &1e67 85 70 STA &70 &1e69 a5 9b LDA &9b ; next_screen_address_high &1e6b 85 71 STA &71 &1e6d a9 00 LDA #&00 &1e6f 85 72 STA &72 ; sprite_address_low &1e71 a5 f9 LDA &f9 ; border_sprite_address_high &1e73 85 73 STA &73 ; sprite_address_high &1e75 a2 04 LDX #&04 # 16 pixels wide &1e77 a0 20 LDY #&20 # 32 pixels high &1e79 20 ae 1b JSR &1bae ; other_sprite_plotter &1e7c e6 9c INC &9c ; sprites_plotted &1e7e a5 9c LDA &9c ; sprites_plotted &1e80 c9 06 CMP #&06 &1e82 d0 d5 BNE &1e59 ; plot_column_of_sprites_loop &1e84 60 RTS ; plot_status_screen_lives &1e85 a5 8d LDA &8d ; player_screen_address_low &1e87 85 9a STA &9a ; previous_player_screen_address_low &1e89 a5 8e LDA &8e ; player_screen_address_high &1e8b 85 9b STA &9b ; previous_player_screen_address_high &1e8d 18 CLC &1e8e a5 82 LDA &82 ; screen_start_address_low &1e90 69 40 ADC #&40 &1e92 85 8d STA &8d ; player_screen_address_low &1e94 a5 83 LDA &83 ; screen_start_address_high &1e96 69 16 ADC #&16 &1e98 10 03 BPL &1e9d ; skip_wrap_around &1e9a 38 SEC &1e9b e9 20 SBC #&20 ; skip_wrap_around &1e9d 85 8e STA &8e ; player_screen_address_high &1e9f a9 00 LDA #&00 &1ea1 85 9c STA &9c ; lives_plotted ; plot_status_screen_lives_loop &1ea3 20 cf 1d JSR &1dcf ; plot_player &1ea6 e6 9c INC &9c ; lives_plotted &1ea8 a5 9c LDA &9c ; lives_plotted &1eaa c5 7f CMP &7f ; player_lives &1eac f0 14 BEQ &1ec2 ; leave_restoring_player_screen_address &1eae 18 CLC &1eaf a5 8d LDA &8d ; player_screen_address_low &1eb1 69 30 ADC #&30 &1eb3 85 8d STA &8d ; player_screen_address_low &1eb5 90 ec BCC &1ea3 ; plot_status_screen_lives_loop &1eb7 e6 8e INC &8e ; player_screen_address_high &1eb9 10 e8 BPL &1ea3 ; plot_status_screen_lives_loop &1ebb a9 60 LDA #&60 &1ebd 85 8e STA &8e ; player_screen_address_high &1ebf 4c a3 1e JMP &1ea3 ; plot_status_screen_lives_loop ; leave_restoring_player_screen_address &1ec2 a5 9a LDA &9a ; previous_player_screen_address_low &1ec4 85 8d STA &8d ; player_screen_address_low &1ec6 a5 9b LDA &9b ; previous_player_screen_address_high &1ec8 85 8e STA &8e ; player_screen_address_high &1eca 60 RTS ; display_sound_status &1ecb a0 00 LDY #&00 &1ecd a2 00 LDX #&00 &1ecf ad 62 02 LDA &0262 ; sound_muted &1ed2 f0 02 BEQ &1ed6 ; write_sound_status_loop &ied4 a2 08 LDX #&08 ; write_sound_status_loop &1ed6 bd ef 5b LDA &5bef,X ; sound_status_strings &1ed9 20 ee ff JSR &ffee ; OSWRCH &1edc e8 INX &1edd c8 INY &1ede c0 08 CPY #&08 &1ee0 d0 f4 BNE &1ed6 ; write_sound_status_loop &1ee2 60 RTS ; display_tune_status &1ee3 a2 00 LDX #&00 &1ee5 a5 39 LDA &39 ; tune_muted &1ee7 d0 0c BNE &1ef5 ; write_tune_yes_loop &1ee9 bd d4 06 LDA &06d4,X ; tune_yes_string &1eec 20 ee ff JSR &ffee ; OSWRCH &1eef e8 INX &1ef0 e0 08 CPX #&08 &1ef2 d0 f5 BNE &1ee9 ; write_tune_yes_loop &1ef4 60 RTS ; write_tune_no_loop &1ef5 bd 37 01 LDA &0137,X ; tune_no_string &1ef8 20 ee ff JSR &ffee ; OSWRCH &1efb e8 INX &1efc e0 08 CPX #&08 &1efe d0 f5 BNE &1ef5 ; write_tune_no_loop &1f00 60 RTS ; check_for_sound_keypresses &1f01 a5 ec LDA &ec ; Internal key number of most recently pressed key &1f03 c9 a1 CMP #&a1 ; W &1f05 d0 08 BNE &1f0f ; w_not_pressed &1f07 a9 00 LDA #&00 &1f09 8d 62 02 STA &0262 ; sound_muted &1f0c 4c cb 1e JMP &1ecb ; display_sound_status ; w_not_pressed &1f0f c9 90 CMP #&90 ; Q &1f11 d0 0d BNE &1f20 ; q_not_pressed &1f13 a9 01 LDA #&01 &1f15 8d 62 02 STA &0262 ; sound_muted &1f18 85 39 STA &39 ; tune_muted &1f1a 20 e3 1e JSR &1ee3 ; display_tune_status &1f1d 4c cb 1e JMP &1ecb ; display_sound_status ; q_not_pressed &1f20 60 RTS ; check_for_tune_keypresses &1f21 ad 62 02 LDA &0262 ; sound_muted &1f24 f0 01 BEQ &1f27 ; sound_not_muted &1f26 60 RTS ; sound_not_muted &1f27 a5 ec LDA &ec ; Internal key number of most recently pressed key &1f29 c9 d1 CMP #&d1 ; S &1f2b d0 07 BNE &1f34 ; s_not_pressed &1f2d a9 00 LDA #&00 &1f2f 85 39 STA &39 ; tune_muted &1f31 4c e3 1e JMP &1ee3 ; display_tune_status ; s_not_pressed &1f34 a5 ec LDA &ec ; Internal key number of most recently pressed key &1f36 c9 c1 CMP #&c1 ; A &1f38 d0 07 BNE &1f41 ; a_not_pressed &1f3a a9 01 LDA #&01 &1f3c 85 39 STA &39 ; tune_muted &1f3e 4c e3 1e JMP &1ee3 ; display_tune_status ; a_not_pressed &1f41 60 RTS ; consider_if_player_can_push_cask_right &1f42 a5 98 LDA &98 ; scroll_effect &1f44 c9 02 CMP #&02 ; SCROLL_STRENGTH &1f46 d0 1f BNE &1f67 ; leave_parent # Player can't push cask if not strong &1f48 a2 0f LDX #&0f &1f4a a0 b0 LDY #&b0 ; CASK &1f4c a5 8c LDA &8c ; player_nibble &1f4e 29 01 AND #&01 &1f50 d0 04 BNE &1f56 ; use_bottom_nibble &1f52 a2 f0 LDX #&f0 &1f54 a0 0b LDY #&0b ; CASK ; use_bottom_nibble &1f56 86 9a STX &9a ; mask &1f58 84 9c STY &9c ; unused &1f5a 8a TXA &1f5b 49 ff EOR #&ff &1f5d 85 9b STA &9b ; inverse_mask &1f5f a0 40 LDY #&40 &1f61 b1 91 LDA (&91),Y ; player_tile_address &1f63 25 9b AND &9b ; inverse_mask &1f65 f0 03 BEQ &1f6a ; space_is_empy # Player can't move if space beyond cask isn't empty ; leave_parent &1f67 68 PLA &1f68 68 PLA &1f69 60 RTS ; space_is_empy &1f6a a6 8f LDX &8f ; player_x &1f6c e8 INX &1f6d a4 90 LDY &90 ; player_y &1f6f a9 00 LDA #&00 ; SPACE &1f71 85 93 STA &93 ; player_tile &1f73 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &1f76 20 81 24 JSR &2481 ; forget_last_change_of_tile &1f79 a6 8f LDX &8f ; player_x &1f7b e8 INX &1f7c e8 INX &1f7d a4 90 LDY &90 ; player_y &1f7f a9 0b LDA #&0b ; CASK &1f81 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &1f84 4c 81 24 JMP &2481 ; forget_last_change_of_tile ; consider_if_player_can_push_cask_left &1f87 a5 98 LDA &98 ; scroll_effect &1f89 c9 02 CMP #&02 ; SCROLL_STRENGTH &1f8b d0 1c BNE &1fa9 ; leave_parent # Player can't push cask if not strong &1f8d a6 8f LDX &8f ; player_x &1f8f ca DEX &1f90 a4 90 LDY &90 ; player_y &1f92 20 1b 28 JSR &281b ; calculate_tile_address &1f95 a2 f0 LDX #&f0 &1f97 a5 8c LDA &8c ; player_nibble &1f99 29 01 AND #&01 &1f9b d0 02 BNE &1f9f ; use_top_nibble &1f9d a2 0f LDX #&0f ; use_top_nibble &1f9f 86 9a STX &9a ; mask &1fa1 a0 00 LDY #&00 &1fa3 b1 9d LDA (&9d),Y ; tile_address &1fa5 25 9a AND &9a ; mask &1fa7 f0 10 BEQ &1fb9 ; space_is_empty # Player can't move if space beyond cask isn't empty ; leave_parent &1fa9 18 CLC &1faa a5 91 LDA &91 ; player_tile_address_low &1fac 69 20 ADC #&20 &1fae 85 91 STA &91 ; player_tile_address_low &1fb0 90 02 BCC &1fb4 &1fb2 e6 92 INC &92 ; player_tile_address_high &1fb4 e6 8f INC &8f ; player_x &1fb6 68 PLA &1fb7 68 PLA &1fb8 60 RTS ; space_is_empty &1fb9 e6 8f INC &8f ; player_x &1fbb a6 8f LDX &8f ; player_x &1fbd ca DEX &1fbe a4 90 LDY &90 ; player_y &1fc0 a9 00 LDA #&00 ; SPACE &1fc2 85 93 STA &93 ; player_tile &1fc4 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &1fc7 20 81 24 JSR &2481 ; forget_last_change_of_tile &1fca a6 8f LDX &8f ; player_x &1fcc ca DEX &1fcd ca DEX &1fce a4 90 LDY &90 ; player_y &1fd0 a9 0b LDA #&0b ; CASK &1fd2 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &1fd5 c6 8f DEC &8f ; player_x &1fd7 4c 81 24 JMP &2481 ; forget_last_change_of_tile ; consider_if_player_can_push_cask_down &1fda a5 98 LDA &98 ; scroll_effect &1fdc c9 02 CMP #&02 ; SCROLL_STRENGTH &1fde d0 1d BNE &1ffd ; leave_parent # Player can't push cask if not strong &1fe0 a6 8f LDX &8f ; player_x &1fe2 a4 90 LDY &90 ; player_y &1fe4 88 DEY &1fe5 88 DEY &1fe6 20 1b 28 JSR &281b ; calculate_tile_address &1fe9 a2 f0 LDX #&f0 &1feb a5 8c LDA &8c ; player_nibble &1fed 29 01 AND #&01 &1fef d0 02 BNE &1ff3 ; use_top_nibble &1ff1 a2 0f LDX #&0f ; use_top_nibble &1ff3 86 9a STX &9a ; mask &1ff5 a0 00 LDY #&00 &1ff7 b1 9d LDA (&9d),Y ; tile_address &1ff9 25 9a AND &9a ; mask &1ffb f0 03 BEQ &2000 ; space_is_empty # Player can't move if space beyond cask isn't empty ; leave_parent &1ffd 68 PLA &1ffe 68 PLA &1fff 60 RTS ; space_is_empty &2000 a6 8f LDX &8f ; player_x &2002 a4 90 LDY &90 ; player_y &2004 88 DEY &2005 a9 00 LDA #&00 ; SPACE &2007 85 93 STA &93 ; player_tile &2009 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &200c 20 81 24 JSR &2481 ; forget_last_change_of_tile &200f a6 8f LDX &8f ; player_x &2011 a4 90 LDY &90 ; player_y &2013 88 DEY &2014 88 DEY &2015 a9 0b LDA #&0b ; CASK &2017 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &201a 4c 81 24 JMP &2481 ; forget_last_change_of_tile ; consider_if_player_can_push_cask_up &201d a5 98 LDA &98 ; scroll_effect &201f c9 02 CMP #&02 ; SCROLL_STRENGTH &2021 d0 1d BNE &2040 ; leave_parent # Player can't push cask if not strong &2023 a6 8f LDX &8f ; player_x &2025 a4 90 LDY &90 ; player_y &2027 c8 INY &2028 c8 INY &2029 20 1b 28 JSR &281b ; calculate_tile_address &202c a2 f0 LDX #&f0 &202e a5 8c LDA &8c ; player_nibble &2030 29 01 AND #&01 &2032 d0 02 BNE &2036 ; use_top_nibble &2034 a2 0f LDX #&0f ; use_top_nibble &2036 86 9a STX &9a ; mask &2038 a0 00 LDY #&00 &203a b1 9d LDA (&9d),Y ; tile_address &203c 25 9a AND &9a ; mask &203e f0 03 BEQ &2043 ; space_is_empty # Player can't move if space beyond cask isn't empty ; leave_parent &2040 68 PLA &2041 68 PLA &2042 60 RTS ; space_is_empty &2043 a6 8f LDX &8f ; player_x &2045 a4 90 LDY &90 ; player_y &2047 c8 INY &2048 a9 00 LDA #&00 ; SPACE &204a 85 93 STA &93 ; player_tile &204c 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &204f 20 81 24 JSR &2481 ; forget_last_change_of_tile &2052 a9 0b LDA #&0b ; CASK &2054 a6 8f LDX &8f ; player_x &2056 a4 90 LDY &90 ; player_y &2058 c8 INY &2059 c8 INY &205a 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &205d 20 81 24 JSR &2481 ; forget_last_change_of_tile &2060 a5 8c LDA &8c ; player_nibble &2062 c6 91 DEC &91 ; player_tile_address_low &2064 29 01 AND #&01 &2066 f0 02 BEQ &206a &2068 e6 91 INC &91 ; player_tile_address_low &206a 60 RTS ; display_health &206b a2 00 LDX #&00 ; write_health_loop &206d bd 86 20 LDA &2086,X ; health_string &2070 20 ee ff JSR &ffee ; OSWRCH &2073 e8 INX &2074 e0 0e CPX #&0e &2076 d0 f5 BNE &206d ; write_health_loop &2078 b5 3c LDA &3c,X &207a 18 CLC &207b 69 30 ADC #&30 &207d 20 ee ff JSR &ffee ; OSWRCH &2080 e8 INX &2081 e0 11 CPX #&11 &2083 d0 f3 BNE &2078 &2085 60 RTS ; health_string &2086 1f 02 0c 11 01 68 e3 e0 e6 ec 68 3a 11 02 ; TAB(&02, &0c); COLOUR 1; "health:"; COLOUR 2 ; display_collected_crucifix_sections &2094 a9 00 LDA #&00 &2096 85 9c STA &9c ; section &2098 a5 9c LDA &9c ; section ; display_collected_crucifix_sections_loop &209a c5 6d CMP &6d ; current_level &209c f0 2d BEQ &20cb ; leave &209e 0a ASL A &209f 0a ASL A &20a0 aa TAX &20a1 bd cc 20 LDA &20cc,X ; crucifix_section_addresses &20a4 85 72 STA &72 ; sprite_address_low &20a6 bd cd 20 LDA &20cd,X ; crucifix_section_addresses + 1 &20a9 85 73 STA &73 ; sprite_address_high &20ab 18 CLC &20ac a5 82 LDA &82 ; screen_start_address_low &20ae 7d ce 20 ADC &20ce,X ; crucifix_section_addresses + 2 &20b1 85 70 STA &70 ; screen_address_low &20b3 a5 83 LDA &83 ; screen_start_address_high &20b5 7d cf 20 ADC &20cf,X ; crucifix_section_addresses + 3 &20b8 10 03 BPL &20bd ; skip_wrap_around &20ba 38 SEC &20bb e9 20 SBC #&20 ; skip_wrap_around &20bd 85 71 STA &71 ; screen_address_high &20bf a2 02 LDX #&02 # 8 pixels wide &20c1 a0 10 LDY #&10 # 16 pixels high &20c3 20 70 19 JSR &1970 ; plot_sprite &20c6 e6 9c INC &9c ; section &20c8 4c 98 20 JMP &2098 ; display_collected_crucifix_sections_loop &20cb 60 RTS ; crucifix_section_addresses &20cc 80 10 b0 08 ; &1080 = sprite_crucifix_tl &20d0 a0 10 0b 0a ; &10a0 = sprite_crucifix_bl &20d4 e0 10 c0 08 ; &10e0 = sprite_crucifix_tr &20d8 c0 10 c0 0a ; &10c0 = sprite_crucifix_br ; wait_depending_on_player_speed &20dc a5 98 LDA &98 ; scroll_effect &20de c9 09 CMP #&09 ; SCROLL_SPEED &20e0 f0 0b BEQ &20ed ; leave # No v-syncs if player under influence of SPEED scroll &20e2 a9 13 LDA #&13 ; Wait for Vertical Retrace &20e4 20 f4 ff JSR &fff4 ; OSBYTE &20e7 a6 49 LDX &49 ; potion_effect &20e9 e0 01 CPX #&01 ; POTION_SPEED &20eb d0 01 BNE &20ee ; not_fast # One v-sync if player under influence of SPEED potion ; leave &20ed 60 RTS ; not_fast &20ee a9 13 LDA #&13 ; Wait for Vertical Retrace &20f0 20 f4 ff JSR &fff4 ; OSBYTE # Two v-syncs ordinarily &20f3 a6 49 LDX &49 ; potion_effect &20f5 e0 02 CPX #&02 ; POTION_SLOW &20f7 d0 f4 BNE &20ed ; leave &20f9 20 f4 ff JSR &fff4 ; OSBYTE # Four v-syncs if player under influence of SLOW potion &20fc 4c f4 ff JMP &fff4 ; OSBYTE ; plot_border &20ff a9 5d LDA #&5d ; &5d00 = sprite_wall_stone &2101 85 f9 STA &f9 ; border_sprite_address_high ; plot_other_border &2103 a5 82 LDA &82 ; screen_start_address_low &2105 85 9a STA &9a ; next_screen_address_low &2107 a5 83 LDA &83 ; screen_start_address_high &2109 85 9b STA &9b ; next_screen_address_high &210b 20 1d 1e JSR &1e1d ; plot_row_of_sprites &210e 18 CLC &210f a5 83 LDA &83 ; screen_start_address_high &2111 69 1c ADC #&1c &2113 10 03 BPL &2118 ; skip_wrap_around &2115 38 SEC &2116 e9 20 SBC #&20 ; skip_wrap_around &2118 85 9b STA &9b ; next_screen_address_high &211a a5 82 LDA &82 ; screen_start_address_low &211c 85 9a STA &9a ; next_screen_address_low &211e 20 1d 1e JSR &1e1d ; plot_row_of_sprites &2121 a5 82 LDA &82 ; screen_start_address_low &2123 85 9a STA &9a ; next_screen_address_low &2125 a5 83 LDA &83 ; screen_start_address_high &2127 85 9b STA &9b ; next_screen_address_high &2129 20 55 1e JSR &1e55 ; plot_column_of_sprites &212c a5 83 LDA &83 ; screen_start_address_high &212e 85 9b STA &9b ; next_screen_address_high &2130 18 CLC &2131 a5 82 LDA &82 ; screen_start_address_low &2133 69 e0 ADC #&e0 &2135 85 9a STA &9a ; next_screen_address_low &2137 90 08 BCC &2141 ; skip_wrap_around &2139 e6 9b INC &9b ; next_screen_address_high &213b 10 04 BPL &2141 ; skip_wrap_around &213d a9 60 LDA #&60 &213f 85 9b STA &9b ; next_screen_address_high ; skip_wrap_around &2141 4c 55 1e JMP &1e55 ; plot_column_of_sprites ; display_score &2144 a9 1f LDA #&1f # TAB(&0d,&0b) &2146 20 ee ff JSR &ffee ; OSWRCH &2149 a9 0d LDA #&0d &214b 20 ee ff JSR &ffee ; OSWRCH &214e a9 0b LDA #&0b &2150 20 ee ff JSR &ffee ; OSWRCH &2153 a9 11 LDA #&11 # COLOUR 2 &2155 20 ee ff JSR &ffee ; OSWRCH &2158 a9 02 LDA #&02 &215a 20 ee ff JSR &ffee ; OSWRCH &215d 18 CLC &215e a5 7c LDA &7c ; score &2160 69 30 ADC #&30 &2162 20 ee ff JSR &ffee ; OSWRCH &2165 a5 7d LDA &7d ; score + 1 &2167 69 30 ADC #&30 &2169 4c ee ff JMP &ffee ; OSWRCH ; increase_score &216c 98 TYA &216d 18 CLC &216e 75 7c ADC &7c,X ; score &2170 95 7c STA &7c,X ; score &2172 c9 0a CMP #&0a &2174 90 14 BCC &218a ; leave &2176 38 SEC &2177 e9 0a SBC #&0a &2179 95 7c STA &7c,X ; score &217b f6 7b INC &7b,X ; score - 1 &217d b5 7b LDA &7b,X ; score - 1 &217f c9 0a CMP #&0a &2181 90 07 BCC &218a ; leave &2183 38 SEC &2184 e9 0a SBC #&0a &2186 95 7b STA &7b,X ; score - 1 &2188 f6 7a INC &7a,X ; score - 1 ; leave &218a 60 RTS ; initialise_bees &218b a9 03 LDA #&03 &218d 85 71 STA &71 ; initial_bee_data_address_low &218f a5 6d LDA &6d ; current_level &2191 0a ASL A &2192 0a ASL A &2193 0a ASL A &2194 0a ASL A &2195 18 CLC &2196 69 80 ADC #&80 ; &0380 = initial_bee_data &2198 85 70 STA &70 ; initial_bee_data_address_high &219a a0 00 LDY #&00 &219c a6 6d LDX &6d ; current_level &219e b5 45 LDA &45,X ; bee_data_size_per_level &21a0 85 44 STA &44 ; bee_data_size &21a2 a2 00 LDX #&00 ; initialise_bees_loop &21a4 c4 44 CPY &44 ; bee_data_size &21a6 f0 19 BEQ &21c1 ; leave &21a8 b1 70 LDA (&70),Y ; initial_bee_data_address &21aa 95 10 STA &10,X ; bees_x &21ac c8 INY &21ad b1 70 LDA (&70),Y ; initial_bee_data_address &21af 95 11 STA &11,X ; bees_y &21b1 a9 01 LDA #&01 ; LEFT &21b3 95 12 STA &12,X ; bees_direction &21b5 a9 00 LDA #&00 &21b7 95 13 STA &13,X ; bees_fraction &21b9 e8 INX &21ba e8 INX &21bb e8 INX &21bc e8 INX &21bd c8 INY &21be 4c a4 21 JMP &21a4 ; initialise_bees_loop &21c1 60 RTS ; check_if_picking_up_crucifix_section &21c2 a4 9f LDY &9f ; object_offset &21c4 c8 INY &21c5 b1 67 LDA (&67),Y ; object_data &21c7 c9 08 CMP #&08 # Is this part of the crucifix? &21c9 90 0c BCC &21d7 ; leave &21cb c9 0c CMP #&0c &21cd b0 08 BCS &21d7 ; leave # If not, leave &21cf a6 6d LDX &6d ; current_level &21d1 a5 3e LDA &3e ; treasure_collected &21d3 d5 3f CMP &3f,X ; treasure_needed &21d5 90 01 BCC &21d8 ; treasure_still_needed # Has the player collected all the treasure? ; leave &21d7 60 RTS ; treasure_still_needed # If not, &21d8 a5 82 LDA &82 ; screen_start_address_low &21da 8d 50 03 STA &0350 ; os_screen_start_address_low &21dd a5 83 LDA &83 ; screen_start_address_high &21df 8d 51 03 STA &0351 ; os_screen_start_address_high &21e2 a2 00 LDX #&00 ; write_treasure_loop # write message &21e4 bd 8d 06 LDA &068d,X ; treasure_string &21e7 20 ee ff JSR &ffee ; OSWRCH &21ea e8 INX &21eb e0 0e CPX #&0e &21ed d0 f5 BNE &21e4 ; write_treasure_loop &21ef c6 69 DEC &69 ; objects_carried &21f1 a9 02 LDA #&02 &21f3 20 1f 27 JSR &271f ; long_delay &21f6 68 PLA # Remove check_if_picking_up_crucifix_section &21f7 68 PLA &21f8 68 PLA # pick_up_object &21f9 68 PLA &21fa 68 PLA # and check_for_player_move from stack &21fb 68 PLA &21fc 4c 2d 11 JMP &112d ; return_to_game ; consider_if_time_shaft_open &21ff a5 6d LDA &6d ; current_level &2201 c9 03 CMP #&03 &2203 f0 01 BEQ &2206 ; is_level_three &2205 60 RTS ; is_level_three &2206 ad ad 3a LDA &3aad ; current_level_tiles + &15 * &20 + &0d # Are there casks in all four parts of the time shaft? &2209 c9 8b CMP #&8b ; WALL_TRIANGLE_TR | CASK &220b d0 5f BNE &226c ; leave &220d ad ed 3a LDA &3aed ; current_level_tiles + &17 * &20 + &0d &2210 c9 9b CMP #&9b ; WALL_TRIANGLE_TL | CASK &2212 d0 58 BNE &226c ; leave &2214 ad cd 3a LDA &3acd ; current_level_tiles + &16 * &20 + &0d &2217 c9 b4 CMP #&b4 ; CASK | PILLAR &2219 d0 51 BNE &226c ; leave &221b ad cc 3a LDA &3acc ; current_level_tiles + &16 * &20 + &0d &221e c9 b0 CMP #&b0 ; CASK | SPACE &2220 d0 4a BNE &226c ; leave &2222 20 3e 25 JSR &253e ; play_sound_2 &2225 a2 12 LDX #&12 # If so, remove them &2227 a0 23 LDY #&23 &2229 a9 00 LDA #&00 ; SPACE &222b 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &222e a2 13 LDX #&13 &2230 a0 23 LDY #&23 &2232 a9 00 LDA #&00 ; SPACE &2234 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2237 a2 11 LDX #&11 &2239 a0 23 LDY #&23 &223b a9 00 LDA #&00 ; SPACE &223d 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2240 a2 12 LDX #&12 &2242 a0 22 LDY #&22 &2244 a9 00 LDA #&00 ; SPACE &2246 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2249 a2 12 LDX #&12 &224b a0 24 LDY #&24 &224d a9 00 LDA #&00 ; SPACE &224f 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2252 a9 0a LDA #&0a ; CRUCIFIX_BR # and put the final crucifix section in the middle &2254 85 9c STA &9c ; object_sprite &2256 a0 02 LDY #&02 &2258 91 67 STA (&67),Y ; object_data &225a a0 00 LDY #&00 &225c a9 12 LDA #&12 &225e 85 9a STA &9a ; object_x &2260 91 67 STA (&67),Y ; object_data &2262 c8 INY &2263 a9 23 LDA #&23 &2265 85 9b STA &9b ; object_y &2267 91 67 STA (&67),Y ; object_data &2269 20 99 26 JSR &2699 ; plot_object_on_screen ; leave &226c 60 RTS ; check_for_key_swapping_trigger &226d a5 8f LDA &8f ; player_x &226f c9 0c CMP #&0c # Is the player at (&0c, &0f)? &2271 d0 16 BNE &2289 ; leave &2273 a5 90 LDA &90 ; player_y &2275 c9 0f CMP #&0f &2277 d0 10 BNE &2289 ; leave &2279 a5 3d LDA &3d ; key_right # If so, reverse the keys &227b a6 4e LDX &4e ; key_left &227d 85 4e STA &4e ; key_left &227f 86 3d STX &3d ; key_right &2281 a5 3c LDA &3c ; key_down &2283 a6 5c LDX &5c ; key_up &2285 86 3c STX &3c ; key_down &2287 85 5c STA &5c ; key_up ; leave &2289 60 RTS ; completion_screen &228a ad 7f 02 LDA &027f ; level_started_from &228d d0 3b BNE &22ca ; to_display_title_screen # Did the player start from level one? &228f a5 7f LDA &7f ; player_lives &2291 c9 03 CMP #&03 &2293 d0 35 BNE &22ca ; to_display_title_screen # Without losing any lives? &2295 e6 6d INC &6d ; current_level &2297 a9 0d LDA #&0d ; Disable Event &2299 a2 04 LDX #&04 ; vsync event &229b 20 f4 ff JSR &fff4 ; OSBYTE &229e 20 80 1c JSR &1c80 ; wipe_screen &22a1 a5 82 LDA &82 ; screen_start_address_low &22a3 8d 50 03 STA &0350 ; os_screen_start_address_low &22a6 a5 83 LDA &83 ; screen_start_address_high &22a8 8d 51 03 STA &0351 ; os_screen_start_address_high &22ab a9 0f LDA #&0f ; &0f00 = sprite_plant &22ad 85 f9 STA &f9 ; border_sprite_address_high &22af 20 03 21 JSR &2103 ; plot_other_border # If so, display the completion screen &22b2 20 94 20 JSR &2094 ; display_collected_crucifix_sections &22b5 a2 00 LDX #&00 ; write_well_done_done_it_loop &22b7 bd cd 22 LDA &22cd,X ; well_done_string &22ba 20 ee ff JSR &ffee ; OSWRCH &22bd e8 INX &22be e0 1c CPX #&1c &22c0 d0 f5 BNE &22b7 ; write_well_done_done_it_loop &22c2 a9 0f LDA #&0f ; Flush input buffer &22c4 20 f4 ff JSR &fff4 ; OSBYTE &22c7 20 e0 ff JSR &ffe0 ; OSRDCH ; to_display_title_screen &22ca 4c 8b 32 JMP &328b ; display_title_screen ; well_done_string &22cd 1f 07 0b 11 02 57 e3 e6 e6 20 e2 e9 e8 e3 1f 03 ; TAB(&07, &0b); COLOUR 2; "Well done" &22dd 10 11 01 44 e9 e8 e3 20 69 ec 20 21 ; TAB(&03, &10); COLOUR 1; "Done it !" ; pick_up_object &22e9 a5 95 LDA &95 ; player_facing &22eb d0 0f BNE &22fc ; player_not_moving_right ; player_moving_right &22ed a6 8f LDX &8f ; player_x &22ef e8 INX &22f0 a4 90 LDY &90 ; player_y &22f2 20 cb 23 JSR &23cb ; check_tile_for_collectable_object &22f5 a2 04 LDX #&04 &22f7 a0 03 LDY #&03 &22f9 4c 2e 23 JMP &232e ; check_for_empty_pocket ; player_not_moving_right &22fc c9 01 CMP #&01 &22fe d0 0f BNE &230f ; player_not_moving_left ; player_moving_left &2300 a6 8f LDX &8f ; player_x &2302 ca DEX &2303 a4 90 LDY &90 ; player_y &2305 20 cb 23 JSR &23cb ; check_tile_for_collectable_object &2308 a2 02 LDX #&02 &230a a0 03 LDY #&03 &230c 4c 2e 23 JMP &232e ; check_for_empty_pocket ; player_not_moving_left &230f c9 02 CMP #&02 &2311 d0 0f BNE &2322 ; player_moving_down ; player_moving_up &2313 a4 90 LDY &90 ; player_y &2315 c8 INY &2316 a6 8f LDX &8f ; player_x &2318 20 cb 23 JSR &23cb ; check_tile_for_collectable_object &231b a2 03 LDX #&03 &231d a0 02 LDY #&02 &231f 4c 2e 23 JMP &232e ; check_for_empty_pocket ; player_moving_down &2322 a4 90 LDY &90 ; player_y &2324 88 DEY &2325 a6 8f LDX &8f ; player_x &2327 20 cb 23 JSR &23cb ; check_tile_for_collectable_object &232a a2 03 LDX #&03 &232c a0 04 LDY #&04 ; check_for_empty_pocket &232e a5 69 LDA &69 ; objects_carried &2330 c9 03 CMP #&03 &2332 d0 01 BNE &2335 ; player_has_empty_pocket &2334 60 RTS ; player_has_empty_pocket &2335 85 66 STA &66 ; selected_pocket &2337 e6 69 INC &69 ; objects_carried &2339 20 c2 21 JSR &21c2 ; check_if_picking_up_crucifix_section # Leave if crucifix section, but missing treasure &233c a4 9f LDY &9f ; object_offset &233e 88 DEY &233f 84 73 STY &73 ; offset &2341 a9 f0 LDA #&f0 # Mark object as being collected &2343 91 67 STA (&67),Y ; object_data &2345 c8 INY &2346 c8 INY &2347 a6 69 LDX &69 ; objects_carried &2349 b1 67 LDA (&67),Y ; object_data &234b 95 69 STA &69,X ; pocket_object_sprite - 1 &234d a5 73 LDA &73 ; offset &234f 95 62 STA &62,X ; pocket_object_offset - 1 &2351 a9 00 LDA #&00 ; SPACE &2353 a6 f6 LDX &f6 ; pickup_relative_x &2355 a4 f7 LDY &f7 ; pickup_relative_y &2357 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &235a 20 81 24 JSR &2481 ; forget_last_change_of_tile &235d a6 69 LDX &69 ; objects_carried &235f ca DEX &2360 86 66 STX &66 ; selected_pocket &2362 a9 00 LDA #&00 &2364 85 96 STA &96 ; player_fraction &2366 b5 6a LDA &6a,X ; pocket_object_sprite &2368 c9 08 CMP #&08 # Is this part of the crucifix? &236a 90 5e BCC &23ca ; leave &236c c9 0c CMP #&0c &236e b0 5a BCS &23ca ; leave &2370 20 1b 2c JSR &2c1b ; undo_changes_to_level &2373 a9 00 LDA #&00 &2375 85 66 STA &66 ; selected_pocket &2377 85 69 STA &69 ; objects_carried &2379 85 70 STA &70 ; pitch &237b 20 75 29 JSR &2975 ; sound_and_light_show &237e a9 ff LDA #&ff &2380 85 6a STA &6a ; pocket_object_sprite &2382 85 6b STA &6b ; pocket_object_sprite + 1 &2384 85 6c STA &6c ; pocket_object_sprite + 2 &2386 a5 6d LDA &6d ; current_level &2388 c9 03 CMP #&03 &238a d0 03 BNE &238f ; not_completed &238c 4c 8a 22 JMP &228a ; completion_screen # Complete the game if it is the final part ; not_completed &238f e6 6d INC &6d ; current_level &2391 a5 7f LDA &7f ; player_lives &2393 c9 03 CMP #&03 &2395 d0 0a BNE &23a1 ; not_first_completion # Otherwise, if the player completed a level without &2397 ad 7e 02 LDA &027e ; maximum_completed_level # losing any lives, allow them to jump past it &239a c5 6d CMP &6d ; current_level &239c b0 03 BCS &23a1 ; not_first_completion &239e ee 7e 02 INC &027e ; maximum_completed_level ; not_first_completion &23a1 20 80 1c JSR &1c80 ; wipe_screen &23a4 20 15 25 JSR &2515 ; reset_health &23a7 20 03 12 JSR &1203 ; reset_screen &23aa 20 8b 21 JSR &218b ; initialise_bees &23ad a2 00 LDX #&00 &23af 86 3e STX &3e ; treasure_collected ; write_well_done_loop # Display level completion screen &23b1 bd cd 22 LDA &22cd,X ; well_done_string &23b4 20 ee ff JSR &ffee ; OSWRCH &23b7 e8 INX &23b8 e0 0e CPX #&0e &23ba d0 f5 BNE &23b1 ; write_well_done_loop &23bc 20 94 20 JSR &2094 ; display_collected_crucifix_sections &23bf a9 07 LDA #&07 &23c1 20 1f 27 JSR &271f ; long_delay &23c4 20 80 1c JSR &1c80 ; wipe_screen &23c7 4c 0e 2b JMP &2b0e ; level_title_screen ; leave &23ca 60 RTS ; check_tile_for_collectable_object &23cb 86 f6 STX &f6 ; pickup_relative_x &23cd 84 f7 STY &f7 ; pickup_relative_y &23cf 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leaves check_tile_for_collectable_object if object &23d2 68 PLA # Leaves pick_up_object is no object &23d3 68 PLA &23d4 60 RTS ; plot_pockets &23d5 18 CLC &23d6 a5 82 LDA &82 ; screen_start_address_low &23d8 69 40 ADC #&40 &23da 85 9d STA &9d ; pocket_screen_address_low &23dc a5 83 LDA &83 ; screen_start_address_high &23de 69 09 ADC #&09 &23e0 10 03 BPL &23e5 ; skip_wrap_around &23e2 38 SEC &23e3 e9 20 SBC #&20 ; skip_wrap_around &23e5 85 9e STA &9e ; pocket_screen_address_high &23e7 a9 00 LDA #&00 &23e9 85 9f STA &9f ; pocket_to_consider ; pockets_loop &23eb a6 9f LDX &9f ; pocket_to_consider &23ed b5 6a LDA &6a,X ; pocket_object_sprite &23ef c9 ff CMP #&ff &23f1 f0 0d BEQ &2400 ; empty_pocket &23f3 85 9c STA &9c ; object_sprite &23f5 a5 9d LDA &9d ; pocket_screen_address_low &23f7 85 70 STA &70 ; screen_address_low &23f9 a5 9e LDA &9e ; pocket_screen_address_high &23fb 85 71 STA &71 ; screen_address_high &23fd 20 a0 26 JSR &26a0 ; plot_object_with_given_address ; empty_pocket &2400 18 CLC &2401 a5 9d LDA &9d ; screen_start_address_low &2403 69 20 ADC #&20 &2405 85 9d STA &9d ; screen_start_address_low &2407 90 08 BCC &2411 ; skip_wrap_around &2409 e6 9e INC &9e ; pocket_screen_address_high &240b 10 04 BPL &2411 ; skip_wrap_around &240d a9 60 LDA #&60 &240f 85 9e STA &9e ; pocket_screen_address_high ; skip_wrap_around &2411 e6 9f INC &9f ; pocket_to_consider &2413 a5 9f LDA &9f ; pocket_to_consider &2415 c9 03 CMP #&03 &2417 d0 d2 BNE &23eb ; pockets_loop &2419 60 RTS ; tab_to_selected_pocket &241a a9 11 LDA #&11 # COLOUR 2 &241c 20 ee ff JSR &ffee ; OSWRCH &241f a9 02 LDA #&02 &2421 20 ee ff JSR &ffee ; OSWRCH &2424 a5 66 LDA &66 ; selected_pocket &2426 0a ASL A &2427 aa TAX &2428 a9 1f LDA #&1f &242a 20 ee ff JSR &ffee ; OSWRCH &242d bd 3a 24 LDA &243a,X ; pocket_tab_positions &2430 20 ee ff JSR &ffee ; OSWRCH &2433 bd 3b 24 LDA &243b,X ; pocket_tab_positions + 1 &2436 20 ee ff JSR &ffee ; OSWRCH &2439 60 RTS ; pocket_tab_positions &243a 00 09 02 09 04 09 ; check_for_object_change_keypresses &2440 c9 c2 CMP #&c2 ; X &2442 f0 05 BEQ &2449 ; x_pressed &2444 c9 e1 CMP #&e1 ; Z &2446 f0 1d BEQ &2465 ; z_pressed &2448 60 RTS ; x_pressed &2449 20 1a 24 JSR &241a ; tab_to_selected_pocket &244c a9 20 LDA #&20 ; " " &244e 20 ee ff JSR &ffee ; OSWRCH &2451 e6 66 INC &66 ; selected_pocket &2453 a5 66 LDA &66 ; selected_pocket &2455 c9 03 CMP #&03 &2457 d0 04 BNE &245d ; skip_wrap_to_left &2459 a9 00 LDA #&00 &245b 85 66 STA &66 ; selected_pocket ; skip_wrap_to_left &245d 20 1a 24 JSR &241a ; tab_to_selected_pocket &2460 a9 5f LDA #&5f ; "_" &2462 4c ee ff JMP &ffee ; OSWRCH ; z_pressed &2465 20 1a 24 JSR &241a ; tab_to_selected_pocket &2468 a9 20 LDA #&20 &246a 20 ee ff JSR &ffee ; OSWRCH &246d c6 66 DEC &66 ; selected_pocket &246f a5 66 LDA &66 ; selected_pocket &2471 c9 ff CMP #&ff &2473 d0 04 BNE &2479 ; skip_wrap_to_right &2475 a9 02 LDA #&02 &2477 85 66 STA &66 ; selected_pocket ; skip_wrap_to_right &2479 20 1a 24 JSR &241 ; tab_to_selected_pocketa &247c a9 5f LDA #&5f ; "_" &247e 4c ee ff JMP &ffee ; OSWRCH ; forget_last_change_of_tile &2481 c6 5d DEC &5d ; changes_offset &2483 c6 5d DEC &5d ; changes_offset &2485 c6 5d DEC &5d ; changes_offset &2487 60 RTS ; play_sound_at_x_y &2488 a9 07 LDA #&07 ; Generate a sound &248a 4c f1 ff JMP &fff1 ; OSWORD ; enable_vsync_events &248d a9 0e LDA #&0e ; Enable Event &248f a2 04 LDX #&04 ; vsync event &2491 a0 00 LDY #&00 &2493 4c f4 ff JMP &fff4 ; OSBYTE ; check_for_examine_keypress &2496 a5 ec LDA &ec ; Internal key number of most recently pressed key &2498 c9 a2 CMP #&a2 ; E &249a d0 50 BNE &24ec ; leave &249c a9 1f LDA #&1f # TAB(&03,&18) &249e 20 ee ff JSR &ffee ; OSWRCH &24a1 a9 03 LDA #&03 &24a3 20 ee ff JSR &ffee ; OSWRCH &24a6 a9 18 LDA #&18 &24a8 20 ee ff JSR &ffee ; OSWRCH &24ab a6 66 LDX &66 ; selected_pocket &24ad b5 6a LDA &6a,X ; pocket_object_sprite &24af c9 ff CMP #&ff &24b1 d0 01 BNE &24b4 ; pocket_contains_object &24b3 60 RTS ; pocket_contains_object &24b4 c9 0c CMP #&0c &24b6 90 03 BCC &24bb ; skip_crucifix_segments &24b8 38 SEC &24b9 e9 04 SBC #&04 ; skip_crucifix_segments &24bb a8 TAY &24bc a2 00 LDX #&00 ; find_object_string &24be c0 00 CPY #&00 &24c0 f0 0c BEQ &24ce ; write_first_object_string &24c2 88 DEY ; find_end_of_string &24c3 bd 00 0e LDA &0e00,X ; object_title_strings &24c6 e8 INX &24c7 c9 5a CMP #&5a &24c9 d0 f8 BNE &24c3 ; find_end_of_string &24cb 4c be 24 JMP &24be ; find_object_string ; write_first_object_string &24ce a0 00 LDY #&00 ; write_object_string &24d0 c8 INY &24d1 bd 00 0e LDA &0e00,X ; object_title_strings &24d4 c9 5a CMP #&5a &24d6 f0 07 BEQ &24df ; write_padding &24d8 20 ee ff JSR &ffee ; OSWRCH &24db e8 INX &24dc 4c d0 24 JMP &24d0 ; write_object_string ; write_padding &24df c0 0c CPY #&0c &24e1 f0 09 BEQ &24ec ; leave &24e3 a9 20 LDA #&20 ; " " &24e5 20 ee ff JSR &ffee ; OSWRCH &24e8 c8 INY &24e9 4c df 24 JMP &24df ; write_padding ; leave &24ec 60 RTS ; check_for_screen_position_keypresses &24ed a5 ec LDA &ec ; Internal key number of most recently pressed key &24ef c9 a9 CMP #&a9 ; DOWN &24f1 f0 17 BEQ &250a ; down_pressed &24f3 c9 b9 CMP #&b9 ; UP &24f5 d0 12 BNE &2509 ; leave ; up_pressed &24f7 a5 d1 LDA &d1 ; vertical_screen_position &24f9 c9 24 CMP #&24 &24fb f0 02 BEQ &24ff &24fd e6 d1 INC &d1 ; vertical_screen_position ; set_register &24ff a9 07 LDA #&07 # R7: Vertical sync position &2501 8d 00 fe STA &fe00 ; video register number &2504 a5 d1 LDA &d1 ; vertical_screen_position &2506 8d 01 fe STA &fe01 ; video register value ; leave &2509 60 RTS ; down_pressed &250a a5 d1 LDA &d1 ; vertical_screen_position &250c c9 1c CMP #&1c &250e f0 f9 BEQ &2509 ; leave &2510 c6 d1 DEC &d1 ; vertical_screen_position &2512 4c ff 24 JMP &24ff ; set_register ; reset_health &2515 a9 02 LDA #&02 &2517 85 4a STA &4a ; health &2519 a9 00 LDA #&00 &251b 85 4b STA &4b ; health + 1 &251d 85 4c STA &4c ; health + 2 &251f 60 RTS ; play_sound_0 # Used for treasure collection and bell &2520 a2 27 LDX #&27 &2522 a0 25 LDY #&25 ; &2527 = sound_0 &2524 4c 88 24 JMP &2488 ; play_sound_at_x_y ; sound_0 ; chan vol pitch dur &2527 01 00 02 00 6e 00 01 00 ; play_sound_1 # Used for scrolls, keys, etc &252f a2 36 LDX #&36 &2531 a0 25 LDY #&25 ; &2536 = sound_1 &2533 4c 88 24 JMP &2488 ; play_sound_at_x_y ; sound_1 ; chan vol pitch dur &2536 01 00 01 00 11 00 01 00 ; play_sound_2 # Used for player death and time shaft opening &253e a2 45 LDX #&45 &2540 a0 25 LDY #&25 ; &2545 = sound_2 &2542 4c 88 24 JMP &2488 ; play_sound_at_x_y ; sound_2 ; chan vol pitch dur &2545 01 00 03 00 40 00 0a 00 ; play_sound_3 # Used for doors closing, arrows, etc &254d a2 54 LDX #&54 &254f a0 25 LDY #&25 ; &2554 = sound_3 &2551 4c 88 24 JMP &2488 ; play_sound_at_x_y ; sound_3 ; chan vol pitch dur &2554 00 00 04 00 0d 00 01 00 ; play_time_door_opening_sound &255c a5 98 LDA &98 ; scroll_effect &255e c9 03 CMP #&03 ; SCROLL_TIME_CHIME &2560 f0 01 BEQ &2563 ; play_sound_4 &2562 60 RTS ; play_sound_4 # Used for time door opening &2563 a2 6a LDX #&6a &2565 a0 25 LDY #&25 ; &256a = sound_4 &2567 4c 88 24 JMP &2488 ; play_sound_at_x_y ; sound_4 ; chan vol pitch dur &256a 01 00 04 00 5a 00 01 00 ; play_time_chime &2572 a5 98 LDA &98 ; scroll_effect &2574 c9 03 CMP #&03 : SCROLL_TIME_CHIME &2576 f0 01 BEQ &2579 &2578 60 RTS &2579 a5 61 LDA &61 ; timer_low &257b 29 1f AND #&1f &257d c9 02 CMP #&02 &257f f0 01 BEQ &2582 ; play_sound_5 &2581 60 RTS ; play_sound_5 # Used for time chime &2582 a2 89 LDX #&89 &2584 a0 25 LDY #&25 ; &2589 = sound_5 &2586 4c 88 24 JMP &2488 ; play_sound_at_x_y ; sound_5 ; chan vol pitch dur &2589 00 00 f4 ff 04 00 01 00 ; play_sound_6 # Used for low health warning and status screen entry &2591 a2 98 LDX #&98 &2593 a0 25 LDY #&25 ; &2598 = sound_6 &2595 4c 88 24 JMP &2488 ; play_sound_at_x_y ; sound_6 ; chan vol pitch dur &2598 01 00 f1 ff c0 00 02 00 ; check_if_object_on_right_edge_of_screen &25a0 a5 8f LDA &8f ; player_x &25a2 18 CLC &25a3 69 03 ADC #&03 ; check_object_x &25a5 c5 9a CMP &9a ; object_x &25a7 d0 03 BNE &25ac ; leave &25a9 4c 99 26 JMP &2699 ; plot_object_on_screen ; leave &25ac 60 RTS ; check_if_object_on_left_edge_of_screen &25ad a5 8f LDA &8f ; player_x &25af 38 SEC &25b0 e9 03 SBC #&03 &25b2 4c a5 25 JMP &25a5 ; check_object_x ; check_if_object_on_top_edge_of_screen &25b5 a5 90 LDA &90 ; player_y &25b7 18 CLC &25b8 69 03 ADC #&03 &25ba 4c c2 25 JMP &25c2 ; check_object_y ; check_if_object_on_bottom_edge_of_screen &25bd a5 90 LDA &90 ; player_y &25bf 38 SEC &25c0 e9 03 SBC #&03 ; check_object_y &25c2 c5 9b CMP &9b ; object_y &25c4 d0 03 BNE &25c9 ; leave &25c6 4c 99 26 JMP &2699 ; plot_object_on_screen ; leave &25c9 60 RTS ; calculate_object_screen_address &25ca a9 18 LDA #&18 &25cc 85 70 STA &70 ; screen_address_offset_low &25ce a9 03 LDA #&03 ; &0318 # Middle of tile &25d0 85 71 STA &71 ; screen_address_offset_high &25d2 4c dd 25 JMP &25dd ; calculate_screen_address ; unused # Unused entry point &25d5 a9 10 LDA #&10 &25d7 85 70 STA &70 ; screen_address_offset_low &25d9 a9 02 LDA #&02 ; &0210 # Top left of tile &25db 85 71 STA &71 ; screen_address_offset_high ; calculate_screen_address &25dd 8a TXA &25de 38 SEC &25df e5 8f SBC &8f ; player_x &25e1 18 CLC &25e2 69 03 ADC #&03 &25e4 aa TAX &25e5 98 TYA &25e6 38 SEC &25e7 e5 90 SBC &90 ; player_y &25e9 49 03 EOR #&03 &25eb 10 03 BPL &25f0 ; calculate_screen_address_with_given_offsets &25ed 18 CLC &25ee 69 08 ADC #&08 &25f0 a8 TAY ; calculate_screen_address_with_given_offsets &25f1 18 CLC &25f2 a5 82 LDA &82 ; screen_start_address_low &25f4 65 70 ADC &70 ; screen_address_offset_low &25f6 85 70 STA &70 ; screen_address_low &25f8 a5 83 LDA &83 ; screen_start_address_high &25fa 65 71 ADC &71 ; screen_address_offset_high &25fc 85 71 STA &71 ; screen_address_high &25fe 8a TXA &25ff 0a ASL A &2600 0a ASL A &2601 0a ASL A &2602 0a ASL A &2603 0a ASL A &2604 18 CLC &2605 65 70 ADC &70 ; screen_address_low &2607 85 70 STA &70 ; screen_address_low &2609 90 02 BCC &260d &260b e6 71 INC &71 ; screen_address_high &260d 98 TYA &260e 0a ASL A &260f 0a ASL A &2610 18 CLC &2611 65 71 ADC &71 ; screen_address_high &2613 10 03 BPL &2618 ; skip_wrap_around &2615 38 SEC &2616 e9 20 SBC #&20 ; skip_wrap_around &2618 85 71 STA &71 ; screen_address_high &261a 60 RTS ; check_if_object_is_on_screen_x &261b a5 8f LDA &8f ; player_x &261d 18 CLC &261e 69 03 ADC #&03 &2620 c5 9a CMP &9a ; object_x &2622 b0 03 BCS &2627 ; check_left &2624 68 PLA &2625 68 PLA &2626 60 RTS ; check_left &2627 a5 8f LDA &8f ; player_x &2629 38 SEC &262a e9 04 SBC #&04 &262c 30 06 BMI &2634 ; leave &262e c5 9a CMP &9a ; object_x &2630 90 02 BCC &2634 ; leave &2632 68 PLA &2633 68 PLA ; leave &2634 60 RTS ; check_if_object_is_on_screen_y &2635 a5 90 LDA &90 ; player_y &2637 18 CLC &2638 69 03 ADC #&03 &263a c5 9b CMP &9b ; object_y &263c b0 03 BCS &2641 ; check_down &263e 68 PLA &263f 68 PLA &2640 60 RTS ; check_down &2641 a5 90 LDA &90 ; player_y &2643 38 SEC &2644 e9 04 SBC #&04 &2646 30 06 BMI &264e ; leave &2648 c5 9b CMP &9b ; object_y &264a 90 02 BCC &264e ; leave &264c 68 PLA &264d 68 PLA ; leave &264e 60 RTS ; plot_objects &264f a9 00 LDA #&00 &2651 85 9f STA &9f ; object_offset ; plot_objects_loop &2653 20 62 26 JSR &2662 ; plot_object &2656 18 CLC &2657 a5 9f LDA &9f ; object_offset &2659 69 05 ADC #&05 &265b 85 9f STA &9f ; object_offset &265d c9 3c CMP #&3c &265f d0 f2 BNE &2653 ; plot_objects_loop &2661 60 RTS ; plot_object &2662 a4 9f LDY &9f ; object_offset &2664 b1 67 LDA (&67),Y ; object_data &2666 aa TAX &2667 c8 INY &2668 c8 INY &2669 b1 67 LDA (&67),Y ; object_data &266b 85 9c STA &9c ; object_sprite &266d 88 DEY &266e b1 67 LDA (&67),Y ; object_data &2670 a8 TAY &2671 84 9b STY &9b ; object_y &2673 86 9a STX &9a ; object_x &2675 a5 95 LDA &95 ; player_facing &2677 d0 06 BNE &267f ; not_right ; player_moving_right &2679 20 35 26 JSR &2635 ; check_if_object_is_on_screen_y &267c 4c a0 25 JMP &25a0 ; check_if_object_on_right_edge_of_screen ; not_right &267f c9 01 CMP #&01 &2681 d0 06 BNE &2689 ; not_left ; player_moving_left &2683 20 35 26 JSR &2635 ; check_if_object_is_on_screen_y &2686 4c ad 25 JMP &25ad ; check_if_object_on_left_edge_of_screen ; not_left &2689 c9 02 CMP #&02 &268b d0 06 BNE &2693 ; not_up ; player_moving_up &268d 20 1b 26 JSR &261b ; check_if_object_is_on_screen_x &2690 4c b5 25 JMP &25b5 ; check_if_object_on_top_edge_of_screen ; player_moving_down &2693 20 1b 26 JSR &261b ; check_if_object_is_on_screen_x &2696 4c bd 25 JMP &25bd ; check_if_object_on_bottom_edge_of_screen ; plot_object_on_screen &2699 a6 9a LDX &9a ; object_x &269b a4 9b LDY &9b ; object_y &269d 20 ca 25 JSR &25ca ; calculate_object_screen_address ; plot_object_with_given_address &26a0 a5 9c LDA &9c ; object_sprite &26a2 0a ASL A &26a3 aa TAX &26a4 bd b5 26 LDA &26b5,X ; object_sprites_address_table &26a7 85 72 STA &72 ; sprite_address_low &26a9 bd b6 26 LDA &26b6,X ; object_sprites_address_table + 1 &26ac 85 73 STA &73 ; sprite_address_high &26ae a2 02 LDX #&02 # 8 pixels wide &26b0 a0 10 LDY #&10 # 16 pixels high &26b2 4c 70 19 JMP &1970 ; plot_sprite ; object_sprites_address_table &26b5 a0 57 ; &57a0 = sprite_key_gb &26b7 c0 57 ; &57c0 = sprite_scroll &26b9 e0 57 ; &57e0 = sprite_pickaxe &26bb 20 48 ; &4820 = sprite_detonator &2bbd 00 50 ; &5000 = sprite_dynamite &2bbf e0 4f ; &4fe0 = sprite_spade &26c1 c0 4f ; &4fc0 = sprite_key_mb &26c3 a0 4f ; &4fa0 = sprite_key_gm &26c5 80 10 ; &1080 = sprite_crucifix_tl &26c7 a0 10 ; &10a0 = sprite_crucifix_bl &2cc9 c0 10 ; &10c0 = sprite_crucifix_br &2ccb e0 10 ; &10e0 = sprite_crucifix_tr &2ccd e0 06 ; &06e0 = sprite_potion &2ccf 00 07 ; &0700 = sprite_scythe &26d1 20 07 ; &0720 = sprite_food &26d3 40 07 ; &0740 = sprite_wine &26d5 60 07 ; &0760 = sprite_bone &26d7 80 07 ; &0780 = sprite_empty_glass &26d9 a0 07 ; &07a0 = sprite_compass &26db c0 07 ; &07c0 = sprite_axe &26dd e0 07 ; &07e0 = sprite_cake &26df c0 03 ; &03c0 = sprite_bell &26e1 00 01 ; &0100 = sprite_bow_and_arrow ; consider_tile_for_object &26e3 86 9a STX &9a ; x &26e5 84 9b STY &9b ; y &26e7 a0 00 LDY #&00 ; consider_tile_for_object_loop &26e9 b1 67 LDA (&67),Y ; object_data &26eb c8 INY &26ec c5 9a CMP &9a ; x &26ee d0 11 BNE &2701 ; consider_next_object &26f0 b1 67 LDA (&67),Y ; object_data &26f2 c5 9b CMP &9b ; y &26f4 d0 0b BNE &2701 ; consider_next_object &26f6 a9 01 LDA #&01 &26f8 85 96 STA &96 ; player_fraction &26fa 84 9f STY &9f ; object_offset &26fc 85 93 STA &93 ; player_tile &26fe 68 PLA # Leave caller if object found &26ff 68 PLA &2700 60 RTS ; consider_next_object &2701 c8 INY &2702 c8 INY &2703 c8 INY &2704 c8 INY &2705 c0 3c CPY #&3c &2707 d0 e0 BNE &26e9 ; consider_tile_for_object_loop &2709 60 RTS ; short_delay &270a 85 72 STA &72 ; delay_length &270c a9 00 LDA #&00 &270e 85 70 STA &70 ; delay_low &2710 85 71 STA &71 ; delay_high ; short_delay_loop &2712 e6 70 INC &70 ; delay_low &2714 d0 fc BNE &2712 ; short_delay_loop &2716 e6 71 INC &71 ; delay_high &2718 a5 71 LDA &71 ; delay_high &271a c5 72 CMP &72 ; delay_length &271c d0 f4 BNE &2712 ; short_delay_loop &271e 60 RTS ; long_delay &271f 85 72 STA &72 ; delay_length &2721 a9 00 LDA #&00 &2723 85 71 STA &71 ; delay_high ; long_delay_loop &2725 e6 70 INC &70 ; delay_low &2727 d0 fc BNE &2725 ; long_delay_loop &2729 e6 71 INC &71 ; delay_high &272b d0 f8 BNE &2725 ; long_delay_loop &272d c6 72 DEC &72 ; delay_length &272f d0 f4 BNE &2725 ; long_delay_loop &2731 60 RTS ; screen_offsets_by_direction &2732 2f 01 ; right &2734 e8 01 ; left &2736 f8 01 ; up &2738 08 06 ; down ; x_y_offsets_by_direction &273a 01 00 ; right &273c ff 00 ; left &273e 00 01 ; up &2740 00 ff ; down ; drop_object &2742 a5 95 LDA &95 ; player_facing &2744 0a ASL A &2745 aa TAX &2746 c9 04 CMP #&04 &2748 f0 17 BEQ &2761 ; player_moving_up &274a 18 CLC &274b a5 8d LDA &8d ; player_screen_address_low &274d 7d 32 27 ADC &2732,X ; screen_offsets_by_direction &2750 85 9a STA &9a ; object_screen_address_low &2752 a5 8e LDA &8e ; player_screen_address_high &2754 7d 33 27 ADC &2733,X ; screen_offsets_by_direction &2757 10 03 BPL &275c ; skip_wrap_around &2759 38 SEC &275a e9 20 SBC #&20 ; skip_wrap_around &275c 85 9b STA &9b ; object_screen_address_high &275e 4c 77 27 JMP &2777 ; player_not_moving_up ; player_moving_up &2761 38 SEC &2762 a5 8d LDA &8d ; player_screen_address_low &2764 fd 32 27 SBC &2732,X ; screen_offsets_by_direction &2767 85 9a STA &9a ; object_screen_address_low &2769 a5 8e LDA &8e ; player_screen_address_high &276b fd 33 27 SBC &2733,X ; screen_offsets_by_direction &276e c9 60 CMP #&60 &2770 b0 03 BCS &2775 ; skip_wrap_around &2772 18 CLC &2773 69 20 ADC #&20 ; skip_wrap_around &2775 85 9b STA &9b ; object_screen_address_high ; player_not_moving_up &2777 a0 00 LDY #&00 &2779 b1 9a LDA (&9a),Y ; object_screen_address &277b d0 18 BNE &2795 ; leave &277d 18 CLC &277e a5 9a LDA &9a ; object_screen_address_low &2780 69 08 ADC #&08 &2782 85 9a STA &9a ; object_screen_address_low &2784 90 08 BCC &278e ; skip_wrap_around &2786 e6 9b INC &9b ; object_screen_address_high &2788 10 04 BPL &278e ; skip_wrap_around &278a a9 60 LDA #&60 &278c 85 9b STA &9b ; object_screen_address_high ; skip_wrap_around &278e b1 9a LDA (&9a),Y ; object_screen_address &2790 d0 03 BNE &2795 ; leave &2792 4c 96 27 JMP &2796 ; dropping_object_onto_space ; leave &2795 60 RTS ; dropping_object_onto_space &2796 bd 3b 27 LDA &273b,X ; x_y_offsets_by_direction + 1 &2799 48 PHA &279a 18 CLC &279b 65 90 ADC &90 ; player_y &279d 85 9f STA &9f ; object_y &279f 68 PLA &27a0 f0 02 BEQ &27a4 &27a2 49 fe EOR #&fe &27a4 18 CLC &27a5 69 03 ADC #&03 &27a7 a8 TAY &27a8 bd 3a 27 LDA &273a,X ; x_y_offsets_by_direction &27ab 48 PHA &27ac 18 CLC &27ad 65 8f ADC &8f ; player_x &27af 85 9e STA &9e ; object_x &27b1 68 PLA &27b2 18 CLC &27b3 69 03 ADC #&03 &27b5 aa TAX &27b6 a9 00 LDA #&00 &27b8 85 96 STA &96 ; player_fraction &27ba 86 70 STX &70 ; x &27bc a6 66 LDX &66 ; selected_pocket &27be b5 6a LDA &6a,X ; pocket_object_sprite &27c0 c9 ff CMP #&ff &27c2 d0 01 BNE &27c5 ; pocket_isn't_empty &27c4 60 RTS ; pocket_isn't_empty &27c5 a6 70 LDX &70 ; x &27c7 a9 18 LDA #&18 &27c9 85 70 STA &70 ; screen_address_offset_low &27cb a9 03 LDA #&03 &27cd 85 71 STA &71 ; screen_address_offset_high &27cf 20 f1 25 JSR &25f1 ; calculate_screen_address_with_given_offsets &27d2 a6 66 LDX &66 ; selected_pocket &27d4 b5 6a LDA &6a,X ; pocket_object_sprite &27d6 85 9c STA &9c ; object_sprite &27d8 20 a0 26 JSR &26a0 ; plot_object_with_given_address &27db a6 66 LDX &66 ; selected_pocket &27dd b5 63 LDA &63,X ; pocket_object_offset &27df a8 TAY &27e0 a5 9e LDA &9e ; object_x &27e2 91 67 STA (&67),Y ; object_data &27e4 c8 INY &27e5 a5 9f LDA &9f ; object_y &27e7 91 67 STA (&67),Y ; object_data &27e9 a5 6d LDA &6d ; current_level &27eb c9 02 CMP #&02 &27ed d0 0b BNE &27fa ; remove_object_from_pocket &27ef c8 INY &27f0 b1 67 LDA (&67),Y ; object_data &27f2 c9 01 CMP #&01 ; SCROLL &27f4 d0 04 BNE &27fa ; remove_object_from_pocket &27f6 a9 08 LDA #&08 ; SCROLL_DISPEL # Dropping the time chime scroll stops the effect &27f8 85 98 STA &98 ; scroll_effect ; remove_object_from_pocket &27fa c6 69 DEC &69 ; objects_carried &27fc a6 66 LDX &66 ; selected_pocket ; shuffle_pockets_loop &27fe e0 02 CPX #&02 &2800 f0 10 BEQ &2812 ; empty_last_pocket &2802 b5 6b LDA &6b,X ; pocket_object_sprite + 1 &2804 95 6a STA &6a,X ; pocket_object_sprite &2806 a9 ff LDA #&ff &2808 95 6b STA &6b,X ; pocket_object_sprite + 1 &280a b5 64 LDA &64,X ; pocket_object_offset + 1 &280c 95 63 STA &63,X ; pocket_object_offset &280e e8 INX &280f 4c fe 27 JMP &27fe ; shuffle_pockets_loop ; empty_last_pocket &2812 a9 ff LDA #&ff &2814 85 6c STA &6c ; pocket_object_sprite + 2 &2816 a9 00 LDA #&00 &2818 85 66 STA &66 ; selected_pocket &281a 60 RTS ; calculate_tile_address # Tile address is &389e - (y / 2) + (x * 32) &281b a9 9e LDA #&9e &281d 85 9d STA &9d ; tile_address_low &281f a9 38 LDA #&38 ; &389e = current_level_tiles + 30 + (4 * 32) &2821 85 9e STA &9e ; tile_address_high &2823 98 TYA &2824 4a LSR A &2825 85 9c STA &9c ; half_y &2827 38 SEC &2828 a5 9d LDA &9d ; tile_address_low &282a e5 9c SBC &9c ; half_y &282c 85 9d STA &9d ; tile_address_low &282e 8a TXA &282f 4a LSR A &2830 4a LSR A &2831 4a LSR A &2832 18 CLC &2833 65 9e ADC &9e ; tile_address_high &2835 85 9e STA &9e ; tile_address_high &2837 18 CLC &2838 8a TXA &2839 29 07 AND #&07 &283b 0a ASL A &283c 0a ASL A &283d 0a ASL A &283e 0a ASL A &283f 0a ASL A &2840 65 9d ADC &9d ; tile_address_low &2842 85 9d STA &9d ; tile_address_low &2844 a5 9e LDA &9e ; tile_address_high &2846 69 00 ADC #&00 &2848 85 9e STA &9e ; tile_address_high &284a 60 RTS ; plot_tile_a_at_position_x_y &284b 86 f6 STX &f6 ; x &284d 84 f7 STY &f7 ; y &284f 85 f9 STA &f9 ; tile &2851 a5 96 LDA &96 ; player_fraction &2853 85 70 STA &70 ; previous_player_fraction &2855 20 6d 29 JSR &296d ; check_for_object # Jumps to no_object_in_tile if no object &2858 a5 70 LDA &70 ; previous_player_fraction &285a 85 96 STA &96 ; player_fraction &285c a4 9f LDY &9f ; object_offset &285e a9 64 LDA #&64 &2860 91 67 STA (&67),Y ; object_data # Remove object from level ; no_object_in_tile &2862 a6 f6 LDX &f6 ; x &2864 a4 f7 LDY &f7 ; y &2866 38 SEC &2867 a5 82 LDA &82 ; screen_start_address_low &2869 e9 10 SBC #&10 &286b 85 70 STA &70 ; screen_address_low &286d a5 83 LDA &83 ; screen_start_address_high &286f e9 02 SBC #&02 &2871 c9 60 CMP #&60 &2873 b0 03 BCS &2878 ; skip_wrap_around &2875 18 CLC &2876 69 20 ADC #&20 ; skip_wrap_around &2878 85 71 STA &71 ; screen_address_high &287a 8a TXA &287b 38 SEC &287c e5 8f SBC &8f ; player_x &287e 18 CLC &287f 69 04 ADC #&04 &2881 aa TAX &2882 86 9a STX &9a ; relative_x &2884 84 9d STY &9d ; y &2886 38 SEC &2887 a5 90 LDA &90 ; player_y &2889 e5 9d SBC &9d ; y &288b 18 CLC &288c 69 04 ADC #&04 &288e a8 TAY &288f 84 9b STY &9b ; relative_y &2891 c0 09 CPY #&09 &2893 90 03 BCC &2898 ; on_screen_y &2895 4c 2b 29 JMP &292b ; set_tile_data ; on_screen_y &2898 e0 09 CPX #&09 &289a 90 03 BCC &289f ; on_screen_x &289c 4c 2b 29 JMP &292b ; set_tile_data ; on_screen_x &289f e0 08 CPX #&08 &28a1 f0 0d BEQ &28b0 ; last_column &28a3 8a TXA &28a4 0a ASL A &28a5 0a ASL A &28a6 0a ASL A &28a7 0a ASL A &28a8 0a ASL A &28a9 18 CLC &28aa 65 70 ADC &70 ; screen_address_low &28ac 85 70 STA &70 ; screen_address_low &28ae 90 02 BCC &28b2 ; last_column &28b0 e6 71 INC &71 ; screen_address_high &28b2 98 TYA &28b3 0a ASL A &28b4 0a ASL A &28b5 18 CLC &28b6 65 71 ADC &71 ; screen_address_high &28b8 10 03 BPL &28bd ; skip_wrap_around &28ba 38 SEC &28bb e9 20 SBC #&20 ; skip_wrap_around &28bd 85 71 STA &71 ; screen_address_high &28bf a9 04 LDA #&04 &28c1 85 74 STA &74 ; columns_to_plot &28c3 a9 20 LDA #&20 &28c5 85 76 STA &76 ; rows_to_plot &28c7 86 75 STX &75 ; rows &28c9 a5 f9 LDA &f9 ; tile &28cb 0a ASL A &28cc aa TAX &28cd bd d1 14 LDA &14d1,X ; current_sprite_address_table &28d0 85 72 STA &72 ; sprite_address_low &28d2 bd d2 14 LDA &14d2,X ; current_sprite_address_table + 1 &28d5 85 73 STA &73 ; sprite_address_high &28d7 a6 75 LDX &75 ; rows # ??? &28d9 e0 00 CPX #&00 &28db d0 1c BNE &28f9 &28dd a9 02 LDA #&02 &28df 85 74 STA &74 ; columns_to_plot &28e1 18 CLC &28e2 a5 72 LDA &72 ; sprite_address_low &28e4 69 40 ADC #&40 &28e6 85 72 STA &72 ; sprite_address_low &28e8 18 CLC &28e9 a5 70 LDA &70 ; screen_address_low &28eb 69 10 ADC #&10 &28ed 85 70 STA &70 ; screen_address_low &28ef 90 08 BCC &28f9 ; skip_wrap_around &28f1 e6 71 INC &71 ; screen_address_high &28f3 10 04 BPL &28f9 ; skip_wrap_around &28f5 a9 60 LDA #&60 &28f7 85 71 STA &71 ; screen_address_high ; skip_wrap_around &28f9 e0 08 CPX #&08 &28fb d0 04 BNE &2901 ; not_last_column_of_tiles &28fd a9 02 LDA #&02 &28ff 85 74 STA &74 ; columns_to_plot ; not_last_column_of_tiles &2901 c0 00 CPY #&00 &2903 d0 17 BNE &291c ; not_first_row_of_tiles &2905 a9 10 LDA #&10 &2907 85 76 STA &76 ; rows_to_plot &2909 18 CLC &290a a5 72 LDA &72 ; sprite_address_low &290c 69 10 ADC #&10 &290e 85 72 STA &72 ; sprite_address_low &2910 18 CLC &2911 a5 71 LDA &71 ; screen_address_high &2913 69 02 ADC #&02 &2915 10 03 BPL &291a ; skip_wrap_around &2917 38 SEC &2918 e9 20 SBC #&20 ; skip_wrap_around &291a 85 71 STA &71 ; screen_address_high ; not_first_row_of_tiles &291c c0 08 CPY #&08 &291e d0 04 BNE &2924 ; not_last_row_of_tiles &2920 a9 10 LDA #&10 &2922 85 76 STA &76 ; rows_to_plot ; not_last_row_of_tiles &2924 a6 74 LDX &74 ; columns_to_plot &2926 a4 76 LDY &76 ; rows_to_plot ; set_tile_operator &2928 20 ae 1b JSR &1bae ; other_sprite_plotter # also JMP &1bae ; other_sprite_plotter ; set_tile_data &292b a6 f6 LDX &f6 ; x &292d a4 f7 LDY &f7 ; y &292f 20 1b 28 JSR &281b ; calculate_tile_address &2932 a0 00 LDY #&00 &2934 a5 9d LDA &9d ; tile_address_low &2936 a6 5d LDX &5d ; changes_offset &2938 9d 80 05 STA &0580,X ; changes_table &293b a5 9e LDA &9e ; tile_address_high &293d 9d 81 05 STA &0581,X ; changes_table + 1 &2940 b1 9d LDA (&9d),Y ; tile_address &2942 9d 82 05 STA &0582,X ; changes_table + 2 &2945 e8 INX &2946 e8 INX &2947 e8 INX &2948 86 5d STX &5d ; changes_offset &294a a2 f0 LDX #&f0 &294c a4 f9 LDY &f9 ; tile &294e a5 f7 LDA &f7 ; y &2950 29 01 AND #&01 &2952 d0 09 BNE &295d ; use_top_nibble &2954 a2 0f LDX #&0f &2956 a5 f9 LDA &f9 ; tile &2958 0a ASL A &2959 0a ASL A &295a 0a ASL A &295b 0a ASL A &295c a8 TAY ; use_top_nibble &295d 84 9b STY &9b ; tile_as_nibble &295f 86 9a STX &9a ; mask &2961 a0 00 LDY #&00 &2963 b1 9d LDA (&9d),Y ; tile_address &2965 25 9a AND &9a ; mask &2967 18 CLC &2968 65 9b ADC &9b ; tile_as_nibble &296a 91 9d STA (&9d),Y ; tile_address &296c 60 RTS ; check_for_object &296d 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave check_for_object if object found &2970 68 PLA # Remove check_for_object from stack if no object found &2971 68 PLA &2972 4c 62 28 JMP &2862 ; no_object_in_tile ; sound_and_light_show &2975 a5 70 LDA &70 ; pitch &2977 8d 05 30 STA &3005 ; sound_7_pitch &297a a9 07 LDA #&07 ; Generate a sound &297c a2 01 LDX #&01 &297e a0 30 LDY #&30 ; &3001 = sound_7 &2980 20 f1 ff JSR &fff1 ; OSWORD &2983 a9 13 LDA #&13 &2985 20 ee ff JSR &ffee ; OSWRCH &2988 a9 03 LDA #&03 &298a 20 ee ff JSR &ffee ; OSWRCH &298d a5 70 LDA &70 ; pitch &298f 29 07 AND #&07 &2991 20 ee ff JSR &ffee ; OSWRCH &2994 a9 00 LDA #&00 &2996 20 ee ff JSR &ffee ; OSWRCH &2999 20 ee ff JSR &ffee ; OSWRCH &299c 20 ee ff JSR &ffee ; OSWRCH &299f 18 CLC &29a0 a5 70 LDA &70 ; pitch &29a2 69 03 ADC #&03 &29a4 85 70 STA &70 ; pitch &29a6 c9 b5 CMP #&b5 &29a8 90 cb BCC &2975 ; sound_and_light_show &29aa 60 RTS ; check_x_y_against_player_x_y &29ab e4 8f CPX &8f ; player_x &29ad d0 07 BNE &29b6 ; not_the_same &29af c4 90 CPY &90 ; player_y &29b1 d0 03 BNE &29b6 ; not_the_same &29b3 a9 00 LDA #&00 &29b5 60 RTS ; not_the_same &29b6 a9 01 LDA #&01 &29b8 60 RTS ; level_trigger_data_offsets &29b9 00 18 30 48 ; check_for_position_based_triggers &29bd a6 6d LDX &6d ; current_level &29bf bd b9 29 LDA &29b9,X ; level_trigger_data_offsets &29c2 18 CLC &29c3 69 ae ADC #&ae &29c5 85 0e STA &0e ; trigger_address_low &29c7 a9 2a LDA #&2a ; &2aae = level_trigger_data &29c9 69 00 ADC #&00 &29cb 85 0f STA &0f ; trigger_address_high &29cd a9 00 LDA #&00 &29cf 85 9a STA &9a ; trigger_offset ; check_for_position_based_triggers_loop &29d1 a4 9a LDY &9a ; trigger_offset &29d3 b1 0e LDA (&0e),Y ; trigger_address &29d5 aa TAX &29d6 c8 INY &29d7 b1 0e LDA (&0e),Y ; trigger_address &29d9 a8 TAY &29da 20 ab 29 JSR &29ab ; check_x_y_against_player_x_y &29dd c9 00 CMP #&00 &29df f0 0b BEQ &29ec ; position_matches_trigger &29e1 e6 9a INC &9a ; trigger_offset &29e3 e6 9a INC &9a ; trigger_offset &29e5 a5 9a LDA &9a ; trigger_offset &29e7 c9 18 CMP #&18 &29e9 d0 e6 BNE &29d1 ; check_for_position_based_triggers_loop &29eb 60 RTS ; position_matches_trigger &29ec a5 9a LDA &9a ; trigger_offset &29ee 4a LSR A &29ef 86 70 STX &70 ; x &29f1 aa TAX &29f2 b5 50 LDA &50,X ; trigger_states &29f4 f0 01 BEQ &29f7 ; trigger_not_yet_triggered # Has the trigger been previously triggered? If not, &29f6 60 RTS ; trigger_not_yet_triggered &29f7 a9 01 LDA #&01 # Mark the trigger as having been triggered &29f9 95 50 STA &50,X ; trigger_states &29fb a6 70 LDX &70 ; x &29fd e8 INX &29fe a5 9a LDA &9a ; trigger_offset &2a00 c9 06 CMP #&06 &2a02 90 11 BCC &2a15 ; shut_door # First three triggers add door to right of player &2a04 e8 INX &2a05 c9 08 CMP #&08 &2a07 b0 05 BCS &2a0e ; triggers_five_onwards &2a09 a9 03 LDA #&03 ; SPIKES &2a0b 4c 17 2a JMP &2a17 ; add_tile # Fourth trigger adds spikes two tile to right of player ; triggers_five_onwards &2a0e ca DEX &2a0f ca DEX &2a10 ca DEX # Fifth and sixth triggers add door to left of player &2a11 c9 0c CMP #&0c &2a13 b0 08 BCS &2a1d ; triggers_seven_onwards ; shut_door &2a15 a9 0a LDA #&0a ; DOOR ; add_tile &2a17 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2a1a 4c 4d 25 JMP &254d ; play_sound_3 ; triggers_seven_onwards &2a1d c9 10 CMP #&10 &2a1f b0 36 BCS &2a57 ; triggers_nine_onwards &2a21 c8 INY # Triggers seven and eight move two pillars above player &2a22 84 0f STY &0f ; trigger_y &2a24 c9 0e CMP #&0e &2a26 90 01 BCC &2a29 ; trigger_seven &2a28 ca DEX ; trigger_seven &2a29 86 0e STX &0e ; trigger_x &2a2b a9 01 LDA #&01 &2a2d 85 56 STA &56 ; triggers + 6 # Mark both triggers as being triggered by either &2a2f 85 57 STA &57 ; triggers + 7 &2a31 a9 00 LDA #&00 ; SPACE &2a33 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2a36 a6 0e LDX &0e ; trigger_x &2a38 e8 INX &2a39 a4 0f LDY &0f ; trigger_y &2a3b a9 04 LDA #&04 ; PILLAR &2a3d 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2a40 a4 0f LDY &0f ; trigger_y &2a42 a6 0e LDX &0e ; trigger_x &2a44 e8 INX &2a45 e8 INX &2a46 a9 04 LDA #&04 ; PILLAR &2a48 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y &2a4b a4 0f LDY &0f ; trigger_y &2a4d a6 0e LDX &0e ; trigger_x &2a4f e8 INX &2a50 e8 INX &2a51 e8 INX &2a52 a9 00 LDA #&00 &2a54 4c 17 2a JMP &2a17 ; add_tile ; triggers_nine_onwards &2a57 c9 12 CMP #&12 &2a59 b0 31 BCS &2a8c ; triggers_ten_onwards &2a5b e8 INX # Trigger nine moves spikes to right and below player &2a5c e8 INX &2a5d 86 0e STX &0e ; trigger_x &2a5f 84 0f STY &0f ; trigger_y &2a61 88 DEY &2a62 a9 00 LDA #&00 ; SPACE &2a64 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # (1, -1) becomes SPACE &2a67 a9 03 LDA #&03 ; SPIKES &2a69 a4 0f LDY &0f ; trigger_y &2a6b 88 DEY &2a6c a6 0e LDX &0e ; trigger_x &2a6e ca DEX &2a6f 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # (0, -1) becomes SPIKES &2a72 a6 0e LDX &0e ; trigger_x &2a74 a4 0f LDY &0f ; trigger_y &2a76 a9 03 LDA #&03 ; SPIKES &2a78 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # (1, 0) becomes SPIKES &2a7b a6 0e LDX &0e ; trigger_x &2a7d a4 0f LDY &0f ; trigger_y &2a7f c8 INY &2a80 a9 00 LDA #&00 ; SPACE &2a82 20 17 2a JSR &2a17 ; add_tile # (1, 1) becomes SPACE &2a85 c6 5d DEC &5d ; changes_offset &2a87 c6 5d DEC &5d ; changes_offset &2a89 c6 5d DEC &5d ; changes_offset &2a8b 60 RTS ; triggers_ten_onwards &2a8c c9 14 CMP #&14 &2a8e b0 0c BCS &2a9c ; triggers_eleven_onwards &2a90 a9 03 LDA #&03 ; SPIKES # Trigger ten adds spikes to left of player &2a92 20 17 2a JSR &2a17 ; add_tile &2a95 c6 5d DEC &5d ; changes_offset &2a97 c6 5d DEC &5d ; changes_offset &2a99 c6 5d DEC &5d ; changes_offset &2a9b 60 RTS ; triggers_eleven_onwards &2a9c c9 16 CMP #&16 &2a9e b0 07 BCS &2aa7 ; trigger_twelve &2aa0 e8 INX # Trigger eleven adds spikes above player &2aa1 c8 INY &2aa2 a9 03 LDA #&03 ; SPIKES &2aa4 4c 17 2a JMP &2a17 ; add_tile ; trigger_twelve &2aa7 e8 INX # Trigger twelve adds spikes below player &2aa8 88 DEY &2aa9 a9 03 LDA #&03 ; SPIKES &2aab 4c 17 2a JMP &2a17 ; add_tile ; level_trigger_data ; level 1 &2aae 24 35 ; DOOR (&25, &35) &2ab0 24 31 ; DOOR (&25, &31) &2ab2 26 35 ; DOOR (&27, &35) &2ab4 1c 14 ; SPIKES (&1e, &14) &2ab6 28 31 ; DOOR (&27, &31) &2ab8 ff ff ; unused &2aba 31 1c ; PILLARs (&31, &1d) and (&32, &1d) &2abc 32 1c ; PILLARs (&31, &1d) and (&32, &1d) &2abe 23 14 ; SPIKES (&23, &13) and (&24, &14) &2ac0 04 1e ; SPIKES (&03, &1e) &2ac2 ff ff ; unused &2ac4 ff ff ; unused ; level 2 &2ac6 1d 07 ; DOOR (&1e, &07) &2ac8 01 0e ; DOOR (&02, &0e) &2aca 2d 23 ; DOOR (&2d, &23) &2acc 0a 04 ; SPIKES (&0c, &04) &2ace 37 22 ; DOOR (&36, &22) &2ad0 07 00 ; DOOR (&06, &00) &2ad2 26 15 ; PILLARs (&26, &16) and (&27, &16) &2ad4 27 15 ; PILLARs (&26, &16) and (&27, &16) &2ad6 07 08 ; SPIKES (&07, &07) and (&08, &08) &2ad8 ff ff ; unused &2ada 02 05 ; SPIKES (&02, &06) &2adc 1c 1d ; SPIKES (&1c, &1c) ; level 3 &2ade 1c 14 ; DOOR (&1d, &14) &2ae0 26 29 ; DOOR (&27, &29) &2ae2 ff ff ; unused &2ae4 ff ff ; unused &2ae6 1e 17 ; DOOR (&1d, &17) &2ae8 0f 38 ; DOOR (&0e, &38) &2aea 2c 10 ; PILLARs (&2c, &11) and (&2d, &11) &2aec 2d 10 ; PILLARs (&2c, &11) and (&2d, &11) &2aee 0d 35 ; SPIKES (&0d, &34) and (&0e, &35) &2af0 ff ff ; unused &2af2 ff ff ; unused &2af4 29 1b ; SPIKES (&29, &1a) ; level 4 &2af6 33 2d ; DOOR (&34, &2d) &2af8 33 29 ; DOOR (&34, &29) &2afa 33 31 ; DOOR (&34, &31) &2afc 21 14 ; SPIKES (&23, &14) &2afe 34 21 ; DOOR (&33, &21) &2b00 1d 18 ; DOOR (&1c, &18) &2b02 36 1a ; PILLARs (&36, &1b) and (&37, &1b) &2b04 37 1a ; PILLARs (&36, &1b) and (&37, &1b) &2b06 06 3a ; SPIKES (&06, &39) and (&07, &3a) &2b08 ff ff ; unused &2b0a 23 15 ; SPIKES (&23, &16) &2b0c 0d 1e ; SPIKES (&0d, &1d) ; level_title_screen &2b0e 20 3f 33 JSR &333f ; initialise_sprite_address_table &2b11 a5 6d LDA &6d ; current_level &2b13 0a ASL A &2b14 0a ASL A &2b15 0a ASL A &2b16 0a ASL A &2b17 0a ASL A &2b18 0a ASL A &2b19 85 67 STA &67 ; object_data_address_low &2b1b a5 6d LDA &6d ; current_level &2b1d 20 87 2b JSR &2b87 ; swap_level_data_into_first_level_slot &2b20 a0 00 LDY #&00 ; copy_object_data_loop # Store object data prior to starting level &2b22 b1 67 LDA (&67),Y ; object_data &2b24 99 80 08 STA &0880,Y ; copy_of_object_data &2b27 c8 INY &2b28 c0 40 CPY #&40 &2b2a d0 f6 BNE &2b22 ; copy_object_data_loop &2b2c 20 7b 2f JSR &2f7b ; adjust_player_screen_address &2b2f 20 c0 2b JSR &2bc0 ; copy_treasure_and_casks_locations &2b32 a2 00 LDX #&00 ; write_level_loop &2b34 bd 77 2b LDA &2b77,X ; level_string &2b37 20 ee ff JSR &ffee ; OSWRCH &2b3a e8 INX &2b3b e0 0b CPX #&0b &2b3d d0 f5 BNE &2b34 ; write_level_loop &2b3f 18 CLC &2b40 a5 6d LDA &6d ; current_level &2b42 69 31 ADC #&31 &2b44 20 ee ff JSR &ffee ; OSWRCH &2b47 a2 00 LDX #&00 ; write_tab_loop &2b49 bd 82 2b LDA &2b82,X ; title_tab_string &2b4c 20 ee ff JSR &ffee ; OSWRCH &2b4f e8 INX &2b50 e0 05 CPX #&05 &2b52 d0 f5 BNE &2b49 ; write_tab_loop &2b54 a6 6d LDX &6d ; current_level &2b56 bd 73 2b LDA &2b73,X ; level_title_offsets &2b59 aa TAX ; write_title_loop &2b5a bd 40 01 LDA &0140,X ; level_title_strings &2b5d c9 5a CMP #&5a &2b5f f0 07 BEQ &2b68 ; end_of_title &2b61 20 ee ff JSR &ffee ; OSWRCH &2b64 e8 INX &2b65 4c 5a 2b JMP &2b5a ; write_title_loop ; end_of_title &2b68 a9 04 LDA #&04 &2b6a 20 1f 27 JSR &271f ; long_delay &2b6d 20 73 1d JSR &1d73 ; scroll_onto_game &2b70 4c 45 11 JMP &1145 ; main_game_loop ; level_title_offsets &2b73 00 17 25 34 ; level_string &2b77 1f 08 07 11 02 4c e3 ee e3 e6 20 ; TAB(&08, &07); COLOUR 2; "Level " ; title_tab_string &2b82 1f 01 0c 11 01 ; TAB(&01, &0c); COLOUR 1 ; swap_level_data_into_first_level_slot &2b87 0a ASL A &2b88 aa TAX &2b89 bd 9d 2c LDA &2c9d,X ; level_data_address_table &2b8c 85 70 STA &70 ; source_address_low &2b8e bd 9e 2c LDA &2c9e,X ; level_data_address_table + 1 &2b91 85 71 STA &71 ; source_address_high &2b93 a9 80 LDA #&80 &2b95 85 72 STA &72 ; target_address_low &2b97 a9 38 LDA #&38 ; &3800 = current_level_tiles &2b99 85 73 STA &73 ; target_address_high &2b9b a0 00 LDY #&00 ; swap_level_data_into_first_level_slot_loop &2b9d b1 70 LDA (&70),Y ; source_address &2b9f aa TAX &2ba0 b1 72 LDA (&72),Y ; target_address &2ba2 91 70 STA (&70),Y ; source_address &2ba4 8a TXA &2ba5 91 72 STA (&72),Y ; target_address &2ba7 e6 70 INC &70 ; source_address_low &2ba9 d0 02 BNE &2bad &2bab e6 71 INC &71 ; source_address_high &2bad e6 72 INC &72 ; target_address_low &2baf d0 02 BNE &2bb3 &2bb1 e6 73 INC &73 ; source_address_high &2bb3 a5 72 LDA &72 ; target_address_low &2bb5 c9 e0 CMP #&e0 &2bb7 90 e4 BCC &2b9d ; swap_level_data_into_first_level_slot_loop &2bb9 a5 73 LDA &73 ; target_address_high &2bbb c9 3f CMP #&3f ; &3fe0 = start of right edge of level border &2bbd d0 de BNE &2b9d ; swap_level_data_into_first_level_slot_loop &2bbf 60 RTS ; copy_treasure_and_casks_locations # Store locations of casks and treasure &2bc0 a0 00 LDY #&00 &2bc2 84 70 STY &70 ; tile_address_low &2bc4 84 5f STY &5f ; treasure_and_casks_count &2bc6 84 72 STY &72 ; copy_address_low &2bc8 a9 38 LDA #&38 ; &3800 = current_level_tiles &2bca 85 71 STA &71 ; tile_address_high &2bcc a9 04 LDA #&04 ; &0400 = treasure_and_casks_locations &2bce 85 73 STA &73 ; copy_address_high ; copy_treasure_and_casks_locations_loop &2bd0 b1 70 LDA (&70),Y ; tile_address &2bd2 29 0f AND #&0f ; TREASURE &2bd4 c9 0f CMP #&0f ; TREASURE &2bd6 f0 13 BEQ &2beb ; is_treasure_or_cask &2bd8 c9 0b CMP #&0b ; CASK &2bda f0 0f BEQ &2beb ; is_treasure_or_cask &2bdc b1 70 LDA (&70),Y ; tile_address &2bde 29 f0 AND #&f0 ; TREASURE &2be0 c9 f0 CMP #&f0; TREASURE &2be2 f0 07 BEQ &2beb ; is_treasure_or_cask &2be4 c9 b0 CMP #&b0 ; CASK &2be6 f0 03 BEQ &2beb ; is_treasure_or_cask &2be8 4c 0c 2c JMP &2c0c ; not_treasure_or_cask ; is_treasure_or_cask &2beb e6 5f INC &5f ; treasure_and_casks_count &2bed a0 00 LDY #&00 &2bef a5 70 LDA &70 ; tile_address_low &2bf1 91 72 STA (&72),Y ; copy_address &2bf3 a0 01 LDY #&01 &2bf5 a5 71 LDA &71 ; tile_address_high &2bf7 91 72 STA (&72),Y ; copy_address &2bf9 a0 00 LDY #&00 &2bfb b1 70 LDA (&70),Y ; tile_address &2bfd a0 02 LDY #&02 &2bff 91 72 STA (&72),Y ; copy_address &2c01 18 CLC &2c02 a5 72 LDA &72 ; copy_address_low &2c04 69 03 ADC #&03 &2c06 85 72 STA &72 ; copy_address_low &2c08 90 02 BCC &2c0cA ; not_treasure_or_cask &2c0a e6 73 INC &73 ; copy_address_high ; not_treasure_or_cask &2c0c a0 00 LDY #&00 &2c0e e6 70 INC &70 ; tile_address_low &2c10 d0 be BNE &2bd0 ; copy_treasure_and_casks_locations_loop &2c12 e6 71 INC &71 ; tile_address_high &2c14 a5 71 LDA &71 ; tile_address_high &2c16 c9 40 CMP #&40 &2c18 d0 b6 BNE &2bd0 ; copy_treasure_and_casks_locations_loop &2c1a 60 RTS ; undo_changes_to_level # Revert the level to its original state &2c1b a5 6d LDA &6d ; current_level &2c1d 29 03 AND #&03 &2c1f 85 0e STA &0e ; copy_of_level &2c21 a9 00 LDA #&00 &2c23 85 6d STA &6d ; current_level &2c25 20 3f 33 JSR &333f ; initialise_sprite_address_table &2c28 a5 0e LDA &0e ; copy_of_level &2c2a 85 6d STA &6d ; current_level &2c2c a6 5d LDX &5d ; changes_offset ; undo_changes_to_level_loop &2c2e e0 00 CPX #&00 &2c30 f0 17 BEQ &2c49 ; end_of_changes &2c32 ca DEX &2c33 ca DEX &2c34 ca DEX &2c35 bd 80 05 LDA &0580,X ; changes_table &2c38 85 70 STA &70 ; tile_address_low &2c3a bd 81 05 LDA &0581,X ; changes_table + 1 &2c3d 85 71 STA &71 ; tile_address_high &2c3f a0 00 LDY #&00 &2c41 bd 82 05 LDA &0582,X ; changes_table + 2 &2c44 91 70 STA (&70),Y ; tile_address &2c46 4c 2e 2c JMP &2c2e ; undo_changes_to_level_loop ; end_of_changes &2c49 a2 00 LDX #&00 &2c4b 86 5d STX &5d ; changes_offset &2c4d 20 a5 2c JSR &2ca5 ; remove_casks_from_level &2c50 a0 00 LDY #&00 ; restore_object_data_loop &2c52 b9 80 08 LDA &0880,Y ; copy_of_object_data &2c55 91 67 STA (&67),Y ; object_data &2c57 c8 INY &2c58 c0 40 CPY #&40 &2c5a d0 f6 BNE &2c52 ; restore_object_data_loop &2c5c a0 00 LDY #&00 &2c5e 84 70 STY &70 ; copy_address_low &2c60 a9 04 LDA #&04 ; &0400 = treasure_and_casks_locations &2c62 85 71 STA &71 ; copy_address_high ; restore_treasure_and_casks_loop &2c64 a5 5f LDA &5f ; treasure_and_casks_count &2c66 f0 24 BEQ &2c8c ; end_of_treasure_and_casks &2c68 b1 70 LDA (&70),Y ; copy_address &2c6a 85 72 STA &72 ; tile_address_low &2c6c c8 INY &2c6d b1 70 LDA (&70),Y ; copy_address &2c6f 85 73 STA &73 ; tile_address_high &2c71 c8 INY &2c72 b1 70 LDA (&70),Y ; copy_address &2c74 a0 00 LDY #&00 &2c76 91 72 STA (&72),Y ; tile_address &2c78 a0 00 LDY #&00 &2c7a c6 5f DEC &5f ; treasure_and_casks_count &2c7c 18 CLC &2c7d a5 70 LDA &70 ; copy_address_low &2c7f 69 03 ADC #&03 &2c81 85 70 STA &70 ; copy_address_low &2c83 a5 71 LDA &71 ; copy_address_high &2c85 69 00 ADC #&00 &2c87 85 71 STA &71 ; copy_address_high &2c89 4c 64 2c JMP &2c64 ; restore_treasure_and_casks_loop ; end_of_treasure_and_casks &2c8c a2 00 LDX #&00 ; reset_trigger_states_loop &2c8e a9 00 LDA #&00 &2c90 95 50 STA &50,X ; trigger_states &2c92 e8 INX &2c93 e0 0c CPX #&0c &2c95 d0 f7 BNE &2c8e ; reset_trigger_states_loop &2c97 a5 6d LDA &6d ; current_level &2c99 20 87 2b JSR &2b87 ; swap_level_data_into_first_level_slot &2c9c 60 RTS ; level_data_address_table &2c9d 80 38 ; &3880 = level_1_tiles &2c9f 60 40 ; &4060 = level_2_tiles &2ca1 40 48 ; &4840 = level_3_tiles &2ca3 20 50 ; &5020 = level_4_tiles ; remove_casks_from_level &2ca5 a0 00 LDY #&00 &2ca7 84 70 STY &70 ; tile_address_low &2ca9 a9 38 LDA #&38 ; &3800 = current_level_tiles &2cab 85 71 STA &71 ; tile_address_high ; remove_casks_from_level_loop &2cad b1 70 LDA (&70),Y ; tile_address &2caf 29 0f AND #&0f &2cb1 c9 0b CMP #&0b ; CASK &2cb3 d0 03 BNE &2cb8 ; not_cask_in_low_nibble &2cb5 20 cf 2c JSR &2ccf ; remove_cask ; not_cask_in_low_nibble &2cb8 b1 70 LDA (&70),Y ; tile_address &2cba 29 f0 AND #&f0 &2cbc c9 b0 CMP #&b0 ; CASK &2cbe d0 03 BNE &2cc3 ; not_cask_in_high_nibble &2cc0 20 cf 2c JSR &2ccf ; remove_cask ; not_cask_in_high_nibble &2cc3 c8 INY &2cc4 d0 e7 BNE &2cad ; remove_casks_from_level_loop &2cc6 e6 71 INC &71 ; tile_address_high &2cc8 a5 71 LDA &71 ; tile_address_high &2cca c9 40 CMP #&40 &2ccc d0 df BNE &2cad ; remove_casks_from_level_loop &2cce 60 RTS ; remove_cask &2ccf 85 73 STA &73 ; cask_nibble &2cd1 b1 70 LDA (&70),Y ; tile_address &2cd3 38 SEC &2cd4 e5 73 SBC &73 ; cask_nibble &2cd6 91 70 STA (&70),Y ; tile_address &2cd8 60 RTS ; use_object &2cd9 a6 66 LDX &66 ; selected_pocket &2cdb b5 6a LDA &6a,X ; pocket_object_sprite &2cdd c9 ff CMP #&ff &2cdf d0 01 BNE &2ce2 ; pocket_contains_object &2ce1 60 RTS ; pocket_contains_object &2ce2 b5 63 LDA &63,X ; pocket_object_offset &2ce4 a8 TAY &2ce5 c8 INY &2ce6 c8 INY &2ce7 c8 INY &2ce8 b1 67 LDA (&67),Y ; object_data &2cea 84 74 STY &74 ; object_offset_plus_three &2cec c9 ff CMP #&ff &2cee d0 01 BNE &2cf1 ; object_hasn't_been_used &2cf0 60 RTS ; object_hasn't_been_used &2cf1 88 DEY &2cf2 b1 67 LDA (&67),Y ; object_data &2cf4 c9 01 CMP #&01 ; SCROLL # Is the player using a scroll? &2cf6 d0 1b BNE &2d13 ; not_scroll &2cf8 a9 08 LDA #&08 # Set half of colour 0 to colour 1 for one flash cycle &2cfa 8d 20 fe STA &fe20 ; video ULA control register &2cfd c8 INY &2cfe b1 67 LDA (&67),Y ; object_data # Fourth byte of scroll data is magic effect &2d00 85 98 STA &98 ; scroll_effect &2d02 a9 ff LDA #&ff # Mark scroll as being used &2d04 91 67 STA (&67),Y ; object_data &2d06 20 2f 25 JSR &252f ; play_sound_1 &2d09 a2 01 LDX #&01 &2d0b a0 01 LDY #&01 &2d0d 20 6c 21 JSR &216c ; increase_score # 1% score for using scroll &2d10 4c c3 2f JMP &2fc3 ; apply_scroll_effect ; not_scroll &2d13 c9 00 CMP #&00 ; KEY_GB &2d15 f0 0b BEQ &2d22 ; is_key &2d17 c9 06 CMP #&06 ; KEY_MB &2d19 f0 07 BEQ &2d22 ; is_key &2d1b c9 07 CMP #&07 ; KEY_GM &2d1d f0 03 BEQ &2d22 ; is_key &2d1f 4c 7e 2d JMP &2d7e ; not_key ; is_key # Is the player using a key? &2d22 c8 INY &2d23 b1 67 LDA (&67),Y ; object_data # Fourth and fifth bytes of object data is door location &2d25 85 9a STA &9a ; key_x &2d27 c8 INY &2d28 b1 67 LDA (&67),Y ; object_data &2d2a 85 9b STA &9b ; key_y &2d2c 38 SEC &2d2d a5 8f LDA &8f ; player_x &2d2f e5 9a SBC &9a ; key_x &2d31 c9 ff CMP #&ff &2d33 f0 0c BEQ &2d41 ; x_matches &2d35 a6 8f LDX &8f ; player_x &2d37 e0 04 CPX #&04 &2d39 d0 01 BNE &2d3c &2d3b 60 RTS &2d3c c9 02 CMP #&02 &2d3e 90 01 BCC &2d41 ; x_matches &2d40 60 RTS ; x_matches &2d41 38 SEC &2d42 a5 90 LDA &90 ; player_y &2d44 e5 9b SBC &9b &2d46 c9 02 CMP #&02 &2d48 90 05 BCC &2d4f ; player_is_using_key_in_right_location &2d4a c9 ff CMP #&ff &2d4c f0 01 BEQ &2d4f ; player_is_using_key_in_right_location &2d4e 60 RTS ; player_is_using_key_in_right_location # If the player is close enough to the door, &2d4f a6 9a LDX &9a ; key_x &2d51 a4 9b LDY &9b ; key_y &2d53 20 1b 28 JSR &281b ; calculate_tile_address &2d56 a0 00 LDY #&00 &2d58 a2 0f LDX #&0f &2d5a a5 9b LDA &9b ; key_y &2d5c 29 01 AND #&01 &2d5e d0 02 BNE &2d62 ; use_low_nibble &2d60 a2 f0 LDX #&f0 ; use_low_nibble &2d62 86 70 STX &70 ; tile_nibble_mask &2d64 b1 9d LDA (&9d),Y ; tile_address &2d66 25 70 AND &70 ; tile_nibble_mask &2d68 d0 01 BNE &2d6b ; tile_not_empty # and the door hasn't already been opened, &2d6a 60 RTS ; tile_not_empty &2d6b 20 2f 25 JSR &252f ; play_sound_1 &2d6e a2 01 LDX #&01 &2d70 a0 01 LDY #&01 &2d72 20 6c 21 JSR &216c ; increase_score # 1% score for using key &2d75 a6 9a LDX &9a ; key_x &2d77 a4 9b LDY &9b ; key_y &2d79 a9 00 LDA #&00 ; SPACE &2d7b 4c 4b 28 JMP &284b ; plot_tile_a_at_position_x_y # Replace the DOOR with a SPACE ; not_key &2d7e c9 02 CMP #&02 ; PICKAXE &2d80 f0 0f BEQ &2d91 ; is_tool &2d82 c9 05 CMP #&05 ; SPADE &2d84 f0 0b BEQ &2d91 ; is_tool &2d86 c9 0d CMP #&0d ; SCYTHE &2d88 f0 07 BEQ &2d91 ; is_tool &2d8a c9 13 CMP #&13 ; AXE &2d8c f0 03 BEQ &2d91 ; is_tool &2d8e 4c 30 2e JMP &2e30 ; not_key ; is_tool # Is the player using a PICKAXE, SPADE, SCYTHE or AXE? &2d91 85 0f STA &0f ; tool_type &2d93 a6 8f LDX &8f ; player_x &2d95 a4 90 LDY &90 ; player_y &2d97 a5 95 LDA &95 ; player_facing # If so, determine the tile they're using it on &2d99 d0 01 BNE &2d9c ; player_isn't_facing_right &2d9b e8 INX ; player_isn't_facing_right &2d9c c9 01 CMP #&01 &2d9e d0 01 BNE &2da1 ; player_isn't_facing_left &2da0 ca DEX ; player_isn't_facing_left &2da1 c9 02 CMP #&02 &2da3 d0 01 BNE &2da6 ; player_isn't_facing_up &2da5 c8 INY ; player_isn't_facing_up &2da6 c9 03 CMP #&03 &2da8 d0 01 BNE &2dab ; player_isn't_facing_down &2daa 88 DEY ; player_isn't_facing_down &2dab 86 f6 STX &f6 ; target_x &2dad 84 f7 STY &f7 ; target_y &2daf 20 1b 28 JSR &281b ; calculate_tile_address &2db2 a0 00 LDY #&00 &2db4 a2 f0 LDX #&f0 &2db6 a5 f7 LDA &f7 ; target_y &2db8 29 01 AND #&01 &2dba f0 02 BEQ &2dbe ; use_high_nibble &2dbc a2 0f LDX #&0f &2dbe 86 9a STX &9a ; tile_nibble_mask &2dc0 b1 9d LDA (&9d),Y ; tile_address &2dc2 25 9a AND &9a ; tile_nibble_mask &2dc4 85 70 STA &70 ; target_tile &2dc6 a5 0f LDA &0f ; tool_type &2dc8 c9 13 CMP #&13 ; AXE &2dca d0 0b BNE &2dd7 ; not_axe &2dcc a5 70 LDA &70 ; target_tile # An AXE can cut through a DOOR &2dce c9 0a CMP #&0a ; DOOR &2dd0 f0 45 BEQ &2e17 ; tool_effective &2dd2 c9 a0 CMP #&a0 ; DOOR &2dd4 f0 41 BEQ &2e17 ; tool_effective &2dd6 60 RTS ; not_axe &2dd7 a5 6d LDA &6d ; current_level &2dd9 29 01 AND #&01 &2ddb d0 0b BNE &2de8 ; not_level_one_or_three &2ddd a5 70 LDA &70 ; target_tile # A PICKAXE can cut through a WALL &2ddf c9 02 CMP #&02 ; WALL &2de1 f0 34 BEQ &2e17 ; tool_effective &2de3 c9 20 CMP #&20 ; WALL &2de5 f0 30 BEQ &2e17 ; tool_effective &2de7 60 RTS ; not_level_one_or_three &2de8 a5 0f LDA &0f ; tool_type &2dea c9 05 CMP #&05 ; SPADE &2dec d0 0b BNE &2df9 ; is_scythe &2dee a5 70 LDA &70 ; target_tile # A SPADE can cut through EARTH (repeatedly) &2df0 c9 0e CMP #&0e ; EARTH &2df2 f0 10 BEQ &2e04 ; spade_effective &2df4 c9 e0 CMP #&e0 ; EARTH &2df6 f0 0c BEQ &2e04 ; spade_effective &2df8 60 RTS ; is_scythe &2df9 a5 70 LDA &70 ; target_tile # A SCYTHE can cut through PLANTs &2dfb c9 0c CMP #&0c ; PLANT &2dfd f0 18 BEQ &2e17 ; tool_effective &2dff c9 c0 CMP #&c0 ; PLANT &2e01 f0 14 BEQ &2e17 ; tool_effective &2e03 60 RTS ; spade_effective &2e04 a2 02 LDX #&02 &2e06 a0 01 LDY #&01 &2e08 20 6c 21 JSR &216c ; increase_score # 0.1% score for using SPADE &2e0b 20 4d 25 JSR &254d ; play_sound_3 &2e0e a6 f6 LDX &f6 ; target_x &2e10 a4 f7 LDY &f7 ; target_y &2e12 a9 00 LDA #&00 ; SPACE &2e14 4c 4b 28 JMP &284b ; plot_tile_a_at_position_x_y Replace target with SPACE ; tool_effective &2e17 a2 01 LDX #&01 &2e19 a0 01 LDY #&01 &2e1b 20 6c 21 JSR &216c ; increase_score # 1% score for using AXE, PICKAXE or SCYTHE &2e1e 20 4d 25 JSR &254d ; play_sound_3 &2e21 a4 74 LDY &74 ; object_offset_plus_three &2e23 a9 ff LDA #&ff # Mark AXE, PICKAXE or SCYTHE as having been used &2e25 91 67 STA (&67),Y ; object_data &2e27 a6 f6 LDX &f6 ; target_x &2e29 a4 f7 LDY &f7 ; target_y &2e2b a9 00 LDA #&00 &2e2d 4c 4b 28 JMP &284b ; plot_tile_a_at_position_x_y ; not_key &2e30 c9 03 CMP #&03 ; DETONATOR &2e32 f0 03 BEQ &2e37 ; is_detonator &2e34 4c c2 2e JMP &2ec2 ; not_detonator ; is_detonator # If the player is using the DETONATOR, &2e37 a0 02 LDY #&02 &2e39 a2 00 LDX #&00 ; find_dynamite_in_pockets &2e3b e0 03 CPX #&03 &2e3d f0 0d BEQ &2e4c ; find_dynamite_object &2e3f b5 6a LDA &6a,X ; pocket_object_sprite &2e41 e8 INX &2e42 c9 04 CMP #&04 ; DYNAMITE &2e44 d0 f5 BNE &2e3b ; find_dynamite_in_pockets &2e46 ca DEX &2e47 86 66 STX &66 ; selected_pocket &2e49 4c 71 2f JMP &2f71 ; explode_dynamite_and_kill_player # Kill them if they are also carrying the DYNAMITE ; find_dynamite_object_loop &2e4c b1 67 LDA (&67),Y ; object_data &2e4e c9 04 CMP #&04 ; DYNAMITE &2e50 f0 0a BEQ &2e5c ; found_dynamite # Otherwise, find where the DYNAMITE is on the level &2e52 c8 INY &2e53 c8 INY &2e54 c8 INY &2e55 c8 INY &2e56 c8 INY &2e57 c0 3e CPY #&3e &2e59 d0 f1 BNE &2e4c ; find_dynamite_object_loop &2e5b 60 RTS ; found_dynamite &2e5c a9 ff LDA #&ff &2e5e 91 67 STA (&67),Y ; object_data &2e60 88 DEY &2e61 b1 67 LDA (&67),Y ; object_data &2e63 85 0f STA &0f ; dynamite_y &2e65 a9 64 LDA #&64 # Remove the DYNAMITE from the level &2e67 91 67 STA (&67),Y ; object_data &2e69 88 DEY &2e6a b1 67 LDA (&67),Y ; object_data &2e6c 85 0e STA &0e ; dynamite_x &2e6e aa TAX &2e6f a4 0f LDY &0f ; dynamite_y &2e71 a9 00 LDA #&00 ; SPACE &2e73 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # Set the tile with the DYNAMITE to be a SPACE &2e76 a6 0e LDX &0e ; dynamite_x &2e78 e8 INX &2e79 a4 0f LDY &0f ; dynamite_y &2e7b a9 00 LDA #&00 ; SPACE &2e7d 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # Set the tile to the right to be a SPACE &2e80 a6 0e LDX &0e ; dynamite_x &2e82 ca DEX &2e83 a4 0f LDY &0f ; dynamite_y &2e85 a9 00 LDA #&00 ; SPACE &2e87 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # Set the tile to the left to be a SPACE &2e8a a6 0e LDX &0e ; dynamite_x &2e8c a4 0f LDY &0f ; dynamite_y &2e8e c8 INY &2e8f a9 00 LDA #&00 ; SPACE &2e91 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # Set the tile above to be a SPACE &2e94 a4 0f LDY &0f ; dynamite_y &2e96 a6 0e LDX &0e ; dynamite_x &2e98 88 DEY &2e99 c0 ff CPY #&ff &2e9b f0 05 BEQ &2ea2 ; skip_below &2e9d a9 00 LDA #&00 ; SPACE &2e9f 20 4b 28 JSR &284b ; plot_tile_a_at_position_x_y # Set the tile below to be a SPACE ; skip_below &2ea2 a5 8f LDA &8f ; player_x &2ea4 38 SEC &2ea5 e5 0e SBC &0e ; dynamite_x &2ea7 c9 ff CMP #&ff &2ea9 f0 14 BEQ &2ebf ; to_kill_player # If the player is too close, kill them &2eab c9 01 CMP #&01 &2ead f0 10 BEQ &2ebf ; to_kill_player &2eaf a5 90 LDA &90 ; player_y &2eb1 38 SEC &2eb2 e5 0f SBC &0f ; dynamite_y &2eb4 c9 ff CMP #&ff &2eb6 f0 07 BEQ &2ebf ; to_kill_player &2eb8 c9 01 CMP #&01 &2eba f0 03 BEQ &2ebf ; to_kill_player &2ebc 4c 4d 25 JMP &254d ; play_sound_3 # Play a sound for exploding dynamite ; to_kill_player &2ebf 4c e3 1a JMP &1ae3 ; kill_player ; not_detonator &2ec2 c9 0e CMP #&0e ; FOOD &2ec4 d0 14 BNE &2eda ; not_food # If the player is using FOOD, &2ec6 e6 4a INC &4a ; health # Gain 100 health points &2ec8 a6 66 LDX &66 ; selected_pocket &2eca a9 10 LDA #&10 ; BONE &2ecc 95 6a STA &6a,X ; pocket_object_sprite # Replace with BONE in pocket &2ece b5 63 LDA &63,X ; pocket_object_offset &2ed0 a8 TAY &2ed1 c8 INY &2ed2 c8 INY &2ed3 a9 10 LDA #&10 ; BONE &2ed5 91 67 STA (&67),Y ; object_data &2ed7 4c 2f 25 JMP &252f ; play_sound_1 ; not_food &2eda c9 0f CMP #&0f ; WINE &2edc d0 30 BNE &2f0e ; not_wine # If the player is using WINE, &2ede e6 4a INC &4a ; health # Gain 100 health points for using WINE &2ee0 ea NOP &2ee1 ea NOP &2ee2 20 2f 25 JSR &252f ; play_sound_1 &2ee5 a5 3d LDA &3d ; key_right # Invert left and right keys &2ee7 aa TAX &2ee8 a5 4e LDA &4e ; key_left &2eea 85 3d STA &3d ; key_right &2eec 86 4e STX &4e ; key_left &2eee a9 e1 LDA #&e1 ; Z # Then ignore that, and confuse all four direction keys &2ef0 85 3d STA &3d ; key_right &2ef2 a9 c8 LDA #&c8 ; * &2ef4 85 3c STA &3c ; key_down &2ef6 a9 e8 LDA #&e8 ; ? &2ef8 85 5c STA &5c ; key_up &2efa a9 c2 LDA #&c2 ; X &2efc 85 4e STA &4e ; key_left &2efe a6 66 LDX &66 ; selected_pocket &2f00 a9 11 LDA #&11 ; EMPTY_GLASS &2f02 95 6a STA &6a,X ; pocket_object_sprite # Replace with EMPTY_GLASS in pocket &2f04 b5 63 LDA &63,X ; pocket_object_offset &2f06 a8 TAY &2f07 c8 INY &2f08 c8 INY &2f09 a9 11 LDA #&11 ; EMPTY_GLASS &2f0b 91 67 STA (&67),Y ; object_data &2f0d 60 RTS ; not_wine &2f0e c9 0c CMP #&0c ; POTION &2f10 d0 1c BNE &2f2e ; not_potion # If the player is using a POTION, &2f12 a4 74 LDY &74 ; object_offset_plus_three &2f14 b1 67 LDA (&67),Y ; object_data &2f16 85 49 STA &49 ; potion_effect &2f18 a9 ff LDA #&ff # Mark potion as having been used &2f1a 91 67 STA (&67),Y ; object_data &2f1c a2 01 LDX #&01 &2f1e a0 01 LDY #&01 &2f20 20 6c 21 JSR &216c ; increase_score # 1% score for using potion &2f23 a9 08 LDA #&08 &2f25 8d 20 fe STA &fe20 ; video ULA control register # Set half of colour 0 to colour 1 for one flash cycle &2f28 20 2f 25 JSR &252f ; play_sound_1 &2f2b 4c 29 33 JMP &3329 ; conditionally_empty_all_pockets # Lose all objects if POTION_LOSER ; not_potion &2f2e c9 12 CMP #&12 ; COMPASS &2f30 d0 14 BNE &2f46 ; not_compass # If the player is using the COMPASS, &2f32 20 4d 25 JSR &254d ; play_sound_3 &2f35 a9 c2 LDA #&c2 ; X # Reset all four directional keys &2f37 85 3d STA &3d ; key_right &2f39 a9 e8 LDA #&e8 ; ? &2f3b 85 3c STA &3c ; key_down &2f3d a9 c8 LDA #&c8 ; * &2f3f 85 5c STA &5c ; key_up &2f41 a9 e1 LDA #&e1 ; Z &2f43 85 4e STA &4e ; key_left &2f45 60 RTS ; not_compass &2f46 c9 14 CMP #&14 ; CAKE &2f48 d0 15 BNE &2f5f ; not_cake # If the player is using the CAKE, &2f4a a9 02 LDA #&02 ; SCROLL_STRENGTH &2f4c 85 98 STA &98 ; scroll_effect # Give them strength &2f4e a4 74 LDY &74 ; object_offset_plus_three &2f50 a9 64 LDA #&64 # ??? &2f52 91 67 STA (&67),Y ; object_data &2f54 88 DEY &2f55 91 67 STA (&67),Y ; object_data &2f57 e6 4a INC &4a ; health # Gain 100 health points &2f59 20 2f 25 JSR &252f ; play_sound_1 &2f5c 4c fa 27 JMP &27fa ; remove_object_from_pocket ; not_cake &2f5f c9 16 CMP #&16 ; BOW_AND_ARROW &2f61 d0 03 BNE &2f66 ; not_bow_and_arrow # If the player is using the BOW_AND_ARROW, &2f63 4c 09 30 JMP &3009 ; fire_arrow # fire arrow ; not_bow_and_arrow &2f66 c9 15 CMP #&15 ; BELL &2f68 d0 03 BNE &2f6d ; not_bell # If the player is using the BELL, &2f6a 4c 20 25 JMP &2520 ; play_sound_0 # play a sound ; not_bell &2f6d c9 04 CMP #&04 ; DYNAMITE &2f6f d0 09 BNE &2f7a ; leave # If the player is using the DYNAMITE, ; explode_dynamite_and_kill_player &2f71 20 4d 25 JSR &254d ; play_sound_3 # play a sound for it exploding, &2f74 20 fa 27 JSR &27fa ; remove_object_from_pocket # remove it from their pocket, &2f77 4c e3 1a JMP &1ae3 ; kill_player # and kill them ; leave &2f7a 60 RTS ; adjust_player_screen_address &2f7b 18 CLC &2f7c a5 8d LDA &8d ; player_screen_address_low &2f7e 69 10 ADC #&10 &2f80 85 8d STA &8d ; player_screen_address_low &2f82 a5 8e LDA &8e ; player_screen_address_high &2f84 69 01 ADC #&01 &2f86 10 03 BPL &2f8b ; skip_wrap_around &2f88 38 SEC &2f89 e9 20 SBC #&20 ; skip_wrap_around &2f8b 85 8e STA &8e ; player_screen_address_high &2f8d 60 RTS ; teleport_player &2f8e a9 00 LDA #&00 &2f90 85 70 STA &70 ; pitch &2f92 20 75 29 JSR &2975 ; sound_and_light_show &2f95 20 80 1c JSR &1c80 ; wipe_screen &2f98 20 03 12 JSR &1203 ; reset_screen &2f9b a2 01 LDX #&01 &2f9d 86 86 STX &86 ; right_fraction &2f9f ca DEX &2fa0 86 8c STX &8c ; player_nibble &2fa2 a9 03 LDA #&03 &2fa4 85 90 STA &90 ; player_y &2fa6 a9 fb LDA #&fb &2fa8 85 84 STA &84 ; top_right_tile_address_low &2faa 85 87 STA &87 ; top_left_tile_address_low &2fac a2 3f LDX #&3f &2fae 86 85 STX &85 ; top_right_tile_address_high &2fb0 86 92 STX &92 ; player_tile_address_high &2fb2 ca DEX &2fb3 86 88 STX &88 ; top_left_tile_address_high &2fb5 a9 7d LDA #&7d &2fb7 85 91 STA &91 ; player_tile_address_low &2fb9 a9 37 LDA #&37 &2fbb 85 8f STA &8f ; player_x &2fbd 20 7b 2f JSR &2f7b ; adjust_player_screen_address &2fc0 4c 73 1d JMP &1d73 ; scroll_onto_game ; apply_scroll_effect &2fc3 a5 98 LDA &98 ; scroll_effect &2fc5 c9 04 CMP #&04 ; SCROLL_TELEPORT &2fc7 d0 03 BNE &2fcc ; not_teleport_scroll &2fc9 4c 8e 2f JMP &2f8e ; teleport_player ; not_teleport_scroll &2fcc c9 05 CMP #&05 ; SCROLL_LIGHTNING_STRIKE &2fce d0 03 BNE &2fd3 ; not_lightning_strike_scroll &2fd0 4c e3 1a JMP &1ae3 ; kill_player ; not_lightning_strike_scroll &2fd3 c9 06 CMP #&06 ; SCROLL_ENERGY_DRAIN &2fd5 d0 05 BNE &2fdc ; not_energy_drain_scroll &2fd7 a9 c8 LDA #&c8 # Arbitrary value to indicate energy drain active &2fd9 85 4f STA &4f ; energy_drain ; leave &2fdb 60 RTS ; not_energy_drain_scroll &2fdc c9 0c CMP #&0c ; SCROLL_OPEN_TEMPORARY # If this is the scroll that lifts the spikes on level 1 &2fde 90 14 BCC &2ff4 ; not_open_gate_scroll &2fe0 20 2f 25 JSR &252f ; play_sound_1 &2fe3 a4 74 LDY &74 ; object_offset_plus_three &2fe5 a6 98 LDX &98 ; scroll_effect # Use bytes three and four for door location &2fe7 c8 INY &2fe8 b1 67 LDA (&67),Y ; object_data &2fea a8 TAY &2feb a9 02 LDA #&02 &2fed 85 f8 STA &f8 ; falling_spikes_timer &2fef a9 00 LDA #&00 ; SPACE &2ff1 4c 4b 28 JMP &284b ; plot_tile_a_at_position_x_y # Replace DOOR with a SPACE ; not_open_temporary_scroll &2ff4 c9 01 CMP #&01 ; SCROLL_OPEN # If this is the scroll that opens the gate on level 1 &2ff6 d0 e3 BNE &2fdb ; leave &2ff8 a9 00 LDA #&00 ; SPACE &2ffa a2 03 LDX #&03 # Replace the DOOR at (&03, &10) with a SPACE &2ffc a0 10 LDY #&10 &2ffe 4c 4b 28 JMP &284b ; plot_tile_a_at_position_x_y ; sound_7 # Used for teleport and level completion ; chan vol pitch dur &3001 01 00 f1 ff 00 00 01 00 ; fire_arrow &3009 a5 03 LDA &03 ; arrow_timer &300b f0 01 BEQ &300e ; no_arrow_currently # Only fire an arrow if none is present already &300d 60 RTS ; no_arrow_currently &300e 20 4d 25 JSR &254d ; play_sound_3 &3011 a9 01 LDA #&01 &3013 85 03 STA &03 ; arrow_timer &3015 a5 91 LDA &91 ; player_tile_address_low &3017 85 04 STA &04 ; arrow_tile_address_low &3019 a5 92 LDA &92 ; player_tile_address_high &301b 85 05 STA &05 ; arrow_tile_address_high &301d a5 8c LDA &8c ; player_nibble &301f a2 f0 LDX #&f0 &3021 29 01 AND #&01 &3023 d0 02 BNE &3027 ; use_top_nibble &3025 a2 0f LDX #&0f ; use_top_nibble &3027 86 06 STX &06 ; arrow_nibble_mask &3029 a5 8f LDA &8f ; player_x &302b 85 08 STA &08 ; arrow_x &302d a5 90 LDA &90 ; player_y &302f 85 09 STA &09 ; arrow_y &3031 a5 95 LDA &95 ; player_facing &3033 85 02 STA &02 ; arrow_direction &3035 d0 2a BNE &3061 ; arrow_not_fired_right ; arrow_fired_right &3037 18 CLC &3038 a5 8d LDA &8d ; player_screen_address_low &303a 69 1e ADC #&1e &303c 85 00 STA &00 ; first_arrow_screen_address_low &303e a5 8e LDA &8e ; player_screen_address_high &3040 69 01 ADC #&01 &3042 10 03 BPL &3047 ; skip_wrap_around &3044 38 SEC &3045 e9 20 SBC #&20 ; skip_wrap_around &3047 85 01 STA &01 ; first_arrow_screen_address_high &3049 a9 a0 LDA #&a0 &304b 85 0a STA &0a ; arrow_sprite_address_low &304d a9 06 LDA #&06 ; &06a0 = sprite_arrow_right &304f 85 0b STA &0b ; arrow_sprite_address_high &3051 a9 00 LDA #&00 &3053 85 07 STA &07 ; arrow_fraction &3055 e6 08 INC &08 ; arrow_x &3057 20 f1 30 JSR &30f1 ; update_arrow &305a c6 07 DEC &07 ; arrow_fraction &305c c6 07 DEC &07 ; arrow_fraction &305e c6 08 DEC &08 ; arrow_x &3060 60 RTS ; arrow_not_fired_right &3061 c9 01 CMP #&01 &3063 d0 2a BNE &308f ; arrow_not_fired_left ; arrow_fired_left &3065 18 CLC &3066 a5 8d LDA &8d ; player_screen_address_low &3068 69 f6 ADC #&f6 &306a 85 00 STA &00 ; first_arrow_screen_address_low &306c a5 8e LDA &8e ; player_screen_address_high &306e 69 00 ADC #&00 &3070 10 03 BPL &3075 ; skip_wrap_around &3072 38 SEC &3073 e9 20 SBC #&20 ; skip_wrap_around &3075 85 01 STA &01 ; first_arrow_screen_address_high &3077 a9 a9 LDA #&a9 &3079 85 0a STA &0a ; arrow_sprite_address_low &307b a9 06 LDA #&06 ; &06a9 = sprite_arrow_left &307d 85 0b STA &0b ; arrow_sprite_address_high &307f a9 03 LDA #&03 &3081 85 07 STA &07 ; arrow_fraction &3083 c6 08 DEC &08 ; arrow_x &3085 20 f1 30 JSR &30f1 ; update_arrow &3088 e6 08 INC &08 ; arrow_x &308a e6 07 INC &07 ; arrow_fraction &308c e6 07 INC &07 ; arrow_fraction &308e 60 RTS ; arrow_not_fired_left &308f c9 02 CMP #&02 &3091 d0 30 BNE &30c3 ; arrow_fired-down ; arrow_fired_up &3093 38 SEC &3094 a5 8d LDA &8d ; player_screen_address_low &3096 e9 f0 SBC #&f0 &3098 85 00 STA &00 ; first_arrow_screen_address_low &309a a5 8e LDA &8e ; player_screen_address_high &309c e9 00 SBC #&00 &309e c9 60 CMP #&60 &30a0 b0 03 BCS &30a5 ; skip_wrap_around &30a2 18 CLC &30a3 69 20 ADC #&20 ; skip_wrap_around &30a5 85 01 STA &01 ; first_arrow_screen_address_high &30a7 a9 b2 LDA #&b2 &30a9 85 0a STA &0a ; arrow_sprite_address_low &30ab a9 06 LDA #&06 ; &06b2 = sprite_arrow_up &30ad 85 0b STA &0b ; arrow_sprite_address_high &30af a9 00 LDA #&00 &30b1 85 07 STA &07 ; arrow_fraction &30b3 a5 8c LDA &8c ; player_nibble &30b5 85 0c STA &0c ; arrow_nibble &30b7 e6 09 INC &09 ; arrow_y &30b9 20 f1 30 JSR &30f1 ; update_arrow &30bc c6 09 DEC &09 ; arrow_y &30be c6 07 DEC &07 ; arrow_fraction &30c0 c6 07 DEC &07 ; arrow_fraction &30c2 60 RTS ; arrow_fired_down &30c3 18 CLC &30c4 a5 8d LDA &8d ; player_screen_address_low &30c6 69 17 ADC #&17 &30c8 85 00 STA &00 ; first_arrow_screen_address_low &30ca a5 8e LDA &8e ; player_screen_address_high &30cc 69 02 ADC #&02 &30ce 10 03 BPL &30d3 ; skip_wrap_around &30d0 38 SEC &30d1 e9 20 SBC #&20 ; skip_wrap_around &30d3 85 01 STA &01 ; first_arrow_screen_address_high &30d5 a9 c3 LDA #&c3 &30d7 85 0a STA &0a ; arrow_sprite_address_low &30d9 a9 06 LDA #&06 ; &06c3 = sprite_arrow_down &30db 85 0b STA &0b ; arrow_sprite_address_high &30dd a9 03 LDA #&03 &30df 85 07 STA &07 ; arrow_fraction &30e1 a5 8c LDA &8c ; player_nibble &30e3 85 0c STA &0c ; arrow_nibble &30e5 c6 09 DEC &09 ; arrow_y &30e7 20 f1 30 JSR &30f1 ; update_arrow &30ea e6 09 INC &09 ; arrow_y &30ec e6 07 INC &07 ; arrow_fraction &30ee e6 07 INC &07 ; arrow_fraction &30f0 60 RTS ; update_arrow &30f1 a5 03 LDA &03 ; arrow_timer &30f3 d0 01 BNE &30f6 ; arrow_exists &30f5 60 RTS ; arrow_exists # If the arrow is moving horizontally, &30f6 a9 03 LDA #&03 &30f8 85 f6 STA &f6 ; arrow_sprite_width # 12 pixels wide &30fa 85 f7 STA &f7 ; arrow_sprite_height # 3 pixels high &30fc a5 02 LDA &02 ; arrow_direction &30fe c9 02 CMP #&02 &3100 90 08 BCC &310a ; arrow_moving_horizontally ; arrow_moving_vertically # If the arrow is moving vertically, &3102 a9 01 LDA #&01 # 4 pixels wide &3104 85 f6 STA &f6 ; arrow_sprite_width &3106 a9 11 LDA #&11 # 17 pixels high &3108 85 f7 STA &f7 ; arrow_sprite_height ; arrow_moving_horizontally &310a a5 03 LDA &03 ; arrow_timer &310c c9 0d CMP #&0d &310e 90 03 BCC &3113 ; arrow_not_at_end_of_life &3110 4c 30 32 JMP &3230 ; unplot_arrow_and_remove # Remove the arrow at the edge of the screen ; arrow_not_at_end_of_life &3113 a6 08 LDX &08 ; arrow_x &3115 a4 09 LDY &09 ; arrow_y &3117 a5 96 LDA &96 ; player_fraction &3119 85 74 STA &74 ; previous_player_fraction &311b a5 93 LDA &93 ; player_tile &311d 85 75 STA &75 ; previous_player_tile &311f 20 52 32 JSR &3252 ; check_arrow_for_object # Continue if arrow hit object, otherwise jump to &312d &3122 a5 75 LDA &75 ; previous_player_tile &3124 85 93 STA &93 ; player_tile &3126 a5 74 LDA &74 ; previous_player_fraction &3128 85 96 STA &96 ; player_fraction &312a 4c 25 32 JMP &3225 ; unplot_arrow_and_remove_on_object_collision ; arrow_didn't_hit_object &312d e6 03 INC &03 ; arrow_timer &312f a5 02 LDA &02 ; arrow_direction &3131 d0 2b BNE &315e ; arrow_not_moving_right ; arrow_moving_right &3133 e6 07 INC &07 ; arrow_fraction &3135 a5 07 LDA &07 ; arrow_fraction &3137 29 03 AND #&03 &3139 c9 01 CMP #&01 &313b d0 0d BNE &314a ; arrow_on_same_tile &313d e6 08 INC &08 ; arrow_x &313f 18 CLC &3140 a5 04 LDA &04 ; arrow_tile_address_low &3142 69 20 ADC #&20 &3144 85 04 STA &04 ; arrow_tile_address_low &3146 90 02 BCC &314a &3148 e6 05 INC &05 ; arrow_tile_address_high ; arrow_on_same_tile &314a 18 CLC &314b a5 00 LDA &00 ; first_arrow_screen_address_low &314d 69 08 ADC #&08 &314f 85 00 STA &00 ; first_arrow_screen_address_low &3151 90 08 BCC &315b &3153 e6 01 INC &01 ; first_arrow_screen_address_high &3155 10 04 BPL &315b &3157 a9 60 LDA #&60 &3159 85 01 STA &01 ; first_arrow_screen_address_high &315b 4c fd 31 JMP &31fd ; plot_arrow_if_no_obstacle ; arrow_not_moving_right &315e c9 01 CMP #&01 &3160 d0 3a BNE &319c ; arrow_not_moving_left ; arrow_moving_left &3162 c6 07 DEC &07 ; arrow_fraction &3164 a5 07 LDA &07 ; arrow_fraction &3166 29 03 AND #&03 &3168 c9 02 CMP #&02 &316a d0 0d BNE &3179 ; arrow_on_same_tile &316c c6 08 DEC &08 ; arrow_x &316e 38 SEC &316f a5 04 LDA &04 ; arrow_tile_address_low &3171 e9 20 SBC #&20 &3173 85 04 STA &04 ; arrow_tile_address_low &3175 b0 02 BCS &3179 &3177 c6 05 DEC &05 ; arrow_tile_address_high ; arrow_on_same_tile &3179 a0 00 LDY #&00 &317b b1 04 LDA (&04),Y ; arrow_tile_address &317d 25 06 AND &06 ; arrow_nibble_mask &317f f0 03 BEQ &3184 ; arrow_hasn't_hit_obstacle &3181 4c 30 32 JMP &3230 ; unplot_arrow_and_remove # Remove the arrow if it hit an obstacle ; arrow_hasn't_hit_obstacle &3184 38 SEC &3185 a5 00 LDA &00 ; first_arrow_screen_address_low &3187 e9 08 SBC #&08 &3189 85 00 STA &00 ; first_arrow_screen_address_low &318b b0 0c BCS &3199 ; skip_wrap_around &318d c6 01 DEC &01 ; first_arrow_screen_address_high &318f a5 01 LDA &01 ; first_arrow_screen_address_high &3191 c9 5f CMP #&5f &3193 d0 04 BNE &3199 ; skip_wrap_around &3195 a9 7f LDA #&7f &3197 85 01 STA &01 ; first_arrow_screen_address_high ; skip_wrap_around &3199 4c 0e 32 JMP &320e ; plot_arrow ; arrow_not_moving_left &319c a2 01 LDX #&01 # 4 pixels wide &319e 86 f6 STX &f6 ; arrow_sprite_width &31a0 a2 11 LDX #&11 # 17 pixels high &31a2 86 f7 STX &f7 ; arrow_sprite_height &31a4 c9 02 CMP #&02 &31a6 d0 2f BNE &31d7 ; arrow_moving_down ; arrow_moving_up &31a8 e6 07 INC &07 ; arrow_fraction &31aa a5 07 LDA &07 ; arrow_fraction &31ac 29 03 AND #&03 &31ae c9 01 CMP #&01 &31b0 d0 16 BNE &31c8 ; arrow_on_same_tile &31b2 e6 09 INC &09 ; arrow_y &31b4 a9 0f LDA #&0f &31b6 85 06 STA &06 ; arrow_nibble_mask &31b8 c6 0c DEC &0c ; arrow_nibble &31ba a5 0c LDA &0c ; arrow_nibble &31bc 29 01 AND #&01 &31be c9 01 CMP #&01 &31c0 d0 06 BNE &31c8 &31c2 c6 04 DEC &04 ; arrow_tile_address_low &31c4 a9 f0 LDA #&f0 &31c6 85 06 STA &06 ; arrow_nibble_mask ; arrow_on_same_tile &31c8 c6 01 DEC &01 ; first_arrow_screen_address_high &31ca a5 01 LDA &01 ; first_arrow_screen_address_high &31cc c9 5f CMP #&5f &31ce d0 04 BNE &31d4 ; skip_wrap_around &31d0 a9 7f LDA #&7f &31d2 85 01 STA &01 ; first_arrow_screen_address_high ; skip_wrap_around &31d4 4c fd 31 JMP &31fd ; plot_arrow_if_no_obstacle ; arrow_moving_down &31d7 c6 07 DEC &07 ; arrow_fraction &31d9 a5 07 LDA &07 ; arrow_fraction &31db 29 03 AND #&03 &31dd c9 02 CMP #&02 &31df d0 14 BNE &31f5 ; arrow_on_same_tile &31e1 c6 09 DEC &09 ; arrow_y &31e3 a9 f0 LDA #&f0 &31e5 85 06 STA &06 ; arrow_nibble_mask &31e7 e6 0c INC &0c ; arrow_nibble &31e9 a5 0c LDA &0c ; arrow_nibble &31eb 29 01 AND #&01 &31ed d0 06 BNE &31f5 ; arrow_on_same_tile &31ef a9 0f LDA #&0f &31f1 85 06 STA &06 ; arrow_nibble_mask &31f3 e6 04 INC &04 ; arrow_tile_address_low ; arrow_on_same_tile &31f5 e6 01 INC &01 ; first_arrow_screen_address_high &31f7 10 04 BPL &31fd ; plot_arrow_if_no_obstacle &31f9 a9 60 LDA #&60 &31fb 85 01 STA &01 ; first_arrow_screen_address_high ; plot_arrow_if_no_obstacle &31fd a0 00 LDY #&00 &31ff b1 04 LDA (&04),Y ; arrow_tile_address &3201 25 06 AND &06 ; arrow_nibble_mask &3203 f0 09 BEQ &320e ; plot_arrow &3205 a5 02 LDA &02 ; arrow_direction &3207 d0 02 BNE &320b ; arrow_not_moving_right &3209 c6 f6 DEC &f6 ; arrow_sprite_width ; arrow_not_moving_right &320b 4c 30 32 JMP &3230 ; unplot_arrow_and_remove # Remove the arrow if it hit an obstacle ; plot_arrow &320e a5 00 LDA &00 ; first_arrow_screen_address_low &3210 85 70 STA &70 ; screen_address_low &3212 a5 01 LDA &01 ; first_arrow_screen_address_high &3214 85 71 STA &71 ; screen_address_high &3216 a5 0a LDA &0a ; arrow_sprite_address_low &3218 85 72 STA &72 ; sprite_address_low &321a a5 0b LDA &0b ; arrow_sprite_address_high &321c 85 73 STA &73 ; sprite_address_high &321e a6 f6 LDX &f6 ; arrow_sprite_width &3220 a4 f7 LDY &f7 ; arrow_sprite_height &3222 4c 70 19 JMP &1970 ; plot_sprite ; unplot_arrow_and_remove_on_object_collision &3225 a5 03 LDA &03 ; arrow_timer &3227 a2 00 LDX #&00 &3229 86 03 STX &03 ; arrow_timer &322b c9 01 CMP #&01 &322d d0 0c BNE &323b ; unplot_arrow &322f 60 RTS ; unplot_arrow_and_remove &3230 a5 03 LDA &03 ; arrow_timer &3232 a2 00 LDX #&00 &3234 86 03 STX &03 ; arrow_timer &3236 c9 02 CMP #&02 &3238 d0 01 BNE &323b ; unplot_arrow &323a 60 RTS ; unplot_arrow &323b a5 00 LDA &00 ; first_arrow_screen_address_low &323d 85 70 STA &70 ; screen_address_low &323f a5 01 LDA &01 ; first_arrow_screen_address_high &3241 85 71 STA &71 ; screen_address_high &3243 a6 f6 LDX &f6 ; arrow_sprite_width &3245 a4 f7 LDY &f7 ; arrow_sprite_height &3247 a9 80 LDA #&80 &3249 85 72 STA &72 ; sprite_address_low &324b a9 5c LDA #&5c ; &5c80 = sprite_space &324d 85 73 STA &73 ; sprite_address_high &324f 4c 70 19 JMP &1970 ; plot_sprite ; check_arrow_for_object &3252 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leave check_arrow_for_object if object found &3255 68 PLA # Remove check_arrow_for_object from stack &3256 68 PLA &3257 4c 2d 31 JMP &312d ; arrow_didn't_hit_object ; display_failure_screen &325a 20 1b 2c JSR &2c1b ; undo_changes_to_level &325d a9 0d LDA #&0d ; Disable Event &325f a2 04 LDX #&04 ; vsync event &3261 20 f4 ff JSR &fff4 ; OSBYTE &3264 a5 82 LDA &82 ; screen_start_address_low &3266 8d 50 03 STA &0350 ; os_screen_start_address_low &3269 8d 4a 03 STA &034a ; os_text_cursor_address_low &326c a5 83 LDA &83 ; screen_start_address_high &326e 8d 51 03 STA &0351 ; os_screen_start_address_high &3271 8d 4b 03 STA &034b ; os_text_cursor_address_high &3274 a2 00 LDX #&00 ; write_you_have_failed_loop &3276 bd 20 01 LDA &0120,X ; you_have_failed_string &3279 20 ee ff JSR &ffee ; OSWRCH &327c a9 50 LDA #&50 &327e 20 0a 27 JSR &270a ; short_delay &3281 e8 INX &3282 e0 16 CPX #&16 &3284 d0 f0 BNE &3276 ; write_you_have_failed_loop &3286 a9 02 LDA #&02 &3288 20 1f 27 JSR &271f ; long_delay ; display_title_screen &328b 20 03 12 JSR &1203 ; reset_screen &328e 20 80 1c JSR &1c80 ; wipe_screen &3291 20 94 20 JSR &2094 ; display_collected_crucifix_sections &3294 a5 82 LDA &82 ; screen_start_address_low &3296 8d 50 03 STA &0350 ; os_screen_start_address_low &3299 8d 4a 03 STA &034a ; os_text_cursor_address_low &329c a5 83 LDA &83 ; screen_start_address_high &329e 8d 51 03 STA &0351 ; os_screen_start_address_high &32a1 8d 4b 03 STA &034b ; os_text_cursor_address_high &32a4 20 ff 20 JSR &20ff ; plot_border &32a7 a9 03 LDA #&03 &32a9 85 7f STA &7f ; player_lives &32ab a2 00 LDX #&00 ; write_title_screen_text_loop &32ad bd 80 5b LDA &5b80,X ; title_screen_text &32b0 20 ee ff JSR &ffee ; OSWRCH &32b3 e8 INX &32b4 e0 39 CPX #&39 # Bug: writes COLOUR &1f at end &32b6 d0 f5 BNE &32ad ; write_title_screen_text_loop &32b8 18 CLC &32b9 a5 7c LDA &7c ; score &32bb 69 30 ADC #&30 &32bd 20 ee ff JSR &ffee ; OSWRCH &32c0 a5 7d LDA &7d ; score + 1 &32c2 18 CLC &32c3 69 30 ADC #&30 &32c5 20 ee ff JSR &ffee ; OSWRCH &32c8 a9 25 LDA #&25 &32ca 20 ee ff JSR &ffee ; OSWRCH &32cd a2 00 LDX #&00 &32cf 86 6d STX &6d ; current_level ; write_jump_loop &32d1 bd 1c 33 LDA &331c,X ; jump_string &32d4 20 ee ff JSR &ffee ; OSWRCH &32d7 e8 INX &32d8 e0 0d CPX #&0d &32da d0 f5 BNE &32d1 ; write_jump_loop &32dc 20 0f 33 JSR &330f &32df a9 0f LDA #&0f ; Flush all buffers &32e1 a2 00 LDX #&00 &32e3 20 f4 ff JSR &fff4 ; OSBYTE ; title_screen_loop &32e6 20 e0 ff JSR &ffe0 ; OSRDCH &32e9 c9 4a CMP #&4a ; "J" &32eb d0 06 BNE &32f3 ; j_not_pressed &32ed 20 02 33 JSR &3302 ; jump_pressed &32f0 4c e6 32 JMP &32e6 ; title_screen_loop ; j_not_pressed &32f3 c9 20 CMP #&20 ; " " &32f5 d0 ef BNE &32e6 ; title_screen_loop &32f7 a5 6d LDA &6d ; current_level &32f9 8d 7f 02 STA &027f ; level_started_from &32fc 20 80 1c JSR &1c80 ; wipe_screen &32ff 4c 06 11 JMP &1106 ; restart_game ; jump_pressed &3302 a5 6d LDA &6d ; current_level &3304 cd 7e 02 CMP &027e ; maximum_completed_level &3307 d0 04 BNE &330d ; skip_ceiling &3309 a9 ff LDA #&ff &330b 85 6d STA &6d ; current_level ; skip_ceiling &330d e6 6d INC &6d ; current_level &330f 18 CLC &3310 a5 6d LDA &6d ; current_level &3312 69 31 ADC #&31 ; "1" &3314 20 ee ff JSR &ffee ; OSWRCH &3317 a9 08 LDA #&08 ; backspace &3319 4c ee ff JMP &ffee ; OSWRCH ; jump_string &331c 11 01 1f 04 10 4a ed e7 70 20 3a 11 03 ; COLOUR 1; TAB(&04, &10); "Jump :"; COLOUR 3 ; conditionally_empty_all_pockets &3329 a5 49 LDA &49 ; potion_effect &332b c9 04 CMP #&04 ; POTION_LOSER &332d d0 0f BNE &333e ; leave &332f a9 ff LDA #&ff # Empty all pockets if player uses POTION_LOSER &3331 85 6a STA &6a ; pocket_object_sprite &3333 85 6b STA &6b ; pocket_object_sprite + 1 &3335 85 6c STA &6c ; pocket_object_sprite + 2 &3337 a9 00 LDA #&00 &3339 85 66 STA &66 ; selected_pocket &333b 85 69 STA &69 ; objects_carried &333d 60 RTS ; leave &333e 60 RTS ; initialise_sprite_address_table &333f a5 6d LDA &6d ; current_level &3341 29 01 AND #&01 &3343 d0 28 BNE &336d ; odd_level &3345 ad d6 14 LDA &14d6 ; current_sprite_address_table + 5 &3348 c9 5d CMP #&5d ; &5d00 = sprite_wall_stone &334a f0 03 BEQ &334f ; skip_swap &334c 4c 77 33 JMP &3377 ; swap_sprite_address_tables ; skip_swap &334f a5 6d LDA &6d ; current_level &3351 d0 08 BNE &335b ; not_first_level &3353 a9 5c LDA #&5c ; &5c00 = sprite_wall_marsh &3355 8d d4 14 STA &14d4 ; current_sprite_address_table + 3 # On level 1, set level border to be marsh &3358 4c 6c 33 JMP &336c ; leave ; not_first_level &335b c9 02 CMP #&02 &335d d0 08 BNE &3367 ; not_third_level &335f a9 0d LDA #&0d ; &0d00 = sprite_wall_stripes &3361 8d d4 14 STA &14d4 ; current_sprite_address_table + 3 # On level 3, set level border to be stripes &3364 4c 6c 33 JMP &336c ; leave ; not_third_level &3367 a9 5d LDA #&5d ; &5d00 = sprite_wall_stone &3369 8d d4 14 STA &14d4 ; current_sprite_address_table + 3 # Otherwise, set level border to be stone ; leave &336c 60 RTS ; odd_level &336d ad d6 14 LDA &14d6 ; current_sprite_address_table + 5 &3370 c9 5d CMP #&5d ; &5d00 = sprite_wall_stone &3372 d0 db BNE &334f ; skip_swap &3374 4c 77 33 JMP &3377 ; swap_sprite_address_tables ; swap_sprite_address_tables &3377 a2 00 LDX #&00 ; swap_sprite_address_tables_loop &3379 bd d1 14 LDA &14d1,X ; current_sprite_address_table &337c a8 TAY &337d bd f1 14 LDA &14f1,X ; alternate_sprite_address_table &3380 9d d1 14 STA &14d1,X ; current_sprite_address_table &3383 98 TYA &3384 9d f1 14 STA &14f1,X ; alternate_sprite_address_table &3387 e8 INX &3388 e0 20 CPX #&20 &338a d0 ed BNE &3379 ; swap_sprite_address_tables_loop &338c 60 RTS ; update_bees &338d 20 30 36 JSR &3630 ; store_screen_values_around_player &3390 20 55 34 JSR &3455 ; calculate_arrow_screen_address &3393 a9 00 LDA #&00 &3395 85 0e STA &0e ; bee_data_offset &3397 85 0f STA &0f ; bee_size_count ; update_bees_loop &3399 20 76 34 JSR &3476 ; store_arrow_check &339c a9 00 LDA #&00 &339e 85 32 STA &32 ; bee_state &33a0 a6 0e LDX &0e ; bee_data_offset &33a2 b5 12 LDA &12,X ; bees_direction &33a4 f0 5c BEQ &3402 ; bee_moving_right &33a6 c9 05 CMP #&05 ; GONE &33a8 f0 3f BEQ &33e9 ; consider_next_bee &33aa c9 03 CMP #&03 ; SHOT &33ac d0 07 BNE &33b5 ; bee_moving_left &33ae a9 03 LDA #&03 ; SHOT &33b0 85 32 STA &32 ; bee_state &33b2 4c d7 33 JMP &33d7 ; bee_on_same_tile ; bee_moving_left &33b5 d6 13 DEC &13,X ; bees_fraction &33b7 b5 13 LDA &13,X ; bees_fraction &33b9 c9 ff CMP #&ff &33bb d0 1a BNE &33d7 ; bee_on_same_tile &33bd a9 03 LDA #&03 &33bf 95 13 STA &13,X ; bees_fraction &33c1 d6 10 DEC &10,X ; bees_x &33c3 b5 11 LDA &11,X ; bees_y &33c5 a8 TAY &33c6 b5 10 LDA &10,X ; bees_x &33c8 aa TAX ; consider_new_tile &33c9 20 3b 34 JSR &343b ; remove_object_in_path_of_bee &33cc a6 30 LDX &30 ; bee_x &33ce a4 31 LDY &31 ; bee_y &33d0 20 1a 34 JSR &341a ; flip_direction_of_bee_if_obstacle &33d3 e0 c8 CPX #&c8 &33d5 f0 0f BEQ &33e6 ; skip_plot # If bee direction flipped, don't plot it ; bee_on_same_tile &33d7 a6 0e LDX &0e ; bee_data_offset &33d9 b5 11 LDA &11,X ; bees_y &33db a8 TAY &33dc b5 13 LDA &13,X ; bees_fraction &33de 48 PHA &33df b5 10 LDA &10,X ; bees_x &33e1 aa TAX &33e2 68 PLA &33e3 20 9e 34 JSR &349e ; plot_bee ; skip_plot &33e6 20 7d 34 JSR &347d ; check_if_arrow_hit_bee ; consider_next_bee &33e9 a6 0e LDX &0e ; bee_data_offset &33eb e8 INX &33ec e8 INX &33ed e8 INX &33ee e8 INX &33ef 86 0e STX &0e ; bee_data_offset &33f1 e6 0f INC &0f ; bee_size_count &33f3 e6 0f INC &0f ; bee_size_count &33f5 a5 0f LDA &0f ; bee_size_count &33f7 c5 44 CMP &44 ; bee_data_size &33f9 d0 9e BNE &3399 ; update_bees_loop &33fb 4c 3f 36 JMP &363f ; check_screen_values_around_player_for_bees ; unused # Unused entry point &33fe a9 03 LDA #&03 ; SHOT &3400 85 32 STA &32 ; bee_state ; bee_moving_right &3402 f6 13 INC &13,X ; bees_fraction &3404 b5 13 LDA &13,X ; bees_fraction &3406 c9 04 CMP #&04 &3408 d0 cd BNE &33d7 ; bee_on_same_tile &340a a9 00 LDA #&00 &340c 95 13 STA &13,X ; bees_fraction &340e f6 10 INC &10,X ; bees_x &3410 b5 11 LDA &11,X ; bees_y &3412 a8 TAY &3413 b5 10 LDA &10,X ; bees_x &3415 aa TAX &3416 e8 INX &3417 4c c9 33 JMP &33c9 ; consider_new_tile ; flip_direction_of_bee_if_obstacle &341a 20 1b 28 JSR &281b ; calculate_tile_address &341d 98 TYA &341e a0 f0 LDY #&f0 &3420 29 01 AND #&01 &3422 f0 02 BEQ &3426 ; use_top_nibble &3424 a0 0f LDY #&0f ; use_top_nibble &3426 84 f6 STY &f6 ; nibble_mask &3428 a0 00 LDY #&00 &342a b1 9d LDA (&9d),Y ; tile_address &342c a6 0e LDX &0e ; bee_data_offset &342e 25 f6 AND &f6 ; nibble_mask &3430 f0 08 BEQ &343a ; leave &3432 b5 12 LDA &12,X ; bees_direction &3434 49 01 EOR #&01 &3436 95 12 STA &12,X ; bees_direction &3438 a2 c8 LDX #&c8 # Indicate bee changed direction &343a 60 RTS ; remove_object_in_path_of_bee &343b a5 96 LDA &96 ; player_fraction &343d 85 72 STA &72 ; bee_fraction &343f 86 30 STX &30 ; bee_x &3441 84 31 STY &31 ; bee_y &3443 20 4f 34 JSR &344f ; bee_object_check &3446 a5 72 LDA &72 ; bee_fraction &3448 85 96 STA &96 ; player_fraction &344a a9 64 LDA #&64 # Remove object if in path of bee &344c 91 67 STA (&67),Y ; object_data &344e 60 RTS ; bee_object_check &344f 20 e3 26 JSR &26e3 ; consider_tile_for_object # Leaves bee_object_check if object found &3452 68 PLA # Leave remove_object_in_path_of_bee if no object &3453 68 PLA &3454 60 RTS ; calculate_arrow_screen_address &3455 a5 02 LDA &02 ; arrow_direction &3457 0a ASL A &3458 aa TAX &3459 18 CLC &345a a5 00 LDA &00 ; first_arrow_screen_address_low &345c 7d 6f 34 ADC &346f,X ; arrow_screen_offsets + 1 &345f 85 e2 STA &e2 ; arrow_screen_address_low &3461 a5 01 LDA &01 ; first_arrow_screen_address_high &3463 7d 6e 34 ADC &346e,X ; arrow_screen_offsets &3466 10 03 BPL &346b ; skip_wrap_around &3468 38 SEC &3469 e9 20 SBC #&20 ; skip_wrap_around &346b 85 e3 STA &e3 ; arrow_screen_address_high &346d 60 RTS ; arrow_screen_offsets &346e 00 11 ; right &3470 00 01 ; left &3472 00 00 ; up &3474 02 00 ; down ; store_arrow_check &3476 a0 00 LDY #&00 &3478 b1 e2 LDA (&e2),Y ; arrow_screen_address &347a 85 0d STA &0d ; arrow_check &347c 60 RTS ; check_if_arrow_hit_bee &347d a0 00 LDY #&00 &347f b1 e2 LDA (&e2),Y ; arrow_screen_address &3481 c5 0d CMP &0d ; arrow_check &3483 d0 01 BNE &3486 ; arrow_hit_bee ; leave &3485 60 RTS ; arrow_hit_bee &3486 a5 03 LDA &03 ; arrow_timer &3488 f0 fb BEQ &3485 ; leave &348a a6 0e LDX &0e ; bee_data_offset &348c a9 03 LDA #&03 ; SHOT &348e 95 12 STA &12,X ; bees_direction &3490 a9 0d LDA #&0d &3492 85 03 STA &03 ; arrow_timer # Mark arrow as end of life &3494 a2 01 LDX #&01 &3496 a0 02 LDY #&02 &3498 20 6c 21 JSR &216c ; increase_score # 2% score for killing bee &349b 4c 2f 25 JMP &252f ; play_sound_1 ; plot_bee &349e 86 72 STX &72 ; bee_x &34a0 85 74 STA &74 ; bee_fraction &34a2 84 9b STY &9b ; bee_y &34a4 a5 90 LDA &90 ; player_y &34a6 c5 9b CMP &9b ; bee_y &34a8 b0 14 BCS &34be ; bee_is_below_player ; bee_is_above_player &34aa 38 SEC &34ab a5 9b LDA &9b ; bee_y &34ad e5 90 SBC &90 ; player_y &34af c9 06 CMP #&06 &34b1 90 01 BCC &34b4 ; bee_isn't_too_far_above &34b3 60 RTS ; bee_isn't_too_far_above &34b4 85 73 STA &73 ; bee_relative_y &34b6 a9 05 LDA #&05 &34b8 38 SEC &34b9 e5 73 SBC &73 ; bee_relative_y &34bb 4c c9 34 JMP &34c9 ; set_bee_relative_y ; bee_is_below_player &34be 38 SEC &34bf e5 9b SBC &9b ; bee_y &34c1 c9 05 CMP #&05 &34c3 90 01 BCC &34c6 ; bee_isn't_too_far_below &34c5 60 RTS ; bee_isn't_too_far_below &34c6 18 CLC &34c7 69 05 ADC #&05 ; set_bee_relative_y &34c9 85 73 STA &73 ; bee_relative_y &34cb a9 04 LDA #&04 &34cd 85 77 STA &77 ; bee_one &34cf 85 78 STA &78 ; bee_two &34d1 a5 8f LDA &8f ; player_x &34d3 c5 72 CMP &72 ; bee_x &34d5 b0 10 BCS &34e7 ; bee_is_left_of_player ; bee_is_right_of_player &34d7 38 SEC &34d8 a5 72 LDA &72 ; bee_x &34da e5 8f SBC &8f ; player_x &34dc c9 05 CMP #&05 &34de 90 01 BCC &34e1 ; bee_isn't_too_far_to_right &34e0 60 RTS ; bee_isn't_too_far_to_right &34e1 18 CLC &34e2 69 05 ADC #&05 &34e4 4c f6 34 JMP &34f6 ; set_bee_relative_x ; bee_is_left_of_player &34e7 38 SEC &34e8 e5 72 SBC &72 ; bee_x &34ea c9 06 CMP #&06 &34ec 90 01 BCC &34ef ; bee_isn't_too_far_to_left &34ee 60 RTS ; bee_isn't_too_far_to_left &34ef 85 72 STA &72 ; bee_relative_x &34f1 38 SEC &34f2 a9 05 LDA #&05 &34f4 e5 72 SBC &72 ; bee_relative_x ; set_bee_relative_x &34f6 85 72 STA &72 ; bee_relative_x &34f8 a5 72 LDA &72 ; bee_relative_x &34fa 0a ASL A &34fb 0a ASL A &34fc 18 CLC &34fd 65 74 ADC &74 ; bee_fraction &34ff 85 75 STA &75 ; bee_relative_x_in_fractions &3501 a5 73 LDA &73 ; bee_relative_y &3503 0a ASL A &3504 0a ASL A &3505 85 76 STA &76 ; bee_relative_y_in_fractions &3507 20 c8 35 JSR &35c8 ; adjust_bee_fractions_based_on_player &350a a9 04 LDA #&04 &350c 85 74 STA &74 ; bee_fraction &350e 85 78 STA &78 ; bee_end_fraction &3510 20 a0 35 JSR &35a0 ; calculate_bee_sprite_address &3513 a5 75 LDA &75 ; bee_relative_x_in_fractions &3515 c9 03 CMP #&03 &3517 b0 01 BCS &351a ; bee_past_left_edge_of_screen &3519 60 RTS ; bee_past_left_edge_of_screen &351a c9 07 CMP #&07 &351c b0 0e BCS &352c ; bee_not_crossing_left_edge_of_screen &351e 38 SEC &351f e9 02 SBC #&02 &3521 85 74 STA &74 ; bee_fraction &3523 85 78 STA &78 ; bee_end_fraction &3525 a9 06 LDA #&06 &3527 85 75 STA &75 ; bee_relative_x_in_fractions &3529 4c 3e 35 JMP &353e ; bee_not_crossing_right_edge_of_screen ; bee_not_crossing_left_edge_of_screen &352c c9 26 CMP #&26 &352e 90 01 BCC &3531 ; bee_not_past_right_edge_of_screen &3530 60 RTS ; bee_not_past_right_edge_of_screen &3531 c9 22 CMP #&22 &3533 90 09 BCC &353e ; bee_not_crossing_right_edge_of_screen &3535 85 70 STA &70 ; fraction &3537 a9 26 LDA #&26 &3539 38 SEC &353a e5 70 SBC &70 ; fraction &353c 85 78 STA &78 ; bee_end_fraction ; bee_not_crossing_right_edge_of_screen &353e 38 SEC &353f a5 82 LDA &82 ; screen_start_address_low &3541 e9 2a SBC #&2a &3543 85 70 STA &70 ; screen_address_low &3545 a5 83 LDA &83 ; screen_start_address_high &3547 e9 06 SBC #&06 &3549 c9 60 CMP #&60 &354b b0 03 BCS &3550 ; skip_wrap_around &354d 18 CLC &354e 69 20 ADC #&20 ; skip_wrap_around &3550 85 71 STA &71 ; screen_address_high &3552 a5 75 LDA &75 ; bee_relative_x_in_fractions &3554 0a ASL A &3555 0a ASL A &3556 0a ASL A &3557 48 PHA &3558 a5 71 LDA &71 ; screen_address_high &355a 65 76 ADC &76 ; bee_relative_y_in_fractions &355c 10 03 BPL &3561 ; skip_wrap_around &355e 38 SEC &355f e9 20 SBC #&20 ; skip_wrap_around &3561 85 71 STA &71 ; screen_address_high &3563 68 PLA &3564 18 CLC &3565 65 70 ADC &70 ; screen_address_low &3567 85 70 STA &70 ; screen_address_low &3569 a5 71 LDA &71 ; screen_address_high &356b 69 00 ADC #&00 &356d 85 71 STA &71 ; screen_address_high &356f 10 03 BPL &3574 ; skip_wrap_around &3571 38 SEC &3572 e9 20 SBC #&20 ; skip_wrap_around &3574 85 71 STA &71 ; screen_address_high &3576 a9 00 LDA #&00 &3578 85 9f STA &9f ; bee_skip_plotting &357a a5 76 LDA &76 ; bee_relative_y_in_fractions &357c c9 02 CMP #&02 &357e b0 01 BCS &3581 ; bee_past_top_edge_of_screen &3580 60 RTS ; bee_past_top_edge_of_screen &3581 c9 26 CMP #&26 &3583 90 01 BCC &3586 ; bee_not_past_bottom_edge_of_screen &3585 60 RTS ; bee_not_past_bottom_edge_of_screen &3586 c9 06 CMP #&06 &3588 b0 04 BCS &358e ; bee_crossing_top_edge_of_screen &358a a9 01 LDA #&01 &358c 85 9f STA &9f ; bee_skip_plotting ; bee_crossing_top_edge_of_screen &358e a6 74 LDX &74 ; bee_fraction &3590 ca DEX &3591 bd c4 35 LDA &35c4,X ; bee_column_offsets &3594 18 CLC &3595 65 72 ADC &72 ; sprite_address_low &3597 85 72 STA &72 ; sprite_address_low &3599 a6 78 LDX &78 ; bee_end_fraction &359b a0 14 LDY #&14 &359d 4c 53 36 JMP &3653 ; actually_plot_bee ; calculate_bee_sprite_address &35a0 a5 32 LDA &32 ; bee_state &35a2 f0 0f BEQ &35b3 ; bee_alive ; bee_dead &35a4 a9 80 LDA #&80 &35a6 85 72 STA &72 ; sprite_address_low &35a8 a9 5c LDA #&5c ; &5c80 = sprite_space &35aa 85 73 STA &73 ; sprite_address_high &35ac a6 0e LDX &0e ; bee_data_offset &35ae a9 05 LDA #&05 ; GONE &35b0 95 12 STA &12,X ; bees_direction &35b2 60 RTS ; bee_alive &35b3 a6 0e LDX &0e ; bee_data_offset &35b5 b5 12 LDA &12,X ; bees_direction &35b7 aa TAX &35b8 bd c2 35 LDA &35c2,X ; bee_sprite_addresses &35bb 85 72 STA &72 ; sprite_address_low &35bd a9 06 LDA #&06 ; &0600 = sprite_bee_left, &063c = sprite_bee_right &35bf 85 73 STA &73 ; sprite_address_high &35c1 60 RTS ; bee_sprite_addresses ; r l &35c2 3c 00 ; bee_column_offsets &35c4 3c 28 14 00 ; adjust_bee_fractions_based_on_player &35c8 a5 96 LDA &96 ; player_fraction &35ca f0 1a BEQ &35e6 ; leave &35cc 85 70 STA &70 ; fraction &35ce c6 70 DEC &70 ; fraction &35d0 a5 95 LDA &95 ; player_facing &35d2 f0 0b BEQ &35df ; player_moving_right &35d4 c9 01 CMP #&01 &35d6 f0 0f BEQ &35e7 ; player_moving_left &35d8 c9 03 CMP #&03 &35da f0 13 BEQ &35ef ; player_moving_down &35dc 4c f7 35 JMP &35f7 ; player_moving_up ; player_moving_right &35df a5 70 LDA &70 ; fraction &35e1 18 CLC &35e2 65 75 ADC &75 ; bee_relative_x_in_fractions &35e4 85 75 STA &75 ; bee_relative_x_in_fractions ; leave &35e6 60 RTS ; player_moving_left &35e7 38 SEC &35e8 a5 75 LDA &75 ; bee_relative_x_in_fractions &35ea e5 70 SBC &70 ; fraction &35ec 85 75 STA &75 ; bee_relative_x_in_fractions &35ee 60 RTS ; player_moving_down &35ef 18 CLC &35f0 a5 70 LDA &70 ; fraction &35f2 65 76 ADC &76 ; bee_relative_y_in_fractions &35f4 85 76 STA &76 ; bee_relative_y_in_fractions &35f6 60 RTS ; player_moving_up &35f7 38 SEC &35f8 a5 76 LDA &76 ; bee_relative_y_in_fractions &35fa e5 70 SBC &70 ; fraction &35fc 85 76 STA &76 ; bee_relative_y_in_fractions &35fe 60 RTS ; get_screen_values_around_player &35ff a2 00 LDX #&00 ; get_screen_values_around_player_loop &3601 a0 00 LDY #&00 &3603 18 CLC &3604 a5 8d LDA &8d ; player_screen_address_low &3606 7d 28 36 ADC &3628,X ; bee_check_screen_offsets &3609 85 74 STA &74 ; check_screen_address_low &360b a5 8e LDA &8e ; player_screen_address_high &360d 7d 29 36 ADC &3629,X ; bee_check_screen_offsets + 1 &3610 10 03 BPL &3615 ; skip_wrap_around &3612 38 SEC &3613 e9 20 SBC #&20 ; skip_wrap_around &3615 85 75 STA &75 ; check_screen_address_high &3617 b1 74 LDA (&74),Y ; check_screen_address &3619 48 PHA &361a 8a TXA &361b 4a LSR A &361c a8 TAY &361d 68 PLA &361e 99 70 00 STA &0070,Y ; bee_check_results &3621 e8 INX &3622 e8 INX &3623 e0 08 CPX #&08 &3625 d0 da BNE &3601 ; get_screen_values_around_player_loop &3627 60 RTS ; bee_check_screen_offsets &3628 07 00 &362a 1f 00 &362c 00 03 &362e 10 03 ; store_screen_values_around_player &3630 20 ff 35 JSR &35ff ; get_screen_values_around_player &3633 a2 00 LDX #&00 ; store_screen_values_around_player_loop &3635 b5 70 LDA &70,X ; bee_check_results &3637 95 35 STA &35,X ; original_bee_check_results &3639 e8 INX &363a e0 04 CPX #&04 &363c d0 f7 BNE &3635 ; store_screen_values_around_player_loop &363e 60 RTS ; check_screen_values_around_player_for_bees &363f 20 ff 35 JSR &35ff ; get_screen_values_around_player &3642 a2 00 LDX #&00 ; check_screen_values_around_player_for_bees_loop &3644 b5 70 LDA &70,X ; bee_check_results &3646 d5 35 CMP &35,X ; original_bee_check_results &3648 d0 06 BNE &3650 ; player_touched_bee &364a e8 INX &364b e0 04 CPX #&04 &364d d0 f5 BNE &3644 ; check_screen_values_around_player_for_bees &364f 60 RTS ; player_touched_bee &3650 4c e3 1a JMP &1ae3 ; kill_player ; actually_plot_bee &3653 a5 9f LDA &9f ; bee_skip_plotting &3655 85 9e STA &9e ; initial_bee_skip_plotting &3657 a5 76 LDA &76 ; bee_relative_y_in_fractions &3659 85 78 STA &78 ; y_fraction &365b 85 9d STA &9d ; initial_bee_relative_y_in_fractions &365d 86 76 STX &76 ; bee_width &365f 84 77 STY &77 ; bee_height &3661 a0 00 LDY #&00 &3663 a6 77 LDX &77 ; bee_height &3665 a5 70 LDA &70 ; screen_address_low &3667 85 74 STA &74 ; previous_screen_address_low &3669 a5 71 LDA &71 ; screen_address_high &366b 85 75 STA &75 ; previous_screen_address_high ; inner_loop &366d a5 9f LDA &9f ; bee_skip_plotting &366f d0 04 BNE &3675 ; skip_plot &3671 b1 72 LDA (&72),Y ; sprite_address &3673 91 70 STA (&70),Y ; screen_address ; skip_plot &3675 e6 72 INC &72 ; sprite_address_low &3677 d0 02 BNE &367b &3679 e6 73 INC &73 ; sprite_address_high &367b ca DEX &367c f0 3f BEQ &36bd ; end_of_column &367e e6 70 INC &70 ; screen_address_low &3680 d0 08 BNE &368a ; skip_wrap_around &3682 e6 71 INC &71 ; screen_address_high &3684 10 04 BPL &368a ; skip_wrap_around &3686 a9 60 LDA #&60 &3688 85 71 STA &71 ; screen_address_high ; skip_wrap_around &368a a5 70 LDA &70 ; screen_address_low &368c 29 07 AND #&07 &368e d0 dd BNE &366d ; inner_loop &3690 a9 00 LDA #&00 &3692 85 9f STA &9f ; bee_skip_plotting &3694 e6 78 INC &78 ; y_fraction &3696 a5 78 LDA &78 ; y_fraction &3698 c9 06 CMP #&06 &369a 90 07 BCC &36a3 ; off_top_or_bottom_of_screen &369c c9 26 CMP #&26 &369e b0 03 BCS &36a3 ; off_top_or_bottom_of_screen &36a0 4c a7 36 JMP &36a7 ; between_top_and_bottom_of_screen ; off_top_or_bottom_of_screen &36a3 a9 01 LDA #&01 &36a5 85 9f STA &9f ; bee_skip_plotting ; between_top_and_bottom_of_screen &36a7 38 SEC &36a8 a5 70 LDA &70 ; screen_address_low &36aa e9 08 SBC #&08 &36ac 85 70 STA &70 ; screen_address_low &36ae b0 02 BCS &36b2 &36b0 c6 71 DEC &71 ; screen_address_high &36b2 e6 71 INC &71 ; screen_address_high &36b4 10 b7 BPL &366d ; inner_loop &36b6 a9 60 LDA #&60 &36b8 85 71 STA &71 ; screen_address_high &36ba 4c 6d 36 JMP &366d ; inner_loop ; end_of_column &36bd c6 76 DEC &76 ; bee_width &36bf d0 01 BNE &36c2 ; next_column &36c1 60 RTS ; next_column &36c2 a5 9e LDA &9e ; initial_bee_skip_plotting &36c4 85 9f STA &9f ; bee_skip_plotting &36c6 a5 9d LDA &9d ; initial_bee_relative_y_in_fractions &36c8 85 78 STA &78 ; y_fraction &36ca 18 CLC &36cb a5 74 LDA &74 ; previous_screen_address_low &36cd 69 08 ADC #&08 &36cf 85 74 STA &74 ; previous_screen_address_low &36d1 85 70 STA &70 ; screen_address_low &36d3 90 08 BCC &36dd ; skip_wrap_around &36d5 e6 75 INC &75 ; previous_screen_address_high &36d7 10 04 BPL &36dd ; skip_wrap_around &36d9 a9 60 LDA #&60 &36db 85 75 STA &75 ; previous_screen_address_high ; skip_wrap_around &36dd a5 75 LDA &75 ; previous_screen_address_high &36df 85 71 STA &71 ; screen_address_high &36e1 a6 77 LDX &77 ; bee_height &36e3 4c 6d 36 JMP &366d ; inner_loop ; unused # Source code fragment corresponding to &29ab-&29b1 &36e6 6f 20 43 50 58 26 38 46 3a 42 4e 45 63 6f 31 3a ; "o CPX&8F:BNEco:CPY&90:BNE" &36f6 43 50 59 26 39 30 3a 42 4e 45 ; level 1 object data # five bytes per object ; x y t e &3700 14 02 00 03 1e ; KEY_GB &3705 05 12 02 fa 19 ; PICKAXE &370a 03 38 07 1c 23 ; KEY_GM &370f 34 08 02 fa 19 ; PICKAXE &3714 03 03 01 22 1e ; SCROLL: SCROLL_OPEN_TEMPORARY (&22, &1e) &3719 2b 2d 02 fa 23 ; PICKAXE &371e 2b 31 01 04 ff ; SCROLL: SCROLL_TELEPORT &3723 0c 23 01 01 ff ; SCROLL: SCROLL_OPEN &3728 22 36 06 1c 19 ; KEY_MB &372d 29 1a 00 20 2c ; KEY_GB &3732 2a 11 01 05 ff ; SCROLL: SCROLL_LIGHTNING_STRIKE &3737 1e 2f 08 fa ff ; CRUCIFIX_TL &373c ff 05 02 04 # Last three bytes correspond to level colours ; level 2 object data &3740 01 00 01 02 ff ; SCROLL: SCROLL_STRENGTH &3745 0b 26 0c 03 ff ; POTION: POTION_NORMAL_SPEED &374a 26 14 01 02 ff ; SCROLL: SCROLL_STRENGTH &374f 28 37 00 20 1e ; KEY_GB &3754 1f 30 0e fa ff ; FOOD &3759 02 00 01 04 ff ; SCROLL: SCROLL_TELEPORT &375e 1c 05 0d fa ff ; SCYTHE &3763 0d 29 05 fa ff ; SPADE &3768 1c 1e 09 fa ff ; CRUCIFIX_BL &376d 03 23 0c 02 ff ; POTION: POTION_SLOW &3772 12 29 01 09 ff ; SCROLL: SCROLL_SPEED &3777 03 08 07 35 0b ; KEY_GM &377c ff 05 02 04 # Last three bytes correspond to level colours ; level 3 object data &3780 0f 09 0b fa ff ; CRUCIFIX_BR &3785 00 00 03 fa ff ; DETONATOR &378a 30 06 04 fa ff ; DYNAMITE &378f 35 20 07 08 02 ; KEY_GM &3794 11 22 0c 04 ff ; POTION; POTION_LOSER &3799 35 00 01 03 ff ; SCROLL: SCROLL_TIME_CHIME &379e 05 1d 0f fa ff ; WINE &37a3 16 22 00 08 06 ; KEY_GB &37a8 14 17 16 fa ff ; BOW_AND_ARROW &37ad 2b 15 12 fa ff ; COMPASS &37b2 0d 37 06 08 04 ; KEY_MB &37b7 01 04 13 fa ff ; AXE &37bc ff 05 03 04 # Last three bytes correspond to level colours ; level 4 object data &37c0 09 01 01 09 ff ; SCROLL: SCROLL_SPEED # Replaced with CRUCIFIX_BR at end of level &37c5 33 2d 14 fa ff ; CAKE &37ca 1a 18 01 02 ff ; SCROLL: SCROLL_STRENGTH &37cf 2d 03 01 04 ff ; SCROLL: SCROLL_TELEPORT &37d4 02 00 05 fa ff ; SPADE &37d9 13 2f 01 06 ff ; SCROLL: SCROLL_ENERGY_DRAIN &37de 06 2d 13 fa ff ; AXE &37e3 38 37 16 fa 38 ; BOW_AND_ARROW &37e8 2a 20 0d fa 38 ; SCYTHE &37ed 27 37 0c 01 ff ; POTION: POTION_SPEED &37f2 32 31 15 fa ff ; BELL &37f7 11 00 06 15 38 ; KEY_MB &37fc ff 05 02 11 # Last three bytes partly correspond to level colours ; current_level_tiles # 4 bits per tile, 32 bytes per column &3800 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 # Left edge (four columns) &3810 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &3820 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &3830 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &3840 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &3850 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &3860 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &3870 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 ; level_1_tiles (Castle Ravenskull) &3880 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &3890 00 00 00 00 12 02 00 00 00 00 00 00 00 00 00 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &38a0 11 70 22 82 00 00 00 00 00 00 00 00 00 00 40 00 ; 3d~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &38b0 00 04 00 00 12 02 00 00 00 00 00 00 27 22 08 11 ; 3c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &38c0 11 20 09 26 20 20 20 20 20 20 20 20 20 20 20 08 ; 3b~~ ~~~~ &38d0 70 02 02 02 12 02 02 02 02 02 02 02 92 60 02 11 ; 3a~~ /###\ / \ /###\ ~~~~ &38e0 11 20 00 20 22 22 22 22 22 22 22 22 22 22 22 33 ; 39~~ #/ \# # # # # # # # # # # # # # # # # # # # # # # # #/ \# ~~~~ &38f0 33 22 22 22 12 22 a2 22 22 22 22 22 02 00 02 11 ; 38~~ # . ################################################# $ # ~~~~ &3900 11 20 08 c0 cc cc cc 2c 22 22 22 22 22 22 2b 09 ; 37~~ #\ \###############$ /# ~~~~ &3910 60 b2 92 60 12 92 00 00 60 92 00 00 00 70 02 11 ; 36~~ \##& &&&&&&& &&&&&& 8 #$##/. | | \### #####\ ##/ ~~~~ &3920 11 60 22 00 00 00 00 2c 09 00 00 00 00 60 4b 00 ; 35~~ #& &#####&&&&&&&&#####\ |#$ ! # #@@@@# # ~~~~ &3930 00 b4 42 00 12 02 70 82 00 42 00 00 00 22 09 11 ; 34~~ ##& &#~~~#& b #####/ ####\ | | /# # #|$$|# ## ~~~~ &3940 11 00 20 c0 cc cc 0c 2c 40 40 40 40 40 00 0b 00 ; 33~~ #& &#####& & &&& #/*$ 8 ######### ###### #/ @# # ~~~~ &3950 00 b0 02 00 12 22 22 21 08 42 7f 8b 00 02 00 11 ; 32~~ ##& &&&&&&& &&&### #\*$ /####/ | | \####8 @# ## ~~~~ &3960 11 00 22 c0 22 c2 00 2c 0f 00 00 00 00 00 00 00 ; 31~~ #& & &##### ########/ \# ! ! .##8888 |# # ~~~~ &3970 00 00 00 00 12 11 11 11 02 42 b0 bb 00 22 00 11 ; 30~~ ##& &&&&&&&#oo## ##oo#/\# #\ | | /##8 $ @# ## ~~~~ &3980 11 00 20 c0 12 c2 c0 2c 40 40 40 40 40 00 0b 00 ; 2f~~ #&&&&&#######o#/$ $\#o#/\# . ###### #######8888 @# # ~~~~ &3990 00 b0 02 00 26 22 22 21 09 42 6f 9b 00 02 00 11 ; 2e~~ ########/\#/\##/ \##/\# ###### ###/ \###$ |# ## ~~~~ &39a0 11 00 22 c0 12 c2 c0 22 08 00 00 00 00 70 4b 00 ; 2d~~ ##/ $ \\/#\/##$ 8\8 $#####\ /#/$ \# ### . \##88 @# # ~~~~ &39b0 00 b4 42 00 00 00 60 92 00 42 00 00 00 22 00 11 ; 2c~~ ### 8 8 /#/ \# * # ###\ $ @# ## ~~~~ &39c0 11 00 20 c0 12 c2 c0 92 06 22 22 22 22 22 bb 0b ; 2b~~ ## # #/\##$ 8\8 $## #### # #%%%%%%%#88 |# # ~~~~ &39d0 b0 bb 82 00 00 00 00 00 70 82 00 00 00 02 00 11 ; 2a~~ ### 8 8 # #\/##\ /## $ #~~# #% %#$#%#$8 @# ## ~~~~ &39e0 11 00 22 c0 22 c2 c0 82 07 00 d0 dd dd dd 22 0b ; 29~~ ## # o#\$ $/#o#\ /#~~# # #% %/ \%# # @# # ~~~~ &39f0 b0 22 22 22 22 22 22 22 22 22 22 22 08 22 00 11 ; 28~~ ### 8 8 #%%%% oo## ##oo#####~~#\ /# #% /%| # |# ## ~~~~ &3a00 11 00 20 c0 cc cc c0 22 02 22 d0 00 00 d0 22 0b ; 27~~ ## #% $% $% %# $#~~~~~~###### #% %###%# # @# # ~~~~ &3a10 b0 92 2f ee ee ee ee ee 22 22 22 22 02 02 00 11 ; 26~~ ### 8 8 #% %%%%%%% #~##########/ #% %/ \%# # @# ## ~~~~ &3a20 11 00 22 00 0c 00 c0 92 06 69 d0 df d0 dd 22 0b ; 25~~ ## #% % % %# #~# #% %\ /%| # |# # ~~~~ &3a30 b0 82 20 0e 00 00 00 ce cc cc cc cc 02 22 00 11 ; 24~~ ### 8 8 #% % % % % %####~# ###########% %#$#%# # @# ## ~~~~ &3a40 11 00 20 00 0c cc cc 82 07 78 d0 dd 00 d0 22 02 ; 23~~ ## #%.% % %###/\#*#/\###@@@@@% %/ \%# # @# # ~~~~ &3a50 20 22 20 0e e0 e0 00 ce 0f 00 00 c0 02 02 00 11 ; 22~~ ###\ /#%%%%%%%%%%%###### ######@@@@@% %\ /%| |# ## ~~~~ &3a60 11 00 22 00 0c c0 22 22 02 22 00 d0 dd d0 22 02 ; 21~~ #ooo ooo##########//##/ \##\\#%%%% %#$#%## ### # ~~~~ &3a70 20 22 20 0e e0 e0 00 ce 0f 00 00 60 09 22 00 11 ; 20~~ 8###8 8o##########\\#/ /#\ \#//#% ### ## ~~~~ &3a80 11 00 20 00 0c cc b2 2b 02 22 bb d0 00 d0 22 0c ; 1f~~ \*/ oooo##&#&##### // \\ ####% 8 #%#$#%## ### # ~~~~ &3a90 c0 22 20 fe e0 e0 f0 ce cc cc 8c 00 00 02 00 11 ; 1e~~ *! # 8 # * #%/ \%## ### ##\ ~~~~ &3aa0 11 00 22 00 0c 2c b2 92 0f 6f b2 d0 d0 dd 22 02 ; 1d~~ * /#### \\ // #########%%%%%\8 8/# ##/ ~~~~ &3ab0 20 22 20 ee ee e0 ee 2e 22 22 22 22 08 22 00 11 ; 1c~~ /*\ oooo##&#&##//#\ \#/ /#\\#####&#####/#!!#\# # ~~~~ &3ac0 11 00 20 00 0c 2c 22 09 00 00 26 df 00 d0 22 0c ; 1b~~ 8###8 8o##########\\##\ /##//###/# #\##### ### ## ~~~~ &3ad0 c0 92 00 00 00 00 00 00 00 00 00 60 02 02 00 11 ; 1a~~ #ooo ooo#/\####/\######## #########/8#.#8\#### \## # ~~~~ &3ae0 11 70 22 c0 0c 20 22 0f 74 04 2f dd dd d0 22 02 ; 19~~ ##### ####$ #####\/#*#\/##$ \# / \ ## @# ## ~~~~ &3af0 27 82 00 00 00 00 00 00 00 00 00 00 09 22 08 11 ; 18~~ #/8 8\####### \####### ##/ \\ ## /\ @# # ~~~~ &3b00 11 00 20 c0 22 00 00 00 26 08 00 00 00 d0 22 02 ; 17~~ ## #@@@@@@ $ #### / ## oo\ @# ## ~~~~ &3b10 22 22 82 70 22 22 22 22 e2 e0 e0 ee 00 02 00 11 ; 16~~ #\ #@ $@ /####### ##\ /#\/# \%\ ## \o/ @# # ~~~~ &3b20 11 60 22 c0 22 22 22 0f 94 04 2f 0d dd dd 69 02 ; 15~~########\ #@ @ #/ \#/ \######*/ / \#$ @# ## ~~~~ &3b30 92 26 22 20 09 36 33 93 e0 e0 e0 ef 70 22 09 11 ; 14~~~~~~~~~~# #@ @@@@ # $$# ! ! ####\ @# # ~~~~ &3b40 11 00 20 c0 22 69 22 08 00 00 27 02 22 22 69 02 ; 13~~#######~# #@ #\ /###\ /##### *#########$#### @# ## ~~~~ &3b50 92 26 22 20 00 00 00 00 e7 e0 e0 e0 e0 02 00 11 ; 12~~ #/.#~# #@ @@@@ #* #/ \ / ### \########/ #### @# # ~~~~ &3b60 11 00 22 c0 22 33 b2 82 0f 7f b2 00 20 22 22 02 ; 11~~ ## #~# #@ @ #* # /#\ / /#$@ . #### @# ## ~~~~ &3b70 22 22 22 20 00 27 02 22 e2 e0 e0 e0 e0 22 00 11 ; 10~~ | /#~#\ #@ $@ #* \ / *# @ /#############/ @# # ~~~~ &3b80 11 00 20 c0 22 ff b2 2b 02 22 bb 0f 20 22 92 00 ; 0f~~ ## #~~~# #@@@@@@ #* # /#\ / *# @ #/ b$ \&&& @# ## ~~~~ &3b90 60 22 22 20 f0 92 00 00 e6 e0 ef e0 e0 02 00 11 ; 0e~~ # \#~#/ #@&&&&# #/ # \ / \# @ 8 8 8 8 &@# # ~~~~ &3ba0 11 00 22 00 96 00 22 22 02 22 22 22 22 29 09 00 ; 0d~~ ## \#/ ##&$$&# # /#\ # @ #\b $ /&& @@@# ## ~~~~ &3bb0 00 26 26 20 f8 02 07 07 e0 e0 ee e0 e0 22 00 11 ; 0c~~ #\ /##& &# @@@@@@@@@@@@@ @ \############ @ # ~~~~ &3bc0 11 00 20 00 00 00 92 97 02 00 26 11 11 28 00 27 ; 0b~~ ###########& &# @ @ # * ## @ ##### ~~~~ &3bd0 08 20 27 20 22 02 02 02 e0 e0 00 e0 e0 02 00 11 ; 0a~~ #/88888\##& &# @@@@@@@@@@@ @ @+ + + # # ## @ # ~~~~ &3be0 11 00 22 40 00 04 82 86 02 f0 20 21 22 22 70 09 ; 09~~ ## $ $ ##& &# $@ @ @ # # # # @### ## ~~~~ &3bf0 86 20 22 20 09 86 86 86 e0 e0 e0 e0 e0 22 00 11 ; 08~~ # /o\ ##& \# @@@@@@ @@@@@@ @+ + + # # # # 8@ .# # ~~~~ &3c00 11 00 20 08 00 70 22 22 82 00 27 21 00 03 20 40 ; 07~~ ## ooo ##& # @$ @ # # # # @ /# ## ~~~~ &3c10 20 00 03 00 f0 00 00 00 e0 e0 e0 e0 e0 02 00 11 ; 06~~ # \o/ ##&&\ #\ @@@@@@@@@@ @@$@+ + + # # # ## @ ## # ~~~~ &3c20 11 00 22 22 20 22 09 00 26 22 22 21 20 22 60 08 ; 05~~ /## \###/ \#/ @@@@$ # # @ \/ ##\ ~~~~ &3c30 97 20 22 20 08 97 97 97 e0 e0 e0 e0 e0 22 00 11 ; 04~~ #/ b /@@@@@@@@ $@888888#***#8888@ \# ~~~~ &3c40 11 00 20 f2 20 22 00 00 00 12 11 21 20 29 00 26 ; 03~~ # . ################################################# # ~~~~ &3c50 09 20 26 20 02 02 00 00 e0 e0 e0 00 00 02 00 11 ; 02~~ #\ /# # # # # # # # # # # # # # # # # # # # # # # # #\ /# ~~~~ &3c60 11 00 22 22 2a 22 08 00 07 12 11 21 20 28 08 00 ; 01~~ \###/ \./ \###/ ~~~~ &3c70 00 27 97 60 02 02 37 83 e0 00 e0 e0 0e 22 00 11 ; 00~~ ~~~~ &3c80 11 00 20 22 22 22 22 22 32 22 22 22 20 22 82 00 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &3c90 70 22 02 0f 02 22 22 22 e2 ee ee e0 0e 02 00 11 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &3ca0 11 00 22 92 6f 92 60 22 09 00 60 22 20 22 22 02 ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &3cb0 22 22 82 70 02 22 0f 00 00 00 00 f0 fe 22 00 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &3cc0 11 00 20 02 00 02 00 22 0f 00 00 22 20 22 78 32 &3cd0 82 27 6f 22 02 22 ee ee ee ee ee ee ee 02 00 11 &3ce0 11 00 22 02 00 02 00 22 00 00 00 22 20 ee 78 02 &3cf0 82 27 00 62 02 00 00 00 00 50 50 50 4f 22 00 11 &3d00 11 00 20 02 00 02 00 22 08 00 70 22 20 ee 22 02 &3d10 22 22 08 72 03 83 70 02 82 00 00 00 40 02 00 11 &3d20 11 00 22 a2 a0 a2 a0 22 22 02 22 92 20 ee dd 0d &3d30 22 22 02 22 09 22 20 09 26 50 50 50 40 22 00 11 &3d40 11 00 20 02 00 00 00 00 00 00 00 00 20 ee 0d 00 &3d50 22 92 00 00 00 22 20 40 20 00 00 00 40 02 00 11 &3d60 11 00 22 a2 a0 a2 a0 22 22 22 22 22 22 ee 0d 04 &3d70 22 49 00 00 00 22 20 00 20 50 50 50 40 22 00 11 &3d80 11 00 20 02 00 02 00 22 22 dd dd dd dd dd 0d 00 &3d90 22 22 09 80 00 22 20 40 20 00 00 00 40 02 00 11 &3da0 11 00 22 02 00 02 00 22 22 0d 00 00 00 00 00 22 &3db0 c2 00 00 d7 09 22 20 0f 2f 20 22 22 22 22 00 11 &3dc0 11 00 20 02 00 02 00 92 60 dd 0d dd dd dd 0d dd &3dd0 2d 22 08 60 00 22 20 40 20 00 00 00 30 02 00 11 &3de0 11 00 22 82 70 82 70 02 00 2d 09 92 26 69 02 92 &3df0 2d 48 00 00 00 22 20 00 20 22 22 22 30 22 00 11 &3e00 11 00 20 2f 20 22 22 82 00 fd 00 02 f0 00 0f 0f &3e10 2d 82 00 00 00 22 20 40 20 00 00 00 30 02 00 11 &3e20 11 00 22 20 00 20 22 22 08 2d 78 82 27 78 02 82 &3e30 2d 22 22 22 08 92 20 00 20 03 22 22 22 22 00 11 &3e40 11 00 20 20 22 20 44 24 02 dd dd dd dd dd 0d dd &3e50 2d 22 22 22 22 0f 20 08 27 00 00 00 40 02 00 11 &3e60 11 00 22 00 00 20 04 24 02 22 a2 22 2a a2 02 22 &3e70 78 22 00 00 2f 22 22 0c 2c 22 22 22 40 22 00 11 &3e80 11 00 20 20 22 42 f4 f4 f4 f4 00 00 00 00 02 22 &3e90 24 22 70 8b 20 22 22 0c 2c 22 00 20 40 02 00 11 &3ea0 11 00 22 20 ae 09 04 04 04 44 22 22 22 02 00 00 &3eb0 00 00 60 bb 20 22 22 0c 00 00 40 00 40 22 00 11 &3ec0 11 00 20 20 fe 00 00 00 00 00 00 00 00 00 00 00 &3ed0 00 00 00 96 60 22 92 00 ee ee ee ee ee 02 00 11 &3ee0 11 00 22 20 fe 00 00 00 00 00 00 00 00 00 22 22 &3ef0 24 82 00 00 00 00 00 c0 0e 00 02 00 00 22 00 11 &3f00 11 00 20 20 ae ee ea ae ee ea ae ee ea ae 22 22 &3f10 69 22 ee ee ee ee ee ee 0e 02 02 27 08 02 00 11 &3f20 11 70 22 60 22 22 22 22 22 22 22 22 22 22 22 22 &3f30 22 22 22 22 22 22 22 22 02 02 22 22 09 22 08 11 &3f40 11 20 09 00 00 00 00 00 00 00 00 00 00 00 00 00 &3f50 00 00 00 00 00 00 00 00 00 02 00 00 00 60 02 11 &3f60 11 20 f0 20 22 22 22 22 22 22 22 22 22 22 22 22 &3f70 22 22 22 22 22 22 22 22 22 22 22 22 02 00 02 11 &3f80 11 20 08 27 20 20 20 20 20 20 20 20 20 20 20 20 &3f90 02 02 02 02 02 02 02 02 02 02 02 02 82 70 02 11 &3fa0 11 60 22 92 00 00 00 00 00 00 00 00 00 00 00 60 &3fb0 09 00 00 00 00 00 00 00 00 00 00 00 26 22 09 11 &3fc0 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3fd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 ; &3fe0 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 # Right edge (four columns) &3ff0 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4000 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4010 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4020 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4030 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4040 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4050 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 ; level_2_tiles (The Catacombs) &4060 11 4f 00 00 00 00 20 00 00 00 00 00 00 20 00 00 ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &4070 00 00 00 00 00 00 f2 01 00 00 00 04 00 09 60 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &4080 11 00 24 22 02 22 20 20 22 20 22 22 02 02 0f 02 ; 3d~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &4090 22 22 02 22 22 02 02 01 69 40 44 04 04 00 00 11 ; 3c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &40a0 11 00 40 22 02 02 20 20 20 20 00 00 22 22 22 02 ; 3b~~$ # ~$ o o $~~~~ &40b0 02 00 02 02 00 00 02 01 11 40 f0 04 f0 00 00 11 ; 3a~~8 b # ### # # ### ## #########~ ######## ########## ~~~~ &40c0 11 00 00 24 02 02 22 20 20 20 22 02 00 00 00 00 ; 39~~ 8 b # $# ##### # # # ~ ####### #$ # ~~~~ &40d0 02 02 02 22 22 22 02 01 41 40 00 04 44 08 70 11 ; 38~~ #8 b #### # # # ### ##### ~ ## o # ######## # ~~~~ &40e0 11 00 00 40 02 02 00 20 20 00 00 20 20 20 22 02 ; 37~~ ##8 b # #### # # ## ~~ #. o o ~~~~ &40f0 00 20 00 02 00 00 02 01 41 40 40 04 44 11 11 11 ; 36~~ ###8 b ### ###$ ######## # #$ # ~~ %%%%%%%%%%%%%% % %% ~~~~ &4100 11 00 00 00 04 02 22 22 20 22 22 22 20 20 20 02 ; 35~~ ####8 ### ##### # # ### # ~~ % % % ~~~~ &4110 02 22 02 00 02 02 02 01 41 40 40 00 44 04 00 11 ; 34~~ 8 8##### # ~~ %%%% %%%o%%% % %o$ ~~~~ &4120 11 00 00 00 00 02 02 00 00 00 00 00 20 20 00 00 ; 33~~ ##################8 8 # #### ## ~~ %$oo % $% %% o ~~~~ &4130 02 20 20 22 02 02 02 01 41 40 40 00 04 00 04 11 ; 32~~ # #@&&&&&&&&$ ## ### # # # ~~ % % o # ##% %%% % ~~~~ &4140 11 00 00 00 00 02 22 22 22 22 22 02 44 40 04 02 ; 31~~ # ### #& ## ### # ~~ %% %oo #o# %%o%~% % ~~~~ &4150 02 22 20 00 00 02 00 01 41 40 00 00 04 04 04 11 ; 30~~#### # # #@& &&&&&&& # ##### .# # ~~ % o o $% %~% % ~~~~ &4160 11 00 00 00 00 02 00 00 00 00 00 00 44 40 04 22 ; 2f~~ # # #@& &&@@@@@& # # ##### # ~~ % o%%%%%%%o%% %~% % ~~~~ &4170 02 20 20 22 22 22 22 01 41 40 03 03 00 04 04 11 ; 2e~~ ##### # #@& &&&&&& # # # ### ~$ o $%o %% %%% % ~~~~ &4180 11 22 22 22 02 22 22 22 22 22 22 00 11 00 01 00 ; 2d~~ # # #&$ & && # ### ### # ~~ % o %% o %$ % ~~~~ &4190 02 20 00 00 00 00 02 01 41 00 04 44 44 00 04 11 ; 2c~~ ##### # #@& &&&& $&& # # # # # ~/ %%%%%% o % %%%%%%%% ~~~~ &41a0 11 00 20 20 02 e2 ec ee ec ee 2e 17 11 08 16 08 ; 2b~~ # # #@& &&&&& ### ### # # # ~ ooo o o~~~~ &41b0 22 22 22 22 02 22 00 01 41 00 0f 00 00 40 04 11 ; 2a~~ ### # # #@&&&& &$ # # # # # # ~\ %%%%%% o o%%%% %%% ~~~~ &41c0 11 20 20 20 02 c2 c0 cc cf cc 2e 01 f0 04 f0 01 ; 29~~ # # # # #@@&.& &.& &# # ### # # ~~ % o %% % % $% %%% ~~~~ &41d0 00 00 00 00 00 02 02 01 41 00 44 44 43 40 00 11 ; 28~~ # # # # ###### ####### # # # ~~ o $o $% o o ~~~~ &41e0 11 20 2f 00 00 c2 00 00 00 c0 2c 16 08 0d 17 09 ; 27~~ # # # # /~\/~ ~~~~~~# #### # # #~~~~~~~~~~~~~ /~~~~~~\o~~~~ &41f0 22 22 00 02 02 02 02 01 41 00 00 00 00 b0 0f 11 ; 26~~ # ## ~.~~ ~$ 8888 8888 ~~~~~~~~~~~~~~~~~~~/$\ ~~~~ &4200 11 20 02 20 02 c2 c0 0c cc c0 20 17 f9 04 16 08 ; 25~~ ## 88~~ \/ ~ /~~~~8$ $8 ~~$ ~~~~ &4210 00 20 20 22 20 02 02 01 41 44 44 44 43 44 44 11 ; 24~~ # ###88~~$ $ &~ /~/ \~8 /88\ 8 /~~~~~~~8 8~~~~~~~~~\o/~~~~~ &4220 11 00 00 20 02 c2 c0 0c c0 c0 2c 01 00 0d f0 01 ; 23~~ ##. \8%8%8%8~~ ~8888@@8888$~ !$ $ 8888$8$~~~~ &4230 02 20 00 00 20 00 02 01 00 00 00 00 00 00 00 11 ; 22~~# # ###88 ~~8~~88~~8~#~ / ~~~8 8~~~~\ 8 ! ~~~~ &4240 11 20 02 22 02 c2 c0 ce c0 00 00 00 c0 04 17 09 ; 21~~ $# # 88~\ /\ /\ /~~\ ~~~~~~~~~~~#~ | | \~ 8 88888~~~~ &4250 02 20 20 22 02 20 02 11 11 11 11 11 11 11 01 11 ; 20~~ # ## ~$~~$~~$~#$~ ~~@@@@@@@~~#/ ~ ~ $ $ $ $ ~ 8 8$ ~~~~ &4260 11 00 02 f2 02 c2 c0 ce c0 cc 20 11 11 0d 16 08 ; 1f~~ ## ## ## \~/\~/\~~# ~ ~~@~~~~~@~ * ~ ~ * * * ~ 8 888~ ~~~~ &4270 02 20 00 00 00 20 00 00 00 00 26 20 09 00 00 11 ; 1e~~ # $# ~ ~~@~/.\~@| o | | $* *$ ~ 8 ~~~~ &4280 11 00 02 02 02 c2 c0 ce 00 fc 2c f1 00 04 f0 01 ; 1d~~ ### ###### # ###### ~ ~~@~\!/~~~ * ~ ~ * * * ~ 88888~ ~~~~ &4290 02 20 22 22 22 20 22 22 22 00 20 20 00 00 00 11 ; 1c~~ # # # # ~ ~~@~*@*~~~~#\ ~ ~ $ $ $ $ ~ ~~~~ &42a0 11 00 02 02 00 c2 c0 ce f0 0c 20 01 70 01 17 f1 ; 1b~~ # # # # # # # ~ ~~@@@@~~~~~#~ | | * * * /~~~~~~~\ ~~~~ &42b0 02 00 00 00 00 00 00 00 00 00 20 20 00 37 08 11 ; 1a~~ # ####### ###### # ~ ~~~~~~~~~~~#/ ~ ~\ ~ ~ ~~~~ &42c0 11 20 22 20 42 f4 c0 ce cc 0c 2c 01 17 01 21 22 ; 19~~ ### # # # # ~ ~ ~88888~~~~ ~~~~\ ~ ~~~~ &42d0 22 22 22 22 20 02 11 11 11 08 20 00 00 03 03 11 ; 18~~ ### # # # # # ~~~ /~~~~~~~~~~~~ ~8/$\8@@@~ ~@@@~ ~ ~~~~ &42e0 11 00 00 20 00 00 00 cc cc 0c 20 01 91 00 f1 00 ; 17~~ #### # # # ## # # # ~ ~/ ~8\ /8@@@~ ~@@@~ ~ ~~~~ &42f0 00 00 00 00 02 00 11 11 11 01 20 20 00 36 09 11 ; 16~~ # # # # # # # # # # ~ ~ 8888888888 88/ ~8@&@~$~@&@~ ~ ~~~~ &4300 11 20 22 20 40 24 02 00 00 00 2c 01 01 00 16 11 ; 15~~ # # ## # # # # # ## ~ ~ #####8!!8/ ~8@@@~~~@@@~ ~ ~~~~ &4310 11 11 11 20 02 02 81 17 78 f1 20 20 00 00 f0 11 ; 14~~ # # # ## # # ~ ~ /~\ # $#8. /~8@@@@@@@@@~ ~ ~~~~ &4320 11 20 00 22 20 20 22 22 22 22 22 02 81 00 00 00 ; 13~~ # # #### #### # # ~ ~ \~/ # ###8 888888~~~~~~~~~~ ~ ~~~~ &4330 00 00 10 00 00 70 01 00 60 81 47 40 f8 17 1a 11 ; 12~~ # # # ### /~ ~\ # 8o88~~~/ ~ ~ \~ ~ ~~~~ &4340 11 20 00 20 20 00 00 00 00 02 00 00 11 11 11 11 ; 11~~####### ## ##### # ~~~~~ ~~~~~ # $8 * * * ~~~~ &4350 11 11 10 11 11 11 01 03 03 11 91 60 11 09 60 11 ; 10~~$ # # ~~\ /~~ #####8 ~~~\ ~ /~~~~~~~~ &4360 11 00 22 20 20 20 20 22 02 22 02 42 44 14 11 11 ; 0f~~~~~~~~~~~~~~~~~~ # ~~/ *** \~~ 8 ~~~~~~~~~\ /~~~~~~~~~~ &4370 11 11 00 00 00 00 00 03 00 00 00 00 00 00 00 11 ; 0e~~ ! ~ # ~~~ ~~~ /~~~~~~~~~~~~~~~~~~ ~$$ \~~~~ &4380 11 20 00 20 20 20 20 00 02 00 00 42 0f 44 e1 ee ; 0d~~ /~~~~~~~~~~~~ ~ # ~~\ * * /~~ ~~ ~~ ~$$ ~~~~ &4390 ee 1e 70 11 11 11 01 03 03 11 81 70 11 08 70 11 ; 0c~~ \~88888888888 ~ # ~~/\ /\~~ ~~ ~~~~~~~~~~~~\ ~~ ~~~~/ ~~~~ &43a0 11 20 22 20 20 22 20 20 02 22 02 42 00 14 e1 11 ; 0b~~ 8 ~ \~~~~ ~~~~/ ~~ ~~~~~~~~~/ ~ ~~ | /~~~~ &43b0 11 1e 10 09 00 60 01 00 70 91 46 40 f9 16 1a 11 ; 0a~~ 88888888 8 ~ $\~ ~/$ ~~ ~~####### /~ ~~~~~~~~~~~~~~ &43c0 11 00 20 00 00 00 20 00 00 02 02 42 70 14 e1 91 ; 09~~ 8 *8$8 8 ~\ /~ ~\ /~~ ~~# $ # ~~/ \~~~~~~~/ ~~~~ &43d0 36 1e 10 00 00 00 91 16 69 f1 20 20 00 00 f0 11 ; 08~~ 8$.888! 8 8 ~######8/ \8###~~~/ ~~# # ~~~~ &43e0 11 20 20 22 22 22 20 02 22 02 02 00 40 4e e1 01 ; 07~~88888 *8 8 8 ~ ~~# /%\ # #### /~~~~~\ ~~~~ &43f0 e0 1e 10 40 70 08 11 11 11 01 20 20 00 00 00 11 ; 06~~ 8 8 8 ~### ##8\ /8###~~~\ ~~# %~% # $# ~ ~$~~~~ &43e0 11 20 20 22 22 22 20 02 22 02 02 00 40 4e e1 01 ; 07~~88888 *8 8 8 ~ ! ~~# /%\ # #### /~~~~~\ ~~~~ &43f0 e0 1e 10 40 70 08 11 11 11 01 20 20 00 00 00 11 ; 06~~ 8 8 8 ~### ##8\ /8###~~~\ ~~# %~% # $# ~ ~$~~~~ &4400 11 20 00 00 00 02 00 02 02 00 00 00 40 4e e1 81 ; 05~~ 8!88888 8 * * ~/ \~ ~/ .#/& & ~~# %~% ###### ~ /~~ ~~~~~~ &4410 37 11 10 40 10 01 11 11 11 09 20 20 22 22 02 11 ; 04~~ $888 8!8 8 ~ $~ ~$ # ~~# %~% /~ ~/ \~~~~ &4420 11 20 00 22 02 22 02 02 22 22 22 42 60 14 e1 11 ; 03~~/ \~8 88 8 ~ /*\ // \\ # & & ~~# %~% #~~~~~~~~ ~ #$ ~~~~ &4430 11 11 10 40 60 09 00 00 00 00 10 10 09 00 00 11 ; 02~~ ~ 88o8 ~ * * ~ ~ # ~~# \%/ # | | ~ # # ~~~~ &4440 11 20 20 f2 02 02 02 02 00 00 00 40 00 14 e1 ee ; 01~~ ~ 88888 $8 ~ \*/ | | # & & ~~# / \ / \ ~ $#$ ~~~~ &4450 11 11 10 40 00 00 00 00 00 00 17 10 0c 0c 0c 11 ; 00~~\../~ ! 8 $~\ /~$ /~~#\ /# | | ~\ /~~~~ &4460 11 20 20 00 02 00 22 22 22 22 20 42 0f 44 11 a1 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &4470 11 11 10 40 22 22 22 70 11 11 11 10 00 00 00 11 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &4480 11 20 20 20 00 02 00 20 00 00 00 40 44 14 11 00 ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &4490 10 11 10 40 02 00 20 10 11 11 91 60 0c 0c 0c 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &44a0 11 20 20 00 02 22 22 22 20 22 22 00 00 2f 22 00 &44b0 20 22 10 40 02 02 20 10 00 00 00 00 00 00 70 11 &44c0 11 20 20 00 00 00 00 00 00 00 00 02 70 11 91 b3 &44d0 63 91 10 40 f2 02 20 10 10 11 11 11 11 11 11 11 &44e0 11 20 00 11 11 11 11 11 11 11 11 11 11 00 00 00 &44f0 00 00 10 40 22 02 20 10 10 11 11 11 11 11 11 11 &4500 11 11 11 11 11 11 11 f1 91 60 11 11 11 70 1a a1 &4510 11 1a 11 40 44 44 40 10 10 21 22 22 22 22 22 11 &4520 11 0f 00 00 00 00 00 00 00 00 00 11 1f 00 00 00 &4530 00 00 00 00 00 b0 0f 10 10 21 00 00 00 00 60 11 &4540 11 20 22 d2 d0 dd dd bd dd d0 0d 11 10 00 00 00 &4550 00 00 00 00 00 40 04 14 10 21 00 d7 dd 8d 00 11 &4560 11 20 22 d0 d0 0f 0d 00 d0 d0 b0 11 10 10 1a a1 &4570 11 1a 11 41 04 44 00 10 10 21 0f 1d 11 d1 00 11 &4580 11 20 02 d0 d0 0b 00 0b db d0 0b 11 10 10 00 00 &4590 00 60 44 44 09 14 10 11 10 21 00 d6 dd 9d 00 11 &45a0 11 20 02 d0 d0 db bd 0d d0 d0 00 11 10 10 f0 00 &45b0 f0 00 94 96 00 14 10 11 10 21 00 00 00 00 70 11 &45c0 11 20 b2 d0 00 00 0b fd d0 d0 00 11 40 40 00 f3 &45d0 03 03 f4 00 70 14 10 11 10 21 22 22 02 22 20 11 &45e0 11 20 02 db d0 bd 0b dd dd d0 fd 11 00 00 f0 30 &45f0 f0 00 84 17 11 94 60 11 10 09 00 00 02 01 00 11 &4600 11 20 22 d0 d0 00 00 bd 0d 0b bd 11 40 40 00 03 &4610 03 03 44 44 44 04 00 11 10 00 01 02 02 01 a7 11 &4620 11 2b 00 d0 d0 20 b2 0d b0 0b 00 11 10 1f f0 30 &4630 f0 00 e1 ee ee 11 03 11 10 70 01 02 02 01 00 11 &4640 11 00 00 db b0 00 0b 0d 0b bb f0 11 10 10 00 f3 &4650 03 03 e1 ce ee 01 00 11 60 11 09 f2 02 a1 08 11 &4660 11 20 22 d0 d0 20 02 0d d0 00 dd 11 10 1f f0 00 &4670 f0 00 e1 ee ee 01 13 11 00 00 00 22 02 01 00 11 &4680 11 20 2f d0 d0 2f 00 0b 00 b0 00 10 10 10 08 00 &4690 00 17 11 11 e1 01 00 11 11 11 08 00 00 01 a7 11 &46a0 11 20 20 d0 d0 dd fd dd dd d0 0d 17 10 60 11 11 &46b0 11 01 00 f0 e1 11 03 16 11 11 01 00 70 01 00 11 &46c0 11 20 20 d0 00 00 dd dd df d0 b0 11 10 00 00 00 &46d0 00 01 11 11 e1 01 00 00 00 10 01 17 11 a1 08 11 &46e0 11 20 20 d0 dd 0d 0b 00 d0 d0 0f 11 10 44 44 44 &46f0 04 01 e1 ee ee 01 00 17 11 10 01 01 00 00 00 11 &4700 11 20 20 00 00 dd dd dd d0 db 0d 11 10 04 00 00 &4710 04 01 e1 ce ee 01 00 f1 1f 1a 01 01 17 11 11 11 &4720 11 2b 20 d0 0d d0 11 d1 d0 00 b0 11 10 04 44 04 &4730 04 01 e1 ee ee 81 70 f1 1f 10 01 01 91 00 60 11 &4740 11 20 20 00 d0 db dd dd d0 d0 0d 91 60 04 f4 04 &4750 04 01 16 11 11 11 10 01 10 10 01 01 01 20 0f 11 &4760 11 20 00 d0 b0 00 00 00 d0 d0 0d f1 b0 0f 04 04 &4770 04 01 00 00 00 00 10 01 90 10 01 01 00 02 02 11 &4780 11 20 22 d0 fd d0 dd dd dd d0 0d 86 70 04 04 01 &4790 01 16 11 11 11 11 10 01 00 10 09 16 01 2f 0f 11 &47a0 11 0f 00 00 00 00 00 00 00 0b 00 0b 10 0f 04 00 &47b0 00 00 00 00 00 00 10 81 00 17 00 f0 81 00 70 11 ; unused &47c0 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &47d0 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &47e0 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &47f0 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4800 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &4810 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 ; sprite_detonator &4820 07 0c 07 0c 01 00 01 00 01 00 30 80 70 c0 70 c0 &4830 73 c0 72 c8 72 c8 72 c8 72 c8 73 c0 70 c0 70 c0 ; level_3_tiles (The Bee's Hive) &4840 11 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &4850 00 00 00 00 00 00 00 00 00 92 f0 f2 f2 f2 00 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &4860 11 00 27 22 22 22 82 70 22 22 22 08 27 22 22 22 ; 3d~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &4870 22 22 20 22 22 22 22 22 02 02 00 02 02 02 00 11 ; 3c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &4880 11 70 92 00 26 dd 2d 20 dd 2d dd 02 d2 dd dd 20 ; 3b~~8 b b b~~~~ &4890 92 00 00 20 00 82 94 94 02 02 27 f2 f2 f2 f0 11 ; 3a~~ /#############################################\ /######\ ~~~~ &48a0 11 20 00 00 2f fd 2d 20 fd 2d dd 02 d2 00 00 20 ; 39~~ /# ####/ \#/ \#/ \## # *###|# #|###$\# ~~~~ &48b0 09 70 8b 00 00 00 00 f0 02 02 22 02 02 02 00 11 ; 38~~ #/ \#/ \\ ## !$ # $ # $ ## ### * #$\#/ \#/$# # ~~~~ &48c0 11 20 80 00 27 0d 2d 20 0d 2d dd 02 d2 c0 d4 20 ; 37~~ # # # #/.#\ /#\ /#\ /## \#&& &&@@@@@@@ # # # ~~~~ &48d0 00 80 7b 20 00 92 84 84 02 02 d2 f2 f2 f2 f0 11 ; 36~~ # # # # */ \%/ \%/ \## #& &@ $@ # /#####\ # 8# ~~~~ &48e0 11 20 20 22 22 0d 2d 20 0d 2d dd 02 d2 00 d0 20 ; 35~~ #\$/#\$/# # ! 8 8 | #& &@ @ # #|||||# # # ~~~~ &48f0 00 80 7b 20 22 22 22 22 02 02 22 02 02 02 00 11 ; 34~~ ######### #\ * | /#&& &&@ @@@@@ # \#####/ #8 # ~~~~ &4900 11 20 90 00 26 0d 9d 60 0d 2d dd 02 d2 c4 d0 20 ; 33~~ #%%%%%%%# ## #\ /%\ /%\ /#####& &@ # # # ~~~~ &4910 08 60 9b 20 92 3f 33 6f 02 02 d2 f2 f2 f2 f0 11 ; 32~~ #%$ %# ## #/ \#/ \#/ \#/ \/ &@ @@@@@ #$/#\ /#\$# 8# ~~~~ &4920 11 20 00 00 2f 0d 00 0f 00 2d 22 02 d2 00 d0 20 ; 31~~ #%%%%% %# ## # $ # $ & &&@ @ ###|# #|### # ~~~~ &4930 82 00 00 20 02 00 00 00 02 02 22 02 02 02 0f 11 ; 30~~ \####/ \# ####\ /#\ /#\ /#\ /\&$ $&@ $@ ##### #####8 # ~~~~ &4940 11 20 80 00 27 dd 8d 70 dd 2d 22 00 d2 c0 dc 20 ; 2f~~ $ ####################&&&&&@@@@@@@ #/ \# # ~~~~ &4950 22 08 00 27 02 70 80 00 02 09 26 a2 a2 a2 22 11 ; 2e~~ /####\ /# #/ \*/ \*/ $# b # + + + # # ~~~~ &4960 11 20 60 22 22 22 22 20 22 22 22 20 d2 00 df 60 ; 2d~~ #%%%%% %# # /*\ /\ ///////## /### | | # ~~~~ &4970 22 22 22 22 02 20 20 00 02 00 00 00 00 00 00 11 ; 2c~~ #%$ %# # /############/ # #\ /#\ # ~~~~ &4980 11 20 00 00 00 00 00 00 00 00 22 d0 d2 dd dd 00 ; 2b~~ #%%%%%%%# / // \#######~~~~~~## /#### \\ /##### # ~~~~ &4990 00 00 00 60 02 20 20 00 22 22 22 08 27 22 22 11 ; 2a~~ ######### /#####\ ~/ \# #/$$| \#/ $ $ # ~~~~ &49a0 11 20 22 22 22 22 22 22 22 09 22 d0 b2 bb bb bb ; 29~~ #%%%%%#######################\ ~ 8 8 !$ # # # /###\ # ~~~~ &49b0 bb 70 8d 00 02 20 20 00 22 22 22 02 22 92 60 11 ; 28~~ #%%%%%######/ b | \### ~\ /# # ##/ 8 \###/ # ~~~~ &49c0 11 20 22 09 60 22 22 92 00 00 22 d0 b2 22 22 22 ; 27~~ \###### /\ /######\ \## ~~~~~~#/ # # # # ~~~~ &49d0 b2 00 d6 09 02 24 20 04 22 aa aa 02 26 09 00 11 ; 26~~ #%%%%%%###%%%%%%%\ \# #$ # | \## / \ # ~~~~ &49e0 11 20 02 00 00 00 20 02 00 07 92 d0 b2 92 00 60 ; 25~~ /#########################\ ### #\ /# # 8 # # # ~~~~ &49f0 b2 08 00 00 f0 27 2f f8 22 dd dd 02 00 00 04 11 ; 24~~ #%%%%%%%%%ooooooooo######\# #/# #######/ ##/ # $# #$ # ~~~~ &4a00 11 20 02 32 30 22 20 82 70 09 02 d0 b2 02 ef 0f ; 23~~ #% 8 %o#######o#/ \##/8 8\# /# #\/# #\/# ~~~~ &4a10 22 22 22 22 22 22 22 22 a2 9d d6 02 27 08 00 11 ; 22~~ #% & & & %o#/ . # . #### ###############/ \##### #### ~~~~ &4a20 11 20 09 96 04 96 60 32 20 00 02 d7 b2 02 0e 0e ; 21~~ #% 8 &$%o# $@$ # ## ##### ########### #$ \$/ $# ~~~~ &4a30 00 00 00 00 00 00 20 00 00 00 d0 02 22 82 70 11 ; 20~~ #% %%%%%%%o# @ @ # # \#/ \##$ $## . ## ~~~~ &4a40 11 20 f0 00 00 00 00 92 20 70 02 26 b2 02 ef 0f ; 1f~~ # o# $@$ # ########\ # ##@@@@@@###$ $# ~~~~ &4a50 22 22 22 22 22 22 22 22 a2 8d d7 02 f2 22 20 11 ; 1e~~ ########\ o#\ /# ~~~~~~~## # /##\ ## @#### ## ~~~~ &4a60 11 20 08 87 04 87 70 02 20 20 02 20 b2 02 00 70 ; 1d~~ ##/ .\### o### ### ~$ ~## \ ##88 88 @@@ @@@#$ / \ $# ~~~~ &4a70 02 00 00 00 00 20 20 f9 22 dd dd 02 02 00 20 11 ; 1c~~ #/ \## ooo# # ~&&&& ~#/ \##| |# @$@ @# /8 8\ # ~~~~ &4a80 11 20 22 d2 00 2d 22 02 27 20 02 27 b2 02 22 22 ; 1b~~ # \# \# # ~~~~~~& ~# \/ ##| |#!@ @@@ @#### #### ~~~~ &4a90 02 11 11 11 81 20 00 00 22 aa aa 02 02 22 20 11 ; 1a~~ # /\\\ # / # # ~$ & ~# /\ #88 88 @ @@@ @#/\8 8/\# ~~~~ &4aa0 11 20 09 96 00 96 60 02 23 20 02 d2 b2 0b 00 00 ; 19~~ oooo # %\ # # ~%%%% & ~#\ $$ /### ## @ @# \ / # ~~~~ &4ab0 00 f1 dd dd 11 60 22 00 26 22 22 02 02 22 20 11 ; 18~~ # \/// # \% # # ~%$ % & ~~~~~~~~~#/ ## && &&@# # ~~~~ &4ac0 11 20 f0 00 00 00 0f 02 26 20 02 d2 22 22 22 12 ; 17~~ # /# / # # ~%. % & ! #@ & &@# # ~~~~ &4ad0 11 01 fd d0 1d 00 22 00 00 00 20 02 02 11 10 11 ; 16~~ ## ######\ # # ~%% & #$#|#$#$###~ #@ && &&@@ @###\ # ~~~~ &4ae0 11 20 08 87 00 87 70 02 20 20 02 d2 22 09 02 12 ; 15~~ # ######## # # ~~%%% & ###|#######~ #@ &. &@@ @#$$# # ~~~~ &4af0 cf 01 0d 00 1d 08 22 00 27 82 20 02 02 01 00 11 ; 14~~ # #/ $# # \~~~~ !b \@ && &&@@ @# \ # ~~~~ &4b00 11 20 22 d2 00 2d 22 82 20 60 02 d2 22 00 00 12 ; 13~~ ## ##$ 8/# # \~~~~~~~~~~~~###\ @ &8 8&@@ @#\ # ~~~~ &4b10 c0 01 dd 0d 1d 01 22 00 92 26 20 02 02 01 04 11 ; 12~~ #\ /#* /###### ###\ b ######\ @ &&$$&&@@ @#### # ~~~~ &4b20 11 20 09 96 00 96 60 32 20 00 a2 d2 22 08 02 12 ; 11~~ #8 8#* b $# # ############ # @ @8 8@@@ @@@@@ # ~~~~ &4b30 c0 01 00 00 00 01 22 00 f2 20 20 02 02 01 00 11 ; 10~~ #/ \#* \######### ############\ / \ # @ @@!!@@@@ @$ $@ # ~~~~ &4b40 11 20 f0 00 00 00 0f 92 20 08 02 d2 22 22 02 12 ; 0f~~ #8 8#$ 8\# #/ \#$#|# # # # @ @@@@ @ @ # ~~~~ &4b50 c0 cc cc cc 0c 01 22 00 02 00 20 02 02 01 00 11 ; 0e~~ #/$\#\ $# #$ $# #|# | | # @@@@ @@@@ @ @ # ~~~~ &4b60 11 20 08 87 00 87 70 02 20 02 02 d6 22 22 02 12 ; 0d~~ ############## ###\ /###### #|# # # # @@@@ @ @ @ # ~~~~ &4b70 00 00 00 00 00 01 22 00 f2 20 20 02 02 01 04 11 ; 0c~~ ####| |### #/$ $\# #|# | | # @@@@@@@@ @ @@ @@ # ~~~~ &4b80 11 20 22 22 00 22 20 02 27 02 02 60 82 27 02 12 ; 0b~~########/ ##|%% %%|# #\ /# #|# # # # @ @ # ~~~~ &4b90 11 11 11 20 02 01 22 f8 82 27 20 02 02 01 00 11 ; 0a~~/ ##|%/ \%|# \## ##/ #|# | | ###########@ @@## ## ~~~~ &4ba0 11 20 22 22 aa 92 60 02 96 02 82 00 26 24 02 22 ; 09~~ /#####\ ##|%\./%|# #|# # # \##########/ \##/ \# ~~~~ &4bb0 22 22 12 f0 02 01 22 22 22 92 20 02 02 01 00 11 ; 08~~$ ##%#%## ##|%%%%%|#############$|$$| # | ~~~~ &4bc0 11 20 00 00 00 02 00 02 00 02 22 08 00 00 00 26 ; 07~~######### \######################################## # 8 # ~~~~ &4bd0 92 00 16 20 02 01 22 0f 00 00 20 02 f2 01 00 11 ; 06~~$ $ $ $ | #$ $ $ $#/.\# # | ~~~~ &4be0 11 20 20 08 70 82 70 02 07 02 22 82 00 00 00 00 ; 05~~######### /#\ /###############\ # /o\ @ @ /o\ #& &# # 8 # ~~~~ &4bf0 00 00 10 a0 0a 01 22 22 22 22 22 02 82 01 f0 11 ; 04~~$.$ $ $ | ### ##$ $\# # ooo @ @ ooo # # # | ~~~~ &4c00 11 20 20 22 22 92 60 02 09 02 26 22 22 24 82 00 ; 03~~######### ##/ \## ##~~~~~~~~~~~ # \o/ @ @ \o/ # & #$$# 8 # ~~~~ &4c10 00 78 1f 20 02 01 22 aa aa aa 2a 02 26 11 11 11 ; 02~~$ $ $ $ | #/ \# ##~ ~ # $@ @$ # #\/#\ /# ~~~~ &4c20 11 20 22 cc cc 0c c0 0c 07 02 00 00 92 26 22 22 ; 01~~ $# # 8 8 8 ~ \#####/ \#####/ #######/ ~~~~ &4c30 08 69 1f f0 02 01 60 22 22 22 22 02 00 00 00 11 ; 00~~. $ $ $ # #\ /####~ $~ /###.$ ~~~~ &4c40 11 20 00 0c c0 00 fc 0c 09 11 11 01 22 22 92 00 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &4c50 00 00 10 20 02 21 00 00 00 00 f0 22 22 22 08 11 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &4c60 11 20 00 00 00 00 00 0c 07 91 60 01 00 20 02 70 ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &4c70 82 00 17 f0 02 21 70 a2 a2 a2 a2 f2 00 00 02 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &4c80 11 20 00 0c c0 00 fc 0c 09 01 04 21 22 20 02 20 &4c90 22 22 12 20 02 22 00 00 00 00 f0 02 b9 06 02 11 &4ca0 11 20 00 cc cc cc cc 0c 07 01 00 f1 26 20 02 20 &4cb0 24 42 22 20 02 22 00 00 00 00 f0 02 bb 0b 02 11 &4cc0 11 20 00 ee ee ee ee fe 02 01 04 01 20 20 02 60 &4cd0 a4 4a 92 20 02 22 60 a2 a2 a2 a2 02 b8 07 02 11 &4ce0 11 20 00 0e 00 00 00 2e 02 01 00 01 20 20 02 00 &4cf0 00 00 00 10 01 26 00 00 00 00 00 f2 00 f0 02 11 &4d00 11 20 00 0e e0 e0 00 0e 00 82 70 02 20 20 82 00 &4d10 00 00 00 00 00 60 22 22 22 22 08 02 ee ee 09 11 &4d20 11 20 00 0e e0 e0 00 0e 27 22 2f 09 20 20 22 22 &4d30 a4 4a 22 22 82 00 00 00 00 20 02 02 00 00 00 11 &4d40 11 20 00 0e e0 e0 00 0e 02 00 00 00 27 20 22 22 &4d50 24 42 22 ee ee ee ee ee ee 20 02 02 ee ee 08 11 &4d60 11 20 30 fe e0 e0 f0 0e 02 27 22 22 92 20 f0 0e &4d70 00 00 00 00 00 00 00 e0 ee 20 02 f2 00 f0 02 11 &4d80 11 20 00 ee ee e0 ee 0e 02 92 00 00 00 20 00 0e &4d90 ee ee ce cc cc cc ee e0 ee 20 02 02 b9 06 02 11 &4da0 11 20 03 00 00 00 00 00 00 f2 00 00 00 20 00 0e &4db0 fe 00 c0 c0 c0 c4 e4 e0 ee 20 02 02 bb 0b 02 11 &4dc0 11 20 22 22 22 22 22 22 2a f2 00 00 00 27 00 0e &4dd0 ee ee 00 00 00 f0 00 00 e0 20 02 02 b8 07 02 11 &4de0 11 20 f2 00 00 f0 22 09 60 a2 22 a2 22 92 00 0e &4df0 00 ee 00 00 00 f0 00 00 e0 20 02 f2 00 00 02 11 &4e00 11 20 82 70 82 70 22 00 00 00 20 00 20 00 00 ee &4e10 0e ee c0 c0 c0 c4 e4 ee e0 20 02 22 22 22 09 11 &4e20 11 20 2a 20 2a 20 2a 50 00 08 90 80 90 80 00 22 &4e30 0e 00 c0 cc cc cc ee ee e0 20 02 92 0c 00 00 11 &4e40 11 60 92 20 2a 60 22 00 00 86 00 20 00 20 f0 22 &4e50 ee ee ee ee ee ee ee ee 00 20 02 02 00 0c 00 11 &4e60 11 00 00 20 2a 00 00 50 00 20 42 22 24 22 22 22 &4e70 22 22 22 e2 ee ee ee ee ee ee 09 82 0c 00 70 11 &4e80 11 70 82 20 2a 70 22 00 00 97 00 00 00 26 2f 2f &4e90 0f 92 00 00 00 00 00 00 00 00 00 22 22 22 22 11 &4ea0 11 20 2a 20 2a 20 2a 50 00 02 87 00 f0 27 00 00 &4eb0 70 82 00 e0 ee ee ee ee ee e0 08 00 00 6f 22 11 &4ec0 11 20 92 60 92 60 22 00 00 f2 22 70 22 22 08 00 &4ed0 47 42 08 20 22 22 fe 00 e0 e0 02 00 00 7f 22 11 &4ee0 11 20 f2 00 00 f0 22 08 70 02 22 00 00 00 0f 00 &4ef0 00 00 00 20 0f 26 0e 00 00 20 22 22 22 22 02 11 &4f00 11 20 22 22 22 22 22 22 2a f2 22 60 22 22 09 00 &4f10 46 42 09 20 0f 20 fe 00 e0 2e 09 00 00 60 f2 11 &4f20 11 20 0f 00 40 00 40 00 60 02 96 00 f0 26 00 00 &4f30 60 92 00 60 82 20 ee ee ee 00 00 04 04 04 02 11 &4f40 11 20 08 40 00 40 00 00 00 00 00 00 00 27 2f 2f &4f50 0f 82 00 00 00 00 00 00 00 20 08 00 00 70 02 11 &4f60 11 60 22 22 22 22 22 22 22 22 22 22 22 22 22 22 &4f70 22 22 22 22 22 22 22 22 22 22 a2 a2 a2 22 09 11 &4f80 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4f90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 ; sprite_key_gm &4fa0 01 00 03 80 10 80 03 80 10 80 01 80 01 80 01 80 &4fb0 01 80 01 80 03 80 16 80 24 48 24 48 21 48 10 80 ; sprite_key_mb &4fc0 11 00 33 08 01 08 33 08 01 08 11 08 11 08 11 08 &4fd0 11 08 11 08 33 08 67 08 46 8c 46 8c 13 8c 01 08 ; sprite_spade &4fe0 03 08 02 08 02 08 01 00 01 00 01 00 01 00 01 00 &4ff0 01 00 01 00 30 80 30 80 30 80 30 80 30 80 30 80 ; sprite_dynamite &5000 cc 22 22 66 22 44 06 0c 06 0c 06 0c f0 e0 06 0c &5010 06 0c 06 0c 06 0c 06 0c 06 0c 06 0c f0 e0 06 0c ; level_4_data (The Time Shaft) &5020 11 44 44 44 00 00 00 00 00 00 00 00 00 00 00 00 ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &5030 00 00 00 00 00 0f 00 00 00 00 00 16 11 91 60 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &5040 11 f4 00 44 40 40 dd dd 00 27 22 22 20 22 22 22 ; 3d~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &5050 20 22 22 22 40 20 2a 2a 2a 2a 08 60 9d 0b f0 11 ; 3c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &5060 11 04 00 44 40 40 00 00 70 21 22 22 20 22 02 2f ; 3b~~88888*$*888 |$ |$ 8 8%8%8%8%8%8%8%~~~~ &5070 20 dd 0d 20 00 20 00 2f 0f 00 00 00 0b 00 0f 11 ; 3a~~8$ ! $ \# * \# *8*8*8 /~~~~\ /~~~~\ %b b 8~~~~ &5080 11 04 00 44 40 40 00 f1 11 09 00 00 00 00 00 20 ; 39~~8 *$*888 /# /# * ~/ \~ 8 ## # # # # %~~~~ &5090 20 dd 0d 20 22 22 00 20 08 08 00 70 8d 00 fb 11 ; 38~~8 8 8%%8 \ |o* |o*8 8 8 ~ $&&& &&&$ ~ % #######$## 8~~~~ &50a0 11 04 00 44 0f 40 00 71 91 00 10 11 11 81 d0 0b ; 37~~888888 8%%8 ~ \# \# $ * ~ && .&& ~ #. %~~~~ &50b0 00 db 00 00 00 26 00 20 a1 81 70 11 11 81 70 11 ; 36~~888888 8888 ~ /# * /# *8 8 8 ~ $&&& &&&$ ~ %8%8%8%8%8%8%8~~~~ &50c0 11 03 43 44 44 44 00 11 09 00 00 00 00 1e b0 00 ; 35~~ $8 ~ | | $ * ~\ /~ \~~~~~~~~~~~~~~~~~ &50d0 00 b0 d0 00 00 20 00 20 a1 91 10 09 16 14 1a 11 ; 34~~ 888 8 % /# * /# *8 8 8 \~~~~~~~\ /~~~ $~$ ~~~~ &50e0 11 0f 0f 00 00 00 70 91 00 17 11 11 11 10 b0 00 ; 33~~ 8 /~~~%% \~~~~~~~~~ $ * ~~~ ~~~8~~~~~~~~\ /~~ ~~~~ &50f0 00 b0 00 0d 44 20 00 20 09 09 90 00 60 91 6f 11 ; 32~~ 88888 ~ \~~~~~~* 8 8 888~~~~ ~/$ \~8%8~~~/ | ~/ ~~~~ &5100 11 03 43 44 00 17 11 11 11 11 00 00 00 10 b0 00 ; 31~~ % ~ 8 ~ &&&&~~ ~ ~~8~~ .! ~ * ~~~~ &5110 00 b0 d0 00 00 00 00 27 0f 00 00 00 00 00 70 11 ; 30~~ % /~ 8%8 ~ &&&$~~ *8*88888~~~~~~ 8# ~+~+~ ~\ | ~ ~~~~ &5120 11 f4 d4 4d 00 01 00 00 60 11 20 22 22 10 d0 bb ; 2f~~ % ~~~~~ $8$ ~ & .~~ b ~~~~~~~~~~ #8 ~~~~~ ~~~~~~ ~ * ~~~~ &5130 bd db 11 11 11 11 11 22 22 22 22 22 22 22 22 11 ; 2e~~ % $/~/~ 8%8 ~ 8 /~~~~~~~\ ~/ \~ b ~ 8# ~+~+~ ~/ | ~ ~~~~ &5140 11 04 d4 4d 00 01 40 4f 00 16 20 00 2f 10 00 00 ; 2d~~ ~~/.~ 8 ~ & ~ ~ ~ ~~ #8 ~~~~~ ! ~ * ~~~~ &5150 00 f0 61 69 69 69 19 0f 00 03 30 30 00 30 20 11 ; 2c~~ /~/ ~\ /~ 8 ~@~~~~\ ~ ~ $ ~~~~~\ 8# \~~~~~~\ | ~ $ ~~~~ &5160 11 04 44 44 00 01 d4 d4 04 00 00 00 2f 10 11 11 ; 2b~~ /~/ /~~\ /~~ & ~@~ \~ ~ ~\ /~$ $~ ~~~~~~~~~~ ~\ /~~~~ &5170 11 11 f1 00 00 00 10 08 03 03 03 00 30 00 20 11 ; 2a~~ ## ~~~~ ~~~\8/~@~$ ~~~~~8 8~\ /~ ~~~~~/ | ~~~~~~~~ &5180 11 00 00 00 00 0d 40 4f 00 17 21 22 22 10 11 11 ; 29~~ ## ~ ~~~~~~~@~~~~~~~~~~~~/ \~~~~/ ~@@@@ ! ~/ \~~~~ &5190 11 11 01 70 22 08 00 03 00 00 00 30 00 03 23 11 ; 28~~ ## ~ ~ ## #~$\~%~@~%~/$~ ~ ~~~\ | ~ $ ~~~~ &51a0 11 00 60 11 d1 0d 00 00 70 11 11 11 11 10 11 11 ; 27~~ ## ~ ~ # #~ \~~o~~/ ~ /~~~~\ /~~ ~~~~ ~~~~~~~~ ~\ ~~~~ &51b0 13 09 06 20 98 c2 03 00 03 f0 33 03 f3 03 20 11 ; 26~~ ## ~ ~ # #~\ \8 8/ /~ ~%8%8~8 8~/ $/8 8~~~~~~~ \~~ ~~~~ &51c0 11 00 00 00 00 00 11 11 11 11 f1 60 11 10 91 f0 ; 25~~ ~ ~ #$$#~~\ /~/ \8%8%~$ $~\ /8# #8~~~~~~\ ~~~~ &51d0 00 00 00 20 67 c2 30 03 30 03 00 00 30 00 20 11 ; 24~~ ## ~ ~ ####~~~\ /$\ /~/ $ \~~~~~~~~~~~~~~~8 8~~~~~~~~~~~~ ~~~~ &51e0 11 80 07 78 70 08 00 00 00 60 81 00 16 1b 09 70 ; 23~~ ## ~@ o $8$ o ~ ~ ~~~~ &51f0 13 08 07 60 22 09 10 08 f3 00 30 30 03 30 20 11 ; 22~~ ## \~~~~~~~~~~/ \$/ \~~~~~~~~~~~~~~\ /~~~~~ %%%%|%8%8%8%~~~~ &5200 11 2a a2 22 2a 81 00 4c 4c 4c 11 08 60 90 00 17 ; 21~~ ## ~~~~/ \~~###########/ \####~ 8% ! 8~~~~ &5210 1d 01 f1 00 00 00 10 09 30 00 03 f3 00 4d 4d 11 ; 20~~ # %ooo% ~~~/ /8 8\ \~#$ # #. #~ %% %| /\ %~~~~ &5220 11 0f b0 00 00 11 cc 00 00 70 d1 81 00 00 70 d1 ; 1f~~ #$ o o ~~~ /~~o~~\ ~# &&&&&&& /&\ &&&& #~ 8% %8 /$$\ 8~~~~ &5230 1d 01 71 78 78 78 18 78 78 78 78 78 78 04 00 11 ; 1e~~ ### o ~~~!/~%~ ~%~\$~# $&$ &@& &@@& #~ %| |% \$$/ %~~~~ &5240 11 30 30 30 30 11 cc 70 11 11 11 41 70 8f 40 11 ; 1d~~ % ~~* *%%~ ~%%~~~# &&&&&&& \&/ &&&& #~ 8% %8 b 8~~~~ &5250 11 09 16 11 11 11 11 11 11 11 11 11 4d 0d 00 11 ; 1c~~ ### o ~~~ ~~~~ ~~~~~~# #~ %% %%%\ /%%~~~~ &5260 11 00 00 00 00 11 cc 10 e0 ee ee 0b f0 f4 00 0b ; 1b~~ #%%o o ~~/ \~~/ \~~~~~####################~ 8| |8%8 8%8~~~~ &5270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1b 11 ; 1a~~ #%%%ooo%$~~ ~~~~~~~~~~~~~~~~~~~~~~ %% %*%%!!%%%~~~~ &5280 11 00 00 00 00 11 fc 10 10 11 11 41 60 9f 40 11 ; 19~~ #%% ~~~~\ /~~\ /\ /~/ \~~~ o o ~ ~ 8% 8%8~~~~ &5290 11 08 17 11 11 11 11 11 11 11 11 11 4d 0d 00 11 ; 18~~ # % %~\$ $/~ ~/ \~ . o! o o o ~ %%%%*%% %%%~~~~ &52a0 11 80 07 78 70 11 11 11 10 f0 d1 91 00 00 60 d1 ; 17~~ # % ~/ \~ ~$ $~\ /~~~~~~\ /~~~~~~ ~~ ~~~~~~~ &52b0 1d 01 96 6f 69 f9 16 69 69 69 69 69 69 d4 d0 11 ; 16~~ ### ~\ /##\ /~ ~\ /~~ ~%%%%%%~ ~$ $~~~~~~~~~ ~/$~~~~ &52c0 11 2a a2 22 2a 11 11 11 10 00 11 09 70 80 00 16 ; 15~~ # 8 ~/ #\/# \~ ~/ \~~ \~~~~~~/!\~~~~~~~o ~ ~~ /~ ~~~~ &52d0 1d 01 00 00 00 00 60 78 78 78 78 78 f0 0d d0 11 ; 14~~ 8 # 8 ~\ #/\# /~ ~\ /~~ ! ~ ~$~o ~~ ~~~~~ ~~~~ &52e0 11 0f b0 00 00 31 00 10 10 08 91 00 17 1b 08 60 ; 13~~$ #\ ~/ \##/ \~ ~/ \~8888~ *~ ~$~ ~ ~$~ ~$~ ~~ ~~~$~oo~~~~ &52f0 11 01 00 00 00 00 00 00 00 00 00 00 00 d4 00 11 ; 12~~ ###### ~\ && /~ ~$ 8~ \~/ ~ \~/ ~ ~ ~* * ~~~~ &5300 11 30 30 30 30 01 30 10 60 01 f1 70 91 10 81 f0 ; 11~~ | ~/ * \~ ~\ /~88 8~~*~ /~ ~ ~ ~~ ~ /o~\ ~~~~ &5310 11 01 87 7f 78 08 17 81 00 00 00 00 70 0d 0d 11 ; 10~~ # ~~~ *~~~~ ~~\ ~~88 8~~~~ /~~~~~ ~~~~~ ~ ~~ ~ $~ ~~~~ &5320 11 40 40 40 40 40 40 10 00 00 11 11 09 10 11 11 ; 0f~~ |$ /#$\*!*\/\~ ~/\ ~~8 88~~ ~/ $% %#%#% ~$~~#%#%# ~ ~~~~ &5330 11 11 11 11 11 01 11 11 11 11 11 11 11 04 00 11 ; 0e~~ ######## /~ ~\/ \~ 8~~ \\ /~8 8%8%8 ~~~~ ~ ~~~~ &5340 11 30 00 0f 0f 0f 30 60 11 01 01 00 f0 11 22 22 ; 0d~~ |$\~~/$# * * * \~ ~/\ ~ 8~8 8~~ % %#%#% \~~ %#%#%~ ~~~~ &5350 22 12 09 16 11 04 44 04 f0 f4 00 00 30 4d 4d 11 ; 0c~~ # || # *$*/~ ~\/ ~$ $8~~ /~~\ 8 8%8% ~~ ~ ~~~~ &5360 11 40 40 40 40 40 40 00 00 00 01 17 08 10 f2 00 ; 0b~~ | \~~/ #** * \~ ~/\ ~8 88~~ ~$ ~ %#% % $8 ~~#%#%# ~ ~~~~ &5370 00 12 00 00 00 04 44 00 04 40 44 44 30 00 30 11 ; 0a~~ # \/ # $ b /~ ~\/ ~$8 8 ~ ~ 8%8 8 % ~~ ~ ~~~~ &5380 11 30 00 00 00 00 40 11 11 11 01 d1 84 10 02 0c ; 09~~ \ # * * *\~ ~/\ ~ 8 8 8~~~/ ~ %#% 8 ~~ ~~~~~/ ~~~~ &5390 0c 12 08 17 08 04 00 00 01 00 00 00 30 30 30 11 ; 08~~ /~/ #* * * /~ ~\/ ~ 8 8 8$ ~ %8 8%8% ~$ ~~~~ &53a0 11 44 43 43 43 43 40 91 00 16 01 41 1d 10 02 0c ; 07~~\ ~/ # * *\~ ~/\ ~ 8 8 8\ ~\ /~~~~~~~~~ ~~~~ &53b0 0c 12 b1 d1 01 44 44 00 04 40 44 44 30 30 30 11 ; 06~~~\ /~ #* * *$/~ ~\/ ~ 8 8 88888 \~~~8%8%8%8~/$ ~~~~ &53c0 11 00 00 00 00 40 40 01 f0 10 01 d1 14 10 02 0c ; 05~~~%o%~\ # * * \% %/ ~ b b ~ ~~~~~~~~~~~ &53d0 0c 12 01 d1 01 11 11 04 f0 04 00 00 30 30 30 11 ; 04~~~/ \~~\ # * $* /8 8\$ /~******** 8 /######### ~ /~%8%8%8~~~~ &53e0 11 70 11 11 81 40 40 81 00 17 01 41 1d 10 02 fc ; 03~~~o ~8~ # ** %8% %8%8%8% 8 ## o .# ~ | %~~~~ &53f0 0c 12 01 d1 01 00 11 44 44 04 44 44 30 30 30 11 ; 02~~/ \~/ #* *8 % % 8 *******8 ## o &@@# ~ \~% $ 8~~~~ &5400 11 10 09 00 16 10 10 11 10 11 09 16 11 10 02 cc ; 01~~ $o |$ #. * % o % % 88 o o @$# ~ ~8 %~~~~ &5410 0c 12 00 d1 01 03 13 11 11 01 f1 46 30 30 30 11 ; 00~~\$.$/~\/#######8 .~ %% 8*******$8$ ### ######$~\ ~%8%8%8~~~~ &5420 11 10 f0 fc 10 10 10 01 10 4f 00 40 1f 10 02 fc ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &5430 0c 12 00 d1 01 01 11 11 11 01 01 40 30 30 30 11 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &5440 11 10 c0 cc 10 10 10 01 11 00 00 00 10 10 02 0c ; ~~~~00000000000000001111111111111111222222222222222233333333333~~~~ &5450 0c 12 b0 d1 01 00 00 00 00 00 01 40 00 30 f0 11 ; ~~~~0123456789abcdef0123456789abcdef0123456789abcdef0123456789a~~~~ &5460 11 10 c0 c0 10 10 10 01 11 00 00 00 10 10 02 00 &5470 00 12 0b 16 09 81 70 81 70 11 09 40 40 44 44 11 &5480 11 60 c0 c0 10 00 10 01 10 4f 00 40 1f 10 22 c7 &5490 08 12 b0 00 0b 1f 10 69 10 0f 00 00 00 00 f4 11 &54a0 11 00 00 00 10 11 11 11 60 11 08 17 11 60 09 ec &54b0 0c 12 00 17 08 91 10 00 10 00 00 00 00 00 00 11 &54c0 11 00 00 00 10 91 00 00 00 60 01 91 16 00 00 c6 &54d0 09 12 00 f1 01 00 10 70 60 11 11 81 70 22 2b 11 &54e0 11 70 c0 c0 60 f1 40 42 42 00 01 01 10 00 00 00 &54f0 00 12 b0 01 01 00 17 1f 00 00 00 16 20 22 20 11 &5500 11 10 c0 c0 00 00 20 24 24 00 01 00 10 00 00 cc &5510 0c 12 0b 01 11 11 11 4d 4d 4d 0d 10 20 00 20 11 &5520 11 10 c0 cc 70 81 00 00 00 70 01 01 10 70 08 ec &5530 0c 12 00 01 01 00 00 00 00 d2 d2 10 20 00 00 11 &5540 11 10 f0 fc 10 11 11 11 81 10 09 f1 17 10 22 ec &5550 0c 12 01 01 01 81 10 4d 0d 4d 4d 40 20 bb 2b 11 &5560 11 10 08 00 17 41 51 51 11 00 00 71 14 10 02 cc &5570 0c 12 00 01 01 1f 10 d2 02 00 00 d0 20 00 20 11 &5580 11 60 11 11 11 d4 14 11 11 11 11 41 42 10 02 00 &5590 00 12 00 00 11 91 10 4d 4d 4d 40 40 20 c0 20 11 &55a0 11 00 00 00 00 41 51 51 11 11 0e 00 00 10 22 22 &55b0 22 12 00 f1 fb 00 10 d2 d2 00 d0 d0 20 e0 2e 11 &55c0 11 d4 d4 d0 08 11 11 11 11 11 1e 41 42 11 11 11 &55d0 11 11 11 11 10 11 11 4d 4d 0f 40 40 20 e0 2f 11 &55e0 11 0d 00 40 01 11 00 00 10 11 1e 11 14 00 00 00 &55f0 00 00 00 10 b0 0f 00 00 d0 d4 d4 d0 20 22 22 11 &5600 11 04 22 d0 01 11 10 11 10 11 1e 11 11 d0 d4 d4 &5610 d4 d4 d4 10 01 11 11 11 00 00 00 40 00 00 f0 11 &5620 11 0d 22 40 01 91 60 91 60 91 60 11 11 d0 dd ad &5630 dd da dd 10 00 00 00 1f 08 00 00 17 11 11 11 11 &5640 11 04 20 d0 01 01 00 01 00 01 00 11 11 d0 00 00 &5650 00 00 d0 10 11 11 11 11 11 11 11 91 00 00 60 11 &5660 11 0d 22 40 f1 01 00 01 00 01 00 11 11 d0 d0 ad &5670 dd da d0 10 11 31 11 11 11 11 f1 f1 00 00 00 11 &5680 11 04 20 d0 11 01 00 01 00 01 00 11 11 a0 a0 d4 &5690 d4 34 30 10 00 00 00 02 00 02 00 01 70 80 00 11 &56a0 11 0d 22 40 f1 a6 a0 a1 a0 a1 a0 11 11 d0 00 00 &56b0 d0 dd d0 10 10 31 01 0d 0d 0d 01 01 11 10 11 11 &56c0 11 04 20 d0 01 00 00 00 00 00 00 00 16 40 00 87 &56d0 60 d4 d0 10 10 01 00 02 02 02 01 01 d1 da d4 11 &56e0 11 0d f2 40 01 00 00 00 00 00 00 00 10 d0 70 ff &56f0 00 00 00 00 10 01 17 0d 0d 0d 01 01 41 00 40 11 &5700 11 04 20 d2 01 17 11 11 11 11 11 81 10 40 60 ff &5710 00 00 00 00 17 0f 0b 02 02 02 01 01 d1 00 d0 11 &5720 11 0d 22 40 01 91 00 00 00 16 09 16 10 d0 00 96 &5730 70 d4 d4 11 11 01 f1 00 0d 00 01 01 41 f0 40 11 &5740 11 04 00 d0 01 01 03 03 f3 10 f0 10 10 40 00 00 &5750 d0 dd dd 91 00 0b 16 11 11 11 09 01 d1 00 d0 11 &5760 11 4d 4d 4d 01 00 00 00 00 17 08 00 00 d0 d4 d4 &5770 d4 d4 d4 f1 00 0b 00 00 00 00 00 00 41 4d 4d 11 ; unused &5780 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 &5790 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 ; sprite_key_gb &57a0 11 00 33 80 10 80 33 80 10 80 11 80 11 80 11 80 &57b0 11 80 33 80 76 80 64 c8 64 c8 64 c8 31 c8 10 80 ; sprite_scroll &57c0 ee 66 5d 99 4c 11 5c 51 cc 11 74 51 44 22 44 a2 &57d0 88 22 a8 a2 88 22 ff ee 08 11 08 11 3b 99 cc 66 ; sprite_pickaxe &57e0 00 00 00 00 30 80 50 40 81 20 81 20 01 00 01 00 &57f0 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 ; $.DATA2 005c00 005c00 001180 ; sprite_marsh &5c00 ff ff ff ff fe e8 99 ff ff ff ff ff ff ff ff ff &5c10 fe e8 99 ff ff ff ff ff fe ee ff ff ff ff ff ff &5c20 ff ff f7 f7 73 b8 cc ff ff ff ff ff ff ff f7 f7 &5c30 73 b8 cc ff ff fd fd d8 a2 77 ff ff ff ff ff ff &5c40 ff ff ff ff ff ff ff ff ff fe fe ec d1 33 ff ff &5c50 ff ff ff ff ff ff ff ff f3 33 ff ff ff fe e8 99 &5c60 ff ff ff ff ff ff ff ff ff ff ff f7 71 99 ff ff &5c70 ff ff ff ff ff ff ff ff ff ff ff f7 f7 73 b8 cc ; sprite_space &5c80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ca0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ce0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cf0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_wall_stone &5d00 ee ea ee ff ff 11 00 cc ee ee ee ee ee e6 ee ee &5d10 ee ee cc dd dd dd dd dd 00 00 dd dd e6 ee ee ee &5d20 ff ff fe 77 77 77 33 00 cc ff ff ff ff ff ff ff &5d30 fb ff ff ff ff ff ee 88 11 77 ff fe ff ff f7 ff &5d40 dd dd dd dd ee ee ee 00 11 ff f7 ff ff ff ff ff &5d50 ee ee ee ea ee cc 00 00 bb bb bb bb dd dd dd dd &5d60 ff ff ff f7 dd 00 22 77 77 75 77 77 77 77 77 77 &5d70 ff ff ff ff fd ff 77 11 88 ee ff fb ff ff ff ff ; sprite_spike_turnstile &5d80 00 00 00 11 77 fc f0 30 00 00 00 00 00 11 77 fc &5d90 f0 30 00 00 00 00 00 11 77 fc f0 30 00 00 00 00 &5da0 03 03 47 fc f3 f7 f7 80 c0 30 03 03 47 fc f3 f7 &5db0 f7 80 c0 30 03 03 47 fc f3 f7 f7 80 c0 30 03 03 &5dc0 0c 0c 0c e2 fc dc 98 10 30 c0 0c 0c 0c e2 fc dc &5dd0 98 10 30 c0 0c 0c 0c e2 fc dc 98 10 30 c0 0c 0c &5de0 00 00 00 00 88 e2 f0 c0 00 00 00 00 00 00 88 e2 &5df0 f0 c0 00 00 00 00 00 00 88 e2 f0 c0 00 00 00 00 ; sprite_pillar &5e00 00 00 00 10 10 31 31 73 73 73 73 80 f7 f7 f7 f7 &5e10 f7 f5 f7 f7 f7 73 73 73 40 31 31 10 10 00 00 00 &5e20 10 71 b3 bb ba bb b3 bb bb 77 44 33 77 77 76 77 &5e30 77 bb bb bb b3 bb bb 77 00 33 77 ff fd f7 71 10 &5e40 80 e8 dc dd dd dd dc dd e6 ee 00 ee ee ee ee ee &5e50 ec ee ee ee ee ea ee ee 00 dd dd d5 dd dc e8 80 &5e60 00 00 00 80 80 c8 c8 ec ec ec ec 76 98 fe fe fe &5e70 fe fe fa fe fe ec ec a8 64 c8 c8 80 80 00 00 00 ; sprite_coffin &5e80 00 00 00 00 00 00 10 10 10 10 10 10 10 10 10 00 &5e90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ea0 30 31 73 73 f7 f7 ff ee ff ff ff dd 98 ec fe f7 &5eb0 f7 f7 f7 f7 f7 f7 f7 f7 73 73 73 73 73 40 40 70 &5ec0 f0 fe ee ee ff 77 73 73 b1 73 73 51 50 e0 72 73 &5ed0 73 73 73 73 73 73 fb ee ee ee ee ee ee 00 00 f0 &5ee0 00 00 80 80 40 40 a8 a8 a8 a8 a8 a8 a8 a0 20 40 &5ef0 40 40 40 40 40 40 40 40 80 80 80 80 80 80 80 80 ; sprite_wall_triangle_bl &5f00 88 88 cc cc ee 22 11 dd ee ea ee ee ee ee ee ea &5f10 ee ee cc dd dd dd dd dd 00 00 dd dd ee ea ee ee &5f20 00 00 00 00 00 00 00 00 88 88 cc cc ee ee ff fd &5f30 ff ff ff ff fb ff ee 88 11 77 ff ff fb ff ff ff &5f40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f50 88 88 cc cc ee ee 11 11 bb bb ba bb dd dd d5 dd &5f60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f70 00 00 00 00 00 00 00 00 88 88 cc cc ee ee fb ff ; sprite_wall_triangle_br &5f80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f90 00 00 00 00 00 00 00 00 11 11 33 22 66 66 ee ea &5fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5fb0 11 11 33 33 77 77 ee 88 11 77 77 ff fd ff ff ff &5fc0 00 00 00 00 00 00 00 00 11 11 33 33 77 77 fd ff &5fd0 ee ee ee e6 ee cc 00 00 bb bb bb bb dd dd d5 dd &5fe0 11 11 33 33 77 44 cc 99 bb 75 77 77 77 77 77 75 &5ff0 ff ff ff fb ff ff 77 11 88 ee f7 ff ff ff fd ff ; sprite_wall_stripes &0d00 4c 9c 18 b8 30 70 70 f0 f0 f0 f0 f0 f0 f0 f0 f0 &0d10 f0 f0 e0 e0 d1 c1 93 a3 57 27 5f af 5f af 4e ae &0d20 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 e0 e0 d1 c1 93 a3 &0d30 57 27 5f af 5f af 4e ae 4c 9c 18 b8 30 70 70 f0 &0d40 f0 f0 e0 e0 d1 c1 93 a3 57 27 5f af 5f af 4e ae &0d50 4c 9c 18 b8 30 70 70 f0 f0 f0 f0 f0 f0 f0 f0 f0 &0d60 57 27 5f af 5f af 4e ae 4c 9c 18 b8 30 70 70 f0 &0d70 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 e0 e0 c1 d1 a3 93 ; sprite_spike_round &0d80 00 00 00 00 00 22 32 10 00 00 00 11 33 76 fc 40 &0d90 30 10 00 00 11 11 33 32 10 00 00 00 00 00 00 00 &0da0 00 00 11 11 33 32 32 b2 e3 d3 bf bf 6e 4c 4d 4d &0db0 6f 7f 7f bf bf c2 e3 b2 32 10 11 00 00 00 00 00 &0dc0 00 00 00 80 80 40 51 73 3e de cd ef ee 6e 26 26 &0dd0 26 6e cc cd 89 12 1c 40 40 40 80 80 00 00 00 00 &0de0 00 00 00 00 00 88 c8 c0 80 80 00 00 08 48 68 18 &0df0 68 48 08 00 00 80 80 c0 40 00 00 00 00 00 00 00 ; unused_sprite_treasure_two # The sprite in $.DATA2 is for the Adventurer's unused &0e00 00 00 00 00 00 00 00 00 11 11 32 23 32 23 32 23 # second treasure (a gem), but this is overwritten by &0e10 32 23 32 23 32 33 11 11 00 00 00 00 00 00 00 00 # object_title_strings, also found in $.DATA2 &0e20 11 11 33 33 75 75 db bd 5b b5 fa e7 5e e5 5e e5 &0e30 5e e5 5e e5 fa a7 5b b5 db bd 57 75 33 33 11 11 &0e40 00 00 88 88 c4 c4 6a a6 5b b5 fa ed 5e e5 5e e5 &0e50 5e e5 5e e5 fa bd 5b b5 6a a6 4c c4 88 88 00 00 &0e60 00 00 00 00 00 00 00 00 00 00 88 88 88 88 88 88 &0e70 88 88 88 88 88 88 00 00 00 00 00 00 00 00 00 00 ; sprite_earth &0e80 05 0a 09 04 01 0b 02 0c 05 08 03 04 08 05 00 04 &0e90 00 09 00 00 08 02 04 01 00 04 00 00 00 00 04 00 &0ea0 0a 04 0b 0d 0a 00 0b 04 01 04 00 0a 00 02 08 01 &0eb0 08 01 04 00 08 01 00 01 00 04 00 00 00 00 04 00 &0ec0 06 0b 05 01 0a 04 01 06 02 04 09 02 08 00 02 00 &0ed0 04 00 01 04 00 0a 00 01 00 04 00 00 08 00 00 01 &0ee0 0b 06 01 06 09 04 01 04 0a 02 05 00 08 03 00 0a &0ef0 00 00 03 02 00 04 00 00 00 00 00 08 00 01 00 00 ; sprite_plant &0f00 80 e0 70 10 10 30 20 60 40 40 60 30 30 90 90 f0 &0f10 70 10 30 30 70 40 40 c0 80 80 80 c0 40 70 10 00 &0f20 00 10 10 31 73 53 73 f7 b7 97 b7 ff 7f 3f 7f ff &0f30 ff 7f 1f 7f ff b7 97 b7 f7 73 53 73 31 10 90 80 &0f40 00 00 00 90 d8 48 c8 ec bc 3c ac fe de 1e de fe &0f50 fe de 9e de fe ac 2c bc fc c8 48 c8 90 30 60 40 &0f60 00 00 80 c0 60 20 10 10 90 d0 60 20 00 00 00 80 &0f70 c0 60 20 20 30 10 10 30 a0 80 c0 60 20 e0 c0 00 ; sprite_cask &0f80 00 01 02 03 04 07 06 09 0f 0f 03 0c 07 0b 06 0d &0f90 03 0f 01 0e 0f 07 09 0e 0f 07 07 06 03 03 01 00 &0fa0 07 0f 00 0f 00 0f 00 0f 0f 0f 00 0f 0f 00 0f 08 &0fb0 07 08 0f 07 08 0f 0f 00 0f 0f 08 07 0f 00 0f 07 &0fc0 0e 0d 03 0e 01 0f 02 0d 0e 0f 03 0c 0f 07 0b 0c &0fd0 07 0f 0c 03 0f 0e 09 07 0e 0f 0f 01 0e 07 0b 0e &0fe0 00 08 0c 04 0e 0e 02 0f 01 0f 0c 03 0e 0d 0e 03 &0ff0 0c 0f 00 0f 0f 00 0f 03 0d 02 0e 0e 04 0c 08 00 ; sprite_wall_square &1000 0f 0f 7f 7f 4c 4c 4d 4d 4d 4d 4d 4d 4d 4d 4d 4d &1010 4d 4d 4d 4d 4d 4d 4d 4d 4d 6f 6f 7f 7f 08 08 0f &1020 0f 0f ff ff 00 00 0f 0f f5 fa f5 fa f5 fa f5 fa &1030 f5 fa f5 fa f5 fa f5 00 00 0f 0f ff ff 00 00 0f &1040 0f 0f ff ff 00 00 0f 0f e4 ea e4 ea e4 ea e4 ea &1050 e4 ea e4 ea e4 ea e4 00 00 0f 0f ff ff 00 00 0f &1060 0f 0f cd cd cd cd 4d 4d 4d 4d 4d 4d 4d 4d 4d 4d &1070 4d 4d 4d 4d 4d 4d 4d 4d 4d 4d 4d cd cd 01 01 0f ; sprite_crucifix_tl &1080 00 70 00 53 00 63 00 31 00 21 00 31 80 21 c0 71 &1090 b4 e3 d7 5f a7 af d7 5f b4 e3 c0 71 80 21 00 31 ; sprite_crucifix_bl &10a0 00 21 00 31 00 21 00 31 00 21 00 31 00 21 00 31 &10b0 00 21 00 31 00 21 00 31 00 21 00 31 00 30 00 30 ; sprite_crucifix_br &10c0 c8 00 48 00 c8 00 48 00 c8 00 48 00 c8 00 48 00 &10d0 c8 00 48 00 c8 00 48 00 c8 00 48 00 c0 00 c0 00 ; sprite_crucifix_tr &10e0 e0 00 6c 00 ac 00 48 00 c8 00 48 00 c8 10 68 30 &10f0 bc f2 5f 5e af be 5f 5e bc f2 68 30 c8 10 48 00 ; sprite_treasure # The sprite in $.DATA2 is for the Adventurer's &0a00 00 03 07 17 37 37 37 37 26 26 26 26 26 37 37 b7 # treasure chest, but this is overwritten by the &0a10 37 37 86 07 03 60 50 60 a0 10 60 50 00 00 10 00 # sprite copied from $.CHRS &0a20 c0 43 43 73 73 73 73 73 73 1f 5b 5b 5b 1f 73 73 &0a30 73 73 40 43 43 e0 70 d0 60 00 e0 50 00 a0 00 20 &0a40 60 29 29 b9 b9 b9 b9 b9 31 07 25 25 25 8f b9 b9 &0a50 b9 b9 20 29 29 a0 d0 50 80 a0 00 40 10 a0 00 10 &0a60 00 0c 0e 8e 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a &0a70 8a 02 16 0e 0c e0 40 20 80 40 80 00 00 40 00 00 ; sprite_wall_splodges &0a80 ee ee ee ee ff 77 77 3b 3b 0c 0f 0f 0f 0f 0f 0e &0a90 1d 1d 33 ff ff ff ee ee ff ff ee ee ee cd cd cd &0aa0 0f 0f 0f 0f 06 15 bb ff ff ff 77 77 77 3b 3b 77 &0ab0 ff ff ff 88 07 07 0f 0f 07 07 0f 0f 0f 0f 0f 0f &0ac0 1d 1d 1d 33 ff ff ff ff ff ee ee cd cd cc ff ff &0ad0 ff ff ff ff 77 77 77 3b 3b 3b 3b 3b 1d 1d 1d 1d &0ae0 ff ff ff ff ff cc cd 8b 03 0f 0f 0f 0f 0f 07 07 &0af0 07 89 ee ff ff ff ff ff ff ff ff ff ff ff ff ff ; sprite_wall_petals &0b00 f0 f0 c0 c1 83 83 83 83 83 c1 c1 e0 f0 f0 f0 f0 &0b10 f0 f0 f0 f0 e0 c1 c1 83 83 83 83 83 c1 c0 f0 f0 &0b20 f0 f0 70 70 38 38 38 1c 1c 1c 1c 1c 10 f0 f0 f0 &0b30 f0 f0 f0 10 1c 1c 1c 1c 1c 38 38 38 70 70 f0 f0 &0b40 f0 f0 e0 e0 c1 c1 c1 83 83 83 83 82 80 f0 f0 f0 &0b50 f0 f0 f0 80 83 83 83 83 83 c1 c1 c1 e0 e0 f0 f0 &0b60 f0 f0 30 38 1c 1c 1c 1c 18 38 30 70 f0 f0 f0 f0 &0b70 f0 f0 f0 f0 70 70 38 38 1c 1c 1c 1c 38 30 f0 f0 ; sprite_acid &0b80 30 70 70 60 e0 d0 d0 d0 f0 70 70 70 70 30 30 30 &0b90 30 30 60 60 60 e0 f0 f0 f0 f0 70 70 30 30 30 00 &0ba0 00 c0 60 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 &0bb0 f0 f0 f0 f0 f0 f0 70 70 b0 c0 f0 f0 f0 c0 80 00 &0bc0 00 10 30 f0 f0 f0 f0 f0 f0 e0 e0 d0 f0 f0 f0 f0 &0bd0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 70 10 00 &0be0 00 80 c0 c0 c0 c0 40 60 60 e0 e0 e0 c0 c0 c0 c0 &0bf0 80 80 80 80 00 00 00 80 80 c0 c0 c0 c0 80 80 00 ; sprite_bee_left &0600 00 88 44 22 11 03 03 07 07 70 70 07 07 03 03 11 &0610 22 44 88 00 77 ee ee ee ee ee de d2 d2 d2 d2 d2 &0620 d2 de ee ee ee ee ee 77 00 00 00 00 00 00 00 48 &0630 48 68 68 48 48 00 00 00 00 00 00 00 ; sprite_bee_right &063c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &064c 00 00 00 00 00 00 00 00 00 00 00 21 21 61 61 21 &065c 21 00 00 00 00 00 00 00 ee 77 77 77 77 77 b7 b4 &066c b4 b4 b4 b4 b4 b7 77 77 77 77 77 ee 00 11 22 44 &067c 88 0c 0c 0e 0e e0 e0 0e 0e 0c 0c 88 44 22 11 00 ; unused &068c 00 ; treasure_string &068d 1f 07 0b 11 02 ec ea e3 e0 eb ed ea e3 3f ; TAB(&07, &0b); COLOUR 2; "treasure?" ; unused &069b 00 00 00 00 00 ; sprite_arrow_right &06a0 00 c0 20 00 0f 1e 00 c0 20 ; sprite_arrow_left &06a9 40 30 00 87 0f 00 40 30 00 ; sprite_arrow_up &06b2 40 a4 04 04 04 04 04 a4 a4 00 00 00 00 00 00 00 &06c2 00 ; sprite_arrow_down &06c3 00 00 00 00 00 00 00 00 a4 a4 04 04 04 04 04 a4 &06d3 40 ; tune_yes_string &06d4 1f 09 10 11 02 ef e3 eb ; TAB(&09, &10); COLOUR 2; "yes" ; unused &06dc ff ff f7 f7 ; sprite_potion &06e0 30 c0 30 c0 10 80 32 c4 33 cc 77 e6 33 ea 77 ea &06f0 33 ea 77 ea 33 ea 77 ea 33 ea 77 ea 33 ea 77 ee ; sprite_scythe &0700 00 00 00 e0 10 32 20 22 20 22 40 22 40 22 40 22 &0710 00 22 00 22 00 22 00 22 00 22 00 22 00 22 00 22 ; sprite_food &0720 00 00 00 00 00 00 00 10 30 90 70 d0 72 f0 f2 e0 &0730 f0 e0 10 f0 70 d0 30 90 00 10 00 00 00 00 00 00 ; sprite_wine &0740 40 10 73 fe 73 fe 73 fe 31 ec 31 ec 10 c8 00 80 &0750 00 80 00 80 00 80 00 80 00 80 10 c0 30 e0 00 00 ; sprite_bone &0760 10 00 10 00 30 80 30 80 70 c0 10 00 70 c0 10 00 &0770 70 c0 10 00 30 80 10 00 30 80 30 80 70 c0 40 40 ; sprite_empty_glass &0780 40 10 40 10 40 10 40 10 20 20 20 20 10 40 00 80 &0790 00 80 00 80 00 80 00 80 00 80 10 c0 30 e0 00 00 ; sprite_compass &07a0 00 00 77 88 47 0c df c6 9f c6 bf cd bf cd bf cd &07b0 bd ed bf cd bf cd 37 89 57 82 02 82 01 0c 00 00 ; sprite_axe &07c0 00 20 00 60 30 e0 31 e0 30 e0 01 60 01 20 01 00 &07d0 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 ; sprite_cake &07e0 00 00 00 00 00 00 00 00 00 00 00 00 01 00 21 80 &07f0 70 c0 f0 e0 ff ee ff ee 77 cc 77 cc 33 88 33 88 ; initial_bee_data # 16 bytes per level &0380 10 34 0d 04 26 0d 28 0f ; level 1 # 4 bees ; sound_melody # Last eight bytes of level 1 data used for sound ; chan vol pitch dur &0388 02 00 04 04 00 00 00 00 &0390 07 36 07 37 07 38 07 39 07 3a 04 00 00 00 00 00 ; level 2 # 5 bees (unused trailing 04 byte) &03a0 2c 3b 33 3b 3a 3b 0f 28 29 2e 1a 12 1d 14 0a 11 ; level 3 # 8 bees &03b0 0e 0a 35 3a 2e 3a 18 2f 36 1d 21 2e 1d 05 2a 05 ; level 4 # 8 bees ; sprite_bell &03c0 11 00 11 00 10 00 30 80 30 80 20 80 60 c0 70 40 &03d0 70 40 70 40 70 40 f0 60 f0 e0 f0 e0 81 20 01 00 ; unused &03e0 4c 9c 18 b8 30 70 70 f0 f0 f0 f0 f0 f0 f0 f0 f0 # Copy of part of sprite_wall_stripes, &0d00-&0d1f &03f0 f0 f0 e0 e0 d1 c1 93 a3 57 27 5f af 5f af 4e ae ; sprite_bow_and_arrow &0100 00 00 10 00 30 80 01 00 01 00 01 00 10 00 21 80 &0110 41 40 41 40 81 20 81 20 cd 66 33 88 00 00 00 00 ; you_have_failed_string &0120 1f 04 08 11 01 59 e9 ed 20 68 e0 ee e3 1f 01 09 ; TAB(&04, &08); COLOUR 1; "You have" &0130 66 e0 69 e6 e3 e2 ee ; TAB(&01, &09); "failed" ; tune_no_string &0137 1f 09 10 11 02 e8 e9 20 ; TAB(&09, &10); COLOUR 2; "no " ; unused &013f 00 ; unused &68c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &68d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &68e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &68f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; play_tune &0900 08 PHP &0901 c9 04 CMP #&04 &0903 d0 59 BNE &095e ; leave_after_restoring_processor_status &0905 48 PHA &0906 8a TXA &0907 48 PHA &0908 98 TYA &0909 48 PHA &090a a9 80 LDA #&80 ; Read I/O device or buffer status &090c a2 f9 LDX #&f9 ; Sound output buffer 2 &090e 20 f4 ff JSR &fff4 ; OSBYTE &0911 e0 00 CPX #&00 &0913 f0 44 BEQ &0959 ; leave_after_restoring_registers &0915 a6 3a LDX &3a ; melody_offset &0917 bd 80 09 LDA &0980,X ; tune_data + 2 &091a 48 PHA &091b a8 TAY &091c bd 7e 09 LDA &097e,X ; tune_data &091f 38 SEC &0920 e5 3b SBC &3b ; melody_octave_shift &0922 20 60 09 JSR &0960 ; play_melody_note &0925 a6 3a LDX &3a ; melody_offset &0927 68 PLA &0928 a8 TAY &0929 bd 7f 09 LDA &097f,X ; tune_data + 1 &092c 38 SEC &092d e5 3b SBC &3b ; melody_octave_shift &092f 20 6f 09 JSR &096f ; play_bassline_note &0932 a6 3a LDX &3a ; melody_offset &0934 e8 INX &0935 e8 INX &0936 e8 INX &0937 86 3a STX &3a ; melody_offset &0939 e0 7e CPX #&7e &093b 90 1c BCC &0959 ; leave_after_restoring_registers &093d a2 00 LDX #&00 &093f 86 3a STX &3a ; melody_offset &0941 a6 3b LDX &3b ; melody_octave_shift &0943 d0 06 BNE &094b &0945 a9 0c LDA #&0c &0947 85 3b STA &3b ; melody_octave_shift &0949 d0 0e BNE &0959 ; leave_after_restoring_registers &094b e0 0c CPX #&0c &094d d0 06 BNE &0955 &094f a9 18 LDA #&18 &0951 85 3b STA &3b ; melody_octave_shift &0953 d0 04 BNE &0959 ; leave_after_restoring_registers &0955 a9 00 LDA #&00 &0957 85 3b STA &3b ; melody_octave_shift ; leave_after_restoring_registers &0959 68 PLA &095a a8 TAY &095b 68 PLA &095c aa TAX &095d 68 PLA ; leave_after_restoring_processor_status &095e 28 PLP &095f 60 RTS ; play_melody_note &0960 8d 8c 03 STA &038c ; sound_melody_pitch &0963 8c 8e 03 STY &038e ; sound_melody_duration &0966 a9 07 LDA #&07 ; Generate a sound &0968 a2 88 LDX #&88 &096a a0 03 LDY #&03 ; &0388 = sound_melody &096c 4c f1 ff JMP &fff1 ; play_bassline_note &096f 8d fc 02 STA &02fc ; sound_bassline_pitch &0972 8c fe 02 STY &02fe ; sound_bassline_duration &0975 a9 07 LDA #&07 ; Generate a sound &0977 a2 f8 LDX #&f8 &0979 a0 02 LDY #&02 ; &02f8 = sound_bassline &097b 4c f1 ff JMP &fff1 ; OSWORD ; tune_data ; m b d &097e 5f 1f 03 &0981 63 1f 03 &0984 5f 1f 03 &0987 6b 2f 03 &098a 63 2f 03 &098d 5f 2f 03 &0990 57 3b 03 &0993 5f 3b 03 &0996 57 3b 03 &0999 63 3b 03 &099c 5f 3b 03 &099f 57 3b 03 &09a2 4f 2f 03 &09a5 57 2f 03 &09a8 4f 2f 03 &09ab 63 1f 03 &09ae 57 1f 03 &09b1 4f 1f 03 &09b4 57 3b 09 &09b7 57 33 09 &09ba 5f 2f 03 &09bd 63 2f 03 &09c0 5f 2f 03 &09c3 6b 1f 03 &09c6 63 1f 03 &09c9 5f 1f 03 &09cc 57 33 03 &09cf 5f 33 03 &09d2 57 33 03 &09d5 63 27 03 &09d8 5f 27 03 &09db 57 27 03 &09de 5f 3b 03 &09e1 63 3b 03 &09e4 5f 3b 03 &09e7 57 33 03 &09ea 5f 33 03 &09ed 57 33 03 &09f0 4f 2f 03 &09f3 4f 3b 03 &09f6 4f 2f 03 &09f9 4f 1f 09 ; unused &09fc 09 00 00 00 ; sprite_wall_brickwork &0c80 ff 00 08 0f cf cd cd cd 89 01 03 0f 7f ff ff ff &0c90 ff 00 08 0f cf cd cd cd 89 01 03 0f 7f ff ff ff &0ca0 89 01 03 0f 7f ff ff ff ff 00 08 0f cf cd cd cd &0cb0 89 01 03 0f 7f ff ff ff ff 00 08 0f cf cd cd cd &0cc0 ff 00 08 0f cf cd cd cd 89 01 03 0f 7f ff ff ff &0cd0 ff 00 08 0f cf cd cd cd 89 01 03 0f 7f ff ff ff &0ce0 89 01 03 0f 7f ff ff ff ff 00 08 0f cf cd cd cd &0cf0 89 01 03 0f 7f ff ff ff ff 00 08 0f cf cd cd cd ; sprite_door &5880 ee 66 22 11 00 00 00 00 00 00 00 00 00 00 00 00 &5890 00 00 00 00 00 00 00 00 00 00 00 00 11 22 66 ee &58a0 ff ff ff 77 ff 77 33 12 12 12 12 12 12 12 12 12 &58b0 12 12 12 12 12 12 12 12 12 33 77 ff ff ff ff ff &58c0 dd dd dd dd ff ee cc 84 84 84 84 84 84 84 84 84 &58d0 84 84 84 84 84 84 84 84 84 cc aa bb dd dd dd dd &58e0 ff ee cc 88 00 00 00 00 00 00 00 00 00 00 00 00 &58f0 00 00 00 00 00 00 00 00 00 00 00 00 88 cc ee ff ; sprite_wall_triangle_tr &5a80 ee e6 ee ff ff 11 00 cc ee ee ea ee ee ee ee ee &5a90 ea ee cc dd dd dd dd dd 11 11 ee ea cc cc 88 88 &5aa0 ff ff fe 77 77 77 33 00 cc ff ff fb ff ff ff ff &5ab0 ff ff ea ee cc cc 88 88 00 00 00 00 00 00 00 00 &5ac0 dd dd dd dd ea ee ee 00 11 ff ee ee c4 cc 88 88 &5ad0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ae0 ff fb ee ee cc 44 88 88 00 00 00 00 00 00 00 00 &5af0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_wall_triangle_tl &5b00 ee ea 66 77 33 33 11 11 00 00 00 00 00 00 00 00 &5b10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b20 ff ff ff 76 77 77 77 00 88 ff 76 77 33 33 11 11 &5b30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b40 dd dd dd dd ee ee ee 00 11 ff ff ff ff ff fb ff &5b50 ee ee 66 66 22 22 11 11 00 00 00 00 00 00 00 00 &5b60 ff ff fb ff dd 00 22 77 77 77 77 77 75 77 77 77 &5b70 ff ff ff ff fb ff 77 11 88 ee 75 77 33 33 11 11 ; title_screen_text &5b80 1f 09 03 11 02 52 e0 ee e3 e8 1f 05 04 eb e5 ed ; TAB(&09, &03); COLOUR 2; "Raven"; TAB(&05, &04); "skull" &5b90 e6 e6 1f 02 14 50 ea e3 eb eb 20 20 53 70 e0 e1 ; TAB(&02, &14); "Press Space"; TAB(&09, &0b); &5ba0 e3 1f 09 0b 11 01 e6 e0 eb ec 1f 04 0c e0 ec ec ; TAB(&09, &0b); COLOUR 1; "last"; TAB(&04, &0c); "attempt"; &5bb0 e3 e7 70 ec 1f 02 0d 11 ; TAB(&02, &0d); COLOUR ; status_screen_text &5bb8 1f 05 04 11 02 eb ec e0 ec ed eb 1f 01 05 eb e1 ; TAB(&05, &04); COLOUR 2; "status"; TAB(&01, 05); "screen" &5bc8 ea e3 e3 e8 1f 06 0b 11 01 eb e1 e9 ea e3 20 3a ; TAB(&06, &0b); COLOUR 1; "score : %" &5bd8 20 20 25 1f 06 0f eb e9 ed e8 e2 20 3a 1f 02 10 ; TAB(&06, &0f); "sound :"; &5be8 ec ed e8 e3 20 20 3a ; TAB(&02, &10); "tune :"; ; sound_status_strings &5bef 1f 0d 0f 11 02 ef e3 eb ; TAB(&0d, &0f); COLOUR 2; "yes" &5bf7 1f 0d 0f 11 02 e8 e9 20 ; TAB(&0d, &0f); COLOUR 2; "no " ; unused &5bff 20 ; object_title_strings &0e00 e5 e3 ef 5a ; "key" &0e04 eb e1 ea e9 e6 e6 5a ; "scroll" &0e0b 70 69 e1 e5 2d e0 78 e3 5a ; "pick-axe" &0e14 e2 e3 ec e9 e8 e0 ec e9 ea 5a ; "detonator" &0e1e e2 ef e8 e0 e7 69 ec e3 5a ; "dynamite" &0e27 eb 70 e0 e2 e3 5a ; "spade" &0e2d e5 e3 ef 5a ; "key" &0e31 e5 e3 ef 5a ; "key" &0e35 70 e9 ec 69 e9 e8 5a ; "potion" &0e3c eb e1 ef ec 68 e3 5a ; "scythe" &0e43 66 e9 e9 e2 5a 77 69 e8 e3 5a ; "food" &0e4d 62 e9 e8 e3 5a ; "wine" &0e52 e3 e7 70 ec ef 20 e4 e6 e0 eb eb 5a ; "empty glass" &0e5e e1 e9 e7 70 e0 eb eb 5a ; "compass" &0e66 e0 78 e3 5a ; "axe" &0e6a e1 e0 e5 e3 5a ; "cake" &0e6f 62 e3 e6 e6 5a ; "bell" &0e74 62 e9 77 20 26 20 e0 ea ea e9 77 5a ; "bow & arrow" ; level_title_strings &0140 1f 08 0b 43 e0 eb ec e6 e3 1f 02 0c 52 e0 ee e3 ; TAB(&08, &0b); "Castle"; TAB(&02, &0c); "Ravenskull" &0150 e8 eb e5 ed e6 e6 5a &0157 54 68 e3 20 43 e0 ec e0 e1 e9 e7 62 eb 5a ; "The Catacombs" &0165 54 68 e3 20 42 e3 e3 27 eb 20 48 69 ee e3 5a ; "The Bee's Hive" &0174 54 68 e3 20 54 69 e7 e3 20 53 68 e0 66 ec 5a ; "The Time Shaft" ; unused &0183 00 00 ; unused &6d45 00 00 00 00 00 00 00 00 00 00 00 &6d50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &6d60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &6d70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; $.CHRS 003800 003800 001100 ; sprite_warrior_up &3800 00 04 00 00 00 08 00 00 00 0c 00 00 01 08 00 00 &3810 01 00 01 08 03 11 00 08 02 31 81 08 06 73 c8 08 &3820 07 73 c8 08 07 f7 ec 08 07 f7 ed 08 03 f3 e9 08 &3830 03 f3 e9 08 01 f1 e1 08 00 f0 e1 00 10 f0 e0 00 &3840 10 f0 f0 00 10 f0 b0 00 30 f0 b0 00 30 f0 b0 80 &3850 30 d0 b0 80 60 d0 d0 80 60 d0 d0 c0 50 d0 e0 c0 &3860 f0 90 e0 c0 f0 90 f0 e0 70 70 b0 e0 10 e0 00 60 &3870 00 c0 00 20 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_warrior_down # Unused &3880 00 00 00 00 00 00 00 00 00 00 00 00 00 c0 00 20 &3890 10 e0 00 60 70 70 b0 e0 f0 90 f0 e0 f0 90 e0 c0 &38a0 50 d0 e0 c0 60 d0 d0 c0 60 d0 d0 80 30 d0 b0 80 &38b0 30 f0 b0 80 30 f0 b0 00 10 f0 b0 00 10 f0 f0 00 &38c0 10 f0 e0 00 00 f0 e1 00 01 f1 e1 08 03 f3 e9 08 &38d0 03 f3 e9 08 07 f7 ed 08 07 f7 ec 08 07 73 c8 08 &38e0 06 73 c8 08 02 31 81 08 03 11 00 08 01 00 01 08 &38f0 01 08 00 00 00 0c 00 00 00 08 00 00 00 04 00 00 ; sprite_warrior_left &3900 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3910 00 00 00 40 00 00 00 e0 00 00 00 e0 00 00 10 f0 &3920 00 00 30 f0 01 0c 70 f0 03 0e f0 90 02 1e f0 30 &3930 04 78 e0 60 04 f4 c0 e0 18 fe 90 c0 39 ff f0 c0 &3940 31 ff f0 c0 31 ff f0 c0 31 ff c0 e0 10 fe f0 e0 &3950 00 f4 f0 e0 00 70 f0 e0 00 07 e0 f0 02 07 78 70 &3960 03 0f 30 30 00 00 10 b0 00 00 00 f0 00 00 00 60 &3970 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_warrior_right &3980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3990 20 00 00 00 70 00 00 00 70 00 00 00 f0 80 00 00 &39a0 f0 c0 00 00 f0 e0 03 08 90 f0 07 0c c0 f0 87 04 &39b0 60 70 e1 02 70 30 f2 02 30 90 f7 81 30 f0 ff c9 &39c0 30 f0 ff c8 30 f0 ff c8 70 30 ff c8 70 f0 f7 80 &39d0 70 f0 f2 00 70 f0 e0 00 f0 70 0e 00 e0 e1 0e 04 &39e0 c0 c0 0f 0c d0 80 00 00 f0 00 00 00 60 00 00 00 &39f0 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_warrior_up_frame_two &3a00 00 00 02 00 00 00 01 00 00 00 03 00 00 00 01 08 &3a10 01 08 00 08 01 00 88 0c 01 18 c8 04 01 31 ec 06 &3a20 01 31 ec 0e 01 73 fe 0e 01 7b fe 0e 01 79 fc 0c &3a30 01 79 fc 0c 01 78 f8 08 00 78 f0 00 00 70 f0 80 &3a40 00 f0 f0 80 00 d0 f0 80 00 d0 f0 c0 10 d0 f0 c0 &3a50 10 d0 b0 40 10 90 b0 60 30 30 b0 a0 30 30 b0 a0 &3a60 30 30 d0 f0 70 70 d0 f0 70 d0 c0 e0 60 00 70 80 &3a70 40 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_warrior_treasure # Shield &3a80 00 00 00 00 10 30 71 72 71 72 71 72 71 72 71 20 &3a90 31 30 31 30 10 10 10 10 00 00 00 00 00 00 00 00 &3aa0 00 00 10 70 f5 ea e4 c8 c5 89 83 03 17 06 07 07 &3ab0 79 fa f5 ea e4 c8 c5 89 d7 f2 f5 72 71 30 10 00 &3ac0 00 00 c0 f8 b1 52 3d 3e 7d 7a f5 fa e4 00 0f 0f &3ad0 83 03 17 16 3d 3e 7d 6a e4 ea c4 98 30 60 c0 80 &3ae0 00 00 00 00 c0 e8 d4 d8 d4 d8 d4 d8 d4 58 90 a8 &3af0 a0 a8 a0 20 40 40 40 40 80 80 80 00 00 00 00 00 ; sprite_warrior_treasure_two # Unused - axe &3b00 00 00 00 70 70 70 70 70 70 70 70 70 70 00 00 00 &3b10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3b20 00 00 11 33 b3 f3 d3 e3 d3 e3 d3 b3 33 33 33 33 &3b30 33 33 33 33 33 23 13 33 23 13 33 23 13 33 11 00 &3b40 00 00 00 98 b8 f8 78 f8 78 f8 78 b8 98 88 88 88 &3b50 88 88 88 88 08 88 88 08 88 88 08 88 88 88 00 00 &3b60 00 00 00 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 00 00 00 &3b70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_warrior_right_frame_two # Unused &3b80 00 00 00 00 00 00 00 00 40 00 00 00 60 00 00 00 &3b90 60 00 00 00 30 00 00 00 30 80 00 00 20 c0 0f 0c &3ba0 20 61 0e 04 30 30 0e 00 70 f0 e0 00 70 f0 f2 00 &3bb0 70 f0 f7 80 f0 30 ff c8 e0 f0 ff c8 f0 f0 ff c8 &3bc0 f0 f0 ff c9 f0 90 f7 81 70 30 f2 02 60 70 e1 02 &3bd0 60 f0 87 04 70 f0 07 0c 30 e0 03 08 30 c0 00 00 &3be0 10 80 00 00 10 00 00 00 30 00 00 00 20 00 00 00 &3bf0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_adventurer_up &3c00 01 08 00 00 01 04 00 00 01 00 00 00 23 0c 00 00 &3c10 33 00 00 00 77 00 00 0e 66 10 00 06 66 16 0c 0e &3c20 cc 38 82 06 cc 78 c2 66 ef f0 e1 66 ef f0 e1 66 &3c30 ef f0 e1 66 ef f0 e1 66 ef f0 e1 ee ef f0 e1 ee &3c40 ef f0 e1 ee ef f0 e1 ee ef f0 e1 ee 67 f8 e3 ee &3c50 67 f8 e3 ee 23 fe ef cc 01 ff ef 88 01 0f 0f 00 &3c60 01 0f 0f 00 01 0f 0f 00 01 0f 0f 00 01 0f 0f 00 &3c70 01 08 03 00 01 07 0d 00 00 0f 0e 00 00 00 00 00 ; sprite_adventurer_down # Unused &3c80 00 0f 0e 00 01 07 0d 00 01 08 03 00 01 0f 0f 00 &3c90 01 0f 0f 00 01 0f 0f 00 01 0f 0f 00 01 0f 0f 00 &3ca0 01 ff ef 88 23 fe ef cc 67 f8 e3 ee 67 f8 e3 ee &3cb0 ef f0 e1 ee ef f0 e1 ee ef f0 e1 ee ef f0 e1 ee &3cc0 ef f0 e1 ee ef f0 e1 66 ef f0 e1 66 ef f0 e1 66 &3cd0 ef f0 e1 66 cc 78 c2 66 cc 38 82 06 66 16 0c 0e &3ce0 66 10 00 06 77 00 00 0e 33 00 00 00 23 0c 00 00 &3cf0 01 00 00 00 01 04 00 00 01 08 00 00 00 00 00 00 ; sprite_adventurer_left &3d00 00 00 00 00 00 00 00 00 00 77 88 00 11 ff cc 00 &3d10 33 ff cc 00 77 ff ee 00 1f 11 0f 0e 0e 07 ef 0d &3d20 0a 78 e7 0b 09 70 e3 07 01 f0 e3 07 01 f0 e3 07 &3d30 12 f0 e1 07 12 f0 e1 07 30 f0 e1 07 12 f0 e1 07 &3d40 12 f0 e1 07 01 f0 e1 07 01 f0 e3 07 01 70 e3 07 &3d50 00 78 e7 0b 00 07 ef 0d 02 00 0f 0e 02 08 ff 00 &3d60 03 ff ff 00 03 ff ff 00 03 ff ee 00 00 00 00 00 &3d70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_adventurer_right &3d80 00 00 00 00 00 00 00 00 00 11 ee 00 00 33 ff 88 &3d90 00 33 ff cc 00 77 ff ee 07 0f 88 8f 0b 7f 0e 07 &3da0 0d 7e e1 05 0e 7c e0 09 0e 7c f0 08 0e 7c f0 08 &3db0 0e 78 f0 84 0e 78 f0 84 0e 78 f0 c0 0e 78 f0 84 &3dc0 0e 78 f0 84 0e 78 f0 08 0e 7c f0 08 0e 7c e0 08 &3dd0 0d 7e e1 00 0b 7f 0e 00 07 0f 00 04 00 ff 01 04 &3de0 00 ff ff 0c 00 ff ff 0c 00 77 ff 0c 00 00 00 00 &3df0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_adventurer_up_frame_two &3e00 00 00 01 08 00 00 02 08 00 00 00 08 00 00 03 4c &3e10 00 00 00 cc 07 00 00 ee 06 00 80 66 07 03 86 66 &3e20 06 14 c1 33 66 34 e1 33 66 78 f0 7f 66 78 f0 7f &3e30 66 78 f0 7f 66 78 f0 7f 77 78 f0 7f 77 78 f0 7f &3e40 77 78 f0 7f 77 78 f0 7f 77 78 f0 7f 77 7c f1 6e &3e50 77 7c f1 6e 33 7f f7 4c 11 7f ff 08 00 0f 0f 08 &3e60 00 0f 0f 08 00 0f 0f 08 00 0f 0f 08 00 0f 0f 08 &3e70 00 0c 01 08 00 0b 0e 08 00 07 0f 00 00 00 00 00 ; sprite_adventurer_treasure # Treasure chest &3e80 00 03 07 17 37 37 37 37 26 26 26 26 26 37 37 b7 &3e90 37 37 86 07 03 60 50 60 a0 10 60 50 00 00 10 00 &3ea0 c0 43 43 73 73 73 73 73 73 1f 5b 5b 5b 1f 73 73 &3eb0 73 73 40 43 43 e0 70 d0 60 00 e0 50 00 a0 00 20 &3ec0 60 29 29 b9 b9 b9 b9 b9 31 07 25 25 25 8f b9 b9 &3ed0 b9 b9 20 29 29 a0 d0 50 80 a0 00 40 10 a0 00 10 &3ee0 00 0c 0e 8e 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a &3ef0 8a 02 16 0e 0c e0 40 20 80 40 80 00 00 40 00 00 ; sprite_adventurer_treasure_two # Unused - gem &3f00 00 00 00 00 00 00 00 00 11 11 32 23 32 23 32 23 &3f10 32 23 32 23 32 33 11 11 00 00 00 00 00 00 00 00 &3f20 11 11 33 33 75 75 db bd 5b b5 fa e7 5e e5 5e e5 &3f30 5e e5 5e e5 fa a7 5b b5 db bd 57 75 33 33 11 11 &3f40 00 00 88 88 c4 c4 6a a6 5b b5 fa ed 5e e5 5e e5 &3f50 5e e5 5e e5 fa bd 5b b5 6a a6 4c c4 88 88 00 00 &3f60 00 00 00 00 00 00 00 00 00 00 88 88 88 88 88 88 &3f70 88 88 88 88 88 88 00 00 00 00 00 00 00 00 00 00 ; sprite_adventurer_right_frame_two # Unused &3f80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3f90 00 00 00 00 00 77 ff 0c 00 ff ff 0c 00 ff ff 0c &3fa0 00 ff 01 04 07 0f 00 04 0b 7f 0e 00 0d 7e e1 00 &3fb0 0e 7c e0 08 0e 7c f0 08 0e 78 f0 08 0e 78 f0 84 &3fc0 0e 78 f0 84 0e 78 f0 c0 0e 78 f0 84 0e 78 f0 84 &3fd0 0e 7c f0 08 0e 7c f0 08 0e 7c e0 09 0d 7e e1 05 &3fe0 0b 7f 0e 07 07 0f 88 8f 00 77 ff ee 00 33 ff cc &3ff0 00 33 ff 88 00 11 ee 00 00 00 00 00 00 00 00 00 ; sprite_wizard_up &4000 00 00 02 00 00 00 01 00 00 00 03 00 00 00 01 08 &4010 01 08 00 cc 01 00 80 cc 01 19 c4 cc 01 32 e2 66 &4020 11 32 e2 66 11 74 f1 ee 11 fc f1 ee 11 fe f3 cc &4030 11 fe f3 cc 11 ff f7 88 00 ff ff 00 00 77 ff 88 &4040 00 ff ff 88 00 ff ff 88 00 df 67 cc 11 df 67 cc &4050 11 ff 77 cc 11 ff 33 ee 33 ff bb ee 33 bf ab ee &4060 22 bf ef ee 66 ff ff 66 55 dd ff 66 77 00 77 33 &4070 66 00 33 99 44 00 11 ff 44 00 00 77 00 00 00 11 ; sprite_wizard_down # Unused &4080 00 00 00 11 44 00 00 77 44 00 11 ff 66 00 33 99 &4090 77 00 77 33 55 dd ff 66 66 ff ff 66 22 bf ef ee &40a0 33 bf ab ee 33 ff bb ee 11 ff 33 ee 11 ff 77 cc &40b0 11 df 67 cc 00 df 67 cc 00 ff ff 88 00 ff ff 88 &40c0 00 77 ff 88 00 ff ff 00 11 ff f7 88 11 fe f3 cc &40d0 11 fe f3 cc 11 fc f1 ee 11 74 f1 ee 11 32 e2 66 &40e0 01 32 e2 66 01 19 c4 cc 01 00 80 cc 01 08 00 cc &40f0 00 00 01 08 00 00 03 00 00 00 01 00 00 00 02 00 ; sprite_wizard_left &4100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4110 00 00 00 22 00 00 00 66 00 00 00 ff 00 00 11 ff &4120 00 00 33 ff 17 ee 77 bf 17 ff 77 9d 04 77 ff 11 &4130 04 77 ff ff 00 ff df ff 11 f3 df ee 32 f1 88 ee &4140 32 f1 ff ee 30 f1 ff cc 30 f1 ef cc 32 f1 ef cc &4150 32 f1 ff cc 19 f3 ff cc 0c ff 33 cc 2e ff 99 cc &4160 77 ff cc cc 33 ee ee cc 11 cc 33 4c 00 00 11 6e &4170 00 00 00 ee 00 00 00 ee 00 00 00 66 00 00 00 22 ; sprite_wizard_right &4180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4190 44 00 00 00 66 00 00 00 ff 00 00 00 ff 88 00 00 &41a0 ff cc 00 00 df ee 77 8e 9b ee ff 8e 88 ff ee 02 &41b0 ff ff ee 02 ff bf ff 00 77 bf fc 88 77 11 f8 c4 &41c0 77 ff f8 c4 33 ff f8 c0 33 7f f8 c0 33 7f f8 c4 &41d0 33 ff f8 c4 33 ff fc 89 33 cc ff 03 33 99 ff 47 &41e0 33 33 ff ee 33 77 77 cc 23 cc 33 88 67 88 00 00 &41f0 77 00 00 00 77 00 00 00 66 00 00 00 44 00 00 00 ; sprite_wizard_up_frame_two &4200 00 04 00 00 00 08 00 00 00 0c 00 00 01 08 00 00 &4210 33 00 01 08 33 10 00 08 33 32 89 08 66 74 c4 08 &4220 66 74 c4 88 77 f8 e2 88 77 f8 f3 88 33 fc f7 88 &4230 33 fc f7 88 11 fe ff 88 00 ff ff 00 11 ff ee 00 &4240 11 ff ff 00 11 ff ff 00 33 6e bf 00 33 6e bf 88 &4250 33 ee ff 88 77 cc ff 88 77 dd ff cc 77 5d df cc &4260 77 7f df 44 66 ff ff 66 66 ff bb aa cc ee 00 ee &4270 99 cc 00 66 ff 88 00 22 ee 00 00 22 88 00 00 00 ; sprite_wizard_treasure # Crystal ball &4280 00 00 00 00 00 00 11 00 11 22 11 22 11 22 11 22 &4290 11 22 11 00 11 00 00 01 01 00 01 00 01 00 00 00 &42a0 00 33 55 ab 47 ab 77 bf 1f bf aa ff bb ef ff bb &42b0 ee ff 77 bb 66 bb 55 33 3b 0c 07 0f 16 1e 07 01 &42c0 00 ee fb fd 7c fe fe ba ff ff ff ff 7f 3f 7f ff &42d0 ff ff fe fe fe fc fd fb ee 01 0f 87 4b 4b 87 0c &42e0 00 00 00 88 88 cc c4 c4 e6 e2 e2 e2 e2 e2 e2 e2 &42f0 e2 e6 c4 c4 cc 88 88 04 0c 0c 0c 0c 0c 08 00 00 ; sprite_wizard_treasure_two # Unused - copy of crystal ball &4300 00 00 00 00 00 00 11 00 11 22 11 22 11 22 11 22 &4310 11 22 11 00 11 00 00 01 01 00 01 00 01 00 00 00 &4320 00 33 55 ab 47 ab 77 bf 1f bf aa ff bb ef ff bb &4330 ee ff 77 bb 66 bb 55 33 3b 0c 07 0f 16 1e 07 01 &4340 00 ee fb fd 7c fe fe ba ff ff ff ff 7f 3f 7f ff &4350 ff ff fe fe fe fc fd fb ee 01 0f 87 4b 4b 87 0c &4360 00 00 00 88 88 cc c4 c4 e6 e2 e2 e2 e2 e2 e2 e2 &4370 e2 e6 c4 c4 cc 88 88 04 0c 0c 0c 0c 0c 08 00 00 ; sprite_wizard_right_frame_two # Unused &4380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4390 44 00 00 00 66 00 00 00 ff 00 00 00 ff 88 00 00 &43a0 ff cc 00 00 df ee 77 8e df ee ff 8e 88 ff ee 02 &43b0 ff ff ee 02 77 bf ff 00 66 bf fc 88 66 33 f8 c4 &43c0 33 ff f8 c4 33 ff f8 c0 33 7f f8 c0 33 7f f8 c4 &43d0 33 ff f8 c4 33 ff fc 89 33 cc ff 03 33 bb ff 47 &43e0 33 77 ff ee 33 ff 77 cc 67 cc 33 88 67 88 00 00 &43f0 77 00 00 00 77 00 00 00 66 00 00 00 44 00 00 00 ; sprite_elf_up &4400 10 80 00 00 30 00 00 00 30 80 00 00 70 00 00 00 &4410 06 00 00 e0 06 10 00 60 0e 34 84 e0 0c 7c c6 60 &4420 0c 7c c6 06 0c f0 e1 06 0e f0 e1 06 0f f0 e1 06 &4430 0f f0 e1 06 17 f0 f1 0e 17 f0 f1 0e 17 78 d3 0e &4440 17 78 d3 0e 13 3c 97 0e 33 0f 1f 8e 33 8f 3f 8c &4450 33 ff ff 8c 33 ff ff 88 33 ff ff 88 77 77 ff 88 &4460 77 77 77 88 77 77 66 cc 66 ff 66 cc ee ff ff 44 &4470 ff ff ff ee 88 ff ff 22 00 77 ee 00 00 11 88 00 ; sprite_elf_down # Unused &4480 00 11 88 00 00 77 ee 00 88 ff ff 22 ff ff ff ee &4490 ee ff ff 44 66 ff 66 cc 77 77 66 cc 77 77 77 88 &44a0 77 77 ff 88 33 ff ff 88 33 ff ff 88 33 ff ff 8c &44b0 33 8f 3f 8c 33 0f 1f 8e 13 3c 97 0e 17 78 d3 0e &44c0 17 78 d3 0e 17 f0 f1 0e 17 f0 f1 0e 0f f0 e1 06 &44d0 0f f0 e1 06 0e f0 e1 06 0c f0 e1 06 0c 7c c6 06 &44e0 0c 7c c6 60 0e 34 84 e0 06 10 00 60 06 00 00 e0 &44f0 70 00 00 00 30 80 00 00 30 00 00 00 10 80 00 00 ; sprite_elf_left &4500 00 00 00 00 00 00 00 00 00 07 00 00 01 0f 08 00 &4510 03 0f 08 66 07 0f 0c ee e1 01 ff ee e0 77 ff aa &4520 a0 78 3f 22 81 f0 97 ee 01 f8 97 cc 01 f8 d3 cc &4530 12 f0 d3 cc 12 f0 d3 cc 30 f0 d3 44 12 f0 d3 ee &4540 12 f0 d3 ee 01 f8 d3 ee 01 f8 97 ee 01 f0 97 ff &4550 00 78 3f ff 00 77 ff 33 20 01 ff 99 20 81 1f dd &4560 30 0f 0e 66 30 0f 0e 00 30 0f 0c 00 00 00 00 00 &4570 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_elf_right &4580 00 00 00 00 00 00 00 00 00 00 0e 00 00 01 0f 08 &4590 66 01 0f 0c 77 03 0f 0e 77 ff 08 78 55 ff ee 70 &45a0 44 cf e1 50 77 9e f0 18 33 9e f1 08 33 bc f1 08 &45b0 33 bc f0 84 33 bc f0 84 22 bc f0 c0 77 bc f0 84 &45c0 77 bc f0 84 77 bc f1 08 77 9e f1 08 ff 9e f0 08 &45d0 ff cf e1 00 cc ff ee 00 99 ff 08 40 bb 8f 18 40 &45e0 66 07 0f c0 00 07 0f c0 00 03 0f c0 00 00 00 00 &45f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_elf_up_frame_two &4600 00 00 10 80 00 00 00 c0 00 00 10 c0 00 00 00 e0 &4610 70 00 00 06 60 00 80 06 70 12 c2 07 60 36 e3 03 &4620 06 36 e3 03 06 78 f0 03 06 78 f0 07 06 78 f0 0f &4630 06 78 f0 0f 07 f8 f0 8e 07 f8 f0 8e 07 bc e1 8e &4640 07 bc e1 8e 07 9e c3 8c 17 8f 0f cc 13 cf 1f cc &4650 13 ff ff cc 11 ff ff cc 11 ff ff cc 11 ff ee cc &4660 11 ee ee cc 33 66 ee ee 33 66 ff 66 22 ff ff 66 &4670 66 ff ff 22 77 cc 77 aa 77 00 11 ee ee 00 00 77 ; sprite_elf_treasure # Bag of money &4680 00 00 00 10 00 00 00 00 00 00 00 00 00 00 10 00 &4690 30 20 10 20 50 20 50 20 50 20 10 20 10 00 00 00 &46a0 10 b0 d0 f0 60 30 74 74 73 73 72 f4 74 f4 72 f1 &46b0 b0 f0 a1 d2 d2 87 d2 87 92 d2 43 d0 70 f0 30 00 &46c0 00 80 c0 e0 a0 00 88 88 80 80 88 c4 c4 e0 e0 b0 &46d0 d0 e0 68 a4 f0 f0 f0 f0 f0 78 a4 f0 f0 f0 c0 00 &46e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &46f0 80 80 80 c0 c0 e0 e0 60 60 60 c0 c0 80 00 00 00 ; sprite_elf_treasure_two # Unused - copy of bag of money &4700 00 00 00 10 00 00 00 00 00 00 00 00 00 00 10 00 &4710 30 20 10 20 50 20 50 20 50 20 10 20 10 00 00 00 &4720 10 b0 d0 f0 60 30 74 74 73 73 72 f4 74 f4 72 f1 &4730 b0 f0 a1 d2 d2 87 d2 87 92 d2 43 d0 70 f0 30 00 &4740 00 80 c0 e0 a0 00 88 88 80 80 88 c4 c4 e0 e0 b0 &4750 d0 e0 68 a4 f0 f0 f0 f0 f0 78 a4 f0 f0 f0 c0 00 &4760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4770 80 80 80 c0 c0 e0 e0 60 60 60 c0 c0 80 00 00 00 ; sprite_elf_right_frame_two # Unused &4780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &4790 00 00 00 00 00 03 0f c0 66 07 0f c0 77 07 0f c0 &47a0 33 8f 18 40 22 ff 08 40 22 77 ee 00 77 cf e1 00 &47b0 77 9e f0 08 ff 9e f1 08 ff bc f1 08 ff bc f0 84 &47c0 ff bc f0 84 cc bc f0 c0 ff bc f0 84 ff bc f0 84 &47d0 ff bc f1 08 77 9e f1 08 66 9e f0 18 44 cf e1 50 &47e0 55 ff ee 70 77 ff 08 78 77 03 0f 0e cc 01 0f 0c &47f0 88 01 0f 08 00 00 0e 00 00 00 00 00 00 00 00 00