Atic Atac disassembly ===================== Published by Ultimate Play the Game in 1983, Atic Atac was originally written by Chris and Tim Stamper for the ZX Spectrum, and was converted to the BBC Micro by David Rhys-Jones. It is a flip-screen adventure game that takes place in a castle, where the player must avoid enemies and collect pieces of a key. The following disassembly was created by reverse engineering binary images, without access to any source code. It is nevertheless reasonably complete, allowing the technical approaches used to be understood. The author of this disassembly imposes no additional copyright restrictions beyond those already present on the game itself. It is provided for educational purposes only, and it is hoped that the original authors will accept it in the good faith it was intended - as a tribute to their skills. Technical notes =============== A encrypted tape loader loads a loading screen and the main game binary from a stream. The main game binary is stored in non-sequential encrypted blocks. Code is copied from the OS ROM and then modified to change into MODE 2 without clearing the screen. The flashing colours are disabled to leave two sets of eight static colours. The top set of colours are used to indicate obstacles. The game has two separate sprite plotting routines. The first, used for moving sprites, can unplot and replot a sprite in a single call. The second, used for background sprites, can flip a sprite horizontally or vertically. Both allow sprites to be plotted using different palettes. Sprites are stored in a one bit per pixel format that encodes a square of four pixels in one nibble. A screenshot map may be found at: http://www.level7.org.uk/miscellany/atic-atac-map.png Interesting pokes ================= &3bc9 = &60 infinite energy &2f04 = &50 open locked doors without keys &2ed9 = &6f open ACG door without keys &2edf = &a9 use all passages, including statues &389e = &a9 temporary doors never close &400b = &60 no enemies Loader Disassembly ================== ; ATIC-ATAC ; 003b00 004222 00075a # &3b00 - &3cff moved to &0400 - 05ff at &3e1a ; font data &0400 40 a0 a0 e0 80 a0 40 00 ; "@" &0408 40 a0 a0 e0 a0 a0 a0 00 ; "A" &0410 c0 a0 a0 c0 a0 a0 c0 00 ; "B" &0418 60 c0 80 80 80 c0 60 00 : "C" &0420 c0 a0 a0 a0 a0 a0 c0 00 : "D" &0428 e0 80 80 e0 80 80 e0 00 : "E" &0430 e0 80 80 e0 80 80 80 00 : "F" &0438 e0 80 80 b0 90 90 f0 00 : "G" &0440 a0 a0 a0 e0 a0 a0 a0 00 : "H" &0448 e0 40 40 40 40 40 e0 00 : "I" &0450 e0 40 40 40 40 40 c0 00 : "J" &0458 a0 a0 a0 c0 a0 a0 a0 00 : "K" &0460 80 80 80 80 80 80 e0 00 : "L" &0468 a0 e0 e0 e0 a0 a0 a0 00 : "M" &0470 e0 a0 a0 a0 a0 a0 a0 00 : "N" &0478 40 a0 a0 a0 a0 a0 40 00 : "O" &0480 c0 a0 a0 c0 80 80 80 00 : "P" &0488 e0 a0 a0 e0 20 20 30 00 : "Q" &0490 c0 a0 a0 c0 a0 a0 a0 00 : "R" &0498 60 80 80 40 20 20 c0 00 : "S" &04a0 e0 40 40 40 40 40 40 00 : "T" &04a8 a0 a0 a0 a0 a0 a0 e0 00 : "U" &04b0 a0 a0 a0 a0 a0 a0 40 00 : "V" &04b8 a0 a0 a0 a0 e0 a0 40 00 : "W" &04c0 a0 a0 a0 40 a0 a0 a0 00 : "X" &04c8 a0 a0 a0 e0 40 40 40 00 : "Y" &04d0 e0 20 20 40 80 80 e0 00 : "Z" &04d8 e0 80 80 80 80 80 e0 00 : "[" &04e0 80 80 40 40 20 20 10 10 : "\" &04e8 e0 20 20 20 20 20 e0 00 : "]" &04f0 40 e0 a0 a0 00 00 00 00 : "^" &04f8 00 00 00 00 00 00 00 f0 : "_" ; custom_row_multiplication_table &0500 00 00 01 90 03 20 04 b0 06 40 07 d0 09 60 0a f0 &0510 0c 80 0e 10 0f a0 11 30 12 c0 14 50 15 e0 17 70 &0520 19 00 1a 90 1c 20 1d b0 1f 40 20 d0 22 60 23 f0 &0530 25 80 27 10 28 a0 2a 30 2b c0 2d 50 2e e0 30 70 &0540 32 00 33 90 35 20 36 b0 38 40 39 d0 3b 60 3c f0 &0550 3e 80 40 10 41 a0 43 30 44 c0 46 50 47 e0 49 70 &0560 4b 00 4c 90 4e 20 4f b0 51 40 52 d0 54 60 55 f0 &0570 57 80 59 10 5a a0 5c 30 5d c0 5f 50 60 e0 62 70 ; font data &0580 e0 a0 a0 a0 a0 a0 e0 00 ; "0" &0588 c0 40 40 40 40 40 e0 00 ; "1" &0590 e0 20 20 e0 80 80 e0 00 ; "2" &0598 e0 20 20 e0 20 20 e0 00 ; "3" &05a0 a0 a0 a0 e0 20 20 20 00 ; "4" &05a8 e0 80 80 e0 20 20 e0 00 ; "5" &05b0 e0 80 80 e0 a0 a0 e0 00 ; "6" &05b8 e0 20 20 20 20 20 20 00 ; "7" &05c0 e0 a0 a0 e0 a0 a0 e0 00 ; "8" &05c8 e0 a0 a0 e0 20 20 e0 00 ; "9" &05d0 00 00 40 40 00 40 40 00 ; ":" &05d8 00 00 20 20 00 20 20 40 ; ";" &05e0 10 20 40 80 40 20 10 00 ; "<" &05e8 00 00 e0 00 e0 00 00 00 ; "=" &05f0 80 40 20 10 20 40 80 00 ; ">" &05f8 e0 a0 20 60 40 00 40 00 ; "?" ; event_handler # Called for RS423 events &3d00 8a TXA &3d01 29 02 AND #&02 # Is this a receiver interrupt? &3d03 f0 02 BEQ &3d07 ; leave &3d05 85 04 STA &04 ; receiver_interrupt ; leave &3d07 60 RTS ; start_tape_and_wait_for_data &3d08 a9 15 LDA #&15 ; Flush buffer &3d0a a2 01 LDX #&01 ; Serial input &3d0c 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d0f a9 89 LDA #&89 ; Control cassette motor &3d11 a2 00 LDX #&00 ; off &3d13 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d16 a2 01 LDX #&01 ; on &3d18 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d1b a9 00 LDA #&00 &3d1d 85 04 STA &04 ; receiver_interrupt ; wait_for_receiver_interrupt &3d1f a5 04 LDA &04 ; receiver_interrupt &3d21 f0 fc BEQ &3d1f ; wait_for_receiver_interrupt &3d23 a9 02 LDA #&02 ; Select input stream &3d25 a2 01 LDX #&01 ; Use the serial circuit for input &3d27 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d2a a2 01 LDX #&01 # Set to 1200 baud &3d2c 20 8f 3d JSR &3d8f ; write_low_two_bits_of_acia_register ; wait_for_input_loop &3d2f a9 81 LDA #&81 ; Wait for keypress # Wait for data from the tape &3d31 a2 00 LDX #&00 &3d33 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d36 b0 f7 BCS &3d2f ; wait_for_input_loop &3d38 e0 2a CPX #&2a ; "*" &3d3a d0 f3 BNE &3d2f ; wait_for_input_loop &3d3c 60 RTS ; stop_tape_and_restore_keyboard_input &3d3d a9 02 LDA #&02 ; Select input stream &3d3f a2 00 LDX #&00 ; Use the keyboard for input &3d41 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d44 a9 89 LDA #&89 ; Control cassette motor &3d46 a2 00 LDX #&00 ; off &3d48 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d4b a9 0d LDA #&0d ; Disable event &3d4d a2 07 LDX #&07 ; RS423 error &3d4f 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3d52 a2 02 LDX #&02 # Set to 300 baud &3d54 20 8f 3d JSR &3d8f ; write_low_two_bits_of_acia_register &3d57 a9 cd LDA #&cd ; Read/Write RS423 destination &3d59 a2 00 LDX #&00 ; Use RS423 port &3d5b 4c 8a 3d JMP &3d8a ; osbyte_with_zero_y ; write_filename_and_block_count &3d5e a0 01 LDY #&01 ; write_filename_loop &3d60 b9 1a 00 LDA &001a,Y ; header &3d63 d9 79 07 CMP &0779,Y ; expected_filename &3d66 f0 02 BEQ &3d6a ; character_ok &3d68 a9 3f LDA #&3f ; "?" ; character_ok &3d6a 20 ee ff JSR &ffee ; OSWRCH &3d6d c8 INY &3d6e c0 05 CPY #&05 &3d70 d0 ee BNE &3d60 ; write_filename_loop &3d72 a5 28 LDA &28 ; header + 14 ; block_number &3d74 4a LSR A &3d75 4a LSR A &3d76 4a LSR A &3d77 4a LSR A &3d78 20 7d 3d JSR &3d7d ; write_hexadecimal_digit &3d7b a5 28 LDA &28 ; header + 14 ; block_number ; write_hexadecimal_digit &3d7d 29 0f AND #&0f &3d7f c9 0a CMP #&0a &3d81 90 02 BCC &3d85 ; is_number &3d83 69 06 ADC #&06 ; is_number &3d85 69 30 ADC #&30 &3d87 4c ee ff JMP &ffee ; OSWRCH ; osbyte_with_zero_y &3d8a a0 00 LDY #&00 &3d8c 4c f4 ff JMP &fff4 ; OSBYTE ; write_low_two_bits_of_acia_register &3d8f a9 9c LDA #&9c ; Read/write 6850 ACIA control register &3d91 a0 fc LDY #&fc &3d93 4c f4 ff JMP &fff4 ; OSBYTE # Set OS variables: # &0259 = &ff ; Econet keyboard disable # &0258 = &03 ; ESCAPE/BREAK effect # &0275 = &ff ; ESCAPE key status # &0276 = &ff ; ESCAPE effect flag # &0262 = &00 ; Sound suppression status # &024e = &00 ; ADC conversion type ; os_variable_offsets &3d96 c9 c8 e5 e6 d2 be ; + 0190 = 259, 258, 275, 276, 262, 24e ; os_variable_values &3d9c ff 03 ff ff 00 00 ; atic_atac_is_loading_text &3da2 1f 0a 0c 87 41 74 69 63 20 41 74 61 63 20 69 73 ; TAB(10, 12); FOREGROUND_TEXT_WHITE, "Atic Atac is loading", &3db2 20 6c 6f 61 64 69 6e 67 91 0d ; FOREGROUND_GRAPHICS_RED ; block_text &3dbc 1f 0e 0e 86 42 6c 6f 63 6b 83 ; TAB(14, 14); FOREGROUND_TEXT_CYAN, "Block", FOREGROUND_TEXT_YELLOW # Set video registers: # &01 = &32 ; R1: Number of characters per line # 100 pixels per line # &02 = &52 ; R2: Horizontal sync position register # &0c = &01 ; R12: Displayed screen start address register (high) # &0d = &60 ; R13: Displayed screen start address register (low) # Set screen start address to &b00 ; video_register_numbers &3dc6 01 02 0c 0d ; video_register_values &3dca 32 52 01 60 ; loading_screen_text &3dce 03 ; Stop printing &3dcf 1c 03 18 08 16 ; Define text window x(&03, &08), y(&16, &18) &3dd4 11 84 ; Blue background &3dd5 0a 0a ; Newlines &3dd8 00 # Set OS VDU variables: # &0367 = &fe ; Font flag # Use custom half-width font at &400 and &580 # &0368 = &05 ; Font location byte 0 # &0369 = &04 ; Font location byte 1 # &036a = &04 ; Font location byte 2 # &034f = &10 ; Number of bytes per character # Characters are half standard width # &0350 = &00 ; Address of top-left of screen (low) # &0351 = &0b ; Address of top-left of screen (high) # &0352 = &90 ; Number of bytes per line (low) # &0353 = &01 ; Number of bytes per line (high) ; vdu_variables_offsets &3dd9 67 68 69 6a 4f 50 51 52 53 ; vdu_variables_values &3de2 fe 05 04 04 10 00 0b 90 01 ; decrypted_entry_point &3deb 78 SEI &3dec a2 0f LDX #&0f &3dee a9 00 LDA #&00 ; remove_roms_loop &3df0 9d a1 02 STA &02a1,X ; os_paged_rom_type_table # Remove paged ROMs from ROM information table &3df3 ca DEX &3df4 10 fa BPL &3df0 ; remove_roms_loop &3df6 a2 35 LDX #&35 ; reset_vector_table_loop &3df8 bd 40 d9 LDA &d940,X ; os_default_vector_table &3dfb 9d 00 02 STA &0200,X ; os_vector_table &3dfe ca DEX &3dff 10 f7 BPL &3df8 ; reset_vector_table_loop &3e01 a2 05 LDX #&05 ; set_os_variables_loop &3e03 bc 96 3d LDY &3d96,X ; os_variable_offsets &3e06 bd 9c 3d LDA &3d9c,X ; os_variable_values &3e09 99 90 01 STA &0190,Y ; &0200 - &70 &3e0c ca DEX &3e0d 10 f4 BPL &3e03 ; set_os_variables_loop &3e0f a9 7c LDA #&7c ; Clear ESCAPE condition &3e11 a2 00 LDX #&00 &3e13 a0 00 LDY #&00 &3e15 20 f4 ff JSR &fff4 ; OSBYTE ; move_memory &3e18 a2 00 LDX #&00 ; move_memory_loop &3e1a bd 00 3b LDA &3b00,X # Move &3b00 - &3cff to &0400 - &05ff &3e1d 9d 00 04 STA &0400,X &3e20 bd 00 3c LDA &3c00,X &3e23 9d 00 05 STA &0500,X &3e26 bd 8d 40 LDA &408d,X # Move &408d - &428c to &0600 - &07ff &3e29 9d 00 06 STA &0600,X &3e2c bd 8d 41 LDA &418d,X &3e2f 9d 00 07 STA &0700,X &3e32 ca DEX &3e33 d0 e5 BNE &3e1a ; move_memory_loop &3e35 a9 16 LDA #&16 # MODE 7 &3e37 20 ee ff JSR &ffee ; OSWRCH &3e3a a9 07 LDA #&07 &3e3c 20 ee ff JSR &ffee ; OSWRCH &3e3f 20 19 40 JSR &4019 ; initialise_screen_and_interrupt_handler # Fill screen with red blank graphics, start routine &3e42 a2 00 LDX #&00 &3e44 86 05 STX &05 ; load_address_low ; write_atic_atac_is_loading_text_loop &3e46 bd a2 3d LDA &3da2,X ; atic_atac_is_loading_text &3e49 20 ee ff JSR &ffee ; OSWRCH &3e4c e8 INX &3e4d c9 0d CMP #&0d &3e4f d0 f5 BNE &3e46 ; write_atic_atac_is_loading_text_loop &3e51 20 15 3f JSR &3f15 ; initialise_event_vector_and_tape &3e54 a9 0b LDA #&0b # Start loading at &0b00 &3e56 85 06 STA &06 ; load_address_high &3e58 20 08 3d JSR &3d08 ; start_tape_and_wait_for_data &3e5b 20 40 06 JSR &0640 ; play_sound &3e5e a2 00 LDX #&00 &3e60 86 0e STX &0e ; blocks_loaded_as_number ; wait_for_start_of_actual_data &3e62 20 e0 ff JSR &ffe0 ; OSRDCH &3e65 c9 2a CMP #&2a ; "*" &3e67 d0 07 BNE &3e70 ; data_received &3e69 e8 INX &3e6a 4c 62 3e JMP &3e62 ; wait_for_start_of_actual_data ; reset_system &3e6d 6c fc ff JMP (&fffc) ; break_vector ; data_received &3e70 8d 00 0b STA &0b00 # Store first byte of loading screen at &0b00 &3e73 e0 40 CPX #&40 &3e75 90 eb BCC &3e62 ; wait_for_start_of_actual_data &3e77 e0 a0 CPX #&a0 &3e79 90 f2 BCC &3e6d ; reset_system &3e7b a0 01 LDY #&01 ; read_block_of_loading_screen_loop &3e7d 20 e0 ff JSR &ffe0 ; OSRDCH # Get byte from tape &3e80 91 05 STA (&05),Y ; load_address # Write to memory, continuing from &0b01 &3e82 c8 INY &3e83 d0 f8 BNE &3e7d ; read_block_of_loading_screen_loop &3e85 a2 00 LDX #&00 ; write_block_text_loop &3e87 bd bc 3d LDA &3dbc,X ; block_text # TAB(14,14) and write "Block" &3e8a 20 ee ff JSR &ffee ; OSWRCH &3e8d e8 INX &3e8e c9 83 CMP #&83 ; FOREGROUND_TEXT_YELLOW &3e90 d0 f5 BNE &3e87 ; write_block_text_loop &3e92 a5 0e LDA &0e ; blocks_loaded_as_number # Write block number &3e94 4a LSR A &3e95 4a LSR A &3e96 4a LSR A &3e97 4a LSR A &3e98 20 7d 3d JSR &3d7d ; write_hexadecimal_digit # Actually decimal digit &3e9b a5 0e LDA &0e ; blocks_loaded_as_number &3e9d 20 7d 3d JSR &3d7d ; write_hexadecimal_digit # Actually decimal digit &3ea0 a9 91 LDA #&91 ; FOREGROUND_GRAPHICS_RED &3ea2 20 ee ff JSR &ffee ; OSWRCH &3ea5 f8 SED &3ea6 a5 0e LDA &0e ; blocks_loaded_as_number &3ea8 18 CLC &3ea9 69 01 ADC #&01 &3eab 85 0e STA &0e ; blocks_loaded_as_number &3ead d8 CLD &3eae e6 06 INC &06 ; load_address_high &3eb0 a5 06 LDA &06 ; load_address_high &3eb2 c9 3d CMP #&3d # Stop loading at &3d00 &3eb4 90 c7 BCC &3e7d ; read_block_of_loading_screen_loop &3eb6 20 40 06 JSR &0640 ; play_sound &3eb9 a9 40 LDA #&40 # Disable User VIA timer 1 &3ebb 8d 6e fe STA &fe6e ; User VIA interrupt enable register ; copy_os_mode_changing_code &3ebe a2 f2 LDX #&f2 ; copy_os_mode_changing_code_loop # Copy &cb1d - &cc0e to &6b1d - &6c0e &3ec0 bd 1c cb LDA &cb1c,X ; os_rom_set_mode - 1 &3ec3 9d 1c 6b STA &6b1c,X ; set_mode - 1 &3ec6 ca DEX &3ec7 d0 f7 BNE &3ec0 ; copy_os_mode_changing_code_loop &3ec9 a9 60 LDA #&60 ; RTS # Remove final jump to video vector &3ecb 8d f0 6b STA &6bf0 ; set_mode + &d4 # (which would clear screen memory) &3ece a9 02 LDA #&02 # Change to MODE 2 without clearing screen memory &3ed0 20 1d 6b JSR &6b1d ; set_mode &3ed3 a9 09 LDA #&09 # Unnecessary code, and wrong too &3ed5 8d 51 03 STA &0351 ; os_screen_start_address_high # &0351 is set to &0b in the VDU variables at &3efd &3ed8 a2 03 LDX #&03 ; set_video_registers_loop &3eda bd c6 3d LDA &3dc6,X ; video_register_numbers # Set screen start address to &0b00, 100 pixels wide &3edd 8d 00 fe STA &fe00 ; video register number &3ee0 bd ca 3d LDA &3dca,X ; video_register_values &3ee3 8d 01 fe STA &fe01 ; video register value &3ee6 ca DEX &3ee7 10 f1 BPL &3eda ; set_video_registers_loop &3ee9 58 CLI &3eea a9 9a LDA #&9a ; Write to video ULA control register and RAM copy &3eec a2 d4 LDX #&d4 # MODE 2 is usually &f4, this sets a half-sized cursor &3eee 20 f4 ff JSR &fff4 ; OSBYTE &3ef1 a9 05 LDA #&05 ; &0500 = custom_row_multiplication_table &3ef3 85 e1 STA &e1 ; os_row_multiplication_table_high &3ef5 a2 08 LDX #&08 ; set_vdu_variables_loop &3ef7 bc d9 3d LDY &3dd9,X ; vdu_variables_offsets &3efa bd e2 3d LDA &3de2,X ; vdu_variables_values &3efd 99 00 03 STA &0300,Y ; os_vdu_variables &3f00 ca DEX &3f01 10 f4 BPL &3ef7 ; set_vdu_variables_loop &3f03 a2 00 LDX #&00 &3f05 86 e0 STX &e0 ; os_row_multiplication_table_low ; write_loading_screen_text_loop &3f07 bd ce 3d LDA &3dce,X ; loading_screen_text &3f0a 20 ee ff JSR &ffee ; OSWRCH &3f0d e8 INX &3f0e c9 00 CMP #&00 &3f10 d0 f5 BNE &3f07 ; write_loading_screen_text_loop &3f12 4c 57 06 JMP &0657 ; load_main_binary ; initialise_event_vector_and_tape &3f15 78 SEI &3f16 a9 00 LDA #&00 &3f18 8d 20 02 STA &0220 ; event_vector_low &3f1b a9 3d LDA #&3d ; &3d00 = event_handler &3f1d 8d 21 02 STA &0221 ; event_vector_high &3f20 58 CLI &3f21 a9 0e LDA #&0e ; Enable event &3f23 a2 07 LDX #&07 ; RS423 error &3f25 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3f28 a9 cd LDA #&cd ; Read/Write RS423 destination &3f2a a2 40 LDX #&40 ; Use cassette &3f2c 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3f2f a9 07 LDA #&07 ; Set RS423 receive rate &3f31 a2 03 LDX #&03 ; 300 baud &3f33 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3f36 a9 08 LDA #&08 ; Set RS423 transmit rate &3f38 a2 03 LDX #&03 ; 300 baud &3f3a 20 8a 3d JSR &3d8a ; osbyte_with_zero_y &3f3d a2 03 LDX #&03 # Reset ACIA &3f3f 20 8f 3d JSR &3d8f ; write_low_two_bits_of_acia_register &3f42 a2 02 LDX #&02 # Set to 300 baud &3f44 4c 8f 3d JMP &3d8f ; write_low_two_bits_of_acia_register ; teletext_pixel_table &3f47 01 02 04 08 10 40 ; update_pixel &3f4d bd 00 7a LDA &7a00,X ; pixels_state # 0 if plotted, 1 if on character, &ff if not active &3f50 d0 19 BNE &3f6b ; skip_unplot # Does this pixel need unplotting? &3f52 bd 80 7a LDA &7a80,X ; pixels_address_low &3f55 85 0f STA &0f ; screen_address_low &3f57 bd 00 7b LDA &7b00,X ; pixels_address_high &3f5a 85 10 STA &10 ; screen_address_high &3f5c bc 80 7b LDY &7b80,X ; pixels_position &3f5f b9 47 3f LDA &3f47,Y ; teletext_pixel_table &3f62 a0 00 LDY #&00 &3f64 51 0f EOR (&0f),Y ; screen_address # Unplot pixel &3f66 91 0f STA (&0f),Y ; screen_address &3f68 bd 00 7a LDA &7a00,X ; pixels_state ; skip_unplot &3f6b 30 4b BMI &3fb8 ; leave # Is there a pixel in this slot? If not leave? &3f6d bd 80 7b LDA &7b80,X ; pixels_position &3f70 18 CLC &3f71 69 02 ADC #&02 # Move pixel down one third of a character &3f73 c9 06 CMP #&06 &3f75 9d 80 7b STA &7b80,X ; pixels_position &3f78 90 17 BCC &3f91 ; same_character # Is it in the same character? &3f7a 29 01 AND #&01 &3f7c 9d 80 7b STA &7b80,X ; pixels_position &3f7f bd 80 7a LDA &7a80,X ; pixels_address_low &3f82 69 27 ADC #&27 # If not, move it down a character &3f84 9d 80 7a STA &7a80,X ; pixels_address_low &3f87 bd 00 7b LDA &7b00,X ; pixels_address_high &3f8a 69 00 ADC #&00 &3f8c 9d 00 7b STA &7b00,X ; pixels_address_high &3f8f 30 24 BMI &3fb5 ; store_pixel_state # Remove the pixel at the bottom of the screen ; same_character &3f91 bd 80 7a LDA &7a80,X ; pixels_address_low &3f94 85 0f STA &0f ; screen_address_low &3f96 bd 00 7b LDA &7b00,X ; pixels_address_high &3f99 85 10 STA &10 ; screen_address_high &3f9b a0 00 LDY #&00 &3f9d b1 0f LDA (&0f),Y ; screen_address &3f9f c9 a0 CMP #&a0 &3fa1 90 16 BCC &3fb9 ; character_occupied # Is the character occupied by text? &3fa3 bc 80 7b LDY &7b80,X ; pixels_position &3fa6 39 47 3f AND &3f47,Y ; teletext_pixel_table &3fa9 d0 0e BNE &3fb9 ; character_occupied # Is there already a pixel in this position? &3fab b9 47 3f LDA &3f47,Y ; teletext_pixel_table &3fae a0 00 LDY #&00 &3fb0 51 0f EOR (&0f),Y ; screen_address # If not, plot the pixel &3fb2 91 0f STA (&0f),Y ; screen_address &3fb4 98 TYA ; store_pixel_state &3fb5 9d 00 7a STA &7a00,X ; pixels_state ; leave &3fb8 60 RTS ; character_occupied &3fb9 a9 01 LDA #&01 # Mark the pixel as not needing unplotting &3fbb 9d 00 7a STA &7a00,X ; pixels_state &3fbe 60 RTS ; rnd &3fbf a5 15 LDA &15 ; rnd_1 &3fc1 29 48 AND #&48 &3fc3 69 38 ADC #&38 &3fc5 0a ASL A &3fc6 0a ASL A &3fc7 26 17 ROL &17 ; rnd_2 &3fc9 26 16 ROL &16 ; rnd_2 &3fcb 26 15 ROL &15 ; rnd_1 &3fcd a5 15 LDA &15 ; rnd_1 &3fcf 60 RTS ; irq2_handler &3fd0 86 18 STX &18 ; irq_x &3fd2 84 19 STY &19 ; irq_y &3fd4 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB ; update_next_pixel &3fd7 c6 13 DEC &13 ; pixel_to_update &3fd9 30 0c BMI &3fe7 ; reset_pixel &3fdb a6 13 LDX &13 ; pixel_to_update &3fdd 20 4d 3f JSR &3f4d ; update_pixel &3fe0 a4 19 LDY &19 ; irq_y &3fe2 a6 18 LDX &18 ; irq_x &3fe4 a5 fc LDA &fc ; irq_accumulator &3fe6 40 RTI ; reset_pixel &3fe7 a5 12 LDA &12 ; number_of_pixels &3fe9 85 13 STA &13 ; pixel_to_update ; reset_next_pixel &3feb c6 14 DEC &14 ; pixel_to_reset &3fed 10 04 BPL &3ff3 ; skip_wraparound &3fef 85 14 STA &14 ; pixel_to_reset &3ff1 30 f8 BMI &3feb ; reset_next_pixel ; skip_wraparound &3ff3 a6 14 LDX &14 ; pixel_to_reset &3ff5 a9 7c LDA #&7c &3ff7 9d 00 7b STA &7b00,X ; pixels_address_high # Move the pixel to the top of the screen &3ffa 9d 00 7a STA &7a00,X ; pixels_state # Mark the pixel as not needing unplotting &3ffd 20 bf 3f JSR &3fbf ; rnd &4000 29 1f AND #&1f &4002 85 11 STA &11 ; x &4004 20 bf 3f JSR &3fbf ; rnd &4007 29 07 AND #&07 &4009 38 SEC &400a 65 11 ADC &11 ; x &400c 9d 80 7a STA &7a80,X ; pixels_address_low # Set a random x position between &00 and &27 &400f a5 16 LDA &16 ; rnd_2 &4011 29 01 AND #&01 &4013 9d 80 7b STA &7b80,X ; pixels_position # Set a random x position within the character &4016 4c d7 3f JMP &3fd7 ; update_next_pixel ; initialise_screen_and_interrupt_handler &4019 a9 40 LDA #&40 # Disable User VIA timer 1 interrupts &401b 8d 6e fe STA &fe6e ; User VIA interrupt enable register &401e 78 SEI &401f a0 00 LDY #&00 &4021 a9 a0 LDA #&a0 ; GRAPHICS_BASE ; wipe_screen_loop &4023 99 00 7c STA &7c00,Y ; screen_memory &4026 99 00 7d STA &7d00,Y ; screen_memory + &100 &4029 99 00 7e STA &7e00,Y ; screen_memory + &200 &402c 99 00 7f STA &7f00,Y ; screen_memory + &300 &402f 88 DEY &4030 d0 f1 BNE &4023 ; wipe_screen_loop &4032 84 0f STY &0f ; screen_address_low &4034 a9 7c LDA #&7c ; &7c00 &4036 85 10 STA &10 ; screen_address_high ; write_graphics_red_loop &4038 a9 91 LDA #&91 ; FOREGROUND_GRAPHICS_RED # Put FOREGROUND_GRAPHICS_RED on first row of column &403a 91 0f STA (&0f),Y ; screen_address &403c 98 TYA &403d 18 CLC &403e 69 28 ADC #&28 # Move down to next column &4040 a8 TAY &4041 90 f5 BCC &4038 ; write_graphics_red_loop &4043 e6 10 INC &10 ; screen_address_high &4045 10 f1 BPL &4038 ; write_graphics_red_loop # Repeat until end of screen memory &4047 a9 43 LDA #&43 &4049 85 15 STA &15 ; rnd_1 &404b a9 57 LDA #&57 &404d 85 16 STA &16 ; rnd_2 &404f a9 e7 LDA #&e7 &4051 85 17 STA &17 ; rnd_3 &4053 a9 50 LDA #&50 &4055 85 12 STA &12 ; number_of_pixels &4057 a9 01 LDA #&01 &4059 85 13 STA &13 ; pixel_to_update &405b 85 14 STA &14 ; pixel_to_reset &405d a6 12 LDX &12 ; number_of_pixels &405f a9 ff LDA #&ff ; initialise_pixels_state_loop &4061 9d 00 7a STA &7a00,X ; pixels_state &4064 ca DEX &4065 10 fa BPL &4061 ; initialise_pixels_state_loop &4067 a9 40 LDA #&40 # Set User VIA timer 1 to generate repeated interrupts &4069 0d 6b fe ORA &fe6b ; User VIA auxiliary control register &406c 8d 6b fe STA &fe6b ; User VIA auxiliary control register &406f a9 c0 LDA #&c0 &4071 8d 6d fe STA &fe6d ; User VIA interrupt flag register # Clear User VIA timer 1 timeout interrupt &4074 8d 6e fe STA &fe6e ; User VIA interrupt control register # Enable User VIA timer 1 interrupts &4077 a9 e4 LDA #&e4 &4079 8d 64 fe STA &fe64 ; User VIA timer 1 counter LSB &407c a9 03 LDA #&03 &407e 8d 65 fe STA &fe65 ; User VIA timer 1 counter MSB &4081 a9 d0 LDA #&d0 &4083 8d 06 02 STA &0206 ; irq2_vector_low &4086 a9 3f LDA #&3f ; &3fd0 = irq2_handler &4088 8d 07 02 STA &0207 ; irq2_vector_high &408b 58 CLI &408c 60 RTS # &408d - &428c gets relocated to &0600 - &07ff at &3e1a ; write_byte_to_sound_chip &0600 48 PHA &0601 a9 ff LDA #&ff # Set all bits to output &0603 8d 43 fe STA &fe43 ; System VIA data direction register A &0606 68 PLA # Push A to output register &0607 8d 41 fe STA &fe41 ; System VIA output register A &060a a9 00 LDA #&00 # Set sound chip write pin low &060c 8d 40 fe STA &fe40 ; System VIA port B input/output register &060f 48 PHA &0610 68 PLA &0611 48 PHA &0612 68 PLA &0613 a9 08 LDA #&08 # Set sound chip write pin high &0615 8d 40 fe STA &fe40 ; System VIA port B input/output register &0618 60 RTS ; write_byte_to_sound_chip_without_interrupts &0619 78 SEI &061a 20 00 06 JSR &0600 ; write_byte_to_sound_chip &061d 58 CLI &061e 60 RTS ; set_channel3_pitch &061f 78 SEI &0620 85 0c STA &0c ; pitch &0622 29 03 AND #&03 &0624 0a ASL A &0625 0a ASL A &0626 09 80 ORA #&80 # Set channel 3 pitch, low bits &0628 20 00 06 JSR &0600 ; write_byte_to_sound_chip &062b a5 0c LDA &0c ; pitch &062d 4a LSR A &062e 4a LSR A &062f 20 00 06 JSR &0600 ; write_byte_to_sound_chip # Set channel 3 pitch, high bits &0632 58 CLI &0633 60 RTS ; play_rising_sound &0634 a0 01 LDY #&01 ; play_rising_sound_loop &0636 98 TYA &0637 20 1f 06 JSR &061f ; set_channel3_pitch &063a c8 INY &063b c4 0d CPY &0d ; maximum_pitch &063d 90 f7 BCC &0636 ; play_rising_sound_loop &063f 60 RTS ; play_sound &0640 a9 90 LDA #&90 # Set channel 3 volume to 15, maximum &0642 20 19 06 JSR &0619 ; write_byte_to_sound_chip_without_interrupts &0645 a9 78 LDA #&78 &0647 85 0d STA &0d ; maximum_pitch ; play_sound_loop &0649 a5 0d LDA &0d ; maximum_pitch &064b 20 34 06 JSR &0634 ; play_rising_sound &064e c6 0d DEC &0d ; maximum_pitch &0650 d0 f7 BNE &0649 ; play_sound_loop &0652 a9 9f LDA #&9f # Set channel 3 volume to 0, mute &0654 4c 19 06 JMP &0619 ; write_byte_to_sound_chip_without_interrupts ; load_main_binary &0657 a9 01 LDA #&01 &0659 85 00 STA &00 ; waiting_for_start_of_data &065b a9 2a LDA #&2a ; "*" &065d 85 1a STA &1a ; header &065f a9 00 LDA #&00 &0661 85 08 STA &08 ; blocks_loaded ; load_main_binary_loop &0663 20 08 3d JSR &3d08 ; start_tape_and_wait_for_data &0666 a0 01 LDY #&01 ; read_header &0668 20 e0 ff JSR &ffe0 ; OSRDCH # Check for eight bytes of filename as header &066b c0 08 CPY #&08 &066d b0 05 BCS &0674 ; after_filename &066f d9 79 07 CMP &0779,Y ; expected_filename &0672 d0 ef BNE &0663 ; load_main_binary_loop ; after_filename &0674 99 1a 00 STA &001a,Y ; header # Store another 17 bytes of header into &22 - &32 &0677 c8 INY &0678 c0 19 CPY #&19 &067a 90 ec BCC &0668 ; read_header &067c a2 1a LDX #&1a &067e a0 00 LDY #&00 ; &001a = header &0680 a9 17 LDA #&17 &0682 20 f5 06 JSR &06f5 ; decrypt_A_bytes_at_X_Y # Header data, but not filename, is encrypted &0685 a2 01 LDX #&01 ; "HEADER" &0687 a5 02 LDA &02 ; cypher_low &0689 c5 31 CMP &31 ; header + 23 &068b d0 2d BNE &06ba ; write_error &068d a5 03 LDA &03 ; cypher_high &068f c5 32 CMP &32 ; header + 24 &0691 d0 27 BNE &06ba ; write_error &0693 a2 00 LDX #&00 ; "BLOCK?" &0695 a5 28 LDA &28 ; header + 14 ; block_number &0697 c5 08 CMP &08 ; blocks_loaded &0699 d0 1f BNE &06ba ; write_error &069b 20 27 07 JSR &0727 ; load_and_decrypt_block # Returns equal set if ok &069e d0 1a BNE &06ba ; write_error &06a0 a9 00 LDA #&00 &06a2 85 00 STA &00 ; waiting_for_start_of_data &06a4 a2 04 LDX #&04 ; "LOADIN" &06a6 20 db 06 JSR &06db ; write_string &06a9 20 5e 3d JSR &3d5e ; write_filename_and_block_count &06ac e6 08 INC &08 ; blocks_loaded &06ae a5 08 LDA &08 ; blocks_loaded &06b0 c9 42 CMP #&42 # Main binary loaded at &3e80 - &7fff, non-sequentially &06b2 d0 af BNE &0663 ; load_main_binary_loop &06b4 20 3d 3d JSR &3d3d ; stop_tape_and_restore_keyboard_input &06b7 6c 2f 00 JMP (&002f) ; header + 15 # Run loaded code ; write_error &06ba 86 01 STX &01 ; error_number &06bc 20 5e 3d JSR &3d5e ; write_filename_and_block_count &06bf a5 00 LDA &00 ; waiting_for_start_of_data &06c1 d0 0e BNE &06d1 ; not_started_loading_data &06c3 e6 00 INC &00 ; waiting_for_start_of_data &06c5 a2 03 LDX #&03 ; "REWIND" &06c7 20 db 06 JSR &06db ; write_string &06ca 20 40 06 JSR &0640 ; play_sound &06cd a6 01 LDX &01 ; error_number &06cf f0 04 BEQ &06d5 ; write_error_and_restart_load # Branches if unexpected block ; not_started_loading_data &06d1 a6 01 LDX &01 ; error_number &06d3 f0 03 BEQ &06d8 ; to_restart_load ; write_error_and_restart_load &06d5 20 db 06 JSR &06db ; write_string ; to_restart_load &06d8 4c 63 06 JMP &0663 ; load_main_binary_loop ; write_string &06db a0 00 LDY #&00 ; find_string &06dd b9 55 07 LDA &0755,Y ; string &06e0 d0 03 BNE &06e5 ; not_end_of_strings &06e2 ca DEX &06e3 30 03 BMI &06e8 ; found_string ; not_end_of_strings &06e5 c8 INY &06e6 d0 f5 BNE &06dd ; find_string ; found_string &06e8 b9 56 07 LDA &0756,Y ; strings + 1 &06eb f0 07 BEQ &06f4 ; leave &06ed 20 ee ff JSR &ffee ; OSWRCH &06f0 c8 INY &06f1 4c e8 06 JMP &06e8 ; found_string &06f4 60 RTS ; decrypt_A_bytes_at_X_Y &06f5 86 05 STX &05 ; address_low &06f7 84 06 STY &06 ; address_high &06f9 85 07 STA &07 ; length &06fb a0 00 LDY #&00 &06fd 84 03 STY &03 ; cypher_high &06ff 84 02 STY &02 ; cypher_low ; decrypt_A_bytes_at_X_Y_loop &0701 a5 03 LDA &03 ; cypher_high &0703 51 05 EOR (&05),Y ; address &0705 85 03 STA &03 ; cypher_high &0707 a2 08 LDX #&08 ; shift_cypher_loop &0709 a5 03 LDA &03 ; cypher_high &070b 2a ROL A &070c 90 0c BCC &071a &070e a5 02 LDA &02 ; cypher_low &0710 49 10 EOR #&10 &0712 85 02 STA &02 ; cypher_low &0714 a5 03 LDA &03 ; cypher_high &0716 49 08 EOR #&08 &0718 85 03 STA &03 ; cypher_high &071a 26 02 ROL &02 ; cypher_low &071c 26 03 ROL &03 ; cypher_high &071e ca DEX &071f d0 e8 BNE &0709 ; shift_cypher_loop &0721 c8 INY &0722 c4 07 CPY &07 ; length &0724 d0 db BNE &0701 ; decrypt_A_bytes_at_X_Y_loop &0726 60 RTS ; load_and_decrypt_block &0727 a5 22 LDA &22 ; header + 8 &0729 05 2d ORA &2d ; header + 19 &072b 85 09 STA &09 ; address_low &072d a5 23 LDA &23 ; header + 20 &072f 05 2e ORA &2e ; second_or_high &0731 85 0a STA &0a ; address_high &0733 a0 00 LDY #&00 ; load_and_decrypt_block_loop # Read block of 256 bytes &0735 20 e0 ff JSR &ffe0 ; OSRDCH &0738 91 09 STA (&09),Y ; address &073a c8 INY &073b d0 f8 BNE &0735 ; read_and_decrypt_block_loop &073d a6 09 LDX &09 ; address_low &073f a4 0a LDY &0a ; address_high &0741 a9 00 LDA #&00 # Decrypt 256 bytes &0743 20 f5 06 JSR &06f5 ; decrypt_A_bytes_at_X_Y &0746 20 e0 ff JSR &ffe0 ; OSRDCH # Read two check bytes &0749 a2 02 LDX #&02 ; "DATA??" &074b c5 02 CMP &02 ; cypher_low &074d d0 05 BNE &0754 ; leave &074f 20 e0 ff JSR &ffe0 ; OSRDCH &0752 c5 03 CMP &03 ; cypher_high ; leave &0754 60 RTS ; strings &0755 00 &0756 42 4c 4f 43 4b 3f 00 ; &00: "BLOCK?" &075d 48 45 41 44 45 52 00 ; &01: "HEADER" &0764 44 41 54 41 3f 3f 00 ; &02: "DATA??" &076b 52 45 57 49 4e 44 00 ; &03: "REWIND" &0772 4c 4f 41 44 49 4e 00 ; &04: "LOADIN" ; expected_filename &0779 2a 41 54 49 43 00 ff ff ; "*ATIC" ; unused &0781 00 00 ; get_cypher_byte # Pseudo-random number stream used for encryption &4210 a5 00 LDA &00 ; cypher_0 &4212 29 48 AND #&48 &4214 69 38 ADC #&38 &4216 0a ASL A &4217 0a ASL A ; sei_instruction &4218 78 SEI &4219 26 02 ROL &02 ; cypher_2 &421b 26 01 ROL &01 ; cypher_1 &421d 26 00 ROL &00 ; cypher_0 &421f a5 00 LDA &00 ; cypher_0 &4221 60 RTS ; entry_point &4222 78 SEI # Disable interrupts &4223 ad 18 42 LDA &4218 ; sei_instruction # Ensure SEI isn't changed, keep interrupts disabled &4226 85 01 STA &01 ; cypher_1 &4228 18 CLC ; check_decryption_code &4229 a2 47 LDX #&47 ; check_decryption_code_loop &422b 7d 10 42 ADC &4210,X ; get_cypher_byte # Ensure code at &4211 - &4257 isn't changed &422e ca DEX # (could be copied elsewhere to calculate byte) &422f d0 fa BNE &422b ; check_decryption_code_loop &4231 85 00 STA &00 ; cypher_0 &4233 ad 58 42 LDA &4258 ; jump_into_decrypted_code + 1 # Ensure low byte of jump address isn't changed &4236 85 02 STA &02 ; cypher_2 &4238 a2 40 LDX #&40 ; decryption # Decrypt &3b00 - &41ff &423a a9 3b LDA #&3b ; &3b00 &423c 85 04 STA &04 ; address_high &423e a0 00 LDY #&00 &4240 84 03 STY &03 ; address_low ; decryption_loop &4242 20 10 42 JSR &4210 ; get_cypher_byte &4245 51 03 EOR (&03),Y ; address &4247 91 03 STA (&03),Y ; address &4249 88 DEY &424a d0 f6 BNE &4242 ; decryption_loop &424c e6 04 INC &04 ; address_high &424e a5 04 LDA &04 ; address_high &4250 c9 42 CMP #&42 &4252 90 ee BCC &4242 ; decryption_loop &4254 ca DEX &4255 d0 e3 BNE &423a ; decryption_loop ; jump_into_decrypted_code # High byte of jump address at &5259 isn't checked, &4257 4c eb 3d JMP &3deb ; decrypted_entry_point # so could be changed to point at alternative code Loading Screen Data =================== ; (no filename) ; 000b00 000000 003200 &0b00 2f 1f 2f 1f 2f 1f 2f 1f 2f 1f 2f 01 02 01 07 15 &0b10 2f 1f 2f 01 02 01 2f 1f 2f 1f 2f 01 02 01 2f 1f &0b20 2f 1f 2f 01 02 01 2a 0b 2f 1f 2f 01 02 01 02 01 &0b30 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 02 01 02 01 &0b40 2f 1f 2f 01 02 01 02 15 2f 1f 2f 01 2f 1f 2f 1f &0b50 2f 1f 2f 01 02 01 02 0b 2f 1f 2f 01 02 01 02 01 &0b60 2f 1f 2f 01 03 15 07 1f 2f 1f 2f 01 2a 0b 2a 0b &0b70 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 02 01 02 01 &0b80 2f 1f 2f 01 2f 1f 2f 1f 2f 1f 2f 01 02 01 02 01 &0b90 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 2f 1f 02 01 &0ba0 2f 1f 2f 01 2a 0b 02 01 2f 1f 2f 01 2f 1f 2f 1f &0bb0 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 2f 1f 02 01 &0bc0 2f 1f 2f 01 2a 0b 02 01 2f 1f 2f 01 2f 1f 2f 1f &0bd0 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 02 01 02 01 &0be0 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 02 15 07 15 &0bf0 2f 1f 2f 01 02 1f 2f 1f 2f 1f 2f 01 02 1f 2f 1f &0c00 2f 1f 2f 01 02 0b 2a 0b 2f 1f 2f 01 02 01 02 01 &0c10 2f 1f 2f 01 2f 1f 2f 1f 2f 1f 2f 01 02 01 02 01 &0c20 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 07 15 07 1f &0c30 2f 1f 2f 01 2a 0b 2a 1f 2f 1f 2f 01 07 15 07 15 &0c40 2f 1f 2f 01 2f 1f 2f 0b 2f 1f 2f 01 2f 1f 2f 17 &0c50 2f 1f 2f 01 2a 0b 2a 0b 2f 1f 2f 01 02 01 02 01 &0c60 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 02 01 02 15 &0c70 2f 1f 2f 01 02 01 02 0b 2f 1f 2f 01 02 01 02 15 &0c80 2f 1f 2f 01 02 01 02 0b 2f 1f 2f 1f 2f 1f 2f 1f &0c90 2f 1f 2f 1f 2f 1f 2f 1f 07 01 02 01 02 01 02 01 &0ca0 2f 1f 07 01 07 15 02 01 2f 1f 2a 01 2a 0b 02 01 &0cb0 2a 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &0cc0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &0cd0 07 15 2f 1f 2f 1f 2f 01 2f 1f 2f 00 03 1f 2f 01 &0ce0 2a 0b 2f 1f 2f 1f 2f 01 07 15 07 01 02 01 02 01 &0cf0 2f 0b 02 01 02 01 02 01 2f 1f 2f 15 07 15 02 01 &0d00 02 01 02 0b 2a 0b 2a 0b 02 01 02 01 2f 1f 2f 01 &0d10 2f 1f 2f 1f 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 &0d20 02 01 02 01 02 01 02 01 02 01 02 15 07 15 02 01 &0d30 02 01 02 01 2a 0b 2a 01 2f 1f 2f 1f 2f 1f 2f 01 &0d40 02 01 02 01 02 01 02 01 02 01 02 15 07 15 02 01 &0d50 02 01 02 01 2a 0b 2a 01 2f 1f 2f 1f 2f 1f 2f 01 &0d60 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &0d70 02 01 02 01 02 01 02 01 02 15 07 15 02 01 02 01 &0d80 02 1f 2f 1f 02 15 07 01 02 1f 2f 1f 02 0b 2a 01 &0d90 02 0b 2a 0b 02 01 02 01 02 01 02 01 2f 1f 2f 01 &0da0 2f 1f 2f 1f 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 &0db0 02 01 07 15 07 15 07 01 2f 1f 2a 0b 2f 1f 2f 01 &0dc0 2f 1f 05 17 2f 1f 2f 01 07 01 2a 0b 2a 0b 2a 01 &0dd0 2a 1f 2f 1f 07 15 07 01 05 1f 2f 1f 2a 0b 2a 01 &0de0 2a 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &0df0 02 01 02 01 02 01 02 01 07 01 02 01 02 01 02 01 &0e00 2a 1f 2f 15 07 01 02 01 07 15 07 1f 2f 1f 2f 15 &0e10 2a 0b 2a 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &0e20 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 15 &0e30 2a 0b 2a 0b 2f 1f 2f 1f 02 01 02 01 2a 0b 2a 1f &0e40 02 01 02 01 02 01 02 0b 02 01 02 15 2f 1f 2f 1f &0e50 02 01 02 1f 2f 1f 00 00 02 01 02 0b 2f 1f 05 00 &0e60 02 01 02 01 02 0f 3f 1f 02 01 07 05 1f 1f 1f 2f &0e70 02 0f 3f 2f 1f 1f 3f 2f 02 01 2f 3f 1f 1f 1f 3f &0e80 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0e90 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0ea0 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0eb0 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0ec0 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0ed0 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0ee0 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0ef0 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0f00 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0f10 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0f20 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0f30 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0f40 02 1f 2f 1f 00 00 00 00 02 1f 2f 1f 00 00 00 00 &0f50 02 01 2f 1f 2f 1f 2f 1f 02 1f 2f 1f 2f 1f 2f 1f &0f60 02 01 2a 0b 2f 1f 2f 1f 02 01 02 01 02 1f 2f 1f &0f70 02 01 02 15 2f 1f 2a 00 02 01 02 1f 2f 1f 00 00 &0f80 02 01 02 0b 2f 1f 2f 1f 02 01 02 01 02 01 02 15 &0f90 02 01 02 01 07 1f 2f 0b 07 15 07 01 2a 0b 2f 1f &0fa0 2a 0b 2a 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &0fb0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 02 01 07 15 &0fc0 2f 1f 2f 1f 02 01 2f 1f 2f 1f 2f 1f 02 01 2f 1f &0fd0 2a 0b 2a 0b 02 01 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &0fe0 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &0ff0 05 00 00 00 20 00 00 00 3f 1f 05 00 00 00 20 00 &1000 1f 3f 2f 00 20 00 00 00 2a 0a 00 00 00 00 20 00 &1010 00 00 00 00 20 00 00 10 00 00 00 00 00 00 20 00 &1020 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1030 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1040 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1050 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1060 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1070 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1080 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1090 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &10a0 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &10b0 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &10c0 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &10d0 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &10e0 05 15 00 00 20 00 00 00 2f 1f 2f 00 00 00 20 00 &10f0 2f 1f 2a 00 20 00 00 00 2a 00 00 00 00 00 20 00 &1100 00 00 00 00 20 00 00 00 00 00 00 00 00 00 20 00 &1110 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 01 02 01 02 01 &1120 2a 01 02 01 02 01 02 01 2f 15 07 15 02 01 02 01 &1130 02 0b 2a 0b 2a 0b 2a 01 2f 1f 2f 1f 2f 1f 2f 1f &1140 2f 1f 2f 1f 2f 1f 2f 1f 07 15 02 01 02 01 02 15 &1150 2f 0b 02 01 02 01 02 1f 2f 01 02 01 02 01 07 1f &1160 2a 01 02 01 02 01 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &1170 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1180 00 10 20 10 20 10 20 10 20 10 20 10 35 15 35 15 &1190 20 3a 2a 3a 3f 3f 3f 3f 02 10 20 15 35 15 35 17 &11a0 2a 3f 3f 3f 3f 3f 3f 3f 20 10 3f 3f 3f 3f 3f 3f &11b0 20 10 3f 3f 3f 3f 3f 3f 30 35 3f 3f 3f 3f 3f 3f &11c0 2a 3a 2a 3f 3f 3f 3f 3f 20 3a 3f 3f 35 15 35 15 &11d0 20 10 35 3f 3f 3f 3f 3f 20 3a 2a 3a 2a 10 35 15 &11e0 15 3f 3f 3f 3f 3f 3f 3f 10 3f 3f 3f 3f 3a 2a 3a &11f0 10 3f 3f 3f 3f 3f 20 10 3f 3f 3f 3f 2a 10 20 10 &1200 20 10 20 10 20 10 20 10 20 10 20 10 35 15 35 15 &1210 2a 3a 3f 3f 3f 3f 3f 3f 20 10 20 10 20 10 2a 3a &1220 20 10 20 00 20 10 20 10 15 15 3f 3f 3f 3f 3f 3f &1230 2a 3f 3f 3f 3f 3f 3f 3f 20 10 3f 3f 3f 3f 3f 3f &1240 20 15 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &1250 00 10 00 2a 2a 2a 2a 2a 20 10 30 15 35 35 35 35 &1260 20 3a 2a 3a 3f 3f 3f 3f 10 00 20 10 20 10 20 10 &1270 20 10 20 10 20 10 35 15 35 3f 3f 3f 3f 3f 3f 3f &1280 3f 3f 3f 3f 3f 3a 2a 3a 2a 3f 3f 3f 3f 3f 20 10 &1290 2a 3a 2a 3a 2a 3a 2a 10 20 10 20 10 20 10 20 10 &12a0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 01 02 01 02 01 &12b0 2f 1f 2f 1f 07 01 07 15 2f 1f 2f 1f 2a 01 2a 0b &12c0 2a 0b 2a 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &12d0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 02 15 07 15 07 15 &12e0 2f 1f 02 0b 2a 0b 2a 1f 2f 1f 02 01 02 01 02 0b &12f0 2a 0b 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1300 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1310 20 10 20 10 35 15 21 01 3f 3f 3f 3f 3f 3f 03 12 &1320 3f 3f 3f 3f 3f 17 21 12 35 15 2b 3a 2b 3a 03 03 &1330 2a 10 20 01 20 10 20 12 3f 3f 3f 3f 3f 03 03 03 &1340 3f 3f 3f 3f 3f 03 03 03 2a 3a 2a 3a 2a 12 02 12 &1350 3f 15 20 10 20 10 20 10 35 15 35 15 21 01 21 01 &1360 3f 3e 3f 3f 03 03 03 03 35 15 35 15 21 01 21 01 &1370 3f 3f 3f 3f 03 03 03 03 20 10 20 10 20 10 20 12 &1380 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1390 20 10 20 10 20 10 20 10 35 15 3f 3f 03 03 03 03 &13a0 3f 3f 3f 3f 03 12 02 10 2a 3a 3f 3f 03 03 03 01 &13b0 20 10 20 10 20 12 02 12 3f 3a 20 10 20 10 20 10 &13c0 35 15 35 15 21 01 21 01 3f 3f 3f 3f 03 03 03 03 &13d0 3f 3f 3f 3f 03 03 03 03 15 10 20 10 20 10 20 10 &13e0 2a 3a 20 10 20 01 21 01 3f 3f 3f 3f 3f 03 03 12 &13f0 3f 3f 3f 3f 3f 01 21 10 20 10 2a 3a 2a 12 02 03 &1400 35 15 21 01 21 01 21 01 3f 3f 3f 03 03 03 03 03 &1410 20 10 20 10 20 10 20 12 20 10 20 10 20 10 20 10 &1420 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1430 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &1440 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &1450 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1460 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 01 &1470 2f 1f 2f 1f 2f 1f 2f 01 2a 0b 2f 1f 2f 1f 2f 01 &1480 02 01 2a 0b 2a 0b 2a 01 2f 1f 2f 1f 2f 1f 2f 1f &1490 20 10 20 10 20 10 20 10 20 10 20 10 21 01 21 01 &14a0 21 03 03 03 03 03 03 03 02 12 21 10 21 03 03 03 &14b0 20 12 21 12 03 03 03 01 03 03 21 01 21 03 03 03 &14c0 20 10 02 12 03 12 03 12 03 03 21 03 21 03 21 03 &14d0 03 03 03 03 03 03 03 03 02 12 02 12 20 10 20 10 &14e0 20 10 20 01 21 01 20 10 21 03 03 03 02 10 20 10 &14f0 03 03 03 01 20 10 20 10 21 12 02 12 02 10 20 10 &1500 03 03 03 03 03 01 21 10 02 12 02 03 03 03 03 03 &1510 20 10 20 12 03 03 03 03 20 10 20 10 02 03 03 03 &1520 21 01 21 01 21 01 21 01 03 03 03 12 02 03 03 03 &1530 20 10 20 01 03 03 03 03 21 10 20 12 03 03 03 01 &1540 02 03 03 03 03 03 03 03 20 10 20 10 20 10 02 12 &1550 21 01 21 01 21 01 20 10 03 03 03 03 03 03 03 03 &1560 03 03 03 03 02 12 02 12 20 10 20 10 20 10 20 10 &1570 21 01 21 03 03 03 03 12 02 12 03 03 03 12 20 10 &1580 20 12 03 03 21 01 20 10 03 03 03 03 03 03 03 03 &1590 21 01 20 10 20 12 02 12 03 03 03 03 03 03 21 10 &15a0 02 12 02 03 03 03 03 01 20 10 20 01 03 03 03 03 &15b0 20 12 03 03 03 03 02 10 20 10 20 10 20 10 20 10 &15c0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 15 07 01 02 15 &15d0 02 01 02 1f 2f 01 02 1f 02 01 02 1f 2f 01 02 1f &15e0 02 01 02 0b 2a 01 02 0b 2f 1f 2f 1f 2f 1f 2f 1f &15f0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 07 15 07 15 &1600 02 01 02 01 2a 0b 2a 0b 02 01 02 01 02 01 02 01 &1610 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1620 20 10 00 20 30 10 20 10 21 03 03 03 03 12 20 10 &1630 03 03 03 12 10 10 20 12 02 01 21 03 03 03 03 03 &1640 21 12 02 03 03 03 03 03 03 03 03 01 12 12 0b 0b &1650 03 03 03 03 03 03 21 21 21 01 21 01 21 30 12 12 &1660 03 03 03 03 12 02 12 12 20 10 20 10 20 00 30 30 &1670 20 10 20 10 30 00 30 30 20 10 20 10 10 00 30 30 &1680 20 10 20 10 30 00 20 20 20 10 20 10 20 30 10 30 &1690 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &16a0 03 10 20 10 20 10 20 10 02 10 20 10 20 10 20 01 &16b0 03 03 03 03 03 03 03 12 03 03 03 12 02 10 20 00 &16c0 02 12 20 10 20 10 00 30 20 10 20 10 20 10 00 30 &16d0 03 03 21 10 20 10 00 10 02 12 03 03 21 10 00 10 &16e0 20 10 20 10 20 10 20 10 03 03 03 03 03 21 21 01 &16f0 02 12 20 10 20 00 20 10 20 10 20 10 20 10 20 10 &1700 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1710 20 10 20 10 20 10 20 10 21 01 20 10 20 10 20 10 &1720 02 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1730 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1740 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &1750 2f 1f 2f 1f 2f 1f 2f 1f 07 01 02 01 02 15 07 15 &1760 2f 01 07 15 02 1f 2f 1f 2f 01 2a 0b 02 0b 2a 0b &1770 2a 01 02 01 02 2b 2a 01 2f 1f 2f 1f 2f 1f 2f 1f &1780 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 15 &1790 2f 1f 2f 1f 2f 1f 2f 1f 2a 0b 2a 1f 2f 1f 2f 1f &17a0 02 01 02 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &17b0 20 10 20 30 20 20 20 10 20 10 20 21 00 30 30 30 &17c0 21 01 21 21 01 21 03 03 03 03 03 03 03 03 03 03 &17d0 03 07 07 07 07 07 0f 0f 0b 0f 0f 0f 0f 0f 0f 0f &17e0 12 03 03 03 03 03 0b 0b 12 21 03 03 03 03 03 03 &17f0 02 30 20 21 20 12 12 12 00 30 20 30 00 20 20 30 &1800 00 30 20 30 00 30 30 00 00 30 20 30 00 30 30 10 &1810 10 00 30 30 00 30 20 1a 30 00 30 30 00 00 30 30 &1820 30 00 30 30 00 30 10 20 30 00 10 20 10 30 30 20 &1830 20 00 30 30 10 10 20 00 21 01 21 30 30 30 20 10 &1840 12 30 30 20 20 20 00 30 10 20 10 30 30 20 00 30 &1850 30 00 30 30 30 00 30 10 30 10 20 20 20 10 30 30 &1860 20 00 30 30 10 20 30 30 20 00 30 30 20 10 10 10 &1870 00 00 20 20 10 30 30 30 21 10 20 30 00 10 10 10 &1880 00 10 20 10 33 31 31 30 20 00 30 33 33 33 33 33 &1890 00 30 33 33 33 33 33 00 20 10 20 32 33 33 33 00 &18a0 20 10 20 10 20 22 22 33 20 10 20 10 20 10 20 30 &18b0 20 10 20 10 20 10 20 20 20 10 20 10 20 10 20 10 &18c0 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &18d0 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 &18e0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 15 &18f0 2f 1f 2f 1f 2f 1f 2f 1f 2f 1f 2f 1f 2f 1f 2f 1f &1900 2a 0b 2a 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &1910 2f 1f 2f 1f 2f 1f 2f 1f 02 15 07 15 02 01 02 01 &1920 02 1f 2f 1f 2f 15 02 15 02 1f 2f 1f 2f 0b 02 0b &1930 02 0b 2a 0b 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1940 10 10 10 10 10 20 20 20 30 30 30 30 30 21 21 01 &1950 03 03 03 03 03 03 03 03 03 03 03 03 03 03 07 07 &1960 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 2f 2f 2f 2f 2f 2f &1970 0b 0b 0b 0b 0b 0b 0f 0f 03 03 03 03 03 03 03 03 &1980 12 12 12 03 03 03 03 03 30 30 20 30 00 30 30 30 &1990 10 10 30 00 20 25 25 25 20 20 00 15 00 14 3d 3e &19a0 05 05 2a 00 00 2d 2f 2d 00 30 1a 0a 1a 05 2d 2d &19b0 00 30 30 00 10 20 00 30 30 10 10 00 20 20 10 20 &19c0 30 30 00 30 30 30 00 30 30 30 10 20 20 20 10 30 &19d0 30 30 30 20 10 30 30 20 30 30 20 10 30 30 30 00 &19e0 10 00 30 30 30 20 10 30 20 10 30 20 20 00 24 0f &19f0 00 10 10 30 30 08 0e 0d 20 30 30 21 21 10 0a 0d &1a00 00 30 03 00 00 00 00 08 00 30 30 13 01 01 01 01 &1a10 10 30 31 33 33 33 33 33 22 22 00 00 00 00 00 00 &1a20 00 00 0a 05 00 00 00 00 00 00 00 05 00 00 00 00 &1a30 11 00 0a 00 00 00 00 00 22 32 22 11 11 01 01 01 &1a40 30 10 20 10 20 10 20 10 20 20 30 10 20 10 20 10 &1a50 20 10 30 10 20 10 20 10 20 10 00 30 20 10 20 10 &1a60 20 10 20 20 30 10 20 10 20 10 20 30 20 10 30 30 &1a70 2f 1f 2f 1f 2f 1f 2f 1f 02 01 07 15 07 01 02 01 &1a80 02 01 2f 1f 2f 1f 07 01 02 01 2f 1f 2f 1f 2a 01 &1a90 02 01 2a 0b 2a 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1aa0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &1ab0 07 01 02 01 07 15 2f 0b 2a 01 02 0b 2f 1f 07 15 &1ac0 02 01 02 01 02 01 02 0b 2f 1f 2f 1f 2f 1f 2f 1f &1ad0 20 10 10 10 00 30 30 30 21 21 21 21 21 01 21 21 &1ae0 03 03 03 03 03 03 03 03 07 07 07 07 07 07 07 07 &1af0 1f 1f 1f 1f 1f 1f 1f 1f 3f 3f 3f 3f 3f 3f 3f 3f &1b00 0f 0f 0f 0f 0f 0f 0f 0f 03 03 03 03 03 03 03 03 &1b10 03 03 03 03 03 03 03 03 30 30 20 10 30 30 20 00 &1b20 14 15 15 15 15 14 00 00 1f 1e 1f 1e 2d 2f 2f 2d &1b30 1e 1f 1a 1e 38 28 30 14 25 3c 38 20 00 10 00 20 &1b40 30 1a 0a 1a 0a 1a 1a 1a 10 10 00 30 20 10 30 00 &1b50 10 00 10 10 20 20 20 10 20 10 30 20 10 30 30 00 &1b60 10 30 30 00 30 30 20 10 30 30 00 30 30 30 00 20 &1b70 25 20 10 30 30 30 00 30 24 10 30 30 30 00 30 30 &1b80 1a 21 21 21 21 01 21 21 04 00 00 00 00 00 00 00 &1b90 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 &1ba0 13 13 13 13 13 13 13 33 22 22 22 22 22 33 33 33 &1bb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &1bc0 00 00 00 00 00 00 01 01 01 01 01 01 13 13 33 33 &1bd0 22 32 22 32 33 33 33 33 20 10 20 10 20 10 30 30 &1be0 20 10 20 10 30 30 30 30 20 10 30 30 30 20 20 10 &1bf0 30 30 30 20 00 10 20 10 30 20 00 10 20 10 20 10 &1c00 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 15 07 15 07 15 &1c10 07 15 02 1f 2f 15 02 01 2a 0b 02 01 2a 0b 2f 15 &1c20 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1c30 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 15 &1c40 2a 03 02 01 02 01 02 0b 07 15 03 01 02 01 02 15 &1c50 2a 0b 2a 0b 2a 2b 02 0b 2f 1f 2f 1f 2f 1f 2f 1f &1c60 30 30 00 30 30 30 30 00 21 01 21 01 21 21 01 21 &1c70 03 03 03 03 03 03 03 03 07 07 07 07 07 07 07 07 &1c80 1f 1f 1f 1f 0f 0f 0f 0f 3f 3f 3f 3f 2f 2f 0f 0f &1c90 0f 0f 0f 0f 0f 0f 0f 0f 03 03 03 03 03 03 03 03 &1ca0 03 03 03 03 03 03 03 03 20 20 20 20 20 20 20 00 &1cb0 00 15 00 00 00 00 00 00 05 05 05 05 05 05 05 05 &1cc0 20 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 &1cd0 0a 1a 1a 1a 1a 1a 1a 0a 30 10 10 10 00 10 10 30 &1ce0 20 20 20 20 10 20 20 20 30 30 20 10 30 30 30 30 &1cf0 30 20 10 20 10 10 20 20 10 20 10 30 30 00 30 20 &1d00 00 30 30 30 00 30 00 30 10 10 10 10 20 10 10 10 &1d10 30 30 30 20 10 30 30 20 02 02 02 02 02 02 21 01 &1d20 00 00 00 00 00 00 00 00 01 01 01 01 13 13 13 13 &1d30 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 &1d40 00 22 22 22 22 22 22 22 00 00 00 11 11 11 33 33 &1d50 13 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 &1d60 33 26 26 26 0c 0c 24 04 30 30 20 18 08 18 0c 0c &1d70 20 10 20 10 20 14 20 10 20 10 20 10 20 10 0a 10 &1d80 20 10 20 05 20 10 34 05 20 10 20 10 20 10 34 10 &1d90 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 15 &1da0 02 01 02 01 02 01 07 1f 0f 3f 0f 15 2f 0b 2a 01 &1db0 0a 2b 0a 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1dc0 2f 1f 2f 1f 2f 1f 2f 1f 07 01 02 01 02 01 02 01 &1dd0 2a 1f 2f 15 07 01 02 01 07 15 07 1f 2f 1f 2f 15 &1de0 2a 0b 2a 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &1df0 20 20 20 10 30 30 25 25 21 30 00 10 25 0f 0f 0f &1e00 03 03 03 03 0b 07 0b 0f 03 03 03 03 03 03 0b 03 &1e10 0f 0f 07 07 03 03 03 03 0f 0f 0f 0f 03 03 03 03 &1e20 0b 0b 03 03 03 03 03 03 03 03 03 03 03 03 03 03 &1e30 03 12 12 12 12 20 10 30 20 20 20 20 00 20 20 20 &1e40 00 02 00 00 00 00 00 00 05 05 05 05 05 05 05 05 &1e50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 &1e60 0a 1a 0a 1a 0a 1a 1a 0a 10 20 30 00 30 00 10 10 &1e70 20 20 10 20 00 20 00 20 20 10 20 10 20 10 30 30 &1e80 10 20 10 20 10 10 10 00 10 30 20 10 30 30 00 20 &1e90 30 00 20 20 30 00 30 20 20 10 30 30 00 30 20 10 &1ea0 10 30 30 00 30 10 20 20 21 21 01 21 21 20 10 30 &1eb0 01 01 01 01 21 13 13 13 33 33 33 33 33 33 33 33 &1ec0 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 &1ed0 22 22 11 11 11 11 11 11 33 33 33 33 33 33 33 33 &1ee0 33 33 33 33 33 33 33 33 33 33 22 32 33 33 33 33 &1ef0 20 10 35 10 20 10 20 10 0c 0c 2f 3f 35 10 20 14 &1f00 08 1a 1c 3a 3f 15 30 05 34 05 30 38 30 2f 35 2d &1f10 20 14 25 34 2d 2d 2f 0f 34 05 30 30 38 2f 1e 2f &1f20 2f 1f 2f 1f 2f 1f 2f 1f 02 15 07 15 02 01 02 01 &1f30 02 1f 2f 1f 2f 15 02 15 02 1f 2f 1f 2f 0b 02 0b &1f40 02 0b 2a 0b 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1f50 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &1f60 02 01 02 01 02 01 02 01 07 15 07 01 02 01 02 01 &1f70 2a 0b 2a 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &1f80 0f 0f 0f 0f 0f 0f 0f 0f 0f 2d 3c 3c 3c 3c 0b 1b &1f90 0b 0f 3d 3d 3f 3f 37 17 0b 07 23 13 2b 3f 3f 2f &1fa0 0b 03 03 03 0b 1a 1a 1a 03 03 03 03 03 20 20 20 &1fb0 03 03 03 02 10 30 30 20 12 12 20 10 30 30 20 10 &1fc0 20 10 30 30 20 10 30 30 20 20 20 20 20 20 20 20 &1fd0 00 00 00 2a 00 00 00 00 05 05 05 05 05 05 05 0f &1fe0 00 00 00 00 00 05 1e 3c 00 00 00 05 1e 3c 3c 3c &1ff0 1a 1a 1a 3c 3c 3c 3c 3c 00 30 30 30 3c 3c 3c 3d &2000 20 10 20 35 34 3d 3e 3c 00 30 3a 3d 3e 3c 3d 3a &2010 30 30 00 30 30 00 30 20 20 10 30 30 30 20 10 30 &2020 10 20 20 20 10 20 24 0d 30 20 10 30 24 0d 1f 2f &2030 10 30 24 0d 1f 2d 1e 2d 31 19 1b 3b 1b 39 1b 3b &2040 13 13 13 13 23 23 23 33 33 33 33 33 33 33 13 13 &2050 33 33 33 33 33 33 33 33 33 33 33 33 33 33 22 22 &2060 11 11 11 11 11 11 11 33 33 33 33 33 33 33 33 33 &2070 33 33 33 33 33 33 33 33 33 33 33 32 22 22 32 32 &2080 20 00 30 10 20 00 20 30 20 30 00 30 00 20 30 10 &2090 30 14 1a 00 34 38 20 30 34 25 10 0a 10 25 14 20 &20a0 1f 2f 2d 34 05 34 10 25 1e 2f 38 20 10 34 14 20 &20b0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &20c0 07 01 02 15 07 15 2f 1f 2a 01 02 0b 2a 0b 2f 1f &20d0 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &20e0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 15 &20f0 2f 1f 2f 0b 2a 0b 2a 0b 2f 1f 2f 15 07 15 07 15 &2100 2a 0b 2a 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &2110 0f 0f 0f 0f 0f 0f 25 30 23 13 23 13 0f 0f 1a 10 &2120 23 07 27 0f 0f 1a 30 30 2f 0f 0f 1a 30 30 30 30 &2130 1a 30 00 20 10 10 10 00 20 10 30 30 30 20 10 00 &2140 10 30 30 20 10 30 20 10 10 10 00 30 30 20 10 30 &2150 20 10 30 20 10 30 30 20 00 20 25 34 34 34 34 34 &2160 05 1e 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3d 3e &2170 3c 3c 3c 3c 3d 3e 3c 3d 3c 3c 3c 3d 3e 3c 3d 3a &2180 3c 3d 3e 3c 3d 3a 10 00 3e 3c 3d 3a 30 20 10 30 &2190 3d 3a 30 20 10 20 24 0d 10 00 10 30 24 1c 1f 2f &21a0 00 30 24 0d 1f 2f 1d 2e 04 0d 1f 2f 1e 0d 3d 2f &21b0 1e 2f 1e 2d 1f 2f 0e 2e 1e 2d 1f 2d 0e 18 30 10 &21c0 1e 2f 0e 08 30 30 30 30 0e 08 10 20 10 20 10 10 &21d0 33 33 33 33 33 33 33 33 13 13 23 23 23 23 23 23 &21e0 33 33 33 33 33 33 33 33 22 22 22 22 22 22 22 22 &21f0 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 &2200 33 33 33 33 33 33 32 32 22 30 30 30 30 00 30 30 &2210 00 20 30 30 30 00 20 30 20 30 00 10 10 30 10 20 &2220 30 00 30 10 20 20 10 30 30 30 10 20 30 30 00 30 &2230 14 30 30 25 00 10 30 10 30 00 30 30 10 20 30 30 &2240 2f 1f 2f 1f 2f 1f 2f 1f 02 15 07 15 07 15 02 01 &2250 2f 0b 2a 1f 2f 1f 02 01 2f 17 05 1f 2f 1f 02 01 &2260 02 0b 2a 0b 2a 0b 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2270 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 01 02 01 02 01 &2280 2a 0b 2a 01 02 01 02 01 07 15 07 01 02 15 07 1f &2290 2a 0b 2a 01 02 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &22a0 30 30 00 30 30 30 00 30 20 00 30 30 30 00 30 30 &22b0 10 20 20 20 00 10 20 30 20 10 10 30 20 10 10 00 &22c0 30 30 30 20 10 30 20 10 10 10 00 30 30 00 30 20 &22d0 30 20 10 20 10 30 30 00 20 10 30 30 35 3e 3d 3c &22e0 10 30 35 3e 3d 3e 3c 3d 34 3e 3d 3e 3c 3d 2a 30 &22f0 3d 3e 3c 3d 3a 30 10 20 3c 3d 2a 20 30 20 10 30 &2300 3a 30 30 30 00 30 24 0d 30 30 20 00 24 0d 1f 2f &2310 10 10 24 0d 1f 2d 1e 2e 24 0d 1f 2f 1f 2e 1d 2d &2320 1f 2f 1f 2e 1d 2f 1f 2f 1f 2e 1d 2f 1f 2a 18 18 &2330 1c 3e 0e 2a 18 30 00 30 1f 2e 18 00 30 30 30 00 &2340 18 30 30 30 00 20 20 10 20 30 20 20 10 30 10 20 &2350 20 10 30 10 31 33 30 10 30 10 31 33 33 32 10 10 &2360 33 33 33 33 33 31 20 20 23 13 13 13 13 13 31 30 &2370 33 33 33 33 33 33 31 20 22 33 33 33 33 33 22 32 &2380 11 11 11 11 11 11 11 30 33 33 33 33 33 33 22 10 &2390 22 32 32 20 32 32 30 10 10 20 30 10 20 20 20 20 &23a0 30 10 20 10 20 30 10 20 20 10 10 20 00 10 20 30 &23b0 10 20 30 30 10 20 10 20 30 20 10 10 10 10 20 20 &23c0 20 20 00 20 20 00 20 30 30 10 20 30 30 30 30 10 &23d0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &23e0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &23f0 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2400 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &2410 02 15 07 15 02 01 02 15 2f 0b 2a 01 02 01 02 0b &2420 2a 0b 2a 0b 2a 0b 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2430 30 30 30 20 10 20 10 30 30 30 00 30 30 30 10 20 &2440 20 10 30 30 30 20 10 30 30 30 30 30 20 10 20 20 &2450 00 20 10 10 30 10 20 10 10 30 30 30 30 00 20 30 &2460 30 30 30 20 10 30 20 10 3e 35 30 30 20 10 30 30 &2470 2a 20 10 00 30 30 24 0d 30 30 30 30 04 0d 1f 2f &2480 20 20 24 0d 1e 2f 1f 2f 24 0d 1f 2f 1f 2d 1e 2c &2490 1f 2f 1f 2f 1e 2d 1f 2f 1f 2e 0e 2d 1f 2f 1f 2e &24a0 1d 2f 1f 2f 0e 18 18 30 1d 0d 2c 18 30 10 20 20 &24b0 0e 18 10 20 30 30 30 25 25 25 25 0f 1f 1f 1f 3f &24c0 0f 1f 3f 1f 0f 2f 0f 3f 30 0f 3f 2f 2f 2f 1f 1f &24d0 10 0f 3f 1f 2f 3f 1f 0f 30 30 0f 3f 0f 3f 1f 0f &24e0 20 30 0f 3f 3f 0f 3f 0f 20 10 1a 2f 3f 1f 2f 1f &24f0 10 20 30 0f 3f 3f 0f 3f 30 30 20 0a 2f 2f 1f 2f &2500 10 00 30 30 0f 3f 3f 0f 30 10 20 30 30 0a 0a 2f &2510 20 20 10 10 10 30 20 00 10 20 20 20 10 00 30 30 &2520 00 30 30 30 30 30 00 10 10 20 20 20 10 00 10 00 &2530 30 30 30 30 30 30 10 20 00 20 30 30 30 20 20 00 &2540 30 10 00 10 10 00 30 30 00 20 30 00 20 30 00 30 &2550 30 30 10 00 30 20 20 10 20 30 30 30 00 30 30 30 &2560 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 15 07 15 02 01 &2570 02 01 02 1f 2f 1f 02 01 02 01 02 15 07 15 07 15 &2580 02 01 02 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &2590 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 15 &25a0 07 15 07 15 07 15 07 1f 2a 0b 2a 0b 2a 0b 2a 1f &25b0 02 01 02 01 02 01 02 0b 2f 1f 2f 1f 2f 1f 2f 1f &25c0 20 10 30 30 20 10 20 10 10 30 30 00 10 10 20 10 &25d0 30 20 10 30 30 20 10 10 00 30 30 20 10 30 30 30 &25e0 30 30 00 20 20 20 24 0d 20 10 30 30 24 0d 1f 2f &25f0 30 30 24 0d 1e 2f 1f 2f 24 0d 1f 2f 1f 2d 1e 2e &2600 1f 2f 1f 2f 1e 2e 1d 2d 1f 2f 1e 2d 1f 2f 1f 2f &2610 1e 2d 1f 2f 1f 2f 0e 18 1e 2e 1e 3e 0c 18 30 20 &2620 1f 2e 18 10 20 00 10 20 00 30 30 30 30 10 20 20 &2630 30 00 30 30 30 30 30 00 10 10 10 20 20 25 1f 1f &2640 05 25 30 25 1f 2f 3f 2f 3f 2f 1f 1f 0f 2f 0f 3f &2650 1f 2f 1f 2f 3f 2f 3f 1f 1f 0f 2f 2f 1f 2f 1f 2f &2660 1f 3f 2f 2f 1f 1f 1f 2f 0f 0f 2f 2f 1f 1f 1f 2f &2670 1f 2f 1f 0f 1f 0f 0f 2f 0f 2f 1f 2f 1f 2f 1f 2f &2680 0f 2f 1f 2f 1f 2f 1f 2f 1f 0f 1f 2f 1f 2f 3f 3f &2690 2f 1f 0f 2f 0f 2f 1f 2f 2f 1f 2f 2f 1f 1f 0f 2f &26a0 20 1a 2f 2f 1f 1f 2f 2f 30 00 20 30 1a 1a 2f 2f &26b0 10 10 20 20 10 10 30 3a 30 30 10 0a 30 30 30 34 &26c0 35 10 10 25 10 15 2f 1f 30 30 20 20 10 10 3a 1e &26d0 10 10 30 0a 30 30 30 10 30 30 30 30 10 20 30 3a &26e0 10 10 20 10 10 30 00 10 30 30 30 00 30 30 10 20 &26f0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &2700 02 01 2a 1f 2f 15 02 01 07 15 07 15 07 15 02 01 &2710 2a 0b 2a 0b 2a 0b 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2720 2f 1f 2f 1f 2f 1f 2f 1f 07 15 02 01 02 01 02 01 &2730 2f 1f 02 01 02 15 07 1f 2f 1f 02 0b 2a 1f 07 15 &2740 2a 0b 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2750 20 10 30 30 30 30 24 0d 30 20 20 20 24 0d 1d 2d &2760 10 30 24 0d 1f 2f 1f 2f 24 0d 1f 2f 1f 2f 1f 2e &2770 1f 2f 1f 2f 1f 2e 1d 2f 1f 2f 1f 2e 1d 2f 1f 2f &2780 1f 2e 1d 2f 1f 2f 1f 2e 1d 2f 1f 2f 1f 2e 08 30 &2790 1d 2d 0c 38 18 30 30 00 0e 18 30 30 30 20 10 30 &27a0 10 20 30 20 10 00 30 30 10 30 10 20 20 30 05 1f &27b0 30 20 10 10 30 05 25 1f 10 30 30 25 1f 3f 2f 1f &27c0 25 1f 1f 2f 3f 1f 2f 1f 3f 2f 3f 3f 1f 2f 2f 2f &27d0 1f 3f 3f 2f 2d 0f 1f 2f 2f 2f 0f 0f 1f 2f 0f 0f &27e0 1f 2f 2d 2f 1f 2d 0f 2f 1f 2f 3f 3f 1f 1f 05 05 &27f0 2f 3f 1f 2f 1f 2f 3f 2f 2f 1f 1f 2f 0f 2f 1f 2f &2800 2f 1f 1f 2f 2f 3f 1f 2f 1f 1f 0f 2f 2f 2f 1f 3f &2810 1f 3f 1f 2f 3f 0f 1f 0f 3f 2f 2f 2f 0f 2f 0f 2f &2820 3f 3f 3f 1f 1f 3f 1f 0f 0f 2f 1f 0f 0f 2f 0f 0f &2830 1f 0f 0f 2f 1f 2f 1f 2f 1f 2f 2f 1f 1f 0f 0f 2f &2840 1a 2f 2f 1f 1f 2f 1f 1f 20 20 10 0a 1a 2f 1f 1f &2850 2f 35 30 30 05 20 1f 1a 3a 30 30 30 20 20 00 00 &2860 00 10 10 10 1a 30 30 20 10 20 20 20 00 10 10 30 &2870 10 30 30 30 30 10 20 30 30 20 20 20 20 10 10 10 &2880 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 02 01 02 15 &2890 2f 1f 2f 0b 02 01 02 1f 2f 1f 2f 01 02 01 07 1f &28a0 2a 0b 2a 01 02 01 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &28b0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 15 &28c0 2a 0b 02 01 02 01 02 1f 07 15 07 15 02 01 02 01 &28d0 02 01 2a 0b 2a 0b 2a 01 2f 1f 2f 1f 2f 1f 2f 1f &28e0 1f 2d 1f 2d 1f 2d 1e 0d 1e 2f 1f 2f 1e 2d 1f 2f &28f0 1f 2c 1e 1c 0e 3e 0e 3e 1d 2f 1f 2f 1f 2f 0e 18 &2900 1f 2f 1f 2e 0e 18 30 30 1f 2e 18 10 10 20 20 10 &2910 18 30 30 30 30 30 00 10 30 30 30 20 10 10 30 30 &2920 20 10 10 10 20 30 30 30 30 30 25 25 05 30 25 1f &2930 25 1f 3f 2f 3f 1f 2f 3f 3f 3f 1f 2f 1f 2f 3f 1f &2940 1f 2f 3f 3f 1f 3f 1f 3f 2f 3f 1f 2f 3f 2f 0f 0f &2950 3f 3e 0f 0f 1f 0f 1f 2f 0f 0f 1f 2f 1f 2f 1f 2f &2960 1f 2d 1f 2f 1f 2f 2d 0a 1f 3f 1f 0f 0a 00 00 00 &2970 3f 3f 3f 2a 00 0a 00 00 00 2a 00 00 00 05 00 00 &2980 1f 1f 1f 05 05 00 28 00 1f 2f 1f 2f 3f 1f 1f 1f &2990 2f 2f 2f 3f 1f 2f 1f 2f 2f 2f 2f 1f 1f 2f 2f 3f &29a0 2f 2f 2f 1f 1f 2f 3f 1f 1f 2f 1f 0f 3f 3f 0f 3f &29b0 0f 2f 1f 0f 3f 3f 0f 3f 1f 2f 1f 0f 3f 3f 0f 3f &29c0 1f 2f 1f 0f 3f 3f 0f 3f 1f 2f 1f 0f 2f 3f 0f 3f &29d0 0f 2f 0f 0f 0f 3f 3f 0f 2f 2f 1f 1f 0f 3f 3f 0f &29e0 2f 2f 1f 1f 2f 2f 3f 0f 30 30 1a 1a 2f 3f 1f 1f &29f0 00 20 30 30 30 1a 0a 2f 30 30 10 00 10 10 30 34 &2a00 30 20 20 00 25 20 30 30 10 30 00 30 30 30 00 34 &2a10 2f 1f 2f 1f 2f 1f 2f 1f 07 15 02 01 02 01 02 01 &2a20 2f 1f 02 15 07 15 2f 1f 2f 1f 02 0b 2a 0b 2f 1f &2a30 2a 0b 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2a40 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 15 &2a50 2f 15 02 01 02 01 02 01 2a 0b 2f 15 3f 0f 3f 15 &2a60 02 01 02 01 2a 0b 2a 01 2f 1f 2f 1f 2f 1f 2f 1f &2a70 1f 2d 1f 2d 1f 2c 18 30 1f 2f 0e 2e 18 10 10 20 &2a80 0e 18 30 20 30 30 30 30 30 30 30 10 20 30 30 30 &2a90 30 20 10 10 30 00 30 30 00 30 30 30 30 30 00 10 &2aa0 00 30 30 30 30 30 10 20 30 00 30 30 30 25 25 05 &2ab0 30 05 25 1f 1f 3f 3f 3f 1f 3f 3f 3f 1f 3f 1f 2f &2ac0 1f 3f 3e 3c 3d 3f 3f 3e 2f 03 0c 0c 3f 2b 2d 2d &2ad0 0f 0f 03 0c 0c 03 0f 0f 1f 2f 1f 03 0c 0c 03 0f &2ae0 1f 2f 1f 2f 06 0c 0c 06 1f 2f 0a 0a 00 08 0c 0c &2af0 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2b00 28 00 00 00 00 00 00 04 00 00 00 00 00 00 08 0f &2b10 00 00 00 02 03 01 00 00 05 05 00 00 00 02 00 00 &2b20 3f 3f 1f 1f 1f 05 05 00 1f 3f 2f 2f 2f 2f 0f 0f &2b30 0f 0f 1f 2f 1f 2f 1f 2f 0f 2f 1f 2f 1f 2f 1f 2f &2b40 0f 2f 1f 2f 1f 2f 1f 2f 0f 2f 1f 2f 1f 2f 1f 0f &2b50 0f 2f 1f 2f 1f 2f 1f 0f 1f 2f 1f 2f 1f 2f 1f 0f &2b60 3f 0f 1f 2f 1f 2f 1f 0f 3f 0f 1f 2f 1f 2f 1f 0f &2b70 3f 0f 1f 2f 1f 3f 2f 1a 3f 0f 1f 2f 1f 2f 0f 25 &2b80 0f 0f 1f 3f 2f 2f 1a 30 30 1a 1a 1a 34 30 30 38 &2b90 25 30 35 2f 1f 2f 35 30 30 30 30 3a 1e 3a 30 30 &2ba0 2f 1f 2f 1f 2f 1f 2f 1f 02 15 07 15 07 15 02 15 &2bb0 2f 0a 2b 1f 2f 1f 02 0b 2f 15 07 1f 2f 1f 02 15 &2bc0 02 0b 2a 0b 2a 0b 02 0b 2f 1f 2f 1f 2f 1f 2f 1f &2bd0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 02 01 02 01 &2be0 02 15 2f 1f 02 01 02 01 2f 0b 2a 01 02 01 02 01 &2bf0 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2c00 30 30 20 20 10 20 20 10 10 10 30 30 20 20 10 30 &2c10 10 20 10 10 30 30 10 20 30 10 20 30 30 30 30 30 &2c20 20 10 10 10 20 38 30 30 30 30 30 30 38 00 30 30 &2c30 30 30 38 30 30 30 10 20 30 38 30 30 30 34 30 20 &2c40 1f 25 30 10 38 10 10 10 3f 1f 34 38 30 30 30 30 &2c50 3e 3f 3f 1f 25 30 25 30 3f 3f 2e 3e 3e 1f 1f 1f &2c60 3f 0c 2d 2d 3f 3f 3f 3f 0c 0f 0f 3f 3f 3f 3f 3f &2c70 0c 0e 0f 2f 2f 2f 3e 3e 0c 0c 0c 0c 0c 0d 1d 2f &2c80 08 08 08 0f 3f 3f 1f 2f 00 00 00 00 0a 2f 3f 3f &2c90 04 04 00 00 15 15 0a 0a 0d 0c 0c 2f 2f 00 00 2a &2ca0 0e 0c 0c 0e 0f 0f 15 00 0c 0c 0c 0c 0e 0f 0f 05 &2cb0 00 08 0c 0c 0c 0c 0e 0f 07 01 00 08 0a 0d 0c 0c &2cc0 0f 02 00 00 00 08 0a 08 0f 00 00 00 05 00 00 00 &2cd0 0a 00 00 0a 2f 0a 00 00 00 00 00 00 00 05 05 1f &2ce0 05 05 1f 1f 1f 3f 3f 2f 3f 2f 3f 2f 1f 2f 1f 2f &2cf0 1f 2f 1f 2f 1f 2f 1f 3f 1a 2f 3f 3f 2f 2f 2f 2f &2d00 30 30 1e 1a 34 30 34 28 34 30 35 2f 1f 2f 35 05 &2d10 30 30 34 3a 1e 3a 34 30 30 38 30 30 1a 30 30 38 &2d20 30 25 30 30 1a 20 20 20 34 30 30 30 25 30 30 30 &2d30 2f 1f 2f 1f 2f 1f 2f 1f 07 01 02 01 02 01 02 01 &2d40 2a 1f 2f 15 07 01 02 01 07 15 07 1f 2f 1f 2f 15 &2d50 2a 0b 2a 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &2d60 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 15 07 15 &2d70 02 01 02 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &2d80 02 01 02 01 02 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &2d90 30 30 30 30 30 30 10 20 30 30 30 30 30 20 10 30 &2da0 30 30 30 30 30 30 00 30 10 10 20 30 30 20 20 00 &2db0 30 30 30 10 00 30 30 30 30 30 30 20 00 20 30 30 &2dc0 20 10 10 30 30 30 10 20 10 30 30 30 30 30 30 10 &2dd0 20 20 30 20 20 30 30 34 30 30 10 20 34 10 10 10 &2de0 34 30 38 10 20 30 30 30 25 30 30 30 30 10 20 30 &2df0 1f 25 30 30 30 30 10 20 3f 3f 1f 25 30 38 20 20 &2e00 3e 3d 3f 3f 0f 10 30 30 3f 2f 1f 2f 3f 1f 25 30 &2e10 1f 2f 1f 3f 3f 2f 2f 1f 3f 2f 2f 1f 1f 3f 3f 2f &2e20 1f 3f 3f 2f 1f 2f 1f 2f 0c 2e 3f 2f 1f 2f 1f 2f &2e30 00 0c 2e 3f 1f 2f 1f 2f 15 00 08 0c 2e 3f 3f 2f &2e40 0f 2f 00 00 1d 0a 0f 3f 0e 0e 2a 2a 00 00 0a 2f &2e50 08 00 00 00 00 00 00 04 00 00 00 00 00 08 0c 0c &2e60 00 00 05 05 15 0d 0c 0c 0f 1f 3f 2f 3f 3f 0f 0c &2e70 3f 0f 3f 3f 1f 2f 3f 1f 3f 3f 1f 2f 2f 3f 1f 3f &2e80 1f 3f 3f 2f 2f 0f 1a 1a 1a 1a 38 30 20 20 20 20 &2e90 20 20 30 30 30 30 30 20 20 25 10 10 10 05 10 30 &2ea0 10 20 30 30 30 30 30 30 30 10 20 30 30 30 30 30 &2eb0 20 1a 10 20 20 20 20 20 30 10 10 00 30 30 30 30 &2ec0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &2ed0 02 01 02 01 02 01 02 01 07 15 07 01 02 01 02 01 &2ee0 2a 0b 2a 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &2ef0 2f 1f 2f 1f 2f 1f 2f 1f 07 01 02 01 02 01 07 15 &2f00 2a 01 02 01 02 01 2f 1f 02 01 02 01 02 15 2f 1f &2f10 02 01 02 01 02 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &2f20 30 30 30 10 20 10 20 30 10 10 20 30 30 10 30 10 &2f30 20 10 30 10 20 20 20 30 30 30 30 30 30 10 20 00 &2f40 10 20 30 30 30 30 30 30 30 10 20 30 30 30 30 30 &2f50 30 30 30 10 20 20 20 20 20 30 30 00 30 30 30 00 &2f60 20 10 10 20 30 30 30 30 30 30 30 10 20 30 30 30 &2f70 30 30 30 30 20 10 10 10 30 30 30 20 10 30 30 30 &2f80 34 30 38 00 30 30 30 30 10 10 20 00 20 20 20 30 &2f90 30 30 30 30 30 30 10 10 30 30 30 30 30 30 30 30 &2fa0 25 30 30 30 30 30 30 20 3f 0f 30 30 20 10 10 30 &2fb0 3f 3f 1f 25 30 30 30 30 1f 2f 3f 3f 1f 25 30 30 &2fc0 1f 3f 3f 2f 2f 1f 25 30 2f 1f 1f 3f 3f 2f 3f 1f &2fd0 3f 2f 1f 3f 1f 3f 3f 3f 3f 3f 3f 2e 0d 3c 3c 3d &2fe0 2e 0c 0d 0f 0f 1f 3f 3f 0c 0c 0e 0f 0f 0f 0f 2f &2ff0 03 0f 0f 0d 1d 1d 1d 0e 0c 06 0e 0b 1e 3e 3f 1f &3000 1d 1c 1c 3e 3f 3d 3d 3d 1f 3f 2d 2d 2d 2d 3a 1a &3010 1a 1a 30 30 30 30 30 30 20 20 00 00 10 10 10 10 &3020 20 20 20 00 20 30 30 30 30 30 30 30 30 00 10 10 &3030 30 30 30 30 30 00 30 30 30 30 30 30 30 30 00 10 &3040 20 20 10 10 10 10 10 20 30 30 30 30 30 30 30 30 &3050 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 15 07 15 07 15 &3060 02 01 02 1f 2f 1f 2a 0b 02 01 02 1f 2f 1f 07 15 &3070 02 01 02 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &3080 2f 1f 2f 1f 2f 1f 2f 1f 07 01 07 15 07 15 07 15 &3090 2f 01 2a 0b 2a 0b 2f 1f 2f 01 02 01 02 01 2a 0b &30a0 2a 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &30b0 10 20 30 10 30 20 30 10 20 30 00 30 10 20 10 20 &30c0 30 30 30 10 20 30 10 20 10 10 20 20 30 00 20 30 &30d0 10 20 30 30 00 10 30 00 30 30 10 20 00 20 20 30 &30e0 30 20 10 30 30 30 10 20 10 30 30 30 30 30 30 10 &30f0 10 20 30 30 30 30 30 30 20 00 20 30 30 30 30 30 &3100 30 30 10 20 30 30 30 30 30 30 30 10 20 20 10 10 &3110 30 30 30 30 10 20 30 30 20 20 20 10 10 10 10 20 &3120 00 30 30 30 30 30 30 30 10 20 30 30 30 30 30 30 &3130 20 10 20 30 30 30 30 30 30 30 30 10 20 30 30 30 &3140 30 30 30 30 10 20 30 20 30 30 30 30 30 30 10 20 &3150 30 30 30 30 30 20 20 10 1f 1f 25 25 05 30 34 30 &3160 3f 1f 1f 3f 3d 1f 25 30 3f 3f 1f 2f 1f 2f 3f 1f &3170 1f 2f 1f 2f 1f 2f 3f 2f 2f 2f 1f 2f 1f 2f 3f 1f &3180 0e 3c 3c 3e 1f 2f 3f 2f 1f 2f 2f 3f 3f 2f 2f 1a &3190 3f 2f 0f 1a 0a 30 30 30 1a 1a 30 30 38 14 20 20 &31a0 28 20 14 10 20 20 10 28 30 30 30 30 38 30 30 30 &31b0 30 30 30 30 20 20 20 20 10 10 10 10 30 30 30 30 &31c0 30 30 30 30 30 20 20 20 10 10 10 10 10 30 30 30 &31d0 20 30 30 30 30 30 30 20 30 10 10 10 10 10 10 30 &31e0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 02 01 &31f0 2a 0b 2a 0b 2a 0b 02 01 07 15 07 15 07 15 02 01 &3200 2a 0b 2a 0b 2a 0b 02 01 2f 1f 2f 1f 2f 1f 2f 1f &3210 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 01 &3220 2f 1f 2f 1f 2f 1f 2f 01 2a 1f 2f 1f 2f 1f 2f 01 &3230 02 0b 2a 0b 2a 0b 2a 01 2f 1f 2f 1f 07 15 07 15 &3240 20 10 30 10 2a 1a 2a 1a 30 10 20 10 30 10 20 10 &3250 10 20 30 10 20 10 30 10 10 30 10 30 30 00 10 10 &3260 10 10 10 10 10 20 20 10 00 30 30 00 00 00 00 00 &3270 30 00 30 00 00 00 15 2a 20 20 10 00 00 00 15 2a &3280 10 20 30 00 00 00 15 2a 30 10 20 00 00 00 15 2a &3290 20 20 30 00 00 00 15 2a 30 30 30 00 00 00 15 2a &32a0 30 30 30 00 00 00 15 2a 30 30 30 00 00 00 15 2a &32b0 10 10 20 00 00 00 15 2a 30 30 30 00 00 00 15 2a &32c0 30 30 30 00 00 00 15 2a 30 30 20 00 00 00 15 2a &32d0 10 10 30 00 00 00 15 2a 30 30 30 00 00 00 15 2a &32e0 30 30 30 00 00 00 15 2a 38 30 30 00 00 00 15 2a &32f0 30 30 30 00 00 00 15 2a 25 20 20 00 00 00 15 2a &3300 1a 30 30 00 00 00 15 2a 25 30 30 00 00 00 15 2a &3310 1a 20 30 00 00 00 15 2a 34 10 20 00 00 00 15 2a &3320 30 30 28 00 00 00 15 2a 10 10 30 00 00 00 15 2a &3330 30 30 30 00 00 00 15 2a 10 20 30 00 00 00 15 2a &3340 20 00 30 00 00 00 00 2a 30 10 20 10 10 00 10 00 &3350 20 20 20 00 30 20 00 20 30 30 30 30 00 20 10 20 &3360 20 20 20 20 20 10 00 20 30 30 30 30 25 35 25 35 &3370 2f 1f 2f 1f 2a 0b 2a 2b 02 01 02 15 07 15 07 15 &3380 07 0a 2b 1f 2f 1f 2f 0b 0a 15 07 1f 2f 1f 2f 17 &3390 02 01 02 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &33a0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 15 &33b0 02 01 02 01 2a 1f 07 15 02 01 02 01 02 01 02 0b &33c0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &33d0 2f 1f 2f 15 07 01 02 01 20 10 2a 1a 2f 1f 2f 15 &33e0 20 10 20 10 20 1a 2a 1f 20 00 00 10 20 00 20 10 &33f0 30 10 10 00 20 10 00 10 00 00 00 00 00 00 00 00 &3400 15 2a 15 2a 15 2a 15 2a 15 3c 3c 3c 3c 3d 3f 3f &3410 15 00 00 00 00 00 00 00 15 3c 3c 3c 3c 3d 3f 3f &3420 15 14 14 14 14 15 15 15 15 28 28 28 2a 2a 2a 2a &3430 15 14 14 14 00 00 00 00 15 3c 3c 3c 14 15 15 15 &3440 15 3c 3c 3c 2a 2a 2a 2a 15 28 28 28 00 00 00 00 &3450 15 3c 3c 3c 3d 3f 3f 3f 15 14 14 14 15 15 15 15 &3460 15 3c 3c 3c 3c 3f 3f 3f 15 00 00 28 28 28 3f 3f &3470 15 00 00 14 14 14 3f 3f 15 3c 3c 3c 3c 3f 3f 3f &3480 15 28 28 28 2a 2a 2a 2a 15 3c 3c 3c 3d 3f 3f 3f &3490 15 28 28 3c 3c 3d 15 15 15 00 00 00 00 00 2a 2a &34a0 15 3c 3c 3c 00 00 00 00 15 3c 3c 3c 3c 3d 3f 3f &34b0 15 3c 3c 3c 00 00 00 00 15 14 14 14 14 14 15 15 &34c0 15 3c 3c 3c 28 2a 2a 3f 15 28 3d 28 15 00 15 08 &34d0 00 2a 00 2a 00 2a 00 2a 10 00 10 00 10 00 10 00 &34e0 00 10 10 00 10 20 10 20 10 00 10 20 10 35 05 1f &34f0 00 20 05 15 2f 1f 2f 0b 2f 1f 2f 0b 2a 01 02 01 &3500 02 01 02 01 02 01 02 01 07 15 02 01 02 01 02 01 &3510 02 03 2a 0b 02 15 07 15 03 01 07 15 02 0b 2a 0b &3520 2a 0b 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &3530 2f 1f 2f 1f 2f 1f 2f 1f 07 15 02 01 02 01 02 01 &3540 02 0b 2a 1f 07 15 02 01 2a 1f 07 15 02 01 02 01 &3550 02 01 02 0b 2a 0b 02 01 02 01 02 01 02 01 02 01 &3560 02 01 02 01 02 01 02 01 07 01 17 3f 2f 2f 2f 15 &3570 2f 1f 2f 1f 3f 2f 2f 1f 20 3a 2a 1a 0a 3a 2a 15 &3580 20 00 20 00 20 10 2f 3f 00 00 00 00 00 00 00 0a &3590 15 2a 15 2a 15 2a 15 2a 3f 2e 0c 0c 0c 0c 04 00 &35a0 00 00 00 00 0c 0c 0c 00 3f 2e 0c 0c 0c 0c 08 00 &35b0 15 04 04 04 04 04 04 00 08 08 08 08 0c 0c 0c 00 &35c0 00 00 00 00 0c 0c 0c 00 15 04 04 04 04 04 04 00 &35d0 08 08 08 08 08 08 08 00 00 00 00 00 00 00 00 00 &35e0 2e 0c 0c 0c 0c 0c 0c 00 04 04 04 04 04 04 04 00 &35f0 2a 08 08 08 08 08 08 00 3f 1d 0c 04 04 04 04 00 &3600 3f 2e 0c 08 08 08 08 00 15 04 04 04 04 04 04 00 &3610 08 08 08 08 08 08 08 00 2e 0c 0c 0c 0c 0c 0c 00 &3620 00 0c 0c 00 00 00 00 00 2a 0c 0c 0c 0c 04 04 00 &3630 00 00 00 00 08 08 08 00 3f 2e 0c 0c 0c 0c 0c 00 &3640 00 00 00 00 00 00 00 00 15 15 04 04 04 04 04 00 &3650 2e 08 08 08 0c 0c 0c 00 1d 00 15 00 1d 08 1d 00 &3660 00 2a 00 2a 00 2a 00 2f 10 00 10 00 10 00 2f 1f &3670 10 35 05 25 05 35 15 3a 2f 1f 2f 3f 3f 1f 1f 2f &3680 2a 01 2a 1f 1f 1f 1f 2b 02 01 02 01 02 01 02 01 &3690 02 01 02 01 02 01 02 01 02 01 02 15 07 15 07 15 &36a0 2f 1f 2f 0a 2b 1f 2f 1f 2f 1f 2f 15 07 1f 2f 1f &36b0 02 01 02 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &36c0 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 07 15 07 15 &36d0 2f 1f 2f 1f 2f 1f 2f 1f 2a 0b 2a 1f 2f 1f 2f 1f &36e0 2a 2b 02 0b 2a 0b 2a 0b 02 01 02 01 02 01 02 01 &36f0 02 01 02 01 02 01 02 01 17 01 02 01 02 01 02 01 &3700 3f 2b 02 01 02 01 02 01 3f 2f 2f 2f 3f 15 02 01 &3710 0f 3f 2f 2f 0f 3f 02 01 2f 1f 2f 3f 2f 15 07 15 &3720 15 2a 15 0a 3f 1f 2f 1f 00 0f 0a 0f 0a 0a 15 2a &3730 00 0a 0a 0a 00 00 15 2a 00 0a 0a 0a 0a 0f 15 2a &3740 00 00 00 00 00 0a 15 2a 00 0f 0a 0f 0a 0a 15 2a &3750 00 0a 0a 0a 0a 0a 15 2a 00 0a 0a 0f 00 0f 15 2a &3760 00 0a 0a 0a 0a 0a 15 2a 00 00 00 00 00 00 15 2a &3770 00 0f 05 05 05 05 15 2a 00 0a 00 00 00 00 15 2a &3780 00 0a 0a 0f 0a 0a 15 2a 00 0a 0a 0a 0a 0a 15 2a &3790 00 0f 0a 0f 0a 0f 15 2a 00 0a 00 0a 00 0a 15 2a &37a0 00 00 00 00 00 00 15 2a 00 0f 0a 0a 0a 0f 15 2a &37b0 00 0a 00 0a 0a 0a 15 2a 00 0f 0a 0f 0a 0a 15 2a &37c0 00 0a 0a 0a 0a 0a 15 2a 00 0f 0a 0a 0a 0a 15 2a &37d0 00 05 0a 0a 0a 0a 15 2a 00 0a 0a 0a 0a 0a 15 2a &37e0 00 0f 0a 0f 0a 0f 15 2a 15 0a 15 1f 05 1f 2f 1f &37f0 2f 1f 2f 1f 3f 0b 2a 0b 2f 1f 3f 1f 0f 3f 02 01 &3800 3f 1f 1f 1f 3f 2b 02 01 3f 05 02 01 02 01 02 01 &3810 2a 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &3820 02 01 02 01 02 01 02 01 02 15 07 01 02 01 02 01 &3830 02 0b 2a 1f 2f 15 07 01 02 15 07 15 07 1f 2f 1f &3840 02 0b 2a 0b 2a 0b 2a 0b 2f 1f 2f 1f 2f 1f 2f 1f &3850 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 01 02 01 02 01 &3860 2f 1f 2f 01 02 01 02 01 2f 1f 2f 01 02 01 02 01 &3870 2a 0b 2a 01 02 01 02 01 02 01 02 01 02 01 02 01 &3880 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &3890 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &38a0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &38b0 2f 1f 07 15 02 01 02 01 3f 0a 2f 1f 2f 1f 07 01 &38c0 15 00 00 0a 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &38d0 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &38e0 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &38f0 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &3900 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &3910 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &3920 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &3930 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &3940 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &3950 15 00 00 00 2f 1f 2f 01 15 00 00 00 2f 1f 2f 01 &3960 15 00 00 00 2f 1f 2f 01 15 00 00 15 2f 1f 2f 01 &3970 05 15 2f 1f 2f 1f 2a 01 2f 1f 2a 0b 02 01 02 01 &3980 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &3990 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &39a0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &39b0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &39c0 02 01 02 01 02 01 02 01 2f 15 07 15 07 15 02 01 &39d0 2a 0b 2a 0b 2a 0b 02 01 2f 1f 2f 1f 2f 1f 2f 1f &39e0 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &39f0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &3a00 02 01 02 01 02 01 07 15 02 01 07 15 2f 1f 2a 0b &3a10 2f 1f 2f 1f 2f 1f 2f 1f 07 15 07 15 02 01 02 01 &3a20 2f 1f 2f 0b 02 01 02 01 2f 1f 2f 01 02 01 02 01 &3a30 2a 0b 2a 01 02 01 02 01 02 01 02 0b 2a 1f 2f 15 &3a40 2a 0b 2f 1f 07 15 02 0b 02 01 02 01 2a 0b 2f 1f &3a50 07 15 07 15 07 01 02 01 2f 1f 2f 0b 2a 1f 2f 1f &3a60 2f 1f 2f 17 05 1f 2f 1f 2a 0b 2a 0b 2a 01 07 15 &3a70 07 15 07 1f 2f 1f 2a 0b 2a 0b 2a 1f 2f 1f 05 17 &3a80 02 01 02 01 02 01 2a 0b 02 01 02 01 02 01 02 01 &3a90 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &3aa0 07 15 07 15 07 15 07 15 2f 1f 2f 0b 2a 0b 2a 0b &3ab0 2f 1f 2f 15 07 15 07 15 2a 0b 2a 0b 2a 0b 2a 0b &3ac0 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &3ad0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &3ae0 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 15 &3af0 02 01 07 15 02 15 2f 1f 02 01 2a 0b 02 0b 2f 1f &3b00 02 01 2f 1f 2f 15 02 0b 02 01 2f 1f 2f 1f 2f 01 &3b10 02 01 2f 1f 2f 0b 02 01 02 01 02 15 07 15 07 01 &3b20 07 1f 2f 0b 2a 01 02 01 2a 0b 2a 1f 2f 15 07 15 &3b30 2f 1f 07 01 02 01 2a 0b 02 0b 2f 1f 2f 15 02 01 &3b40 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 01 02 01 &3b50 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 &3b60 02 01 02 01 02 01 02 01 2f 1f 2f 1f 2f 1f 2f 1f &3b70 2f 1f 2f 1f 2f 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3b80 02 01 02 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3b90 07 01 02 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3ba0 2f 1f 2f 1f 02 1f 2f 1f 02 15 07 15 02 1f 2f 1f &3bb0 02 1f 2f 1f 02 1f 2f 1f 07 1f 2f 1f 02 1f 2f 1f &3bc0 2a 0b 2a 0b 02 1f 2f 1f 07 01 02 01 02 1f 2f 1f &3bd0 2a 1f 2f 15 02 1f 2f 1f 07 15 02 01 02 1f 2f 1f &3be0 2a 0b 2a 01 02 1f 2f 1f 07 15 07 01 02 1f 2f 1f &3bf0 2a 0b 2a 01 02 1f 2f 1f 07 15 07 01 02 1f 2f 1f &3c00 2f 1f 2f 01 02 1f 2f 1f 2f 1f 2f 01 02 1f 2f 1f &3c10 2a 0b 2a 01 02 1f 2f 1f 2f 1f 2f 01 02 1f 2f 1f &3c20 2f 1f 2f 01 02 1f 2f 1f 2f 1f 2f 01 02 1f 2f 1f &3c30 07 15 07 01 02 1f 2f 1f 2a 0b 2a 01 02 1f 2f 1f &3c40 07 15 07 01 02 1f 2f 1f 2a 0b 2a 01 02 1f 2f 1f &3c50 2f 1f 2f 01 02 1f 2f 1f 2f 1f 2f 01 02 1f 2f 1f &3c60 2f 1f 2f 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3c70 02 01 02 01 02 1f 2f 1f 07 15 02 01 02 1f 2f 1f &3c80 2f 1f 02 01 02 1f 2f 1f 2f 1f 02 01 02 1f 2f 1f &3c90 2a 0b 02 01 02 1f 2f 1f 2f 1f 02 01 02 1f 2f 1f &3ca0 02 01 02 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3cb0 02 01 02 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3cc0 2a 1f 07 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3cd0 2f 1f 2f 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3ce0 02 01 02 01 02 1f 2f 1f 02 01 02 01 02 1f 2f 1f &3cf0 02 01 02 01 02 1f 2f 1f 2f 1f 2f 1f 2f 1f 2f 1f Game Disassembly ================ ; (no filename) ; 003e80 007d80 004180 &42b3 - &42b5 enemies_materialisation # Top bit set if dematerialising, zero if present &42b6 - &42b8 enemies_position_fraction &42b9 - &42bb enemies_position # X &42bc - &42be enemies_position_fraction + 6 &42bf - &42c1 enemies_position + 6 # Y &42c2 - &42c4 enemies_unused &42c5 - &42c7 enemies_velocity_fraction &42c8 - &42ca enemies_velocity &42cb - &42cd enemies_velocity_fraction + 6 &42ce - &42d0 enemies_velocity + 6 &42d1 - &42d3 enemies_acceleration_fraction &42d4 - &42d6 enemies_acceleration &42d7 - &42d9 enemies_acceleration_fraction + 6 &42da - &42dc enemies_acceleration + 6 &42dd - &42df enemies_type &42e0 - &42e2 enemies_change_cooldown &42e3 - &42e5 enemies_loop_stage &42e6 - &42e8 enemies_loop_direction &42e9 - &42eb enemies_screen_address_low &42ec - &42ee enemies_screen_address_high &42ef - &42f3 nasties_velocity_y &42f4 - &42f9 room_doors_temporarily_closed &42fa - &42ff room_doors_offset &4300 - &430f previous_palette_table_for_odd_rows &4310 - &431f previous_palette_table_for_even_rows &4330 - &432f palette_table_for_even_rows &4320 - &433f palette_table_for_odd_rows &4340 - &4344 room_consumables_data &4345 - &4349 room_consumables_sprite &434a - &434e room_consumables_x &434f - &4353 room_consumables_y &4354 - &435d room_consumables_offset &435e - &4373 objects_y &4374 - &4389 objects_rooms &438a - &439f objects_x &43a0 - &43b5 objects_pocket &43b6 - &43c0 trapdoor_states &43c1 - &43c6 room_doors_location &43c7 - &43c6 room_doors_locked # &c0 if door locked &43cd - &43c2 room_doors_colour &43d3 - &43d7 nasties_x &43d8 - &43dc nasties_y &43dd - &43e1 nasties_screen_address_low &43e2 - &43e6 nasties_screen_address_high &43e7 - &43eb nasties_velocity_x &43ec - &43f0 nasties_animation &43f1 - &43f3 enemies_animation_fraction &43f4 - &43f6 enemies_sprite_previous &43f7 - &43f9 enemies_colour &43fa - &43fc enemies_room &43fd - &43ff enemies_animation &4400 - &7fff screen memory # &3e80 - &7e7f moved to &0380 - &437f at &7da5 ; font_data &0380 57 35 ab 3a ; "0" &0384 02 20 57 35 ; "1" &0388 c3 35 eb 30 ; "2" &038c c3 30 eb 3a ; "3" &0390 d5 00 ea 2a ; "4" &0394 d7 30 c3 3a ; "5" &0398 d7 35 c3 3a ; "6" &039c 03 00 ab 2a ; "7" &03a0 d7 35 eb 3a ; "8" &03a4 d7 30 eb 3a ; "9" &03a8 2a 2a 15 15 ; ":" &03ac 0f 5a 5a f0 ; "%" # Room Types # ========== # 0 ROOM_SQUARE # 1 ROOM_TALL # 2 ROOM_WIDE # 3 OCTAGON # 4 CAVERN_SQUARE # 5 CAVERN_TALL # 6 CAVERN_WIDE # 7 STAIRS_VERTICAL # 8 STAIRS_HORIZONTAL # 9 EXIT # # a STATUS_AREA ; walls_a STATUS_AREA &03b0 78 19 92 08 &03b4 9f 19 92 08 &03b8 78 1a 11 1a &03bc 9f 1a 11 16 &03c0 9f ab 0e 0a &03c4 78 ab 0e 06 &03c8 8c c0 0c 12 &03cc 8b 03 0a 02 &03d0 8b c0 0c 1e &03d4 8c 03 0b 0e ; unused &03d8 8c 83 01 00 # This would plot two pixels underneath turkey &03dc 83 83 01 00 ; unused &03e0 00 00 ; walls_0 ROOM_SQUARE &03e2 00 00 77 80 bf &03e7 11 1f 55 80 81 &03ec 77 00 20 0a &03f0 01 00 1f 06 &03f4 01 bf 1f 1a &03f8 77 bf 20 16 ; walls_1 ROOM_TALL &03fc 16 00 4b 80 bf &0401 27 1f 29 80 81 &0406 17 00 1f 06 &040a 17 bf 1f 1a &040e 61 bf 1f 16 &0412 61 00 1f 0a ; walls_2 ROOM_WIDE &0416 00 1c 77 80 87 &041b 11 3b 55 80 49 &0420 01 1c 1f 06 &0424 77 1c 1f 0a &0428 01 a3 1f 1a &042c 77 a3 1f 16 ; walls_3 OCTAGON &0430 11 35 54 08 &0434 66 35 54 08 &0438 1b 1f 40 00 &043c 1b a0 40 00 &0440 13 bf 50 00 &0444 13 00 50 00 &0448 00 26 72 08 &044c 77 25 74 08 &0450 5a a0 17 1a &0454 64 bf 25 1a &0458 01 26 25 1a &045c 64 00 25 06 &0460 01 99 25 06 &0464 12 37 17 1a &0468 12 88 17 06 &046c 5a 1f 17 06 &0470 15 bf 1e 19 &0474 63 bf 1e 17 &0478 1d 1f 1e 17 &047c 5b 1f 1e 19 &0480 11 36 10 14 &0484 77 9a 10 14 &0488 66 36 10 1c &048c 00 9a 10 1c ; walls_4 CAVERN_SQUARE &0490 4e 9c 24 10 &0494 4e 23 24 10 &0498 5e 4c 26 08 &049c 19 4b 28 08 &04a0 0f 87 12 1a &04a4 0f 87 19 07 &04a8 14 a0 0b 02 &04ac 1f a6 0a 1c &04b0 19 4b 20 17 &04b4 20 16 14 0b &04b8 2a 23 0d 15 &04bc 5d 4c 0d 1e &04c0 6a 46 0c 13 &04c4 5e 3d 1f 19 &04c8 66 1d 18 0f &04cc 4e 9c 0e 01 &04d0 68 86 18 0a &04d4 5e 73 13 06 &04d8 2a 9d 1b 09 &04dc 50 9d 1b 07 &04e0 24 08 1b 07 &04e4 4e 23 1b 19 &04e8 22 b8 34 00 &04ec 23 07 31 00 &04f0 09 47 11 01 &04f4 09 78 10 1f &04f8 08 77 30 18 &04fc 24 09 09 14 &0500 5e 4d 12 1f &0504 5e 73 11 01 &0508 6f 48 2e 08 &050c 64 bd 26 1a &0510 64 bf 20 17 &0514 67 87 0f 04 &0518 6f 77 20 07 &051c 56 b8 0c 02 &0520 00 8c 25 07 &0524 09 b0 12 02 &0528 1b bb 07 1e &052c 0a 77 14 0a &0530 1c ba 15 19 &0534 09 af 0f 1b &0538 00 8d 0e 1e &053c 65 1d 1c 1a &0540 55 08 1f 1f &0544 75 ff 31 09 &0548 69 2f 0d 0b &054c 67 31 0f 04 &0550 76 40 0c 0e &0554 77 40 07 0c &0558 09 47 24 17 &055c 00 23 23 1b &0560 11 2b 10 12 &0564 20 17 16 17 ; walls_5 CAVERN_TALL &0568 30 9c 18 00 &056c 31 9d 1b 09 &0570 49 9d 1b 07 &0574 2a 08 1b 07 &0578 49 23 1b 19 &057c 29 b8 26 00 &0580 30 23 18 00 &0584 29 07 26 00 &0588 31 9c 0e 0f &058c 23 a0 27 17 &0590 19 79 13 19 &0594 15 46 20 07 &0598 24 3e 0f 0e &059c 25 3e 26 17 &05a0 31 24 0e 13 &05a4 2a 0a 13 12 &05a8 50 74 1c 1a &05ac 5f 58 0d 15 &05b0 54 4b 0d 1c &05b4 62 3e 1d 16 &05b8 54 20 0a 0f &05bc 4f b8 0d 02 &05c0 6b 40 0a 05 &05c4 61 70 11 0f &05c8 60 72 27 1a &05cc 5e 57 13 1e &05d0 53 20 1f 19 &05d4 6b 41 15 0e &05d8 61 3e 10 1d &05dc 73 30 10 0a &05e0 5a ff 31 06 &05e4 5a 02 0a 0e &05e8 2a b8 13 0f &05ec 08 83 3a 07 &05f0 16 ba 1a 1a &05f4 1c 18 17 15 &05f8 19 79 10 0e &05fc 08 82 18 19 &0600 23 1a 1c 16 &0604 09 00 0c 00 &0608 22 1b 06 11 &060c 1d 66 0f 0f &0610 0f 69 2f 17 &0614 03 3c 11 02 &0618 24 3d 0e 14 &061c 02 3a 13 1e &0620 16 30 2e 17 &0624 56 a3 1b 07 &0628 48 9c 0d 02 &062c 55 a3 0b 1c &0630 4f 73 24 06 &0634 5d bf 23 1b &0638 61 71 2a 06 &063c 62 97 15 01 ; walls_6 CAVERN_WIDE &0640 5e 4c 26 08 &0644 19 4b 26 08 &0648 09 47 11 01 &064c 09 77 11 1f &0650 08 77 30 18 &0654 5e 4d 12 1f &0658 5e 73 11 01 &065c 6f 48 2e 08 &0660 1a 72 0e 0a &0664 14 81 19 07 &0668 1b 9b 1d 1f &066c 52 9a 11 1f &0670 5e 73 0d 05 &0674 69 81 15 09 &0678 01 86 2f 07 &067c 09 76 0f 0a &0680 14 7e 12 0e &0684 0d b5 1b 1a &0688 0d b6 26 1f &068c 5e 4c 0f 17 &0690 5a 3d 0f 1a &0694 19 25 16 02 &0698 1a 24 14 09 &069c 1a 4b 13 17 &06a0 09 47 17 17 &06a4 04 32 32 19 &06a8 11 01 24 07 &06ac 15 39 10 12 &06b0 29 12 18 13 &06b4 30 30 12 1e &06b8 29 12 19 1e &06bc 31 31 20 17 &06c0 43 27 21 18 &06c4 59 3e 11 1e &06c8 6b 35 13 07 &06cc 6b 35 16 1a &06d0 61 2e 13 1d &06d4 62 2e 0c 14 &06d8 44 27 12 1f &06dc 56 22 25 19 &06e0 44 07 1a 1f &06e4 76 1f 1e 15 &06e8 6e 77 0c 05 &06ec 6e ab 27 19 &06f0 6d ac 15 0f &06f4 62 95 17 06 &06f8 32 ac 12 04 &06fc 37 93 0d 04 &0700 44 a1 0d 1e &0704 32 ac 17 19 &0708 58 b2 18 17 &070c 44 bf 12 1d &0710 45 a0 1d 08 &0714 69 82 0e 01 ; walls_7 STAIRS_VERTICAL &0718 20 a0 36 00 &071c 1b fc c3 21 &0720 5d fd c1 20 &0724 1a 00 41 00 &0728 0b bf 61 00 &072c 57 a0 1a 05 &0730 21 a0 1a 0b &0734 2b 1f 20 00 &0738 2c 20 1f 16 &073c 4d 1f 1f 1a &0740 28 32 26 00 &0744 26 47 2a 00 &0748 24 5d 2e 00 &074c 21 72 33 00 &0750 1f 89 38 00 &0754 20 a1 17 18 &0758 57 a1 17 18 &075c 54 89 16 18 &0760 22 89 16 18 &0764 25 72 14 18 &0768 52 72 14 18 &076c 50 5d 15 18 &0770 27 5d 15 18 &0774 29 47 14 18 &0778 4e 47 14 18 &077c 4c 32 13 18 &0780 2b 32 12 18 &0784 2e a1 1e 09 &0788 4a a1 1e 07 ; walls_8 STAIRS_HORIZONTAL &078c 1d 37 50 08 &0790 00 bf be 18 &0794 00 00 78 01 &0798 00 c0 78 1f &079c 77 1e 84 08 &07a0 77 1f 28 0a &07a4 77 a1 28 16 &07a8 01 bf 37 1a &07ac 01 00 37 06 &07b0 62 47 31 08 &07b4 29 37 50 08 &07b8 35 3a 4a 08 &07bc 41 3d 44 08 &07c0 4c 40 3e 08 &07c4 57 43 38 08 &07c8 1d 38 0b 00 &07cc 1d 87 0b 00 &07d0 57 78 0a 00 &07d4 57 47 0b 00 &07d8 29 3b 0b 00 &07dc 35 3e 0b 00 &07e0 41 41 0a 00 &07e4 4c 44 0a 00 &07e8 4c 7b 0a 00 &07ec 41 7e 0a 00 &07f0 35 81 0b 00 &07f4 29 84 0b 00 &07f8 00 3d 1c 02 &07fc 00 86 1c 1e ; OS sound workspace &0800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0830 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; OS channel buffers &0840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0850 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0870 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; door_gap_x_offsets &0880 00 04 0f 04 ; CLOCK &0884 00 fd 0f fd ; BOOKCASE &0888 00 03 0f 03 ; BARREL &088c 00 04 0f 04 ; STATUE &0890 00 ff 0f ff ; ANGULAR, ROUND &0894 00 ff 0f ff ; ACG ; door_gap_y_offsets &0898 05 00 05 01 ; CLOCK &089c ff 00 ff 01 ; BOOKCASE &08a0 06 00 06 01 ; BARREL &08a4 08 00 08 01 ; STATUE &08a8 ff 00 ff 01 ; ANGULAR, ROUND &08ac fb 00 fb 01 ; ACG ; door_gap_lengths ; v h &08b0 1c 0e ; CLOCK &08b2 28 1c ; BOOKCASE &08b4 1a 10 ; BARREL &08b6 12 0d ; STATUE &08b8 28 18 ; ANGULAR, ROUND &08ba 30 00 ; ACG ; door_sizes &08bc ea 14 0a fc ; OS envelope storage area &08c0 01 00 00 00 00 00 00 7e ff 00 ff 7e 78 00 00 00 ; envelope 1 &08d0 01 0f 0f 0f ff ff ff 7e 01 00 f7 7e 78 00 00 00 ; envelope 2 &08e0 01 00 00 00 00 00 00 04 ff 00 fd 7e 78 00 00 00 ; envelope 3 &08f0 01 fd fe ff 14 14 14 01 00 00 ff 01 01 00 00 00 ; envelope 4 &0900 01 02 04 06 0a 14 1e 01 00 00 ff 01 01 00 00 00 ; envelope 5 &0910 01 ec ec ec 02 01 01 7e ff 82 82 7e 7d 00 00 00 ; envelope 6 &0920 01 05 fe ff 0a 14 0a 7e ff 00 ff 7e 78 00 00 00 ; envelope 7 &0930 01 fd 07 fd 02 02 02 7e fe fd fd 7e 78 00 00 00 ; envelope 8 &0940 01 01 ff 01 04 04 04 7e fe 00 ff 7e 78 00 00 00 ; envelope 9 &0950 02 01 ff 00 03 03 03 6e ff 00 ff 6e 50 00 00 00 ; envelope 10 ; walls_9 EXIT &0960 00 00 c7 08 &0964 11 00 c7 08 ; unused &0968 00 00 00 00 ; other_sprites ; other_sprite_00 ENEMY_HAT_RIGHT &096c 00 00 00 00 00 00 00 00 00 0b ff e8 ff ff f7 17 &097c ff fd 00 ea b0 00 35 c0 00 35 c0 00 ff 00 2b f4 &098c 00 55 00 00 ; other_sprite_01 ENEMY_HAT_RIGHT_2 &0990 bf e8 00 07 f5 80 00 7f f0 0b d5 5c ff ff f7 17 &09a0 ff fd 00 00 10 00 00 00 00 00 00 00 00 00 00 00 &09b0 00 00 00 00 ; other_sprite_02 ENEMY_PHANTOM_RIGHT &09b4 5a aa a4 fa be a8 02 be b0 1a bf d4 6b 6a a8 a8 &09c4 aa a8 28 ab e8 19 96 50 aa 6a f0 ea a8 00 3a a9 &09d4 00 03 aa a0 ; other_sprite_03 ENEMY_PHANTOM_RIGHT_2 &09d8 aa a9 40 3a be a4 06 be a8 1a bf b0 6b 6a 68 a8 &09e8 aa a8 28 ab a8 19 96 7c aa 6a f0 aa a8 00 3a a9 &09f8 00 03 ea b0 ; other_sprite_04 ENEMY_WITCH_RIGHT &09fc 09 aa 80 06 57 a0 1a 96 a0 6a fa c0 a9 a7 00 ea &0a0c aa 00 39 fe 90 0e bc ec 02 28 00 1a 8b 00 aa a2 &0a1c 00 0f a8 00 ; other_sprite_05 ENEMY_WITCH_RIGHT_2 &0a20 09 aa 80 06 95 e0 1a a5 a0 6b fa c0 aa a7 00 ea &0a30 aa 40 39 fd a4 0e bc 30 02 28 00 5a 8b 00 ea a2 &0a40 00 0f a8 00 ; other_sprite_06 ENEMY_BAT &0a44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 &0a54 23 00 0c fc c0 30 b8 30 33 ff 30 c3 47 0c c0 00 &0a64 0c c0 00 0c ; other_sprite_07 ENEMY_BAT_2 &0a68 c0 00 0c c0 00 0c c0 00 0c 30 00 30 30 00 30 0c &0a78 20 c0 0c fc c0 04 b8 40 03 ff 00 03 47 00 00 00 &0a88 00 00 00 00 ; other_sprite_08 ENEMY_APPLE &0a8c 1a 41 a4 6a be a9 aa 7d aa aa aa aa a8 28 2a a8 &0a9c aa 2a 2a aa a8 0e be b0 5a 00 a5 fc 00 3f 00 00 &0aac 00 00 00 00 ; other_sprite_09 ENEMY_APPLE_2 &0ab0 1a 41 a4 6a be a9 aa 41 aa aa aa aa a8 28 2a a8 &0ac0 aa 2a 2a aa a8 0e aa b0 02 82 80 0a 00 a0 28 00 &0ad0 28 f0 00 0f ; other_sprite_0a ENEMY_GHOST_ONE &0ad4 00 00 00 ee 3c bb ff ff ff 3f 55 fc 3d ff 7c 2f &0ae4 ff f8 2f be f8 2f ff f8 0d 7d 70 0b 7d e0 03 ff &0af4 c0 00 ff 00 ; other_sprite_0b ENEMY_GHOST_ONE_2 &0af8 00 00 00 00 00 00 ee 3c bb ff ff ff 3d ff 7c 3f &0b08 55 fc 2f ff f8 2f ff f8 0d be 70 0b 7d e0 03 ff &0b18 c0 00 ff 00 ; other_sprite_0c ENEMY_GHOST_TWO &0b1c 00 00 00 00 14 00 80 aa 02 a6 aa 9a aa aa aa 6a &0b2c aa a9 2a aa a8 1b eb e4 0a eb a0 06 69 90 02 aa &0b3c 80 00 aa 00 ; other_sprite_0d ENEMY_GHOST_TWO_2 &0b40 00 00 00 19 00 64 6a 41 a9 aa aa aa aa aa aa 6a &0b50 aa a9 2a aa a8 1b eb e4 0a eb a0 06 69 90 02 aa &0b60 80 00 aa 00 ; other_sprite_0e ENEMY_TENTACLES &0b64 00 5a a0 9a aa 88 2a 66 a0 2a 9a a0 8a aa 88 0b &0b74 ef 80 2a ee a4 8a aa 08 06 aa 40 06 22 40 18 20 &0b84 90 20 60 20 ; other_sprite_0f ENEMY_TENTACLES_2 &0b88 2a 94 08 4a aa 88 2a aa a0 8a 66 84 0a 9a a4 0b &0b98 ef 80 69 ed a0 86 aa 88 06 aa 40 06 22 40 18 20 &0ba8 90 20 24 20 ; other_sprite_10 ENEMY_GHOST_THREE &0bac 40 06 91 00 1a 00 c0 69 03 c1 aa 43 f6 aa 9f fa &0bbc aa af fa aa af fa 28 af ca 69 a3 c6 aa 93 02 aa &0bcc 80 00 aa 00 ; other_sprite_11 ENEMY_GHOST_THREE_2 &0bd0 06 90 00 40 a8 01 00 6a 00 c1 aa 43 c6 aa 93 fa &0be0 aa af fa aa af fa 28 af fa 69 af c6 aa 93 c2 aa &0bf0 83 00 aa 00 ; other_sprite_12 ENEMY_RADISH &0bf4 20 00 20 24 44 60 09 99 80 16 56 50 6a aa a4 aa &0c04 aa a8 a8 e3 a8 a8 20 a8 2a aa a0 2a 69 a0 0a aa &0c14 80 00 a8 00 ; other_sprite_13 ENEMY_RADISH_2 &0c18 00 88 00 20 88 20 29 99 a0 16 aa 50 6a 56 a4 aa &0c28 aa a8 ab 2c a8 a8 20 a8 2a aa a0 29 a6 a0 0a aa &0c38 80 00 a8 00 ; other_sprite_14 ENEMY_PUMPKIN &0c3c 02 aa 80 1a ee e4 2b bb a8 aa aa aa aa 96 aa aa &0c4c aa aa 6b ae e9 2a eb a8 0a aa a0 01 aa 40 00 24 &0c5c 00 00 0a a0 ; other_sprite_15 ENEMY_PUMPKIN_2 &0c60 02 aa 80 1a ff a4 2b ee e8 aa aa aa aa 96 aa aa &0c70 aa aa 6a fb a9 2a eb a8 0a aa a0 01 ff 40 00 3c &0c80 00 0f f0 00 ; other_sprite_16 ENEMY_HAT_LEFT &0c84 00 00 00 00 00 00 00 00 00 2b ff e0 df ff ff 7f &0c94 ff d4 0e ab 00 03 5c 00 03 5c 00 00 ff 00 00 1f &0ca4 e8 00 00 55 ; other_sprite_17 ENEMY_HAT_LEFT_2 &0ca8 00 2b fe 02 5f d0 0f fd 00 35 57 e0 df ff ff 7f &0cb8 ff d4 04 00 00 00 00 00 00 00 00 00 00 00 00 00 &0cc8 00 00 00 00 ; other_sprite_18 ENEMY_PHANTOM_LEFT &0ccc 1a aa a5 2a be af 0e be 80 17 fe a4 2a a9 e9 2a &0cdc aa 2a 2b ea 28 05 96 64 0f a9 aa 00 2a ab 00 6a &0cec ac 0a aa c0 ; other_sprite_19 ENEMY_PHANTOM_LEFT_2 &0cf0 01 6a aa 1a be ac 2a be 90 0e fe a4 29 a9 e9 2a &0d00 aa 2a 2a ea 28 3d 96 64 0f a9 aa 00 2a aa 00 6a &0d10 ac 0e ab c0 ; other_sprite_1a ENEMY_WITCH_LEFT &0d14 02 aa 60 0b 56 90 0a 5a a4 03 af e9 00 da aa 01 &0d24 aa ab 1a 7f 6c 0c 3e b0 00 28 80 00 e2 a5 00 8a &0d34 ab 00 2a f0 ; other_sprite_1b ENEMY_WITCH_LEFT_2 &0d38 02 aa 60 0a d5 90 0a 96 a4 03 af a9 00 da 6a 00 &0d48 aa ab 06 bf 6c 3b 3e b0 00 28 80 00 e2 a4 00 8a &0d58 aa 00 2a f0 ; other_sprite_1c CAN &0d5c 03 ff 00 0d 55 c0 35 65 70 1d 65 d0 1d 59 d0 1d &0d6c a9 d0 1d 55 d0 15 fd 50 1f ff d0 3f ff f0 0f ff &0d7c c0 03 ff 00 ; other_sprite_1d DRUMSTICK &0d80 05 55 40 16 aa 50 1a aa 90 16 aa 50 05 55 40 05 &0d90 55 40 01 55 00 01 55 00 00 54 00 00 fc 00 03 ff &0da0 00 03 cf 00 ; other_sprite_1e LOLLIPOP &0da4 00 20 00 00 20 00 00 20 00 00 20 00 00 20 00 00 &0db4 20 00 00 54 00 01 55 00 07 55 40 07 d5 40 01 f5 &0dc4 00 00 54 00 ; other_sprite_1f WINE_BOTTLE &0dc8 01 55 40 01 d5 40 01 d5 40 01 d5 40 01 d5 40 01 &0dd8 d5 40 01 d5 40 01 d5 40 01 75 40 00 55 00 00 3c &0de8 00 00 28 00 ; other_sprite_20 DESSERT &0dec 03 ff c0 0f ff f0 3f ff fc ff ff ff aa aa aa 2a &0dfc aa a8 09 a9 94 05 99 50 01 55 40 00 55 00 00 14 &0e0c 00 00 00 00 ; other_sprite_21 WINEGLASS &0e10 02 aa 00 00 20 00 00 20 00 00 20 00 00 a8 00 02 &0e20 aa 00 0b 57 80 2d 55 e0 b5 55 78 95 55 58 95 55 &0e30 58 00 00 00 ; other_sprite_22 APPLE &0e34 02 aa 80 0a fe a0 2b fa a8 2f ea a8 bf aa aa bf &0e44 aa aa bf aa aa bf ea aa 2f ea a8 0a 99 a0 01 59 &0e54 40 05 40 54 ; other_sprite_23 STICK &0e58 00 00 20 00 00 68 00 02 58 00 06 90 00 25 80 00 &0e68 69 00 02 58 00 06 90 00 25 80 00 29 00 00 08 00 &0e78 00 00 00 00 ; other_sprite_24 MUSHROOM &0e7c 00 02 bf 00 00 fc 00 01 f0 05 1f f0 3e db c0 fe &0e8c ed 80 fb bb c0 ff ef f0 3e fb b0 2f ef e0 0b ff &0e9c 80 00 a8 00 ; other_sprite_25 KEY &0ea0 00 00 00 00 00 00 00 00 00 3e 00 88 fb a0 fc ff &0eb0 ff ab f7 50 00 3d 00 00 00 00 00 00 00 00 00 00 &0ec0 00 00 00 00 ; other_sprite_26 ACG_LEFT &0ec4 a0 a0 aa aa a2 80 a0 a2 80 a0 a2 80 2a bf aa 15 &0ed4 55 55 5f ff ff 15 55 55 00 00 00 00 00 00 00 00 &0ee4 00 00 00 00 ; other_sprite_27 ACG_MIDDLE &0ee8 0a a8 00 28 0a 00 28 a8 02 28 00 09 fa a8 25 55 &0ef8 55 55 ff ff ff 55 55 55 00 00 25 00 00 09 00 00 &0f08 02 00 00 00 ; other_sprite_28 ACG_RIGHT &0f0c 00 00 00 26 60 00 55 56 00 40 05 80 00 01 60 55 &0f1c 55 54 ff ff f5 55 55 54 00 01 60 40 05 80 55 56 &0f2c 00 26 60 00 ; other_sprite_29 CLAW &0f30 02 00 00 22 20 00 b3 30 00 f7 f0 00 ff c0 00 ff &0f40 00 40 3f 47 f4 3e ff bd 0e be af 0f be bc 03 ff &0f50 f0 00 ff 00 ; other_sprite_2a MASK &0f54 00 00 00 02 aa 00 02 fe 00 0a fe 80 0b 57 80 2b &0f64 df a0 2f ff e0 2c 71 e0 2d 75 e0 2b ff a0 0a aa &0f74 80 02 aa 00 ; other_sprite_2b GARLIC &0f78 00 00 00 00 00 00 03 c0 00 0f ba c0 0f b7 f0 0f &0f88 ed fc 0f fb a4 03 fe 70 03 ff e8 00 ff ff 00 1f &0f98 ff 00 01 fc ; other_sprite_2c COIN &0f9c 00 00 00 00 00 00 00 2a a0 00 bf e8 00 fd 7a 03 &0fac f5 7e 03 f1 4e 03 55 0e 03 f9 0e 00 f4 38 00 3f &0fbc e0 00 00 00 ; other_sprite_2d BOTTLE &0fc0 09 55 58 0b f7 f8 0b 75 78 0b f7 f8 0b 77 58 0b &0fd0 f7 f8 09 55 58 0a aa a8 02 aa a0 00 7f 40 00 3f &0fe0 00 00 3f 00 ; other_sprite_2e DIAMOND &0fe4 00 7d 00 03 7d c0 0a d7 a0 3a d7 ac 5f d7 f5 f5 &0ff4 69 5f f5 69 5f 5f d7 f5 3a d7 ac 0a d7 a0 03 7d &1004 c0 00 7d 00 ; other_sprite_2f CHALICE &1008 02 aa 80 2a ff e8 aa ff ea aa bf aa aa ee ea 2a &1018 ee e8 0a aa a0 2a 55 a8 a5 55 5a 95 55 56 0a 55 &1028 a0 00 aa 00 ; other_sprite_30 HORSESHOE &102c 00 00 00 00 00 00 0a 05 00 5a 07 c0 7c 03 a0 3a &103c 00 ac 1a 00 3a 1f 00 1a 0e 80 3a 02 b1 ad 00 eb &104c a0 00 2b d0 ; other_sprite_31 SPANNER &1050 a0 00 00 f8 00 00 fe 00 00 3f 80 00 0f f0 00 03 &1060 fe be 00 ff ff 00 3f c0 00 0f e0 00 03 ff 00 00 &1070 7d 00 00 00 ; other_sprite_32 CRUCIFIX &1074 00 10 00 00 54 00 00 20 00 00 20 00 10 a8 10 f5 &1084 55 7c 10 a8 10 00 20 00 00 ec 00 03 67 00 00 54 &1094 00 00 10 00 ; other_sprite_33 LEAF &1098 00 00 19 00 07 fe 00 7f 9c 03 fa ac 0f aa ac 0e &10a8 aa bc 3e aa f0 3a a9 f0 fa a7 c0 ea 77 00 ff fc &10b8 00 3f 00 00 ; other_sprite_34 TOMBSTONE &10bc 05 55 54 16 aa a5 1a aa a9 16 a6 a5 05 a7 94 00 &10cc 57 40 00 07 00 00 07 00 00 7f f0 00 57 f0 00 07 &10dc 00 00 07 00 ; other_sprite_35 MATERIALISATION &10e0 32 1d 8b 04 c0 34 2c 23 43 01 36 38 1c 00 00 c3 &10f0 87 93 08 0c 38 8c 70 81 12 07 0c 20 c2 10 4d 20 &1100 88 36 1e 31 ; other_sprite_36 DEMATERIALISATION &1104 cc 30 cc 33 33 30 c8 64 83 32 22 0c 04 44 40 fa &1114 11 af 04 44 40 32 12 0c c8 64 83 30 20 30 c3 33 &1124 0c 0c 30 c3 ; background_sprite_e CLOSED_DOOR_HORIZONTAL &1128 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 57 &1138 d5 55 5e b5 55 5e b5 55 57 d5 55 55 55 55 ; unused &1146 00 00 00 00 00 00 ; background_sprite_f CLOSED_DOOR_VERTICAL &114c 15 55 54 55 55 55 55 55 55 55 55 55 55 55 f5 55 &115c 57 ad 55 57 ad 55 55 f5 55 55 55 55 55 55 55 55 &116c 55 ; unused &116d 00 00 00 ; other_sprite_39 DRACULA &1170 01 42 b0 0f 96 00 09 ea 28 0a 7f 68 0d aa 9c 03 &1180 59 70 02 15 20 08 95 88 1c b7 8d 02 c8 e0 03 6a &1190 70 00 ea c0 ; other_sprite_3a DRACULA_2 &11a0 03 a2 b0 00 26 00 0a 2a 28 0a 7f 68 0d aa 9c 03 &1180 59 70 02 15 20 08 95 88 1c b7 8d 02 c8 e0 03 6a &1190 70 00 ea c0 ; other_sprite_3b DRACULA_3 &11a0 03 a0 50 00 25 bc 0a 2a d8 0a 7f 68 0d aa 9c 03 &1180 59 70 02 15 20 08 95 88 1c b7 8d 02 c8 e0 03 6a &1190 70 00 ea c0 ; other_sprite_3c DEVIL &11a0 00 52 8a 00 e2 07 00 3a 18 00 6a 60 05 95 94 25 &1180 aa 96 0f d5 fc 00 95 80 02 0c 20 06 22 24 2e 95 &1190 ae 30 ea c3 ; other_sprite_3d DEVIL_2 &11a0 00 a2 8a 00 37 07 00 2a 18 00 6a 60 05 95 94 25 &1180 aa 96 0f d5 fc 00 95 80 02 0c 20 06 22 24 2e 95 &1190 ae 30 ea c3 ; other_sprite_3e DEVIL_3 &11a0 00 a1 4a 00 22 c7 00 2b 18 00 6a 60 05 95 94 25 &1180 aa 96 0f d5 fc 00 95 80 02 0c 20 06 22 24 2e 95 &1190 ae 30 ea c3 ; other_sprite_3f FRANKENSTEIN &11a0 00 52 80 02 a1 00 00 d6 00 04 aa 8d 34 d5 c9 29 &1180 a6 8a 29 a6 ba 29 a6 bb 0f 77 70 06 95 a4 0a 08 &1190 28 03 6a 70 ; other_sprite_40 FRANKENSTEIN_2 &11a0 00 a2 80 00 11 00 00 66 40 1c aa 8d 18 d5 c9 28 &1180 a6 8a 2b a6 ba 3b a6 bb 03 77 70 06 95 a4 0a 08 &1190 28 03 6a 70 ; other_sprite_41 FRANKENSTEIN_3 &11a0 00 a1 40 00 12 a0 00 65 c0 1c aa 84 18 d5 c7 28 &1180 a6 9a 2b a6 9a 3b a6 9a 03 77 7c 06 95 a4 0a 08 &1190 28 03 6a 70 ; other_sprite_42 MUMMY &11a0 05 5a b0 02 9e c0 01 9e c0 01 9e 80 02 ed c0 01 &1180 aa 0a 03 96 6a 96 aa a8 aa af b0 3f 1a 40 00 1a &1190 40 00 3a c0 ; other_sprite_43 MUMMY_2 &11a0 0e b6 b0 03 b6 c0 03 b6 c0 02 aa 80 00 ed c0 00 &1180 aa 00 a1 96 4a aa aa aa 3e 82 bc 00 69 00 00 99 &1190 00 00 eb 00 ; other_sprite_44 MUMMY_3 &11a0 0e b5 50 03 b6 80 03 b6 40 02 a6 40 00 ed 80 a0 &1180 aa c0 a9 96 40 2a aa a0 0e fa a8 01 a4 28 01 98 &1190 0c 03 ac 00 ; other_sprite_45 HUNCHBACK &11a0 15 0a b0 3a 8a 00 02 aa 00 33 ff 0c a2 aa 8a a2 &1180 aa 8a ab 55 ea ae eb ba 2a 96 a8 3a 28 ac 02 69 &1190 80 00 eb 00 ; other_sprite_46 HUNCHBACK_2 &11a0 3a 8a b0 02 8a 00 02 aa 00 33 ff 0c a2 aa 8a a2 &1180 aa 8a ab 55 ea ae ff ba 2a 96 a8 3a 28 ac 02 69 &1190 80 00 eb 00 ; other_sprite_47 HUNCHBACK_3 &11a0 3a 81 50 02 8a b0 02 aa 00 33 ff 0c a2 aa 8a a2 &1180 aa 8a ab 55 ea ae eb ba 2a 96 a8 3a 28 ac 02 69 &1190 80 00 eb 00 ; background_sprite_0 CLOCK_HORIZONTAL &138c 00 00 15 54 00 00 00 05 7a aa 00 00 00 15 5d 55 &139c 40 00 15 55 57 55 50 00 56 55 a5 ea a8 00 6a 56 &13ac ad 75 55 00 66 56 b9 5d 55 40 55 5a ea 57 aa a0 &13bc 59 5a ba 57 aa a0 66 56 ad 5d 55 40 6a 56 a9 75 &13cc 55 00 55 55 a5 ea a8 00 15 55 57 55 50 00 00 15 &13dc 5d 55 40 00 00 05 7a aa 00 00 00 00 15 54 00 00 ; background_sprite_1 CLOCK_VERTICAL &13ec 00 01 69 40 00 00 19 69 64 00 00 59 69 65 00 02 &13fc 59 69 65 80 06 59 69 65 90 16 5f d7 f5 94 16 75 &140c 65 5d 94 17 d6 9a 97 d4 1d 5a 9a a5 74 05 6a 9a &141c a9 50 05 6a be a9 50 05 6a a9 a9 50 05 5a aa 65 &142c 50 01 56 aa 95 40 00 55 55 55 00 00 5a 7d a9 00 &143c 00 1b bb 64 00 00 1b bd 64 00 00 1a 77 a4 00 00 &144c 15 55 54 00 ; background_sprite_2 BOOKCASE_HORIZONTAL &1450 00 00 2a aa a0 00 0a aa 00 a8 aa aa a8 28 28 a0 &1460 00 a8 82 2a 88 02 28 77 2a 82 a8 28 82 2a 82 08 &1470 28 55 2a 82 08 28 ff 2a 82 08 28 82 2a 82 08 28 &1480 52 2a 82 08 28 55 2a 82 08 28 85 2a 82 08 28 82 &1490 2a 82 08 28 ff 2a 82 08 28 55 2a 82 08 28 ff 2a &14a0 82 08 28 55 2a 82 08 28 ff 2a 82 a8 28 55 2a 88 &14b0 02 28 82 2a a0 00 a8 82 2a aa aa a8 28 28 00 0a &14c0 aa 00 a8 00 00 2a aa a0 ; background_sprite_3 BOOKCASE_VERTICAL &14c8 2a aa aa aa aa aa aa a8 a0 0d c5 45 f3 74 50 0a &14d8 8a b7 a5 45 f1 de 5a a2 88 dc 05 45 f3 74 14 22 &14e8 8b 7a a5 65 f9 de 96 a2 a0 00 00 00 00 00 00 0a &14f8 2a aa aa aa aa aa aa a8 2a 00 00 00 00 00 00 a8 &1508 28 80 00 00 00 00 02 28 08 2a aa aa aa aa a8 20 &1518 08 20 00 00 00 00 08 20 08 20 00 00 00 00 08 20 &1528 08 2a aa aa aa aa a8 20 08 80 00 00 00 00 02 20 &1538 0a 00 00 00 00 00 00 a0 0a aa aa aa aa aa aa a0 ; background_sprite_4 BARREL_HORIZONTAL &1548 00 0a ff 78 00 00 b6 a9 e7 00 0b 6f ff 9d c0 2c &1568 f0 03 75 b0 33 75 57 7d ec b3 72 23 5d 7a cd 71 &1578 13 57 7b cd 7a ab 57 7b cd 75 57 57 7b cf 72 23 &1588 5f 7b 73 71 13 5d 78 33 fa ab 7d dc 1c f0 03 f3 &1598 70 07 9f ff 6e c0 00 79 56 db 00 00 05 ff b4 00 ; background_sprite_5 BARREL_VERTICAL &1598 00 0a ff a0 00 00 b5 55 5e 00 03 6d 55 79 c0 0d &15a8 db ff e7 70 27 3f ff fc d8 3c ff bf bf 3c 27 fb &15b8 ee ee d8 37 cc 0c 0c dc 37 cc cc cc dc 37 cc 0c &15c8 0c dc 37 cc cc cc dc 0e cc 0c 0c 70 06 7f 77 7d &15d8 90 01 e7 ff db 40 00 1e aa b4 00 ; background_sprite_6 STATUE_HORIZONTAL &15e3 00 00 00 ff f0 00 00 00 2f ff fc 00 c0 00 00 00 &15f3 fc 00 ff fc ff 3e ab 30 ff ff ff cf ff 7c 00 03 &1603 ff 3f f7 ff 00 03 ff 3f f7 ff ff ff ff cf ff 7c &1613 ff fc ff 3e ab 30 c0 00 00 00 fc 00 01 55 6f ff &1623 fc 00 00 00 3c ff f0 00 ; background_sprite_7 STATUE_VERTICAL &162b 00 3f c0 00 00 ff f0 00 00 2f 80 00 00 ff f0 00 &163b 0f 3f cf 00 3f cf 3f c0 3f ff ff c0 3c ff f3 c0 &164b fc ff f3 f0 fc 3f c3 f0 f0 2a 80 f0 d0 3f c0 f0 &165b 10 ff f0 74 13 ff fc 10 13 fa fc 10 13 f0 fc 00 &166b 10 f0 f0 00 10 f0 f0 00 03 f0 fc 00 0f f0 ff 00 ; background_sprite_8 ANGULAR_DOOR_FRAME_HORIZONTAL &167b aa 80 00 00 ff aa 80 00 ff ff aa 80 ff ff ff a8 &168b aa aa aa f8 00 00 00 b8 00 00 00 b8 00 00 00 b8 &169b 00 00 00 b8 00 00 00 b8 00 00 00 b8 00 00 00 b8 &16ab 00 00 00 b8 00 00 00 b8 00 00 00 b8 aa aa aa f8 &16bb ff ff ff a8 ff ff aa 80 ff aa 80 00 aa 80 00 00 ; background_sprite_9 ANGULAR_DOOR_FRAME_VERTICAL &16cb 00 2a aa aa a8 00 00 bf ff ff fe 00 00 be aa aa &16db be 00 02 b8 00 00 2e 80 02 e0 00 00 0b 80 02 e0 &16eb 00 00 0b 80 0a e0 00 00 0b a0 0b e0 00 00 0b e0 &16fb 0b e0 00 00 0b e0 2b e0 00 00 0b e8 2f e0 00 00 &170b 0b f8 2f e0 00 00 0b f8 af e0 00 00 0b fa bf e0 &171b 00 00 0b fe ; background_sprite_a ROUND_DOOR_FRAME_HORIZONTAL &171f 90 00 00 00 90 55 50 00 a5 aa a5 00 aa aa aa 40 &172f 55 55 55 90 00 00 00 64 00 00 00 64 00 00 00 64 &173f 00 00 00 64 00 00 00 64 00 00 00 64 00 00 00 64 &174f 00 00 00 64 00 00 00 64 00 00 00 64 55 55 55 90 &175f aa aa aa 40 a5 aa a5 00 90 55 50 00 90 00 00 00 ; background_sprite_b ROUND_DOOR_FRAME_VERTICAL &176f 00 00 7f fd 00 00 00 07 aa aa d0 00 00 79 55 55 &177f 6d 00 01 a4 00 00 1a 40 07 90 00 00 06 d0 06 90 &178f 00 00 06 90 1e 90 00 00 06 b4 1a 90 00 00 06 a4 &179f 1a 90 00 00 06 a4 1a 90 00 00 06 a4 16 90 00 00 &17af 06 94 05 90 00 00 06 50 01 90 00 00 06 40 ff 90 &17bf 00 00 06 ff ; unused &17c3 00 ; background_sprite_12 TABLE &17c4 7d 55 55 7d 55 55 7d 55 55 7d 69 55 7f ff ff aa &17d4 aa aa aa aa aa 6a aa aa 5a aa aa 56 aa aa 55 aa &17e4 aa 55 55 55 ; background_sprite_10 RUG &17e8 00 00 0f 00 00 00 0f c0 00 00 00 19 00 00 00 15 &17f8 40 00 00 00 19 40 00 00 1a 40 00 00 00 5a 40 00 &1808 00 5a 40 00 00 00 5a 50 00 01 6a 50 00 00 01 6a &1818 94 00 05 aa 90 00 05 45 6a a5 00 56 aa 94 00 15 &1828 55 6a a5 55 56 aa 94 00 5f 55 5a 95 a9 55 aa 95 &1838 00 5f 55 56 56 aa 95 6a 55 60 d5 55 55 55 aa 55 &1848 69 55 a8 75 55 55 55 55 55 55 55 55 ; background_sprite_11 TRAPDOOR_FRAME &1854 01 55 ff fd 55 c0 05 55 7f f5 57 f0 3f 5a aa aa &1864 af fc 3f d8 00 00 2f fc 3f f8 00 00 2f fc 17 f8 &1874 00 00 2f 54 15 78 00 00 25 54 15 58 00 00 25 54 ; player_sprites ; player_sprite_00 KNIGHT_RIGHT_HEAD &1884 0a 78 e0 08 93 d0 0d 3f b0 02 15 80 03 4a c0 00 &1894 db 00 ; player_sprite_01 KNIGHT_RIGHT_FEET_1 &1896 06 b6 00 0b 5f 90 02 0e 30 08 16 84 08 6a bc 0f &18a6 aa d0 ; player_sprite_02 KNIGHT_RIGHT_FEET_2 &18a8 00 ab 00 00 fc 00 02 fe 00 08 05 80 09 2a 80 0f &18b8 aa d0 ; player_sprite_03 KNIGHT_RIGHT_FEET_3 &18ba 06 b6 00 0b 5f 90 02 aa 30 0a 03 80 98 06 80 0f &18ca aa d0 ; player_sprite_04 KNIGHT_DOWN_HEAD &18cc 09 c3 60 08 aa a0 0d 2a b0 02 2a 80 03 4a c0 00 &18dc eb 00 ; player_sprite_05 KNIGHT_DOWN_FEET_1 &18de 01 42 b0 0a d6 c0 90 bd 00 a7 3c d9 e7 aa da 03 &18ee 7d ce ; player_sprite_06 KNIGHT_DOWN_FEET_2 &18f0 0e 82 b0 03 d7 c0 00 be 00 67 3c d9 a7 aa da 33 &1900 7d cc ; player_sprite_07 KNIGHT_DOWN_FEET_3 &1902 0e 81 40 03 97 a0 00 7e 06 67 3c da a7 aa db b3 &1912 7d c0 ; player_sprite_08 KNIGHT_LEFT_HEAD &1914 0b 2d a0 07 c6 a0 0e ff b0 02 2a 80 03 4a c0 00 &1924 d7 00 ; player_sprite_09 KNIGHT_LEFT_FEET_1 &1926 00 9e 90 06 f5 e0 0c b0 80 12 94 20 3e a9 20 07 &1936 aa f0 ; player_sprite_0a KNIGHT_LEFT_FEET_2 &1938 00 ea 00 00 3f 00 00 bf 80 02 50 20 02 a8 60 07 &1948 aa f0 ; player_sprite_0b KNIGHT_LEFT_FEET_3 &194a 00 9e 90 06 f5 e0 0c aa 80 02 c0 a0 02 90 26 07 &195a aa f0 ; player_sprite_0c KNIGHT_UP_HEAD &195c 0b aa a0 08 ff a0 0d 15 b0 02 3a 80 03 4a c0 00 &196c eb 00 ; player_sprite_0d KNIGHT_UP_FEET_1 &196e 01 42 a0 0a d6 c0 90 a9 00 a2 aa 89 e2 aa 8a 03 &197e ff ce ; player_sprite_0e KNIGHT_UP_FEET_2 &1980 0e 82 b0 03 d7 c0 00 aa 00 62 aa 89 a2 aa 8a 33 &1990 ff cc ; player_sprite_0f KNIGHT_UP_FEET_3 &1992 0a 81 40 03 97 a0 00 6a 06 62 aa 8a a2 aa 8b b3 &19a2 ff c0 ; player_sprite_10 WIZARD_RIGHT_HEAD &19a4 0a 88 60 09 a4 d0 02 aa a0 02 ab 80 00 a6 00 00 &19b4 28 00 ; player_sprite_11 WIZARD_RIGHT_FEET_1 &19b6 06 b6 00 0b 5f 90 02 fa 00 0b 0a 84 09 2a bc 0f &19c6 ea d0 ; player_sprite_12 WIZARD_RIGHT_FEET_2 &19c8 00 ab 00 01 f4 00 02 aa 00 0a 06 80 09 1a 80 0f &19d8 ea d0 ; player_sprite_13 WIZARD_RIGHT_FEET_3 &19da 06 b6 00 0b 5f 90 06 aa 00 4a c2 80 ee 06 80 0f &19ea ea d0 ; player_sprite_14 WIZARD_DOWN_HEAD &19ec 09 55 60 0a bf a0 02 ca 80 02 8e 80 00 aa 00 00 &19fc 28 00 ; player_sprite_15 WIZARD_DOWN_FEET_1 &19fe 05 42 b4 3e d7 00 90 aa 00 a2 d7 89 e2 aa 8a 03 &1a0e 7d cc ; player_sprite_16 WIZARD_DOWN_FEET_2 &1a10 1e 82 b4 00 d7 00 10 aa 04 a2 d7 8a e2 aa 8b 03 &1a20 7d c0 ; player_sprite_17 WIZARD_DOWN_FEET_3 &1a22 1e 81 50 00 d7 bc 00 aa 06 62 d7 8a a2 aa 8b 33 &1a32 7d c0 ; player_sprite_18 WIZARD_LEFT_HEAD &1a34 09 22 a0 07 1a 60 0a aa 80 02 ea 80 00 9a 00 00 &1a44 28 00 ; player_sprite_19 WIZARD_LEFT_FEET_1 &1a46 00 9e 90 06 f5 e0 00 af 80 12 a0 e0 3e a8 60 07 &1a56 ab f0 ; player_sprite_1a WIZARD_LEFT_FEET_2 &1a58 00 ea 00 00 1f 40 00 aa 80 02 90 a0 02 a4 60 07 &1a68 ab f0 ; player_sprite_1b WIZARD_LEFT_FEET_3 &1a6a 00 9e 90 06 f5 e0 00 aa 90 02 83 a1 02 90 bb 07 &1a7a ab f0 ; player_sprite_1c WIZARD_UP_HEAD &1a7c 0a ea a0 09 1a a0 02 aa 80 02 b3 80 00 a6 00 00 &1a8c 28 00 ; player_sprite_1d WIZARD_UP_FEET_1 &1a8e 05 42 b4 3e d7 00 40 a9 00 a2 aa 84 a2 aa aa 33 &1a9e ff cb ; player_sprite_1e WIZARD_UP_FEET_2 &1aa0 1e 82 b4 00 d7 00 00 aa 00 62 aa 89 a2 aa 8a 33 &1ab0 ff cc ; player_sprite_1f WIZARD_UP_FEET_3 &1ab2 1e 81 50 00 d7 bc 00 6a 01 12 aa 8a aa aa 8a e3 &1ac2 ff cc ; player_sprite_20 SERF_RIGHT_HEAD &1ac4 06 78 28 09 a4 1c 0a a6 70 0d 9a a0 02 aa a0 00 &1ad4 ea c0 ; player_sprite_21 SERF_RIGHT_FEET_1 &1ad6 06 a2 40 2b 57 a4 36 0a 22 08 0a 8c 0d 2a 58 03 &1ae6 6a 90 ; player_sprite_22 SERF_RIGHT_FEET_2 &1ae8 02 aa be 01 54 d7 06 be 00 0a 02 80 0e 0a 40 03 &1af8 aa 90 ; player_sprite_23 SERF_RIGHT_FEET_3 &1afa 01 af d4 03 5f b8 06 aa 30 4a af 80 de 85 80 0f &1b0a aa 90 ; player_sprite_24 SERF_DOWN_HEAD &1b0c 08 41 20 29 d7 68 2a 55 a8 3a aa ac 0a aa a0 03 &1b1c aa c0 ; player_sprite_25 SERF_DOWN_FEET_1 &1b1e 02 8a e0 1a d7 c0 28 b6 01 02 b6 8a 22 be 8a 32 &1b2e 28 8e ; player_sprite_26 SERF_DOWN_FEET_2 &1b30 0a ea e0 03 d7 c0 40 b6 01 a2 b6 8a a2 be 8a 32 &1b40 28 8c ; player_sprite_27 SERF_DOWN_FEET_3 &1b42 0b a2 80 03 d7 a4 40 9e 28 a2 9e 80 a2 9a 88 b2 &1b52 28 8c ; player_sprite_28 SERF_LEFT_HEAD &1b54 28 2d 90 34 1a 60 0d 9a a0 0a a6 70 0a aa 80 03 &1b64 ab 00 ; player_sprite_29 SERF_LEFT_FEET_1 &1b66 01 8a 90 1a d5 e8 88 a0 9c 32 a0 20 25 a8 70 06 &1b76 a9 c0 ; player_sprite_2a SERF_LEFT_FEET_2 &1b78 be aa 80 d7 15 40 00 be 90 02 80 a0 01 a0 b0 06 &1b88 aa c0 ; player_sprite_2b SERF_LEFT_FEET_3 &1b8a 17 fa 40 2e f5 c0 0c aa 90 02 fa a1 02 52 b7 06 &1b9a aa f0 ; player_sprite_2c SERF_UP_HEAD &1b9c 01 69 40 06 aa 90 0a aa a0 0a aa a0 0e aa b0 03 &1bac eb c0 ; player_sprite_2d SERF_UP_FEET_1 &1bae 01 82 a0 0a d7 80 0c aa 01 61 aa 4a a2 aa 8a b2 &1bbe d7 8e ; player_sprite_2e SERF_UP_FEET_2 &1bc0 0a 82 a0 02 d7 80 40 aa 01 a1 aa 4a a2 aa 8a 22 &1bd0 d7 88 ; player_sprite_2f SERF_UP_FEET_3 &1bd2 0a 82 40 02 d7 a0 40 aa 30 a1 aa 49 a2 aa 8a b2 &1be2 d7 8e ; spell_sprites ; spell_sprite_00 SPELL_SERF &1be4 00 5a 00 05 5a a0 15 5a a8 15 5a a8 15 5a a8 15 &1bf4 5a a8 05 5a a0 00 5a 00 ; spell_sprite_01 SPELL_SERF_2 &1bfc 00 55 00 05 55 f0 15 57 fc 15 5f fc 15 7f fc 15 &1c0c ff fc 07 ff f0 00 ff 00 ; spell_sprite_02 SPELL_SERF_3 &1c14 00 55 00 05 55 50 15 55 54 15 55 54 2a aa a8 2a &1c24 aa a8 0a aa a0 00 aa 00 ; spell_sprite_03 SPELL_SERF_4 &1c2c 00 55 00 0a 55 50 2a 95 54 2a a5 54 2a a9 54 2a &1c3c aa 54 0a aa 90 00 aa 00 ; spell_sprite_04 SPELL_SERF_5 &1c44 00 f5 00 0f f5 50 3f f5 54 3f f5 54 3f f5 54 3f &1c54 f5 54 0f f5 50 00 f5 00 ; spell_sprite_05 SPELL_SERF_6 &1c5c 00 aa 00 0a aa 90 2a aa 54 2a a9 54 2a a5 54 2a &1c6c 95 54 0a 55 50 00 55 00 ; spell_sprite_06 SPELL_SERF_7 &1c74 00 ff 00 0f ff f0 3f ff fc 3f ff fc 15 55 54 15 &1c84 55 54 05 55 50 00 55 00 ; spell_sprite_07 SPELL_SERF_8 &1c8c 00 aa 00 06 aa a0 15 aa a8 15 6a a8 15 5a a8 15 &1c9c 56 a8 05 55 a0 00 55 00 ; spell_sprite_08 SPELL_KNIGHT &1ca4 00 00 a8 00 02 a0 ff ca 80 ff 6a 00 fd a8 00 f6 &1cb4 a0 00 0a 80 00 00 00 00 ; spell_sprite_09 SPELL_KNIGHT_2 &1cbc 2a 00 00 0a 80 00 02 a0 00 00 a8 00 0f 6a 00 0f &1ccc da 80 0f f6 a0 0f fc 00 ; spell_sprite_0a SPELL_KNIGHT_3 &1cd4 00 00 00 00 02 a0 00 0a 9f 00 2a 7f 00 a9 ff 02 &1ce4 a3 ff 0a 80 00 2a 00 00 ; spell_sprite_0b SPELL_KNIGHT_4 &1cec 2a 3f f0 0a 9f f0 02 a7 f0 00 a9 f0 00 2a 00 00 &1cfc 0a 80 00 02 a0 00 00 a8 ; spell_sprite_0c SPELL_WIZARD &1d04 00 98 00 01 89 00 06 32 40 18 fc 90 06 32 40 01 &1d14 89 00 00 98 00 00 00 00 ; spell_sprite_0d SPELL_WIZARD_2 &1d1c 00 30 00 03 47 00 0d 21 c0 30 a8 30 0d 21 c0 03 &1d2c 47 00 00 30 00 00 00 00 ; spell_sprite_0e SPELL_WIZARD_3 &1d34 00 20 00 02 ce 00 0b 13 80 20 54 20 0b 13 80 02 &1d44 ce 00 00 20 00 00 00 00 ; turkey_sprite &1d4c 00 00 15 40 00 00 00 00 00 &1d55 00 00 6a 50 00 00 00 00 00 &1d5e 00 00 6a 90 00 00 00 00 00 &1d67 00 05 aa 90 00 0a a8 00 00 &1d70 00 5a aa 40 02 aa aa a0 00 &1d79 01 aa aa 90 2a aa aa aa 00 &1d82 01 aa aa 91 aa ae aa ba 80 &1d8b 01 aa aa a7 a9 ab 6a a7 a0 &1d94 00 6a 5a a9 e7 6a e9 e9 a8 &1d9d 00 15 01 aa 7d da 6a 6b 68 &1da6 00 00 5b 6a a7 da da ea e9 &1daf 00 00 aa da aa 7d da da eb &1db8 00 02 aa 76 aa 9f 6a 7a eb &1dc1 00 0e ad de aa ad ab 6a e9 &1dca 00 37 b7 7d aa ad ad ab 64 &1dd3 00 3d dd d7 aa 9d dd a9 a4 &1ddc 00 2b 7b 77 6a 77 6d dd d0 &1de5 00 0a aa 77 77 7a eb ab 40 &1dee 00 02 aa 9a aa fa aa a4 00 &1df7 00 00 0a aa aa aa aa 40 00 # Colour Table # ============ # Three pixel pair values per palette. # # Left of each pair plus black sets colours for first row of sprite. # Right of each pair plus black sets colours for second row of sprite. ; colour_table &1e00 01 02 03 ; palette &00, KR RK RR - ENEMY_HAT &1e03 02 03 01 ; palette &01, RK RR KR - ENEMY_PHANTOM &1e06 22 33 11 ; palette &02, MK MM KM - ENEMY_WITCH, PAINTING_MAGENTA_BLACK_FIGURE &1e09 11 36 33 ; palette &03, KM MC MM - ENEMY_BAT &1e0c 08 0c 04 ; palette &04, GK GG KG - ENEMY_APPLE &1e0f 3c 20 30 ; palette &05, CC BK BB - ENEMY_GHOST_ONE &1e12 08 0c 30 ; palette &06, GK GG BB - ENEMY_GHOST_TWO &1e15 08 0c 0f ; palette &07, GK GG YY - ENEMY_TENTACLES &1e18 0a 0f 03 ; palette &08, YK YY RR - ENEMY_GHOST_THREE, PAINTING_RED_YELLOW_DIAMOND &1e1b 02 03 0f ; palette &09, RK RR YY - ENEMY_RADISH &1e1e 0a 0f 03 ; palette &0a, YK YY RR - ENEMY_PUMPKIN &1e21 03 0f 17 ; palette &0b, RR YY RW - CAN, PAINTING_RED_YELLOW_FACE &1e24 03 07 3f ; palette &0c, RR RY WW - DRUMSTICK &1e27 03 0f 07 ; palette &0d, RR YY RY - LOLLIPOP &1e2a 3f 0f 3c ; palette &0e, WW YY CC - WINE_BOTTLE &1e2d 03 0f 3d ; palette &0f, RR YY CW - DESSERT &1e30 0c 1e 1c ; palette &10, GG YC GC - WINEGLASS &1e33 0c 03 07 ; palette &11, GG RR RY - APPLE &1e36 0f 33 30 ; palette &12, YY MM BB - STICK &1e39 08 05 0d ; palette &13, GK KY GY - MUSHROOM &1e3c 3c 0f 30 ; palette &14, CC YY BB - ACG_LEFT &1e3f 3c 0f 30 ; palette &15, CC YY BB - ACG_RIGHT &1e42 3c 0f 30 ; palette &16, CC YY BB - ACG_MIDDLE &1e45 08 03 0e ; palette &17, GK RR YG - CLAW &1e48 3c 3f 30 ; palette &18, CC WW BB - MASK &1e4b 05 0a 0f ; palette &19, KY YK YY - GARLIC &1e4e 3f 30 3c ; palette &1a, WW BB CC - COIN &1e51 04 0c 0f ; palette &1b, KG GG YY - BOTTLE, PAINTING_YELLOW_GREEN_FACE &1e54 3f 30 3c ; palette &1c, WW BB CC - DIAMOND &1e57 33 03 07 ; palette &1d, MM RR RY - CHALICE, PAINTING_MAGENTA_RED_FACE, PAINTING_RED_BLACK_FACE &1e5a 3f 30 3c ; palette &1e, WW BB CC - HORSESHOE, PAINTING_MOUNTAIN, PAINTING_WHITE_BLUE_FACE &1e5d 14 28 3c ; palette &1f, KC CK CC - SPANNER &1e60 0b 03 0f ; palette &20, YR RR YY - CRUCIFIX &1e63 0e 03 0d ; palette &21, YG RR GY - LEAF &1e66 1e 0c 3c ; palette &22, YC GG CC - TOMBSTONE &1e69 03 00 00 ; palette &23, RR KK KK - MATERIALISATION, DEMATERIALISATION &1e6c 03 0c 00 ; palette &24, RR GG KK - MATERIALISATION, DEMATERIALISATION &1e6f 00 0c 30 ; palette &25, KK GG BB - MATERIALISATION, DEMATERIALISATION &1e72 00 00 30 ; palette &26, KK KK BB - MATERIALISATION, DEMATERIALISATION &1e75 3c 33 30 ; palette &27, CC MM BB - CLOCK &1e78 30 07 3c ; palette &28, BB RY CC - BOOKCASE &1e7b 05 0a 0f ; palette &29, KY YK YY - BARREL &1e7e 3c 3a 30 ; palette &2a, CC WB BB - STATUE &1e81 39 0f 33 ; palette &2b, CM YY MM - ANGULAR_DOOR_FRAME (third byte set per room at &2a02) &1e84 3c 33 36 ; palette &2c, CC MM MC - ROUND_DOOR_FRAME &1e87 2b 0f 03 ; palette &2d, WR YY RR - CLOSED_DOOR_RED &1e8a 0e 0f 0c ; palette &2e, YG YY GG - CLOSED_DOOR_GREEN &1e8d 0b 3f 0f ; palette &2f, YR WW YY - CLOSED_DOOR_YELLOW &1e90 34 3f 3c ; palette &30, BC WW CC - CLOSED_DOOR_CYAN &1e93 1f 33 3f ; palette &31, YW MM WW - CLOSED_DOOR_TEMPORARY &1e96 03 0f 30 ; palette &32, RR YY BB - TRAPDOOR_COVER &1e99 08 0c 04 ; palette &33, GK GG KG - DRACULA &1e9c 22 33 11 ; palette &34, MK MM KM - DEVIL &1e9f 02 03 01 ; palette &35, RK RR KR - FRANKENSTEIN &1ea2 2a 3f 15 ; palette &36, WK WW KW - MUMMY &1ea5 02 03 01 ; palette &37, RK RR KR - HUNCHBACK &1ea8 3f 0f 03 ; palette &38, WW YY RR - RUG &1eab 33 0f 3c ; palette &39, MM YY CC - TRAPDOOR_FRAME &1eae 01 02 03 ; palette &3a, KR RK RR - KEY_RED &1eb1 04 08 0c ; palette &3b, KG GK GG - KEY_GREEN &1eb4 05 0a 0f ; palette &3c, KY YK YY - KEY_YELLOW &1eb7 14 28 3c ; palette &3d, KC CK CC - KEY_CYAN &1eba c0 cf f4 ; palette &3e, KK YY BC - TABLE (colours have top bit set to indicate obstacle) &1ebd 3f 03 33 ; palette &3f, WW RR MM - ACG_DOOR &1ec0 0f 23 3c ; palette &40, YY MR CC - SPELL_KNIGHT &1ec3 0f 3c 3f ; palette &41, YY CC WW - SPELL_WIZARD &1ec6 30 34 38 ; palette &42, BB BC CB - SPELL_SERF &1ec9 0f 0f 0b ; palette &43, YY YY YR - TURKEY (yellow) &1ecc 00 00 00 ; palette &44, KK KK KK - MATERIALISATION, DEMATERIALISATION &1ecf 08 1c 14 ; palette &45, GK GC KC - KNIGHT &1ed2 02 13 11 ; palette &46, RK RM KM - WIZARD &1ed5 0a 1f 15 ; palette &47, YK YW KW - SERF &1ed8 00 03 00 ; palette &48, KK RR KK - TURKEY (red) ; rooms_wall_data ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &1edb 01 3e 3a 42 3b 3e 3a 05 06 05 06 03 06 05 1e 13 ; 00 # 8....... Set when room visited, cleared at start &1eeb 1f 05 1e 13 1f 0b 27 2a 23 26 26 02 01 02 03 03 ; 10 # .4218... Room type &1efb 02 0b 1e 15 13 09 0a 1e 03 06 05 07 05 22 35 21 ; 20 # .....421 Wall colour &1f0b 32 26 27 22 23 27 2e 2d 2d 22 27 33 26 35 21 29 ; 30 &1f1b 23 27 23 2e 25 26 32 25 25 33 37 23 22 2b 25 25 ; 40 &1f2b 36 23 26 21 22 25 06 06 03 06 02 05 01 07 05 02 ; 50 &1f3b 06 03 07 05 07 06 02 05 01 11 12 0a 0b 0e 03 06 ; 60 &1f4b 12 1d 0b 17 0f 02 0a 0a 12 15 11 09 05 05 03 07 ; 70 &1f5b 12 1d 0d 09 06 03 13 05 0b 09 0b 06 12 06 12 05 ; 80 &1f6b 07 09 12 06 49 ; 90 ; consumables_room ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &1f70 87 8a 8b 89 8e 2a 90 85 1e 0c 0c 90 7e 0c 1b 1c ; 00 &1f80 83 84 93 13 12 93 5a 1b 24 6f 6d 6b 08 79 0d 74 ; 10 &1f90 0a 11 72 5d 59 1f 4a 78 70 1f 07 60 0d 1f 1a 56 ; 20 &1fa0 0e 64 32 2d 57 68 53 4c 78 52 48 43 52 52 2d 3e ; 30 &1fb0 20 54 3a 44 2e 18 82 16 16 4c 7c 7c 31 31 7c 47 ; 40 &1fc0 32 32 32 32 34 4b 4e 4e 2f 31 51 55 55 55 45 ; 50 ; consumables_data ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &1fcf c4 c3 e9 bb c4 8a e2 91 8a 91 94 e6 bb ef e5 9a ; 00 # 8....... Set if consumable present, clear if taken &1fdf 9a c3 b3 c3 dd ef a3 e2 c1 9c c4 93 c1 c4 e6 bb ; 10 # .4218... y position &1fef 89 d3 c4 bb a3 b9 bb ab bb 99 ee bb e4 d9 e2 84 ; 20 # .....421 x position &1fff c4 ba e3 ca bb db da 89 cb bb bb d3 9b db 8e d2 ; 30 &200f 83 da e9 b9 cb e5 bb be bb 8b e9 ec e6 e2 ef 8b ; 40 &201f 89 8e e1 e6 8b ad d2 d5 8c 8e d2 d2 d5 e3 a5 ; 50 # Consumables &50 - &5e are MUSHROOMs ; door_rooms_entrance_table # One byte per pair of doors ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &202e 00 02 01 57 04 05 06 20 1f 58 59 5a 20 56 1f 58 ; 00 &203e 59 5a 5b 5c 5d 5e 5c 5d 5e 5f 60 61 62 60 61 62 ; 10 &204e 28 64 65 66 67 68 57 85 2b 86 85 85 2b 87 29 92 ; 20 &205e 29 88 2a 89 8b 8c 8a 91 2c 8d 8e 8f 1e 0c 1d 7d ; 30 &206e 7e 7e 7f 27 80 26 27 80 81 82 15 83 14 13 25 14 ; 40 &207e 1c 63 0b 93 1c 63 1b 24 09 69 23 6a 09 09 6a 0a ; 50 &208e 0a 6b 6c 6d 6e 6f 22 70 6d 6e 6f 22 70 71 72 73 ; 60 &209e 21 72 00 74 75 11 10 0f 74 0f 76 77 08 78 79 7a ; 70 &20ae 08 18 2d 2e 2f 30 2d 2f 32 33 34 35 33 34 18 36 ; 80 &20be 37 3a 3b 3c 3d 38 39 3a 3c 3e 19 40 41 03 44 45 ; 90 &20ce 46 31 3f 42 43 45 48 49 4a 4b 48 4b 4c 4d 1a 4e ; a0 &20de 4f 50 51 17 4e 4f 51 52 53 52 1e 5e 0d 0d 25 16 ; b0 &20ee 7b 5d 87 87 8d 8d 7f 7f 00 00 27 12 0e 14 ; c0 ; door_rooms_exit_table # One byte per pair of doors ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &20fc 94 7c 02 03 0f 87 13 56 64 5c 5d 5e 58 5b 58 59 ; 00 &210c 5a 5b 5f 5d 5e 5f 60 61 62 28 61 62 28 65 66 67 ; 10 &211c 68 65 66 67 68 57 04 2b 86 87 29 29 88 89 92 2a ; 20 &212c 8a 8b 91 2c 8c 2c 8d 8f 90 8e 8f 90 1d 7d 7d 7e ; 30 &213c 7f 26 27 80 81 82 15 05 83 25 14 12 13 12 0b 93 ; 40 &214c 63 0b 93 77 1b 84 84 09 69 23 6a 0a 08 6b 7a 07 ; 50 &215c 6c 6d 70 6e 6f 22 70 71 21 75 11 72 06 00 73 00 ; 60 &216c 74 10 0e 75 11 10 0f 0e 76 77 08 07 78 79 7a 07 ; 70 &217c 7b 2d 2e 2f 30 31 36 37 33 34 35 18 38 39 3a 3c ; 80 &218c 3e 3b 3c 3d 3e 3f 19 4b 43 45 40 41 42 44 45 46 ; 90 &219c 47 47 48 4c 4f 4d 49 4a 4b 4c 17 1a 4e 51 4e 4f ; a0 &21ac 50 51 16 52 53 54 55 55 54 01 0c 0d 61 62 15 54 ; b0 &21bc 7c 0d 8b 8b 8f 8f 23 23 0f 0f 7e 71 81 07 ; c0 ; doors_flags # One byte per pair of doors ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &21ca e0 00 00 00 00 00 00 20 60 00 00 00 d0 10 90 00 ; 00 # 84...... Colour of locked door or type of passage: &21da 50 00 90 0d 10 50 d0 50 10 00 10 10 00 00 d0 d0 ; 01 # 0 red 0 clock &21ea 00 50 00 00 90 00 00 00 50 00 20 00 00 00 00 00 ; 02 # 1 green 1 bookcase &21fa 00 00 00 d0 00 00 90 00 00 90 00 10 00 00 00 d0 ; 03 # 2 yellow 2 barrel &220a 00 00 00 00 00 00 00 90 00 50 00 d0 00 00 00 50 ; 40 # 3 cyan 3 statue &221a 10 90 00 a0 00 00 00 00 00 00 00 10 20 00 60 20 ; 50 # ..21.... Type of door: 0 uncoloured, temporary door &222a 50 00 00 00 00 d0 00 00 10 a0 60 00 00 d0 00 00 ; 60 # 1 coloured door, locked &223a 00 00 00 50 00 00 00 00 00 50 00 00 00 00 00 00 ; 70 # 2 character-specific passage &224a d0 a0 00 00 50 00 10 00 00 00 00 00 00 00 00 00 ; 80 # 3 coloured door, unlocked &225a 00 00 d0 10 00 00 00 a0 00 00 00 00 00 00 00 00 ; 90 # ....8... Set if door temporarily closed &226a 10 a0 00 00 60 00 00 00 00 50 00 00 00 00 00 00 ; a0 # .....421 Countdown for temporarily closed door to open &227a d0 00 00 00 50 00 00 20 00 00 50 90 90 90 20 60 ; b0 &228a 00 90 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0 ; c0 ; doors_locations # One nibble per pair of doors, top nibble first ; 01 23 45 67 89 ab cd ef 01 23 45 67 89 ab cd ef # &2298 01 10 11 10 11 11 11 00 00 10 00 11 11 00 01 11 ; 00 # b 3 7 &22a8 10 00 00 10 00 91 11 00 11 11 00 11 10 00 11 00 ; 20 # 6 4 &22b8 01 10 01 11 11 11 00 11 00 00 11 00 00 00 91 19 ; 40 # 2 0 &22c8 11 10 00 00 11 11 11 00 11 10 00 00 11 11 00 00 ; 60 # a 8 &22d8 10 00 00 11 00 00 11 11 10 00 01 11 11 00 00 00 ; 80 # 9 1 5 &22e8 01 11 11 00 00 11 11 00 00 01 11 10 01 09 95 41 ; a0 &22f8 15 b7 b7 6a 48 20 12 ; c0 ; doors_location_override_table # One byte per pair of doors from &bb to &cd ; b c d e f 0 1 2 3 4 5 6 7 8 9 a &22ff 07 07 0b 02 00 07 0b 07 0b 07 0b 09 05 0b 07 03 ; b0 &230f 00 03 0a ; c0 ; background_sprite_14 ACG_DOOR &2312 00 3f ff f0 00 ff f5 55 7f 00 55 55 55 57 c0 aa &2322 aa aa 55 f0 55 55 56 a5 7c aa aa a5 69 5c 0f ff &2332 ea 5a 5f 0f 55 fe 96 97 0d fd f7 a5 97 0d ff f7 &2342 e9 97 0f 55 5f f9 97 0c ff f3 f9 97 0c ff f3 f9 &2352 97 0c ff f3 f9 97 0f 00 0f f9 97 0d 55 5f f9 97 &2362 0f f7 f7 e9 97 0f f7 f7 a5 97 0d 55 5e 96 97 0f &2372 ff ea 5a 5f aa aa a5 69 5c 55 55 56 a5 7c aa aa &2382 aa 55 f0 55 55 55 57 c0 ff f5 55 7f 00 00 3f ff &2392 f0 00 ; door_screen_positions_x ; 0 1 2 3 4 5 6 7 8 9 a b &2394 66 30 02 30 66 48 02 48 66 18 02 18 # ROOM_SQUARE, OCTAGON, STAIRS_VERTICAL, EXIT &23a0 50 30 18 30 50 # ROOM_TALL &23a5 62 18 0e 50 00 18 # STAIRS_HORIZONTAL &23ab 66 30 02 30 00 48 00 48 00 18 00 18 # ROOM_WIDE &23b7 5e 30 0a 30 # CAVERN_SQUARE, CAVERN_TALL, CAVERN_WIDE ; door_screen_positions_y ; 0 1 2 3 4 5 6 7 8 9 a b &23bb 4c a0 4c 1e 24 a0 24 1e 74 a0 74 1e # ROOM_SQUARE, OCTAGON, STAIRS_VERTICAL, EXIT &23c7 4c a0 4c 1e 24 # ROOM_TALL &23cc 4c 24 4c 74 00 74 # STAIRS_HORIZONTAL &23d2 4c 84 4c 3a 00 84 00 3a 00 84 00 3a # ROOM_WIDE &23de 4c 9c 4c 22 # CAVERN_SQUARE, CAVERN_TALL, CAVERN_WIDE ; door_screen_offsets_x &23e2 f8 02 00 02 ; CLOCK &23e6 fc fc 00 fc ; BOOKCASE &23ea fc 02 00 02 ; BARREL &23ee f8 04 00 04 ; STATUE &23f2 00 00 00 00 ; ANGULAR_DOOR &23f6 00 00 00 00 ; ROUND_DOOR &23fa 00 02 04 02 ; INVISIBLE_DOOR &23fe 00 06 04 06 ; CLOSED_DOOR &2402 04 06 00 06 ; PAINTING ; door_screen_offsets_y &2406 04 f4 04 0c ; CLOCK &240a fc fc fc 04 ; BOOKCASE &240e 04 fa 04 06 ; BARREL &2412 08 f4 08 0c ; STATUE &2416 00 00 00 00 ; ANGULAR_DOOR &241a 00 00 00 00 ; ROUND_DOOR &241e 00 00 00 00 ; INVISIBLE_DOOR &2422 0a 00 0a 00 ; CLOSED_DOOR &2426 0a 04 0a fc ; PAINTING ; room_middle_offset_table &242a a8 50 a8 a8 88 60 88 50 88 a8 ; room_middle_height_table &2434 20 20 12 20 1e 1e 1a 20 12 20 ; room_middle_address_low_table &243e 48 a0 cc 48 6c 94 ec a0 fc 48 ; room_middle_address_high_table &2448 4e 4e 55 4e 4e 4e 50 4e 55 4e ; trapdoor_positions &2452 81 a6 86 46 86 8a 86 86 8a a6 a6 ; TRAPDOORs &245d 82 84 84 54 86 79 84 84 89 c4 96 ; RUGs ; table_positions &2468 a0 ac 34 a8 32 9b 32 3c 3c 34 a8 b0 32 32 3a 3a &2478 dc 32 32 ab 32 ; trapdoor_rooms &247d 22 23 24 25 26 27 28 29 2a 2b 2c ; TRAPDOORs &2488 68 0d 32 11 6f 22 3a 63 93 25 07 ; RUGs ; table_rooms &2493 2b 2b 8a 8a 8c 8c 8f 1d 7f 6c 6c 75 08 5d 5e 5f &24a3 64 66 57 86 86 ; wall_data_length_table ; 0 1 2 3 4 5 6 7 8 9 a &24a8 06 06 06 18 36 36 36 1d 1d 02 0a ; wall_data_addresses_low_table &24b3 e2 fc 16 30 90 68 40 18 8c 60 b0 ; wall_data_addresses_high_table &24be 03 03 04 04 04 05 06 07 07 09 03 ; trapdoor_rectangle_widths &24c9 03 05 09 0d 13 19 20 28 30 3a 44 50 5c 69 77 ; trapdoor_rectangle_heights &24d8 04 08 0d 13 1b 25 30 3c 4a 5a 6b 7d 91 a7 be ; lines_delta_x_fraction_table &24e7 00 fc 00 00 00 c0 80 40 00 c0 80 40 00 00 00 04 00 ; lines_delta_x_table &24f8 01 00 01 01 01 00 00 00 00 ff ff ff ff ff ff ff ff ; lines_delta_y_fraction_table &2509 00 04 00 00 00 40 80 c0 00 40 80 c0 00 00 00 fc 00 ; lines_delta_y_table &251a ff ff ff ff ff ff ff ff 00 00 00 00 01 01 01 00 01 ; extra_lines_delta_x_fraction_table &252b 14 ec ; extra_lines_delta_x_table &252d 00 ff ; extra_lines_delta_y_fraction_table &252f 00 00 ; extra_lines_delta_y_table &2531 01 01 ; room_sizes ; y- y+ x+ x- &2533 20 88 5a 12 ; room type 0 &2537 20 88 44 28 ; room type 1 &253b 3c 6c 5a 12 ; room type 2 &253f 20 88 5a 12 ; room type 3 &2543 24 84 52 1a ; room type 4 &2547 24 84 48 24 ; room type 5 &254b 2c 7c 52 1a ; room type 6 &254f 20 88 44 28 ; room type 7 &2553 3c 6c 56 1e ; room type 8 &2557 20 88 5a 12 ; room type 9 # Objects # ======= # 0 1 2 3 4 5 6 7 8 9 # &00 ACG_LEFT random room &1b &1d &36 &20 &56 &56 &64 &1f &0a &1b # &01 ACG_MIDDLE random room &43 &47 &24 &1b &1e &1e &43 &02 &21 &31 # &02 ACG_RIGHT random room &8b &8d &8d &8d &8b &8b &8d &8b &8b &8d # &03 CLAW fixed room &09 # &04 MASK fixed room &43 # &05 GARLIC fixed room &67 # &06 COIN fixed room &3c # &07 BOTTLE fixed room &4e # &08 DIAMOND fixed room &63 # &09 CHALICE fixed room &81 # &0a HORSESHOE fixed room &6e # &0b SPANNER fixed room &33 # &0c CRUCIFIX fixed room &10 # &0d LEAF fixed room &07 &07 &07 &07 &07 &07 &6e &07 &07 &07 (set at &436f) # &0e KEY_RED random room &09 &0a &0c &0b &7e &7e &07 &08 &84 &7d # &0f KEY_GREEN random room &0f &10 &14 &12 &13 &13 &0e &75 &15 &11 # &10 KEY_YELLOW fixed room &0d # &11 KEY_CYAN random room &19 &19 &19 &19 &31 &16 &55 &42 &1a &18 # # &12 - &14 used for TOMBSTONEs (&14 first) # &15 unused ; initial_rooms_for_fixed_objects &255b 09 43 67 3c 4e 63 81 6e 33 10 6e 0d ; initial_positions_for_fixed_objects &2567 36 15 ae 8c 87 2a 8c 24 84 84 23 b2 ; list_of_fixed_objects &2573 03 04 05 06 07 08 09 0a 0b 0c 0d 10 ; initial_rooms_for_random_objects &257f 0f 09 19 1b 43 8b ; 0 &2585 10 0a 19 1d 47 8d ; 1 &258b 14 0c 19 36 24 8d ; 2 &2591 12 0b 19 20 1b 8d ; 3 &2597 13 7e 31 56 1e 8b ; 4 &259d 13 7e 16 56 1e 8b ; 5 &25a3 0e 07 55 64 4e 8d ; 6 &25a9 75 08 42 1f 02 8b ; 7 &25af 15 84 1a 0a 21 8b ; 8 &25b5 11 7d 18 1b 31 8d ; 9 ; initial_x_for_random_objects &25bb 48 50 36 34 38 36 ; initial_y_for_random_objects &25c1 58 3e 58 3c 3c 58 ; list_of_random_objects &25c7 0f 0e 11 00 01 02 ; sixes_minus_one ; 0 1 2 3 4 5 6 7 8 9 &25cd 05 0b 11 17 1d 23 29 2f 35 3b # Background sprites # ================== # addr size w # &00: &138c + 60, 58 ; CLOCK_HORIZONTAL # &01: &13ec + 64, 48 ; CLOCK_VERTICAL # &02: &1450 + 78, 48 ; BOOKCASE_HORIZONTAL # &03: &14c8 + 80, 78 ; BOOKCASE_VERTICAL # &04: &1548 + 50, 48 ; BARREL_HORIZONTAL # &05: &1598 + 4b, 48 ; BARREL_VERTICAL # &06: &15e3 + 48, 58 ; STATUE_HORIZONTAL # &07: &162b + 50, 38 ; STATUE_VERTICAL # &08: &167b + 50, 38 ; ANGULAR_DOOR_FRAME_HORIZONTAL # &09: &16cb + 54, 58 ; ANGULAR_DOOR_FRAME_VERTICAL # &0a: &171f + 50, 38 ; ROUND_DOOR_FRAME_HORIZONTAL # &0b: &176f + 54, 58 ; ROUND_DOOR_FRAME_VERTICAL # &0c: &8000 + 3c, 28 ; INVISIBLE_DOOR_HORIZONTAL # &0d: &8000 + 3c, 48 ; INVISIBLE_DOOR_VERTICAL # &0e: &1128 + 1e, 28 ; CLOSED_DOOR_HORIZONTAL # &0f: &114c + 21, 28 ; CLOSED_DOOR_VERTICAL # &10: &17e8 + 6c, 88 ; RUG # &11: &1854 + 30, 58 ; TRAPDOOR_FRAME # &12: &17c4 + 24, 28 ; TABLE # &13: &2674 + 24, 28 ; TRAPDOOR_COVER # &14: &2312 + 82, 48 ; ACG_DOOR # &15: &0000 + 24, 28 ; PAINTING (address is changed) ; background_sprites_size_table &25d7 60 64 78 80 50 4b 48 50 50 54 50 54 3c 3c 1e 21 &25e7 6c 30 24 24 82 24 ; background_sprites_address_low_table &25ed 8c ec 50 c8 48 98 e3 2b 7b cb 1f 6f 00 00 28 4c &25fd e8 54 c4 74 12 00 ; background_sprites_address_high_table &2603 13 13 14 14 15 15 15 16 16 16 17 17 80 80 11 11 &2613 17 18 17 26 23 00 ; background_sprites_width_table &2619 58 48 48 78 48 48 58 38 38 58 38 58 28 48 28 28 &2629 88 58 28 28 48 28 ; sound_data ; dc v p &262f 0c 01 06 ; sound_00 # Shutting door &2632 0e 01 c8 ; sound_03 # Picking up or dropping object &2635 16 02 00 ; sound_06 # Consuming consumable &2638 46 03 06 ; sound_09 # Materialising enemy &263b 0c f1 05 ; sound_0c # Trapdoor opening or closing &263e 0f 02 00 ; sound_0f # pitch modified # Falling through trapdoor &2641 2c f1 07 ; sound_12 # Gaining or losing energy &2644 1d 04 c8 ; sound_15 # Touching enemy &2647 1d 00 96 ; sound_18 # Touching nasty &264a 1d 00 64 ; sound_1b # Touching mushroom &264d 3d 05 64 ; sound_1e # Player entering room &2650 3c f1 03 ; sound_21 # Player entering room &2653 0f 06 3c ; sound_24 # pitch modified # Player walking &2656 1f 07 00 ; sound_27 # pitch modified # Player shrinking or growing &2659 0d 08 11 ; sound_2a # pitch modified # Spell bouncing off wall &265c 0f 08 13 ; sound_2d # Unused, possibly alternative spell bounce &265f 15 09 00 ; sound_30 # cd modified, pitch modified # Tune ; unused &2662 12 09 00 &2665 13 09 00 &2668 09 0a 00 &266b 0a 0a 00 &266e 0b 0a 00 &2671 00 00 00 ; background_sprite_13 TRAPDOOR_COVER &2674 aa aa aa 95 55 56 9f ff f6 9d 55 76 9d ff 76 9d &2684 d7 76 9d d7 76 9d ff 76 9d 55 76 9f ff f6 95 55 &2694 56 aa aa aa ; sound_block ; chan vol pitch dur &2698 00 00 00 00 00 00 00 00 ; room_doors_closed_cooldown &26a0 00 00 00 00 00 00 ; room_doors_door_or_passage &26a6 00 00 00 00 00 00 ; painting_sprites ; other_sprite_d0 PAINTING_MAGENTA_RED_FACE &26ac 00 05 50 00 5a 54 01 56 95 05 56 d5 15 a8 b5 1a &26bc 2a bd 1a 2a bd 15 a8 b5 05 56 d5 01 56 95 00 5a &26cc 54 00 05 50 ; other_sprite_d1 PAINTING_MOUNTAIN &26d0 aa aa aa 80 02 02 88 30 22 80 fc 82 a3 ff 02 8d &26e0 fd ca 85 5d 42 95 55 52 95 55 56 95 55 56 aa aa &26f0 aa 00 00 00 ; other_sprite_d2 PAINTING_RED_YELLOW_DIAMOND &26f4 00 af 00 02 af c0 0a ad f0 2a 55 fc aa 6d ff aa &2704 5d ff ff fa aa ff d6 aa 3f 79 a8 0f 55 a0 03 fa &2714 80 00 fa 00 ; other_sprite_d3 PAINTING_RED_YELLOW_FACE &2718 03 ff c0 0d 55 70 35 aa 5c 36 28 9c 36 aa 9c 36 &2728 aa 9c 35 82 5c 35 aa 5c 0d 69 70 0d 55 70 03 55 &2738 c0 00 ff 00 ; other_sprite_d4 PAINTING_YELLOW_GREEN_FACE &273c 00 0f fc 03 fc 0f ff 00 03 e0 3d 43 ef fb 53 ec &274c ff 53 ec ff 53 ef fb 53 e0 3d 43 ff 00 03 03 fc &275c 0f 00 0f fc ; other_sprite_d5 PAINTING_RED_BLACK_FACE &2760 3f ff fc c0 00 03 c0 aa 03 c2 aa 83 c2 eb 83 c2 &2770 aa 83 c0 be 03 30 28 0c 30 55 0c 35 55 5c 0f ff &2780 f0 00 00 00 ; other_sprite_d6 PAINTING_WHITE_BLUE_FACE &2784 00 05 54 00 56 a5 05 aa 69 1a 95 59 69 57 d9 65 &2794 95 59 65 95 59 69 57 d9 1a 95 59 05 aa 69 00 56 &27a4 a5 00 05 54 ; other_sprite_d7 PAINTING_MAGENTA_BLACK_FIGURE &27a8 55 55 55 40 00 01 45 a8 fd 6a a2 3d 7a 89 3d 42 &27b8 28 3d 46 94 fd 5b e9 3d 65 6a 3d 65 6a 3d 69 56 &27c8 55 00 00 00 ; replot_double_height_sprite &27cc a2 24 LDX #&24 ; replot_sprite # Uses &02 first_screen_address for unplot &27ce 86 06 STX &06 ; bytes_to_plot # &04 second_screen_address for plot ; replot_sprite_loop &27d0 a0 28 LDY #&28 # Sprites are 10 pixels wide, plotted right to left &27d2 38 SEC ; replot_sprite_row_loop &27d3 c6 06 DEC &06 ; bytes_to_plot &27d5 a6 06 LDX &06 ; bytes_to_plot &27d7 bd 00 09 LDA &0900,X # actually LDA previous_sprite_address,X &27da 85 00 STA &00 ; previous_sprite_data_byte &27dc 29 0f AND #&0f # Use the low nibble for first two columns &27de aa TAX &27df bd 00 43 LDA &4300,X ; previous_palette_table_for_odd_rows &27e2 51 02 EOR (&02),Y ; first_screen_address # Unplot previous sprite &27e4 91 02 STA (&02),Y ; first_screen_address &27e6 c8 INY &27e7 bd 10 43 LDA &4310,X ; previous_palette_table_for_even_rows &27ea 51 02 EOR (&02),Y ; first_screen_address &27ec 91 02 STA (&02),Y ; first_screen_address &27ee a6 06 LDX &06 ; bytes_to_plot &27f0 bd 00 0a LDA &0a00,X # actually LDA sprite_address,X &27f3 85 01 STA &01 ; sprite_data_byte &27f5 29 0f AND #&0f &27f7 aa TAX &27f8 bd 30 43 LDA &4330,X ; palette_table_for_even_rows &27fb 51 04 EOR (&04),Y ; second_screen_address # Plot sprite &27fd 91 04 STA (&04),Y ; second_screen_address &27ff 88 DEY &2800 bd 20 43 LDA &4320,X ; palette_table_for_odd_rows &2803 51 04 EOR (&04),Y ; second_screen_address &2805 91 04 STA (&04),Y ; second_screen_address &2807 98 TYA &2808 e9 08 SBC #&08 &280a a8 TAY &280b a5 00 LDA &00 ; previous_sprite_data_byte &280d 4a LSR A # Use the high nibble for next two columns &280e 4a LSR A &280f 4a LSR A &2810 4a LSR A &2811 aa TAX &2812 bd 00 43 LDA &4300,X ; previous_palette_table_for_odd_rows &2815 51 02 EOR (&02),Y ; first_screen_address # Unplot previous sprite &2817 91 02 STA (&02),Y ; first_screen_address &2819 c8 INY &281a bd 10 43 LDA &4310,X ; previous_palette_table_for_even_rows &281d 51 02 EOR (&02),Y ; first_screen_address &281f 91 02 STA (&02),Y ; first_screen_address &2821 a5 01 LDA &01 sprite_data_byte &2823 4a LSR A &2824 4a LSR A &2825 4a LSR A &2826 4a LSR A &2827 aa TAX &2828 bd 30 43 LDA &4330,X ; palette_table_for_even_rows &282b 51 04 EOR (&04),Y ; second_screen_address # Plot sprite &282d 91 04 STA (&04),Y ; second_screen_address &282f 88 DEY &2830 bd 20 43 LDA &4320,X ; palette_table_for_odd_rows &2833 51 04 EOR (&04),Y ; second_screen_address &2835 91 04 STA (&04),Y ; second_screen_address &2837 98 TYA &2838 18 CLC &2839 e9 07 SBC #&07 # Move left two pixels &283b a8 TAY &283c 10 95 BPL &27d3 ; replot_sprite_row_loop &283e e6 02 INC &02 ; first_screen_address_low # Move down two pixels &2840 e6 02 INC &02 ; first_screen_address_low &2842 a5 02 LDA &02 ; first_screen_address_low &2844 2c 3a 28 BIT &283a ; seven &2847 d0 0d BNE &2856 ; not_group_previous &2849 e9 00 SBC #&00 &284b 18 CLC &284c 69 79 ADC #&79 &284e 85 02 STA &02 ; first_screen_address_low &2850 a5 03 LDA &03 ; first_screen_address_high &2852 69 02 ADC #&02 &2854 85 03 STA &03 ; first_screen_address_high ; not_group_previous &2856 e6 04 INC &04 ; second_screen_address_low &2858 e6 04 INC &04 ; second_screen_address_low &285a a5 04 LDA &04 ; second_screen_address_low &285c 2c 3a 28 BIT &283a ; seven &285f d0 0d BNE &286e ; not_group &2861 e9 00 SBC #&00 &2863 18 CLC &2864 69 79 ADC #&79 &2866 85 04 STA &04 ; second_screen_address_low &2868 a5 05 LDA &05 ; second_screen_address_high &286a 69 02 ADC #&02 &286c 85 05 STA &05 ; second_screen_address_high ; not_group &286e a6 06 LDX &06 ; bytes_to_plot &2870 f0 13 BEQ &2885 ; leave &2872 4c d0 27 JMP &27d0 ; replot_sprite_loop ; rnd1 &2875 a5 10 LDA &10 ; rnd1_1 &2877 29 48 AND #&48 &2879 69 38 ADC #&38 &287b 0a ASL A &287c 0a ASL A &287d 26 12 ROL &12 ; rnd1_3 &287f 26 11 ROL &11 ; rnd1_2 &2881 26 10 ROL &10 ; rnd1_1 &2883 a5 10 LDA &10 ; rnd1_1 ; leave &2885 60 RTS ; rnd2 &2886 a5 13 LDA &13 ; rnd2_1 &2888 29 48 AND #&48 &288a 69 38 ADC #&38 &288c 0a ASL A &288d 0a ASL A &288e 26 14 ROL &14 ; rnd2_2 &2890 26 15 ROL &15 ; rnd2_3 &2892 26 13 ROL &13 ; rnd2_1 &2894 a5 13 LDA &13 ; rnd2_1 &2896 60 RTS ; calculate_screen_address_from_x_and_A &2897 85 09 STA &09 ; y ; calculate_screen_address_from_x_and_y &2899 a5 09 LDA &09 ; y &289b 4a LSR A &289c 4a LSR A &289d 29 fe AND #&fe &289f a8 TAY # Y = group * 2 &28a0 a9 00 LDA #&00 &28a2 85 07 STA &07 ; tmp &28a4 a5 08 LDA &08 ; x &28a6 29 fe AND #&fe &28a8 0a ASL A &28a9 26 07 ROL &07 ; tmp &28ab 0a ASL A &28ac 26 07 ROL &07 ; tmp &28ae 79 76 c3 ADC &c376,Y ; os_rom_640_multiplication_table + 1 &28b1 85 0a STA &0a ; screen_address_low &28b3 a5 09 LDA &09 ; y &28b5 29 07 AND #&07 &28b7 05 0a ORA &0a ; screen_address_low &28b9 85 0a STA &0a ; screen_address_low &28bb b9 75 c3 LDA &c375,Y ; os_rom_640_multiplication_table &28be 69 44 ADC #&44 &28c0 65 07 ADC &07 &28c2 85 0b STA &0b ; screen_address_high &28c4 60 RTS ; calculate_first_screen_address &28c5 20 97 28 JSR &2897 ; calculate_screen_address_from_x_and_A ; store_first_screen_address &28c8 85 03 STA &03 ; first_screen_address_high &28ca a5 0a LDA &0a &28cc 29 fe AND #&fe &28ce 85 02 STA &02 ; first_screen_address_low &28d0 60 RTS ; calculate_second_screen_address &28d1 20 97 28 JSR &2897 ; calculate_screen_address_from_x_and_A &28d4 85 05 STA &05 ; second_screen_address_high &28d6 a5 0a LDA &0a &28d8 29 fe AND #&fe &28da 85 04 STA &04 ; second_screen_address_low &28dc 60 RTS ; check_for_keypress &28dd 78 SEI &28de a0 03 LDY #&03 # Disable keyboard auto-scanning &28e0 8c 40 fe STY &fe40 ; System VIA port B input/output register &28e3 a0 7f LDY #&7f # Set top bit as input, low seven bits as output &28e5 8c 43 fe STY &fe43 ; System VIA data direction register A &28e8 8d 4f fe STA &fe4f ; System VIA input/output register A # Write key to check &28eb a0 0b LDY #&0b # Enable keyboard auto-scanning &28ed cd 4f fe CMP &fe4f ; System VIA input/output register A # Top bit set if key pressed &28f0 8c 40 fe STY &fe40 ; System VIA port B input/output register &28f3 58 CLI &28f4 60 RTS # Return not equal if key pressed ; check_for_joystick_button &28f5 a9 00 LDA #&00 &28f7 8d 43 fe STA &fe43 ; System VIA data direction register A # Set all bits as input &28fa ad 40 fe LDA &fe40 ; System VIA port B input/output register &28fd 29 10 AND #&10 # Bit set if joystick button pressed &28ff 60 RTS # Return not equal if joystick button pressed ; play_sound &2900 85 92 STA &92 ; offset &2902 98 TYA &2903 48 PHA &2904 8a TXA &2905 48 PHA &2906 a4 92 LDY &92 ; offset &2908 b9 31 26 LDA &2631,Y ; sound_data + 2 &290b 8d 9c 26 STA &269c ; sound_block + 4 # Third byte of sound data is pitch &290e b9 2f 26 LDA &262f,Y ; sound_data &2911 aa TAX &2912 4a LSR A &2913 4a LSR A &2914 4a LSR A &2915 8d 9e 26 STA &269e ; sound_block + 6 # High five bits of first byte of sound data is duration &2918 8a TXA &2919 29 03 AND #&03 # Low two bits of first byte of sound data is channel &291b 90 02 BCC &291f ; skip_flush # Remaining bit of first byte determines flushing &291d 09 10 ORA #&10 # Flush channel; play sound immediately ; skip_flush &291f 8d 98 26 STA &2698 ; sound_block &2922 b9 30 26 LDA &2630,Y ; sound_data + 1 &2925 8d 9a 26 STA &269a ; sound_block + 2 # Second byte of sound data is volume or envelope &2928 a2 98 LDX #&98 &292a a0 26 LDY #&26 ; &2698 = sound_block &292c a9 07 LDA #&07 ; Generate a sound (SOUND) &292e 20 f1 ff JSR &fff1 ; OSWORD &2931 68 PLA &2932 aa TAX &2933 68 PLA &2934 a8 TAY &2935 a5 92 LDA &92 ; offset &2937 18 CLC &2938 60 RTS ; use_extra_angle # Used for walls_7 (vertical stairs) &2939 b9 0b 25 LDA &250b,Y ; extra_lines_delta_x_fraction_table - &20 &293c 8d 98 29 STA &2998 ; delta_x_fraction &293f b9 0d 25 LDA &250d,Y ; extra_lines_delta_x_table - &20 &2942 8d 9f 29 STA &299f ; delta_x &2945 b9 0f 25 LDA &250f,Y ; extra_lines_delta_y_fraction_table - &20 &2948 8d a6 29 STA &29a6 ; delta_y_fraction &294b b9 11 25 LDA &2511,Y ; extra_lines_delta_y_table - &20 &294e b0 41 BCS &2991 ; store_delta_y_and_start_drawing_line # Angles # ====== # a 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 # # x 01 00 01 01 01 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 01 01 01 00 00 ff # 00 fc 00 00 00 c0 80 40 00 c0 80 40 00 00 00 04 00 04 00 00 00 40 80 c0 00 40 80 c0 00 00 00 fc 14 ec # y 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 01 01 01 00 01 00 01 01 01 00 00 00 01 01 # 00 c0 80 40 00 00 00 04 00 04 00 00 00 40 80 c0 00 40 80 c0 00 00 00 fc 00 fc 00 00 00 c0 80 40 00 00 ; draw_line # Called with X = length, Y = angle &2950 a9 00 LDA #&00 &2952 8d a3 29 STA &29a3 ; y_fraction &2955 8d 95 29 STA &2995 ; x_fraction ; continue_line &2958 98 TYA &2959 c9 20 CMP #&20 &295b b0 dc BCS &2939 ; use_extra_angle &295d c9 11 CMP #&11 &295f 90 06 BCC &2967 ; skip_mirror &2961 85 07 STA &07 ; angle &2963 a9 20 LDA #&20 # Mirror x around &00 and &10 &2965 e5 07 SBC &07 ; angle ; skip_mirror &2967 84 17 STY &17 ; mirrored_angle &2969 a8 TAY &296a b9 e7 24 LDA &24e7,Y ; lines_delta_x_fraction_table &296d 8d 98 29 STA &2998 ; delta_x_fraction &2970 b9 f8 24 LDA &24f8,Y ; lines_delta_x_table &2973 8d 9f 29 STA &299f ; delta_x &2976 a5 17 LDA &17 ; mirrored_angle &2978 18 CLC &2979 69 08 ADC #&08 # Mirror y around &08 and &18 &297b 29 1f AND #&1f &297d c9 11 CMP #&11 &297f 90 06 BCC &2987 ; skip_inversion &2981 85 07 STA &07 ; angle &2983 a9 20 LDA #&20 &2985 e5 07 SBC &07 ; angle ; skip_inversion &2987 a8 TAY &2988 b9 09 25 LDA &2509,Y ; lines_delta_y_fraction_table &298b 8d a6 29 STA &29a6 ; delta_y_fraction &298e b9 1a 25 LDA &251a,Y ; lines_delta_y_table ; store_delta_y_and_start_drawing_line &2991 8d ad 29 STA &29ad ; delta_y ; draw_line_loop &2994 a9 00 LDA #&00 # actually LDA x_fraction &2996 18 CLC &2997 69 00 ADC #&00 # actually ADC delta_x_fraction &2999 8d 95 29 STA &2995 ; x_fraction &299c a5 08 LDA &08 ; x &299e 69 01 ADC #&01 # actually ADC delta_x &29a0 85 08 STA &08 ; x &29a2 a9 00 LDA #&00 # actually LDA y_fraction &29a4 18 CLC &29a5 69 00 ADC #&00 # actually ADC delta_y_fraction &29a7 8d a3 29 STA &29a3 ; y_fraction &29aa a5 09 LDA &09 ; y &29ac 69 01 ADC #&01 # actually ADC delta_y &29ae 20 97 28 JSR &2897 ; calculate_screen_address_from_x_and_A # Stores A in &09 y &29b1 a0 00 LDY #&00 &29b3 a5 08 LDA &08 ; x &29b5 4a LSR A &29b6 90 04 BCC &29bc ; is_left_pixel &29b8 a9 01 LDA #&01 # actually LDA right_pixel_colour &29ba 10 02 BPL &29be ; plot_pixel # Always branches ; is_left_pixel &29bc a9 02 LDA #&02 # actually LDA left_pixel_colour ; plot_pixel &29be 51 0a EOR (&0a),Y ; screen_address &29c0 91 0a STA (&0a),Y ; screen_address &29c2 ca DEX &29c3 d0 cf BNE &2994 ; draw_line_loop &29c5 60 RTS ; draw_rectangle &29c6 85 19 STA &19 ; height &29c8 86 18 STX &18 ; width &29ca a0 00 LDY #&00 # Draw bottom line &29cc 20 58 29 JSR &2958 ; continue_line &29cf a0 08 LDY #&08 # Draw right line &29d1 a6 19 LDX &19 ; height &29d3 20 58 29 JSR &2958 ; continue_line &29d6 a0 10 LDY #&10 # Draw top line &29d8 a6 18 LDX &18 ; width &29da 20 58 29 JSR &2958 ; continue_line &29dd a0 18 LDY #&18 # Draw left line &29df a6 19 LDX &19 ; height &29e1 4c 58 29 JMP &2958 ; continue_line ; set_line_colour &29e4 29 07 AND #&07 ; set_line_colour_full_range &29e6 aa TAX &29e7 bd 11 2a LDA &2a11,X ; colours_to_pixel_values - 1 &29ea 8d b9 29 STA &29b9 ; right_pixel_colour &29ed 0a ASL A &29ee 8d bd 29 STA &29bd ; left_pixel_colour &29f1 60 RTS ; mark_room_as_visited_and_get_wall_type &29f2 a6 1e LDX &1e ; player_room &29f4 bd db 1e LDA &1edb,X ; rooms_wall_data &29f7 09 80 ORA #&80 &29f9 9d db 1e STA &1edb,X ; rooms_wall_data &29fc 20 e4 29 JSR &29e4 ; set_line_colour &29ff 0d b9 29 ORA &29b9 ; right_pixel_colour &2a02 8d 83 1e STA &1e83 ; colour_table + &83 # Set inside of ANGULAR_DOOR_FRAME to match walls &2a05 a6 1e LDX &1e ; player_room &2a07 bd db 1e LDA &1edb,X ; rooms_wall_data &2a0a 4a LSR A &2a0b 4a LSR A &2a0c 4a LSR A &2a0d 29 0f AND #&0f &2a0f 85 1a STA &1a ; room_type &2a11 60 RTS ; colours_to_pixel_values ; 1 2 3 4 5 6 7 8 9 a b c d e f &2a12 01 04 05 10 11 14 15 40 41 44 45 50 51 54 55 ; plot_status_area_border_with_random_colour &2a21 20 86 28 JSR &2886 ; rnd2 &2a24 29 07 AND #&07 &2a26 f0 02 BEQ &2a2a ; plot_status_area_border_with_same_colour &2a28 85 97 STA &97 ; status_border_colour ; plot_status_area_border_with_same_colour &2a2a a5 97 LDA &97 ; status_border_colour &2a2c 20 e4 29 JSR &29e4 ; set_line_colour &2a2f a2 0a LDX #&0a ; plot_walls &2a31 bd a8 24 LDA &24a8,X ; wall_data_length_table &2a34 85 1d STA &1d ; count &2a36 bd b3 24 LDA &24b3,X ; wall_data_addresses_low_table &2a39 85 1b STA &1b ; wall_data_address_low &2a3b bd be 24 LDA &24be,X ; wall_data_addresses_high_table &2a3e 85 1c STA &1c ; wall_data_address_high ; plot_walls_loop &2a40 a0 00 LDY #&00 &2a42 b1 1b LDA (&1b),Y ; wall_data_address # First byte is x &2a44 85 08 STA &08 ; x &2a46 c8 INY &2a47 b1 1b LDA (&1b),Y ; wall_data_address # Second byte is y &2a49 85 09 STA &09 ; y &2a4b c8 INY &2a4c b1 1b LDA (&1b),Y ; wall_data_address # Third byte is width of rectangle or length of line &2a4e aa TAX &2a4f c8 INY &2a50 b1 1b LDA (&1b),Y ; wall_data_address # Fourth byte has top bit set for rectangles &2a52 30 07 BMI &2a5b ; is_rectangle &2a54 a8 TAY # Otherwise, fourth byte is angle of line &2a55 20 50 29 JSR &2950 ; draw_line &2a58 18 CLC # Lines have four bytes of data &2a59 90 07 BCC &2a62 ; consider_next_wall # Always branches ; is_rectangle &2a5b c8 INY &2a5c b1 1b LDA (&1b),Y ; wall_data_address # Fifth byte is height of rectangle &2a5e 20 c6 29 JSR &29c6 ; draw_rectangle &2a61 38 SEC # Rectangles have five bytes of data ; consider_next_wall &2a62 a5 1b LDA &1b ; wall_data_address_low &2a64 69 04 ADC #&04 &2a66 85 1b STA &1b ; wall_data_address_low &2a68 90 02 BCC &2a6c ; skip_page &2a6a e6 1c INC &1c ; wall_data_address_high ; skip_page &2a6c c6 1d DEC &1d ; count &2a6e d0 d0 BNE &2a40 ; plot_walls_loop &2a70 60 RTS ; write_pair_of_bytes_to_screen_from_high_nibble &2a71 a8 TAY &2a72 a5 00 LDA &00 ; sprite_data_byte &2a74 4a LSR A &2a75 4a LSR A &2a76 4a LSR A &2a77 4a LSR A ; write_pair_of_bytes_to_screen_from_low_nibble &2a78 aa TAX &2a79 bd 00 43 LDA &4300,X ; palette_table_for_odd_rows &2a7c 51 02 EOR (&02),Y ; screen_address &2a7e 91 02 STA (&02),Y ; screen_address &2a80 c8 INY &2a81 bd 10 43 LDA &4310,X ; palette_table_for_even_rows &2a84 51 02 EOR (&02),Y ; screen_address &2a86 91 02 STA (&02),Y ; screen_address &2a88 98 TYA &2a89 60 RTS ; plot_sprite_column_right_to_left &2a8a a0 28 LDY #&28 # actually LDY sprite_width &2a8c 38 SEC ; plot_sprite_column_right_to_left_loop &2a8d c6 06 DEC &06 ; bytes_to_plot &2a8f a6 06 LDX &06 ; bytes_to_plot &2a91 bd 00 09 LDA &0900,X # actually LDA sprite_data,X &2a94 85 00 STA &00 ; sprite_data_byte &2a96 29 0f AND #&0f &2a98 20 78 2a JSR &2a78 ; write_pair_of_bytes_to_screen_from_low_nibble &2a9b e9 09 SBC #&09 &2a9d 20 71 2a JSR &2a71 ; write_pair_of_bytes_to_screen_from_high_nibble &2aa0 38 SEC &2aa1 e9 09 SBC #&09 &2aa3 a8 TAY &2aa4 b0 e7 BCS &2a8d ; plot_sprite_column_right_to_left_loop &2aa6 60 RTS ; plot_sprite_column_left_to_right &2aa7 a0 00 LDY #&00 &2aa9 18 CLC ; plot_sprite_column_left_to_right_loop &2aaa c6 06 DEC &06 ; bytes_to_plot &2aac a6 06 LDX &06 ; bytes_to_plot &2aae bd 00 09 LDA &0900,X # actually LDA sprite_data,X &2ab1 85 00 STA &00 ; sprite_data_byte &2ab3 29 0f AND #&0f &2ab5 20 78 2a JSR &2a78 ; write_pair_of_bytes_to_screen_from_low_nibble &2ab8 69 07 ADC #&07 &2aba 20 71 2a JSR &2a71 ; write_pair_of_bytes_to_screen_from_high_nibble &2abd 18 CLC &2abe 69 07 ADC #&07 &2ac0 a8 TAY &2ac1 c0 29 CPY #&29 # actually CPY sprite_width_for_flip &2ac3 90 e5 BCC &2aaa ; plot_sprite_column_left_to_right_loop &2ac5 60 RTS ; plot_sprite # Uses &02 first_screen_address for plot &2ac6 8e 92 2a STX &2a92 ; sprite_data_address_right_to_left_low # 0 or 1 regular, 2 horizontal flip, 3 vertical flip &2ac9 8e af 2a STX &2aaf ; sprite_data_address_left_to_right_low &2acc 8c 93 2a STY &2a93 ; sprite_data_address_right_to_left_high &2acf 8c b0 2a STY &2ab0 ; sprite_data_address_left_to_right_high &2ad2 e6 0d INC &0d ; flip_sprite &2ad4 a5 0d LDA &0d ; flip_sprite &2ad6 29 03 AND #&03 &2ad8 8d 25 2b STA &2b25 ; flip_vertically &2adb 49 03 EOR #&03 &2add 8d 14 2b STA &2b14 ; flip_horizontally &2ae0 f0 19 BEQ &2afb ; flip_pixels_of_palette_table &2ae2 49 03 EOR #&03 &2ae4 d0 37 BNE &2b1d ; plot_sprite_bottom_to_top_loop ; swap_rows_of_palette_table &2ae6 a2 0f LDX #&0f # If the sprite is vertically flipped, ; swap_rows_of_palette_table_loop &2ae8 bd 00 43 LDA &4300,X ; palette_table_for_odd_rows # swap the two rows of the palette table &2aeb 48 PHA &2aec bd 10 43 LDA &4310,X ; palette_table_for_even_rows &2aef 9d 00 43 STA &4300,X ; palette_table_for_odd_rows &2af2 68 PLA &2af3 9d 10 43 STA &4310,X ; palette_table_for_even_rows &2af6 ca DEX &2af7 10 ef BPL &2ae8 ; swap_rows_of_palette_table_loop &2af9 30 22 BMI &2b1d ; plot_sprite_bottom_to_top_loop # Always branches ; flip_pixels_of_palette_table &2afb a2 1f LDX #&1f # If the sprite is horizontally flipped, ; flip_pixels_of_palette_table_loop &2afd bd 00 43 LDA &4300,X ; palette_table # swap the pixels in every byte of the palette table &2b00 29 55 AND #&55 &2b02 0a ASL A &2b03 85 0c STA &0c ; pixel_value &2b05 bd 00 43 LDA &4300,X ; palette_table &2b08 29 aa AND #&aa &2b0a 4a LSR A &2b0b 45 0c EOR &0c ; pixel_value &2b0d 9d 00 43 STA &4300,X ; palette_table &2b10 ca DEX &2b11 10 ea BPL &2afd ; flip_pixels_of_palette_table_loop ; plot_sprite_top_to_bottom_loop &2b13 a9 03 LDA #&03 # actually LDA flip_horizontally # Zero if flip_sprite was 2 to start with &2b15 d0 06 BNE &2b1d ; plot_sprite_bottom_to_top_loop ; sprite_is_flipped_horizontally &2b17 20 a7 2a JSR &2aa7 ; plot_sprite_column_left_to_right # Plot two rows of sprite &2b1a 18 CLC &2b1b 90 03 BCC &2b20 ; move_vertically_two_pixels # Always branches ; plot_sprite_bottom_to_top_loop &2b1d 20 8a 2a JSR &2a8a ; plot_sprite_column_right_to_left # Plot two rows of sprite ; move_vertically_two_pixels &2b20 a5 06 LDA &06 ; bytes_to_plot &2b22 f0 3b BEQ &2b5f ; leave &2b24 a9 00 LDA #&00 # actually LDA flip_vertically # Zero if flip_sprite was 3 to start with &2b26 f0 1a BEQ &2b42 ; sprite_is_flipped_vertically &2b28 e6 02 INC &02 ; screen_address_low &2b2a e6 02 INC &02 ; screen_address_low &2b2c a5 02 LDA &02 ; screen_address_low &2b2e 2c 3a 28 BIT &283a ; seven &2b31 d0 e0 BNE &2b13 ; plot_sprite_top_to_bottom_loop &2b33 e9 00 SBC #&00 &2b35 18 CLC &2b36 69 79 ADC #&79 &2b38 85 02 STA &02 ; screen_address_low &2b3a a5 03 LDA &03 ; screen_address_high &2b3c 69 02 ADC #&02 &2b3e 85 03 STA &03 ; screen_address_high &2b40 d0 d1 BNE &2b13 ; plot_sprite_top_to_bottom_loop # Always branches ; sprite_is_flipped_vertically &2b42 c6 02 DEC &02 ; screen_address_low &2b44 c6 02 DEC &02 ; screen_address_low &2b46 a5 02 LDA &02 ; screen_address_low &2b48 29 07 AND #&07 &2b4a c9 06 CMP #&06 &2b4c d0 cf BNE &2b1d ; plot_sprite_bottom_to_top_loop &2b4e a5 02 LDA &02 ; screen_address_low &2b50 69 01 ADC #&01 &2b52 38 SEC &2b53 e9 7a SBC #&7a &2b55 85 02 STA &02 ; screen_address_low &2b57 a5 03 LDA &03 ; screen_address_high &2b59 e9 02 SBC #&02 &2b5b 85 03 STA &03 ; screen_address_high &2b5d d0 be BNE &2b1d ; plot_sprite_bottom_to_top_loop # Always branches ; leave &2b5f 60 RTS # Palette tables # ============== # Given three pixel value pairs, aA, bB and cC, prepare_palette_table generates: # # 0 1 2 3 4 5 6 7 8 9 a b c d e f # &00 -- -a -b -c a- aa ab ac b- ba bb bc c- ca cb cc # &10 -- -A -B -C A- AA AB AC B- BA BB BC C- CA CB CC # # where - is black and abcABC are colours. ; write_left_pixel_to_palette_table # Writes 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 3 &2b60 8d 6b 2b STA &2b6b ; write_left_pixel_op &2b63 a2 00 LDX #&00 ; write_left_pixel_loop &2b65 a9 04 LDA #&04 &2b67 85 0e STA &0e ; count &2b69 b5 93 LDA &93,X ; pixel_values ; write_left_pixel_op &2b6b ea NOP # Use left pixel of colour table # also ASL A # Use right pixel of colour table &2b6c 29 aa AND #&aa # Set left pixel of palette table ; write_left_pixel_inner_loop &2b6e 99 00 43 STA &4300,Y ; palette_table &2b71 c8 INY &2b72 c6 0e DEC &0e ; count &2b74 d0 f8 BNE &2b6e ; write_left_pixel_inner_loop &2b76 e8 INX &2b77 e0 04 CPX #&04 &2b79 d0 ea BNE &2b65 ; write_left_pixel_loop &2b7b 60 RTS ; eor_right_pixel_to_palette_table # EORs 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 &2b7c a2 00 LDX #&00 &2b7e 8d 87 2b STA &2b87 ; eor_right_pixel_op ; eor_right_pixel_loop &2b81 a9 04 LDA #&04 &2b83 85 0e STA &0e ; count ; eor_right_pixel_inner_loop &2b85 b5 93 LDA &93,X ; pixel_values ; eor_right_pixel_op &2b87 ea NOP # Use right pixel of colour table # also LSR A # Use left pixel of colour table &2b88 29 55 AND #&55 # Set right pixel of palette table &2b8a 59 00 43 EOR &4300,Y ; palette_table &2b8d 99 00 43 STA &4300,Y ; palette_table &2b90 c8 INY &2b91 c8 INY &2b92 c8 INY &2b93 c8 INY &2b94 c6 0e DEC &0e ; count &2b96 d0 ed BNE &2b85 ; eor_right_pixel_inner_loop &2b98 98 TYA &2b99 38 SEC &2b9a e9 0f SBC #&0f &2b9c a8 TAY &2b9d e8 INX &2b9e e0 04 CPX #&04 &2ba0 d0 df BNE &2b81 ; eor_right_pixel_loop &2ba2 60 RTS ; prepare_second_palette_table &2ba3 a0 20 LDY #&20 &2ba5 d0 02 BNE &2ba9 ; prepare_palette_table ; prepare_first_palette_table &2ba7 a0 00 LDY #&00 ; prepare_palette_table &2ba9 85 4b STA &4b ; tmp &2bab 0a ASL A &2bac 65 4b ADC &4b ; tmp &2bae aa TAX &2baf 84 0f STY &0f ; offset # &93 (pixel_values) is always &00, i.e. KK &2bb1 bd 00 1e LDA &1e00,X ; colour_table &2bb4 85 94 STA &94 ; pixel_values + 1 &2bb6 bd 01 1e LDA &1e01,X ; colour_table + 1 &2bb9 85 95 STA &95 ; pixel_values + 2 &2bbb bd 02 1e LDA &1e02,X ; colour_table + 2 &2bbe 85 96 STA &96 ; pixel_values + 3 &2bc0 a9 ea LDA #&ea ; NOP &2bc2 20 60 2b JSR &2b60 ; write_left_pixel_to_palette_table # Leaves with Y = &10 &2bc5 a9 0a LDA #&0a ; ASL A &2bc7 20 60 2b JSR &2b60 ; write_left_pixel_to_palette_table &2bca a5 0f LDA &0f ; offset &2bcc 09 10 ORA #&10 &2bce a8 TAY &2bcf a9 ea LDA #&ea ; NOP &2bd1 20 7c 2b JSR &2b7c ; eor_right_pixel_to_palette_table &2bd4 a4 0f LDY &0f ; offset &2bd6 a9 4a LDA #&4a ; LSR A &2bd8 20 7c 2b JSR &2b7c ; eor_right_pixel_to_palette_table &2bdb a9 00 LDA #&00 &2bdd 60 RTS ; calculate_other_sprite_address # Returns &096c + A * 36 in X and Y &2bde 20 0f 2c JSR &2c0f ; multiply_A_by_36_into_X_and_Y &2be1 8a TXA &2be2 69 6c ADC #&6c &2be4 aa TAX &2be5 98 TYA &2be6 69 09 ADC #&09 ; &096c = other_sprites &2be8 a8 TAY &2be9 60 RTS ; calculate_spell_sprite_address # Returns &1be4 + A * 24 in X and Y &2bea 8d ef 2b STA &2bef ; tmp &2bed 0a ASL A &2bee 69 00 ADC #&00 # actually ADC tmp &2bf0 0a ASL A &2bf1 0a ASL A &2bf2 0a ASL A &2bf3 08 PHP &2bf4 18 CLC &2bf5 69 e4 ADC #&e4 &2bf7 aa TAX &2bf8 a9 00 LDA #&00 &2bfa 2a ROL A &2bfb 28 PLP &2bfc 69 1b ADC #&1b ; &1be4 = spell_sprites &2bfe a8 TAY &2bff 60 RTS ; calculate_player_sprite_address # Returns &1884 + A * 18 in X and Y &2c00 20 0f 2c JSR &2c0f ; multiply_A_by_36_into_X_and_Y &2c03 4a LSR A &2c04 a8 TAY &2c05 8a TXA &2c06 6a ROR A &2c07 69 84 ADC #&84 &2c09 aa TAX &2c0a 98 TYA &2c0b 69 18 ADC #&18 ; &1884 = player_sprites &2c0d a8 TAY &2c0e 60 RTS ; multiply_A_by_36_into_X_and_Y &2c0f a8 TAY &2c10 a9 00 LDA #&00 &2c12 85 4b STA &4b ; tmp_high &2c14 98 TYA &2c15 0a ASL A &2c16 26 4b ROL &4b; tmp_high &2c18 0a ASL A &2c19 26 4b ROL &4b; tmp_high &2c1b 8d 23 2c STA &2c23 ; tmp_low &2c1e 0a ASL A &2c1f 0a ASL A &2c20 0a ASL A &2c21 18 CLC &2c22 69 00 ADC #&00 # actually ADC tmp_low &2c24 08 PHP &2c25 aa TAX &2c26 98 TYA &2c27 4a LSR A &2c28 4a LSR A &2c29 4a LSR A &2c2a 28 PLP &2c2b 65 4b ADC &4b; tmp_high &2c2d a8 TAY &2c2e 60 RTS ; wipe_middle_of_room &2c2f a4 1a LDY &1a ; room_type &2c31 b9 3e 24 LDA &243e,Y ; room_middle_address_low_table &2c34 85 02 STA &02 ; screen_address_low &2c36 be 48 24 LDX &2448,Y ; room_middle_address_high_table &2c39 86 03 STX &03 ; screen_address_high &2c3b b9 2a 24 LDA &242a,Y ; room_middle_offset_table &2c3e 85 00 STA &00 ; offset &2c40 18 CLC &2c41 65 02 ADC &02 ; screen_address_low &2c43 48 PHA &2c44 8a TXA &2c45 69 00 ADC #&00 &2c47 48 PHA &2c48 20 53 2c JSR &2c53 ; wipe_half_of_middle_of_room # Wipe left half of room &2c4b 68 PLA &2c4c 85 03 STA &03 ; screen_address_low &2c4e 68 PLA &2c4f 85 02 STA &02 ; screen_address_high &2c51 a4 1a LDY &1a ; room_type # Wipe right half of room ; wipe_half_of_middle_of_room &2c53 be 34 24 LDX &2434,Y ; room_middle_height_table ; wipe_middle_of_room_loop &2c56 a4 00 LDY &00 ; offset &2c58 38 SEC ; wipe_middle_of_room_inner_loop &2c59 98 TYA &2c5a e9 05 SBC #&05 &2c5c a8 TAY &2c5d a9 00 LDA #&00 &2c5f 91 02 STA (&02),Y ; screen_address &2c61 88 DEY &2c62 91 02 STA (&02),Y ; screen_address &2c64 88 DEY &2c65 91 02 STA (&02),Y ; screen_address &2c67 88 DEY &2c68 91 02 STA (&02),Y ; screen_address &2c6a d0 ed BNE &2c59 ; wipe_middle_of_room_inner_loop &2c6c ca DEX &2c6d f0 19 BEQ &2c88 ; leave &2c6f a5 02 LDA &02 ; screen_address_low &2c71 2c 77 2c BIT &2c77 ; four &2c74 d0 06 BNE &2c7c ; not_half_group &2c76 09 04 ORA #&04 &2c78 85 02 STA &02 ; screen_address_low &2c7a d0 da BNE &2c56 ; wipe_middle_of_room_loop ; not_half_group &2c7c 69 7b ADC #&7b &2c7e 85 02 STA &02 ; screen_address_low &2c80 a5 03 LDA &03 ; screen_address_high &2c82 69 02 ADC #&02 &2c84 85 03 STA &03 ; screen_address_high &2c86 d0 ce BNE &2c56 ; wipe_middle_of_room_loop # Always branches ; leave &2c88 60 RTS ; set_video_palette &2c89 a0 07 LDY #&07 ; set_video_palette_loop &2c8b 98 TYA &2c8c 0a ASL A &2c8d 0a ASL A &2c8e 0a ASL A &2c8f 0a ASL A &2c90 79 98 00 ADC &0098,Y ; video_palette # &80 + Y * &10 + (&0 for white, &7 for black) &2c93 8d 21 fe STA &fe21 ; video ULA palette register &2c96 88 DEY &2c97 10 f2 BPL &2c8b ; set_video_palette_loop &2c99 60 RTS ; trapdoor_falling_screen &2c9a 20 5d 3c JSR &3c5d ; clear_screen_without_resetting_window &2c9d 20 89 2c JSR &2c89 ; set_video_palette # Set colours 8 - 15 to be white, black x 7 &2ca0 a0 0e LDY #&0e &2ca2 84 02 STY &02 ; rectangle ; draw_rectangles_loop &2ca4 a4 02 LDY &02 ; rectangle &2ca6 98 TYA &2ca7 09 08 ORA #&08 &2ca9 20 e6 29 JSR &29e6 ; set_line_colour_full_range &2cac be c9 24 LDX &24c9,Y ; trapdoor_rectangle_widths # X is width of rectangle &2caf 8a TXA &2cb0 4a LSR A &2cb1 85 08 STA &08 ; x &2cb3 a9 3b LDA #&3b &2cb5 38 SEC &2cb6 e5 08 SBC &08 ; x &2cb8 85 08 STA &08 ; x &2cba b9 d8 24 LDA &24d8,Y ; trapdoor_rectangle_heights &2cbd 4a LSR A &2cbe 85 09 STA &09 ; y &2cc0 a9 5f LDA #&5f &2cc2 38 SEC &2cc3 e5 09 SBC &09 ; y &2cc5 85 09 STA &09 ; y &2cc7 b9 d8 24 LDA &24d8,Y ; trapdoor_rectangle_heights # A is height of rectangle &2cca 20 c6 29 JSR &29c6 ; draw_rectangle &2ccd c6 02 DEC &02 ; rectangle &2ccf d0 d3 BNE &2ca4 ; draw_rectangles_loop &2cd1 a2 67 LDX #&67 ; animate_trapdoor_rectangles_loop &2cd3 a0 07 LDY #&07 &2cd5 a5 9f LDA &9f ; video_palette + 7 &2cd7 48 PHA ; rotate_video_palette_loop &2cd8 b9 97 00 LDA &0097,Y ; video_palette - 1 # Rotate colours 8 - 15 &2cdb 99 98 00 STA &0098,Y ; video_palette &2cde 88 DEY &2cdf d0 f7 BNE &2cd8 ; rotate_video_palette_loop &2ce1 68 PLA &2ce2 85 98 STA &98 ; video_palette &2ce4 20 1c 33 JSR &331c ; wait_for_vsync &2ce7 20 89 2c JSR &2c89 ; set_video_palette &2cea 8e 40 26 STX &2640 ; sound_data + &11 # Set pitch of sound_0f &2ced a9 0f LDA #&0f ; sound_0f &2cef 20 00 29 JSR &2900 ; play_sound # Play sound for player falling through trapdoor &2cf2 ca DEX &2cf3 10 de BPL &2cd3 ; animate_trapdoor_rectangles_loop &2cf5 a6 1e LDX &1e ; player_room &2cf7 bc 66 24 LDY &2466,X ; trapdoor_positions - &22 + &b # Each TRAPDOOR deposits player on a RUG &2cfa 84 1e STY &1e ; player_room &2cfc bd 3b 24 LDA &243b,X ; trapdoor_rooms - &22 + &b &2cff 20 55 2f JSR &2f55 ; convert_position_byte_into_coordinates &2d02 85 32 STA &32 ; player_y &2d04 a9 0c LDA #&0c ; CLS &2d06 20 ee ff JSR &ffee ; OSWRCH &2d09 65 08 ADC &08 ; x &2d0b 85 31 STA &31 ; player_x &2d0d 85 08 STA &08 ; x &2d0f 4c ab 39 JMP &39ab ; set_player_screen_address_from_position_and_disable_unplot ; add_door_to_room_doors # X is offset in doors, Y is offset in room_doors &2d12 8a TXA &2d13 99 fa 42 STA &42fa,Y ; room_doors_offset &2d16 4a LSR A &2d17 aa TAX &2d18 bd 98 22 LDA &2298,X ; doors_locations # One nibble sets where door is on screen &2d1b 90 04 BCC &2d21 ; use_top_nibble &2d1d 29 0f AND #&0f &2d1f 10 04 BPL &2d25 ; store_door_location ; use_top_nibble &2d21 4a LSR A &2d22 4a LSR A &2d23 4a LSR A &2d24 4a LSR A ; store_door_location &2d25 99 c1 43 STA &43c1,Y ; room_doors_location &2d28 be fa 42 LDX &42fa,Y ; room_doors_offset &2d2b bd ca 21 LDA &21ca,X ; doors_flags # Low three bits of doors_flags sets how long &2d2e 29 07 AND #&07 # temporarily closed door will remain closed for &2d30 99 a0 26 STA &26a0,Y ; room_doors_closed_cooldown &2d33 bd ca 21 LDA &21ca,X ; doors_flags &2d36 4a LSR A &2d37 4a LSR A &2d38 4a LSR A &2d39 4a LSR A &2d3a 48 PHA &2d3b 29 03 AND #&03 &2d3d 99 a6 26 STA &26a6,Y ; room_doors_door_or_passage # Bits four and five determine door or passage &2d40 a9 00 LDA #&00 &2d42 2a ROL A &2d43 99 f4 42 STA &42f4,Y ; room_doors_temporarily_closed # Bit three set if door temporarily closed &2d46 68 PLA &2d47 4a LSR A &2d48 4a LSR A &2d49 99 cd 43 STA &43cd,Y ; room_doors_colour # Top two bits are colour of door or type of passage &2d4c 60 RTS ; initialise_room_doors &2d4d a0 00 LDY #&00 &2d4f a2 cd LDX #&cd ; initialise_room_doors_loop &2d51 a5 1e LDA &1e ; player_room &2d53 dd 2e 20 CMP &202e,X ; door_rooms_entrance_table # Does the door start from this room? &2d56 d0 06 BNE &2d5e ; not_an_entrance &2d58 20 12 2d JSR &2d12 ; add_door_to_room_doors &2d5b c8 INY &2d5c d0 1e BNE &2d7c ; consider_next_door ; not_an_entrance &2d5e dd fc 20 CMP &20fc,X ; door_rooms_exit_table # Does the door end in this room? &2d61 d0 19 BNE &2d7c ; door_isn't_an_exit_here &2d63 20 12 2d JSR &2d12 ; add_door_to_room_doors &2d66 a9 0b LDA #&0b &2d68 e0 01 CPX #&01 # Door &01 leads from bottom of stairs in room &02 &2d6a f0 0c BEQ &2d78 ; set_door_location # to left of top door in room &7c &2d6c b9 c1 43 LDA &43c1,Y ; room_doors_location &2d6f 49 02 EOR #&02 # Doors &00 to &ba have their exits on the opposite &2d71 e0 bb CPX #&bb # side of the room to their entrances &2d73 90 03 BCC &2d78 ; set_door_location &2d75 bd 44 22 LDA &2244,X ; doors_location_override_table - &bb # Doors &bb to &cd have differently located exits ; set_door_location &2d78 99 c1 43 STA &43c1,Y ; room_doors_location &2d7b c8 INY ; consider_next_door &2d7c ca DEX &2d7d e0 ff CPX #&ff &2d7f d0 d0 BNE &2d51 ; initialise_room_doors_loop &2d81 88 DEY &2d82 84 6e STY &6e ; number_of_doors_in_room &2d84 60 RTS ; door_positions_base_by_room_type ; 0 1 2 3 4 5 6 7 8 9 &2d85 00 0c 17 00 23 23 23 00 11 00 ; door_gap_angles ; v h &2d8f 08 00 ; get_door_positions_for_room_type &2d91 a4 1a LDY &1a ; room_type &2d93 b9 85 2d LDA &2d85,Y ; door_positions_base_by_room_type &2d96 18 CLC &2d97 65 52 ADC &52 ; door_location &2d99 a8 TAY &2d9a a5 52 LDA &52 ; door_location &2d9c 29 03 AND #&03 # Lowest two bits of location set door sprite flipping ; leave &2d9e 60 RTS ; plot_locked_doors &2d9f a6 4c LDX &4c ; door_to_consider &2da1 bd a6 26 LDA &26a6,X ; room_doors_door_or_passage &2da4 c9 01 CMP #&01 # Is this a coloured door? If not, leave &2da6 d0 f6 BNE &2d9e ; leave &2da8 bd cd 43 LDA &43cd,X ; room_doors_colour &2dab 85 53 STA &53 ; door_colour &2dad a9 0e LDA #&0e ; CLOSED_DOOR_HORIZONTAL ; plot_door_of_given_type &2daf 85 50 STA &50 ; background_sprite &2db1 a4 4c LDY &4c ; door_to_consider &2db3 b9 c1 43 LDA &43c1,Y ; room_doors_location &2db6 85 52 STA &52 ; door_location &2db8 29 01 AND #&01 # Use horizontal or vertical version of sprite &2dba 05 50 ORA &50 ; background_sprite &2dbc 85 50 STA &50 ; background_sprite &2dbe 4a LSR A &2dbf 85 51 STA &51 ; door_sprite_base_divided_by_two ; plot_door &2dc1 20 91 2d JSR &2d91 ; get_door_positions_for_room_type # Returns A = flip, Y = room type offset + location &2dc4 85 0d STA &0d ; flip_sprite &2dc6 a5 51 LDA &51 ; door_sprite_base_divided_by_two &2dc8 0a ASL A &2dc9 0a ASL A &2dca 05 0d ORA &0d ; flip_sprite &2dcc aa TAX &2dcd bd e2 23 LDA &23e2,X ; door_screen_offsets_x &2dd0 18 CLC &2dd1 79 94 23 ADC &2394,Y ; door_screen_positions_x &2dd4 85 08 STA &08 ; x &2dd6 bd 06 24 LDA &2406,X ; door_screen_offsets_y &2dd9 18 CLC &2dda 79 bb 23 ADC &23bb,Y ; door_screen_positions_y &2ddd 20 c5 28 JSR &28c5 ; calculate_first_screen_address &2de0 a5 51 LDA &51 ; door_sprite_base_divided_by_two &2de2 c9 06 CMP #&06 ; INVISIBLE_DOOR_HORIZONTAL / 2 &2de4 90 12 BCC &2df8 ; is_door_frame &2de6 d0 0c BNE &2df4 ; is_closed_door &2de8 a2 1f LDX #&1f &2dea a9 c0 LDA #&c0 ; colour 8 in both pixels # Top bit set indicates obstacle ; wipe_palette_table_loop &2dec 9d 00 43 STA &4300,X ; palette_table_for_odd_rows &2def ca DEX &2df0 10 fa BPL &2dec ; wipe_palette_table_loop &2df2 30 09 BMI &2dfd ; plot_background_sprite # Always branches ; is_closed_door &2df4 a5 53 LDA &53 ; door_colour &2df6 69 05 ADC #&05 # Use palettes &2d - &31 for closed doors ; is_door_frame &2df8 69 27 ADC #&27 # Use palettes &2b and &2c for door frames ; plot_background_sprite_after_preparing_palette_table # Called with A = palette &2dfa 20 a7 2b JSR &2ba7 ; prepare_first_palette_table ; plot_background_sprite &2dfd a4 50 LDY &50 ; background_sprite &2dff b9 19 26 LDA &2619,Y ; background_sprites_width_table &2e02 8d 8b 2a STA &2a8b ; sprite_width &2e05 8d c2 2a STA &2ac2 ; sprite_width_for_flip &2e08 a5 52 LDA &52 ; background_flip or door_location &2e0a 29 03 AND #&03 &2e0c 85 0d STA &0d ; flip_sprite &2e0e b9 d7 25 LDA &25d7,Y ; background_sprites_size_table &2e11 85 06 STA &06 ; bytes_to_plot &2e13 be ed 25 LDX &25ed,Y ; background_sprites_address_low_table &2e16 b9 03 26 LDA &2603,Y ; background_sprites_address_high_table &2e19 a8 TAY &2e1a 4c c6 2a JMP &2ac6 ; plot_sprite ; plot_gap_in_door &2e1d 20 91 2d JSR &2d91 ; get_door_positions_for_room_type # Returns A = flip &2e20 85 74 STA &74 ; door_orientation &2e22 a5 51 LDA &51 ; door_sprite_base_divided_by_two &2e24 c9 05 CMP #&05 ; ROUND_DOOR_FRAME_HORIZONTAL / 2 &2e26 90 02 BCC &2e2a ; skip_subtraction &2e28 e9 01 SBC #&01 # Use same gap for round and angular door frames ; skip_subtraction &2e2a 85 07 STA &07 ; door_type &2e2c 0a ASL A &2e2d 0a ASL A &2e2e 05 74 ORA &74 ; door_orientation &2e30 aa TAX &2e31 bd 80 08 LDA &0880,X ; door_gap_x_offsets &2e34 79 94 23 ADC &2394,Y ; door_screen_positions_x &2e37 85 08 STA &08 ; x &2e39 bd 98 08 LDA &0898,X ; door_gap_y_offsets &2e3c 18 CLC &2e3d 79 bb 23 ADC &23bb,Y ; door_screen_positions_y &2e40 85 09 STA &09 ; y &2e42 8a TXA &2e43 29 01 AND #&01 &2e45 aa TAX &2e46 bc 8f 2d LDY &2d8f,X ; door_gap_angles &2e49 18 CLC &2e4a 65 07 ADC &07 ; door_type &2e4c 65 07 ADC &07 ; door_type # X = door_type * 2 + 0 if horizontal, 1 if vertical &2e4e aa TAX &2e4f bd b0 08 LDA &08b0,X ; door_gap_lengths &2e52 aa TAX &2e53 4c 50 29 JMP &2950 ; draw_line ; acg_door_screen_addresses_table &2e56 8e 59 0e 58 ; &598e = right of room, &580e = left of room ; plot_acg_door &2e5a a8 TAY &2e5b b9 56 2e LDA &2e56,Y ; acg_door_screen_addresses_table &2e5e 85 02 STA &02 ; screen_address_low &2e60 b9 57 2e LDA &2e57,Y ; acg_door_screen_addresses_table + 1 &2e63 85 03 STA &03 ; screen_address_high &2e65 a9 14 LDA #&14 ; ACG_DOOR &2e67 85 50 STA &50 ; background_sprite &2e69 a9 3f LDA #&3f # Use palette &3f for ACG door &2e6b 20 fa 2d JSR &2dfa ; plot_background_sprite_after_preparing_palette_table &2e6e a9 06 LDA #&06 &2e70 85 51 STA &51 ; door_sprite_base_divided_by_two &2e72 d0 39 BNE &2ead ; after_plotting_door ; plot_doors &2e74 a5 6e LDA &6e ; number_of_doors_in_room &2e76 85 4c STA &4c ; door ; plot_doors_loop &2e78 a6 4c LDX &4c ; door &2e7a bd c1 43 LDA &43c1,X ; room_doors_location &2e7d 85 52 STA &52 ; door_location &2e7f bc fa 42 LDY &42fa,X ; room_doors_offset &2e82 f0 d6 BEQ &2e5a ; plot_acg_door &2e84 29 01 AND #&01 # Store whether door is horizontal or vertical &2e86 85 50 STA &50 ; background_sprite &2e88 bd a6 26 LDA &26a6,X ; room_doors_door_or_passage &2e8b c9 02 CMP #&02 &2e8d d0 06 BNE &2e95 ; is_door ; is_passage # If the door is a passage, colour sets type &2e8f bd cd 43 LDA &43cd,X ; room_doors_colour # 0 = CLOCK, 1 = BOOKCASE, 2 = BARREL &2e92 0a ASL A &2e93 10 0e BPL &2ea3 ; set_door_sprite # Always branches ; is_door &2e95 a9 0a LDA #&0a ; ROUND_DOOR_FRAME_HORIZONTAL &2e97 a4 1a LDY &1a ; room_type &2e99 c0 04 CPY #&04 &2e9b 90 06 BCC &2ea3 ;set_door_sprite &2e9d c0 07 CPY #&07 &2e9f b0 02 BCS &2ea3 ; set_door_sprite &2ea1 a9 08 LDA #&08 ; ANGULAR_DOOR_FRAME_HORIZONTAL # Use angular door frame for cavern rooms ; set_door_sprite &2ea3 05 50 ORA &50 ; background_sprite &2ea5 85 50 STA &50 ; background_sprite &2ea7 4a LSR A &2ea8 85 51 STA &51 ; door_sprite_base_divided_by_two &2eaa 20 c1 2d JSR &2dc1 ; plot_door ; after_plotting_door &2ead 20 1d 2e JSR &2e1d ; plot_gap_in_door &2eb0 20 9f 2d JSR &2d9f ; plot_locked_doors &2eb3 c6 4c DEC &4c ; door &2eb5 10 c1 BPL &2e78 ; plot_doors_loop &2eb7 a2 05 LDX #&05 &2eb9 a9 c0 LDA #&c0 ; set_all_doors_as_locked_loop &2ebb 9d c7 43 STA &43c7,X ; room_doors_locked # Set all doors to be locked by default &2ebe ca DEX &2ebf 10 fa BPL &2ebb ; set_all_doors_as_locked_loop &2ec1 86 74 STX &74 ; plotting_room # Non-zero to indicate room is being plotted ; unlock_doors_player_can_use # Then open character-specific passages &2ec3 a6 6e LDX &6e ; number_of_doors_in_room # and doors the player has keys to &2ec5 86 4c STX &4c ; door_to_consider ; unlock_doors_player_can_use_loop &2ec7 a6 4c LDX &4c ; door_to_consider &2ec9 bd c7 43 LDA &43c7,X ; room_doors_locked &2ecc 85 5d STA &5d ; door_lock &2ece bd a6 26 LDA &26a6,X ; room_doors_door_or_passage &2ed1 c9 02 CMP #&02 &2ed3 d0 23 BNE &2ef8 ; check_for_key # Is this a passage? &2ed5 bd fa 42 LDA &42fa,X ; room_doors_offset &2ed8 f0 0e BEQ &2ee8 ; check_for_acg_key # The ACG door has a special check &2eda bd cd 43 LDA &43cd,X ; room_doors_colour &2edd c5 2e CMP &2e ; player_character # If it's a passage, is it the type the player can use? &2edf d0 4e BNE &2f2f ; consider_unlocking_next_door &2ee1 a5 5d LDA &5d ; door_lock &2ee3 10 4a BPL &2f2f ; consider_unlocking_next_door &2ee5 4c 49 2f JMP &2f49 ; toggle_door_lock_for_door_X_from_A ; check_for_acg_key &2ee8 a5 85 LDA &85 ; pockets + 1 # 0 = ACG_LEFT &2eea d0 1a BNE &2f06 ; player_doesn't_have_acg_key &2eec a9 02 LDA #&02 # 2 = ACG_RIGHT &2eee c5 87 CMP &87 ; pockets + 3 &2ef0 d0 14 BNE &2f06 ; player_doesn't_have_acg_key &2ef2 c5 86 CMP &86 ; pockets + 2 &2ef4 b0 16 BCS &2f0c ; unlock_door_if_not_already_unlocked # 1 = ACG_MIDDLE &2ef6 90 0e BCC &2f06 ; lock_door_if_not_already_locked ; check_for_key &2ef8 c9 01 CMP #&01 &2efa d0 16 BNE &2f12 ; is_uncoloured_door # Is this a coloured door? &2efc bd cd 43 LDA &43cd,X ; room_doors_colour &2eff 69 0d ADC #&0d ; RED_KEY - 1 &2f01 20 67 31 JSR &3167 ; check_for_object_in_pockets # If so, does the player have the right key for it? &2f04 10 06 BPL &2f0c ; unlock_door_if_not_already_unlocked ; lock_door_if_not_already_locked &2f06 a5 5d LDA &5d ; door_lock &2f08 f0 3f BEQ &2f49 ; toggle_door_lock_for_door_X_from_A &2f0a d0 23 BNE &2f2f ; consider_unlocking_next_door ; unlock_door_if_not_already_unlocked &2f0c a5 5d LDA &5d ; door_lock &2f0e d0 39 BNE &2f49 ; toggle_door_lock_for_door_X_from_A &2f10 f0 1d BEQ &2f2f ; consider_unlocking_next_door ; is_uncoloured_door &2f12 a5 74 LDA &74 ; plotting_room &2f14 f0 07 BEQ &2f1d ; updating_doors &2f16 bd f4 42 LDA &42f4,X ; room_doors_temporarily_closed # If plotting room, is the door closed? &2f19 f0 2c BEQ &2f47 ; toggle_door_lock_for_door_X # If not, mark it as unlocked &2f1b d0 1b BNE &2f38 ; plot_temporarily_closed_door # Otherwise, plot the middle of the door ; updating_doors &2f1d bd f4 42 LDA &42f4,X ; room_doors_temporarily_closed # If not plotting room, is the door open? &2f20 f0 09 BEQ &2f2b ; plot_temporarily_closed_door_if_locked # If so, unplot the middle of the door if necessary &2f22 a5 5d LDA &5d ; door_lock &2f24 d0 09 BNE &2f2f ; consider_unlocking_next_door &2f26 20 00 29 JSR &2900 ; play_sound # Play sound_00 for closing door &2f29 f0 0d BEQ &2f38 ; plot_temporarily_closed_door # Plot newly closed door ; plot_temporarily_closed_door_if_locked &2f2b a5 5d LDA &5d ; door_lock &2f2d d0 09 BNE &2f38 ; plot_temporarily_closed_door ; consider_unlocking_next_door &2f2f c6 4c DEC &4c ; door_to_consider &2f31 10 94 BPL &2ec7 ; unlock_doors_player_can_use_loop &2f33 a9 00 LDA #&00 # Zero for calls to unlock_doors_player_can_use &2f35 85 74 STA &74 ; plotting_room # while player is in room &2f37 60 RTS ; plot_temporarily_closed_door &2f38 a9 04 LDA #&04 # Palette &31 for temporarily closed door &2f3a 85 53 STA &53 ; door_colour &2f3c a9 0e LDA #&0e ; CLOSED_DOOR_HORIZONTAL &2f3e 20 af 2d JSR &2daf ; plot_door_of_given_type &2f41 a5 74 LDA &74 ; plotting_room &2f43 d0 ea BNE &2f2f ; consider_unlocking_next_door ; toggle_door_lock &2f45 a6 4c LDX &4c ; door_to_consider ; toggle_door_lock_for_door_X &2f47 a5 5d LDA &5d ; door_lock ; toggle_door_lock_for_door_X_from_A &2f49 49 c0 EOR #&c0 &2f4b 9d c7 43 STA &43c7,X ; room_doors_locked &2f4e a9 0c LDA #&0c ; INVISIBLE_DOOR_HORIZONTAL # Plot or unplot invisible obstacle &2f50 20 af 2d JSR &2daf ; plot_door_of_given_type &2f53 f0 da BEQ &2f2f ; consider_unlocking_next_door ; convert_position_byte_into_coordinates &2f55 48 PHA &2f56 29 0f AND #&0f &2f58 0a ASL A &2f59 0a ASL A &2f5a 69 18 ADC #&18 &2f5c 85 08 STA &08 ; x &2f5e 68 PLA &2f5f 29 f0 AND #&f0 &2f61 4a LSR A &2f62 69 20 ADC #&20 &2f64 60 RTS ; plot_trapdoors_rugs_and_tables &2f65 a2 15 LDX #&15 # No trapdoor or rug in room by default &2f67 86 67 STX &67 ; room_trapdoor_or_rug &2f69 86 4c STX &4c ; trapdoor_or_rug ; plot_trapdoors_and_rugs_loop &2f6b a6 4c LDX &4c ; trapdoor_or_rug &2f6d bd 7d 24 LDA &247d,X ; trapdoor_rooms &2f70 c5 1e CMP &1e ; player_room &2f72 d0 2c BNE &2fa0 ; consider_next_trapdoor_or_rug &2f74 bd 52 24 LDA &2452,X ; trapdoor_positions &2f77 20 55 2f JSR &2f55 ; convert_position_byte_into_coordinates &2f7a 20 c5 28 JSR &28c5 ; calculate_first_screen_address &2f7d a9 00 LDA #&00 &2f7f 85 52 STA &52 ; background_flip # Plot in two halves, first unflipped &2f81 a0 10 LDY #&10 ; RUG &2f83 e0 0b CPX #&0b &2f85 b0 03 BCS &2f8a ; not_a_trapdoor &2f87 86 67 STX &67; room_trapdoor # Note which trapdoor is in the room &2f89 c8 INY ; TRAPDOOR_FRAME ; not_a_trapdoor &2f8a 98 TYA &2f8b 09 28 ORA #&28 # Use palettes &38 and &39 for RUG and TRAPDOOR_FRAME &2f8d 84 50 STY &50 ; background_sprite &2f8f 20 fa 2d JSR &2dfa ; plot_background_sprite_after_preparing_palette_table &2f92 a9 fe LDA #&fe &2f94 65 09 ADC &09 ; y &2f96 20 c5 28 JSR &28c5 ; calculate_first_screen_address &2f99 c6 52 DEC &52 ; background_flip # Plot second half vertically flipped &2f9b 20 fd 2d JSR &2dfd ; plot_background_sprite &2f9e a6 4c LDX &4c ; trapdoor_or_rug ; consider_next_trapdoor_or_rug &2fa0 c6 4c DEC &4c ; trapdoor_or_rug &2fa2 10 c7 BPL &2f6b ; plot_trapdoors_and_rugs_loop &2fa4 a2 14 LDX #&14 &2fa6 86 4c STX &4c ; table ; plot_tables_loop &2fa8 a6 4c LDX &4c ; table &2faa bd 93 24 LDA &2493,X ; table_rooms &2fad c5 1e CMP &1e ; player_room &2faf d0 27 BNE &2fd8 ; consider_next_table &2fb1 bd 68 24 LDA &2468,X ; table_positions &2fb4 20 55 2f JSR &2f55 ; convert_position_byte_into_coordinates &2fb7 20 c5 28 JSR &28c5 ; calculate_first_screen_address &2fba a0 12 LDY #&12 ; TABLE &2fbc 84 50 STY &50 ; background_sprite &2fbe a9 01 LDA #&01 # Plot table in two halves, first unflipped &2fc0 85 52 STA &52 ; background_flip &2fc2 a9 3e LDA #&3e # Use palette &3e for TABLE &2fc4 20 fa 2d JSR &2dfa ; plot_background_sprite_after_preparing_palette_table &2fc7 a5 08 LDA &08 ; x &2fc9 69 0c ADC #&0c &2fcb 85 08 STA &08 ; x &2fcd 20 99 28 JSR &2899 ; calculate_screen_address_from_x_and_y &2fd0 20 c8 28 JSR &28c8 ; store_first_screen_address &2fd3 e6 52 INC &52 ; background_flip # Second half of table is horizontally flipped &2fd5 20 fd 2d JSR &2dfd ; plot_background_sprite ; consider_next_table &2fd8 c6 4c DEC &4c ; table &2fda 10 cc BPL &2fa8 ; plot_tables_loop &2fdc a6 67 LDX &67 ; room_trapdoor_or_rug &2fde e0 0b CPX #&0b &2fe0 b0 6f BCS &3051 ; leave # Is there a trapdoor in the room? &2fe2 bd 52 24 LDA &2452,X ; trapdoor_positions &2fe5 20 55 2f JSR &2f55 ; convert_position_byte_into_coordinates &2fe8 38 SEC &2fe9 e9 0c SBC #&0c &2feb 85 69 STA &69 ; trapdoor_y &2fed a5 08 LDA &08 ; x &2fef 69 06 ADC #&06 &2ff1 85 68 STA &68 ; trapdoor_x &2ff3 bc b6 43 LDY &43b6,X ; trapdoor_states &2ff6 10 59 BPL &3051 ; leave # Leave if trapdoor is open ; plot_trapdoor_cover &2ff8 a5 68 LDA &68 ; trapdoor_x &2ffa 85 08 STA &08 ; x &2ffc a5 69 LDA &69 ; trapdoor_y &2ffe 20 c5 28 JSR &28c5 ; calculate_first_screen_address &3001 a9 00 LDA #&00 &3003 85 52 STA &52 ; background_flip &3005 a0 13 LDY #&13 ; TRAPDOOR_COVER &3007 84 50 STY &50 ; background_sprite &3009 a9 32 LDA #&32 # Use palette &32 for TRAPDOOR_COVER &300b 4c fa 2d JMP &2dfa ; plot_background_sprite_after_preparing_palette_table ; update_trapdoor &300e a6 67 LDX &67 ; room_trapdoor_or_rug &3010 e0 0b CPX #&0b &3012 b0 3d BCS &3051 ; leave # Is there a trapdoor in the room? &3014 bd b6 43 LDA &43b6,X ; trapdoor_states &3017 10 12 BPL &302b ; trapdoor_is_open &3019 20 75 28 JSR &2875 ; rnd1 &301c c9 03 CMP #&03 # 3 in 256 chance that trapdoor opens if closed &301e b0 31 BCS &3051 ; leave ; update_trapdoor_state &3020 9d b6 43 STA &43b6,X ; trapdoor_states &3023 a9 0c LDA #&0c ; sound_0c &3025 20 00 29 JSR &2900 ; play_sound # Play sound for trapdoor opening or closing &3028 4c f8 2f JMP &2ff8 ; plot_trapdoor_cover ; trapdoor_is_open &302b 20 86 28 JSR &2886 ; rnd2 &302e c9 fd CMP #&fd # 3 in 256 chance that trapdoor closes if open &3030 b0 ee BCS &3020 ; update_trapdoor_state &3032 a5 68 LDA &68 ; trapdoor_x &3034 85 08 STA &08 ; x &3036 a5 69 LDA &69 ; trapdoor_y &3038 20 47 31 JSR &3147 ; check_for_overlap_with_player_with_y &303b 90 14 BCC &3051 ; leave # Is the player standing over an open trapdoor? &303d a5 5e LDA &5e ; player_state &303f d0 10 BNE &3051 ; leave # Is the player alive? &3041 a9 01 LDA #&01 &3043 85 64 STA &64 ; player_started_or_fell_into_room &3045 20 24 39 JSR &3924 ; store_state_of_doors &3048 20 9a 2c JSR &2c9a ; trapdoor_falling_screen # If so, display the falling animation &304b a2 ff LDX #&ff &304d 9a TXS &304e 4c d7 35 JMP &35d7 ; entering_room_via_trapdoor # and change the door ; leave &3051 60 RTS ; plot_consumables &3052 a2 4f LDX #&4f ; restore_consumables_loop &3054 bd cf 1f LDA &1fcf,X ; consumables_data &3057 30 17 BMI &3070 ; consider_next_consumable # Don't restore consumables that are already present &3059 20 86 28 JSR &2886 ; rnd2 &305c dd 70 1f CMP &1f70,X ; consumables_room &305f d0 0f BNE &3070 ; consider_next_consumable # 1 in 256 chance to consider restoring a consumable &3061 20 75 28 JSR &2875 ; rnd1 &3064 29 24 AND #&24 # 1 in 8 chance to restore, otherwise abandon restoring &3066 d0 0b BNE &3073 ; skip_further_restoration &3068 a9 80 LDA #&80 # Set top bit to make consumable appear &306a 1d cf 1f ORA &1fcf,X ; consumables_data &306d 9d cf 1f STA &1fcf,X ; consumables_data ; consider_next_consumable &3070 ca DEX &3071 10 e1 BPL &3054 ; restore_consumables_loop ; skip_further_restoration &3073 a9 5e LDA #&5e &3075 85 4e STA &4e ; consumable &3077 a0 00 LDY #&00 &3079 84 4f STY &4f ; number_of_consumables_in_room ; plot_consumables_loop &307b a6 4e LDX &4e ; consumable &307d bd 70 1f LDA &1f70,X ; consumables_room &3080 c5 1e CMP &1e ; player_room &3082 d0 39 BNE &30bd ; consider_next_consumable &3084 bd cf 1f LDA &1fcf,X ; consumables_data &3087 85 4d STA &4d ; consumable_data &3089 10 32 BPL &30bd ; consider_next_consumable # Has the consumable been taken? &308b a4 4f LDY &4f ; number_of_consumables_in_room &308d 99 40 43 STA &4340,Y ; room_consumables_data &3090 29 07 AND #&07 &3092 0a ASL A # Low three bits of consumable data set x position &3093 0a ASL A &3094 0a ASL A &3095 69 1a ADC #&1a &3097 99 4a 43 STA &434a,Y ; room_consumables_x &309a 8a TXA &309b 99 54 43 STA &4354,Y ; room_consumables_offset &309e a5 4d LDA &4d ; consumable_data &30a0 29 78 AND #&78 # Remaining bits (except top bit) set y position &30a2 69 20 ADC #&20 &30a4 99 4f 43 STA &434f,Y ; room_consumables_y &30a7 8a TXA &30a8 29 07 AND #&07 &30aa e0 50 CPX #&50 # Consumables &50 to &5e are MUSHROOMs &30ac 90 03 BCC &30b1 ; isn't_mushroom &30ae a9 08 LDA #&08 ; MUSHROOM - CAN &30b0 18 CLC ; isn't_mushroom &30b1 69 1c ADC #&1c ; CAN &30b3 99 45 43 STA &4345,Y ; room_consumables_sprite &30b6 98 TYA &30b7 aa TAX &30b8 20 13 31 JSR &3113 ; plot_consumable &30bb e6 4f INC &4f ; number_of_consumables_in_room ; consider_next_consumable &30bd c6 4e DEC &4e ; consumable &30bf 10 ba BPL &307b ; plot_consumables_loop &30c1 c6 4f DEC &4f ; number_of_consumables_in_room &30c3 60 RTS ; play_sounds_for_energy_change &30c4 20 00 29 JSR &2900 ; play_sound &30c7 a9 12 LDA #&12 : sound_12 &30c9 4c 00 29 JMP &2900 ; play_sound ; check_for_player_consuming_consumables &30cc a5 5e LDA &5e ; player_state # Leave if player not alive &30ce d0 28 BNE &30f8 ; leave &30d0 a6 4f LDX &4f ; number_of_consumables_in_room ; check_for_player_consuming_consumables_loop &30d2 bd 40 43 LDA &4340,X ; room_consumables_data &30d5 10 1e BPL &30f5 ; consider_next_consumable # Top bit clear if consumable already consumed &30d7 bd 4a 43 LDA &434a,X ; room_consumables_x &30da 85 08 STA &08 ; x &30dc bd 4f 43 LDA &434f,X ; room_consumables_y &30df 20 47 31 JSR &3147 ; check_for_overlap_with_player_with_y &30e2 90 11 BCC &30f5 ; consider_next_consumable &30e4 bd 54 43 LDA &4354,X ; room_consumables_offset &30e7 c9 50 CMP #&50 # Is the consumable a MUSHROOM? &30e9 90 0e BCC &30f9 ; consume_consumable &30eb a9 24 LDA #&24 # Drain &2400 energy for touching MUSHROOM &30ed 20 c3 3b JSR &3bc3 ; drain_energy_one &30f0 a9 1b LDA #&1b ; sound_1b &30f2 20 c4 30 JSR &30c4 ; play_sounds_for_energy_change ; consider_next_consumable &30f5 ca DEX &30f6 10 da BPL &30d2 ; check_for_player_consuming_consumables_loop ; leave &30f8 60 RTS ; consume_consumable &30f9 a9 06 LDA #&06 ; sound_06 &30fb 20 00 29 JSR &2900 ; play_sound # Play sound for consuming consumable &30fe a9 f6 LDA #&f6 # Gain &a0000 energy for consuming consumable &3100 20 c9 3b JSR &3bc9 ; drain_energy_two &3103 a9 00 LDA #&00 # Clear top bit to mark consumable as consumed in room &3105 9d 40 43 STA &4340,X ; room_consumables_data &3108 bc 54 43 LDY &4354,X ; room_consumables_offset &310b b9 cf 1f LDA &1fcf,Y ; consumables_data &310e 29 7f AND #&7f # Clear top bit to mark consumable as consumed in game &3110 99 cf 1f STA &1fcf,Y ; consumables_data ; plot_consumable # Unplot consumable &3113 bd 4a 43 LDA &434a,X ; room_consumables_x &3116 85 08 STA &08 ; x &3118 bd 4f 43 LDA &434f,X ; room_consumables_y &311b 20 c5 28 JSR &28c5 ; calculate_first_screen_address &311e bd 45 43 LDA &4345,X ; room_consumables_sprite &3121 48 PHA &3122 e9 10 SBC #&10 # Use palettes &0b to &12 for consumables, &13 mushroom &3124 a2 00 LDX #&00 &3126 86 0d STX &0d ; flip_sprite &3128 a2 24 LDX #&24 &312a 86 06 STX &06 ; bytes_to_plot &312c a2 28 LDX #&28 &312e 8e 8b 2a STX &2a8b ; sprite_width &3131 20 a7 2b JSR &2ba7 ; prepare_first_palette_table &3134 68 PLA &3135 20 de 2b JSR &2bde ; calculate_other_sprite_address &3138 4c c6 2a JMP &2ac6 ; plot_sprite ; check_for_overlap_in_x &313b 18 CLC &313c 69 18 ADC #&18 &313e 85 07 STA &07 ; end_x &3140 a5 08 LDA &08 ; x &3142 69 0c ADC #&0c &3144 c5 07 CMP &07 ; end_x &3146 60 RTS ; check_for_overlap_with_player_with_y # Leaves with carry set if overlap &3147 85 09 STA &09 ; y ; check_for_overlap_with_player &3149 a5 31 LDA &31 ; player_x &314b 20 3b 31 JSR &313b ; check_for_overlap_in_x &314e b0 15 BCS &3165 ; leave_with_carry_clear &3150 c5 31 CMP &31 ; player_x &3152 90 12 BCC &3166 ; leave &3154 a5 32 LDA &32 ; player_y &3156 69 2b ADC #&2b &3158 85 07 STA &07 ; end_y &315a a5 09 LDA &09 ; y &315c 69 16 ADC #&16 &315e c5 07 CMP &07 ; end_y &3160 b0 03 BCS &3165 ; leave_with_carry_clear &3162 c5 32 CMP &32 ; player_y &3164 60 RTS ; leave_with_carry_clear &3165 18 CLC ; leave &3166 60 RTS ; check_for_object_in_pockets # Leaves with equal set if player carrying object &3167 a0 02 LDY #&02 ; check_for_object_in_pockets_loop &3169 d9 85 00 CMP &0085,Y ; pockets + 1 &316c f0 03 BEQ &3171 ; leave &316e 88 DEY &316f 10 f8 BPL &3169 ; check_for_object_in_pockets_loop ; leave &3171 60 RTS ; set_previous_and_current_player_sprite_addresses &3172 a5 8a LDA &8a ; sprite_previous &3174 20 00 2c JSR &2c00 ; calculate_player_sprite_address &3177 8e d8 27 STX &27d8 ; previous_sprite_address_low &317a 8c d9 27 STY &27d9 ; previous_sprite_address_high &317d a5 8b LDA &8b ; sprite &317f 20 00 2c JSR &2c00 ; calculate_player_sprite_address ; to_set_sprite_addresses &3182 4c b6 31 JMP &31b6 ; set_sprite_addresses ; prepare_first_palette_table_for_player &3185 a5 2e LDA &2e ; player_character &3187 18 CLC &3188 69 45 ADC #&45 # Use palettes &45 - &47 for player ; prepare_and_duplicate_palette_table &318a 20 a7 2b JSR &2ba7 ; prepare_first_palette_table &318d a2 1f LDX #&1f ; duplicate_palette_table_loop &318f bd 00 43 LDA &4300,X ; palette_table # Use same palette table for previous and current sprite &3192 9d 20 43 STA &4320,X ; palette_table + &20 &3195 ca DEX &3196 10 f7 BPL &318f ; duplicate_palette_table_loop &3198 60 RTS ; prepare_sprite_addresses_and_palette_table_for_enemy &3199 20 a6 31 JSR &31a6 ; set_previous_and_current_other_sprite_addresses &319c a5 88 LDA &88 ; enemy_previous_colour &319e 20 a7 2b JSR &2ba7 ; prepare_first_palette_table &31a1 a5 89 LDA &89 ; enemy_colour &31a3 4c a3 2b JMP &2ba3 ; prepare_second_palette_table ; set_previous_and_current_other_sprite_addresses &31a6 a5 8a LDA &8a ; sprite_previous &31a8 20 de 2b JSR &2bde ; calculate_other_sprite_address &31ab 8e d8 27 STX &27d8 ; sprite_address_low &31ae 8c d9 27 STY &27d9 ; sprite_address_high &31b1 a5 8b LDA &8b ; sprite &31b3 20 de 2b JSR &2bde ; calculate_other_sprite_address ; set_sprite_addresses &31b6 8e f1 27 STX &27f1 ; sprite_address_low &31b9 8c f2 27 STY &27f2 ; sprite_address_high &31bc 60 RTS ; plot_object &31bd 20 c5 28 JSR &28c5 ; calculate_first_screen_address &31c0 bd 8a 43 LDA &438a,X ; objects_x &31c3 85 08 STA &08 ; x &31c5 bd 5e 43 LDA &435e,X ; objects_y &31c8 20 d1 28 JSR &28d1 ; calculate_second_screen_address &31cb e0 0e CPX #&0e &31cd 8a TXA &31ce b0 07 BCS &31d7 ; object_is_key_or_tombstone &31d0 69 14 ADC #&14 &31d2 a8 TAY # Use palettes &14 to &21 for objects &31d3 69 12 ADC #&12 ; &26 = ACG_LEFT &31d5 d0 0f BNE &31e6 ; set_object_sprites ; object_is_key_or_tombstone &31d7 e0 12 CPX #&12 &31d9 b0 07 BCS &31e2 ; object_is_tombstone &31db 69 2c ADC #&2c # Use palettes &3a to &3d for keys &31dd a8 TAY &31de a9 25 LDA #&25 ; KEY &31e0 d0 04 BNE &31e6 ; set_object_sprites ; object_is_tombstone &31e2 a0 22 LDY #&22 # Use palettes &22 for tombstone &31e4 a9 34 LDA #&34 ; TOMBSTONE ; set_object_sprites &31e6 85 8a STA &8a ; sprite_previous &31e8 85 8b STA &8b ; sprite &31ea 98 TYA &31eb 48 PHA &31ec 20 a6 31 JSR &31a6 ; set_previous_and_current_other_sprite_addresses &31ef 68 PLA &31f0 20 8a 31 JSR &318a ; prepare_and_duplicate_palette_table &31f3 4c cc 27 JMP &27cc ; replot_double_height_sprite ; put_object_in_room &31f6 a9 fa LDA #&fa # Mark object as not being in any pocket &31f8 9d a0 43 STA &43a0,X ; objects_pocket &31fb a5 1e LDA &1e ; player_room &31fd 9d 74 43 STA &4374,X ; objects_rooms &3200 a4 32 LDY &32 ; player_y &3202 a5 31 LDA &31 ; player_x &3204 60 RTS ; pocket_x_table &3205 7a 86 92 ; check_for_picking_up_object &3208 a9 62 LDA #&62 ; SPACE &320a 20 dd 28 JSR &28dd ; check_for_keypress &320d d0 05 BNE &3214 ; pick_up_object &320f a9 01 LDA #&01 &3211 85 55 STA &55 ; space_was_pressed ; leave &3213 60 RTS ; pick_up_object &3214 a5 55 LDA &55 ; space_was_pressed &3216 f0 fb BEQ &3213 ; leave # Require SPACE to be pressed each time &3218 c6 55 DEC &55 ; space_was_pressed &321a a2 11 LDX #&11 ; consider_objects_loop &321c bd 74 43 LDA &4374,X ; objects_rooms &321f c5 1e CMP &1e ; player_room # Is the object in the room? &3221 d0 1e BNE &3241 ; consider_next_object &3223 bd a0 43 LDA &43a0,X ; objects_pocket &3226 10 19 BPL &3241 ; consider_next_object # Is the object already in a pocket? &3228 bd 8a 43 LDA &438a,X ; objects_x &322b 85 08 STA &08 ; x &322d bd 5e 43 LDA &435e,X ; objects_y &3230 20 47 31 JSR &3147 ; check_for_overlap_with_player_with_y &3233 90 0c BCC &3241 ; consider_next_object &3235 a9 03 LDA #&03 ; sound_03 &3237 20 00 29 JSR &2900 ; play_sound # Play sound for picking up object &323a a9 00 LDA #&00 # Mark object as being in the first pocket &323c 9d a0 43 STA &43a0,X ; objects_pocket &323f f0 03 BEQ &3244 ; store_object ; consider_next_object &3241 ca DEX &3242 10 d8 BPL &321c ; consider_objects_loop # Falls through with &ff if no object picked up ; store_object &3244 86 84 STX &84 ; pockets &3246 a2 03 LDX #&03 &3248 86 56 STX &56 ; pocket ; replot_pockets_loop &324a a6 56 LDX &56 ; pocket &324c b5 84 LDA &84,X ; pockets &324e 30 30 BMI &3280 ; replot_next_pocket &3250 aa TAX &3251 fe a0 43 INC &43a0,X ; objects_pocket # Move object to next pocket &3254 bd 8a 43 LDA &438a,X ; objects_x &3257 85 08 STA &08 ; x &3259 bd 5e 43 LDA &435e,X ; objects_y &325c 85 09 STA &09 ; y &325e bc a0 43 LDY &43a0,X ; objects_pocket &3261 c0 04 CPY #&04 &3263 90 0a BCC &326f ; object_in_pocket &3265 a9 03 LDA #&03 ; sound_03 &3267 20 00 29 JSR &2900 ; play_sound # Play sound for dropping object &326a 20 f6 31 JSR &31f6 ; put_object_in_room &326d d0 05 BNE &3274 ; object_not_in_pocket # Always branches ; object_in_pocket &326f b9 04 32 LDA &3204,Y ; pocket_x_table - 1 &3272 a0 1e LDY #&1e ; object_not_in_pocket &3274 9d 8a 43 STA &438a,X ; objects_x &3277 98 TYA &3278 9d 5e 43 STA &435e,X ; objects_y &327b a5 09 LDA &09 ; y &327d 20 bd 31 JSR &31bd ; plot_object ; replot_next_pocket &3280 c6 56 DEC &56 ; pocket &3282 10 c6 BPL &324a ; replot_pockets_loop ; shuffle_pockets &3284 a0 02 LDY #&02 ; shuffle_pockets_loop &3286 b9 84 00 LDA &0084,Y ; pockets &3289 99 85 00 STA &0085,Y ; pockets + 1 &328c 88 DEY &328d 10 f7 BPL &3286 ; shuffle_pockets_loop &328f 60 RTS ; plot_objects &3290 a2 15 LDX #&15 &3292 86 56 STX &56 ; object ; plot_objects_loop &3294 a6 56 LDX &56 ; object &3296 bd 74 43 LDA &4374,X ; objects_rooms &3299 c5 1e CMP &1e ; player_room &329b d0 0a BNE &32a7 ; consider_next_object &329d bd a0 43 LDA &43a0,X ; objects_pocket &32a0 10 05 BPL &32a7 ; consider_next_object # Is the object in a pocket? &32a2 a9 ff LDA #&ff &32a4 20 bd 31 JSR &31bd ; plot_object ; consider_next_object &32a7 c6 56 DEC &56 ; object &32a9 10 e9 BPL &3294 ; plot_objects_loop &32ab 60 RTS ; initialise_fixed_object &32ac be 73 25 LDX &2573,Y ; list_of_fixed_objects &32af b9 5b 25 LDA &255b,Y ; initial_rooms_for_fixed_objects &32b2 9d 74 43 STA &4374,X ; objects_rooms &32b5 b9 67 25 LDA &2567,Y ; initial_positions_for_fixed_objects &32b8 20 55 2f JSR &2f55 ; convert_position_byte_into_coordinates &32bb 9d 5e 43 STA &435e,X ; objects_y &32be a5 08 LDA &08 ; x &32c0 9d 8a 43 STA &438a,X ; objects_x &32c3 60 RTS ; irq1_handler &32c4 ad 4d fe LDA &fe4d ; System VIA interrupt flag register &32c7 29 82 AND #&82 # System VIA CA1 (v-sync) &32c9 c9 82 CMP #&82 &32cb f0 0a BEQ &32d7 ; vsync_interrupt &32cd ad 6d fe LDA &fe6d ; User VIA interrupt flag register &32d0 29 20 AND #&20 # User VIA timer 2 timeout &32d2 d0 3f BNE &3313 ; timer_interrupt &32d4 4c 93 dc JMP &dc93 ; os_irq1_handler ; vsync_interrupt &32d7 8d 4d fe STA &fe4d ; System VIA interrupt flag register # Clear interrupt &32da 86 72 STX &72 ; irq_x &32dc a9 01 LDA #&01 &32de 85 71 STA &71 ; vsync &32e0 a5 27 LDA &27 ; game_paused &32e2 d0 1a BNE &32fe ; skip_time # If the game isn't paused, increase the time &32e4 f8 SED &32e5 a5 78 LDA &78 ; game_time &32e7 69 01 ADC #&01 &32e9 85 78 STA &78 ; game_time &32eb 90 11 BCC &32fe ; no_overflow &32ed a2 00 LDX #&00 ; increment_game_time_loop &32ef b5 79 LDA &79,X ; game_time + 1 &32f1 69 00 ADC #&00 &32f3 c9 60 CMP #&60 &32f5 90 02 BCC &32f9 ; skip_overflow &32f7 a9 00 LDA #&00 ; skip_overflow &32f9 95 79 STA &79,X ; game_time + 1 &32fb e8 INX &32fc b0 f1 BCS &32ef ; increment_game_time_loop ; no_overflow ; skip_time &32fe 29 04 AND #&04 &3300 d0 02 BNE &3304 ; skip_nasties &3302 85 91 STA &91 ; nasties_cooldown # Every four frames, reset nasties_cooldown &3304 a6 72 LDX &72 ; irq_x &3306 a9 10 LDA #&10 &3308 8d 68 fe STA &fe68 ; User VIA timer 2 counter LSB # Set the timer after v-sync &330b a9 24 LDA #&24 ; set_timer_msb &330d 8d 69 fe STA &fe69 ; User VIA timer 2 counter MSB &3310 a5 fc LDA &fc ; irq_accumulator &3312 40 RTI ; timer_interrupt &3313 ad 68 fe LDA &fe68 ; User VIA timer 2 counter LSB # Clear interrupt &3316 a9 01 LDA #&01 &3318 85 f8 STA &f8 ; via_event &331a d0 f4 BNE &3310 ; set_timer_msb # Always branches ; wait_for_vsync &331c a9 00 LDA #&00 &331e 85 71 STA &71 ; vsync ; wait_for_vsync_loop &3320 a5 71 LDA &71 ; vsync &3322 f0 fc BEQ &3320 ; wait_for_vsync_loop &3324 60 RTS ; select_character &3325 86 2e STX &2e ; player_character &3327 d0 2d BNE &3356 ; list_characters ; character_strings_start &3329 76 82 8e ; KNIGHT, WIZARD, SERF ; character_strings_end &332c 82 8e 98 ; character_selection_keys &332f 30 31 11 ; 1, 2, 3 ; character_selection_screen &3332 a2 ff LDX #&0ff &3334 9a TXS &3335 20 57 3c JSR &3c57 ; clear_screen &3338 a5 2e LDA &2e ; player_character &333a 48 PHA &333b a2 03 LDX #&03 &333d 86 2e STX &2e ; player_character &333f 20 a9 36 JSR &36a9 ; plot_life_with_character &3342 a2 04 LDX #&04 &3344 20 a9 36 JSR &36a9 ; plot_life_with_character &3347 a2 05 LDX #&05 &3349 20 a9 36 JSR &36a9 ; plot_life_with_character &334c 68 PLA &334d 85 2e STA &2e ; player_character &334f a2 00 LDX #&00 # Starting screen text &3351 a9 48 LDA #&48 &3353 20 67 3c JSR &3c67 ; write_string ; list_characters &3356 a0 02 LDY #&02 ; list_characters_loop &3358 a9 9a LDA #&9a # COLOUR 1 &335a a2 98 LDX #&98 &335c 20 67 3c JSR &3c67 ; write_string &335f c4 2e CPY &2e ; player_character &3361 d0 05 BNE &3368 ; not_selected &3363 a9 9c LDA #&9c # COLOUR 7 &3365 20 67 3c JSR &3c67 ; write_string ; not_selected &3368 be 29 33 LDX &3329,Y ; character_strings_start &336b b9 2c 33 LDA &332c,Y ; character_strings_end &336e 20 67 3c JSR &3c67 ; write_string &3371 88 DEY &3372 10 e4 BPL &3358 ; list_characters_loop ; character_selection_screen_loop &3374 a2 01 LDX #&01 &3376 86 33 STX &33 ; keyboard_or_joystick # 1 = joystick, 0 = keyboard &3378 e8 INX ; check_for_character_selection_keys_loop &3379 bd 2f 33 LDA &332f,X ; character_selection_keys &337c 20 dd 28 JSR &28dd ; check_for_keypress &337f d0 a4 BNE &3325 ; select_character &3381 ca DEX &3382 10 f5 BPL &3379 ; check_for_character_selection_keys_loop &3384 20 f5 28 JSR &28f5 ; check_for_joystick_button &3387 f0 10 BEQ &3399 ; start_game_with_joystick &3389 a9 62 LDA #&62 ; SPACE &338b 20 dd 28 JSR &28dd ; check_for_keypress &338e d0 07 BNE &3397 ; start_game_with_keyboard &3390 a9 00 LDA #&00 ; SHIFT &3392 20 dd 28 JSR &28dd ; check_for_keypress &3395 f0 dd BEQ &3374 ; check_for_character_selection_keys_loop ; start_game_with_keyboard &3397 c6 33 DEC &33 ; keyboard_or_joystick ; start_game_with_joystick &3399 a9 0f LDA #&0f &339b 85 04 STA &04 ; unused # Unnecessary code ; play_tune &339d ac 62 02 LDY &0262 ; os_sound_suppression &33a0 d0 27 BNE &33c9 ; skip_tune ; play_tune_loop &33a2 ee 5f 26 INC &265f ; sound_data + &30 # Increase channel for sound_30 &33a5 ad 5f 26 LDA &265f ; sound_data + &30 &33a8 c9 18 CMP #&18 # Use channels 1 to 3 &33aa 90 05 BCC &33b1 ; reset_channel &33ac a9 15 LDA #&15 # Channel 1, flush, duration 2 &33ae 8d 5f 26 STA &265f ; sound_data + &30 ; reset_channel &33b1 b9 75 3c LDA &3c75,Y ; tune_data &33b4 30 13 BMI &33c9 ; skip_tune # Top bit set marks end of tune &33b6 8d 61 26 STA &2661 ; sound_data + &32 # Set pitch for sound_30 &33b9 a9 30 LDA #&30 ; sound_30 &33bb 20 00 29 JSR &2900 ; play_sound # Play note of tune &33be a2 08 LDX #&08 ; delay_loop &33c0 20 1c 33 JSR &331c ; wait_for_vsync &33c3 ca DEX &33c4 d0 fa BNE &33c0 ; delay_loop &33c6 c8 INY &33c7 d0 d9 BNE &33a2 ; play_tune_loop ; skip_tune &33c9 a2 03 LDX #&03 &33cb 86 73 STX &73 ; player_lives ; reset_pockets &33cd a9 ff LDA #&ff ; reset_pockets_loop &33cf 95 84 STA &84,X ; pockets &33d1 ca DEX &33d2 10 fb BPL &33cf ; reset_pockets_loop &33d4 e8 INX ; 0 &33d5 86 1e STX &1e ; player_room # Player starts in room 0 ; reset_consumables &33d7 a2 4f LDX #&4f ; reset_consumables_loop &33d9 bd cf 1f LDA &1fcf,X ; consumables_data &33dc 09 80 ORA #&80 # Set top bit to indicate consumable present &33de 9d cf 1f STA &1fcf,X ; consumables_data &33e1 ca DEX &33e2 10 f5 BPL &33d9 ; reset_consumables_loop ; reset_doors &33e4 a2 cd LDX #&cd ; reset_doors_loop &33e6 bd ca 21 LDA &21ca,X ; doors_flags &33e9 29 f0 AND #&f0 # Clear any temporary closed flag and timer &33eb a8 TAY &33ec 29 30 AND #&30 &33ee c9 30 CMP #&30 &33f0 d0 06 BNE &33f8 ; not_unlocked_coloured_door &33f2 98 TYA &33f3 29 c0 AND #&c0 &33f5 09 10 ORA #&10 # Lock any unlocked coloured doors &33f7 a8 TAY ; not_unlocked_coloured_door &33f8 98 TYA &33f9 9d ca 21 STA &21ca,X ; doors_flags &33fc ca DEX &33fd d0 e7 BNE &33e6 ; reset_doors_loop &33ff 20 57 3c JSR &3c57 ; clear_screen &3402 a9 76 LDA #&76 # define text window (00 17 0e 00), COLOUR &88 &3404 a2 6f LDX #&6f &3406 20 67 3c JSR &3c67 ; write_string ; initialise_nasty_positions &3409 a2 04 LDX #&04 ; initialise_nasty_positions_loop &340b a9 20 LDA #&20 &340d 9d d8 43 STA &43d8,X ; nasties_y &3410 a9 36 LDA #&36 &3412 9d d3 43 STA &43d3,X ; nasties_x &3415 ca DEX &3416 10 f3 BPL &340b ; initialise_nasty_positions_loop ; initialise_objects &3418 a2 15 LDX #&15 &341a a9 fa LDA #&fa ; initialise_objects_loop &341c 9d a0 43 STA &43a0,X ; objects_pocket # Set object as not being in a pocket &341f 9d 74 43 STA &4374,X ; objects_rooms &3422 ca DEX &3423 10 f7 BPL &341c ; initialise_objects_loop ; randomly_position_objects &3425 20 75 28 JSR &2875 ; rnd1 # Get a random number between 0 and 9 &3428 38 SEC ; reduce_to_0_to_9 &3429 e9 0a SBC #&0a &342b b0 fc BCS &3429 ; reduce_to_0_to_9 &342d 69 0a ADC #&0a &342f 85 70 STA &70 ; random &3431 a8 TAY &3432 a9 05 LDA #&05 &3434 85 75 STA &75 ; player_movement_cooldown &3436 85 02 STA &02 ; object &3438 b9 cd 25 LDA &25cd,Y ; sixes_minus_one # Choose a set of random locations using this number &343b 85 70 STA &70 ; random_room_list_offset ; initialise_random_objects_loop &343d a6 70 LDX &70 ; random_room_list_offset &343f a4 02 LDY &02 ; object &3441 b9 c7 25 LDA &25c7,Y ; list_of_random_objects &3444 a8 TAY &3445 bd 7f 25 LDA &257f,X ; initial_rooms_for_random_objects &3448 99 74 43 STA &4374,Y ; objects_rooms &344b a6 02 LDX &02 ; object &344d bd bb 25 LDA &25bb,X ; initial_x_for_random_objects &3450 99 8a 43 STA &438a,Y ; objects_x &3453 bd c1 25 LDA &25c1,X ; initial_y_for_random_objects &3456 99 5e 43 STA &435e,Y ; objects_y &3459 c6 70 DEC &70 ; random_room_list_offset &345b c6 02 DEC &02 ; object &345d 10 de BPL &343d ; initialise_random_objects_loop ; initialise_fixed_objects_loop &345f a0 0b LDY #&0b &3461 20 ac 32 JSR &32ac ; initialise_fixed_object &3464 88 DEY &3465 10 fa BPL &3461 ; initialise_fixed_objects_loop &3467 a5 70 LDA &70 ; random_room_list_offset &3469 c9 23 CMP #&23 &346b f0 05 BEQ &3472 ; is_layout_six &346d a9 07 LDA #&07 # Put LEAF in room &07 nine times out of ten &346f 8d 81 43 STA &4381 ; objects_rooms + &d ; LEAF ; is_layout_six &3472 ad 82 43 LDA &4382 ; objects_rooms + &e ; KEY_RED &3475 85 8f STA &8f ; nasties_room + 3 ; MUMMY # Put MUMMY in same room as KEY_RED &3477 a2 02 LDX #&02 &3479 a9 96 LDA #&96 ; initialise_enemies_room_loop &347b 9d fa 43 STA &43fa,X ; enemies_room # Put enemies in an unused room &347e 9d e0 42 STA &42e0,X ; enemies_change_cooldown &3481 ca DEX &3482 10 f5 BPL &3479 ; initialise_enemies_room_loop &3484 e8 INX &3485 86 27 STX &27 ; game_paused &3487 86 76 STX &76 ; unused &3489 20 4c 37 JSR &374c ; reset_player_energy &348c a2 00 LDX #&00 # Plot initial three lives &348e 20 ab 36 JSR &36ab ; plot_life &3491 a2 01 LDX #&01 &3493 20 ab 36 JSR &36ab ; plot_life &3496 a2 02 LDX #&02 &3498 20 ab 36 JSR &36ab ; plot_life ; initialise_game_time &349b a2 0c LDX #&0c &349d a9 00 LDA #&00 ; initialise_game_time_loop &349f 95 77 STA &77,X ; game_time - 1 &34a1 ca DEX &34a2 10 fb BPL &349f ; initialise_game_time_loop &34a4 20 96 3b JSR &3b96 ; plot_score &34a7 a9 01 LDA #&01 &34a9 85 64 STA &64 ; player_started_or_fell_into_room ; enter_room &34ab 20 63 3c JSR &3c63 ; colour_8_clear_screen # Clear the room area of the screen with colour 8 &34ae 20 21 2a JSR &2a21 ; plot_status_area_border_with_random_colour &34b1 20 f2 29 JSR &29f2 ; mark_room_as_visited_and_get_wall_type &34b4 20 2f 2c JSR &2c2f ; wipe_middle_of_room # Clear the floor part of the room with colour 0 &34b7 a5 1a LDA &1a ; room_type &34b9 0a ASL A &34ba 0a ASL A &34bb aa TAX &34bc a0 00 LDY #&00 ; set_room_sizes_loop &34be bd 33 25 LDA &2533,X ; room_sizes &34c1 99 3c 00 STA &003c,Y ; room_min_y &34c4 18 CLC &34c5 79 bc 08 ADC &08bc,Y ; door_sizes &34c8 99 40 00 STA &0040,Y ; room_min_y_including_door &34cb e8 INX &34cc c8 INY &34cd c0 04 CPY #&04 &34cf 90 ed BCC &34be ; set_room_sizes_loop &34d1 a6 1a LDX &1a ; room_type &34d3 20 31 2a JSR &2a31 ; plot_walls &34d6 20 4d 2d JSR &2d4d ; initialise_room_doors &34d9 20 68 39 JSR &3968 ; initialise_player_position_on_entering_room &34dc 20 74 2e JSR &2e74 ; plot_doors &34df 20 65 2f JSR &2f65 ; plot_trapdoors_rugs_and_tables &34e2 20 52 30 JSR &3052 ; plot_consumables &34e5 20 90 32 JSR &3290 ; plot_objects &34e8 20 b0 3c JSR &3cb0 ; plot_paintings &34eb a2 02 LDX #&02 ; initialise_enemies_loop &34ed a9 80 LDA #&80 # Skip unplotting enemy &34ef 9d ec 42 STA &42ec,X ; enemies_screen_address_high &34f2 bc fa 43 LDY &43fa,X ; enemies_room &34f5 20 75 28 JSR &2875 ; rnd1 &34f8 4a LSR A &34f9 4a LSR A &34fa c4 1e CPY &1e ; player_room &34fc d0 02 BNE &3500 ; enemy_not_in_room &34fe a9 01 LDA #&01 ; enemy_not_in_room &3500 9d e0 42 STA &42e0,X ; enemies_change_cooldown &3503 ca DEX &3504 10 e7 BPL &34ed ; initialise_enemies_loop &3506 20 84 40 JSR &4084 ; initialise_nasties &3509 a9 ff LDA #&ff &350b 85 3b STA &3b ; spell_ttl &350d a5 1e LDA &1e ; player_room &350f c9 94 CMP #&94 # Is the player in the exit room? &3511 d0 4d BNE &3560 ; main_game_loop &3513 a9 60 LDA #&60 # YOU HAVE ESCAPED &3515 a2 48 LDX #&48 &3517 d0 04 BNE &351d ; completed_screen ; game_over_screen &3519 a2 60 LDX #&60 # GAME OVER &351b a9 6f LDA #&6f ; completed_screen &351d 20 67 3c JSR &3c67 ; write_string &3520 a9 01 LDA #&01 &3522 85 02 STA &02 ; score_fraction &3524 85 03 STA &03 ; score &3526 a2 95 LDX #&95 ; count_visited_rooms_loop &3528 bd da 1e LDA &1eda,X ; rooms_wall_data - 1 # Top bit set if room was visited &352b 10 12 BPL &353f ; room_wasn't_visited &352d 29 7f AND #&7f &352f 9d da 1e STA &1eda,X ; rooms_wall_data - 1 &3532 f8 SED &3533 a9 66 LDA #&66 &3535 65 02 ADC &02 ; score_fraction &3537 85 02 STA &02 ; score_fraction &3539 a5 03 LDA &03 ; score &353b 69 00 ADC #&00 &353d 85 03 STA &03 ; score ; room_wasn't_visited &353f ca DEX &3540 d0 e6 BNE &3528 ; count_visited_rooms_loop &3542 d8 CLD &3543 a9 6a LDA #&6a ; &6a38 &3545 85 0b STA &0b ; screen_address_high &3547 a0 38 LDY #&38 &3549 84 0a STY &0a ; screen_address_low &354b a5 03 LDA &03 ; score &354d 20 aa 3b JSR &3baa ; plot_two_digit_number &3550 a9 0b LDA #&0b ; "%" &3552 20 ee 3a JSR &3aee ; plot_character &3555 a2 00 LDX #&00 ; delay_loop &3557 20 1c 33 JSR &331c ; wait_for_vsync &355a ca DEX &355b d0 fa BNE &3557 ; delay_loop &355d 4c 32 33 JMP &3332 ; character_selection_screen ; main_game_loop &3560 20 e1 3b JSR &3be1 ; update_player_and_turkey &3563 20 0b 3b JSR &3b0b ; plot_time &3566 20 0e 30 JSR &300e ; update_trapdoor &3569 20 e1 3b JSR &3be1 ; update_player_and_turkey &356c 20 c3 2e JSR &2ec3 ; unlock_doors_player_can_use &356f 20 cc 30 JSR &30cc ; check_for_player_consuming_consumables &3572 20 72 38 JSR &3872 ; update_player &3575 20 c3 40 JSR &40c3 ; update_nasties &3578 20 e1 3b JSR &3be1 ; update_player_and_turkey &357b a9 69 LDA #&69 ; COPY &357d 20 dd 28 JSR &28dd ; check_for_keypress &3580 f0 02 BEQ &3584 ; copy_not_pressed &3582 e6 27 INC &27 ; game_paused ; copy_not_pressed ; pause_loop &3584 a9 70 LDA #&70 ; ESCAPE &3586 20 dd 28 JSR &28dd ; check_for_keypress &3589 d0 8e BNE &3519 ; game_over_screen &358b a5 27 LDA &27 ; game_paused &358d f0 1d BEQ &35ac ; game_not_paused &358f a2 01 LDX #&01 &3591 a9 10 LDA #&10 ; Q &3593 20 dd 28 JSR &28dd ; check_for_keypress &3596 d0 08 BNE &35a0 ; set_sound_suppression &3598 a9 51 LDA #&51 ; S &359a 20 dd 28 JSR &28dd ; check_for_keypress &359d f0 04 BEQ &35a3 ; skip_sound_suppression &359f ca DEX ; set_sound_suppression &35a0 8e 62 02 STX &0262 ; os_sound_suppression ; skip_sound_suppression &35a3 a9 59 LDA #&59 ; DELETE &35a5 20 dd 28 JSR &28dd ; check_for_keypress &35a8 f0 da BEQ &3584 ; pause_loop &35aa c6 27 DEC &27 ; game_paused ; game_not_paused &35ac 20 17 3f JSR &3f17 ; update_enemies &35af 30 af BMI &3560 ; main_game_loop # Always branches ; enter_door &35b1 a6 6e LDX &6e ; number_of_doors_in_room &35b3 a5 52 LDA &52 ; door_location ; find_door_loop # Determine which door was used &35b5 dd c1 43 CMP &43c1,X ; room_doors_location &35b8 f0 03 BEQ &35bd ; found_door &35ba ca DEX &35bb 10 f8 BPL &35b5 ; find_door_loop ; found_door &35bd bd a6 26 LDA &26a6,X ; room_doors_door_or_passage &35c0 c9 01 CMP #&01 # Is this a coloured door? &35c2 d0 05 BNE &35c9 ; not_coloured_door &35c4 a9 03 LDA #&03 # If so, mark as open &35c6 9d a6 26 STA &26a6,X ; room_doors_door_or_passage ; not_coloured_door &35c9 a9 00 LDA #&00 &35cb 9d f4 42 STA &42f4,X ; room_doors_temporarily_closed &35ce 9d a0 26 STA &26a0,X ; room_doors_closed_cooldown &35d1 20 24 39 JSR &3924 ; store_state_of_doors &35d4 20 42 39 JSR &3942 ; get_door_exit_room # Determine where the door leads ; entering_room_via_trapdoor &35d7 a9 05 LDA #&05 &35d9 85 75 STA &75 ; player_movement_cooldown &35db 20 2a 2a JSR &2a2a ; plot_status_area_border_with_same_colour # Unplot status area border &35de 4c ab 34 JMP &34ab ; enter_room ; check_for_obstacles &35e1 a5 32 LDA &32 ; player_y ; check_for_obstacles_with_A &35e3 a4 31 LDY &31 ; player_x &35e5 85 09 STA &09 ; y &35e7 84 08 STY &08 ; x &35e9 20 f2 35 JSR &35f2 ; check_for_obstacle &35ec 30 15 BMI &3603 ; leave &35ee a5 09 LDA &09 ; y &35f0 69 16 ADC #&16 ; check_for_obstacle &35f2 20 97 28 JSR &2897 ; calculate_screen_address_from_x_and_A &35f5 a0 00 LDY #&00 ; check_for_obstacle_loop &35f7 b1 0a LDA (&0a),Y ; screen_address # Top bit set if obstacle &35f9 30 08 BMI &3603 ; leave &35fb 98 TYA &35fc 69 08 ADC #&08 # Move right two pixels &35fe a8 TAY &35ff c0 30 CPY #&30 # Check twelve pixels in total &3601 90 f4 BCC &35f7 ; check_for_obstacle_loop ; leave &3603 60 RTS ; set_player_screen_addresses_for_replotting &3604 a2 00 LDX #&00 ; set_spell_screen_addresses_for_replotting &3606 b5 1f LDA &1f,X ; previous_player_screen_address_low # or previous_spell_screen_address_low if X = 2 &3608 85 02 STA &02 ; first_screen_address_low # Used for unplotting &360a b5 20 LDA &20,X ; previous_player_screen_address_high # or previous_spell_screen_address_high if X = 2 &360c 85 03 STA &03 ; first_screen_address_high &360e b5 23 LDA &23,X ; player_screen_address_low # or spell_screen_address_low if X =2 &3610 85 04 STA &04 ; second_screen_address_low # Used for plotting &3612 b5 24 LDA &24,X ; player_screen_address_high # or spell_screen_address_high if X =2 &3614 85 05 STA &05 ; second_screen_address_high &3616 60 RTS ; calculate_player_sprites &3617 a2 01 LDX #&01 ; calculate_player_sprites_loop &3619 b5 2a LDA &2a,X ; previous_player_facing # or player_facing if X =1 &361b 0a ASL A &361c 0a ASL A &361d 05 30 ORA &30 ; player_sprite_base &361f 95 8a STA &8a,X ; sprite_previous # or sprite if X = 1 &3621 ca DEX &3622 10 f5 BPL &3619 ; calculate_player_sprites_loop &3624 60 RTS ; directions_table &3625 01 04 02 08 06 0a 09 05 ; horizontal_speeds &362d 02 fe ; vertical_speeds &362f 04 fc ; diagonal_movement_table &3631 07 06 04 05 ; joystick_to_movement_table &3635 00 00 00 ff ff 02 02 02 ; replot_player &363d 20 04 36 JSR &3604 ; set_player_screen_addresses_for_replotting &3640 20 17 36 JSR &3617 ; calculate_player_sprites &3643 20 72 31 JSR &3172 ; set_previous_and_current_player_sprite_addresses &3646 a6 6a LDX &6a ; player_head_sprite_size_in_bytes &3648 20 ce 27 JSR &27ce ; replot_sprite ; calculate_player_feet_sprites &364b a2 01 LDX #&01 ; calculate_player_feet_sprites_loop &364d b4 2c LDY &2c,X ; previous_player_animation &364f b5 8a LDA &8a,X ; sprite_previous &3651 79 fc 02 ADC &02fc,Y ; animation_table &3654 69 01 ADC #&01 &3656 95 8a STA &8a,X ; sprite_previous &3658 ca DEX &3659 10 f2 BPL &364d ; calculate_player_feet_sprites_loop &365b e8 INX &365c 20 72 31 JSR &3172 ; set_previous_and_current_player_sprite_addresses &365f a5 2d LDA &2d ; player_animation &3661 85 2c STA &2c ; previous_player_animation &3663 a6 6b LDX &6b ; player_feet_sprite_size_in_bytes &3665 4c ce 27 JMP &27ce ; replot_sprite ; plot_partial_player &3668 a5 31 LDA &31 ; player_x &366a 85 08 STA &08 ; x &366c a9 80 LDA #&80 # Plot only once &366e 85 20 STA &20 ; previous_player_screen_address_high &3670 a5 32 LDA &32 ; player_y &3672 18 CLC &3673 69 19 ADC #&19 &3675 e5 6d SBC &6d ; player_height &3677 a4 6d LDY &6d ; player_height &3679 c0 0d CPY #&0d &367b 90 10 BCC &368d ; player_has_only_feet &367d 20 64 38 JSR &3864 ; set_player_screen_address_from_x_and_A &3680 a9 12 LDA #&12 &3682 85 6b STA &6b ; player_feet_sprite_size_in_bytes &3684 a5 6c LDA &6c ; player_sprite_size_in_bytes &3686 e9 11 SBC #&11 &3688 85 6a STA &6a ; player_head_sprite_size_in_bytes &368a 4c 3d 36 JMP &363d ; replot_player ; player_has_only_feet &368d a4 6c LDY &6c ; player_sprite_size_in_bytes &368f 84 6b STY &6b ; player_feet_sprite_size_in_bytes &3691 20 64 38 JSR &3864 ; set_player_screen_address_from_x_and_A &3694 20 17 36 JSR &3617 ; calculate_player_sprites &3697 20 04 36 JSR &3604 ; set_player_screen_addresses_for_replotting &369a 4c 4b 36 JMP &364b ; calculate_player_feet_sprites ; l1 l2 l3 c3 c2 c1 ; lives_x &369d 7a 86 92 18 18 18 ; lives_y &36a3 90 90 90 78 50 28 ; plot_life_with_character &36a9 c6 2e DEC &2e ; player_character ; plot_life &36ab bd a3 36 LDA &36a3,X ; lives_y &36ae 85 32 STA &32 ; player_y &36b0 bd 9d 36 LDA &369d,X ; lives_x &36b3 20 ca 36 JSR &36ca ; set_player_sprite &36b6 a9 24 LDA #&24 &36b8 85 6c STA &6c ; player_sprite_size_in_bytes &36ba a9 18 LDA #&18 &36bc 85 6d STA &6d ; player_height &36be 20 85 31 JSR &3185 ; prepare_first_palette_table_for_player &36c1 4c 68 36 JMP &3668 ; plot_partial_player ; set_player_sprite_in_middle_of_room &36c4 a9 58 LDA #&58 &36c6 85 32 STA &32 ; player_y &36c8 a9 36 LDA #&36 ; set_player_sprite &36ca 85 31 STA &31 ; player_x &36cc a9 00 LDA #&00 &36ce 85 2b STA &2b ; player_facing &36d0 85 2a STA &2a ; previous_player_facing &36d2 85 2d STA &2d ; player_animation &36d4 85 2c STA &2c ; previous_player_animation &36d6 a5 2e LDA &2e ; player_character &36d8 0a ASL A &36d9 0a ASL A &36da 0a ASL A &36db 0a ASL A &36dc 85 30 STA &30 ; player_sprite_base &36de 60 RTS ; set_player_growing &36df 20 c4 36 JSR &36c4 ; set_player_sprite_in_middle_of_room &36e2 a9 80 LDA #&80 # Set player growing &36e4 85 5e STA &5e ; player_state &36e6 a0 03 LDY #&03 &36e8 84 6c STY &6c ; player_sprite_size_in_bytes &36ea 88 DEY &36eb 84 6d STY &6d ; player_height &36ed 10 0c BPL &36fb ; grow_player_without_unplotting # Always branches ; to_game_over_screen &36ef 4c 19 35 JMP &3519 ; game_over_screen ; grow_player &36f2 20 68 36 JSR &3668 ; plot_partial_player # Unplot player &36f5 a5 6d LDA &6d ; player_height &36f7 c9 18 CMP #&18 &36f9 b0 17 BCS &3712 ; player_is_fully_grown ; grow_player_without_unplotting &36fb e6 6c INC &6c ; player_sprite_size_in_bytes &36fd e6 6c INC &6c ; player_sprite_size_in_bytes &36ff e6 6c INC &6c ; player_sprite_size_in_bytes &3701 e6 6d INC &6d ; player_height &3703 e6 6d INC &6d ; player_height &3705 20 68 36 JSR &3668 ; plot_partial_player # Plot player ; play_sound_for_shrinking_or_growing &3708 a5 6c LDA &6c ; player_sprite_size_in_bytes &370a 8d 58 26 STA &2658 ; sound_data + &29 # Set pitch of sound_27 &370d a9 27 LDA #&27 ; sound_27 &370f 4c 00 29 JMP &2900 ; play_sound # Play sound for player growing ; player_is_fully_grown &3712 a9 00 LDA #&00 # Mark player as ready for action again &3714 85 5e STA &5e ; player_state &3716 60 RTS ; shrink_player &3717 20 68 36 JSR &3668 ; plot_partial_player # Unplot player &371a c6 6c DEC &6c ; player_sprite_size_in_bytes &371c c6 6c DEC &6c ; player_sprite_size_in_bytes &371e c6 6c DEC &6c ; player_sprite_size_in_bytes &3720 c6 6d DEC &6d ; player_height &3722 c6 6d DEC &6d ; player_height &3724 f0 05 BEQ &372b ; player_has_shrunk_away &3726 20 68 36 JSR &3668 ; plot_partial_player # Plot player &3729 f0 dd BEQ &3708 ; play_sound_for_shrinking_or_growing # Always branches ; player_has_shrunk_away &372b c6 73 DEC &73 ; player_lives &372d 30 c0 BMI &36ef ; to_game_over_screen &372f a5 73 LDA &73 ; player_lives &3731 18 CLC &3732 69 12 ADC #&12 # Objects &12 - &14 used for tombstones &3734 aa TAX &3735 20 f6 31 JSR &31f6 ; put_object_in_room &3738 9d 8a 43 STA &438a,X ; objects_x &373b 98 TYA &373c 9d 5e 43 STA &435e,X ; objects_y &373f a9 ff LDA #&ff # Skip unplotting object &3741 20 bd 31 JSR &31bd ; plot_object &3744 a6 73 LDX &73 ; player_lives &3746 20 ab 36 JSR &36ab ; plot_life # Unplot life &3749 20 c4 36 JSR &36c4 ; set_player_sprite_in_middle_of_room ; reset_player_energy &374c a9 81 LDA #&81 # Mark player as about to start growing &374e 85 5e STA &5e ; player_state &3750 a9 57 LDA #&57 &3752 85 2f STA &2f ; player_animation_fraction &3754 85 59 STA &59 ; player_energy + 2 &3756 a9 7f LDA #&7f &3758 85 5a STA &5a ; previous_player_energy_msb &375a a9 01 LDA #&01 &375c 85 5b STA &5b ; refill_energy_after_dying ; leave &375e 60 RTS ; animate_player_shrinking_or_growing &375f c6 2f DEC &2f ; player_animation_fraction &3761 d0 fb BNE &375e ; leave &3763 a9 07 LDA #&07 &3765 85 2f STA &2f ; player_animation_fraction &3767 98 TYA ; player_state &3768 10 ad BPL &3717 ; shrink_player &376a 85 34 STA &34 ; player_direction &376c 29 7f AND #&7f &376e f0 82 BEQ &36f2 ; grow_player &3770 4c df 36 JMP &36df ; set_player_growing ; check_for_joystick_movement &3773 bd ba 02 LDA &02ba,X ; os_adc_high &3776 4a LSR A &3777 4a LSR A &3778 4a LSR A &3779 4a LSR A &377a 4a LSR A &377b a8 TAY &377c 8a TXA &377d 19 35 36 ORA &3635,Y ; joystick_to_movement_table &3780 95 28 STA &28,X ; player_horizontal_direction # or player_vertical direction if X = 1 &3782 ca DEX &3783 f0 ee BEQ &3773 ; check_for_joystick_movement &3785 d0 52 BNE &37d9 ; update_player_direction ; check_for_player_movement &3787 a5 23 LDA &23 ; player_screen_address_low &3789 85 1f STA &1f ; previous_player_screen_address_low &378b a5 24 LDA &24 ; player_screen_address_high &378d 85 20 STA &20 ; previous_player_screen_address_high &378f a5 2b LDA &2b ; player_facing &3791 85 2a STA &2a ; previous_player_facing &3793 c6 75 DEC &75 ; player_movement_cooldown &3795 d0 62 BNE &37f9 ; leave &3797 a9 03 LDA #&03 &3799 85 75 STA &75 ; player_movement_cooldown &379b a9 ff LDA #&ff &379d 85 28 STA &28 ; player_horizontal_direction &379f 85 29 STA &29 ; player_vertical_direction &37a1 85 34 STA &34 ; player_direction &37a3 a6 33 LDX &33 ; keyboard_or_joystick &37a5 d0 cc BNE &3773 ; check_for_joystick_movement &37a7 e8 INX ; check_for_horizontal_keys_loop &37a8 bd 20 3d LDA &3d20,X ; left_keys &37ab 20 dd 28 JSR &28dd ; check_for_keypress &37ae f0 04 BEQ &37b4 ; left_not_pressed &37b0 a9 02 LDA #&02 &37b2 10 0a BPL &37be ; set_horizontal_direction # Always branches ; left_not_pressed &37b4 bd 22 3d LDA &3d22,X ; right_keys &37b7 20 dd 28 JSR &28dd ; check_for_keypress &37ba f0 04 BEQ &37c0 ; right_not_pressed &37bc a9 00 LDA #&00 ; set_horizontal_direction &37be 85 28 STA &28 ; player_horizontal_direction ; right_not_pressed &37c0 ca DEX &37c1 10 e5 BPL &37a8 ; check_for_horizontal_keys_loop &37c3 a9 46 LDA #&46 ; K &37c5 20 dd 28 JSR &28dd ; check_for_keypress &37c8 f0 04 BEQ &37ce ; up_not_pressed &37ca a9 03 LDA #&03 &37cc d0 09 BNE &37d7 ; set_vertical_direction # Always branches ; up_not_pressed &37ce a9 65 LDA #&65 ; M &37d0 20 dd 28 JSR &28dd ; check_for_keypress &37d3 f0 04 BEQ &37d9 ; down_not_pressed &37d5 a9 01 LDA #&01 ; set_vertical_direction &37d7 85 29 STA &29 ; player_vertical_direction ; down_not_pressed ; update_player_direction &37d9 a5 28 LDA &28 ; player_horizontal_direction &37db 25 29 AND &29 ; player_vertical_direction &37dd 30 1a BMI &37f9 ; leave # Leave if player didn't move &37df a5 28 LDA &28 ; player_horizontal_direction &37e1 30 10 BMI &37f3 ; player_only_moving_vertically &37e3 85 2b STA &2b ; player_facing &37e5 a4 29 LDY &29 ; player_vertical_direction &37e7 30 0e BMI &37f7 ; set_player_direction &37e9 98 TYA &37ea 4a LSR A &37eb 05 28 ORA &28 ; player_horizontal_direction &37ed aa TAX &37ee bd 31 36 LDA &3631,X ; diagonal_movement_table &37f1 10 04 BPL &37f7 ; set_player_direction # Always branches ; player_only_moving_vertically &37f3 a5 29 LDA &29 ; player_vertical_direction &37f5 85 2b STA &2b ; player_facing ; set_player_direction &37f7 85 34 STA &34 ; player_direction ; leave &37f9 60 RTS ; animate_player &37fa c6 2f DEC &2f ; player_animation_fraction &37fc d0 fb BNE &37f9 ; leave &37fe a9 04 LDA #&04 &3800 85 2f STA &2f ; player_animation_fraction &3802 a5 34 LDA &34 ; player_direction &3804 30 f3 BMI &37f9 ; leave &3806 e6 2d INC &2d ; player_animation &3808 a5 2d LDA &2d ; player_animation &380a 29 03 AND #&03 &380c 85 2d STA &2d ; player_animation &380e 4a LSR A &380f 90 e8 BCC &37f9 ; leave &3811 ad 55 26 LDA &2655 ; sound_data + &26 &3814 49 7c EOR #&7c # Alternate pitch of walking sound &3816 8d 55 26 STA &2655 ; sound_data + &26 &3819 a9 24 LDA #&24 ; sound_24 &381b 4c 00 29 JMP &2900 ; play_sound # Play sound for player walking ; move_player &381e 20 e1 35 JSR &35e1 ; check_for_obstacles &3821 30 d6 BMI &37f9 ; leave # Player can't move if trapped in a door &3823 a6 34 LDX &34 ; player_direction &3825 bd 25 36 LDA &3625,X ; directions_table &3828 4a LSR A &3829 4a LSR A &382a 85 29 STA &29 ; player_vertical_direction &382c bd 25 36 LDA &3625,X ; directions_table &382f 29 03 AND #&03 &3831 f0 14 BEQ &3847 ; player_not_moving_horizontally # Does the movement have a horizontal component? &3833 a8 TAY &3834 a5 31 LDA &31 ; player_x &3836 85 28 STA &28 ; previous_player_x &3838 18 CLC &3839 79 2c 36 ADC &362c,Y ; horizontal_speeds - 1 # Apply horizontal component of movement &383c 85 31 STA &31 ; player_x &383e 20 e1 35 JSR &35e1 ; check_for_obstacles &3841 10 04 BPL &3847 ; skip_reset_x &3843 a5 28 LDA &28 ; previous_player_x # Reset previous position if there is an obstacle &3845 85 31 STA &31 ; player_x ; skip_reset_x ; player_not_moving_horizontally &3847 a4 29 LDY &29 ; player_vertical_direction &3849 f0 13 BEQ &385e ; player_not_moving_vertically # Does the movement have a vertical component? &384b a5 32 LDA &32 ; player_y &384d 85 28 STA &28 ; previous_player_y &384f 18 CLC &3850 79 2e 36 ADC &362e,Y ; vertical_speeds - 1 # Apply vertical component of movement &3853 85 32 STA &32 ; player_y &3855 20 e3 35 JSR &35e3 ; check_for_obstacles_with_A &3858 10 04 BPL &385e ; skip_reset_y &385a a5 28 LDA &28 ; previous_player_y # Reset previous position if there is an obstacle &385c 85 32 STA &32 ; player_y ; skip_reset_y ; player_not_moving_vertically &385e a5 31 LDA &31 ; player_x &3860 85 08 STA &08 ; x ; set_player_screen_address_from_position &3862 a5 32 LDA &32 ; player_y ; set_player_screen_address_from_x_and_A &3864 a2 00 LDX #&00 ; set_spell_screen_address_from_x_and_A &3866 20 97 28 JSR &2897 ; calculate_screen_address_from_x_and_A &3869 95 24 STA &24,X ; player_screen_address_high # or spell_screen_address_high if X = 2 &386b a5 0a LDA &0a ; screen_address_low &386d 29 fe AND #&fe &386f 95 23 STA &23,X ; player_screen_address_low # or spell_screen_address_low if X = 2 ; leave &3871 60 RTS ; update_player &3872 a5 32 LDA &32 ; player_y &3874 c9 56 CMP #&56 &3876 a6 71 LDX &71 ; vsync # Wait for v-sync if player in bottom half of screen &3878 b0 02 BCS &387c ; use_vsync &387a a6 f8 LDX &f8 ; via_event # Or timer event if player in top half of screen ; use_vsync &387c f0 f3 BEQ &3871 ; leave &387e ca DEX &387f 86 f8 STX &f8 ; via_event &3881 86 71 STX &71 ; vsync &3883 c6 6f DEC &6f ; door_change_cooldown &3885 10 28 BPL &38af ; skip_temporary_doors # Every 64 frames, consider temporary doors &3887 a9 3f LDA #&3f &3889 85 6f STA &6f ; door_change_cooldown &388b a6 6e LDX &6e ; number_of_doors_in_room ; update_temporary_doors_loop &388d bd a0 26 LDA &26a0,X ; room_doors_closed_cooldown &3890 f0 09 BEQ &389b ; door_is_open &3892 de a0 26 DEC &26a0,X ; room_doors_closed_cooldown &3895 d0 15 BNE &38ac ; consider_next_door &3897 a9 00 LDA #&00 # Open door &3899 f0 0e BEQ &38a9 ; set_door_state ; door_is_open &389b 20 75 28 JSR &2875 ; rnd1 &389e 29 1f AND #&1f # 1 in 32 chance of door closing &38a0 d0 0a BNE &38ac ; consider_next_door &38a2 a9 07 LDA #&07 # Door stays closed for 448 frames &38a4 9d a0 26 STA &26a0,X ; room_doors_closed_cooldown &38a7 a9 01 LDA #&01 # Close door ; set_door_state &38a9 9d f4 42 STA &42f4,X ; room_doors_temporarily_closed ; consider_next_door &38ac ca DEX &38ad 10 de BPL &388d ; update_temporary_doors_loop ; skip_temporary_doors &38af 20 85 31 JSR &3185 ; prepare_first_palette_table_for_player &38b2 a4 5e LDY &5e ; player_state &38b4 f0 06 BEQ &38bc ; player_still_active # Is the player alive? &38b6 20 5f 37 JSR &375f ; animate_player_shrinking_or_growing # If not, animate shrinking or growing &38b9 4c f2 39 JMP &39f2 ; update_spell ; player_still_active &38bc 20 3d 36 JSR &363d ; replot_player &38bf 20 f2 39 JSR &39f2 ; update_spell &38c2 20 87 37 JSR &3787 ; check_for_player_movement &38c5 20 27 3b JSR &3b27 ; check_for_enemy_collisions &38c8 a9 1e LDA #&1e # Drain &051e energy per frame &38ca a2 05 LDX #&05 &38cc 20 be 3b JSR &3bbe ; drain_energy &38cf a5 34 LDA &34 ; player_direction &38d1 30 03 BMI &38d6 ; skip_move # Is the player moving? &38d3 20 1e 38 JSR &381e ; move_player # If so, move the player ; skip_move &38d6 20 fa 37 JSR &37fa ; animate_player &38d9 20 08 32 JSR &3208 ; check_for_picking_up_object &38dc a6 31 LDX &31 ; player_x &38de a4 32 LDY &32 ; player_y &38e0 a9 00 LDA #&00 # Has the player gone through a door? &38e2 c4 40 CPY &40 ; room_min_y_including_door &38e4 90 1e BCC &3904 ; player_leaving_room_vertically &38e6 c4 41 CPY &41 ; room_max_y_including_door &38e8 b0 1a BCS &3904 ; player_leaving_room_vertically &38ea e4 43 CPX &43 ; room_min_x_including_door &38ec 90 04 BCC &38f2 ; player_leaving_room_horizontally &38ee e4 42 CPX &42 ; room_max_x_including_door &38f0 90 2f BCC &3921 ; to_update_player 1 # Update player if not outside boundaries ; player_leaving_room_horizontally &38f2 2a ROL A # Calculate door location from player's position &38f3 2a ROL A &38f4 49 02 EOR #&02 # 0 for right door, 2 for left door &38f6 c0 4c CPY #&4c &38f8 b0 02 BCS &38fc ; not_upper_door &38fa 69 04 ADC #&04 # Add 4 if upper of left or right doors &38fc c0 74 CPY #&74 ; not_upper_door &38fe 90 15 BCC &3915 ; set_door_location &3900 69 07 ADC #&07 # Add 8 if lower of left or right doors &3902 10 11 BPL &3915 ; set_door_location ; player_leaving_room_vertically &3904 2a ROL A &3905 38 SEC &3906 2a ROL A &3907 49 02 EOR #&02 # 1 for bottom door, 3 for top door &3909 e0 2c CPX #&2c &390b b0 02 BCS &390f ; not_left_door &390d 69 08 ADC #&08 # Add 8 if left of top or bottom doors ; not_left_door &390f e0 42 CPX #&42 &3911 90 02 BCC &3915 ; set_door_location &3913 69 03 ADC #&03 # Add 4 if right of top or bottom doors ; set_door_location &3915 85 52 STA &52 ; door_location # Final value of door_location: &3917 a9 00 LDA #&00 # b 3 7 &3919 85 64 STA &64 ; player_started_or_fell_into_room # 6 4 &391b a2 ff LDX #&ff # 2 0 &391d 9a TXS # a 8 &391e 4c b1 35 JMP &35b1 ; enter_door # 9 1 5 ; to_update_player &3921 4c 72 38 JMP &3872 ; update_player ; store_state_of_doors &3924 a4 6e LDY &6e ; number_of_doors_in_room ; store_state_of_doors_loop &3926 be fa 42 LDX &42fa,Y ; room_doors_offset &3929 b9 cd 43 LDA &43cd,Y ; room_doors_colour &392c 0a ASL A &392d 0a ASL A &392e 19 a6 26 ORA &26a6,Y ; room_doors_door_or_passage &3931 0a ASL A &3932 19 f4 42 ORA &42f4,Y ; room_doors_temporarily_closed &3935 0a ASL A &3936 0a ASL A &3937 0a ASL A &3938 19 a0 26 ORA &26a0,Y ; room_doors_closed_cooldown &393b 9d ca 21 STA &21ca,X ; doors_flags &393e 88 DEY &393f 10 e5 BPL &3926 ; store_state_of_doors_loop &3941 60 RTS ; get_door_exit_room &3942 a4 6e LDY &6e ; number_of_doors_in_room &3944 a5 52 LDA &52 ; door_location ; find_door_loop &3946 d9 c1 43 CMP &43c1,Y ; room_doors_location &3949 f0 03 BEQ &394e ; found_door &394b 88 DEY &394c 10 f8 BPL &3946 ; find_door_loop ; found_door &394e be fa 42 LDX &42fa,Y ; room_doors_offset &3951 bd 2e 20 LDA &202e,X ; door_rooms_entrance_table &3954 c5 1e CMP &1e ; player_room &3956 d0 03 BNE &395b ; player_entered_exit &3958 bd fc 20 LDA &20fc,X ; door_rooms_exit_table ; player_entered_exit &395b 85 1e STA &1e ; player_room &395d 86 66 STX &66 ; offset_of_door_player_entered_by &395f 60 RTS ; x_offsets_from_doors_for_player &3960 fe 06 0a 06 ; y_offsets_from_doors_for_player &3964 08 f8 08 f8 ; initialise_player_position_on_entering_room &3968 a5 5e LDA &5e ; player_state # Is the player alive? &396a 05 64 ORA &64 ; player_started_or_fell_into_room # Did the player enter the room by a door? &396c d0 44 BNE &39b2 ; leave # If not, leave &396e a9 1e LDA #&1e ; sound_1e &3970 20 00 29 JSR &2900 ; play_sound # Play sound for player entering a room &3973 a9 21 LDA #&21 ; sound_21 &3975 20 00 29 JSR &2900 ; play_sound &3978 a4 6e LDY &6e ; number_of_doors_in_room &397a a5 66 LDA &66 ; offset_of_door_player_entered_by ; find_door_player_entered_by_loop &397c d9 fa 42 CMP &42fa,Y ; room_doors_offset &397f f0 03 BEQ &3984 ; found_door &3981 88 DEY &3982 10 f8 BPL &397c ; find_door_player_entered_by_loop ; found_door &3984 b9 c1 43 LDA &43c1,Y ; room_doors_location &3987 85 52 STA &52 ; door_location &3989 29 03 AND #&03 &398b 49 02 EOR #&02 &398d 85 2b STA &2b ; player_facing # Set player direction based on door used &398f 85 34 STA &34 ; player_direction &3991 20 91 2d JSR &2d91 ; get_door_positions_for_room_type &3994 aa TAX &3995 b9 94 23 LDA &2394,Y ; door_screen_positions_x &3998 18 CLC &3999 7d 60 39 ADC &3960,X ; x_offsets_from_doors_for_player &399c 85 31 STA &31 ; player_x &399e 85 08 STA &08 ; x &39a0 b9 bb 23 LDA &23bb,Y ; door_screen_positions_y &39a3 18 CLC &39a4 7d 64 39 ADC &3964,X ; y_offsets_from_doors_for_player &39a7 29 fc AND #&fc &39a9 85 32 STA &32 ; player_y ; set_player_screen_address_from_position_and_disable_unplot &39ab 20 62 38 JSR &3862 ; set_player_screen_address_from_position &39ae a9 80 LDA #&80 &39b0 85 20 STA &20 ; previous_player_screen_address_high ; leave &39b2 60 RTS ; play_sound_for_spell_bounce &39b3 ad 5b 26 LDA &265b ; sound_data + &2c &39b6 49 02 EOR #&02 &39b8 8d 5b 26 STA &265b ; sound_data + &2c &39bb a9 2a LDA #&2a ; sound_2a &39bd 4c 00 29 JMP &2900 ; play_sound ; compare_against_room_min_and_max_x &39c0 c5 3f CMP &3f ; room_min_x &39c2 90 0e BCC &39d2 ; leave_with_carry_set &39c4 e9 01 SBC #&01 &39c6 c5 3e CMP &3e ; room_max_x &39c8 60 RTS ; compare_against_room_min_and_max_y &39c9 c5 3c CMP &3c ; room_min_y &39cb 90 05 BCC &39d2 ; leave_with_carry_set &39cd e9 09 SBC #&09 &39cf c5 3d CMP &3d ; room_max_y &39d1 60 RTS ; leave_with_carry_set &39d2 38 SEC &39d3 60 RTS ; invert_spell_velocity &39d4 a9 00 LDA #&00 &39d6 38 SEC &39d7 f5 37 SBC &37,X ; spell_x_velocity # or spell_y_velocity if X = 1 &39d9 95 37 STA &37,X ; spell_x_velocity # or spell_y_velocity ifX = 1 &39db 60 RTS ; spell_x_velocities_table &39dc 03 00 fd 00 fd fd 03 03 ; spell_y_velocities_table &39e4 00 06 00 fa 06 fa fa 06 ; spell_sprite_table &39ec 08 0c 00 ; spell_animations_table &39ef 03 02 07 ; update_spell &39f2 a5 3b LDA &3b ; spell_ttl &39f4 30 30 BMI &3a26 ; no_spell # Is there already a spell? &39f6 a5 2e LDA &2e ; player_character &39f8 09 40 ORA #&40 # Use palettes &40 - &42 for spells &39fa 20 8a 31 JSR &318a ; prepare_and_duplicate_palette_table &39fd a6 2e LDX &2e ; player_character &39ff bd ec 39 LDA &39ec,X ; spell_sprite_table &3a02 48 PHA &3a03 18 CLC &3a04 65 35 ADC &35 ; previous_spell_animation &3a06 20 ea 2b JSR &2bea ; calculate_spell_sprite_address &3a09 8e d8 27 STX &27d8 ; sprite_address_low &3a0c 8c d9 27 STY &27d9 ; sprite_address_high &3a0f 68 PLA &3a10 65 36 ADC &36 ; spell_animation &3a12 20 ea 2b JSR &2bea ; calculate_spell_sprite_address &3a15 20 82 31 JSR &3182 ; to_set_sprite_addresses &3a18 a2 02 LDX #&02 &3a1a 20 06 36 JSR &3606 ; set_spell_screen_addresses_for_replotting &3a1d a2 18 LDX #&18 &3a1f 20 ce 27 JSR &27ce ; replot_sprite # Replot spell &3a22 c6 3b DEC &3b ; spell_ttl &3a24 10 46 BPL &3a6c ; update_spell_position_and_animation ; no_spell &3a26 a5 33 LDA &33 ; keyboard_or_joystick &3a28 d0 06 BNE &3a30 ; check_for_joystick_firing &3a2a 20 dd 28 JSR &28dd ; check_for_keypress &3a2d d0 06 BNE &3a35 ; fire_spell ; leave &3a2f 60 RTS ; check_for_joystick_firing &3a30 20 f5 28 JSR &28f5 ; check_for_joystick_button &3a33 d0 fa BNE &3a2f ; leave ; fire_spell &3a35 a5 5e LDA &5e ; player_state # Leave if player isn't alive &3a37 d0 f6 BNE &3a2f ; leave &3a39 a9 80 LDA #&80 # Skip unplotting spell &3a3b 85 26 STA &26 ; spell_screen_address_high &3a3d a5 31 LDA &31 ; player_x &3a3f 85 39 STA &39 ; spell_x &3a41 20 c0 39 JSR &39c0 ; compare_against_room_min_and_max_x &3a44 b0 e9 BCS &3a2f ; leave # Don't allow player to fire spell in doorways &3a46 a5 32 LDA &32 ; player_y &3a48 85 3a STA &3a ; spell_y &3a4a 20 c9 39 JSR &39c9 ; compare_against_room_min_and_max_y &3a4d b0 e0 BCS &3a2f ; leave # Don't allow player to fire spell in doorways &3a4f 20 e1 35 JSR &35e1 ; check_for_obstacles &3a52 30 db BMI &3a2f ; leave # Don't allow player to fire spell in obstacles &3a54 a9 28 LDA #&28 &3a56 85 3b STA &3b ; spell_ttl &3a58 a6 34 LDX &34 ; player_direction &3a5a 10 02 BPL &3a5e ; use_player_direction &3a5c a6 2b LDX &2b ; player_facing ; use_player_direction &3a5e bd dc 39 LDA &39dc,X ; spell_x_velocities_table &3a61 85 37 STA &37 ; spell_x_velocity &3a63 bd e4 39 LDA &39e4,X ; spell_y_velocities_table &3a66 85 38 STA &38 ; spell_y_velocity &3a68 a9 00 LDA #&00 &3a6a 85 36 STA &36 ; spell_animation ; update_spell_position_and_animation &3a6c a5 36 LDA &36 ; spell_animation &3a6e 85 35 STA &35 ; previous_spell_animation &3a70 a5 3b LDA &3b ; spell_ttl &3a72 d0 04 BNE &3a78 ; spell_still_alive &3a74 a9 ff LDA #&ff # Skip replotting spell at end of life ; spell_still_alive &3a76 85 3a STA &3a ; spell_y &3a78 a5 26 LDA &26 ; spell_screen_address_high &3a7a 85 22 STA &22 ; previous_spell_screen_address_high &3a7c a5 25 LDA &25 ; spell_screen_address_low &3a7e 85 21 STA &21 ; previous_spell_screen_address_low &3a80 a5 3b LDA &3b ; spell_ttl &3a82 f0 40 BEQ &3ac4 ; set_spell_screen_address # Is the spell still active? &3a84 29 03 AND #&03 &3a86 d0 0b BNE &3a93 ; skip_animation # Animate every four frames &3a88 a6 2e LDX &2e ; player_character &3a8a c6 36 DEC &36 ; spell_animation &3a8c 10 05 BPL &3a93 ; skip_animation &3a8e bd ef 39 LDA &39ef,X ; spell_animations_table &3a91 85 36 STA &36 ; spell_animation ; skip_animation &3a93 a5 39 LDA &39 ; spell_x &3a95 a8 TAY &3a96 18 CLC &3a97 65 37 ADC &37 ; spell_x_velocity &3a99 85 39 STA &39 ; spell_x &3a9b 20 c0 39 JSR &39c0 ; compare_against_room_min_and_max_x &3a9e 90 0b BCC &3aab ; skip_x_inversion # Has the spell hit the left or right wall? &3aa0 a2 00 LDX #&00 ; spell_x_velocity &3aa2 20 d4 39 JSR &39d4 ; invert_spell_velocity # If so, invert its horizontal direction &3aa5 84 39 STY &39 ; spell_x &3aa7 20 b3 39 JSR &39b3 ; play_sound_for_spell_bounce # Play sound for the spell bouncing off the wall &3aaa 98 TYA ; skip_x_inversion &3aab 85 08 STA &08 ; x &3aad a5 3a LDA &3a ; spell_y &3aaf a8 TAY &3ab0 18 CLC &3ab1 65 38 ADC &38 ; spell_y_velocity &3ab3 85 3a STA &3a ; spell_y &3ab5 20 c9 39 JSR &39c9 ; compare_against_room_min_and_max_y &3ab8 90 0a BCC &3ac4 ; skip_y_inversion # Has the spell hit the top or bottom wall? &3aba a2 01 LDX #&01 ; spell_y_velocity &3abc 20 d4 39 JSR &39d4 ; invert_spell_velocity # If so, invert its vertical direction &3abf 84 3a STY &3a ; spell_y &3ac1 20 b3 39 JSR &39b3 ; play_sound_for_spell_bounce # Play sound for the spell bouncing off the wall ; skip_y_inversion ; set_spell_screen_address &3ac4 a2 02 LDX #&02 &3ac6 a5 3a LDA &3a ; spell_y &3ac8 4c 66 38 JMP &3866 ; set_spell_screen_address_from_x_and_A ; pixel_values ; L R LR &3acb 00 0a 05 0f ; plot_column_of_character &3acf 20 dc 3a JSR &3adc ; use_lowest_two_bits &3ad2 20 d8 3a JSR &3ad8 ; use_next_lowest_two_bits &3ad5 20 d8 3a JSR &3ad8 ; use_next_lowest_two_bits ; use_next_lowest_two_bits &3ad8 a5 00 LDA &00 ; font_byte &3ada 4a LSR A &3adb 4a LSR A ; use_lowest_two_bits &3adc 85 00 STA &00 ; font_byte &3ade 29 03 AND #&03 &3ae0 aa TAX &3ae1 bd cb 3a LDA &3acb,X ; pixel_values &3ae4 91 0a STA (&0a),Y ; screen_address &3ae6 c8 INY &3ae7 60 RTS ; plot_digit_from_top_nibble &3ae8 4a LSR A &3ae9 4a LSR A &3aea 4a LSR A &3aeb 4a LSR A ; plot_digit &3aec 29 0f AND #&0f ; plot_character &3aee 0a ASL A &3aef 0a ASL A &3af0 aa TAX &3af1 a9 03 LDA #&03 &3af3 85 06 STA &06 ; columns_to_plot &3af5 86 01 STX &01 ; font_offset ; plot_character_loop &3af7 a6 01 LDX &01 ; font_offset &3af9 bd 80 03 LDA &0380,X ; font_data &3afc 20 cf 3a JSR &3acf ; plot_column_of_character &3aff e6 01 INC &01 ; font_offset &3b01 c6 06 DEC &06 ; columns_to_plot &3b03 10 f2 BPL &3af7 ; plot_character_loop &3b05 98 TYA &3b06 18 CLC &3b07 69 08 ADC #&08 &3b09 a8 TAY ; leave &3b0a 60 RTS ; plot_time &3b0b a0 59 LDY #&59 ; &5997 &3b0d 84 0b STY &0b ; screen_address_high &3b0f a9 97 LDA #&97 &3b11 85 0a STA &0a ; screen_address_low &3b13 a5 7b LDA &7b ; game_time + 3 &3b15 20 ec 3a JSR &3aec ; plot_digit &3b18 a5 7a LDA &7a ; game_time + 2 &3b1a 20 aa 3b JSR &3baa ; plot_two_digit_number &3b1d a9 0a LDA #&0a ; ":" &3b1f 20 ee 3a JSR &3aee ; plot_character &3b22 a5 79 LDA &79 ; game_time + 1 &3b24 4c aa 3b JMP &3baa ; plot_two_digit_number ; check_for_enemy_collisions &3b27 a2 03 LDX #&03 ; check_for_enemy_collisions_loop &3b29 ca DEX &3b2a 30 de BMI &3b0a ; leave &3b2c bd fa 43 LDA &43fa,X ; enemies_room &3b2f c5 1e CMP &1e ; player_room # Is there an enemy in this slot? &3b31 d0 f6 BNE &3b29 ; check_for_enemy_collisions_loop &3b33 bd b3 42 LDA &42b3,X ; enemies_materialisation # If so, is it materialising? &3b36 d0 f1 BNE &3b29 ; check_for_enemy_collisions_loop &3b38 bd b9 42 LDA &42b9,X ; enemies_position # If not, does it overlap with the spell? &3b3b 85 08 STA &08 ; x &3b3d bd bf 42 LDA &42bf,X ; enemies_position + 6 &3b40 85 09 STA &09 ; y &3b42 a5 39 LDA &39 ; spell_x &3b44 20 3b 31 JSR &313b ; check_for_overlap_in_x &3b47 b0 23 BCS &3b6c ; check_for_enemy_collision_with_player &3b49 c5 39 CMP &39 ; spell_x &3b4b 90 1f BCC &3b6c ; check_for_enemy_collision_with_player &3b4d a5 3a LDA &3a ; spell_y &3b4f 18 CLC &3b50 69 24 ADC #&24 &3b52 85 07 STA &07 ; end_y &3b54 a5 09 LDA &09 ; y &3b56 69 18 ADC #&18 &3b58 c5 07 CMP &07 ; en_y &3b5a b0 10 BCS &3b6c ; check_for_enemy_collision_with_player &3b5c c5 3a CMP &3a ; spell_y &3b5e 90 0c BCC &3b6c ; check_for_enemy_collision_with_player &3b60 a5 3b LDA &3b ; spell_ttl &3b62 f0 17 BEQ &3b7b ; dematerialise_enemy &3b64 30 06 BMI &3b6c ; check_for_enemy_collision_with_player &3b66 a9 01 LDA #&01 # Remove the spell on next frame &3b68 85 3b STA &3b ; spell_ttl &3b6a b0 0f BCS &3b7b ; dematerialise_enemy # Dematerialise enemy ; check_for_enemy_collision_with_player &3b6c 20 49 31 JSR &3149 ; check_for_overlap_with_player &3b6f 90 b8 BCC &3b29 ; check_for_enemy_collisions_loop # Is the enemy touching the player? &3b71 a9 06 LDA #&06 # Drain &60000 energy for touching enemy &3b73 20 c9 3b JSR &3bc9 ; drain_energy_two &3b76 a9 15 LDA #&15 ; sound_15 &3b78 20 c4 30 JSR &30c4 ; play_sounds_for_energy_change # Play sounds for player touching enemy ; dematerialise_enemy &3b7b a9 a2 LDA #&a2 # Set enemy as dematerialising &3b7d 9d b3 42 STA &42b3,X ; enemies_materialisation &3b80 a0 01 LDY #&01 # Score 155 for killing enemy ; increase_score &3b82 a5 7c LDA &7c ; score &3b84 f8 SED &3b85 18 CLC &3b86 69 55 ADC #&55 &3b88 85 7c STA &7c ; score &3b8a 98 TYA &3b8b 65 7d ADC &7d ; score + 1 &3b8d 85 7d STA &7d ; score + 1 &3b8f a5 7e LDA &7e ; score + 2 &3b91 69 00 ADC #&00 &3b93 d8 CLD &3b94 85 7e STA &7e ; score + 2 ; plot_score &3b96 a0 5e LDY #&5e ; &5e92 = screen address of score &3b98 84 0b STY &0b ; screen_address_high &3b9a a9 92 LDA #&92 &3b9c 85 0a STA &0a ; screen_address_low &3b9e a5 7e LDA &7e ; score + 2 &3ba0 20 aa 3b JSR &3baa ; plot_two_digit_number &3ba3 a5 7d LDA &7d ; score + 1 &3ba5 20 aa 3b JSR &3baa ; plot_two_digit_number &3ba8 a5 7c LDA &7c ; score ; plot_two_digit_number &3baa 48 PHA &3bab 20 e8 3a JSR &3ae8 ; plot_digit_from_top_nibble &3bae 68 PLA &3baf 4c ec 3a JMP &3aec ; plot_digit ; plot_nibble_of_turkey &3bb2 aa TAX &3bb3 bd 00 43 LDA &4300,X ; palette_table_for_odd_rows # or LDA &4310,X ; palette_table_for_even_rows &3bb6 91 0a STA (&0a),Y ; screen_address &3bb8 98 TYA &3bb9 38 SEC &3bba e9 08 SBC #&08 # Move left two pixels &3bbc a8 TAY &3bbd 60 RTS ; drain_energy &3bbe 65 57 ADC &57 ; player_energy &3bc0 85 57 STA &57 ; player_energy &3bc2 8a TXA ; drain_energy_one &3bc3 65 58 ADC &58 ; player_energy + 1 &3bc5 85 58 STA &58 ; player_energy + 1 &3bc7 a9 00 LDA #&00 ; drain_energy_two &3bc9 65 59 ADC &59 ; player_energy + 2 &3bcb 85 59 STA &59 ; player_energy + 2 &3bcd 60 RTS ; energy_completely_refilled &3bce a9 01 LDA #&01 # Stop refilling &3bd0 85 5b STA &5b ; refill_energy_after_dying &3bd2 a9 57 LDA #&57 &3bd4 85 59 STA &59 ; player_energy + 2 &3bd6 85 5a STA &5a ; previous_player_energy_msb ; leave &3bd8 60 RTS ; set_player_as_dead &3bd9 e6 5e INC &5e ; player_state # Mark player as shrinking &3bdb 20 85 31 JSR &3185 ; prepare_first_palette_table_for_player &3bde 4c 3d 36 JMP &363d ; replot_player ; update_player_and_turkey &3be1 20 72 38 JSR &3872 ; update_player &3be4 a5 5e LDA &5e ; player_state &3be6 f0 02 BEQ &3bea ; player_is_alive &3be8 10 ee BPL &3bd8 ; leave # Leave if player is shrinking ; player_is_alive # Update turkey if player is alive or growing &3bea a5 59 LDA &59 ; player_energy + 2 &3bec c5 5a CMP &5a ; previous_player_energy_msb # Does the turkey need updating? &3bee f0 e8 BEQ &3bd8 ; leave # If not, leave &3bf0 08 PHP &3bf1 68 PLA &3bf2 29 01 AND #&01 # Lowest bit set if carry set &3bf4 90 0e BCC &3c04 ; gained_a_row &3bf6 c5 5b CMP &5b ; refill_energy_after_dying &3bf8 d0 04 BNE &3bfe ; lost_a_row &3bfa e6 5a INC &5a ; previous_player_energy_msb # Another red row &3bfc 30 db BMI &3bd9 ; set_player_as_dead # Branch at bottom of turkey ; lost_a_row &3bfe 85 5b STA &5b ; refill_energy_after_dying &3c00 a9 48 LDA #&48 # Use palette &48 for red turkey &3c02 d0 10 BNE &3c14 ; set_colour_for_turkey # Always branches ; gained_a_row &3c04 c5 5b CMP &5b ; refill_energy_after_dying &3c06 d0 02 BNE &3c0a ; skip_refill &3c08 c6 5a DEC &5a ; previous_player_energy_msb # Another yellow row ; skip_refill &3c0a 85 5b STA &5b ; refill_energy_after_dying &3c0c a5 5a LDA &5a ; previous_player_energy_msb &3c0e c9 58 CMP #&58 # Is the turkey full? If so, stop refilling &3c10 90 bc BCC &3bce ; energy_completely_refilled &3c12 a9 43 LDA #&43 # Use palette &43 for yellow turkey ; set_colour_for_turkey &3c14 20 a7 2b JSR &2ba7 ; prepare_first_palette_table &3c17 a5 5a LDA &5a ; previous_player_energy_msb &3c19 85 09 STA &09 ; y &3c1b 29 01 AND #&01 &3c1d 0a ASL A &3c1e 0a ASL A &3c1f 0a ASL A &3c20 0a ASL A &3c21 8d b4 3b STA &3bb4 ; turkey_palette_table_to_use # Use odd or even palette table depending on y &3c24 a9 78 LDA #&78 &3c26 85 08 STA &08 ; x &3c28 20 99 28 JSR &2899 ; calculate_screen_address_from_x_and_y &3c2b a5 5a LDA &5a ; previous_player_energy_msb &3c2d e9 55 SBC #&55 &3c2f 4a LSR A # Chicken sprite data is 9 bytes per double row &3c30 85 07 STA &07 ; tmp &3c32 0a ASL A &3c33 0a ASL A &3c34 0a ASL A &3c35 65 07 ADC &07 ; tmp &3c37 85 06 STA &06 ; sprite_offset &3c39 a0 90 LDY #&90 # Chicken is &12 screen bytes or 36 pixels wide ; plot_row_of_turkey_loop &3c3b c6 06 DEC &06 ; sprite_offset &3c3d a6 06 LDX &06 ; sprite_offset &3c3f bd 4c 1d LDA &1d4c,X ; turkey_sprite &3c42 85 00 STA &00 ; sprite_data_byte &3c44 29 0f AND #&0f &3c46 20 b2 3b JSR &3bb2 ; plot_nibble_of_turkey &3c49 a5 00 LDA &00 ; sprite_data_byte &3c4b 4a LSR A &3c4c 4a LSR A &3c4d 4a LSR A &3c4e 4a LSR A &3c4f 20 b2 3b JSR &3bb2 ; plot_nibble_of_turkey &3c52 d0 e7 BNE &3c3b ; plot_row_of_turkey_loop &3c54 4c 72 38 JMP &3872 ; update_player ; clear_screen &3c57 a2 9c LDX #&9c # Clear screen, restore default logical colours &3c59 a9 a3 LDA #&a3 # i.e. colours 8 - 15 become same as 0 - 7 &3c5b d0 0a BNE &3c67 ; write_string ; clear_screen_without_resetting_window &3c5d a9 a3 LDA #&a3 # Clear screen, restore default logical colours &3c5f a2 a1 LDX #&a1 # i.e. colours 8 - 15 become same as 0 - 7 &3c61 d0 04 BNE &3c67 ; write_string ; colour_8_clear_screen &3c63 a2 a3 LDX #&a3 # Clear screen, restore default logical colours &3c65 a9 a7 LDA #&a7 # i.e. colours 8 - 15 become same as 0 - 7 ; write_string # Called with X = start offset, A = end offset, &3c67 85 07 STA &07 ; offset_last ; write_string_loop &3c69 bd 00 01 LDA &0100,X ; strings &3c6c 20 ee ff JSR &ffee ; OSWRCH &3c6f e8 INX &3c70 e4 07 CPX &07 ; offset_last &3c72 90 f5 BCC &3c69 ; write_string_loop &3c74 60 RTS ; tune_data ; c1 c2 c3 &3c75 35 3d 3d &3c78 59 49 49 &3c7b 51 49 45 &3c7e 35 35 51 &3c81 45 45 49 &3c84 45 35 29 &3c87 29 35 45 &3c8a 45 49 45 &3c8d 35 3d 3d &3c90 59 3d 3d &3c93 49 3d 3d &3c96 6d 3d 3d &3c99 80 ; plot_paintings_for_start_room &3c9a a9 05 LDA #&05 &3c9c 85 28 STA &28 ; painting ; plot_paintings_for_start_room_loop &3c9e a4 28 LDY &28 ; painting &3ca0 b9 14 3d LDA &3d14,Y ; start_room_paintings_location_table &3ca3 85 52 STA &52 ; door_location # Set location of painting &3ca5 b9 1a 3d LDA &3d1a,Y ; start_room_paintings_sprite_table &3ca8 20 f0 3c JSR &3cf0 ; plot_painting &3cab c6 28 DEC &28 ; painting &3cad 10 ef BPL &3c9e ; plot_paintings_for_start_room_loop ; leave &3caf 60 RTS ; plot_paintings &3cb0 a5 1e LDA &1e ; player_room &3cb2 f0 e6 BEQ &3c9a ; plot_paintings_for_start_room &3cb4 a4 1a LDY &1a ; room_type &3cb6 c0 04 CPY #&04 # Caverns, stairs and the exit do not have paintings &3cb8 b0 f5 BCS &3caf ; leave &3cba a2 03 LDX #&03 ; wipe_doors_on_wall_counts &3cbc a9 00 LDA #&00 &3cbe 9d 00 43 STA &4300,X ; doors_on_wall_counts # Temporarily use start of palette_table &3cc1 ca DEX &3cc2 10 fa BPL &3cbe ; wipe_doors_on_wall_counts &3cc4 a4 6e LDY &6e ; number_of_doors_in_room ; count_doors_on_walls_loop &3cc6 b9 c1 43 LDA &43c1,Y ; room_doors_location &3cc9 29 03 AND #&03 &3ccb aa TAX &3ccc fe 00 43 INC &4300,X ; palette_table_for_odd_rows # to count the number of doors on each wall &3ccf 88 DEY &3cd0 10 f4 BPL &3cc6 ; count_doors_on_walls_loop &3cd2 a0 08 LDY #&08 &3cd4 a5 1e LDA &1e ; player_room &3cd6 85 02 STA &02 ; room_plus_wall ; find_wall_without_a_door_loop &3cd8 88 DEY &3cd9 30 d4 BMI &3caf ; leave &3cdb e6 02 INC &02 ; room_plus_wall &3cdd a5 02 LDA &02 ; room_plus_wall &3cdf 29 03 AND #&03 &3ce1 aa TAX &3ce2 bd 00 43 LDA &4300,X ; doors_on_wall_counts &3ce5 d0 f1 BNE &3cd8 ; find_wall_without_a_door_loop &3ce7 86 52 STX &52 ; door_location # Set the location of the painting &3ce9 8a TXA &3cea 4a LSR A &3ceb a5 1e LDA &1e ; player_room # Use the room number to determine which painting &3ced 29 03 AND #&03 &3cef 2a ROL A # plus a bit for whether the wall is vertical or not ; plot_painting &3cf0 aa TAX &3cf1 09 d0 ORA #&d0 &3cf3 bc 0c 3d LDY &3d0c,X ; paintings_colours_table &3cf6 84 53 STY &53 ; door_colour &3cf8 20 de 2b JSR &2bde ; calculate_other_sprite_address &3cfb 8e 02 26 STX &2602 ; background_sprites_address_low_table + &15 &3cfe 8c 18 26 STY &2618 ; background_sprites_address_high_table + &15 &3d01 a9 15 LDA #&15 ; PAINTING &3d03 85 50 STA &50 ; background_sprite &3d05 a9 08 LDA #&08 &3d07 85 51 STA &51 ; door_sprite_base_divided_by_two &3d09 4c c1 2d JMP &2dc1 ; plot_door ; paintings_colours_table &3d0c f0 f1 db de ee f0 f1 d5 ; start_room_paintings_location_table &3d14 05 09 0b 07 06 0a ; start_room_paintings_sprite_table &3d1a 01 03 05 07 00 02 ; left_keys &3d20 61 40 ; Z, CAPSLOCK ; right_keys &3d22 42 01 ; X, CTRL ; apply_velocity_to_enemy_position &3d24 bd b6 42 LDA &42b6,X ; enemies_position_fraction &3d27 18 CLC &3d28 7d c5 42 ADC &42c5,X ; enemies_velocity_fraction &3d2b 9d b6 42 STA &42b6,X ; enemies_position_fraction &3d2e bd b9 42 LDA &42b9,X ; enemies_position &3d31 7d c8 42 ADC &42c8,X ; enemies_velocity &3d34 9d b9 42 STA &42b9,X ; enemies_position &3d37 60 RTS ; invert_enemy_velocity &3d38 bd c5 42 LDA &42c5,X ; enemies_velocity_fraction &3d3b 49 ff EOR #&ff &3d3d 9d c5 42 STA &42c5,X ; enemies_velocity_fraction &3d40 bd c8 42 LDA &42c8,X ; enemies_velocity &3d43 49 ff EOR #&ff &3d45 9d c8 42 STA &42c8,X ; enemies_velocity &3d48 60 RTS ; accelerate_enemy &3d49 bd c5 42 LDA &42c5,X ; enemies_velocity_fraction &3d4c 18 CLC &3d4d 7d d1 42 ADC &42d1,X ; enemies_acceleration_fraction &3d50 9d c5 42 STA &42c5,X ; enemies_velocity_fraction &3d53 bd c8 42 LDA &42c8,X ; enemies_velocity &3d56 7d d4 42 ADC &42d4,X ; enemies_acceleration &3d59 9d c8 42 STA &42c8,X ; enemies_velocity &3d5c 60 RTS ; decelerate_enemy &3d5d bd c5 42 LDA &42c5,X ; enemies_velocity_fraction &3d60 38 SEC &3d61 fd d1 42 SBC &42d1,X ; enemies_acceleration_fraction &3d64 9d c5 42 STA &42c5,X ; enemies_velocity_fraction &3d67 bd c8 42 LDA &42c8,X ; enemies_velocity &3d6a fd d4 42 SBC &42d4,X ; enemies_acceleration &3d6d 9d c8 42 STA &42c8,X ; enemies_velocity &3d70 60 RTS ; give_enemy_random_velocity_fraction &3d71 20 86 28 JSR &2886 ; rnd2 &3d74 9d c5 42 STA &42c5,X ; enemies_velocity_fraction &3d77 20 86 28 JSR &2886 ; rnd2 &3d7a 9d cb 42 STA &42cb,X ; enemies_velocity_fraction + 6 &3d7d 60 RTS ; set_enemy_horizontal_velocity_and_give_enemy_random_vertical_velocity &3d7e 9d c8 42 STA &42c8,X ; enemies_velocity &3d81 20 86 28 JSR &2886 ; rnd2 &3d84 29 07 AND #&07 &3d86 a8 TAY &3d87 b9 c0 00 LDA &00c0,Y ; enemy_y_random_velocities &3d8a 9d ce 42 STA &42ce,X ; enemies_velocity + 6 &3d8d 60 RTS ; acceleration_fractions_table &3d8e c0 c0 40 40 ; enemy type 8 &3d92 80 80 80 80 ; enemy type 9 &3d96 a8 a8 58 58 ; enemy type a ; accelerations_table &3d9a ff ff 00 00 ; enemy type 8 &3d9e ff ff 00 00 ; enemy type 9 &3da2 ff ff 00 00 ; enemy type a # Enemy Types # =========== # 0 ENEMY_HAT # 1 ENEMY_PHANTOM # 2 ENEMY_WITCH # 3 ENEMY_BAT # 4 ENEMY_APPLE # 5 ENEMY_GHOST_ONE # 6 ENEMY_GHOST_TWO # 7 ENEMY_TENTACLES # 8 ENEMY_GHOST_THREE # 9 ENEMY_RADISH # a ENEMY_PUMPKIN ; move_enemy &3da6 a9 00 LDA #&00 &3da8 85 46 STA &46 ; enemy_hit_wall &3daa bd dd 42 LDA &42dd,X ; enemies_type &3dad 85 47 STA &47 ; enemy_type &3daf 20 24 3d JSR &3d24 ; apply_velocity_to_enemy_position &3db2 c5 3f CMP &3f ; room_min_x &3db4 90 04 BCC &3dba ; enemy_hit_left_or_right_wall &3db6 c5 3e CMP &3e ; room_max_x &3db8 90 08 BCC &3dc2 ; enemy_didn't_hit_left_or_right_wall ; enemy_hit_left_or_right_wall &3dba e6 46 INC &46 ; enemy_hit_wall &3dbc 20 38 3d JSR &3d38 ; invert_enemy_velocity &3dbf 20 24 3d JSR &3d24 ; apply_velocity_to_enemy_position ; enemy_didn't_hit_left_or_right_wall &3dc2 a6 45 LDX &45 ; enemy_to_consider_plus_six &3dc4 20 24 3d JSR &3d24 ; apply_velocity_to_enemy_position &3dc7 c5 3c CMP &3c ; room_min_y &3dc9 90 04 BCC &3dcf ; enemy_hit_top_or_bottom_wall &3dcb c5 3d CMP &3d ; room_max_y &3dcd 90 08 BCC &3dd7 ; enemy_didn't_hit_top_or_bottom_wall ; enemy_hit_top_or_bottom_wall &3dcf e6 46 INC &46 ; enemy_hit_wall &3dd1 20 38 3d JSR &3d38 ; invert_enemy_velocity &3dd4 20 24 3d JSR &3d24 ; apply_velocity_to_enemy_position ; enemy_didn't_hit_top_or_bottom_wall &3dd7 a6 44 LDX &44 ; enemy_to_consider &3dd9 a5 47 LDA &47 ; enemy_type &3ddb c9 06 CMP #&06 &3ddd b0 03 BCS &3de2 ; enemy_is_type_6_to_a &3ddf 4c a4 3e JMP &3ea4 ; enemy_is_type_0_to_5 ; enemy_is_type_six_to_a &3de2 20 49 3d JSR &3d49 ; accelerate_enemy # Changes and returns enemies_velocity_x &3de5 c9 fe CMP #&fe &3de7 b0 07 BCS &3df0 ; skip_x_deceleration &3de9 c9 02 CMP #&02 &3deb 90 03 BCC &3df0 ; skip_x_deceleration &3ded 20 5d 3d JSR &3d5d ; decelerate_enemy # Limit acceleration to &fe - &01 ; skip_x_deceleration &3df0 a6 45 LDX &45 ; enemy_to_consider_plus_six &3df2 20 49 3d JSR &3d49 ; accelerate_enemy # Changes and returns enemies_velocity_y &3df5 c9 fc CMP #&fc &3df7 b0 07 BCS &3e00 ; skip_y_deceleration &3df9 c9 04 CMP #&04 &3dfb 90 03 BCC &3e00 ; skip_y_deceleration &3dfd 20 5d 3d JSR &3d5d ; decelerate_enemy # Limit y acceleration to &fc - &03 ; skip_y_deceleration &3e00 a6 44 LDX &44 ; enemy_to_consider &3e02 a5 47 LDA &47 ; enemy_type &3e04 c9 08 CMP #&08 &3e06 90 60 BCC &3e68 ; enemy_is_type_6_or_7 ; enemy_is_type_8_to_a # ENEMY_GHOST_THREE, ENEMY_RADISH, ENEMY_PUMPKIN &3e08 a5 46 LDA &46 ; enemy_hit_wall # Meanders in erratic loops &3e0a d0 05 BNE &3e11 ; change_after_bounce &3e0c de e0 42 DEC &42e0,X ; enemies_change_cooldown &3e0f d0 56 BNE &3e67 ; leave ; change_after_bounce &3e11 20 75 28 JSR &2875 ; rnd1 &3e14 c9 f8 CMP #&f8 # 1 in 32 chance of changing loop direction &3e16 90 08 BCC &3e20 ; skip_inverting_direction # between clockwise and anti-clockwise &3e18 bd e6 42 LDA &42e6,X ; enemies_loop_direction &3e1b 49 02 EOR #&02 &3e1d 9d e6 42 STA &42e6,X ; enemies_loop_direction ; skip_inverting_direction &3e20 bd e3 42 LDA &42e3,X ; enemies_loop_stage &3e23 18 CLC &3e24 7d e6 42 ADC &42e6,X ; enemies_loop_direction &3e27 29 03 AND #&03 &3e29 9d e3 42 STA &42e3,X ; enemies_loop_stage &3e2c a5 47 LDA &47 ; enemy_type &3e2e 29 03 AND #&03 &3e30 0a ASL A &3e31 0a ASL A &3e32 85 46 STA &46 ; type_times_four &3e34 7d e3 42 ADC &42e3,X ; enemies_loop_stage &3e37 a8 TAY &3e38 b9 8e 3d LDA &3d8e,Y ; acceleration_fractions_table &3e3b 9d d1 42 STA &42d1,X ; enemies_acceleration_fraction &3e3e b9 9a 3d LDA &3d9a,Y ; accelerations_table &3e41 9d d4 42 STA &42d4,X ; enemies_acceleration &3e44 bd e3 42 LDA &42e3,X ; enemies_loop_stage &3e47 69 01 ADC #&01 &3e49 29 03 AND #&03 &3e4b 65 46 ADC &46 ; type_times_four &3e4d a8 TAY &3e4e b9 8e 3d LDA &3d8e,Y ; acceleration_fractions_table &3e51 0a ASL A &3e52 9d d7 42 STA &42d7,X ; enemies_acceleration_fraction + 6 &3e55 b9 9a 3d LDA &3d9a,Y ; accelerations_table &3e58 2a ROL A &3e59 9d da 42 STA &42da,X ; enemies_acceleration + 6 &3e5c 20 86 28 JSR &2886 ; rnd2 &3e5f 29 07 AND #&07 &3e61 18 CLC &3e62 69 04 ADC #&04 &3e64 9d e0 42 STA &42e0,X ; enemies_change_cooldown ; leave &3e67 60 RTS ; enemy_is_type_6_or_7 # ENEMY_GHOST_TWO, ENEMY_TENTACLES &3e68 de e0 42 DEC &42e0,X ; enemies_change_cooldown # Meanders randomly &3e6b d0 fa BNE &3e67 ; leave &3e6d 20 86 28 JSR &2886 ; rnd2 &3e70 9d cb 42 STA &42cb,X ; enemies_velocity_fraction + 6 # Set random y velocity fraction &3e73 20 86 28 JSR &2886 ; rnd2 &3e76 29 0f AND #&0f &3e78 9d e0 42 STA &42e0,X ; enemies_change_cooldown # Set random time for next change of direction &3e7b 20 86 28 JSR &2886 ; rnd2 &3e7e 29 03 AND #&03 &3e80 a8 TAY &3e81 b9 c0 00 LDA &00c0,Y ; enemy_y_random_velocities &3e84 9d ce 42 STA &42ce,X ; enemies_velocity + 6 # Set random y velocity from enemy_y_random_velocities &3e87 20 86 28 JSR &2886 ; rnd2 &3e8a 29 03 AND #&03 &3e8c a8 TAY &3e8d 20 86 28 JSR &2886 ; rnd2 &3e90 9d c5 42 STA &42c5,X ; enemies_velocity_fraction # Set random x velocity fraction &3e93 b9 ea 02 LDA &02ea,Y ; enemy_x_random_velocities &3e96 9d c8 42 STA &42c8,X ; enemies_velocity # Set random x velocity &3e99 a9 30 LDA #&30 &3e9b 9d d7 42 STA &42d7,X ; enemies_acceleration_fraction + 6 &3e9e a9 00 LDA #&00 &3ea0 9d da 42 STA &42da,X ; enemies_acceleration + 6 &3ea3 60 RTS ; enemy_is_type_0_to_5 &3ea4 c9 05 CMP #&05 &3ea6 f0 38 BEQ &3ee0 ; enemy_is_type_5 &3ea8 de e0 42 DEC &42e0,X ; enemies_change_cooldown &3eab 10 19 BPL &3ec6 ; leave &3ead 20 71 3d JSR &3d71 ; give_enemy_random_velocity_fraction # Set random x and y velocity fractions &3eb0 a5 47 LDA &47 ; enemy_type &3eb2 c9 03 CMP #&03 &3eb4 b0 44 BCS &3efa ; enemy_is_type_3_or_4 ; enemy_is_type_0_to_2 # ENEMY_HAT, ENEMY_PHANTOM, ENEMY_WITCH &3eb6 20 c7 3e JSR &3ec7 ; give_enemy_random_velocity_from_tables # Moves randomly from side to side &3eb9 a4 47 LDY &47 ; enemy_type &3ebb 20 86 28 JSR &2886 ; rnd2 &3ebe 39 f8 02 AND &02f8,Y ; enemy_random_change_cooldowns # &1f for types 0 and 1, &0f for type 2 &3ec1 69 10 ADC #&10 &3ec3 9d e0 42 STA &42e0,X ; enemies_change_cooldown ; leave &3ec6 60 RTS ; give_enemy_random_velocity_from_tables &3ec7 20 86 28 JSR &2886 ; rnd2 &3eca 29 03 AND #&03 &3ecc a8 TAY &3ecd b9 c8 00 LDA &00c8,Y ; enemy_random_velocities &3ed0 9d ce 42 STA &42ce,X ; enemies_velocity + 6 # Set enemy y velocity &3ed3 20 75 28 JSR &2875 ; rnd1 &3ed6 29 01 AND #&01 &3ed8 a8 TAY &3ed9 b9 f6 02 LDA &02f6,Y ; enemy_random_directions &3edc 9d c8 42 STA &42c8,X ; enemies_velocity # Set enemy x velocity &3edf 60 RTS ; enemy_is_type_5 # ENEMY_GHOST_ONE &3ee0 a5 46 LDA &46 ; enemy_hit_wall # Bounces off walls, then changes direction &3ee2 f0 e2 BEQ &3ec6 ; leave # Continue moving until enemy hits a wall &3ee4 20 75 28 JSR &2875 ; rnd1 &3ee7 c9 e0 CMP #&e0 # 1 in 8 chance &3ee9 90 db BCC &3ec6 ; leave &3eeb 20 71 3d JSR &3d71 ; give_enemy_random_velocity_fraction # Set random x and y velocity fractions &3eee 20 86 28 JSR &2886 ; rnd2 &3ef1 29 03 AND #&03 &3ef3 a8 TAY &3ef4 b9 ea 02 LDA &02ea,Y ; enemy_x_random_velocities &3ef7 4c 7e 3d JMP &3d7e ; set_enemy_horizontal_velocity_and_give_enemy_random_vertical_velocity ; enemy_is_type_3_or_4 # ENEMY_BAT, ENEMY_APPLE # Bounces off walls, sometimes changes direction &3efa 20 71 3d JSR &3d71 ; give_enemy_random_velocity_fraction # Set random x and y velocity fractions &3efd 20 86 28 JSR &2886 ; rnd2 &3f00 29 07 AND #&07 &3f02 a8 TAY &3f03 b9 c8 00 LDA &00c8,Y ; enemy_random_velocities &3f06 20 7e 3d JSR &3d7e ; set_enemy_horizontal_velocity_and_give_enemy_random_vertical_velocity &3f09 a4 47 LDY &47 ; enemy_type &3f0b 20 86 28 JSR &2886 ; rnd2 &3f0e 39 f6 02 AND &02f6,Y ; enemy_random_change_cooldowns - 2 # &02f9 (&1f) for type 3, &02fa (&0f) for type 4 &3f11 69 06 ADC #&06 &3f13 9d e0 42 STA &42e0,X ; enemies_change_cooldown &3f16 60 RTS ; update_enemies &3f17 a2 08 LDX #&08 &3f19 86 45 STX &45 ; enemy_to_consider_plus_six &3f1b a2 02 LDX #&02 &3f1d 86 44 STX &44 ; enemy_to_consider ; update_enemies_loop &3f1f 20 2e 3f JSR &3f2e ; update_enemy &3f22 c6 45 DEC &45 ; enemy_to_consider_plus_six &3f24 c6 44 DEC &44 ; enemy_to_consider &3f26 20 72 38 JSR &3872 ; update_player &3f29 a6 44 LDX &44 ; enemy_to_consider &3f2b 10 f2 BPL &3f1f ; update_enemies_loop &3f2d 60 RTS ; update_enemy &3f2e bd fa 43 LDA &43fa,X ; enemies_room &3f31 c5 1e CMP &1e ; player_room &3f33 f0 0a BEQ &3f3f ; enemy_exists &3f35 a5 5e LDA &5e ; player_state &3f37 d0 05 BNE &3f3e ; leave # Leave if player isn't alive &3f39 de e0 42 DEC &42e0,X ; enemies_change_cooldown &3f3c f0 0c BEQ &3f4a ; to_new_enemy &3f3e 60 RTS ; enemy_exists &3f3f bd b3 42 LDA &42b3,X ; enemies_materialisation &3f42 f0 37 BEQ &3f7b ; replot_enemy &3f44 10 07 BPL &3f4d ; materialise_enemy &3f46 29 7f AND #&7f &3f48 d0 11 BNE &3f5b ; dematerialise_enemy ; to_new_enemy &3f4a 4c 0b 40 JMP &400b ; new_enemy ; materialise_enemy &3f4d a9 35 LDA #&35 ; MATERIALISATION &3f4f 20 cd 3f JSR &3fcd ; update_enemy_materialisation &3f52 d0 14 BNE &3f68 ; prepare_and_plot_enemy_sprite # Returns A = enemy_materialisation &3f54 a9 09 LDA #&09 ; sound_09 &3f56 20 00 29 JSR &2900 ; play_sound # Play sound for materialising enemy &3f59 d0 0d BNE &3f68 ; prepare_and_plot_enemy_sprite # Always branches ; dematerialise_enemy &3f5b a9 36 LDA #&36 ; DEMATERIALISATION &3f5d 20 cd 3f JSR &3fcd ; update_enemy_materialisation # Returns A = enemy_materialisation &3f60 29 7f AND #&7f &3f62 d0 04 BNE &3f68 ; prepare_and_plot_enemy_sprite &3f64 a9 44 LDA #&44 ; KKK # Use completely black sprite at end of materialisation &3f66 85 89 STA &89 ; enemy_colour ; prepare_and_plot_enemy_sprite &3f68 a0 00 LDY #&00 &3f6a 20 99 31 JSR &3199 ; prepare_sprite_addresses_and_palette_table_for_enemy &3f6d 4c cc 27 JMP &27cc ; replot_double_height_sprite ; set_enemy_previous_sprite_and_colour &3f70 bd f4 43 LDA &43f4,X ; enemies_sprite_previous &3f73 85 8a STA &8a ; sprite_previous &3f75 bd f7 43 LDA &43f7,X ; enemies_colour &3f78 85 88 STA &88 ; enemy_previous_colour &3f7a 60 RTS ; replot_enemy &3f7b a5 5e LDA &5e ; player_state &3f7d f0 06 BEQ &3f85 ; player_is_alive &3f7f a9 a2 LDA #&a2 # Dematerialise all enemies when player dies &3f81 9d b3 42 STA &42b3,X ; enemies_materialisation &3f84 60 RTS ; player_is_alive &3f85 20 a6 3d JSR &3da6 ; move_enemy &3f88 20 72 38 JSR &3872 ; update_player &3f8b a6 44 LDX &44 ; enemy_to_consider &3f8d 20 70 3f JSR &3f70 ; set_enemy_previous_sprite_and_colour &3f90 a5 47 LDA &47 ; enemy_type &3f92 c9 03 CMP #&03 &3f94 b0 07 BCS &3f9d ; use_first_sprites # Does the enemy have left and right sprites? &3f96 bc c8 42 LDY &42c8,X ; enemies_velocity &3f99 10 02 BPL &3f9d ; use_first_sprites # If so, is the enemy moving left? &3f9b 69 0b ADC #&0b ; (ENEMY_HAT_LEFT - ENEMY_HAT_RIGHT) / 2 # If so, yse left set of sprites ; use_first_sprites &3f9d 85 46 STA &46 ; sprite_direction &3f9f bd f1 43 LDA &43f1,X ; enemies_animation_fraction &3fa2 18 CLC &3fa3 69 01 ADC #&01 &3fa5 29 0f AND #&0f &3fa7 9d f1 43 STA &43f1,X ; enemies_animation_fraction &3faa c9 0f CMP #&0f &3fac bd fd 43 LDA &43fd,X ; enemies_animation &3faf 90 06 BCC &3fb7 ; skip_animation &3fb1 49 01 EOR #&01 &3fb3 9d fd 43 STA &43fd,X ; enemies_animation &3fb6 18 CLC ; skip_animation &3fb7 65 46 ADC &46 ; sprite_direction &3fb9 65 46 ADC &46 ; sprite_direction &3fbb 85 8b STA &8b ; sprite &3fbd 9d f4 43 STA &43f4,X ; enemies_sprite_previous &3fc0 a5 47 LDA &47 ; enemy_type &3fc2 9d f7 43 STA &43f7,X ; enemies_colour &3fc5 85 89 STA &89 ; enemy_colour &3fc7 20 ea 3f JSR &3fea ; set_enemy_screen_addresses_and_position &3fca 4c 68 3f JMP &3f68 ; prepare_and_plot_enemy_sprite ; update_enemy_materialisation &3fcd 85 46 STA &46 ; materialisation_sprite &3fcf 20 70 3f JSR &3f70 ; set_enemy_previous_sprite_and_colour &3fd2 de b3 42 DEC &42b3,X ; enemies_materialisation &3fd5 bd b3 42 LDA &42b3,X ; enemies_materialisation &3fd8 4a LSR A &3fd9 29 03 AND #&03 &3fdb 18 CLC &3fdc 69 23 ADC #&23 # Use palettes &23 - &26 for materialisation &3fde 85 89 STA &89 ; enemy_colour &3fe0 9d f7 43 STA &43f7,X ; enemies_colour &3fe3 a5 46 LDA &46 ; materialisation_sprite &3fe5 9d f4 43 STA &43f4,X ; enemies_sprite_previous &3fe8 85 8b STA &8b ; sprite ; set_enemy_screen_addresses_and_position &3fea bd e9 42 LDA &42e9,X ; enemies_screen_address_low &3fed 85 02 STA &02 ; previous_screen_address_low &3fef bd ec 42 LDA &42ec,X ; enemies_screen_address_high &3ff2 85 03 STA &03 ; previous_screen_address_high &3ff4 bd b9 42 LDA &42b9,X ; enemies_position &3ff7 85 08 STA &08 ; x &3ff9 bd bf 42 LDA &42bf,X ; enemies_position + 6 &3ffc 20 d1 28 JSR &28d1 ; calculate_second_screen_address &3fff 9d e9 42 STA &42e9,X ; enemies_screen_address_low &4002 a5 05 LDA &05 ; screen_address_high &4004 9d ec 42 STA &42ec,X ; enemies_screen_address_high &4007 bd b3 42 LDA &42b3,X ; enemies_materialisation ; leave &400a 60 RTS ; new_enemy &400b a5 5e LDA &5e ; player_state &400d d0 fb BNE &400a ; leave # Leave if player isn't alive ; wipe_enemy_position_velocity_and_acceleration &400f a9 00 LDA #&00 &4011 a4 44 LDY &44 ; enemy_to_consider ; wipe_enemy_position_velocity_and_acceleration_loop &4013 99 c5 42 STA &42c5,Y ; enemies_velocity_fraction &4016 c8 INY &4017 c8 INY &4018 c8 INY &4019 c0 18 CPY #&18 &401b 90 f6 BCC &4013 ; wipe_enemy_position_velocity_and_acceleration_loop &401d 9d fd 43 STA &43fd,X ; enemies_animation &4020 a9 03 LDA #&03 &4022 9d e0 42 STA &42e0,X ; enemies_change_cooldown &4025 a9 80 LDA #&80 # Skip unplotting enemy &4027 9d ec 42 STA &42ec,X ; enemies_screen_address_high &402a a9 44 LDA #&44 # Use all black palette &44 &402c 9d f7 43 STA &43f7,X ; enemies_colour &402f 20 75 28 JSR &2875 ; rnd1 &4032 29 3f AND #&3f &4034 38 SEC ; reduce_to_0_to_a_loop &4035 e9 0b SBC #&0b &4037 10 fc BPL &4035 ; reduce_to_0_to_a_loop &4039 69 0b ADC #&0b &403b 9d dd 42 STA &42dd,X ; enemies_type # Set random enemy type between 0 and &a &403e c9 08 CMP #&08 &4040 90 12 BCC &4054 ; enemy_is_type_0_to_7 &4042 20 86 28 JSR &2886 ; rnd2 &4045 29 03 AND #&03 &4047 9d e3 42 STA &42e3,X ; enemies_loop_stage &404a 20 86 28 JSR &2886 ; rnd2 &404d 29 02 AND #&02 # Choose randomly between clockwise and anti-clockwise &404f 49 01 EOR #&01 &4051 9d e6 42 STA &42e6,X ; enemies_loop_direction ; enemy_is_type_0_to_7 &4054 20 71 3d JSR &3d71 ; give_enemy_random_velocity_fraction # Set random x and y velocity fractions &4057 20 c7 3e JSR &3ec7 ; give_enemy_random_velocity_from_tables # Set random x and y velocities &405a a5 1e LDA &1e ; player_room &405c 9d fa 43 STA &43fa,X ; enemies_room # Put enemy in same room as player &405f a9 20 LDA #&20 &4061 9d c2 42 STA &42c2,X ; enemies_unused # Unused variable &4064 9d b3 42 STA &42b3,X ; enemies_materialisation # Set enemy materialising ; set_enemy_x_position_loop &4067 20 86 28 JSR &2886 ; rnd2 &406a c5 3f CMP &3f ; room_min_x &406c 90 f9 BCC &4067 ; set_enemy_x_position_loop &406e c5 3e CMP &3e ; room_max_x &4070 b0 f5 BCS &4067 ; set_enemy_x_position_loop &4072 9d b9 42 STA &42b9,X ; enemies_position # Set random x position ; set_enemy_y_position_loop &4075 20 75 28 JSR &2875 ; rnd1 &4078 c5 3c CMP &3c ; room_min_y &407a 90 f9 BCC &4075 ; set_enemy_y_position_loop &407c c5 3d CMP &3d ; room_max_y &407e b0 f5 BCS &4075 ; set_enemy_y_position_loop &4080 9d bf 42 STA &42bf,X ; enemies_position + 6 # Set random y position &4083 60 RTS # Nasties # ======= # 0 DRACULA # 1 DEVIL # 2 FRANKENSTEIN # 3 MUMMY # 4 HUNCHBACK ; initialise_nasties &4084 a2 04 LDX #&04 ; set_nasties_screen_address_high_loop &4086 a9 80 LDA #&80 # Skip unplotting nasty &4088 9d e2 43 STA &43e2,X ; nasties_screen_address_high &408b ca DEX &408c 10 fa BPL &4088 ; set_nasties_screen_address_high_loop &408e a2 03 LDX #&03 &4090 ad 81 43 LDA &4381 ; objects_rooms + &d ; LEAF &4093 c5 8f CMP &8f ; nasties_room + 3 ; MUMMY &4095 f0 15 BEQ &40ac ; skip_randomising_nasty_position # If the leaf is in the same room as the mummy, &4097 ad 6c 43 LDA &436c ; objects_y + &e ; KEY_RED # or the red key hasn't been moved, don't randomise &409a c9 3e CMP #&3e # the position of the mummy &409c f0 0e BEQ &40ac ; skip_randomising_nasty_position ; randomise_nasties_position_loop &409e 20 75 28 JSR &2875 ; rnd1 # Set random positions for all nasties except HUNCHBACK &40a1 20 55 2f JSR &2f55 ; convert_position_byte_into_coordinates &40a4 9d d8 43 STA &43d8,X ; nasties_y &40a7 a5 08 LDA &08 ; x &40a9 9d d3 43 STA &43d3,X ; nasties_x ; skip_randomising_nasty_position &40ac ca DEX &40ad 10 ef BPL &409e ; randomise_nasties_position_loop &40af 20 86 28 JSR &2886 ; rnd2 &40b2 a8 TAY &40b3 20 75 28 JSR &2875 ; rnd1 &40b6 c9 e0 CMP #&e0 &40b8 90 08 BCC &40c2 ; leave # 7 in 8 chance to keep DRACULA in same room, then &40ba c9 fc CMP #&fc &40bc 90 02 BCC &40c0 ; set_dracula_room # 63 in 64 chance to put DRACULA in random room, &40be a4 1e LDY &1e ; player_room # 1 in 64 chance to put DRACULA in player's room ; set_dracula_room &40c0 84 8c STY &8c ; nasties_room ; DRACULA &40c2 60 RTS ; update_nasties &40c3 a5 91 LDA &91 ; nasties_cooldown &40c5 d0 5e BNE &4125 ; leave &40c7 a9 04 LDA #&04 &40c9 85 91 STA &91 ; nasties_cooldown &40cb 85 60 STA &60 ; nasty_to_consider ; update_nasties_loop &40cd a6 60 LDX &60 ; nasty_to_consider &40cf b5 8c LDA &8c,X ; nasties_room &40d1 c5 1e CMP &1e ; player_room # Is the nasty in the same room as the player? &40d3 d0 44 BNE &4119 ; consider_next_nasty &40d5 b5 7f LDA &7f,X ; nasties_state &40d7 30 40 BMI &4119 ; consider_next_nasty # Top bit set if nasty has been destroyed &40d9 20 36 41 JSR &4136 ; update_nasty_position &40dc 20 26 42 JSR &4226 ; move_nasty &40df a5 5e LDA &5e ; player_state &40e1 d0 36 BNE &4119 ; consider_next_nasty # Is the player alive? &40e3 a6 60 LDX &60 ; nasty_to_consider &40e5 20 1d 41 JSR &411d ; get_nasties_position &40e8 20 47 31 JSR &3147 ; check_for_overlap_with_player_with_y &40eb 90 2c BCC &4119 ; consider_next_nasty # If so, is the nasty touching the player? &40ed e0 02 CPX #&02 ; FRANKENSTEIN &40ef d0 16 BNE &4107 ; nasty_hurts_player &40f1 a9 0b LDA #&0b ; SPANNER &40f3 20 67 31 JSR &3167 ; check_for_object_in_pockets &40f6 30 0f BMI &4107 ; nasty_hurts_player # The SPANNER kills FRANKENSTEIN &40f8 a9 ff LDA #&ff # Skip plotting FRANKENSTEIN &40fa 8d da 43 STA &43da ; nasties_y + 2 &40fd 85 81 STA &81 ; nasties_state + 2 ; FRANKENSTEIN # Set FRANKENSTEIN as being destroyed &40ff 20 64 41 JSR &4164 ; replot_nasty &4102 a0 11 LDY #&11 # Score 1155 for killing FRANKENSTEIN &4104 20 82 3b JSR &3b82 ; increase_score ; nasty_hurts_player &4107 bd 76 42 LDA &4276,X ; nasties_enemy_drain_low &410a 65 58 ADC &58 ; player_energy + 1 &410c 85 58 STA &58 ; player_energy + 1 &410e bd 7b 42 LDA &427b,X ; nasties_enemy_drain_high &4111 20 c9 3b JSR &3bc9 ; drain_energy_two # Drain energy depending on type of nasty &4114 a9 18 LDA #&18 ; sound_18 &4116 20 c4 30 JSR &30c4 ; play_sounds_for_energy_change # Play sounds for touching nasty ; consider_next_nasty &4119 c6 60 DEC &60 ; nasty_to_consider &411b 10 b0 BPL &40cd ; update_nasties_loop ; get_nasties_position &411d bd d3 43 LDA &43d3,X ; nasties_x &4120 85 08 STA &08 ; x &4122 bd d8 43 LDA &43d8,X ; nasties_y ; leave &4125 60 RTS ; calculate_nasty_sprite &4126 bd ec 43 LDA &43ec,X ; nasties_animation &4129 29 03 AND #&03 &412b a8 TAY &412c 8a TXA &412d 0a ASL A &412e 65 60 ADC &60 ; nasty_to_consider &4130 79 fc 02 ADC &02fc,Y ; animation_table &4133 69 39 ADC #&39 ; DRACULA &4135 60 RTS ; update_nasty_position &4136 bd e7 43 LDA &43e7,X ; nasties_velocity_x &4139 18 CLC &413a 7d d3 43 ADC &43d3,X ; nasties_x &413d c5 3f CMP &3f ; room_min_x # Limit nasty to room &413f b0 02 BCS &4143 ; skip_minimum_x &4141 a5 3f LDA &3f ; room_min_x ; skip_minimum_x &4143 c5 3e CMP &3e ; room_max_x &4145 90 02 BCC &4149 ; skip_maximum_x &4147 a5 3e LDA &3e ; room_max_x ; skip_maximum_x &4149 9d d3 43 STA &43d3,X ; nasties_x &414c bd ef 42 LDA &42ef,X ; nasties_velocity_y &414f 18 CLC &4150 7d d8 43 ADC &43d8,X ; nasties_y &4153 c5 3c CMP &3c ; room_min_y &4155 b0 02 BCS &4159 ; skip_minimum_y &4157 a5 3c LDA &3c ; room_min_y ; skip_minimum_y &4159 c5 3d CMP &3d ; room_max_y &415b 90 02 BCC &415f ; skip_maximum_y &415d a5 3d LDA &3d ; room_max_y ; skip_maximum_y &415f 29 fe AND #&fe &4161 9d d8 43 STA &43d8,X ; nasties_y ; replot_nasty &4164 bd dd 43 LDA &43dd,X ; nasties_screen_address_low &4167 85 02 STA &02 ; first_screen_address_low &4169 bd e2 43 LDA &43e2,X ; nasties_screen_address_high &416c 85 03 STA &03 ; first_screen_address_high &416e 20 1d 41 JSR &411d ; get_nasties_position &4171 20 d1 28 JSR &28d1 ; calculate_second_screen_address &4174 9d dd 43 STA &43dd,X ; nasties_screen_address_low &4177 a5 05 LDA &05 ; second_screen_address_high &4179 9d e2 43 STA &43e2,X ; nasties_screen_address_high &417c 20 26 41 JSR &4126 ; calculate_nasty_sprite &417f 85 8a STA &8a ; sprite_previous &4181 b5 7f LDA &7f,X ; nasties_state &4183 d0 03 BNE &4188 ; skip_animation # Don't animate nasty if destroyed &4185 fe ec 43 INC &43ec,X ; nasties_animation ; skip_animation &4188 20 26 41 JSR &4126 ; calculate_nasty_sprite &418b 85 8b STA &8b ; sprite &418d a5 60 LDA &60 ; nasty_to_consider &418f 69 33 ADC #&33 # Use palettes &33 - &37 for nasties &4191 20 8a 31 JSR &318a ; prepare_and_duplicate_palette_table &4194 20 a6 31 JSR &31a6 ; set_previous_and_current_other_sprite_addresses &4197 4c cc 27 JMP &27cc ; replot_double_height_sprite ; check_if_object_in_room_but_not_pocket # Returns equal set &419a b9 74 43 LDA &4374,Y ; objects_rooms &419d c5 1e CMP &1e ; player_room &419f d0 07 BNE &41a8 ; leave # if object is in room &41a1 b9 a0 43 LDA &43a0,Y ; objects_pocket &41a4 29 80 AND #&80 &41a6 49 80 EOR #&80 # but not in pocket &41a8 60 RTS ; move_nasty_towards_object &41a9 b9 8a 43 LDA &438a,Y ; objects_x &41ac 85 08 STA &08 ; x &41ae b9 5e 43 LDA &435e,Y ; objects_y &41b1 d0 12 BNE &41c5 ; move_nasty_towards_x_and_A # Always branches ; move_nasty_towards_player &41b3 a5 31 LDA &31 ; player_x &41b5 a4 5e LDY &5e ; player_state &41b7 c0 01 CPY #&01 &41b9 90 02 BCC &41bd ; player_is_alive_x &41bb 49 0f EOR #&0f # Use slightly different position if player is dead (?) ; player_is_alive_x &41bd 85 08 STA &08 ; x &41bf a5 32 LDA &32 ; player_y &41c1 90 02 BCC &41c5 ; player_is_alive_y &41c3 49 0f EOR #&0f # Use slightly different position if player is dead (?) ; player_is_alive_y ; move_nasty_towards_x_and_A &41c5 85 09 STA &09 ; y &41c7 bd d3 43 LDA &43d3,X ; nasties_x &41ca a0 00 LDY #&00 # Don't move if aligned with target &41cc c5 08 CMP &08 ; x &41ce f0 05 BEQ &41d5 ; set_nasty_velocity_x &41d0 c8 INY # Move right if left of target &41d1 90 02 BCC &41d5 ; set_nasty_velocity_x &41d3 a0 ff LDY #&ff # Move left if right of target ; set_nasty_velocity_x &41d5 98 TYA &41d6 9d e7 43 STA &43e7,X ; nasties_velocity_x &41d9 bd d8 43 LDA &43d8,X ; nasties_y &41dc a0 00 LDY #&00 # Don't move if aligned with target &41de c5 09 CMP &09 ; y &41e0 f0 06 BEQ &41e8 ; set_nasty_velocity_y &41e2 a0 02 LDY #&02 # Move down if above target &41e4 90 02 BCC &41e8 ; set_nasty_velocity_y &41e6 a0 fe LDY #&fe # Move up if below target ; set_nasty_velocity_y &41e8 98 TYA &41e9 9d ef 42 STA &42ef,X ; nasties_velocity_y &41ec 1d e7 43 ORA &43e7,X ; nasties_velocity_x &41ef 60 RTS ; move_static_nasty &41f0 f0 5e BEQ &4250 ; move_mummy ; move_hunchback &41f2 a9 00 LDA #&00 # Animate HUNCHBACK when moving &41f4 85 83 STA &83 ; nasties_state + 4 &41f6 a0 0a LDY #&0a ; HORSESHOE # Check for objects in room, excluding ACG parts, ; check_for_objects_loop # SPANNER, CRUCIFIX, LEAF and KEYs &41f8 20 9a 41 JSR &419a ; check_if_object_in_room_but_not_pocket &41fb f0 13 BEQ &4210 ; move_nasty_towards_object_or_remove_it &41fd 88 DEY &41fe c0 02 CPY #&02 ; ACG_RIGHT &4200 d0 f6 BNE &41f8 ; check_for_objects_loop &4202 a9 36 LDA #&36 # Move HUNCHBACK back to to doorway &4204 85 08 STA &08 ; x &4206 a9 20 LDA #&20 &4208 20 c5 41 JSR &41c5 ; move_nasty_towards_x_and_A &420b d0 42 BNE &424f ; leave &420d e6 83 INC &83 ; nasties_state + 4 # Don't animate HUNCHBACK when not moving ; leave &420f 60 RTS ; move_nasty_towards_object_or_remove_it &4210 84 63 STY &63 ; object &4212 20 a9 41 JSR &41a9 ; move_nasty_towards_object # Move HUNCHBACK towards object &4215 d0 38 BNE &424f ; leave &4217 a9 fa LDA #&fa # Remove object from room &4219 a6 63 LDX &63 ; object &421b 20 bd 31 JSR &31bd ; plot_object &421e a4 63 LDY &63 ; object &4220 88 DEY &4221 88 DEY &4222 88 DEY &4223 4c ac 32 JMP &32ac ; initialise_fixed_object # Return object to original location ; move_nasty &4226 a6 60 LDX &60 ; nasty_to_consider &4228 e0 03 CPX #&03 ; MUMMY &422a b0 c4 BCS &41f0 ; move_static_nasty # MUMMY and HUNCHBACK don't move ; move_nasty_towards_player_and_stuff &422c 20 b3 41 JSR &41b3 ; move_nasty_towards_player # DRACULA, DEVIL and FRANKENSTEIN move towards player &422f 8a TXA &4230 d0 07 BNE &4239 ; not_dracula &4232 a9 0c LDA #&0c ; CRUCIFIX &4234 20 67 31 JSR &3167 ; check_for_object_in_pockets &4237 10 04 BPL &423d ; invert_nasty_direction # DRACULA flees from player carrying CRUCIFIX ; not_dracula &4239 a5 5e LDA &5e ; player_state &423b f0 12 BEQ &424f ; leave # Nasties flee from growing or shrinking player ; invert_nasty_direction &423d a9 00 LDA #&00 &423f 38 SEC &4240 fd e7 43 SBC &43e7,X ; nasties_velocity_x &4243 9d e7 43 STA &43e7,X ; nasties_velocity_x &4246 a9 00 LDA #&00 &4248 38 SEC &4249 fd ef 42 SBC &42ef,X ; nasties_velocity_y &424c 9d ef 42 STA &42ef,X ; nasties_velocity_y ; leave &424f 60 RTS ; move_mummy &4250 a0 0d LDY #&0d ; LEAF &4252 20 9a 41 JSR &419a ; check_if_object_in_room_but_not_pocket # If the LEAF is in the room with the MUMMY, &4255 f0 b9 BEQ &4210 ; move_nasty_towards_object_or_remove_it # move the MUMMY towards it, then remove the LEAF &4257 ad 6c 43 LDA &436c ; objects_y + &e ; KEY_RED &425a c9 3e CMP #&3e # If the KEY_RED has been moved, &425c d0 ce BNE &422c ; move_nasty_towards_player_and_stuff # the MUMMY moves towards the player &425e a5 61 LDA &61 ; mummy_homing_target_x &4260 85 08 STA &08 ; x &4262 a5 62 LDA &62 ; mummy_homing_target_y &4264 20 c5 41 JSR &41c5 ; move_nasty_towards_x_and_A &4267 d0 a6 BNE &420f ; leave # Otherwise the MUMMY alternates between two targets &4269 a5 61 LDA &61 ; mummy_homing_target_x &426b 49 1c EOR #&1c &426d 85 61 STA &61 ; mummy_homing_target_x &426f a5 62 LDA &62 ; mummy_homing_target_y &4271 49 70 EOR #&70 &4273 85 62 STA &62 ; mummy_homing_target_y &4275 60 RTS # Nasties enemy drain # =================== # DRACULA &10000 # DEVIL &1c000 # FRANKENSTEIN &20000 # MUMMY &0c000 # HUNCHBACK &28000 ; nasties_enemy_drain_low &4276 00 c0 00 c0 80 ; nasties_enemy_drain_high &427b 01 01 02 00 02 ; entry_point &7d80 78 SEI &7d81 a9 06 LDA #&06 # R6: Vertical displayed register &7d83 8d 00 fe STA &fe00 ; video register number &7d86 a2 0f LDX #&0f &7d88 a9 00 LDA #&00 ; remove_roms_loop &7d8a 9d a1 02 STA &02a1,X ; os_paged_rom_type_table # Remove paged ROMs from ROM information table &7d8d ca DEX &7d8e 10 fa BPL &7d8a ; remove_roms_loop &7d90 8d 01 fe STA &fe01 ; video register value # Hide screen ; move_memory &7d93 a9 80 LDA #&80 &7d95 85 02 STA &02 ; target_address_low &7d97 85 04 STA &04 ; source_address_low &7d99 a9 03 LDA #&03 &7d9b 85 03 STA &03 ; target_address_high &7d9d a9 3e LDA #&3e &7d9f 85 05 STA &05 ; source_address_high &7da1 a2 40 LDX #&40 &7da3 a0 00 LDY #&00 ; move_memory_loop &7da5 b1 04 LDA (&04),Y ; source_address # Move &3e80 - &7e7f to &0380 - &437f &7da7 91 02 STA (&02),Y ; target_address &7da9 88 DEY &7daa d0 f9 BNE &7da5 ; move_memory_loop &7dac e6 03 INC &03 ; target_address_high &7dae e6 05 INC &05 ; source_address_high &7db0 ca DEX &7db1 d0 f2 BNE &7da5 ; move_memory_loop &7db3 8a TXA ; wipe_variables_loop &7db4 9d b3 42 STA &42b3,X ; enemies_materialisation # Wipe &42b3 - &43ff &7db7 9d 00 43 STA &4300,X ; palette_table_for_odd_rows &7dba ca DEX &7dbb d0 f7 BNE &7db4 ; wipe_variables_loop &7dbd a0 35 LDY #&35 ; reset_vector_table_loop &7dbf b9 40 d9 LDA &d940,Y ; os_default_vector_table &7dc2 99 00 02 STA &0200,Y ; os_vector_table &7dc5 88 DEY &7dc6 10 f7 BPL &7dbf ; reset_vector_table_loop &7dc8 c8 INY ; osbyte_loop &7dc9 84 02 STY &02 ; offset &7dcb b9 9e 7f LDA &7f9e,Y ; osbyte_a_table &7dce be a7 7f LDX &7fa7,Y ; osbyte_x_table &7dd1 a0 00 LDY #&00 &7dd3 20 f4 ff JSR &fff4 ; OSBYTE &7dd6 a4 02 LDY &02 ; offset &7dd8 c0 08 CPY #&08 &7dda 90 ec BCC &7dc8 ; osbyte_loop &7ddc a2 9f LDX #&9f &7dde a9 00 LDA #&00 ; wipe_zero_page_loop &7de0 95 00 STA &00,X # Wipe &0001 - &009f &7de2 ca DEX &7de3 d0 fb BNE &7de0 ; wipe_zero_page_loop ; initialise_variables &7de5 a9 45 LDA #&45 &7de7 85 8d STA &8d ; nasties_room + 1 ; DEVIL &7de9 a9 35 LDA #&35 &7deb 85 8e STA &8e ; nasties_room + 2 ; FRANKENSTEIN &7ded 85 8c STA &8c ; nasties_room ; DRACULA &7def a9 58 LDA #&58 &7df1 85 90 STA &90 ; nasties_room + 4 ; HUNCHBACK &7df3 a9 46 LDA #&46 &7df5 85 61 STA &61 ; mummy_homing_target_x &7df7 a9 20 LDA #&20 &7df9 85 62 STA &62 ; mummy_homing_target_y &7dfb ad 9b 02 LDA &029b ; os_system_clock_2_lowest_byte &7dfe 09 01 ORA #&01 &7e00 85 10 STA &10 ; rnd1_1 &7e02 a9 92 LDA #&92 &7e04 85 11 STA &11 ; rnd1_2 &7e06 a9 5e LDA #&5e &7e08 85 12 STA &12 ; rnd1_3 &7e0a a5 fc LDA &fc ; irq_accumulator &7e0c 09 01 ORA #&01 &7e0e 85 13 STA &13 ; rnd2_1 &7e10 a9 a8 LDA #&a8 &7e12 85 14 STA &14 ; rnd2_2 &7e14 a9 28 LDA #&28 &7e16 85 15 STA &15 ; rnd2_3 &7e18 a9 c4 LDA #&c4 &7e1a 8d 04 02 STA &0204 ; irq1_vector_low &7e1d a9 32 LDA #&32 ; &32c4 = irq1_handler &7e1f 8d 05 02 STA &0205 ; irq1_vector_high &7e22 a2 ff LDX #&ff &7e24 c6 34 DEC &34 ; player_direction &7e26 c6 3b DEC &3b ; spell_ttl &7e28 9a TXS &7e29 a2 00 LDX #&00 ; move_strings_loop &7e2b bd c6 7e LDA &7ec6,X ; unrelocated_strings # Copy &7ec6 - &7f6c to &0100 - &01a6 &7e2e c9 0d CMP #&0d &7e30 f0 06 BEQ &7e38 ; moved_strings &7e32 9d 00 01 STA &0100,X ; strings &7e35 e8 INX &7e36 d0 f3 BNE &7e2b ; move_strings_loop ; moved_strings &7e38 ca DEX &7e39 8e 68 03 STX &0368 ; os_font_location_bytes &7e3c 8e 69 03 STX &0369 ; os_font_location_bytes + 1 &7e3f 8e 6a 03 STX &036a ; os_font_location_bytes + 2 &7e42 a2 0f LDX #&0f &7e44 8e 67 03 STX &0367 ; os_font_flag # Restore default font ; move_enemy_y_random_velocites_loop &7e47 bd 6e 7f LDA &7f6e,X ; unrelocated_enemy_y_random_velocities # Copy &7f6e - &7f7d to &00c0 - &00cf &7e4a 95 c0 STA &c0,X ; enemy_y_random_velocities &7e4c ca DEX &7e4d 10 f8 BPL &7e47 ; move_enemy_y_random_velocites_loop &7e4f a2 15 LDX #&15 ; move_enemy_x_random_velocities_loop &7e51 bd 7e 7f LDA &7f7e,X ; unrelocated_enemy_x_random_velocities # Copy &7f7e - &7f93 to &02ea - &02ff &7e54 9d ea 02 STA &02ea,X ; enemy_x_random_velocities &7e57 ca DEX &7e58 10 f7 BPL &7e51 ; move_enemy_x_random_velocities_loop &7e5a a0 07 LDY #&07 &7e5c a9 80 LDA #&80 ; initialise_video_palette_loop &7e5e 99 98 00 STA &0098,Y ; video_palette # Set colours for trapdoor falling animation &7e61 a9 87 LDA #&87 # colour 8 will be white, 9 - 15 will be black &7e63 88 DEY &7e64 10 f8 BPL &7e5e ; initialise_video_palette_loop &7e66 a9 df LDA #&df # Set User VIA timer 2 to one-shot mode &7e68 2d 6b fe AND &fe6b ; User VIA auxiliary control register &7e6b 8d 6b fe STA &fe6b ; User VIA auxiliary control register &7e6e a9 a0 LDA #&a0 # Enable interrupts from User VIA timer 2 &7e70 8d 6e fe STA &fe6e ; User VIA interrupt enable register &7e73 8d 6e fe STA &fe6e ; User VIA interrupt enable register &7e76 a9 10 LDA #&10 &7e78 8d 68 fe STA &fe68 ; User VIA timer 2 counter LSB &7e7b a9 27 LDA #&27 &7e7d 8d 69 fe STA &fe69 ; User VIA timer 2 counter MSB &7e80 58 CLI &7e81 a9 03 LDA #&03 # Stop printing &7e83 20 ee ff JSR &ffee ; OSWRCH &7e86 a9 0a LDA #&0a ; Set second flashing colour duration &7e88 a2 00 LDX #&00 &7e8a a0 00 LDY #&00 &7e8c 20 f4 ff JSR &fff4 ; OSBYTE &7e8f a9 09 LDA #&09 ; Set first flashing colour duration # Set colours 8 to 15 to be the same as 0 to 7 &7e91 a2 00 LDX #&00 &7e93 a0 00 LDY #&00 &7e95 20 f4 ff JSR &fff4 ; OSBYTE &7e98 a2 f2 LDX #&f2 ; copy_os_mode_changing_code_loop # Copy &cb1d - &cc0e to &6b1d - &6c0e &7e9a bd 1c cb LDA &cb1c,X ; os_rom_set_mode - 1 &7e9d 9d 1c 6b STA &6b1c,X ; set_mode - 1 &7ea0 ca DEX &7ea1 d0 f7 BNE &7e9a ; copy_os_mode_changing_code_loop &7ea3 a9 60 LDA #&60 ; RTS # Remove final jump to video vector &7ea5 8d f0 6b STA &6bf0 ; set_mode + &d4 # (which would clear screen memory) &7ea8 a9 02 LDA #&02 # Change to MODE 2 without clearing screen memory &7eaa 20 1d 6b JSR &6b1d ; set_mode &7ead a9 44 LDA #&44 ; &4400 = screen_memory &7eaf 8d 51 03 STA &0351 ; os_screen_start_address_high &7eb2 a2 04 LDX #&04 ; set_video_registers_loop &7eb4 bd 94 7f LDA &7f94,X ; video_register_numbers &7eb7 8d 00 fe STA &fe00 ; video register number &7eba bd 99 7f LDA &7f99,X ; video_register_values &7ebd 8d 01 fe STA &fe01 ; video register value &7ec0 ca DEX &7ec1 10 f1 BPL &7eb4 ; set_video_registers_loop &7ec3 4c 32 33 JMP &3332 ; character_selection_screen # &7ec6 - &7f6c is copied to &0100 - &01a6 at &7e2b ; strings &0100 11 03 1f 00 17 28 43 29 20 31 39 38 33 20 41 2e ; COLOUR 3, TAB(&00, &17) ; "(C) 1983 A.C.G. LTD" &0110 43 2e 47 2e 20 4c 54 44 1f 05 00 41 54 49 43 20 ; TAB(&05, &00) ; "ATIC ATAC" &0120 41 54 41 43 11 06 1f 03 14 53 50 41 43 45 20 4f ; COLOUR 6; TAB(&03, &14) ; "SPACE OR FIRE" &0130 52 20 46 49 52 45 1f 02 02 53 45 4c 45 43 54 49 ; TAB(&02, &02) ; "SELECTION SHEET" &0140 4f 4e 20 53 48 45 45 54 &0148 11 06 1f 04 0a 59 4f 55 ; COLOUR 6 ; TAB(&04, &0a) ; "YOU HAVE" &0150 20 20 48 41 56 45 1f 05 0c 45 53 43 41 50 45 44 ; TAB(&05, &0c); "ESCAPED" &0160 0c 11 06 1f 04 0a 47 41 4d 45 20 4f 56 45 52 ; CLS; COLOUR 6; TAB(&04, &0a); "GAME OVER" &016f 1c 00 17 0e 00 11 88 ; define text window (00 17 0e 00), background colour 8 &0176 1f 07 06 31 20 20 4b 4e 49 47 48 54 ; TAB(&07, &06); "1 KNIGHT"; &0182 1f 07 0b 32 20 20 57 49 5a 41 52 44 ; TAB(&07, &0b); "2 WIZARD"; &018e 1f 07 10 33 20 20 53 45 52 46 ; TAB(&07, &10); "3 SERF"; &0198 11 01 ; COLOUR 1 &019a 11 07 ; COLOUR 7 &019c 1c 00 17 13 00 14 0c ; define text window(00 17 13 00), restore default colours, CLS &01a3 14 11 88 0c ; restore default colours, background colour 8, CLS &7f6d 0d # Marker for end of strings # &7f6e - &7f7d copied to &00c0 - &00cf at &7e47 ; enemy_y_random_velocities &00c0 fc fc fd fe 01 02 03 03 ; enemy_random_velocities &00c8 01 00 ff fe 02 fd 01 fe # &7f7e - &7f93 copied to &02ea - &02ff at &7e51 ; enemy_x_random_velocities &02ea 02 01 fe fd ; unused &02ee 80 c0 3f 7f ff ff 00 00 ; enemy_random_directions &02f6 01 fe ; enemy_random_change_cooldowns &02f8 1f 1f 0f ; unused &02fb 07 ; animation_table &02fc 01 02 01 00 # Set video registers: # &07 = &1e ; R7: Vertical sync position # &06 = &18 ; R6: Vertical displayed register # 192 pixels high # &0c = &08 ; R12: Displayed screen start address register (high) # &0d = &80 ; R13: Displayed screen start address register (low) # Set screen start address to &4400 # &0a = &20 ; R10: Cursor start register # Disable cursor ; video_register_numbers &7f94 07 06 0c 0d 0a ; video_register_values &7f99 1e 18 08 80 20 # OSBYTEs # &c9, &ff ; Disable keyboard # &c8, &03 ; Clear memory on BREAK, disable ESCAPE # &e5, &ff ; ESCAPE inserts value into input buffer # &e6, &ff ; Disable ESCAPE effects # &d2, &00 ; Enable sound # &0f, &00 ; Flush all buffers # &10, &02 ; Set maximum ADC channel to sample to 2 # &7c, &00 ; Clear ESCAPE condition # &be, &00 ; Use default ADC resolution ; osbyte_a_table &7f9e c9 c8 e5 e6 d2 0f 10 7c be ; osbyte_x_table &7fa7 ff 03 ff ff 00 00 02 00 00 ; unused &7fb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7fd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7ff0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00