FireTrack disassembly ===================== FireTrack was written by Nick "Orlando" Pelling for Aardvark Software and published by Electric Dreams Software for the BBC Micro in 1987. This vertically-scrolling shooter was renowned for its smooth scrolling. 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 =============== An unremarkable BASIC loader runs the main loader, $.!FTLoad, which in turn runs the game's binary, $.!FTrack. The loader is notable in its own right, and is disassembled as part of this analysis. It has an interrupt-driven music and text routine that continues as the game loads. For the logo screen, it uses a hardware timer as a source of randomness. It also builds the code of a filter routine as an unrolled loop, which it then applies to the entire screen. The game's binary searches for sideways RAM. If found, it is used to store extra maps, graphics and music for an enhanced version of the game. Holding down "T" while pressing SPACE to leave the loader disables this check. The sixteen colours of a custom-sized MODE 2 screen are configured to split the four bits per pixel into two pairs. This permits bitwise operations to change background or foreground separately. Smooth scrolling is achieved by an interrupt driven routine which writes to the video registers several times per v-sync. There is no use of shadow RAM or double buffering. The smooth scrolling is achieved by using the vertical total adjust register (R5) to move the entire display up the number of rows scrolled in the first group, but then hiding the same number of rows by disabling the display with the interlace and delay register (R8). At the bottom of the screen, the scan lines per character register (R9) is used to display a partial group of rows. The combined effect keeps the visible part of the screen the same size and in the same position, but gives the appearance of scrolling one row per frame. The background is updated a group at a time in the hidden part of the screen. Maps are compressed using a variable-length dictionary. In the enhanced version, background sprites are unpacked prior to each stage. They are stored as 8x8 bitmaps, and can be plotted upside-down. Each background tile consists of two sprites, but some tiles are linked to form larger structures. Foreground sprites are unplotted and plotted using a single routine that is optimised for small movements between frames. This routine uses partially unrolled loops. Pressing f5 when starting a stage enables a tweak to the scrolling routine. This is described in the game's instructions as enabling a black and white mode. The game also checks for configuration options in sideways RAM. These are not used in the released version, but in principle, they could change the scrolling and sound routines, define custom keys or add other controls. Pressing f0 and f9 on the title screen enables a cheat. This allows the game to be started on the last stage with seven lives by pressing f9. Pressing f0, f9, COPY and SHIFT-LOCK increases the number of lives given to forty two. Interesting Pokes ================= &22bc = &2c, &2598 = &2c, &25af = &60 disable smooth scrolling &1fd6 = &24 infinite lives &334c = &60 player is invulnerable &327b = &a9 no enemies &1ec9 = &2a start on last stage Loader Disassembly ================== ; $.!FTLoad 001f00 001f00 001141 # Bytes are listed in the order they occur in the binary. Addresses are where they are used. &1f00 a9 12 LDA #&12 ; Reset F-key definitions &1f02 20 f4 ff JSR &fff4 ; OSBYTE # Clear soft key buffer &1f05 a9 14 LDA #&14 ; Implode user defined character font RAM &1f07 a2 00 LDX #&00 ; characters &80 to &9F only are redefineable &1f09 20 f4 ff JSR &fff4 ; OSBYTE # Release any memory used by exploded characters &1f0c ad 10 fe LDA &fe10 ; Serial ULA control register &1f0f c9 64 CMP #&64 &1f11 d0 08 BNE &1f1b ; integra_b_not_present # Does the system have an Integra-B expansion board? (?) &1f13 a9 ea LDA #&ea ; NOP # If so, treat it as a Master for MODE 7 operations &1f15 8d 5a 20 STA &205a ; master_check &1f18 8d 5b 20 STA &205b ; master_check + 1 ; integra_b_not_present &1f1b ea NOP &1f1c ea NOP &1f1d ea NOP &1f1e a9 e3 LDA #&e3 ; Read/Write Interpretation of Ctrl-F-keys &1f20 a2 00 LDX #&00 &1f22 a0 00 LDY #&00 &1f24 20 f4 ff JSR &fff4 ; OSBYTE # Totally ignore Ctrl function keys &1f27 a9 e4 LDA #&e4 ; Read/Write Interpretation of Ctrl-Shift-F-keys &1f29 a2 00 LDX #&00 &1f2b a0 00 LDY #&00 &1f2d 20 f4 ff JSR &fff4 ; OSBYTE # Totally ignore Ctrl-Shift function keys &1f30 a9 f4 LDA #&f4 ; Read/Write soft key consistency flag &1f32 a2 ff LDX #&ff &1f34 a0 00 LDY #&00 &1f36 20 f4 ff JSR &fff4 ; OSBYTE # Mark soft keys as in an inconsistent state &1f39 58 CLI &1f3a ea NOP &1f3b a2 00 LDX #&00 ; move_memory_loop &1f3d bd 1d 2a LDA &2a1d,X # Move &2a1d-&2d1c to &0492-&0791 &1f40 9d 92 04 STA &0492,X # (event routine and first part of music) &1f43 bd 1d 2b LDA &2b1d,X &1f46 9d 92 05 STA &0592,X &1f49 bd 1d 2c LDA &2c1d,X &1f4c 9d 92 06 STA &0692,X &1f4f bd 2e 2d LDA &2d2e,X # Move &2d2e-&302d to &09c0-&0cbf &1f52 9d c0 09 STA &09c0,X # (second part of music) &1f55 bd 2e 2e LDA &2e2e,X &1f58 9d c0 0a STA &0ac0,X &1f5b bd 2e 2f LDA &2f2e,X &1f5e 9d c0 0b STA &0bc0,X &1f61 e8 INX &1f62 d0 d9 BNE &1f3d ; move_memory_loop &1f64 a2 3f LDX #&3f ; move_memory_two_loop &1f66 bd 2e 30 LDA &302e,X # Move &302e-&305d to &0cc0-&0cff &1f69 9d c0 0c STA &0cc0,X # (end of second part of music) &1f6c bd 1d 2d LDA &2d1d,X # Move &2d1d-&2d4c to &0792-&07c1 &1f6f 9d 92 07 STA &0792,X # (end of first part of music) &1f72 bd 4b 2d LDA &2d4b,X # Move &2d4b-&2d7c to &07c0-&07ff &1f75 9d c0 07 STA &07c0,X # (end of first part of music) &1f78 ca DEX &1f79 10 eb BPL &1f66 ; move_memory_two_loop &1f7b a2 00 LDX #&00 &1f7d 86 35 STX &35 ; credits_active &1f7f a9 01 LDA #&01 &1f81 85 29 STA &29 ; credits_cooldown ; move_memory_three_loop &1f83 bd 4b 26 LDA &264b,X # Move &264b-&274a to &1200-&12ff &1f86 9d 00 12 STA &1200,X # (credits) &1f89 e8 INX &1f8a d0 f7 BNE &1f83 ; move_memory_three_loop &1f8c a2 08 LDX #&08 ; move_memory_four_loop &1f8e bd 4b 27 LDA &274b,X # Move &274b-&2483 to &1300-&1308 &1f91 9d 00 13 STA &1300,X # (end of credits) &1f94 ca DEX &1f95 10 f7 BPL &1f8e ; move_memory_four_loop &1f97 a2 00 LDX #&00 &1f99 a0 12 LDY #&12 ; &1200 = credits &1f9b 84 34 STY &34 ; credits_address_high &1f9d 86 33 STX &33 ; credits_address_low &1f9f 20 4b 28 JSR &284b ; initialise_sound &1fa2 a9 00 LDA #&00 &1fa4 85 36 STA &36 ; music_muted &1fa6 a9 e5 LDA #&e5 ; Read/Write ESCAPE key status &1fa8 a2 ff LDX #&ff &1faa a0 00 LDY #&00 &1fac 20 f4 ff JSR &fff4 ; OSBYTE # Treat ESCAPE as an ASCII code &1faf a9 dc LDA #&dc ; Read/Write ASCII for ESCAPE &1fb1 a2 1b LDX #&1b &1fb3 a0 00 LDY #&00 &1fb5 20 f4 ff JSR &fff4 ; OSBYTE # Use &1b as ESCAPE (the default) &1fb8 a9 90 LDA #&90 ; Set TV offset and interlacing &1fba a2 ff LDX #&ff ; vertical screen shift &1fbc a0 01 LDY #&01 ; turn on interlacing &1fbe 20 f4 ff JSR &fff4 ; OSBYTE &1fc1 a9 60 LDA #&60 # Disable interrupts for User VIA Timer 1 and Timer 2 &1fc3 8d 6e fe STA &fe6e ; User Interrupt control register &1fc6 a9 40 LDA #&40 # Set Timer 1 to generate repeated interrupts &1fc8 8d 6b fe STA &fe6b ; User Auxiliary control register &1fcb a9 00 LDA #&00 # Set count value to 256000 &1fcd 8d 64 fe STA &fe64 ; User Timer 1 latch/counter LSB &1fd0 a9 64 LDA #&64 &1fd2 8d 65 fe STA &fe65 ; User Timer 1 latch-counter MSB # i.e. set up &fe64 as a source of randomness &1fd5 20 2d 21 JSR &212d ; construct_filter_routine &1fd8 a2 00 LDX #&00 ; mode2_title_string # Change to MODE 2 and set colours &1fda a0 24 LDY #&24 &1fdc 20 f4 22 JSR &22f4 ; write_string &1fdf a5 d0 LDA &d0 ; os_vdu_status &1fe1 09 08 ORA #&08 # Enable soft scrolling &1fe3 29 ef AND #&ef # Disable shadow display mode &1fe5 85 d0 STA &d0 ; os_vdu_status &1fe7 a9 08 LDA #&08 # Set VDU driver code at &c000, disable shadow RAM &1fe9 8d 34 fe STA &fe34 ; os_ram_access_control &1fec a9 00 LDA #&00 # Fill screen with background sprite &1fee 20 33 22 JSR &2233 ; plot_firetrack_logo &1ff1 a9 01 LDA #&01 ; emerge_logo_loop &1ff3 48 PHA &1ff4 20 33 22 JSR &2233 ; plot_firetrack_logo # Make logo increasingly less random &1ff7 68 PLA &1ff8 69 07 ADC #&07 &1ffa c9 50 CMP #&50 &1ffc 90 f5 BCC &1ff3 ; emerge_logo_loop &1ffe 48 PHA &1fff a2 24 LDX #&24 ; colour_two_to_cyan_string &2001 a0 06 LDY #&06 &2003 20 f4 22 JSR &22f4 ; write_string # Add cyan top-left edge to logo &2006 68 PLA ; continue_to_emerge_logo_loop &2007 48 PHA &2008 20 33 22 JSR &2233 ; plot_firetrack_logo # Continue to make logo increasingly less random &200b 68 PLA &200c 69 10 ADC #&10 &200e 90 f7 BCC &2007 ; continue_to_emerge_logo_loop &2010 a9 ff LDA #&ff # Plot logo without any randomness &2012 20 33 22 JSR &2233 ; plot_firetrack_logo &2015 a2 2a LDX #&2a ; colour_two_to_white_string &2017 a0 0c LDY #&0c &2019 20 f4 22 JSR &22f4 ; write_string # Turn cyan top-left edge to white, reveal black &201c a9 0c LDA #&0c &201e 85 82 STA &82 ; count ; add_shadow_to_logo_loop &2020 20 fc 20 JSR &20fc ; call_filter_routine_over_entire_screen # Lengthen black shadow to right of logo &2023 c6 82 DEC &82 ; count &2025 d0 f9 BNE &2020 ; add_shadow_to_logo_loop &2027 a9 ff LDA #&ff &2029 18 CLC &202a 65 30 ADC &30 ; vsync_counter ; wait_for_vsync &202c c5 30 CMP &30 ; vsync_counter &202e d0 fc BNE &202c ; wait_for_vsync &2030 20 5b 27 JSR &275b ; shrink_mode2_screen # Fill the screen with black from the sides &2033 a2 36 LDX #&36 ; mode2_game_string # Set up custom MODE 2 screen for game &2035 a0 49 LDY #&49 &2037 20 f4 22 JSR &22f4 ; write_string &203a a2 00 LDX #&00 ; copy_0300_loop &203c bd 00 03 LDA &0300,X # Copy &0300-&037f (OS VDU workspace) to &0400-&047f &203f 9d 00 04 STA &0400,X &2042 e8 INX &2043 10 f7 BPL &203c ; copy_0300_loop &2045 a2 11 LDX #&11 ; copy_00d0_loop # Copy &00d0-&00e1 (OS VDU zero page) to &0480-&0491 &2047 b5 d0 LDA &d0,X &2049 9d 80 04 STA &0480,X &204c ca DEX &204d 10 f8 BPL &2047 ; copy_00d0_loop &204f a9 00 LDA #&00 ; Identify Host/Operating System &2051 a2 01 LDX #&01 ; Return host/OS in X &2053 20 f4 ff JSR &fff4 ; OSBYTE &2056 e0 03 CPX #&03 ; Master 128 &2058 a2 00 LDX #&00 ; master_check &205a 90 2d BCC &2089 ; not_master # If this is a Master, ; also NOP ; if system has Integra-B expansion board ; NOP &205c a9 28 LDA #&28 # make adjustments for different size of screen &205e 8d 03 26 STA &2603 ; mode7_string + 5 &2061 8d 41 28 STA &2841 ; move_to_next_row + 1 &2064 a9 34 LDA #&34 &2066 8d 17 26 STA &2617 ; mode7_string + &19 &2069 a9 13 LDA #&13 &206b 8d cf 27 STA &27cf ; set_middle_of_screen + 1 &206e a9 27 LDA #&27 &2070 8d df 27 STA &27df ; set_right_side_of_screen + 1 &2073 8d f7 27 STA &27f7 ; set_right_side_of_screen_two + 1 &2076 8d 1a 28 STA &281a ; set_width_of_screen + 1 &2079 a9 28 LDA #&28 &207b 8d 35 26 STA &2635 ; mode7_string + &37 &207e a9 60 LDA #&60 &2080 8d 3f 26 STA &263f ; mode7_string + &41 &2083 a9 25 LDA #&25 &2085 8d 1a 05 STA &051a ; set_length_of_blank_line + 1 &2088 ca DEX ; not_master &2089 86 2a STX &2a ; is_master &208b a2 7f LDX #&7f ; mode7_string # Change to custom MODE 7 &208d a0 4d LDY #&4d &208f 20 f4 22 JSR &22f4 ; write_string &2092 a2 32 LDX #&32 &2094 8e 4c 03 STX &034c ; os_text_window_width_low &2097 8e 52 03 STX &0352 ; os_number_of_bytes_per_line &209a ca DEX &209b 8e 0a 03 STX &030a ; os_x_coordinate_of_right_side_of_text_window &209e a9 03 LDA #&03 &20a0 8d 08 03 STA &0308 ; os_x_coordinate_of_left_side_of_text_window &20a3 a9 13 LDA #&13 &20a5 8d 09 03 STA &0309 ; os_y_coordinate_of_bottom_side_of_text_window &20a8 a5 d0 LDA &d0 ; os_vdu_status &20aa 09 08 ORA #&08 # Enable soft scrolling &20ac 29 ef AND #&ef # Disable shadow display mode &20ae 85 d0 STA &d0 ; os_vdu_status &20b0 a9 08 LDA #&08 # Set VDU driver code at &c000, disable shadow RAM &20b2 8d 34 fe STA &fe34 ; os_ram_access_control &20b5 a2 92 LDX #&92 &20b7 a0 04 LDY #&04 ; &0492 = row_multiplication_table &20b9 84 e1 STY &e1 ; os_row_multiplication_table_high &20bb 86 e0 STX &e0 ; os_row_multiplication_table_low &20bd a9 10 LDA #&10 &20bf 8d 50 03 STA &0350 ; os_address_of_top_left_of_screen_low &20c2 a9 1e LDA #&1e ; HOME &20c4 20 ee ff JSR &ffee ; OSWRCH &20c7 20 2a 22 JSR &222a ; read_key &20ca 20 c7 27 JSR &27c7 ; expand_mode7_screen # Fill the screen with red from the middle &20cd a9 84 LDA #&84 ; BLUE # Set top four lines of screen to foreground blue &20cf 24 2a BIT &2a ; is_master &20d1 30 11 BMI &20e4 ; master_version ; standard_version &20d3 8d 76 7c STA &7c76 &20d6 8d a8 7c STA &7ca8 &20d9 8d da 7c STA &7cda &20dc 8d 0c 7d STA &7d0c &20df 8d 3e 7d STA &7d3e &20e2 10 0f BPL &20f3 ; start_credits_and_run_game ; master_version &20e4 8d 62 7c STA &7c62 &20e7 8d 8a 7c STA &7c8a &20ea 8d b2 7c STA &7cb2 &20ed 8d da 7c STA &7cda &20f0 8d 02 7d STA &7d02 ; start_credits_and_run_game &20f3 c6 35 DEC &35 ; credits_active &20f5 a2 ba LDX #&ba &20f7 a0 04 LDY #&04 ; &04ba = run_ftrack_string &20f9 4c f7 ff JMP &fff7 ; OSCLI ; call_filter_routine_over_entire_screen &20fc a2 00 LDX #&00 &20fe a0 30 LDY #&30 &2100 84 2f STY &2f ; row_screen_address_high &2102 86 2e STX &2e ; row_screen_address_low ; call_filter_routine_over_entire_screen_loop &2104 a4 2f LDY &2f ; row_screen_address_high &2106 a6 2e LDX &2e ; row_screen_address_low &2108 84 2d STY &2d ; screen_address_high &210a 86 2c STX &2c ; screen_address_low &210c a2 05 LDX #&05 &210e 20 1d 2b JSR &2b1d ; filter_routine &2111 e6 2e INC &2e ; row_screen_address_low &2113 d0 02 BNE &2117 &2115 e6 2f INC &2f ; row_screen_address_high &2117 a5 2e LDA &2e ; row_screen_address_low &2119 29 07 AND #&07 &211b d0 e7 BNE &2104 ; call_filter_routine_over_entire_screen_loop &211d 18 CLC &211e a5 2e LDA &2e ; row_screen_address_low &2120 69 78 ADC #&78 &2122 85 2e STA &2e ; row_screen_address_low &2124 a5 2f LDA &2f ; row_screen_address_high &2126 69 02 ADC #&02 &2128 85 2f STA &2f ; row_screen_address_high &212a 10 d8 BPL &2104 ; loop &212c 60 RTS ; construct_filter_routine &212d a2 00 LDX #&00 ; built_filter_previous_table_loop # Build a &100 table, repeating the sequence &212f 8a TXA # &00, &10, &00, &10, &40, &50, &40, &50 &2130 0a ASL A &2131 0a ASL A &2132 0a ASL A &2133 0a ASL A &2134 29 50 AND #&50 &2136 9d 1d 2a STA &2a1d,X ; filter_previous_table &2139 e8 INX &213a d0 f3 BNE &212f ; built_filter_previous_table_loop &213c a2 1d LDX #&1d # Build a &415 byte block of code &2b1d-&2f31 &213e a0 2b LDY #&2b ; &2b1d = filter_routine # which runs the contents of filter_instructions &2140 84 81 STY &81 ; code_address_high # over every eighth byte between 0 and &278 &2142 86 80 STX &80 ; code_address_low # i.e. operates on an entire row of pixels &2144 a9 00 LDA #&00 &2146 20 68 21 JSR &2168 ; construct_block_of_filter_routine &2149 a9 e6 LDA #&e6 ; INC &214b a2 2d LDX #&2d ; &2d &214d 20 8b 21 JSR &218b ; add_two_bytes_to_filter_routine # Add INC &2d ; screen_address_high &2150 a9 00 LDA #&00 &2152 20 68 21 JSR &2168 ; construct_block_of_filter_routine &2155 a9 e6 LDA #&e6 ; INC &2157 a2 2d LDX #&2d ; &2d &2159 20 8b 21 JSR &218b ; add_two_bytes_to_filter_routine # Add INC &2d ; screen_address_high &215c a9 80 LDA #&80 &215e 20 68 21 JSR &2168 ; construct_block_of_filter_routine &2161 a9 60 LDA #&60 ; RTS &2163 a0 00 LDY #&00 &2165 91 80 STA (&80),Y ; code_address # Add RTS &2167 60 RTS ; construct_block_of_filter_routine &2168 85 82 STA &82 ; count &216a a9 00 LDA #&00 &216c 48 PHA ; construct_block_of_filter_routine_loop &216d aa TAX &216e a9 a0 LDA #&a0 ; LDY # &2170 20 8b 21 JSR &218b ; add_two_bytes_to_filter_routine # Add LDY #A &2173 a0 0a LDY #&0a ; construct_block_of_filter_routine_instructions_loop # Copy filter_instructions &2175 b9 9f 21 LDA &219f,Y ; filter_instructions &2178 91 80 STA (&80),Y ; code_address &217a 88 DEY &217b 10 f8 BPL &2175 ; construct_block_of_filter_routine_instructions_loop &217d a9 0b LDA #&0b &217f 20 95 21 JSR &2195 ; add_to_code_address &2182 68 PLA &2183 18 CLC &2184 69 08 ADC #&08 &2186 c5 82 CMP &82 ; count &2188 d0 e2 BNE &216c ; construct_block_of_filter_routine_loop # Repeat until A = count &218a 60 RTS ; add_two_bytes_to_filter_routine &218b a0 00 LDY #&00 &218d 91 80 STA (&80),Y ; code_address &218f c8 INY &2190 8a TXA &2191 91 80 STA (&80),Y ; code_address &2193 a9 02 LDA #&02 ; add_to_code_address &2195 18 CLC &2196 65 80 ADC &80 ; code_address_low &2198 85 80 STA &80 ; code_address_low &219a 90 02 BCC &219e &219c e6 81 INC &81 ; code_address_high &219e 60 RTS ; filter_instructions # FOR offset = 0 to &f8 step &8 # LDY #offset &219f bd 1d 2a LDA &2a1d,X ; filter_previous_table # Use the byte of the previous two pixels &21a2 11 2c ORA (&2c),Y ; screen_address # together with the current two pixels &21a4 aa TAX &21a5 bd aa 21 LDA &21aa,X ; filter_byte_table # to determine what these two pixels should be &21a8 91 2c STA (&2c),Y ; screen_address # NEXT # INC &2d ; screen_address_high # At end of each &100 block # RTS # At end ; filter_byte_table ; KK KR RK RR KM KW RM RW MK MR WK WR MM MW WM WW ; this KK KR RK RR KM KW RM RW MK MR WK WR MM MW WM WW ; 0 1 2 3 4 5 6 7 8 9 a b c d e f ; previous &21aa 00 00 00 01 04 00 04 05 08 09 00 01 0c 0d 04 05 ; 00 KK RK MK WK -> KK K- -K -R KM K- -M -W MK MR -K -R MM MW -M -W &21ba 00 00 02 03 04 00 06 07 08 09 0a 0b 0c 0d 0e 0f ; 10 KR KM MR MM -> KK K- RK RR KM K- RM RW MK MR WK WR MM MW WM WW &21ca 00 00 00 01 04 00 04 05 08 09 00 01 0c 0d 04 05 ; 20 KK K- -K -R KM K- -M -W MK MR -K -R MM MW -M -W &21da 00 00 02 03 04 00 06 07 08 09 0a 0b 0c 0d 0e 0f ; 30 KK K- RK RR KM K- RM RW MK MR WK WR MM MW WM WW &21ea 00 00 02 03 04 00 06 07 08 09 0a 0b 0c 0d 0e 0f ; 40 KM RM MM WM -> KK K- RK RR KM K- RM RW MK MR WK WR MM MW WM WW &21fa 00 00 02 03 04 00 06 07 08 09 0a 0b 0c 0d 0e 0f ; 50 KW RW MW WW -> KK K- RK RR KM K- RM RW MK MR WK WR MM MW WM WW &220a 00 00 02 03 04 00 06 07 08 09 0a 0b 0c 0d 0e 0f ; 60 KK K- RK RR KM K- RM RW MK MR WK WR MM MW WM WW &221a 00 00 02 03 04 00 06 07 08 09 0a 0b 0c 0d 0e 0f ; 70 KK K- RK RR KM K- RM RW MK MR WK WR MM MW WM WW ; KKR -> KKK, KRK -> KKK, KRR -> KKR, *KW -> *KK, KRM -> KKM, KRW -> KKW, KWK -> KKK, KWR -> KKR, KWM -> KKM, KWW -> KKW ; i.e. add a black pixel to the right of every existing black pixel, except where that would replace a magenta pixel ; read_key &222a a9 81 LDA #&81 ; Read key with time limit &222c a2 16 LDX #&16 &222e a0 00 LDY #&00 &2230 4c f4 ff JMP &fff4 ; OSBYTE ; plot_firetrack_logo &2233 85 37 STA &37 ; logo_state &2235 a2 00 LDX #&00 &2237 a0 30 LDY #&30 &2239 84 2f STY &2f ; screen_address_high &223b 86 2e STX &2e ; screen_address_low &223d a2 80 LDX #&80 &223f a0 32 LDY #&32 ; &3280 = screen address + one group of eight pixels down &2241 84 2d STY &2d ; offset_screen_address_high &2243 86 2c STX &2c ; offset_screen_address_low &2245 a2 3f LDX #&3f &2247 a0 24 LDY #&24 ; &243f = logo_data &2249 84 81 STY &81 ; logo_data_address_high &224b 86 80 STX &80 ; logo_data_address_low &224d a9 10 LDA #&10 &224f 85 82 STA &82 ; rows ; outer_loop &2251 a9 14 LDA #&14 &2253 85 83 STA &83 ; columns ; inner_loop &2255 a0 00 LDY #&00 &2257 b1 80 LDA (&80),Y ; logo_data_address &2259 20 9b 22 JSR &229b ; plot_square_of_logo &225c 18 CLC &225d a5 2c LDA &2c ; offset_screen_address_low &225f 69 20 ADC #&20 &2261 85 2c STA &2c ; offset_screen_address_low &2263 90 02 BCC &2267 &2265 e6 2d INC &2d ; offset_screen_address_high &2267 18 CLC &2268 a5 2e LDA &2e ; screen_address_low &226a 69 20 ADC #&20 &226c 85 2e STA &2e ; screen_address_low &226e 90 02 BCC &2272 &2270 e6 2f INC &2f ; screen_address_high &2272 e6 80 INC &80 ; logo_data_address_low &2274 d0 02 BNE &2278 &2276 e6 81 INC &81 ; logo_data_address_high &2278 c6 83 DEC &83 ; columns &227a d0 d9 BNE &2255 ; inner_loop &227c 18 CLC &227d a5 2c LDA &2c ; offset_screen_address_low &227f 69 80 ADC #&80 &2281 85 2c STA &2c ; offset_screen_address_low &2283 a5 2d LDA &2d ; offset_screen_address_high &2285 69 02 ADC #&02 &2287 85 2d STA &2d ; offset_screen_address_high &2289 18 CLC &228a a5 2e LDA &2e ; screen_address_low &228c 69 80 ADC #&80 &228e 85 2e STA &2e ; screen_address_low &2290 a5 2f LDA &2f ; screen_address_high &2292 69 02 ADC #&02 &2294 85 2f STA &2f ; screen_address_high &2296 c6 82 DEC &82 ; rows &2298 d0 b7 BNE &2251 ; outer_loop &229a 60 RTS ; plot_square_of_logo &229b a4 37 LDY &37 ; logo_state &229d d0 03 BNE &22a2 ; use_sprite &229f 98 TYA &22a0 f0 03 BEQ &22a5 ; calculate_sprite_address # If logo state is &00, use sprite zero throughout ; use_sprite &22a2 a8 TAY &22a3 f0 2f BEQ &22d4 ; leave ; calculate_sprite_address &22a5 0a ASL A &22a6 0a ASL A &22a7 0a ASL A &22a8 0a ASL A &22a9 0a ASL A &22aa 08 PHP &22ab 18 CLC &22ac 69 ff ADC #&ff &22ae 85 7c STA &7c ; sprite_address_low &22b0 a9 22 LDA #&22 ; &22ff = sprite_data &22b2 69 00 ADC #&00 &22b4 28 PLP &22b5 69 00 ADC #&00 &22b7 85 7d STA &7d ; sprite_address_high &22b9 a0 1f LDY #&1f &22bb a5 37 LDA &37 ; logo_state &22bd f0 04 BEQ &22c3 ; plot_sprite_loop # If logo state is &00 or &ff, plot sprite as is &22bf c9 ff CMP #&ff &22c1 d0 12 BNE &22d5 ; plot_sprite_or_randomness_loop ; plot_sprite_loop &22c3 b1 7c LDA (&7c),Y ; sprite_address &22c5 aa TAX &22c6 29 0f AND #&0f &22c8 91 2e STA (&2e),Y ; offset_screen_addres # Bottom four bits of sprite data is lower group &22ca 8a TXA &22cb 4a LSR A &22cc 4a LSR A &22cd 4a LSR A &22ce 4a LSR A &22cf 91 2c STA (&2c),Y ; screen_address # Top four bits of sprite data is upper group &22d1 88 DEY &22d2 10 ef BPL &22c3 ; plot_sprite_loop ; leave &22d4 60 RTS ; plot_sprite_or_randomness_loop &22d5 98 TYA &22d6 45 2c EOR &2c ; offset_screen_address_low &22d8 4d 64 fe EOR &fe64 ; Timer 1 latch/counter LSB # Use timer as a source of randomness &22db c5 37 CMP &37 ; logo_state &22dd b9 ff 22 LDA &22ff,Y ; sprite_data &22e0 b0 02 BCS &22e4 ; use_randomness # If logo state < RND(256), use random number &22e2 b1 7c LDA (&7c),Y ; sprite_address # otherwise use byte of sprite data ; use_randomness &22e4 aa TAX &22e5 29 0f AND #&0f &22e7 91 2e STA (&2e),Y ; offset_screen_address # Bottom four bits is lower group &22e9 8a TXA &22ea 4a LSR A &22eb 4a LSR A &22ec 4a LSR A &22ed 4a LSR A &22ee 91 2c STA (&2c),Y ; screen_address # Top four bits is upper group &22f0 88 DEY &22f1 10 e2 BPL &22d5 ; plot_sprite_or_randomness_loop &22f3 60 RTS ; write_string &22f4 bd 7f 25 LDA &257f,X ; strings &22f7 20 ee ff JSR &ffee ; OSWRCH &22fa e8 INX &22fb 88 DEY &22fc d0 f6 BNE &22f4 ; write_string &22fe 60 RTS ; sprite_data ; sprite 0 &22ff 33 77 bb 33 77 33 73 3b 77 33 33 33 33 b7 33 3b &230f 33 77 b3 3b b3 33 33 73 73 33 3b b3 3b 33 77 3b ; sprite 1 &231f f1 f5 fa fa ff ff ff ff f3 f3 f3 f7 f1 f1 fa fa &232f 13 13 a7 a3 f3 fb f3 f3 33 33 33 33 5b 13 a3 a7 ; sprite 2 &233f 33 77 33 33 63 63 d7 d3 63 63 d3 db f7 f3 f3 f3 &234f f3 f3 fb f3 f6 f6 fd fd f6 f6 fd fd ff ff ff ff ; sprite 3 &235f 3d 7d 36 36 37 33 7b 33 3f 3f 3f bf 7d 3d 36 3e &236f df df ef 6f 3f 3f 3f 7f ff ff ff ff df df 6f 6f ; sprite 4 &237f ff ff ff ff af af 5f 1f af af 1f 1f 7f 3f 3f 3f &238f 3f 3f bf 3f 3a 3a 31 71 3a 3a 31 31 7b 33 33 37 ; sprite 5 &239f ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff &23af ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ; sprite 6 &23bf 11 55 11 11 55 11 51 11 77 33 33 33 33 b7 33 3b &23cf 33 77 b3 3b b3 33 33 73 73 33 3b b3 3b 33 77 3b ; sprite 7 &23df 11 55 11 11 41 41 d5 d1 63 63 d3 db f7 f3 f3 f3 &23ef f3 f3 fb f3 f6 f6 fd fd f6 f6 fd fd ff ff ff ff ; sprite 8 &23ff dd dd dd dd dd dd dd dd ff ff ff ff ff ff ff ff &240f ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ; sprite 9 &241f dd dd dd dd 8d 8d 5d 1d af af 1f 1f 7f 3f 3f 3f &242f 3f 3f bf 3f 3a 3a 31 71 3a 3a 31 31 7b 33 33 37 ; logo_data &243f 00 00 00 00 00 00 02 06 00 00 00 00 02 06 00 00 02 06 00 00 &244f 00 00 00 00 00 02 04 00 02 06 00 02 05 06 00 02 04 00 00 00 &245f 00 00 00 00 02 04 02 06 08 06 02 04 09 00 02 04 00 00 00 00 &246f 00 00 00 00 08 07 04 00 08 06 08 07 01 00 08 07 06 00 00 00 &247f 00 00 00 00 08 04 00 00 08 06 08 04 08 06 08 04 02 06 00 00 &248f 00 00 00 00 08 06 00 00 08 06 08 06 08 06 08 07 04 00 00 00 &249f 00 00 00 00 08 06 00 00 08 06 08 06 09 00 08 04 00 00 00 00 &24af 00 00 00 00 09 00 00 00 09 00 09 00 00 00 09 00 00 00 00 00 &24bf 00 00 00 02 06 00 02 06 00 00 02 06 00 00 02 06 00 00 02 06 &24cf 00 00 02 04 00 02 05 06 00 02 05 06 00 02 05 06 00 00 08 06 &24df 00 02 05 06 02 04 09 00 02 04 08 06 02 04 09 00 02 06 09 00 &24ef 00 09 08 06 08 07 01 00 08 07 05 06 08 06 02 06 08 07 05 06 &24ff 00 00 08 06 08 04 08 06 08 04 08 06 08 06 08 06 08 04 08 06 &250f 00 00 08 06 08 06 08 06 08 06 08 06 08 07 04 00 08 06 09 00 &251f 00 00 08 06 08 06 09 00 08 06 09 00 08 04 00 00 08 06 00 00 &252f 00 00 09 00 09 00 00 00 09 00 00 00 09 00 00 00 09 00 00 00 ; strings ; mode2_title_string &257f 16 02 # MODE 2 &2581 17 00 0a 20 00 00 00 00 00 00 # Set R10 = &20 (Cursor start register; disable cursor) &258b 13 00 01 00 00 00 # Set colour 0 to red &2591 13 01 01 00 00 00 # Set colour 1 to red &2597 13 02 05 00 00 00 # Set colour 2 to magenta &259d 13 03 05 00 00 00 # Set colour 3 to magenta ; colour_two_to_cyan_string &25a3 13 02 06 00 00 00 # Set colour 2 to cyan ; colour_two_to_white_string &25a9 13 00 00 00 00 00 # Set colour 0 to black &25af 13 02 07 00 00 00 # Set colour 2 to white ; mode2_game_string &25b5 16 02 # MODE 2 &25b7 1e # HOME &25b8 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b # Cursor up x25 &25c8 0b 0b 0b 0b 0b 0b 0b 0b 0b &25d1 1c 00 18 13 00 # Text window: x(&00, &13), y(&00, &18) &25d6 17 00 04 25 00 00 00 00 00 00 # Set R4 = &25 (Vertical total register) &25e0 17 00 05 08 00 00 00 00 00 00 # Set R5 = &08 (Vertical total adjust register) &25ea 17 00 06 19 00 00 00 00 00 00 # Set R6 = &19 (Vertical displayed register) &25f4 17 00 07 1f 00 00 00 00 00 00 # Set R7 = &1f (Vertical sync position) ; mode7_string &25fe 16 07 # MODE 7 &2600 17 00 01 32 00 00 00 00 00 00 # Set R1 = &32 (Horizontal displayed register) &260a 17 00 06 12 00 00 00 00 00 00 # Set R6 = &12 (Vertical displayed register) &2614 17 00 02 3a 00 00 00 00 00 00 # Set R2 = &3a (Horizontal sync position register) &261e 17 00 07 18 00 00 00 00 00 00 # Set R7 = &18 (Vertical sync position) &2628 17 00 0a 20 00 00 00 00 00 00 # Set R10 = &20 (Cursor start register; disable cursor) &2632 17 00 0c 28 00 00 00 00 00 00 # Set R12 = &28 (Displayed screen start address (high)) &263c 17 00 0d 74 00 00 00 00 00 00 # Set R13 = &74 (Displayed screen start address (low)) &2646 1c 03 07 27 02 # Text window: x(&03, &27), y(&02, &07) ; credits &1200 64 3f 7c 2f 7c 00 ; wait &64 after, &7c3f/&7c2f, blank &1206 4b a6 7d 50 7d 9c ; wait &4b after, &7da6/&7d50, double, length &1c &120c 8d 45 6c 65 63 74 72 69 63 20 20 44 72 65 61 6d ; "Electric Dreams presents" &121c 73 20 20 20 70 72 65 73 65 6e 74 73 &1228 4b 3b 7e c7 7d 1e ; wait &4b after, &7e3b/&7dc7, length &1e &122e 41 20 53 6f 66 74 77 61 72 65 20 53 74 75 64 69 ; "A Software Studios Production" &123e 6f 73 20 20 50 72 6f 64 75 63 74 69 6f 6e &124c e1 a1 7e 19 7e 1a ; wait &e1 after, &7ea1/&7e19, length &1a &1252 28 43 29 20 31 39 38 37 20 41 61 72 64 76 61 72 ; "(C) 1987 Aardvark Software" &1262 6b 20 53 6f 66 74 77 61 72 65 &126c 05 97 7e 0f 7e 00 ; wait &05 after, &7e97/&7e0f, blank &1272 05 33 7e bf 7d 00 ; wait &05 after, &7e33/&7dbf, blank &1278 4b 9d 7d 47 7d 80 ; wait &4b after, &7d9d/&7d47, double, blank &127e fa d5 7d 75 7d a1 ; wait &fa after, &75d5/&7d75, double, length &21 &1284 8d 41 20 43 6f 6d 70 75 74 65 72 20 53 63 72 65 ; "A Computer Screenplay by Orlando" &1294 65 6e 70 6c 61 79 20 62 79 87 4f 72 6c 61 6e 64 &12a4 6f &12a5 a0 cf 7d 6f 7d 80 ; wait &a0 after, &7dcf/&7d6f, double, blank &12ab 5f aa 7d 54 7d 93 ; wait &5f after, &7daa/&7d54, double, length &13 &12b1 8d 87 46 20 69 20 72 20 65 20 54 20 72 20 61 20 ; "F i r e T r a c k" &12c1 63 20 6b &12c4 c8 3a 7e c6 7d 1f ; wait &c8 after, &7e3a/&7dc6, length &1f &12ca 87 2d 20 53 65 61 72 63 68 20 66 6f 72 20 74 68 ; "- Search for the White Light -" &12da 65 20 57 68 69 74 65 20 4c 69 67 68 74 20 2d &12e9 fa 9e 7f e4 7e 14 ; wait &fa after, &7f9e/&7ee4, length &14 &12ef 52 65 6c 65 61 73 65 20 56 65 72 73 69 6f 6e 20 ; "Release Version 1.00" &12ff 31 2e 30 30 &1303 00 3f 7c 2f 7c 00 ; end of credits, &7c3f/&7c2f, blank ; wait_for_event &2754 a5 30 LDA &30 ; vsync_counter ; wait_for_event_loop &2756 c5 30 CMP &30 ; vsync_counter &2758 f0 fc BEQ &2756 ; wait_for_event_loop &275a 60 RTS ; shrink_mode2_screen &275b a2 00 LDX #&00 &275d a0 30 LDY #&30 ; &3000 = address of top left of screen &275f 84 81 STY &81 ; left_screen_address_high &2761 86 80 STX &80 ; left_screen_address_low &2763 a2 78 LDX #&78 &2765 a0 32 LDY #&32 ; &3278 = address of top right of screen &2767 84 83 STY &83 ; right_screen_address_high &2769 86 82 STX &82 ; right_screen_address_low &276b a9 28 LDA #&28 &276d 85 84 STA &84 ; columns ; shrink_mode2_screen_loop &276f a4 81 LDY &81 ; left_screen_address_high &2771 a6 80 LDX &80 ; left_screen_address_low &2773 84 7d STY &7d ; screen_address_high &2775 86 7c STX &7c ; screen_address_low &2777 a4 83 LDY &83 ; right_screen_address_high &2779 a6 82 LDX &82 ; right_screen_address_low &277b 84 7f STY &7f ; second_screen_address_high &277d 86 7e STX &7e ; second_screen_address_low &277f a2 20 LDX #&20 &2781 20 54 27 JSR &2754 ; wait_for_event ; wipe_column_loop &2784 a9 00 LDA #&00 &2786 a0 07 LDY #&07 ; wipe_group_loop &2788 91 7c STA (&7c),Y ; screen_address &278a 91 7e STA (&7e),Y &278c 88 DEY &278d 10 f9 BPL &2788 ; wipe_group_loop &278f 18 CLC &2790 a5 7c LDA &7c ; screen_address_low &2792 69 80 ADC #&80 &2794 85 7c STA &7c ; screen_address_low &2796 a5 7d LDA &7d ; screen_address_high &2798 69 02 ADC #&02 &279a 85 7d STA &7d ; screen_address_high &279c a5 7e LDA &7e ; second_screen_address_low &279e 69 80 ADC #&80 &27a0 85 7e STA &7e ; second_screen_address_low &27a2 a5 7f LDA &7f ; second_screen_address_high &27a4 69 02 ADC #&02 &27a6 85 7f STA &7f ; second_screen_address_high &27a8 ca DEX &27a9 d0 d9 BNE &2784 ; wipe_column_loop &27ab c6 84 DEC &84 ; columns &27ad f0 17 BEQ &27c6 ; leave &27af a5 80 LDA &80 ; left_screen_address_low &27b1 69 08 ADC #&08 &27b3 85 80 STA &80 ; left_screen_address_low &27b5 90 02 BCC &27b9 &27b7 e6 81 INC &81 ; left_screen_address_high &27b9 38 SEC &27ba a5 82 LDA &82 ; right_screen_address_low &27bc e9 08 SBC #&08 &27be 85 82 STA &82 ; right_screen_address_low &27c0 b0 ad BCS &276f ; shrink_mode2_screen_loop &27c2 c6 83 DEC &83 ; right_screen_address_high &27c4 90 a9 BCC &276f ; shrink_mode2_screen_loop ; leave &27c6 60 RTS ; expand_mode7_screen &27c7 a0 00 LDY #&00 &27c9 a9 91 LDA #&91 ; FOREGROUND_GRAPHICS_RED &27cb 20 27 28 JSR &2827 ; add_character_to_all_rows ; set_middle_of_screen &27ce a2 18 LDX #&18 # also LDX #&13 ; for master version ; fill_screen_loop &27d0 20 54 27 JSR &2754 ; wait_for_event &27d3 8a TXA &27d4 a8 TAY &27d5 f0 05 BEQ &27dc ; skip_left_side &27d7 a9 6a LDA #&6a ; "j" (all three right pixels set) &27d9 20 27 28 JSR &2827 ; add_character_to_all_rows ; skip_left_side &27dc 86 7c STX &7c ; x ; set_right_side_of_screen &27de a9 31 LDA #&31 # also LDA #&27 ; for master version &27e0 e5 7c SBC &7c ; x &27e2 a8 TAY &27e3 a9 35 LDA #&35 ; "5" (all three left pixels set) &27e5 20 27 28 JSR &2827 ; add_character_to_all_rows &27e8 20 54 27 JSR &2754 ; wait_for_event &27eb 8a TXA &27ec a8 TAY &27ed f0 05 BEQ &27f4 &27ef a9 ff LDA #&ff ; (all pixels set) &27f1 20 27 28 JSR &2827 ; add_character_to_all_rows &27f4 86 7c STX &7c ; x ; set_right_side_of_screen_two &27f6 a9 31 LDA #&31 # also LDA #&27 ; for master version &27f8 e5 7c SBC &7c ; x &27fa a8 TAY &27fb a9 ff LDA #&ff ; (all pixels set) &27fd 20 27 28 JSR &2827 ; add_character_to_all_rows &2800 ca DEX &2801 10 cd BPL &27d0 ; fill_screen_loop &2803 20 54 27 JSR &2754 ; wait_for_event &2806 a9 81 LDA #&81 ; FOREGROUND_TEXT_RED &2808 a0 02 LDY #&02 &280a 20 27 28 JSR &2827 ; add_character_to_all_rows &280d a9 9d LDA #&9d ; NEW_BACKGROUND &280f 88 DEY &2810 20 27 28 JSR &2827 ; add_character_to_all_rows &2813 a9 81 LDA #&81 ; FOREGROUND_TEXT_RED &2815 88 DEY &2816 20 27 28 JSR &2827 ; add_character_to_all_rows ; set_width_of_screen &2819 a0 31 LDY #&31 # also LDY #&27 ; for master version ; wipe_screen_loop &281b a9 00 LDA #&00 &281d 20 27 28 JSR &2827 ; add_character_to_all_rows &2820 88 DEY &2821 c0 03 CPY #&03 &2823 b0 f6 BCS &281b ; wipe_screen_loop &2825 a9 83 LDA #&83 ; FOREGROUND_TEXT_YELLOW ; add_character_to_all_rows &2827 85 7c STA &7c ; character &2829 a9 14 LDA #&14 &282b 85 7d STA &7d ; rows &282d a9 10 LDA #&10 &282f 85 7e STA &7e ; screen_address_low &2831 a9 7c LDA #&7c ; &7c10 &2833 85 7f STA &7f ; screen_address_high ; add_character_to_all_rows_loop &2835 a5 7c LDA &7c ; character &2837 91 7e STA (&7e),Y ; screen_address &2839 c6 7d DEC &7d ; rows &283b f0 0d BEQ &284a ; leave &283d 18 CLC &283e a5 7e LDA &7e ; screen_address_low ; move_to_next_row &2840 69 32 ADC #&32 # also ADC #&28 ; for master version &2842 85 7e STA &7e ; screen_address_low &2844 90 ef BCC &2835 ; add_character_to_all_rows_loop &2846 e6 7f INC &7f ; screen_address_high &2848 b0 eb BCS &2835 ; add_character_to_all_rows_loop ; leave &284a 60 RTS ; initialise_sound &284b a2 3d LDX #&3d &284d a0 29 LDY #&29 ; &293d = channel_tables_addresses_table &284f a9 08 LDA #&08 &2851 84 7d STY &7d ; channel_tables_addresses_address_high &2853 86 7c STX &7c ; channel_tables_addresses_address_low &2855 85 77 STA &77 ; maximum_channel_times_two &2857 a2 00 LDX #&00 ; populate_channel_tables_addresses_loop &2859 8a TXA &285a a8 TAY &285b b1 7c LDA (&7c),Y ; channel_tables_addresses # Get two bytes from the master table &285d 95 60 STA &60,X ; channel_tables_address_low &285f 85 7e STA &7e ; this_channel_tables_address_low &2861 c8 INY &2862 b1 7c LDA (&7c),Y ; channel_tables_addresses # for the address of the table for this channel &2864 95 61 STA &61,X ; channel_tables_address_high &2866 85 7f STA &7f ; this_channel_tables_address_high &2868 a0 00 LDY #&00 &286a b1 7e LDA (&7e),Y ; this_channel_tables # Get one byte from the channel table for pitch shift &286c 95 49 STA &49,X ; channels_pitch_shift &286e c8 INY &286f b1 7e LDA (&7e),Y ; this_channel_tables # Get two bytes from the channel table &2871 95 54 STA &54,X ; channels_notes_address_low &2873 c8 INY &2874 b1 7e LDA (&7e),Y ; this_channel_tables # for the address of the notes table for this channel &2876 95 55 STA &55,X ; channels_notes_address_high &2878 c8 INY &2879 b1 7e LDA (&7e),Y ; this_channel_tables # Get one byte from the channel table for possibly_envelope &287b 95 6c STA &6c,X ; channels_envelope_and_channel &287d a9 04 LDA #&04 # Channel starts at beginning of bar table &287f 95 3d STA &3d,X ; channels_bar_offset &2881 e8 INX &2882 e8 INX &2883 e4 77 CPX &77 ; maximum_channel_times_two &2885 90 d2 BCC &2859 ; populate_channel_tables_addresses_loop &2887 a4 77 LDY &77 ; maximum_channel_times_two &2889 b1 7c LDA (&7c),Y ; some_table_address # Get a byte from the master table for the master bar &288b 85 78 STA &78 ; initial_master_bar_number # number (counts down to zero, marking end of music) &288d 85 79 STA &79 ; master_bar_number &288f e6 79 INC &79 ; master_bar_number &2891 a9 fe LDA #&fe &2893 85 3a STA &3a ; master_note_number # Used to change master bar number every twelve beats &2895 a9 00 LDA #&00 &2897 85 3b STA &3b ; music_cooldown &2899 ad 10 06 LDA &0610 ; previous_event_vector_low &289c 2d 11 06 AND &0611 ; previous_event_vector_high &289f c9 ff CMP #&ff &28a1 d0 75 BNE &2918 ; skip_music_initialisation # If the music hasn't already been initialised, &28a3 a9 08 LDA #&08 ; Define a sound envelope # set up envelopes &28a5 a2 47 LDX #&47 &28a7 a0 29 LDY #&29 ; &2947 = envelope_1 &28a9 20 f1 ff JSR &fff1 ; OSWORD &28ac a2 55 LDX #&55 &28ae a0 29 LDY #&29 ; &2955 = envelope_2 &28b0 20 f1 ff JSR &fff1 ; OSWORD &28b3 a2 63 LDX #&63 &28b5 a0 29 LDY #&29 ; &2963 = envelope_3 &28b7 20 f1 ff JSR &fff1 ; OSWORD &28ba a2 71 LDX #&71 &28bc a0 29 LDY #&29 ; &2971 = envelope_4 &28be 20 f1 ff JSR &fff1 ; OSWORD &28c1 a2 7f LDX #&7f &28c3 a0 29 LDY #&29 ; &297f = envelope_5 &28c5 20 f1 ff JSR &fff1 ; OSWORD &28c8 a2 8d LDX #&8d &28ca a0 29 LDY #&29 ; &298d = envelope_6 &28cc 20 f1 ff JSR &fff1 ; OSWORD &28cf a2 9b LDX #&9b &28d1 a0 29 LDY #&29 ; &299b = envelope_7 &28d3 20 f1 ff JSR &fff1 ; OSWORD &28d6 a2 a9 LDX #&a9 &28d8 a0 29 LDY #&29 ; &29a9 = envelope_8 &28da 20 f1 ff JSR &fff1 ; OSWORD &28dd a2 b7 LDX #&b7 &28df a0 29 LDY #&29 ; &29b7 = envelope_9 &28e1 20 f1 ff JSR &fff1 ; OSWORD &28e4 a2 c5 LDX #&c5 &28e6 a0 29 LDY #&29 ; &29c5 = envelope_10 &28e8 20 f1 ff JSR &fff1 ; OSWORD &28eb a2 d3 LDX #&d3 &28ed a0 29 LDY #&29 ; &29d3 = envelope_11 &28ef 20 f1 ff JSR &fff1 ; OSWORD &28f2 a2 e1 LDX #&e1 &28f4 a0 29 LDY #&29 ; &29e1 = envelope_12 &28f6 20 f1 ff JSR &fff1 ; OSWORD &28f9 a2 ef LDX #&ef &28fb a0 29 LDY #&29 ; &29ef = envelope_14 &28fd 20 f1 ff JSR &fff1 ; OSWORD &2900 ac 21 02 LDY &0221 ; event_vector_high &2903 ae 20 02 LDX &0220 ; event_vector_low &2906 8c 11 06 STY &0611 ; previous_event_vector_high &2909 8e 10 06 STX &0610 ; previous_event_vector_low &290c 78 SEI &290d a2 c6 LDX #&c6 &290f a0 04 LDY #&04 ; &04c6 = event_routine &2911 8c 21 02 STY &0221 ; event_vector_high # Set up the event vector routine &2914 8e 20 02 STX &0220 ; event_vector_low &2917 58 CLI ; skip_music_initialisation &2918 a9 07 LDA #&07 ; Generate a sound # Play sounds for logo screen &291a a2 fd LDX #&fd &291c a0 29 LDY #&29 ; &29fd = sound_0 &291e 20 f1 ff JSR &fff1 ; OSWORD &2921 a2 05 LDX #&05 &2923 a0 2a LDY #&2a ; &2a05 = sound_1 &2925 20 f1 ff JSR &fff1 ; OSWORD &2928 a2 0d LDX #&0d &292a a0 2a LDY #&2a ; &2a0d = sound_2 &292c 20 f1 ff JSR &fff1 ; OSWORD &292f a2 15 LDX #&15 &2931 a0 2a LDY #&2a ; &2a15 = sound_3 &2933 20 f1 ff JSR &fff1 ; OSWORD &2936 a9 0e LDA #&0e ; Enable Event &2938 a2 04 LDX #&04 ; vsync event &293a 4c f4 ff JMP &fff4 ; OSBYTE ; channel_tables_addresses_table &293d 70 06 ; &0670 = channel_zero_tables &293f 8c 0b ; &0b8c = channel_one_tables &2942 f9 0b ; &0bf9 = channel_two_tables &2943 66 0c ; &0c66 = channel_three_tables ; initial bar number &2945 69 ; unused &2946 07 ; envelope_1 ; used for music, percussion &2947 01 01 04 00 00 02 07 07 69 fe f6 f6 64 5a ; envelope_2 ; used for music, percussion &2955 02 01 04 ff 00 01 01 06 70 f9 f2 fc 76 54 ; envelope_3 ; used for music, percussion &2963 03 01 04 00 00 01 5a 5a 03 08 92 92 2d 6e ; envelope_4 ; used for music, percussion &2971 04 01 01 ff 00 02 01 01 78 fa ec fb 78 50 ; envelope_5 ; used for music, channel 1 &297f 05 01 00 00 01 04 04 01 50 08 fe fd 50 6e ; envelope_6 ; unused &298d 06 02 00 ff 01 04 01 02 0c fb fd fd 64 56 ; envelope_7 ; used for music, percussion &299b 07 01 ff 00 00 02 0a 0a 64 ce ce ce 64 0a ; envelope_8 ; used for music, percussion &29a9 08 01 ff 00 00 01 0a 0a 5a 0a ec ec 5a 6e ; envelope_9 ; used for music, channel 3 &29b7 09 01 01 ff 00 01 01 06 05 0f ff fd 14 5a ; envelope_10 ; unused &29c5 0a 01 00 01 ff 09 01 01 37 fb fe fe 6e 28 ; envelope_11 ; used for music, channel 2 &29d3 0b 01 00 20 00 03 01 02 32 fe ff fe 64 28 ; envelope_12 ; used for initial buzz, channel 0 &29e1 0c 08 00 01 fe 01 01 01 02 03 ff ff 46 78 ; envelope_14 ; used for initial buzz, channels 1-3 &29ef 0e 08 00 00 00 01 01 01 02 03 ff ff 46 78 ; sound_0 &29fd 10 00 0c 00 01 00 ff ff ; sound_1 &2a05 11 00 0e 00 03 00 ff ff ; sound_2 &2a0d 12 00 0e 00 03 00 ff ff ; sound_3 &2a15 13 00 0e 00 03 00 ff ff ; moved to 0492 ; row_multiplication_table &0492 00 00 00 32 00 64 00 96 00 c8 00 fa 01 2c 01 5e &04a2 01 90 01 c2 01 f4 02 26 02 58 02 8a 02 bc 02 ee &04b2 03 20 03 52 03 84 03 b6 ; run_ftrack_string &04ba 52 55 4e 20 21 46 54 72 61 63 6b 0d ; "RUN !FTrack" ; event_routine &04c6 08 PHP &04c7 78 SEI &04c8 d8 CLD &04c9 48 PHA &04ca c9 04 CMP #&04 &04cc f0 03 BEQ &04d1 ; event_4 &04ce 4c 51 05 JMP &0551 ; to_leave_event_routine ; event_4 &04d1 e6 30 INC &30 ; vsync_counter &04d3 24 35 BIT &35 ; credits_active &04d5 10 76 BPL &054d ; skip_updating_credits &04d7 c6 29 DEC &29 ; credits_cooldown &04d9 d0 72 BNE &054d ; skip_updating_credits &04db 8a TXA &04dc 48 PHA &04dd 98 TYA &04de 48 PHA &04df a0 00 LDY #&00 &04e1 b1 33 LDA (&33),Y ; credits_address # Get a byte of credit data for next cooldown &04e3 d0 04 BNE &04e9 ; set_credits_cooldown &04e5 85 35 STA &35 ; credits_active &04e7 f0 60 BEQ &0549 ; leave_after_restoring_x_and_y ; set_credits_cooldown &04e9 85 29 STA &29 ; credits_cooldown &04eb 18 CLC &04ec 24 2a BIT &2a ; is_master &04ee 30 0a BMI &04fa ; master_version &04f0 c8 INY &04f1 b1 33 LDA (&33),Y ; credits_address # Byte two is low byte of screen address for BBC &04f3 85 2e STA &2e ; screen_address_low &04f5 69 32 ADC #&32 &04f7 4c 02 05 JMP &0502 ; set_second_address ; master_version &04fa a0 03 LDY #&03 &04fc b1 33 LDA (&33),Y ; credits_address # Byte four is low byte of screen address for Master &04fe 85 2e STA &2e ; screen_address_low &0500 69 28 ADC #&28 ; set_second_address &0502 85 2c STA &2c ; text_second_screen_address_low &0504 c8 INY &0505 b1 33 LDA (&33),Y ; credits_address # Bytes three and five are high bytes of screen address &0507 85 2f STA &2f ; screen_address_high &0509 69 00 ADC #&00 &050b 85 2d STA &2d ; text_second_screen_address_high &050d a0 05 LDY #&05 &050f b1 33 LDA (&33),Y ; credits_address # Byte six sets double height and length of line &0511 85 38 STA &38 ; double_height &0513 c8 INY &0514 29 3f AND #&3f &0516 aa TAX &0517 d0 18 BNE &0531 ; not_blank # If length is zero, blank the line ; set_length_of_blank_line &0519 a2 2f LDX #&2f # also LDX #&25 ; for master version &051b 24 2a BIT &2a ; is_master &051d 10 02 BPL &0521 ; not_master &051f a0 0c LDY #&0c ; not_master ; blank_loop &0521 91 2e STA (&2e),Y ; screen_address &0523 24 38 BIT &38 ; double_height &0525 10 02 BPL &0529 ; not_double_height_blank &0527 91 2c STA (&2c),Y ; text_second_screen_address ; not_double_height_blank &0529 c8 INY &052a ca DEX &052b d0 f4 BNE &0521 ; blank_loop &052d a0 06 LDY #&06 &052f d0 0e BNE &053f ; finished_line ; not_blank ; not_blank_loop # If length is non-zero, write that many characters &0531 b1 33 LDA (&33),Y ; credits_address &0533 91 2e STA (&2e),Y ; screen_address &0535 24 38 BIT &38 ; double_height &0537 10 02 BPL &053b ; not_double_height &0539 91 2c STA (&2c),Y ; text_second_screen_address ; not_double_height &053b c8 INY &053c ca DEX &053d d0 f2 BNE &0531 ; not_blank_loop ; finished_line &053f 18 CLC &0540 98 TYA &0541 65 33 ADC &33 ; credits_address_low &0543 85 33 STA &33 ; credits_address_low &0545 90 02 BCC &0549 &0547 e6 34 INC &34 ; credits_address_high ; leave_after_restoring_x_and_y &0549 68 PLA &054a a8 TAY &054b 68 PLA &054c aa TAX ; skip_updating_credits &054d c6 3b DEC &3b ; music_cooldown &054f 30 03 BMI &0554 ; update_music ; to_leave_event_routine &0551 4c 0d 06 JMP &060d ; leave_event_routine ; update_music &0554 a5 ef LDA &ef ; Accumulator value for most recent OSBYTE/OSWORD &0556 48 PHA &0557 a5 f0 LDA &f0 ; X reg for most recent OSBYTE/OSWORD &0559 48 PHA &055a a5 f1 LDA &f1 ; Y reg for most recent OSBYTE/OSWORD &055c 48 PHA &055d 8a TXA &055e 48 PHA &055f 98 TYA &0560 48 PHA &0561 a9 07 LDA #&07 &0563 85 3b STA &3b ; music_cooldown &0565 a9 81 LDA #&81 ; Scan for a particular key &0567 a2 ae LDX #&ae ; S &0569 a0 ff LDY #&ff &056b 20 f4 ff JSR &fff4 ; OSBYTE &056e 86 38 STX &38 ; s_pressed &0570 a9 81 LDA #&81 ; Scan for a particular key &0572 a2 ef LDX #&ef ; Q &0574 a0 ff LDY #&ff &0576 20 f4 ff JSR &fff4 ; OSBYTE &0579 86 39 STX &39 ; q_pressed &057b 8a TXA &057c 45 38 EOR &38 ; s_pressed &057e 10 02 BPL &0582 ; skip_change_of_mute &0580 86 36 STX &36 ; music_muted # Mute music if Q pressed, unmute if S pressed ; skip_change_of_mute &0582 e6 3a INC &3a ; master_note_number &0584 a5 3a LDA &3a ; master_note_number &0586 c9 0c CMP #&0c &0588 90 31 BCC &05bb ; play_channels # Is this the end of a bar? &058a c6 79 DEC &79 ; master_bar_number &058c d0 10 BNE &059e ; not_restarting_music # If so, is is the end of the music? &058e a5 78 LDA &78 ; initial_master_bar_number &0590 85 79 STA &79 ; master_bar_number &0592 a2 00 LDX #&00 &0594 a9 04 LDA #&04 ; reset_channel_bar_offsets_loop &0596 95 3d STA &3d,X ; channels_bar_offset # Return to first bar in channel table &0598 e8 INX &0599 e8 INX &059a e4 77 CPX &77 ; maximum_channel_times_two &059c 90 f8 BCC &0596 ; reset_channel_bar_offsets_loop ; not_restarting_music # At the start of a bar, &059e a2 00 LDX #&00 &05a0 86 3a STX &3a ; master_note_number ; reset_channels_loop # For each channel, &05a2 a9 00 LDA #&00 &05a4 95 48 STA &48,X ; channel_cooldown &05a6 b4 3d LDY &3d,X ; channels_bar_offset &05a8 f6 3d INC &3d,X ; channels_bar_offset # Move to next bar for this channel &05aa 8a TXA &05ab 18 CLC &05ac 69 60 ADC #&60 ; channels_tables &05ae 8d b2 05 STA &05b2 &05b1 b1 60 LDA (&60),Y ; channel_tables # Get offset in note table of start of this bar # actually LDA (this_channel_table),Y &05b3 95 3c STA &3c,X ; channels_note_offset &05b5 e8 INX &05b6 e8 INX &05b7 e4 77 CPX &77 ; maximum_channel_times_two &05b9 90 e7 BCC &05a2 ; reset_channels_loop ; play_channels &05bb a2 00 LDX #&00 ; channel_loop # For each channel, &05bd d6 48 DEC &48,X ; channel_cooldown &05bf 10 39 BPL &05fa ; skip_channel_without_pla &05c1 b4 3c LDY &3c,X ; channels_note_offset &05c3 f6 3c INC &3c,X ; channels_note_offset # Move to next note for this channel &05c5 8a TXA &05c6 48 PHA &05c7 18 CLC &05c8 69 54 ADC #&54 ; channels_notes &05ca 8d ce 05 STA &05ce &05cd b1 54 LDA (&54),Y ; channels_notes # Get a note from the channel's note table # actually LDA (&54 + channel * 2) ; this_channel_notes &05cf b4 49 LDY &49,X ; channels_pitch_shift &05d1 c0 ff CPY #&ff &05d3 f0 3d BEQ &0612 ; play_percussion # If this isn't percussion, &05d5 48 PHA &05d6 29 03 AND #&03 &05d8 95 48 STA &48,X ; channel_cooldown # Low two bits set time to next note &05da 68 PLA &05db c9 fc CMP #&fc &05dd b0 19 BCS &05f8 ; skip_channel # If top six bits are set, note is silence &05df 29 fc AND #&fc # Otherwise, top six bits set pitch &05e1 8c e5 05 STY &05e5 &05e4 69 00 ADC #&00 # actually ADC #this_channel_pitch_shift &05e6 a8 TAY &05e7 b5 6c LDA &6c,X ; channels_envelope_and_channel # From the envelope and channel byte for the channel, &05e9 48 PHA &05ea 29 0f AND #&0f &05ec 8d 6a 06 STA &066a ; sound_music_volume # Low four bits set envelope and thus duration &05ef 68 PLA &05f0 38 SEC &05f1 6a ROR A # High four bits set channel, flush set &05f2 4a LSR A &05f3 4a LSR A &05f4 4a LSR A ; play_sound_and_continue_channel_loop &05f5 20 2b 06 JSR &062b ; play_sound ; skip_channel &05f8 68 PLA &05f9 aa TAX ; skip_channel_without_pla &05fa e8 INX &05fb e8 INX &05fc e4 77 CPX &77 ; maximum_channel_times_two &05fe 90 bd BCC &05bd ; channel_loop &0600 68 PLA &0601 a8 TAY &0602 68 PLA &0603 aa TAX &0604 68 PLA &0605 85 f1 STA &f1 ; Y reg for most recent OSBYTE/OSWORD &0607 68 PLA &0608 85 f0 STA &f0 ; X reg for most recent OSBYTE/OSWORD &060a 68 PLA &060b 85 ef STA &ef ; Accumulator value for most recent OSBYTE/OSWORD ; leave_event_routine &060d 68 PLA &060e 28 PLP &060f 4c ff ff JMP &ffff # actually JMP previous_event_vector ; play_percussion # If this is percussion, &0612 48 PHA &0613 29 0f AND #&0f # Low four bits set time to next note &0615 95 48 STA &48,X ; channel_cooldown &0617 68 PLA &0618 4a LSR A &0619 4a LSR A &061a 4a LSR A &061b 4a LSR A &061c f0 da BEQ &05f8 ; skip_channel # If high four bits are zero, note is silence &061e 8d 6a 06 STA &066a ; sound_music_volume # Otherwise, high four bits are envelope and duration &0621 a8 TAY &0622 b9 5c 06 LDA &065c,Y ; percussion_pitch_table - 1 # High four bits also set noise type &0625 a8 TAY &0626 a9 10 LDA #&10 # Channel 0 with flush set &0628 4c f5 05 JMP &05f5 ; play_sound_and_continue_channel_loop ; play_sound &062b 8d 68 06 STA &0668 ; sound_music_channel # A is the channel &062e 29 03 AND #&03 &0630 09 04 ORA #&04 &0632 aa TAX # X is used for flushing buffer &0633 8c 6c 06 STY &066c ; sound_music_pitch # Y is the pitch &0636 ac 6a 06 LDY &066a ; sound_music_volume &0639 b9 51 06 LDA &0651,Y ; envelope_duration_table - 1 # Volume (envelope) is used as lookup for duration &063c 8d 6e 06 STA &066e ; sound_music_duration &063f a9 15 LDA #&15 ; Flush Selected Buffer &0641 20 f4 ff JSR &fff4 ; OSBYTE # Flush buffer corresponding to channel &0644 24 36 BIT &36 ; music_muted &0646 30 09 BMI &0651 ; leave &0648 a9 07 LDA #&07 ; Generate a sound &064a a2 68 LDX #&68 &064c a0 06 LDY #&06 ; &0668 = sound_music &064e 4c f1 ff JMP &fff1 ; OSWORD ; leave &0651 60 RTS ; envelope_duration_table ; 1 2 3 4 5 6 7 8 9 a b ; P P P P C1 P P C2 C3 &0652 03 02 07 03 02 07 02 03 03 04 04 ; percussion_pitch_table ; 1 2 3 4 5 6 7 8 &065d 06 01 00 04 00 00 06 05 ; unused &0665 00 00 00 ; sound_music ; chan vol pitch dur &0668 10 00 00 00 02 00 04 00 ; channel_zero_tables &0670 ff ; percussion &0671 dd 06 ; &06dd = channel_zero_notes &0672 01 ; channel 0 ; channel_zero_bars &0673 00 00 00 00 00 00 00 6e 78 7b 07 0d 62 28 07 0d &0683 07 15 07 62 01 21 07 0d 07 15 07 0d 07 21 07 0d &0693 07 15 28 34 28 3f 07 0d 28 21 58 5b 6b 28 6b 5b &06a3 01 28 07 0d 01 21 62 0d 62 15 07 62 62 21 78 78 &06b3 78 7b 78 7b 01 21 28 34 28 3f 28 34 07 21 78 7b &06c3 07 6e 0d 6e 07 15 07 15 15 21 62 15 15 48 53 6e &06d3 62 21 15 48 78 15 48 55 00 ; channel_zero_notes &06dd 0b ; bar &00 &06de 72 72 72 80 70 70 ; bar &01 &06e4 12 21 10 12 21 10 ; bar &07 &06ea 12 21 10 11 10 20 10 20 ; bar &0d &06f2 20 20 10 20 20 10 20 20 10 20 20 20 ; bar &15 &06fe 31 31 31 32 20 20 20 ; bar &12 &0705 10 70 70 20 10 20 10 70 70 20 20 20 ; bar &28 &0711 10 70 70 20 70 11 70 70 20 10 20 ; bar &34 &071c 41 41 41 40 70 70 20 20 10 ; bar &3f &0725 10 80 70 20 80 70 10 70 70 31 40 ; bar &48 &0730 01 49 ; bar &53 &0732 01 42 46 ; bar &55 &0735 07 20 22 ; bar &58 &0738 74 71 20 70 20 10 20 ; bar &5b &073f 10 70 70 21 10 11 70 21 10 ; bar &62 (11 beats) &0748 05 31 32 ; bar &6b (11 beats) &074b 02 70 70 70 80 80 80 20 20 20 ; bar &6e &0755 02 45 42 ; bar &78 &0758 02 44 40 42 ; bar &7b ; channel_two_notes &075c ff ff ff ; bar &00 &076f 5f ff fc 5d 54 ; bar &03 &0764 ff ff 50 55 58 ; bar &08 &0769 5f fd 5e 5d 54 ; bar &0d &076e 68 68 68 64 64 64 5c 5c 5c 54 54 58 ; bar &12 &077a fe 5f fd 5e ; bar &1e &077e fe 57 fc 54 5a ; bar &22 &0783 48 48 48 48 48 48 4c 4c 4c 4c 4c 54 ; bar &27 &078f 4b fc 4b fe ; bar &33 &0793 48 48 48 40 40 40 38 38 38 34 34 30 ; bar &37 &079f fe 3a 35 5f ; bar &43 ; channel_one_notes &09c0 ff ff ff ; bar &00 &09c3 1c 4c 1c 4d 4e 58 5c 4c 44 ; bar &03 &09cc 1f fc 1c 28 2c 1c 41 38 ; bar &0c &09d4 15 14 45 3e 50 54 44 3c ; bar &14 &09dc 1f fc 1c 28 2c 1c 40 3c 38 ; bar &1c &09e5 44 44 44 3c 3c 3c 38 38 38 30 28 2c ; bar &25 &09f1 17 fc 14 20 24 14 39 30 ; bar &31 &09f9 15 14 39 32 50 54 50 54 ; bar &39 &0a01 1f ff ff ; bar &41 &0a04 1f fc 1d 4c 1c 38 30 28 ; bar &44 &0a0c 0c 34 0c 34 0c 34 14 3c 14 3c 14 3c ; bar &4c &0a18 1f fc 1d 28 2c 1c 14 ; bar &58 (11 beats) &0a1f 1e 28 2c 1c 41 38 28 2c 1c ; bar &5f &0a28 1e 28 2c 4e 44 38 30 28 ; bar &68 &0a30 0c 3c 0c 3c 28 3c 0c 3c 0c 3c 30 34 ; bar &70 &0a3c 3b fc 3a 08 38 14 18 ; bar &7c &0a43 14 44 14 44 14 44 14 44 14 48 18 48 ; bar &83 &0a4f 25 54 2d 5c 31 60 34 64 34 ; bar &8f &0a58 0c 14 18 1c 30 28 14 1c 20 24 38 30 ; bar &98 &0a64 1f 1f ff ; bar &a4 &0a67 28 2c 1c 41 3b fe ; bar &a7 &0a6d 30 30 30 39 27 2a ; bar &ad &0a73 4c 44 38 4c 44 38 4c 44 38 34 30 28 ; bar &b3 &0a7f 38 30 24 38 30 24 3c 34 28 3c 34 44 ; bar &bf &0a8b 3b fc 0a 14 18 24 2c ; bar &cb &0a92 38 38 38 30 30 30 28 28 28 24 14 18 ; bar &dc ; channel_three_notes &0a9e ff ff ff ; bar &00 &0aa1 39 38 31 28 2d 1c 25 1c ; bar &03 &0aa9 28 ; bar &0b (1 beat) &0aaa 29 25 1c 25 20 25 28 ; bar &0c (11 beats) &0ab1 2d 40 39 42 38 28 24 1c ; bar &13 &0ab9 27 ff 38 40 3c 38 ; bar &1b &0abf 4c 4c 4c 45 34 31 28 1d 24 ; bar &21 &0ac8 fd 24 45 3f fe ; bar &2a &0acd 39 38 40 3c 38 41 4e 48 ; bar &2f &0ad5 4c 4c 4c 44 44 38 4c 4c 4c 44 44 38 ; bar &37 &0ae1 1e 1e 1e 39 34 ; bar &43 &0ae6 30 28 1f fe 15 08 ; bar &48 &0aec 30 28 1e 2b 31 28 ; bar &4e &0af2 30 28 1e 4f 1d 24 ; bar &54 &0af8 29 28 29 28 31 28 45 38 ; bar &5a &0b00 08 04 08 1d 17 fe ; bar &62 &0b06 1c 18 1c 31 2f fe ; bar &68 &0b0c 2c 28 2c 40 3c 3a 4c 46 ; bar &6e &0b14 24 20 24 30 2c 30 44 40 44 54 50 54 ; bar &76 &0b20 4c 44 48 4d 2b 2c 40 38 ; bar &82 &0b28 4c 44 44 44 4c 44 4c 44 44 44 4c 44 ; bar &8a &0b34 2c 28 2c 40 3c 40 54 58 5c 68 60 5c ; bar &96 &0b40 59 68 61 54 4d 38 30 24 28 ; bar &a2 &0b49 38 38 38 3c 3c 3c 44 44 44 48 44 44 48 ; bar &ab (13 beats) &0b56 30 34 30 34 30 34 30 34 30 34 30 34 ; bar &b8 &0b62 30 28 1e 2a 1c 30 28 1c ; bar &c4 &0b6a 34 38 4e 1c 4c 44 38 30 28 1c ; bar &cc &0b74 24 24 24 2c 2c 2c 30 30 30 34 34 34 ; bar &d6 &0b80 1c 24 28 28 24 1c 24 28 30 30 28 24 ; bar &e2 ; channel_one_tables &0b8c 00 ; no pitch shift &0b8d c0 09 ; &09c0 = channel_one_notes &0b8f 15 ; channel 1, envelope 5 ; channel_one_bars &0b90 00 00 00 00 00 00 00 00 00 00 41 00 41 00 03 00 ; &0ba0 1c b3 00 00 00 00 0c 14 1c 25 0c 14 1c 25 0c 39 &0bb0 1c 25 4c 58 4c 5f 4c 68 70 7c a7 ad a7 b3 a7 ad &0bc0 a7 b3 bf cb bf d2 0c 83 1c ad 0c 00 1c 25 00 00 &0bd0 0c 31 0c 31 0c 25 4c 58 4c 1c 4c 0c 8f d2 a7 ad &0be0 a7 b3 a7 00 a7 00 4c 98 4c b3 4c 4c 98 44 41 00 &0bf0 98 98 4c 44 00 4c 44 a4 00 ; channel_two_tables &0bf9 00 ; no pitch shift &0bfa 5c 07 ; &075c = channel_two_notes &0bfc 3b ; channel 3, envelope 11 ; channel_two_bars &0bfd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0c0d 00 00 03 08 0d 12 03 08 0d 12 00 00 00 00 03 08 &0c1d 0d 12 00 00 00 00 00 00 00 00 00 00 00 00 1e 22 &0c2d 1e 12 27 33 27 37 00 00 00 12 03 08 00 37 00 00 &0c3d 00 00 03 08 0d 12 00 00 00 00 00 00 00 37 03 08 &0c4d 0d 12 03 00 0d 00 00 00 00 43 00 00 00 00 00 00 &0c5d 00 00 00 00 08 00 00 00 00 ; channel_three_tables &0c66 30 ; pitch shift = &30 &0c67 9e 0a ; &0a9e = channel_three_notes &0c69 29 ; channel 2, envelope 9 ; channel_three_bars &0c6a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2a &0c7a 00 00 00 00 00 00 00 00 00 00 03 0c 13 1b 21 2a &0c8a 2f 37 43 48 43 4e 43 54 5a 00 62 00 68 00 00 00 &0c9a 00 00 00 00 00 00 6e 76 82 8a 96 a2 96 ab 03 0b &0caa 13 1b 21 2a 2f 37 b8 c4 b8 cc b8 c4 d6 00 68 00 &0cba 62 00 62 00 68 00 e2 e2 e2 00 e2 00 e2 00 00 00 &0cca e2 e2 e2 00 00 e2 00 00 00 Game Disassembly ================ ; $.!FTrack 001a00 001a00 006212 # Bytes are listed in the order they occur in the binary. Addresses are where they are used. &1a00 a9 8c LDA #&8c ; Select Tape FS &1a02 20 f4 ff JSR &fff4 ; OSBYTE &1a05 a2 00 LDX #&00 ; copy_data_for_03b0_loop # Copy &0030 bytes from &1a30-&1a5f to &03b0-&03df &1a07 bd 30 1a LDA &1a30,X ; data_for_03b0 # This overwrites OS tape workspace; unclear why. &1a0a 9d b0 03 STA &03b0,X &1a0d e8 INX &1a0e e0 30 CPX #&30 &1a10 d0 f5 BNE &1a07 ; copy_data_for_03b0_loop &1a12 ad 10 fe LDA &fe10 ; Serial ULA control register &1a15 c9 64 CMP #&64 &1a17 d0 03 BNE &1a1c ; integra_b_not_present # Does the system have an Integra-B expansion board? (?) &1a19 4c 60 1a JMP &1a60 ; tweak_loaded_string # If so, treat it as a Master for MODE 7 operations ; integra_b_not_present &1a1c ad 1a fe LDA &fe1a ; ADC convertor read low # Check for Master hardware &1a1f c9 00 CMP #&00 &1a21 d0 6d BNE &1a90 ; move_from_loader_into_game &1a23 4c 60 1a JMP &1a60 ; tweak_loaded_string # If present, shorten loading string ; unused &1a26 00 00 00 00 00 00 00 00 00 00 ; data_for_03b0 # &03b0-&03ca is identical to parts of &1a30 fd ff fd fe fd fe fd fe 00 fb fa fc fb fa fa fa # sprite_offset_x_table and sprite_offset_y_table &1a40 fa fa fa fe f9 f9 f7 f9 f7 f9 fc 00 00 00 00 f8 # copied into this location at &43fd &1a50 8c 19 21 46 54 72 61 63 6b 00 6b 00 00 00 00 00 # "!FTrack" in os_file_filename_searched_for ; tweak_loaded_string &1a60 a9 cd LDA #&cd &1a62 8d 9b 1a STA &1a9b ; write_loaded_string_loop + 1 # Change loading string to start "Track" &1a65 a9 27 LDA #&27 &1a67 8d a2 1a STA &1aa2 ; write_loaded_string_loop + 8 # and to finish with two NULLs (bug?) &1a6a a9 0a LDA #&0a &1a6c 8d cd 1a STA &1acd ; loaded_string + 9 # Overwrite "Track" with newlines and space &1a6f 8d cf 1a STA &1acf ; loaded_string &1a72 a9 0d LDA #&0d &1a74 8d ce 1a STA &1ace ; loaded_string + 10 &1a77 8d d0 1a STA &1ad0 ; loaded_string + 12 &1a7a a9 20 LDA #&20 &1a7c 8d d1 1a STA &1ad1 ; loaded_string + 13 # so string reads " Loaded ... Press SPACE To Start" &1a7f 4c 90 1a JMP &1a90 ; move_from_loader_into_game ; unused &1a82 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; move_from_loader_into_game &1a90 a9 0f LDA #&0f ; Flush input buffer &1a92 a2 01 LDX #&01 &1a94 20 f4 ff JSR &fff4 ; OSBYTE &1a97 78 SEI &1a98 a2 00 LDX #&00 ; write_loaded_string_loop &1a9a bd c4 1a LDA &1ac4,X ; loaded_string # also LDA &1acd,X # in Master version &1a9d 20 ee ff JSR &ffee ; OSWRCH &1aa0 e8 INX &1aa1 e0 2e CPX #&2e # also CPX #&27 # in Master version &1aa3 90 f5 BCC &1a9a ; write_loaded_string_loop &1aa5 58 CLI &1aa6 ea NOP ; wait_for_space &1aa7 a9 81 LDA #&81 ; Scan for a particular key &1aa9 a2 9d LDX #&9d ; SPACE &1aab a0 ff LDY #&ff &1aad 20 f4 ff JSR &fff4 ; OSBYTE &1ab0 8a TXA &1ab1 10 f4 BPL &1aa7 ; wait_for_space &1ab3 a9 0d LDA #&0d ; Disable event &1ab5 a2 04 LDX #&04 ; v-sync event &1ab7 20 f4 ff JSR &fff4 ; OSBYTE &1aba a9 0f LDA #&0f ; Flush all buffers &1abc a2 00 LDX #&00 &1abe 20 f4 ff JSR &fff4 ; OSBYTE &1ac1 4c 9f 47 JMP &479f ; initialisation_part_one ; loaded_string &1ac4 0a 0d 0d 20 20 46 69 72 65 54 72 61 63 6b 20 4c ; " FireTrack Loaded ... Press SPACE To Start" &1ad4 6f 61 64 65 64 20 2e 2e 2e 20 50 72 65 73 73 20 &1ae4 53 50 41 43 45 20 54 6f 20 53 74 61 72 74 ; unused &1af2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # &1fd1 bytes copied from &1b00-&3ad0 to &17ab-&377b at &43e2 ; sideway_ram_title_screen_routine &17ab a9 40 LDA #&40 # &40 set when in title screen &17ad 85 25 STA &25 ; scrolling_paused &17af a9 00 LDA #&00 &17b1 85 79 STA &79 ; first_byte_of_stage_flags # Use regular, not dark stage colours &17b3 a6 39 LDX &39 ; stage_foreground_colours &17b5 20 a5 21 JSR &21a5 ; set_foreground_and_background_colours &17b8 a9 00 LDA #&00 &17ba 20 11 18 JSR &1811 ; check_for_keys_for_45_vsyncs &17bd b0 51 BCS &1810 ; leave # Leave if fire pressed ; sideway_ram_title_screen_routine_loop &17bf 20 11 18 JSR &1811 ; check_for_keys_for_45_vsyncs &17c2 b0 4c BCS &1810 ; leave # Leave if fire pressed ; zoom_screen &17c4 85 9a STA &9a ; zoom_colour &17c6 a2 4f LDX #&4f &17c8 86 b2 STX &b2 ; zoom_start_x &17ca e8 INX &17cb 86 b4 STX &b4 ; zoom_end_x &17cd 38 SEC &17ce a9 67 LDA #&67 &17d0 e5 73 SBC &73 ; screen_tweak_enabled # Add 1 if screen tweak enabled &17d2 85 b8 STA &b8 ; zoom_end_y &17d4 38 SEC &17d5 e9 19 SBC #&19 &17d7 85 b6 STA &b6 ; zoom_start_y ; zoom_screen_loop &17d9 20 2e 18 JSR &182e ; plot_zoom_box_colour_1 &17dc 20 34 23 JSR &2334 ; plot_score_to_screen &17df 20 87 29 JSR &2987 ; check_for_function_key_presses &17e2 20 d7 26 JSR &26d7 ; check_for_space_or_fire_and_set_control_type &17e5 b0 29 BCS &1810 ; leave # Leave if fire pressed &17e7 a9 5a LDA #&5a &17e9 20 e9 25 JSR &25e9 ; compare_a_against_timer_2_counter &17ec 20 36 18 JSR &1836 ; plot_zoom_box_colour_0 &17ef 20 34 23 JSR &2334 ; plot_score_to_screen &17f2 c6 b2 DEC &b2 ; zoom_start_x &17f4 30 09 BMI &17ff ; zoom_reached_side_of_screen &17f6 e6 b4 INC &b4 ; zoom_end_x &17f8 e6 b8 INC &b8 ; zoom_end_y &17fa c6 b6 DEC &b6 ; zoom_start_y &17fc 4c d9 17 JMP &17d9 ; zoom_screen_loop ; zoom_reached_side_of_screen &17ff a5 9a LDA &9a ; zoom_colour &1801 18 CLC &1802 69 02 ADC #&02 &1804 c9 0c CMP #&0c &1806 b0 a3 BCS &17ab ; sideway_ram_title_screen_routine &1808 48 PHA &1809 4a LSR A &180a 4a LSR A &180b 68 PLA &180c b0 b6 BCS &17c4 ; zoom_screen &180e 90 af BCC &17bf ; sideway_ram_title_screen_routine_loop ; leave &1810 60 RTS ; check_for_keys_for_45_vsyncs &1811 48 PHA &1812 18 CLC &1813 a5 18 LDA &18 ; vsync_counter &1815 69 2d ADC #&2d &1817 48 PHA ; check_for_keys_for_45_vsyncs_loop &1818 20 87 29 JSR &2987 ; check_for_function_key_presses &181b 20 d7 26 JSR &26d7 ; check_for_space_or_fire_and_set_control_type &181e 68 PLA &181f a8 TAY &1820 68 PLA &1821 b0 ed BCS &1810 ; leave &1823 48 PHA &1824 98 TYA &1825 48 PHA &1826 c4 18 CPY &18 ; vsync_counter &1828 10 ee BPL &1818 ; check_for_keys_for_45_vsyncs_loop &182a 68 PLA &182b 68 PLA &182c 18 CLC &182d 60 RTS ; plot_zoom_box_colour_1 &182e a5 9a LDA &9a ; zoom_colour &1830 09 01 ORA #&01 &1832 85 9a STA &9a ; zoom_colour &1834 10 06 BPL &183c ; plot_zoom_box ; plot_zoom_box_colour_0 &1836 a5 9a LDA &9a ; zoom_colour &1838 29 fe AND #&fe &183a 85 9a STA &9a ; zoom_colour ; plot_zoom_box &183c a6 b2 LDX &b2 ; zoom_start_x &183e 20 50 18 JSR &1850 ; plot_zoom_vertical_line &1841 a6 b4 LDX &b4 ; zoom_end_x &1843 20 50 18 JSR &1850 ; plot_zoom_vertical_line &1846 a4 b6 LDY &b6 ; zoom_start_y &1848 20 a4 18 JSR &18a4 ; plot_zoom_horizontal_line &184b a4 b8 LDY &b8 ; zoom_end_y &184d 4c a4 18 JMP &18a4 ; plot_zoom_horizontal_line ; plot_zoom_vertical_line &1850 a4 b8 LDY &b8 ; zoom_end_y &1852 20 ef 18 JSR &18ef ; calculate_zoom_screen_address &1855 85 4d STA &4d ; pixel_mask &1857 a6 9a LDX &9a ; zoom_colour &1859 bd 0b 19 LDA &190b,X ; zoom_pixel_values_table &185c 25 4d AND &4d ; pixel_mask &185e 29 f0 AND #&f0 &1860 85 9b STA &9b ; zoom_pixel_value &1862 38 SEC &1863 a5 b8 LDA &b8 ; zoom_end_y &1865 e5 b6 SBC &b6 ; zoom_start_y &1867 aa TAX &1868 e8 INX &1869 f0 a5 BEQ &1810 ; leave &186b a5 4d LDA &4d ; pixel_mask &186d 49 ff EOR #&ff &186f 09 0f ORA #&0f &1871 85 4d STA &4d ; pixel_mask &1873 a5 0d LDA &0d ; screen_address_low &1875 29 07 AND #&07 &1877 a8 TAY &1878 a5 0d LDA &0d ; screen_address_low &187a 29 f8 AND #&f8 &187c 85 0d STA &0d ; screen_address_low ; plot_zoom_vertical_line_loop &187e b1 0d LDA (&0d),Y ; screen_address &1880 25 4d AND &4d ; pixel_mask &1882 05 9b ORA &9b ; zoom_pixel_value &1884 91 0d STA (&0d),Y ; screen_address &1886 ca DEX &1887 f0 7e BEQ &1907 ; leave &1889 c8 INY &188a c0 08 CPY #&08 &188c d0 f0 BNE &187e ; plot_zoom_vertical_line_loop &188e a0 00 LDY #&00 &1890 a5 0d LDA &0d ; screen_address_low &1892 69 7f ADC #&7f &1894 85 0d STA &0d ; screen_address_low &1896 a5 0e LDA &0e ; screen_address_high &1898 69 02 ADC #&02 &189a 85 0e STA &0e ; screen_address_high &189c 10 e0 BPL &187e ; plot_zoom_vertical_line_loop &189e e9 3f SBC #&3f &18a0 85 0e STA &0e ; screen_address_high &18a2 10 da BPL &187e ; plot_zoom_vertical_line_loop ; plot_zoom_horizontal_line &18a4 a6 b2 LDX &b2 ; zoom_start_x &18a6 20 ef 18 JSR &18ef ; calculate_zoom_screen_address &18a9 85 4d STA &4d ; pixel_mask &18ab a6 9a LDX &9a ; zoom_colour &18ad bd 0b 19 LDA &190b,X ; zoom_pixel_values_table &18b0 85 9b STA &9b ; zoom_pixel_value &18b2 38 SEC &18b3 a5 b4 LDA &b4 ; zoom_end_x &18b5 e5 b2 SBC &b2 ; zoom_start_x &18b7 f0 4e BEQ &1907 ; leave &18b9 aa TAX &18ba a0 00 LDY #&00 ; plot_zoom_horizontal_line_loop &18bc a5 4d LDA &4d ; pixel_mask &18be 49 ff EOR #&ff &18c0 31 0d AND (&0d),Y ; screen_address &18c2 85 92 STA &92 ; other_pixel &18c4 b1 0d LDA (&0d),Y ; screen_address &18c6 29 0f AND #&0f &18c8 05 9b ORA &9b ; zoom_pixel_value &18ca 25 4d AND &4d ; pixel_mask &18cc 05 92 ORA &92 ; other_pixel &18ce 91 0d STA (&0d),Y ; screen_address &18d0 ca DEX &18d1 f0 34 BEQ &1907 ; leave &18d3 24 4d BIT &4d ; pixel_mask &18d5 10 04 BPL &18db &18d7 46 4d LSR &4d ; pixel_mask &18d9 10 e1 BPL &18bc ; plot_zoom_horizontal_line_loop &18db 06 4d ASL &4d ; pixel_mask &18dd a5 0d LDA &0d ; screen_address_low &18df 69 08 ADC #&08 &18e1 85 0d STA &0d ; screen_address_low &18e3 90 d7 BCC &18bc ; plot_zoom_horizontal_line_loop &18e5 e6 0e INC &0e ; screen_address_high &18e7 10 d3 BPL &18bc ; plot_zoom_horizontal_line_loop &18e9 a9 40 LDA #&40 &18eb 85 0e STA &0e ; screen_address_high &18ed 10 cd BPL &18bc ; plot_zoom_horizontal_line_loop ; calculate_zoom_screen_address &18ef a9 00 LDA #&00 &18f1 85 16 STA &16 ; sprite_height &18f3 86 13 STX &13 ; sprite_x &18f5 46 13 LSR &13 ; sprite_x &18f7 08 PHP &18f8 18 CLC &18f9 98 TYA &18fa 65 02 ADC &02 ; screen_vertical_scroll &18fc 85 14 STA &14 ; sprite_y &18fe 20 be 1d JSR &1dbe ; calculate_screen_address &1901 a9 aa LDA #&aa &1903 28 PLP &1904 90 01 BCC &1907 ; leave &1906 4a LSR A ; leave &1907 60 RTS ; &1908-&1910 is different in standard version; see &4260-&4268 ; title_screen_routine &1908 4c ab 17 JMP &17ab ; sideway_ram_title_screen_routine ; zoom_pixel_values_table ; 1 1 0 3 3 3 0 1 2 0 0 1 # Both pixels set, background colours &190b 30 30 00 f0 f0 f0 00 30 c0 f0 00 30 ; set_up_sprite_X_for_updating &1917 bd 96 0f LDA &0f96,X ; sprites_vertical_scroll &191a 85 ba STA &ba ; previous_sprite_vertical_scroll &191c bc 42 0f LDY &0f42,X ; sprites_type &191f bd 0a 0f LDA &0f0a,X ; sprites_x &1922 85 13 STA &13 ; sprite_x &1924 bd 26 0f LDA &0f26,X ; sprites_y &1927 85 14 STA &14 ; sprite_y &1929 8a TXA &192a 48 PHA &192b a2 00 LDX #&00 # Use previous variables &192d 20 34 19 JSR &1934 ; calculate_sprite_coordinates &1930 68 PLA &1931 aa TAX ; leave_with_carry_set &1932 38 SEC &1933 60 RTS ; calculate_sprite_coordinates # Called with X = slot (0 or 1), Y = sprite_type &1934 a9 ff LDA #&ff &1936 95 bc STA &bc,X ; sprite_type &1938 c0 12 CPY #&12 # Is this actually a sprite? If not, leave &193a b0 f6 BCS &1932 ; leave_with_carry_set &193c a5 13 LDA &13 ; sprite_x &193e 79 a7 03 ADC &03a7,Y ; sprite_offset_x_table &1941 c9 50 CMP #&50 &1943 10 ed BPL &1932 ; leave_with_carry_set # Leave if sprite is beyond the right of the screen &1945 95 b2 STA &b2,X ; sprite_start_x &1947 24 79 BIT &79 ; first_byte_of_stage_flags &1949 10 07 BPL &1952 ; skip_extra_offset # Is the stage dark? &194b c0 11 CPY #&11 ; BULLET &194d f0 03 BEQ &1952 ; skip_extra_offset # If so, no need to plot shadows &194f 38 SEC &1950 e9 02 SBC #&02 ; skip_extra_offset &1952 18 CLC &1953 79 e8 0c ADC &0ce8,Y ; sprite_width_table &1956 30 da BMI &1932 ; leave_with_carry_set # Leave if sprite is beyond the left of the screen &1958 95 b4 STA &b4,X ; sprite_end_x &195a 18 CLC &195b a5 14 LDA &14 ; sprite_y &195d 79 b9 03 ADC &03b9,Y ; sprite_offset_y_table &1960 95 b6 STA &b6,X ; sprite_start_y &1962 85 14 STA &14 ; sprite_y &1964 18 CLC &1965 79 ea 02 ADC &02ea,Y ; sprite_height_table &1968 95 b8 STA &b8,X ; sprite_end_y &196a a5 02 LDA &02 ; screen_vertical_scroll &196c 29 f8 AND #&f8 &196e 85 94 STA &94 ; screen_vertical_scroll_group &1970 38 SEC &1971 b5 b6 LDA &b6,X ; sprite_start_y &1973 e5 94 SBC &94 ; screen_vertical_scroll_group &1975 c9 e6 CMP #&e6 &1977 90 04 BCC &197d ; use_sprite_start_y &1979 a5 94 LDA &94 ; screen_vertical_scroll_group &197b 95 b6 STA &b6,X ; sprite_start_y # Clip start of sprite to edge of screen ; use_sprite_start_y &197d 38 SEC &197e b5 ba LDA &ba,X ; sprite_vertical_scroll &1980 29 f8 AND #&f8 &1982 e5 94 SBC &94 ; screen_vertical_scroll_group &1984 18 CLC &1985 69 c0 ADC #&c0 &1987 85 92 STA &92 ; groups &1989 38 SEC &198a b5 b8 LDA &b8,X ; sprite_end_y &198c e5 94 SBC &94 ; screen_vertical_scroll_group &198e 38 SEC &198f e5 92 SBC &92 ; groups &1991 90 09 BCC &199c ; use_sprite_end_y &1993 f0 07 BEQ &199c ; use_sprite_end_y &1995 18 CLC &1996 a5 92 LDA &92 ; groups &1998 65 94 ADC &94 ; screen_vertical_scroll_group &199a 95 b8 STA &b8,X ; sprite_end_y # Clip end of sprite to edge of screen ; use_sprite_end_y &199c b5 b8 LDA &b8,X ; sprite_end_y &199e d5 b6 CMP &b6,X ; sprite_start_y &19a0 30 90 BMI &1932 ; leave_with_carry_set &19a2 94 bc STY &bc,X ; sprite_type &19a4 18 CLC &19a5 60 RTS ; update_player_sprite &19a6 a2 00 LDX #&00 ; update_sprite_X &19a8 a5 02 LDA &02 ; screen_vertical_scroll &19aa 85 bb STA &bb ; new_sprite_vertical_scroll &19ac 9d 96 0f STA &0f96,X ; sprites_vertical_scroll &19af bc 42 0f LDY &0f42,X ; sprites_type &19b2 bd 0a 0f LDA &0f0a,X ; sprites_x &19b5 85 13 STA &13 ; sprite_x &19b7 bd 26 0f LDA &0f26,X ; sprites_y &19ba 85 14 STA &14 ; sprite_y &19bc 8a TXA &19bd 48 PHA &19be a2 01 LDX #&01 # Use new variables &19c0 20 34 19 JSR &1934 ; calculate_sprite_coordinates &19c3 68 PLA &19c4 48 PHA &19c5 aa TAX &19c6 b0 1b BCS &19e3 ; sprite_was_off_screen &19c8 b9 ea 02 LDA &02ea,Y ; sprite_height_table &19cb 85 16 STA &16 ; sprite_height &19cd 65 14 ADC &14 ; sprite_y &19cf 38 SEC &19d0 e5 b7 SBC &b7 ; new_sprite_start_y &19d2 18 CLC &19d3 79 c4 0c ADC &0cc4,Y ; sprite_address_low_table &19d6 85 0f STA &0f ; sprite_address_low &19d8 85 11 STA &11 ; bottom_of_column_sprite_address_low &19da a9 00 LDA #&00 &19dc 79 d6 0c ADC &0cd6,Y ; sprite_address_high_table &19df 85 10 STA &10 ; sprite_address_high &19e1 85 12 STA &12 ; bottom_of_column_sprite_address_high ; sprite_was_off_screen &19e3 a5 bd LDA &bd ; new_sprite_type &19e5 10 13 BPL &19fa ; sprite_needs_plotting # Does the sprite need plotting? &19e7 a5 b2 LDA &b2 ; previous_sprite_start_x # If no, use the previous coordinates for the new ones &19e9 85 b3 STA &b3 ; new_sprite_start_x &19eb 85 b5 STA &b5 ; new_sprite_end_x &19ed a5 b6 LDA &b6 ; previous_sprite_start_y &19ef 85 b7 STA &b7 ; new_sprite_start_y &19f1 85 b9 STA &b9 ; new_sprite_end_y &19f3 a5 bc LDA &bc ; previous_sprite_type &19f5 10 13 BPL &1a0a ; sprite_needs_unplotting &19f7 68 PLA &19f8 aa TAX &19f9 60 RTS ; sprite_needs_plotting &19fa a5 bc LDA &bc ; previous_sprite_type &19fc 10 0c BPL &1a0a ; sprite_needs_unplotting # Does the sprite need unplotting? &19fe a5 b3 LDA &b3 ; new_sprite_start_x # If not, use the new coordinates for the previous ones &1a00 85 b2 STA &b2 ; previous_sprite_start_x &1a02 85 b4 STA &b4 ; previous_sprite_end_x &1a04 a5 b7 LDA &b7 ; new_sprite_start_y &1a06 85 b6 STA &b6 ; previous_sprite_start_y &1a08 85 b8 STA &b8 ; previous_sprite_end_y ; sprite_needs_unplotting &1a0a 38 SEC &1a0b a5 b8 LDA &b8 ; previous_sprite_end_y &1a0d e5 b6 SBC &b6 ; previous_sprite_start_y &1a0f 85 c2 STA &c2 ; previous_sprite_effective_height &1a11 38 SEC &1a12 a5 b9 LDA &b9 ; new_sprite_end_y &1a14 e5 b7 SBC &b7 ; new_sprite_start_y &1a16 85 c3 STA &c3 ; new_sprite_effective_height &1a18 38 SEC &1a19 a5 b7 LDA &b7 ; new_sprite_start_y &1a1b e5 b6 SBC &b6 ; previous_sprite_start_y &1a1d 85 be STA &be ; sprite_start_y_change &1a1f 38 SEC &1a20 a5 b9 LDA &b9 ; new_sprite_end_y &1a22 e5 b8 SBC &b8 ; previous_sprite_end_y &1a24 85 bf STA &bf ; sprite_end_y_change &1a26 38 SEC &1a27 a5 b8 LDA &b8 ; previous_sprite_end_y &1a29 e5 b7 SBC &b7 ; new_sprite_start_y &1a2b 85 c0 STA &c0 ; sprite_previous_end_y_minus_new_start_y &1a2d 38 SEC &1a2e a5 b9 LDA &b9 ; new_sprite_end_y &1a30 e5 b6 SBC &b6 ; previous_sprite_start_y &1a32 85 c1 STA &c1 ; sprite_new_end_y_minus_previous_start_y &1a34 a5 b2 LDA &b2 ; previous_sprite_start_x &1a36 c5 b3 CMP &b3 ; new_sprite_start_x &1a38 30 02 BMI &1a3c ; use_previous_start_x &1a3a a5 b3 LDA &b3 ; new_sprite_start_x ; use_previous_start_x &1a3c 85 13 STA &13 ; sprite_x &1a3e a5 b6 LDA &b6 ; previous_sprite_start_y &1a40 c5 b7 CMP &b7 ; new_sprite_start_y &1a42 30 02 BMI &1a46 ; use_previous_end_y &1a44 a5 b7 LDA &b7 ; new_sprite_start_y ; use_previous_start_y &1a46 85 14 STA &14 ; sprite_y &1a48 20 be 1d JSR &1dbe ; calculate_screen_address &1a4b a5 0d LDA &0d ; bottom_of_column_screen_address_low &1a4d 85 0b STA &0b ; screen_address_low &1a4f a5 0e LDA &0e ; bottom_of_column_screen_address_high ; update_sprite_loop &1a51 85 0e STA &0e ; bottom_of_column_screen_address_high &1a53 85 0c STA &0c ; screen_address_high &1a55 a5 13 LDA &13 ; sprite_x &1a57 c9 50 CMP #&50 &1a59 90 03 BCC &1a5e ; update_column &1a5b 4c 1e 1b JMP &1b1e ; skip_column ; update_column &1a5e a0 00 LDY #&00 # Y is &00 &1a60 c5 b2 CMP &b2 ; previous_sprite_start_x &1a62 30 06 BMI &1a6a ; column_didn't_contain_sprite &1a64 c5 b4 CMP &b4 ; previous_sprite_end_x &1a66 10 02 BPL &1a6a ; column_didn't_contain_sprite &1a68 a0 80 LDY #&80 # plus &80 if this column is within previous sprite ; column_didn't_contain_sprite &1a6a c5 b3 CMP &b3 ; new_sprite_start_x &1a6c 30 05 BMI &1a73 ; column_doesn't_contain_sprite &1a6e c5 b5 CMP &b5 ; new_sprite_end_x &1a70 10 01 BPL &1a73 ; column_doesn't_contain_sprite &1a72 c8 INY # plus &01 if this column is within new sprite ; column_doesn't_contain_sprite &1a73 98 TYA &1a74 30 14 BMI &1a8a ; column_needs_unplotting &1a76 d0 03 BNE &1a7b ; column_needs_plotting_but_not_unplotting # If the column contains neither new or previous sprite, &1a78 4c 1e 1b JMP &1b1e ; skip_column # skip it entirely. : column_needs_plotting_but_not_unplotting # If the column contains the new, but not the previous, &1a7b a5 be LDA &be ; sprite_start_y_change &1a7d 30 03 BMI &1a82 ; new_sprite_starts_first &1a7f 20 ff 1b JSR &1bff ; adjust_screen_address_by_A_rows # move to the start of the new sprite if necessary ; new_sprite_starts_first &1a82 a5 c3 LDA &c3 ; new_sprite_effective_height &1a84 20 4c 1b JSR &1b4c ; plot_A_rows_of_sprite # and plot the new sprite &1a87 4c 0d 1b JMP &1b0d ; move_to_next_column_of_sprite ; column_needs_unplotting &1a8a 88 DEY &1a8b 30 0f BMI &1a9c ; column_needs_plotting_and_unplotting ; column_needs_unplotting_but_not_plotting # If the column contains the previous, but not the new, &1a8d a5 be LDA &be ; sprite_start_y_change &1a8f 10 03 BPL &1a94 ; previous_sprite_starts_first &1a91 20 fa 1b JSR &1bfa ; adjust_screen_address_by_minus_A_rows # move to the start of the previous sprite if necessary, ; previous_sprite_starts_first &1a94 a5 c2 LDA &c2 ; previous_sprite_effective_height &1a96 20 68 1c JSR &1c68 ; unplot_A_rows_of_foreground # and unplot the previous sprite &1a99 4c 1e 1b JMP &1b1e ; skip_column ; column_needs_plotting_and_unplotting # If the column contains both previous and new sprites, &1a9c a5 be LDA &be ; sprite_start_y_change &1a9e 30 38 BMI &1ad8 ; plot_and_unplot_new_sprite_starts_first # a) if the previous sprite starts first &1aa0 24 c0 BIT &c0 ; sprite_previous_end_y_minus_new_start_y &1aa2 30 22 BMI &1ac6 ; previous_and_new_sprites_are_separate # a1) and the two sprites overlap &1aa4 a8 TAY &1aa5 20 68 1c JSR &1c68 ; unplot_A_rows_of_foreground # unplot the non-overlapping part of the previous sprite &1aa8 24 bf BIT &bf ; sprite_end_y_change &1aaa 30 0d BMI &1ab9 ; new_sprite_fits_within_previous_sprite # a1i) the new sprite extends past the previous sprite &1aac a5 c0 LDA &c0 ; sprite_previous_end_y_minus_new_start_y # replace the overlapping part &1aae 20 ff 1c JSR &1cff ; replace_A_rows_of_sprite &1ab1 a5 bf LDA &bf ; sprite_end_y_change &1ab3 20 4c 1b JSR &1b4c ; plot_A_rows_of_sprite # plot the remainder of the new sprite &1ab6 4c 0d 1b JMP &1b0d ; move_to_next_column_of_sprite ; new_sprite_fits_within_previous_sprite # a1ii) the new sprite fits within the previous sprite &1ab9 a5 c3 LDA &c3 ; new_sprite_effective_height &1abb 20 ff 1c JSR &1cff ; replace_A_rows_of_sprite # replace the overlapping part &1abe a5 bf LDA &bf ; sprite_end_y_change &1ac0 20 63 1c JSR &1c63 ; unplot_minus_A_rows_of_foreground # unplot the remainder of the previous sprite &1ac3 4c 0d 1b JMP &1b0d ; move_to_next_column_of_sprite ; previous_and_new_sprites_are_separate # a2) the two sprites don't overlap &1ac6 a5 c2 LDA &c2 ; previous_sprite_effective_height &1ac8 20 68 1c JSR &1c68 ; unplot_A_rows_of_foreground # unplot the previous sprite &1acb a5 c0 LDA &c0 ; sprite_previous_end_y_minus_new_start_y &1acd 20 fa 1b JSR &1bfa ; adjust_screen_address_by_minus_A_rows # move to the new sprite &1ad0 a5 c3 LDA &c3 ; new_sprite_effective_height &1ad2 20 4c 1b JSR &1b4c ; plot_A_rows_of_sprite # plot the new sprite &1ad5 4c 0d 1b JMP &1b0d ; move_to_next_column_of_sprite ; plot_and_unplot_new_sprite_starts_first # b) if the new sprite starts first &1ad8 24 c1 BIT &c1 ; sprite_new_end_y_minus_previous_start_y &1ada 30 22 BMI &1afe ; new_and_previous_sprites_are_separate # b1) and the two sprites overlap &1adc a8 TAY &1add 20 47 1b JSR &1b47 ; plot_minus_A_rows_of_sprite # plot the non-overlapping part of the new sprite &1ae0 24 bf BIT &bf ; sprite_end_y_change &1ae2 30 0d BMI &1af1 ; previous_sprite_not_within_new_sprite # b1i) the previous sprite fits within the new sprite &1ae4 a5 c2 LDA &c2 ; previous_sprite_effective_height &1ae6 20 ff 1c JSR &1cff ; replace_A_rows_of_sprite # replace the overlapping part &1ae9 a5 bf LDA &bf ; sprite_end_y_change &1aeb 20 4c 1b JSR &1b4c ; plot_A_rows_of_sprite # plot the remainder of the new sprite &1aee 4c 0d 1b JMP &1b0d ; move_to_next_column_of_sprite ; previous_sprite_not_within_new_sprite # b1ii) the previous sprite extends past the new sprite &1af1 a5 c1 LDA &c1 ; sprite_new_end_y_minus_previous_start_y &1af3 20 ff 1c JSR &1cff ; replace_A_rows_of_sprite # replace the overlapping part &1af6 a5 bf LDA &bf ; sprite_end_y_change &1af8 20 63 1c JSR &1c63 ; unplot_minus_A_rows_of_foreground # unplot the remainder of the previous sprite &1afb 4c 0d 1b JMP &1b0d ; move_to_next_column_of_sprite ; new_and_previous_sprites_are_separate # b2) the two sprites don't overlap &1afe a5 c3 LDA &c3 ; new_sprite_effective_height &1b00 20 4c 1b JSR &1b4c ; plot_A_rows_of_sprite # plot the new sprite &1b03 a5 c1 LDA &c1 ; sprite_new_end_y_minus_previous_start_y &1b05 20 fa 1b JSR &1bfa ; adjust_screen_address_by_minus_A_rows # move to the previous sprite &1b08 a5 c2 LDA &c2 ; previous_sprite_effective_height &1b0a 20 68 1c JSR &1c68 ; unplot_A_rows_of_foreground # unplot the previous sprite ; move_to_next_column_of_sprite &1b0d 18 CLC &1b0e a5 11 LDA &11 ; bottom_of_column_sprite_address_low # Move to the next column of sprite data &1b10 65 16 ADC &16 ; sprite_height &1b12 85 11 STA &11 ; bottom_of_column_sprite_address_low &1b14 85 0f STA &0f ; sprite_address_low &1b16 a5 12 LDA &12 ; bottom_of_column_sprite_address_high &1b18 69 00 ADC #&00 &1b1a 85 12 STA &12 ; bottom_of_column_sprite_address_high &1b1c 85 10 STA &10 ; sprite_address_high ; skip_column &1b1e e6 13 INC &13 ; sprite_x &1b20 a5 13 LDA &13 ; sprite_x &1b22 c5 b4 CMP &b4 ; previous_sprite_end_x &1b24 30 04 BMI &1b2a ; move_to_next_column_of_screen &1b26 c5 b5 CMP &b5 ; new_sprite_end_x &1b28 10 13 BPL &1b3d ; skip_move_to_next_column_of_screen ; move_to_next_column_of_screen &1b2a 18 CLC &1b2b a5 0d LDA &0d ; bottom_of_column_screen_address_low # Move to the next column of the screen &1b2d 69 08 ADC #&08 &1b2f 85 0d STA &0d ; bottom_of_column_screen_address_low &1b31 85 0b STA &0b ; screen_address_low &1b33 a5 0e LDA &0e ; bottom_of_column_screen_address_high &1b35 69 00 ADC #&00 &1b37 10 0b BPL &1b44 ; to_update_sprite_loop &1b39 e9 3f SBC #&3f ; skip_move_to_next_column_of_screen &1b3b 10 07 BPL &1b44 ; to_update_sprite_loop &1b3d 68 PLA &1b3e aa TAX &1b3f a9 ff LDA #&ff # Mark previous sprite as unplotted &1b41 85 bc STA &bc ; previous_sprite_type &1b43 60 RTS ; to_update_sprite_column_loop &1b44 4c 51 1a JMP &1a51 ; update_sprite_loop ; plot_minus_A_rows_of_sprite &1b47 49 ff EOR #&ff &1b49 18 CLC &1b4a 69 01 ADC #&01 ; plot_A_rows_of_sprite &1b4c f0 28 BEQ &1b76 ; leave &1b4e a8 TAY &1b4f 85 92 STA &92 ; rows_to_plot &1b51 a5 0b LDA &0b ; screen_address_low &1b53 29 07 AND #&07 &1b55 aa TAX &1b56 38 SEC &1b57 a5 0b LDA &0b ; screen_address_low &1b59 e5 92 SBC &92 ; rows_to_plot &1b5b 85 0b STA &0b ; screen_address_low &1b5d b0 02 BCS &1b61 &1b5f c6 0c DEC &0c ; screen_address_high &1b61 bd f2 1b LDA &1bf2,X ; top_branch_offsets_table &1b64 8d 75 1b STA &1b75 ; branch_offset &1b67 38 SEC &1b68 a5 0f LDA &0f ; sprite_address_low &1b6a e5 92 SBC &92 ; rows_to_plot &1b6c 85 0f STA &0f ; sprite_address_low &1b6e a5 10 LDA &10 ; sprite_address_high &1b70 e9 00 SBC #&00 &1b72 85 10 STA &10 ; sprite_address_high &1b74 b0 fe BCS &1b74 ; leave &1b76 60 RTS ; plot_A_rows_of_sprite_loop &1b77 98 TYA &1b78 f0 fc BEQ &1b76 ; leave ; branch_7 &1b7a b1 0f LDA (&0f),Y ; sprite_address &1b7c 29 f0 AND #&f0 &1b7e 11 0b ORA (&0b),Y ; screen_address &1b80 91 0b STA (&0b),Y &1b82 88 DEY &1b83 f0 f1 BEQ &1b76 ; leave ; branch_6 &1b85 b1 0f LDA (&0f),Y ; sprite_address &1b87 29 f0 AND #&f0 &1b89 11 0b ORA (&0b),Y ; screen_address &1b8b 91 0b STA (&0b),Y ; screen_address &1b8d 88 DEY &1b8e f0 e6 BEQ &1b76 ; leave ; branch_5 &1b90 b1 0f LDA (&0f),Y ; sprite_address &1b92 29 f0 AND #&f0 &1b94 11 0b ORA (&0b),Y ; screen_address &1b96 91 0b STA (&0b),Y ; screen_address &1b98 88 DEY &1b99 f0 db BEQ &1b76 ; leave ; branch_4 &1b9b b1 0f LDA (&0f),Y ; sprite_address &1b9d 29 f0 AND #&f0 &1b9f 11 0b ORA (&0b),Y ; screen_address &1ba1 91 0b STA (&0b),Y ; screen_address &1ba3 88 DEY &1ba4 f0 d0 BEQ &1b76 ; leave ; branch_3 &1ba6 b1 0f LDA (&0f),Y ; sprite_address &1ba8 29 f0 AND #&f0 &1baa 11 0b ORA (&0b),Y ; screen_address &1bac 91 0b STA (&0b),Y ; screen_address &1bae 88 DEY &1baf f0 c5 BEQ &1b76 ; leave ; branch_2 &1bb1 b1 0f LDA (&0f),Y ; sprite_address &1bb3 29 f0 AND #&f0 &1bb5 11 0b ORA (&0b),Y ; screen_address &1bb7 91 0b STA (&0b),Y ; screen_address &1bb9 88 DEY &1bba f0 ba BEQ &1b76 ; leave ; branch_1 &1bbc b1 0f LDA (&0f),Y ; sprite_address &1bbe 29 f0 AND #&f0 &1bc0 11 0b ORA (&0b),Y ; screen_address &1bc2 91 0b STA (&0b),Y ; screen_address &1bc4 88 DEY &1bc5 f0 af BEQ &1b76 ; leave ; branch_0 &1bc7 b1 0f LDA (&0f),Y ; sprite_address &1bc9 29 f0 AND #&f0 &1bcb 11 0b ORA (&0b),Y ; screen_address &1bcd 91 0b STA (&0b),Y ; screen_address &1bcf 88 DEY &1bd0 a5 0b LDA &0b ; screen_address_low # Move up a group &1bd2 e9 78 SBC #&78 &1bd4 85 0b STA &0b ; screen_address_low &1bd6 a5 0c LDA &0c ; screen_address_high &1bd8 e9 02 SBC #&02 &1bda 85 0c STA &0c ; screen_address_high &1bdc c9 40 CMP #&40 &1bde b0 97 BCS &1b77 ; plot_A_rows_of_sprite_loop &1be0 49 3f EOR #&3f # Wrap around at top of screen &1be2 d0 05 BNE &1be9 &1be4 98 TYA &1be5 65 0b ADC &0b ; screen_address_low &1be7 b0 8e BCS &1b77 ; plot_A_rows_of_sprite_loop &1be9 a5 0c LDA &0c ; screen_address_high &1beb 69 40 ADC #&40 &1bed 85 0c STA &0c ; screen_address_high &1bef 38 SEC &1bf0 b0 85 BCS &1b77 ; plot_A_rows_of_sprite_loop ; plot_branch_offsets_table &1bf2 51 46 3b 30 25 1a 0f 04 ; adjust_screen_address_by_minus_A_rows &1bfa 49 ff EOR #&ff &1bfc 18 CLC &1bfd 69 01 ADC #&01 ; adjust_screen_address_by_A_rows &1bff 30 f9 BMI &1bfa ; adjust_screen_address_by_minus_A_rows &1c01 f0 1c BEQ &1c1f ; leave &1c03 a8 TAY &1c04 85 92 STA &92 ; rows_to_add &1c06 a5 0b LDA &0b ; screen_address_low &1c08 29 07 AND #&07 &1c0a aa TAX &1c0b 38 SEC &1c0c a5 0b LDA &0b ; screen_address_low &1c0e e5 92 SBC &92 ; rows_to_add &1c10 85 0b STA &0b ; screen_address_low &1c12 b0 02 BCS &1c16 &1c14 c6 0c DEC &0c ; screen_address_high &1c16 bd 5b 1c LDA &1c5b,X ; adjust_branch_offsets_table &1c19 8d 1e 1c STA &1c1e ; branch_offset &1c1c 38 SEC &1c1d b0 fe BCS &1c1d # actually BCS branch_offset ; leave &1c1f 60 RTS ; adjust_screen_address_by_A_rows_loop &1c20 98 TYA &1c21 f0 fc BEQ &1c1f ; leave ; branch_7 &1c23 88 DEY &1c24 f0 f9 BEQ &1c1f ; leave ; branch_6 &1c26 88 DEY &1c27 f0 f6 BEQ &1c1f ; leave ; branch_5 &1c29 88 DEY &1c2a f0 f3 BEQ &1c1f ; leave ; branch_4 &1c2c 88 DEY &1c2d f0 f0 BEQ &1c1f ; leave ; branch_3 &1c2f 88 DEY &1c30 f0 ed BEQ &1c1f ; leave ; branch_2 &1c32 88 DEY &1c33 f0 ea BEQ &1c1f ; leave ; branch_1 &1c35 88 DEY &1c36 f0 e7 BEQ &1c1f ; leave ; branch_0 &1c38 88 DEY &1c39 a5 0b LDA &0b ; screen_address_low &1c3b e9 78 SBC #&78 &1c3d 85 0b STA &0b ; screen_address_low &1c3f a5 0c LDA &0c ; screen_address_high &1c41 e9 02 SBC #&02 &1c43 85 0c STA &0c ; screen_address_high &1c45 c9 40 CMP #&40 &1c47 b0 d7 BCS &1c20 ; adjust_screen_address_by_A_rows_loop &1c49 49 3f EOR #&3f &1c4b d0 05 BNE &1c52 &1c4d 98 TYA &1c4e 65 0b ADC &0b ; screen_address_low &1c50 b0 ce BCS &1c20 ; loop &1c52 a5 0c LDA &0c ; screen_address_high &1c54 69 40 ADC #&40 &1c56 85 0c STA &0c ; screen_address_high &1c58 38 SEC &1c59 b0 c5 BCS &1c20 ; adjust_screen_address_by_A_rows_loop ; adjust_branch_offsets_table &1c5b 19 16 13 10 0d 0a 07 04 ; unplot_minus_A_rows_of_foreground &1c63 49 ff EOR #&ff &1c65 18 CLC &1c66 69 01 ADC #&01 ; unplot_A_rows_of_foreground &1c68 f0 1c BEQ &1c86 ; leave &1c6a a8 TAY &1c6b 85 92 STA &92 ; rows_to_unplot &1c6d a5 0b LDA &0b ; screen_address_low &1c6f 29 07 AND #&07 &1c71 aa TAX &1c72 38 SEC &1c73 a5 0b LDA &0b ; screen_address_low &1c75 e5 92 SBC &92 ; rows_to_unplot &1c77 85 0b STA &0b ; screen_address_low &1c79 b0 02 BCS &1c7d &1c7b c6 0c DEC &0c ; screen_address_high &1c7d bd f2 1c LDA &1cf2,X ; unplot_branch_offsets_table &1c80 8d 85 1c STA &1c85 ; branch_offset &1c83 38 SEC &1c84 b0 fe BCS &1c84 # actually BCS branch_offset ; leave &1c86 60 RTS ; unplot_A_rows_of_foreground_loop &1c87 98 TYA &1c88 f0 fc BEQ &1c86 ; leave ; branch_7 &1c8a b1 0b LDA (&0b),Y ; screen_address &1c8c 29 0f AND #&0f &1c8e 91 0b STA (&0b),Y ; screen_address &1c90 88 DEY &1c91 f0 f3 BEQ &1c86 ; leave ; branch_6 &1c93 b1 0b LDA (&0b),Y ; screen_address &1c95 29 0f AND #&0f &1c97 91 0b STA (&0b),Y ; screen_address &1c99 88 DEY &1c9a f0 ea BEQ &1c86 ; leave ; branch_5 &1c9c b1 0b LDA (&0b),Y ; screen_address &1c9e 29 0f AND #&0f &1ca0 91 0b STA (&0b),Y ; screen_address &1ca2 88 DEY &1ca3 f0 e1 BEQ &1c86 ; leave ; branch_4 &1ca5 b1 0b LDA (&0b),Y ; screen_address &1ca7 29 0f AND #&0f &1ca9 91 0b STA (&0b),Y ; screen_address &1cab 88 DEY &1cac f0 d8 BEQ &1c86 ; leave ; branch_3 &1cae b1 0b LDA (&0b),Y ; screen_address &1cb0 29 0f AND #&0f &1cb2 91 0b STA (&0b),Y ; screen_address &1cb4 88 DEY &1cb5 f0 cf BEQ &1c86 ; leave ; branch_2 &1cb7 b1 0b LDA (&0b),Y ; screen_address &1cb9 29 0f AND #&0f &1cbb 91 0b STA (&0b),Y ; screen_address &1cbd 88 DEY &1cbe f0 c6 BEQ &1c86 ; leave ; branch_1 &1cc0 b1 0b LDA (&0b),Y ; screen_address &1cc2 29 0f AND #&0f &1cc4 91 0b STA (&0b),Y ; screen_address &1cc6 88 DEY &1cc7 f0 bd BEQ &1c86 ; leave ; branch_0 &1cc9 b1 0b LDA (&0b),Y ; screen_address &1ccb 29 0f AND #&0f &1ccd 91 0b STA (&0b),Y ; screen_address &1ccf 88 DEY &1cd0 a5 0b LDA &0b ; screen_address_low # Move to group above &1cd2 e9 78 SBC #&78 &1cd4 85 0b STA &0b ; screen_address_low &1cd6 a5 0c LDA &0c ; screen_address_high &1cd8 e9 02 SBC #&02 &1cda 85 0c STA &0c ; screen_address_high &1cdc c9 40 CMP #&40 &1cde b0 a7 BCS &1c87 ; unplot_A_rows_of_foreground &1ce0 49 3f EOR #&3f # Wrap around at top of screen &1ce2 d0 05 BNE &1ce9 &1ce4 98 TYA &1ce5 65 0b ADC &0b ; screen_address_low &1ce7 b0 9e BCS &1c87 ; unplot_A_rows_of_foreground &1ce9 a5 0c LDA &0c ; screen_address_high &1ceb 69 40 ADC #&40 &1ced 85 0c STA &0c ; screen_address_high &1cef 38 SEC &1cf0 b0 95 BCS &1c87 ; unplot_A_rows_of_foreground ; unplot_branch_offsets_table &1cf2 43 3a 31 28 1f 16 0d 04 ; replace_minus_A_rows_of_sprite # Unused entry point &1cfa 49 ff EOR #&ff &1cfc 18 CLC &1cfd 69 01 ADC #&01 ; replace_A_rows_of_sprite &1cff f0 28 BEQ &1d29 ; leave &1d01 a8 TAY &1d02 85 92 STA &92 ; rows_to_replace &1d04 a5 0b LDA &0b ; screen_address_low &1d06 29 07 AND #&07 &1d08 aa TAX &1d09 38 SEC &1d0a a5 0b LDA &0b ; screen_address_low &1d0c e5 92 SBC &92 ; rows_to_replace &1d0e 85 0b STA &0b ; screen_address_low &1d10 b0 02 BCS &1d14 &1d12 c6 0c DEC &0c ; screen_address_high &1d14 bd b6 1d LDA &1db6,X ; replace_branch_offsets_table &1d17 8d 28 1d STA &1d28 ; branch_offset &1d1a 38 SEC &1d1b a5 0f LDA &0f ; sprite_address_low &1d1d e5 92 SBC &92 ; rows_to_replace &1d1f 85 0f STA &0f ; sprite_address_low &1d21 a5 10 LDA &10 ; sprite_address_high &1d23 e9 00 SBC #&00 &1d25 85 10 STA &10 ; sprite_address_high &1d27 b0 fe BCS &1d27 # actually BCS branch_offset ; leave &1d29 60 RTS ; replace_A_rows_of_sprite_loop &1d2a 98 TYA &1d2b f0 fc BEQ &1d29 ; leave ; branch_7 &1d2d b1 0b LDA (&0b),Y ; screen_address &1d2f 51 0f EOR (&0f),Y ; sprite_address &1d31 29 f0 AND #&f0 &1d33 51 0b EOR (&0b),Y ; screen_address &1d35 91 0b STA (&0b),Y ; screen_address &1d37 88 DEY &1d38 f0 ef BEQ &1d29 ; leave ; branch_6 &1d3a b1 0b LDA (&0b),Y ; screen_address &1d3c 51 0f EOR (&0f),Y ; sprite_address &1d3e 29 f0 AND #&f0 &1d40 51 0b EOR (&0b),Y ; screen_address &1d42 91 0b STA (&0b),Y ; screen_address &1d44 88 DEY &1d45 f0 e2 BEQ &1d29 ; leave ; branch_5 &1d47 b1 0b LDA (&0b),Y ; screen_address &1d49 51 0f EOR (&0f),Y ; sprite_address &1d4b 29 f0 AND #&f0 &1d4d 51 0b EOR (&0b),Y ; screen_address &1d4f 91 0b STA (&0b),Y ; screen_address &1d51 88 DEY &1d52 f0 d5 BEQ &1d29 ; leave ; branch_4 &1d54 b1 0b LDA (&0b),Y ; screen_address &1d56 51 0f EOR (&0f),Y ; sprite_address &1d58 29 f0 AND #&f0 &1d5a 51 0b EOR (&0b),Y ; screen_address &1d5c 91 0b STA (&0b),Y ; screen_address &1d5e 88 DEY &1d5f f0 c8 BEQ &1d29 ; leave ; branch_3 &1d61 b1 0b LDA (&0b),Y ; screen_address &1d63 51 0f EOR (&0f),Y ; sprite_address &1d65 29 f0 AND #&f0 &1d67 51 0b EOR (&0b),Y ; screen_address &1d69 91 0b STA (&0b),Y ; screen_address &1d6b 88 DEY &1d6c f0 bb BEQ &1d29 ; leave ; branch_2 &1d6e b1 0b LDA (&0b),Y ; screen_address &1d70 51 0f EOR (&0f),Y ; sprite_address &1d72 29 f0 AND #&f0 &1d74 51 0b EOR (&0b),Y ; screen_address &1d76 91 0b STA (&0b),Y ; screen_address &1d78 88 DEY &1d79 f0 ae BEQ &1d29 ; leave ; branch_1 &1d7b b1 0b LDA (&0b),Y ; screen_address &1d7d 51 0f EOR (&0f),Y ; sprite_address &1d7f 29 f0 AND #&f0 &1d81 51 0b EOR (&0b),Y ; screen_address &1d83 91 0b STA (&0b),Y ; screen_address &1d85 88 DEY &1d86 f0 2d BEQ &1db5 ; leave ; branch_0 &1d88 b1 0b LDA (&0b),Y ; screen_address &1d8a 51 0f EOR (&0f),Y ; sprite_address &1d8c 29 f0 AND #&f0 &1d8e 51 0b EOR (&0b),Y ; screen_address &1d90 91 0b STA (&0b),Y ; screen_address &1d92 88 DEY &1d93 a5 0b LDA &0b ; screen_address_low # Move to group above &1d95 e9 78 SBC #&78 &1d97 85 0b STA &0b ; screen_address_low &1d99 a5 0c LDA &0c ; screen_address_high &1d9b e9 02 SBC #&02 &1d9d 85 0c STA &0c ; screen_address_high &1d9f c9 40 CMP #&40 ; to_replace_A_rows_of_sprite_loop &1da1 b0 87 BCS &1d2a ; replace_A_rows_of_sprite_loop &1da3 49 3f EOR #&3f # Wrap around at top of screen &1da5 d0 05 BNE &1dac &1da7 98 TYA &1da8 65 0b ADC &0b ; screen_address_low &1daa b0 f5 BCS &1da1 ; to_replace_A_rows_of_sprite_loop &1dac a5 0c LDA &0c ; screen_address_high &1dae 69 40 ADC #&40 &1db0 85 0c STA &0c ; screen_address_high &1db2 38 SEC &1db3 b0 ec BCS &1da1 ; to_replace_A_rows_of_sprite_loop &1db5 60 RTS ; replace_branch_offsets_table &1db6 5f 52 45 38 2b 1e 11 04 ; calculate_screen_address &1dbe a6 13 LDX &13 ; sprite_x &1dc0 a9 00 LDA #&00 &1dc2 85 0e STA &0e ; screen_address_high &1dc4 a5 02 LDA &02 ; screen_vertical_scroll &1dc6 29 f8 AND #&f8 &1dc8 85 0d STA &0d ; screen_address_low &1dca 38 SEC &1dcb a5 14 LDA &14 ; sprite_y &1dcd e5 0d SBC &0d ; screen_address_low &1dcf 85 0d STA &0d ; screen_address_low &1dd1 38 SEC &1dd2 a9 c7 LDA #&c7 &1dd4 e5 0d SBC &0d ; screen_address_low &1dd6 a8 TAY &1dd7 29 07 AND #&07 &1dd9 85 0d STA &0d ; screen_address_low &1ddb 98 TYA &1ddc 29 f8 AND #&f8 &1dde 4a LSR A &1ddf 4a LSR A &1de0 a8 TAY &1de1 c8 INY &1de2 8a TXA &1de3 0a ASL A &1de4 26 0e ROL &0e ; screen_address_high &1de6 0a ASL A &1de7 26 0e ROL &0e ; screen_address_high &1de9 0a ASL A &1dea 26 0e ROL &0e ; screen_address_high &1dec 05 0d ORA &0d ; screen_address_low &1dee 71 e0 ADC (&e0),Y ; os_row_multiplication_table # also ADC (&00),Y ; sideways_ram_multiplication_table # in enhanced version &1df0 08 PHP &1df1 18 CLC &1df2 6d 50 03 ADC &0350 ; os_address_of_top_left_of_screen_low &1df5 85 0d STA &0d ; screen_address_low &1df7 88 DEY &1df8 b1 e0 LDA (&e0),Y ; os_row_multiplication_table # also LDA (&00),Y ; sideways_ram_multiplication_table # in enhanced version &1dfa 65 0e ADC &0e ; screen_address_high &1dfc 28 PLP &1dfd 6d 51 03 ADC &0351 ; os_address_of_top_left_of_screen_high &1e00 10 02 BPL &1e04 ; skip_wrap_around &1e02 e9 3f SBC #&3f ; skip_wrap_around &1e04 e0 a0 CPX #&a0 &1e06 90 08 BCC &1e10 ; skip_second_adjustment &1e08 e9 08 SBC #&08 &1e0a c9 40 CMP #&40 &1e0c b0 02 BCS &1e10 ; skip_second_adjustment &1e0e 69 40 ADC #&40 ; skip_second_adjustment &1e10 85 0e STA &0e ; screen_address_high &1e12 60 RTS ; scroll_to_screen_new_vertical_scroll &1e13 a5 03 LDA &03 ; screen_new_vertical_scroll &1e15 85 02 STA &02 ; screen_vertical_scroll &1e17 4c 5c 1e JMP &1e5c ; set_crtc_start_address_from_screen_start_address ; plot_rows_of_background &1e1a a5 09 LDA &09 ; rows_of_background_to_plot &1e1c d0 01 BNE &1e1f ; plot_rows_of_background_loop &1e1e 60 RTS ; plot_rows_of_background_loop &1e1f e6 02 INC &02 ; screen_vertical_scroll &1e21 a5 02 LDA &02 ; screen_vertical_scroll &1e23 29 07 AND #&07 &1e25 d0 1a BNE &1e41 ; skip_plotting_group # Plot background in eight-row groups at a time &1e27 38 SEC &1e28 ad 50 03 LDA &0350 ; os_address_of_top_left_of_screen_low &1e2b e9 80 SBC #&80 &1e2d 8d 50 03 STA &0350 ; os_address_of_top_left_of_screen_low &1e30 ad 51 03 LDA &0351 ; os_address_of_top_left_of_screen_high &1e33 e9 02 SBC #&02 &1e35 c9 40 CMP #&40 &1e37 b0 02 BCS &1e3b ; skip_wrap_around &1e39 69 40 ADC #&40 ; skip_wrap_around &1e3b 8d 51 03 STA &0351 ; os_address_of_top_left_of_screen_high &1e3e 20 95 2f JSR &2f95 ; plot_row_of_background_tiles ; skip_plotting_group &1e41 20 2c 2e JSR &2e2c ; update_stars &1e44 c6 09 DEC &09 ; rows_of_background_to_plot &1e46 d0 d7 BNE &1e1f ; plot_rows_of_background_loop &1e48 60 RTS ; set_crtc_start_address_from_screen_start_address_after_moving_up_a_group &1e49 38 SEC &1e4a a5 06 LDA &06 ; screen_start_address_low &1e4c e9 80 SBC #&80 &1e4e 85 06 STA &06 ; screen_start_address_low &1e50 a5 07 LDA &07 ; screen_start_address_high &1e52 e9 02 SBC #&02 &1e54 c9 40 CMP #&40 &1e56 b0 02 BCS &1e5a &1e58 69 40 ADC #&40 &1e5a 85 07 STA &07 ; screen_start_address_high ; set_crtc_start_address_from_screen_start_address &1e5c 08 PHP &1e5d 78 SEI &1e5e a5 06 LDA &06 ; screen_start_address_low &1e60 85 21 STA &21 ; tmp &1e62 a9 0c LDA #&0c # R12: Displayed screen start address register (high) &1e64 8d 00 fe STA &fe00 ; video register number &1e67 a5 07 LDA &07 ; screen_start_address_high &1e69 4a LSR A &1e6a 66 21 ROR &21 ; tmp &1e6c 4a LSR A &1e6d 66 21 ROR &21 ; tmp &1e6f 4a LSR A &1e70 8d 01 fe STA &fe01 ; video register value &1e73 66 21 ROR &21 &1e75 a9 0d LDA #&0d # R13: Displayed screen start address register (low) &1e77 8d 00 fe STA &fe00 ; video register number &1e7a a5 21 LDA &21 ; tmp &1e7c 8d 01 fe STA &fe01 ; video register value &1e7f 28 PLP &1e80 60 RTS ; &1e81-&1eb9 is different in standard version; see &4268-&42a0, changed at &46a2 ; &1e84-&1e86 is different during initialisation; see &425d-&425f, changed at &460b ; &1e84-&1e8f is different in enhanced version; see &42a1-&42ac, changed at &46d4 ; copy_block_A_to_address_X_Y &1e81 38 SEC &1e82 b0 0c BCS &1e90 ; always_copy_block_A_to_address_X_Y ; copy_address_of_block_A_into_zero_page_X &1e84 a8 TAY ; copy_address_of_block_Y_into_zero_page_X &1e85 b9 9c 0c LDA &0c9c,Y ; relocatable_blocks_address_table &1e88 95 00 STA &00,X &1e8a b9 9d 0c LDA &0c9d,Y ; relocatable_blocks_address_table + 1 &1e8d 95 01 STA &01,X &1e8f 60 RTS ; always_copy_block_A_to_address_X_Y &1e90 84 0e STY &0e ; target_address_high &1e92 86 0d STX &0d ; target_address_low &1e94 a8 TAY &1e95 b9 9c 0c LDA &0c9c,Y ; relocatable_blocks_address_table &1e98 85 0f STA &0f ; source_address_low &1e9a f9 9e 0c SBC &0c9e,Y ; relocatable_blocks_address_table + 2 &1e9d aa TAX ; minus_bytes_to_copy_low &1e9e b9 9d 0c LDA &0c9d,Y ; relocatable_blocks_address_table + 1 &1ea1 85 10 STA &10 ; source_address_high &1ea3 f9 9f 0c SBC &0c9f,Y ; relocatable_blocks_address_table + 3 &1ea6 85 0c STA &0c ; minus_bytes_to_copy_high &1ea8 a0 00 LDY #&00 &1eaa 08 PHP &1eab 78 SEI ; use_sideways_ram_slot &1eac a9 00 LDA #&00 # actually LDA sideways_ram_slot &1eae 8d 30 fe STA &fe30 ; Paged ROM latch # Switch to sideways RAM ; copy_block_loop &1eb1 b1 0f LDA (&0f),Y ; source_address &1eb3 91 0d STA (&0d),Y ; target_address &1eb5 c8 INY &1eb6 d0 04 BNE &1ebc &1eb8 e6 10 INC &10 ; source_address_high &1eba e6 0e INC &0e ; target_address_high &1ebc e8 INX &1ebd d0 f2 BNE &1eb1 ; copy_block_loop &1ebf e6 0c INC &0c ; minus_bytes_to_copy_high &1ec1 d0 ee BNE &1eb1 ; copy_block_loop &1ec3 28 PLP &1ec4 60 RTS ; stage_starting_values_table ; 5 6 7 8 9 a b ; s0 s1 s2 s3 Y A X ; score st wo lv &1ec5 00 00 00 00 00 00 03 ; starting_stage &80 - Baseworld "Cygni", 3 lives &1ecc 00 00 00 00 06 24 03 ; starting_stage &87 - Dustworld "Delan", 3 lives &1ed3 00 00 00 00 0c 3b 03 ; starting_stage &8e - Iceworld "Shail", 3 lives &1eda 00 00 90 99 26 3b 07 ; starting_stage &95 - Mallworld "Enola", 7 lives, starting score 9000000 (for cheat) ; write_title_screen_string &1ee1 bd 5c 04 LDA &045c,X ; title_screen_strings &1ee4 20 ee ff JSR &ffee ; OSWRCH &1ee7 e8 INX &1ee8 88 DEY &1ee9 d0 f6 BNE &1ee1 ; write_title_screen_string ; null_function &1eeb 60 RTS ; title_and_stage_screen &1eec 20 34 23 JSR &2334 ; plot_score_to_screen &1eef 20 34 23 JSR &2334 ; plot_score_to_screen &1ef2 a2 04 LDX #&04 # Set foreground colours to red and yellow &1ef4 20 a5 21 JSR &21a5 ; set_foreground_and_background_colours &1ef7 20 17 2e JSR &2e17 ; initialise_stars ; title_and_stage_screen_without_initialising_stars &1efa 20 97 21 JSR &2197 ; set_scrolling_paused_and_plot_rows_of_background &1efd a9 ff LDA #&ff &1eff 85 2c STA &2c ; scrolling_paused_but_game_continuing &1f01 85 8b STA &8b ; block_number_of_desired_music # Force reload of music &1f03 a2 00 LDX #&00 &1f05 a0 65 LDY #&65 &1f07 20 e1 1e JSR &1ee1 ; write_title_screen_string # Write all of title screen text &1f0a a2 03 LDX #&03 &1f0c a9 20 LDA #&20 ; " " &1f0e 85 92 STA &92 ; leading_character ; write_high_score_loop &1f10 b5 1b LDA &1b,X ; high_score &1f12 20 e6 34 JSR &34e6 ; write_two_digit_number &1f15 ca DEX &1f16 10 f8 BPL &1f10 ; write_high_score_loop &1f18 a9 30 LDA #&30 ; "0" &1f1a 20 ee ff JSR &ffee ; OSWRCH &1f1d 20 08 19 JSR &1908 ; title_screen_routine &1f20 20 90 23 JSR &2390 ; update_score_with_trailing_hundred ; check_for_cheat &1f23 a9 df LDA #&df ; f0 # If f0 and f9 are pressed, &1f25 20 17 22 JSR &2217 ; check_for_key_press &1f28 10 24 BPL &1f4e ; cheat_not_pressed &1f2a a9 88 LDA #&88 ; f9 &1f2c 20 17 22 JSR &2217 ; check_for_key_press &1f2f 10 1d BPL &1f4e ; cheat_not_pressed &1f31 a9 88 LDA #&88 ; f9 # change action of f9 to select final stage &1f33 8d fd 04 STA &04fd ; function_key_action_table + &18 &1f36 a9 95 LDA #&95 &1f38 8d ff 04 STA &04ff ; function_key_action_table + &1a &1f3b a9 96 LDA #&96 ; COPY # If f0, f9, COPY and SHIFT-LOCK are pressed, &1f3d 20 17 22 JSR &2217 ; check_for_key_press &1f40 10 0c BPL &1f4e ; cheat_not_pressed &1f42 a9 af LDA #&af ; SHIFT-LOCK &1f44 20 17 22 JSR &2217 ; check_for_key_press &1f47 10 05 BPL &1f4e ; cheat_not_pressed &1f49 a9 2a LDA #&2a # set number of lives for final stage to 42 &1f4b 8d e0 1e STA &1ee0 ; stage_starting_values_table + &1b ; cheat_not_pressed &1f4e a9 00 LDA #&00 &1f50 a2 03 LDX #&03 &1f52 a4 84 LDY &84 ; starting_stage &1f54 10 18 BPL &1f6e ; not_starting_new_game ; initialise_score_loop &1f56 b9 48 1e LDA &1e48,Y ; stage_starting_values_table - &7d &1f59 95 57 STA &57,X ; score &1f5b 88 DEY &1f5c ca DEX &1f5d 10 f7 BPL &1f56 ; initialise_score_loop &1f5f be 4f 1e LDX &1e4f,Y ; stage_starting_values_table - &76 # Number of lives &1f62 b9 4e 1e LDA &1e4e,Y ; stage_starting_values_table - &77 # Wave offset &1f65 48 PHA &1f66 b9 4d 1e LDA &1e4d,Y ; stage_starting_values_table - &78 # Stage offset &1f69 a8 TAY &1f6a 68 PLA &1f6b 4c 79 1f JMP &1f79 ; start_stage ; not_starting_new_game ; copy_previous_score_loop &1f6e b5 86 LDA &86,X ; previous_score &1f70 95 57 STA &57,X ; score &1f72 ca DEX &1f73 10 f9 BPL &1f6e ; copy_previous_score_loop &1f75 a5 85 LDA &85 ; previous_wave_offset &1f77 a6 8a LDX &8a ; previous_player_lives ; start_stage &1f79 85 50 STA &50 ; wave_offset &1f7b 86 6e STX &6e ; player_lives &1f7d 84 4a STY &4a ; stage_offset &1f7f a9 00 LDA #&00 &1f81 85 8c STA &8c ; inhibit_enemy_spawning &1f83 20 97 21 JSR &2197 ; set_scrolling_paused_and_plot_rows_of_background &1f86 a5 18 LDA &18 ; vsync_counter &1f88 49 80 EOR #&80 &1f8a 85 72 STA &72 ; delay_between_launch_of_homing_enemies &1f8c 20 a9 20 JSR &20a9 ; reset_stage ; into_main_game_loop_with_zero_enemies &1f8f a2 00 LDX #&00 &1f91 86 52 STX &52 ; number_of_enemies_still_to_add &1f93 e8 INX &1f94 86 3b STX &3b ; function_key_check_cooldown ; main_game_loop &1f96 20 fc 26 JSR &26fc ; check_for_fire_pressed &1f99 85 3c STA &3c ; player_fire_cooldown &1f9b 20 92 21 JSR &2192 ; unset_scrolling_paused &1f9e 20 9c 28 JSR &289c ; check_for_escape_and_handle_music_and_postponed_sounds ; update_background_and_enemies_and_player &1fa1 20 7a 27 JSR &277a ; handle_player ; update_background_and_enemies_but_not_player &1fa4 24 2d BIT &2d ; player_has_finished_exploding &1fa6 30 51 BMI &1ff9 ; end_of_playing &1fa8 20 1a 1e JSR &1e1a ; plot_rows_of_background &1fab 20 b1 28 JSR &28b1 ; handle_music_and_postponed_sounds &1fae 20 7b 32 JSR &327b ; consider_adding_enemies &1fb1 20 f0 31 JSR &31f0 ; consider_adding_homing_enemy &1fb4 20 15 31 JSR &3115 ; update_enemies_and_bullets &1fb7 24 2c BIT &2c ; scrolling_paused_but_game_continuing &1fb9 30 15 BMI &1fd0 ; player_is_dying &1fbb 24 32 BIT &32 ; stage_has_had_screen_of_blank_tiles &1fbd 10 25 BPL &1fe4 ; update_depending_on_player_energy # &80 set before start of map data &1fbf 70 09 BVS &1fca ; reset_stage_and_return_to_main_game_loop # &40 set if end of map data &1fc1 20 38 20 JSR &2038 ; end_of_stage &1fc4 20 be 20 JSR &20be ; reset_stage_variables_and_music &1fc7 4c 96 1f JMP &1f96 ; main_game_loop ; reset_stage_and_return_to_main_game_loop &1fca 20 a9 20 JSR &20a9 ; reset_stage &1fcd 4c 96 1f JMP &1f96 ; main_game_loop ; player_is_dying &1fd0 a5 6f LDA &6f ; vsync_counter_at_death_or_quit &1fd2 c5 18 CMP &18 ; vsync_counter &1fd4 10 c0 BPL &1f96 ; main_game_loop &1fd6 c6 2d DEC &2d ; player_has_finished_exploding &1fd8 20 6a 21 JSR &216a ; remove_foreground_from_entire_screen &1fdb 20 d4 31 JSR &31d4 ; reset_enemies_and_bullets &1fde c6 6e DEC &6e ; player_lives &1fe0 e6 2c INC &2c ; scrolling_paused_but_game_continuing &1fe2 10 15 BPL &1ff9 ; end_of_playing ; update_depending_on_player_energy &1fe4 a5 41 LDA &41 ; player_energy &1fe6 f0 bc BEQ &1fa4 ; update_background_and_enemies_but_not_player &1fe8 24 3a BIT &3a ; player_y_has_crossed_screen_boundary &1fea 30 b5 BMI &1fa1 ; update_background_and_enemies_and_player &1fec 20 e3 25 JSR &25e3 ; compare_player_y_against_timer_2_counter &1fef b0 b0 BCS &1fa1 ; update_background_and_enemies_and_player &1ff1 a5 41 LDA &41 ; player_energy &1ff3 c9 03 CMP #&03 &1ff5 b0 aa BCS &1fa1 ; update_background_and_enemies_and_player &1ff7 90 ab BCC &1fa4 ; update_background_and_enemies_but_not_player ; end_of_playing &1ff9 20 92 21 JSR &2192 ; unset_scrolling_paused &1ffc a5 6e LDA &6e ; player_lives &1ffe 30 35 BMI &2035 ; not_new_high_score &2000 f0 1e BEQ &2020 ; compare_score_against_high_score &2002 a5 7a LDA &7a ; rows_into_stage &2004 48 PHA &2005 24 49 BIT &49 ; before_during_or_after_main_map # &40 set if at devil rock or end launch &2007 08 PHP &2008 20 be 20 JSR &20be ; reset_stage_variables_and_music &200b 28 PLP &200c 50 03 BVC &2011 ; not_at_devil_rock &200e 20 14 2a JSR &2a14 ; end_of_stage ; not_at_devil_rock &2011 68 PLA &2012 38 SEC &2013 e9 0f SBC #&0f # Move back 15 rows &2015 b0 02 BCS &2019 ; skip_floor &2017 a9 00 LDA #&00 # but not before start of stage ; skip_floor &2019 aa TAX &201a 20 3c 21 JSR &213c ; stop_music_and_scroll_into_position_on_stage &201d 4c 8f 1f JMP &1f8f ; into_main_game_loop_with_zero_enemies ; compare_score_against_high_score &2020 a2 fc LDX #&fc &2022 38 SEC ; compare_score_against_high_score_loop &2023 b5 5b LDA &5b,X ; score + 4 &2025 f5 1f SBC &1f,X ; high_score + 3 &2027 e8 INX &2028 d0 f9 BNE &2023 ; compare_score_against_high_score_loop &202a 90 09 BCC &2035 ; not_new_high_score &202c a2 fc LDX #&fc ; set_high_score_loop &202e b5 5b LDA &5b,X ; score + 4 &2030 95 1f STA &1f,X ; high_score + 3 &2032 e8 INX &2033 d0 f9 BNE &202e ; set_high_score_loop ; not_new_high_score &2035 4c fa 1e JMP &1efa ; title_and_stage_screen_without_initialising_stars ; end_of_stage &2038 24 49 BIT &49 ; before_during_or_after_main_map # &80 set if on starting launch &203a 30 35 BMI &2071 ; end_of_launch_stage &203c a5 79 LDA &79 ; first_byte_of_stage_flags &203e 29 10 AND #&10 &2040 f0 0b BEQ &204d ; not_end_of_commspace # Is this the end of a CommSpace stage? &2042 20 1a 26 JSR &261a ; play_end_of_stage_chord &2045 a4 6e LDY &6e ; player_lives &2047 c0 03 CPY #&03 &2049 b0 02 BCS &204d ; not_end_of_commspace &204b e6 6e INC &6e ; player_lives # If so, grant an extra life ; not_end_of_commspace &204d a9 00 LDA #&00 &204f 85 8c STA &8c ; inhibit_enemy_spawning &2051 a6 4a LDX &4a ; stage_offset &2053 e8 INX &2054 e8 INX &2055 e0 2c CPX #&2c &2057 90 37 BCC &2090 ; continue_to_next_stage # Has the played finished the final stage? ; &2059-&206a is different in standard version; see &42ad-&42be, changed at &4626 ; end_screen_routine # If so, show the end of game screen ; call_to_null_function_instruction_four &2059 20 eb 1e JSR &1eeb ; null_function # actually BIT &1eeb # Always commented out, but wouldn't do anything anyway &205c a9 1a LDA #&1a ; sideways_ram_completion_data &205e a2 00 LDX #&00 &2060 a0 26 LDY #&26 ; &2600 = sideways_ram_completion_data &2062 20 81 1e JSR &1e81 ; copy_block_A_to_address_X_Y # Copy sideways_ram_completion_data to &2600-&31d2 ; wait_for_space_to_be_pressed &2065 20 15 22 JSR &2215 ; check_for_space_press &2068 10 fb BPL &2065 ; wait_for_space_to_be_pressed &206a 78 SEI &206b 20 8b 26 JSR &268b ; sideways_ram_completion_screen &206e 4c 20 20 JMP &2020 ; compare_score_against_high_score ; end_of_launch_stage &2071 a6 4a LDX &4a ; stage_offset &2073 a4 6e LDY &6e ; player_lives &2075 c0 03 CPY #&03 # Did the player clear the previous world with three &2077 90 17 BCC &2090 ; continue_to_next_stage # or more lives? &2079 e0 26 CPX #&26 # If so, is this world Enola? &207b b0 13 BCS &2090 ; continue_to_next_stage &207d 86 84 STX &84 ; starting_stage # If not, use this world as the start for future games &207f 84 8a STY &8a ; previous_player_lives &2081 a5 50 LDA &50 ; wave_offset &2083 85 85 STA &85 ; previous_wave_offset &2085 a0 04 LDY #&04 ; copy_score_loop &2087 b9 56 00 LDA &0056,Y ; score - 1 &208a 99 85 00 STA &0085,Y ; previous_score - 1 &208d 88 DEY &208e d0 f7 BNE &2087 ; copy_score_loop ; continue_to_next_stage &2090 86 4a STX &4a ; stage_offset &2092 a9 00 LDA #&00 &2094 85 7a STA &7a ; rows_into_stage ; reset_stage_bonuses &2096 a9 00 LDA #&00 &2098 85 80 STA &80 ; stage_bonus_count ; wipe_record_of_destroyed_background &209a a9 0c LDA #&0c # Twelve question marks need destroying for bonus &209c 85 7f STA &7f ; question_marks_or_reactors_destroyed # (also doubles as count of reactors destroyed) &209e a9 00 LDA #&00 &20a0 a2 40 LDX #&40 ; wipe_record_of_destroyed_background_loop &20a2 9d bf 09 STA &09bf,X ; record_of_destroyed_background - 1 # Wipe &09c0-&09ff &20a5 ca DEX &20a6 d0 fa BNE &20a2 ; wipe_record_of_destroyed_background_loop &20a8 60 RTS ; reset_stage &20a9 20 96 20 JSR &2096 ; reset_stage_bonuses &20ac 20 2a 21 JSR &212a ; reset_stage_variables &20af a9 80 LDA #&80 # &80 set to indicate starting launch &20b1 85 49 STA &49 ; before_during_or_after_main_map &20b3 20 d4 31 JSR &31d4 ; reset_enemies_and_bullets &20b6 20 e7 29 JSR &29e7 ; initialise_stage &20b9 a2 0e LDX #&0e # Start at row 14 &20bb 4c 3c 21 JMP &213c ; stop_music_and_scroll_into_position_on_stage ; reset_stage_variables_and_music &20be 20 2a 21 JSR &212a ; reset_stage_variables &20c1 20 c7 20 JSR &20c7 ; get_stage_flags # Returns X = map, A = big target variant &20c4 4c 7f 2a JMP &2a7f ; reinitialise_map_sprites_colours_and_music ; get_stage_flags &20c7 a6 4a LDX &4a ; stage_offset &20c9 bc 22 06 LDY &0622,X ; stage_data_table + 1 &20cc e0 0c CPX #&0c # "Shail" &20ce f0 04 BEQ &20d4 ; stage_doesn't_have_enemies &20d0 e0 16 CPX #&16 # and "Hanah" have no enemies &20d2 d0 04 BNE &20d8 ; stage_has_enemies ; stage_doesn't_have_enemies &20d4 a9 40 LDA #&40 # &40 set to inhibit enemy spawning &20d6 85 8c STA &8c ; inhibit_enemy_spawning ; stage_has_enemies # From the second byte of stage data, &20d8 98 TYA &20d9 29 03 AND #&03 # low two bits set number of homing enemies &20db 85 70 STA &70 ; maximum_number_of_homing_enemies_minus_one &20dd 98 TYA &20de 4a LSR A &20df 4a LSR A &20e0 29 03 AND #&03 # next lowest two bits set number of enemies &20e2 85 83 STA &83 ; reduction_in_enemies_per_wave &20e4 98 TYA &20e5 29 f0 AND #&f0 # next four bits set wave energy &20e7 0a ASL A &20e8 08 PHP &20e9 18 CLC &20ea 69 c0 ADC #&c0 &20ec 85 6b STA &6b ; wave_energy_delta_low &20ee a9 00 LDA #&00 &20f0 85 56 STA &56 ; use_hexagonal_background &20f2 2a ROL A &20f3 28 PLP &20f4 69 00 ADC #&00 &20f6 85 6c STA &6c ; wave_energy_delta_high &20f8 bd 21 06 LDA &0621,X ; stage_data_table &20fb 85 79 STA &79 ; first_byte_of_stage_flags &20fd 0a ASL A &20fe 29 c0 AND #&c0 &2100 85 82 STA &82 ; stage_enemy_flags # First byte of stage data, & &60 * 2 &2102 a5 79 LDA &79 ; first_byte_of_stage_flags &2104 29 1c AND #&1c &2106 aa TAX # X is map &2107 a0 16 LDY #&16 ; track_0 &2109 29 10 AND #&10 &210b f0 02 BEQ &210f ; use_music_track_0 &210d a0 18 LDY #&18 ; track_1 # CommSpace stages use different music ; use_music_track_0 &210f c4 8b CPY &8b ; block_number_of_desired_music &2111 f0 0a BEQ &211d ; keep_position_in_music &2113 84 8b STY &8b ; block_number_of_desired_music &2115 a0 ff LDY #&ff &2117 84 69 STY &69 ; music_bar &2119 a0 01 LDY #&01 &211b 84 5c STY &5c ; music_notes_left_in_bar ; keep_position_in_music &211d a5 79 LDA &79 ; first_byte_of_stage_flags &211f 29 03 AND #&03 &2121 4a LSR A &2122 90 02 BCC &2126 ; not_hexagonal_background &2124 c6 56 DEC &56 ; use_hexagonal_background # Set to &ff if lowest bit of stage flags set ; not_hexagonal_background &2126 2a ROL A &2127 69 01 ADC #&01 # Leaves with A = big target variant (flags & 3 + 1) &2129 60 RTS # X = map (flags & &1c) ; reset_stage_variables &212a a9 40 LDA #&40 &212c 85 25 STA &25 ; scrolling_paused # &40 set when in title screen &212e a0 01 LDY #&01 &2130 84 71 STY &71 ; number_of_homing_enemies_still_to_add &2132 88 DEY &2133 84 2c STY &2c ; scrolling_paused_but_game_continuing &2135 84 2d STY &2d ; player_has_finished_exploding &2137 84 3e STY &3e ; number_of_blank_rows_before_next_map &2139 84 49 STY &49 ; before_during_or_after_main_map &213b 60 RTS ; stop_music_and_scroll_into_position_on_stage # Called with X = rows_into_stage &213c a9 23 LDA #&23 &213e 85 5b STA &5b ; music_beat_cooldown # Prevent the music from continuing &2140 a9 00 LDA #&00 &2142 85 6a STA &6a ; music_beats_missing &2144 8a TXA &2145 48 PHA &2146 a9 15 LDA #&15 ; Flush Selected Buffer &2148 a2 04 LDX #&04 ; sound channel 0 ; flush_channels_loop &214a 20 f4 ff JSR &fff4 ; OSBYTE # Flush sound channels 0 - 3 &214d e8 INX &214e e0 08 CPX #&08 &2150 d0 f8 BNE &214a ; flush_channels_loop &2152 a2 00 LDX #&00 &2154 20 c3 21 JSR &21c3 ; set_background_colours_to_set_X # Temporarily hide changes to screen &2157 68 PLA &2158 aa TAX # X = rows_into_stage &2159 20 22 2f JSR &2f22 ; scroll_into_position_on_stage &215c 20 13 1e JSR &1e13 ; scroll_to_screen_new_vertical_scroll &215f 4c 24 27 JMP &2724 ; initialise_player ; delay_for_A_vsyncs &2162 18 CLC &2163 65 18 ADC &18 ; vsync_counter ; delay_for_A_vsyncs_loop &2165 c5 18 CMP &18 ; vsync_counter &2167 10 fc BPL &2165 ; delay_for_A_vsyncs_loop &2169 60 RTS ; remove_foreground_from_entire_screen &216a a0 00 LDY #&00 &216c 84 0d STY &0d ; screen_address_low &216e 20 bd 21 JSR &21bd ; set_eight_colours_from_Y_to_stage_set # Set all sixteen colours to background colours &2171 20 bd 21 JSR &21bd ; set_eight_colours_from_Y_to_stage_set &2174 a9 40 LDA #&40 &2176 85 0e STA &0e ; screen_address_high ; remove_foreground_from_entire_screen_outer_loop &2178 a0 00 LDY #&00 ; remove_foreground_from_entire_screen_loop &217a b1 0d LDA (&0d),Y ; screen_address &217c 29 0f AND #&0f &217e 91 0d STA (&0d),Y ; screen_address &2180 c8 INY &2181 d0 f7 BNE &217a ; remove_foreground_from_entire_screen_loop &2183 20 b1 28 JSR &28b1 ; handle_music_and_postponed_sounds &2186 e6 0e INC &0e ; screen_address_high &2188 10 ee BPL &2178 ; remove_foreground_from_entire_screen_outer_loop &218a 20 34 23 JSR &2334 ; plot_score_to_screen &218d a6 39 LDX &39 ; stage_foreground_colours # Restore foreground colours &218f 4c a5 21 JMP &21a5 ; set_foreground_and_background_colours ; unset_scrolling_paused &2192 a9 00 LDA #&00 &2194 85 25 STA &25 ; scrolling_paused ; leave &2196 60 RTS ; set_scrolling_paused_and_plot_rows_of_background &2197 a9 ff LDA #&ff &2199 85 25 STA &25 ; scrolling_paused &219b 4c 1a 1e JMP &1e1a ; plot_rows_of_background ; keyboard_routine &219e 90 f6 BCC &2196 ; leave # Only pass keyboard scans to previous vector, not &21a0 70 f4 BVS &2196 ; leave # keypress interrupts, timer interrupts, modifier tests &21a2 4c ff ff JMP &ffff # actually JMP previous_keyboard_vector ; set_foreground_and_background_colours # Called with X = foreground colour set &21a5 a9 00 LDA #&00 &21a7 85 94 STA &94 ; allow_dark_colours &21a9 a0 04 LDY #&04 &21ab 20 c9 21 JSR &21c9 ; set_four_colours_from_Y # Colours 4-7 are red/magenta foreground &21ae a0 0c LDY #&0c &21b0 20 c9 21 JSR &21c9 ; set_four_colours_from_Y # Colours 12-15 are yellow/white foreground &21b3 a0 08 LDY #&08 &21b5 24 79 BIT &79 ; first_byte_of_stage_flags # If the stage is dark, &21b7 30 07 BMI &21c0 ; set_four_colours_from_Y_to_stage_set # colours 8-11 are the background colours &21b9 a2 00 LDX #&00 &21bb 10 0c BPL &21c9 ; set_four_colours_from_Y # Otherwise, colours 8-11 are black foreground ; set_eight_colours_from_Y_to_stage_set # Set colours Y-Y+7 to be background colours &21bd 20 c0 21 JSR &21c0 ; set_four_colours_from_Y_to_stage_set ; set_four_colours_from_Y_to_stage_set # Set colours Y-Y+3 to be background colours &21c0 a6 38 LDX &38 ; stage_background_colours &21c2 2c a0 00 BIT &00a0 ; set_background_colours_to_set_X # Set colours 0-3 to be background colours #21c3 a0 00 LDY #&00 &21c5 a9 ff LDA #&ff &21c7 85 94 STA &94 ; allow_dark_colours ; set_four_colours_from_Y ; set_colours_loop &21c9 98 TYA &21ca 0a ASL A &21cb 0a ASL A &21cc 0a ASL A &21cd 0a ASL A &21ce 85 92 STA &92 ; logical_colour_as_high_nibble &21d0 84 93 STY &93 ; logical_colour_as_low_nibble &21d2 98 TYA &21d3 29 03 AND #&03 &21d5 a8 TAY &21d6 98 TYA &21d7 4a LSR A &21d8 bd d9 05 LDA &05d9,X ; colour_table # One byte encodes two colours as two nibbles &21db 90 05 BCC &21e2 ; use_low_nibble &21dd 4a LSR A &21de 4a LSR A &21df 4a LSR A &21e0 4a LSR A &21e1 e8 INX ; use_low_nibble &21e2 24 79 BIT &79 ; first_byte_of_stage_flags &21e4 10 1d BPL &2203 ; use_table_colour # Is the stage dark? If not, use colour from table &21e6 24 94 BIT &94 ; allow_dark_colours &21e8 10 19 BPL &2203 ; use_table_colour # If setting all colours, also use colour from table &21ea c0 01 CPY #&01 &21ec f0 0e BEQ &21fc ; store_colour_and_use_black # Otherwise, use black for colour 1 &21ee c0 03 CPY #&03 &21f0 f0 0f BEQ &2201 ; use_stored_colour # Use the stored colour 1 for colour 3 (dark background) &21f2 c0 02 CPY #&02 &21f4 f0 0d BEQ &2203 ; use_table_colour # Use colour from table for colour 2 (background light) &21f6 b0 0b BCS &2203 ; use_table_colour # Use colour from table for all foreground colours &21f8 a9 00 LDA #&00 ; K &21fa f0 07 BEQ &2203 ; use_table_colour # Use black for colour 0 ; store_colour_and_use_black &21fc 85 95 STA &95 ; stored_colour &21fe a9 00 LDA #&00 ; K &2200 2c a5 95 BIT &95a5 ; use_stored_colour #2101 a5 95 LDA &95 ; stored_colour ; use_table_colour &2203 29 0f AND #&0f &2205 05 92 ORA &92 ; logical_colour_as_high_nibble &2207 49 07 EOR #&07 &2209 8d 21 fe STA &fe21 ; video ULA palette register # Set colour &220c a4 93 LDY &93 ; logical_colour_as_low_nibble &220e c8 INY &220f 98 TYA &2210 29 03 AND #&03 &2212 d0 b5 BNE &21c9 ; set_colours_loop &2214 60 RTS ; check_for_space_press &2215 a9 9d LDA #&9d ; SPACE ; check_for_key_press &2217 85 92 STA &92 ; key_to_check &2219 8a TXA &221a 48 PHA &221b 98 TYA &221c 48 PHA &221d a6 92 LDX &92 ; key_to_check &221f a0 ff LDY #&ff &2221 a9 81 LDA #&81 ; Scan for a particular key &2223 20 f4 ff JSR &fff4 ; OSBYTE &2226 84 92 STY &92 ; result &2228 68 PLA &2229 a8 TAY &222a 68 PLA &222b aa TAX &222c a5 92 LDA &92 ; result # Returns &ff if key pressed, &00 if not &222e 60 RTS ; call_routine &222f 6c 90 00 JMP (&0090) ; routine_address ; get_random_number &2232 a5 4e LDA &4e ; rnd &2234 6d 69 fe ADC &fe69 ; User VIA timer 2 counter MSB &2237 4a LSR A &2238 26 4e ROL &4e ; rnd &223a a5 4e LDA &4e ; rnd &223c 69 8e ADC #&8e &223e 85 4e STA &4e ; rnd &2240 45 fc EOR &fc ; os_accumulator_saved_in_irq_routine &2242 60 RTS ; timer2_frame_routine # Called by initialisation_part_three at &4573 # and then every time User VIA Timer 2 times out &2243 8a TXA &2244 48 PHA &2245 a5 25 LDA &25 ; scrolling_paused &2247 05 2c ORA &2c ; scrolling_paused_but_game_continuing &2249 d0 2e BNE &2279 ; skip_scrolling &224b a5 18 LDA &18 ; vsync_counter &224d 4a LSR A &224e 24 49 BIT &49 ; before_during_or_after_main_map # &40 set if at devil rock or end launch &2250 50 02 BVC &2254 ; not_at_end_of_stage &2252 b0 25 BCS &2279 ; skip_scrolling # Scroll half as fast for end of stage ; not_at_end_of_stage &2254 a9 ff LDA #&ff &2256 85 08 STA &08 ; rows_to_scroll # Scroll one row &2258 a9 07 LDA #&07 &225a 70 14 BVS &2270 ; single_row_scroll &225c 24 8c BIT &8c ; inhibit_enemy_spawning # &40 set if stage has no enemies &225e 50 10 BVC &2270 ; single_row_scroll # Scroll twice as fast if stage has no enemies &2260 b0 0e BCS &2270 ; single_row_scroll &2262 a5 06 LDA &06 ; screen_start_address_low &2264 85 f8 STA &f8 ; other_screen_start_address_low &2266 a5 07 LDA &07 ; screen_start_address_high &2268 85 f9 STA &f9 ; other_screen_start_address_high &226a c6 08 DEC &08 ; rows_to_scroll # Scroll two rows &226c e6 03 INC &03 ; screen_new_vertical_scroll &226e a9 06 LDA #&06 ; single_row_scroll &2270 e6 03 INC &03 ; screen_new_vertical_scroll &2272 24 03 BIT &03 ; screen_new_vertical_scroll &2274 d0 03 BNE &2279 ; skip_scrolling # Would scrolling rows move to the next group? &2276 20 49 1e JSR &1e49 ; set_crtc_start_address_from_screen_start_address_after_moving_up_a_group ; skip_scrolling &2279 a9 70 LDA #&70 &227b 8d 68 fe STA &fe68 ; User VIA timer 2 counter LSB &227e a9 97 LDA #&97 &2280 8d 64 fe STA &fe64 ; User VIA timer 1 counter LSB &2283 a9 02 LDA #&02 &2285 85 54 STA &54 ; frame_routine_state # &02 = after v-sync # i.e. call timer1_frame_routine_part_one next &2287 8d 46 fe STA &fe46 ; System VIA timer 1 latch LSB # First half of setting counter at &256f ; wait_for_vsync_interrupt &228a 2c 4d fe BIT &fe4d ; System VIA interrupt flag register # &02 is set when System VIA CA1 (i.e. a v-sync) occurs &228d f0 fb BEQ &228a ; wait_for_vsync_interrupt &228f a9 10 LDA #&10 &2291 8d 65 fe STA &fe65 ; User VIA timer 1 counter MSB # Set User VIA Timer 1 to &1097 (4247) &2294 a9 4a LDA #&4a &2296 8d 69 fe STA &fe69 ; User VIA timer 2 counter MSB # Set User VIA Timer 2 to &4a70 (19056) &2299 a9 00 LDA #&00 &229b 8d 66 fe STA &fe66 ; User VIA timer 1 latch LSB &229e 8d 4b fe STA &fe4b ; System VIA auxilliary control register # Set System VIA Timer 1 to generate single interrupt &22a1 a2 2e LDX #&2e &22a3 a5 03 LDA &03 ; screen_new_vertical_scroll &22a5 29 06 AND #&06 &22a7 d0 01 BNE &22aa ; longer_delay &22a9 ca DEX # User VIA Timer 1 latch is either &2d00 or &2e00 ; longer_delay &22aa 8e 67 fe STX &fe67 ; User VIA timer 1 latch MSB # Set delay between first and second Timer 1 parts &22ad a9 05 LDA #&05 # R5: Vertical total adjust register &22af 8d 00 fe STA &fe00 ; video register number &22b2 a9 00 LDA #&00 &22b4 24 0a BIT &0a ; use_normal_top_and_bottom_groups &22b6 30 04 BMI &22bc ; set_register &22b8 a5 03 LDA &03 ; screen_new_vertical_scroll &22ba 29 07 AND #&07 ; set_register &22bc 8d 01 fe STA &fe01 ; video register value # Move the entire display up by (scroll & 7) lines # This positions the (scroll & 7)th line at what the # player sees as the top of the screen &22bf 49 0f EOR #&0f &22c1 85 05 STA &05 ; scan_lines_in_bottom_group # Note how many rows for the bottom group &22c3 c9 0e CMP #&0e &22c5 a9 04 LDA #&04 &22c7 69 00 ADC #&00 &22c9 85 04 STA &04 ; delay_for_final_rows &22cb 24 73 BIT &73 ; screen_tweak_enabled &22cd 10 17 BPL &22e6 ; skip_ula_change # Is the screen tweak enabled? If so, &22cf 24 0a BIT &0a ; use_normal_top_and_bottom_groups &22d1 30 13 BMI &22e6 ; skip_ula_change &22d3 a2 04 LDX #&04 # MODE 2, but with low frequency clock &22d5 a9 14 LDA #&14 # MODE 2, but with no cursor (top three bits unset) &22d7 8e 20 fe STX &fe20 ; video ULA control register # Set ULA to low frequency clock &22da a2 1f LDX #&1f # actually LDX &22db ; screen_tweak_delay_length ; screen_tweak_delay_loop &22dc 24 00 BIT &00 # 3 cycles &22de ca DEX # 2 cycles &22df d0 fb BNE &22dc ; screen_tweak_delay_loop # 3 cycles if branch taken, i.e. 8 cycles per loop &22e1 24 00 BIT &00 &22e3 8d 20 fe STA &fe20 ; video ULA control register # Return ULA to high frequency clock ; skip_ula_change &22e6 38 SEC &22e7 a5 03 LDA &03 ; screen_new_vertical_scroll &22e9 ed 26 0f SBC &0f26 ; player_sprite_y &22ec c9 ce CMP #&ce &22ee 66 3a ROR &3a ; player_y_has_crossed_screen_boundary &22f0 a9 40 LDA #&40 # Set User VIA Timer 1 to generate repeated interrupts &22f2 8d 6b fe STA &fe6b ; User VIA auxilliary control register # and User VIA Timer 2 to generate single interrupt &22f5 a9 e0 LDA #&e0 # Enable both User VIA Timer 1 and User VIA Timer 2 &22f7 8d 6e fe STA &fe6e ; User VIA interrupt enable register # When User VIA Timer 1 times out, # timer1_frame_routine_part_one will be called # (at start of invisible part of screen) # When User VIA Timer 2 times out, # timer2_frame_routine will be called again # (at start of next frame) &22fa a5 25 LDA &25 ; scrolling_paused &22fc 05 2c ORA &2c ; scrolling_paused_but_game_continuing &22fe d0 26 BNE &2326 ; skip_scroll &2300 a5 08 LDA &08 ; rows_to_scroll &2302 f0 22 BEQ &2326 ; skip_scroll # Is the screen being scrolled? &2304 98 TYA &2305 48 PHA &2306 a5 08 LDA &08 ; rows_to_scroll &2308 c9 ff CMP #&ff &230a 10 13 BPL &231f ; single_row_to_scroll # by two rows? &230c c6 03 DEC &03 ; screen_new_vertical_scroll # Undo the second row &230e a5 03 LDA &03 ; screen_new_vertical_scroll &2310 29 07 AND #&07 &2312 a2 06 LDX #&06 &2314 c9 07 CMP #&07 &2316 d0 02 BNE &231a ; not_new_group &2318 a2 f8 LDX #&f8 ; not_new_group &231a 20 b7 23 JSR &23b7 ; scroll_score_with_screen # Move the score up a row &231d e6 03 INC &03 ; screen_new_vertical_scroll # Redo the second row ; single_row_to_scroll &231f a2 06 LDX #&06 &2321 20 b7 23 JSR &23b7 ; scroll_score_with_screen # Move the score up a row &2324 68 PLA &2325 a8 TAY ; skip_scroll &2326 a2 03 LDX #&03 &2328 b5 61 LDA &61,X ; sound_channels_cooldown &232a f0 02 BEQ &232e &232c d6 61 DEC &61,X ; sound_channels_cooldown &232e ca DEX &232f 10 f7 BPL &2328 &2331 68 PLA &2332 aa TAX &2333 60 RTS ; plot_score_to_screen &2334 20 a3 24 JSR &24a3 ; update_score &2337 a0 70 LDY #&70 &2339 a9 00 LDA #&00 &233b 85 92 STA &92 ; previous_eor ; process_score_image_buffer_loop &233d b9 7c 10 LDA &107c,Y ; score_image_buffer - 1 &2340 aa TAX # Unnecessary instruction &2341 45 92 EOR &92 ; previous_eor # Each byte of the butter is EORed with the previous &2343 99 7c 10 STA &107c,Y ; score_image_buffer - 1 # one to allow the score to be scrolled using EORs &2346 85 92 STA &92 ; previous_eor # instead of having to calculate the foreground too &2348 98 TYA &2349 29 07 AND #&07 &234b c9 01 CMP #&01 &234d d0 04 BNE &2353 ; not_start_of_group &234f a9 00 LDA #&00 &2351 85 92 STA &92 ; previous_eor ; not_start_of_group &2353 88 DEY &2354 d0 e7 BNE &233d ; process_score_image_buffer_loop &2356 a2 06 LDX #&06 ; use screen_start_address &2358 20 99 23 JSR &2399 ; calculate_screen_address_for_score &235b 84 97 STY &97 ; score_screen_address_high &235d 86 96 STX &96 ; score_screen_address_low &235f a9 01 LDA #&01 &2361 85 98 STA &98 ; row ; plot_score_to_screen_loop &2363 a9 68 LDA #&68 &2365 a8 TAY &2366 05 98 ORA &98 ; row &2368 aa TAX &2369 38 SEC ; plot_score_to_screen_digit_loop # Plot one row of each digit in score &236a b1 96 LDA (&96),Y ; score_screen_address &236c 29 0f AND #&0f &236e 1d 7d 10 ORA &107d,X ; score_image_buffer &2371 91 96 STA (&96),Y ; score_screen_address &2373 8a TXA &2374 e9 08 SBC #&08 &2376 aa TAX &2377 98 TYA &2378 e9 08 SBC #&08 &237a a8 TAY &237b b0 ed BCS &236a ; plot_score_to_screen_digit_loop &237d a4 97 LDY &97 ; score_screen_address_high &237f a6 96 LDX &96 ; score_screen_address_low &2381 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &2384 84 97 STY &97 ; score_screen_address_high &2386 86 96 STX &96 ; score_screen_address_low &2388 e6 98 INC &98 ; row &238a a5 98 LDA &98 ; row &238c c9 08 CMP #&08 &238e 90 d3 BCC &2363 ; plot_score_to_screen_loop ; update_score_with_trailing_hundred &2390 20 a3 24 JSR &24a3 ; update_score &2393 a9 00 LDA #&00 &2395 38 SEC &2396 4c c0 24 JMP &24c0 ; update_single_digit_of_score ; calculate_screen_address_for_score # Called with X = &06 or &f8 &2399 b4 01 LDY &01,X ; screen_start_address_high for X = &06, other_screen_start_address_high for X = &f8 &239b a5 03 LDA &03 ; screen_new_vertical_scroll &239d 49 ff EOR #&ff &239f 29 07 AND #&07 &23a1 15 00 ORA &00,X ; screen_start_address_low for X = &06, other_screen_start_address_low for X= &f8 &23a3 aa TAX &23a4 a5 73 LDA &73 ; screen_tweak_enabled # rows = &09 if f5 screen tweak enabled, &0a if not &23a6 29 03 AND #&03 &23a8 49 0a EOR #&0a &23aa 08 PHP &23ab 78 SEI &23ac 85 21 STA &21 ; rows ; loop &23ae 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &23b1 c6 21 DEC &21 ; rows &23b3 d0 f9 BNE &23ae ; loop &23b5 28 PLP &23b6 60 RTS # Leave with screen address in X, Y ; scroll_score_with_screen # Called with X = &06 or &f8 &23b7 20 99 23 JSR &2399 ; calculate_screen_address_for_score &23ba 8c 34 24 STY &2434 ; lda_score_address_0_high &23bd 8e 33 24 STX &2433 ; lda_score_address_0_low &23c0 8c 3a 24 STY &243a ; sta_score_address_0_high &23c3 8e 39 24 STX &2439 ; lda_score_address_0_low &23c6 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &23c9 8c 3d 24 STY &243d ; lda_score_address_1_high &23cc 8e 3c 24 STX &243c ; lda_score_address_1_low &23cf 8c 43 24 STY &2443 ; sta_score_address_1_high &23d2 8e 42 24 STX &2442 ; lda_score_address_1_low &23d5 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &23d8 8c 46 24 STY &2446 ; lda_score_address_2_high &23db 8e 45 24 STX &2445 ; lda_score_address_2_low &23de 8c 4c 24 STY &244c ; sta_score_address_2_high &23e1 8e 4b 24 STX &244b ; lda_score_address_2_low &23e4 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &23e7 8c 4f 24 STY &244f ; lda_score_address_3_high &23ea 8e 4e 24 STX &244e ; lda_score_address_3_low &23ed 8c 55 24 STY &2455 ; sta_score_address_3_high &23f0 8e 54 24 STX &2454 ; lda_score_address_3_low &23f3 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &23f6 8c 58 24 STY &2458 ; lda_score_address_4_high &23f9 8e 57 24 STX &2457 ; lda_score_address_4_low &23fc 8c 5e 24 STY &245e ; sta_score_address_4_high &23ff 8e 5d 24 STX &245d ; lda_score_address_4_low &2402 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &2405 8c 61 24 STY &2461 ; lda_score_address_5_high &2408 8e 60 24 STX &2460 ; lda_score_address_5_low &240b 8c 67 24 STY &2467 ; sta_score_address_5_high &240e 8e 66 24 STX &2466 ; lda_score_address_5_low &2411 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &2414 8c 6a 24 STY &246a ; lda_score_address_6_high &2417 8e 69 24 STX &2469 ; lda_score_address_6_low &241a 8c 70 24 STY &2470 ; sta_score_address_6_high &241d 8e 6f 24 STX &246f ; lda_score_address_6_low &2420 20 80 24 JSR &2480 ; increase_screen_address_in_x_y_by_one_pixel_down &2423 8c 73 24 STY &2473 ; lda_score_address_7_high &2426 8e 72 24 STX &2472 ; lda_score_address_7_low &2429 8c 78 24 STY &2478 ; sta_score_address_7_high &242c 8e 77 24 STX &2477 ; lda_score_address_7_low &242f a0 68 LDY #&68 &2431 38 SEC ; scroll_score_with_screen_loop &2432 b9 ff ff LDA &ffff,Y # actually LDA score_address_0,Y &2435 59 7d 10 EOR &107d,Y ; score_image_buffer &2438 99 ff ff STA &ffff,Y # actually STA score_address_0,Y &243b b9 ff ff LDA &ffff,Y # actually LDA score_address_1,Y &243e 59 7e 10 EOR &107e,Y ; score_image_buffer + 1 &2441 99 ff ff STA &ffff,Y # actually STA score_address_1,Y &2444 b9 ff ff LDA &ffff,Y # actually LDA score_address_2,Y &2447 59 7f 10 EOR &107f,Y ; score_image_buffer + 2 &244a 99 ff ff STA &ffff,Y # actually STA score_address_2,Y &244d b9 ff ff LDA &ffff,Y # actually LDA score_address_3,Y &2450 59 80 10 EOR &1080,Y ; score_image_buffer + 3 &2453 99 ff ff STA &ffff,Y # actually STA score_address_3,Y &2456 b9 ff ff LDA &ffff,Y # actually LDA score_address_4,Y &2459 59 81 10 EOR &1081,Y ; score_image_buffer + 4 &245c 99 ff ff STA &ffff,Y # actually STA score_address_4,Y &245f b9 ff ff LDA &ffff,Y # actually LDA score_address_5,Y &2462 59 82 10 EOR &1082,Y ; score_image_buffer + 5 &2465 99 ff ff STA &ffff,Y # actually STA score_address_5,Y &2468 b9 ff ff LDA &ffff,Y # actually LDA score_address_6,Y &246b 59 83 10 EOR &1083,Y ; score_image_buffer + 6 &246e 99 ff ff STA &ffff,Y # actually STA score_address_6,Y &2471 b9 ff ff LDA &ffff,Y # actually LDA score_address_7,Y &2474 29 0f AND #&0f &2476 99 ff ff STA &ffff,Y # actually STA score_address_7,Y &2479 98 TYA &247a e9 08 SBC #&08 &247c a8 TAY &247d b0 b3 BCS &2432 ; scroll_score_with_screen_loop &247f 60 RTS ; increase_screen_address_in_x_y_by_one_pixel_down &2480 e8 INX # Move one byte down &2481 8a TXA &2482 24 2a BIT &2a ; seven &2484 d0 0e BNE &2494 ; leave # Does this move into a new group? &2486 ca DEX &2487 18 CLC &2488 8a TXA &2489 69 79 ADC #&79 # If so, add an additional &279 to screen address in XY &248b aa TAX &248c 98 TYA &248d 69 02 ADC #&02 &248f 10 02 BPL &2493 ; skip_wrap_around &2491 e9 3f SBC #&3f # Wrap around at bottom of screen ; skip_wrap_around &2493 a8 TAY &2494 60 RTS ; increase_score &2495 18 CLC &2496 f8 SED &2497 a2 fc LDX #&fc ; increase_score_loop &2499 75 5b ADC &5b,X ; score + 4 &249b 95 5b STA &5b,X ; score + 4 &249d a9 00 LDA #&00 &249f e8 INX &24a0 d0 f7 BNE &2499 ; increase_score_loop &24a2 d8 CLD ; update_score &24a3 a5 5a LDA &5a ; score + 3 &24a5 c9 01 CMP #&01 &24a7 a0 00 LDY #&00 &24a9 a5 59 LDA &59 ; score + 2 &24ab 20 b5 24 JSR &24b5 ; update_two_digits_of_score &24ae a5 58 LDA &58 ; score + 1 &24b0 20 b5 24 JSR &24b5 ; update_two_digits_of_score &24b3 a5 57 LDA &57 ; score + 0 ; update_two_digits_of_score &24b5 48 PHA &24b6 20 c0 24 JSR &24c0 ; update_single_digit_of_score &24b9 68 PLA &24ba 08 PHP &24bb 0a ASL A &24bc 0a ASL A &24bd 0a ASL A &24be 0a ASL A &24bf 28 PLP ; update_single_digit_of_score &24c0 29 f0 AND #&f0 &24c2 b0 06 BCS &24ca ; use_digit &24c4 d0 03 BNE &24c9 ; set_carry &24c6 a9 a0 LDA #&a0 &24c8 24 38 BIT &38 ; stage_background_colours ; set_carry #24c9 38 SEC ; use_digit_a &24ca aa TAX ; update_single_digit_of_score_loop &24cb bd 00 0b LDA &0b00,X ; digit_sprites &24ce 99 7d 10 STA &107d,Y ; score_image_buffer &24d1 c8 INY &24d2 e8 INX &24d3 8a TXA &24d4 29 0f AND #&0f &24d6 d0 f3 BNE &24cb ; update_single_digit_of_score_loop &24d8 60 RTS ; event_routine &24d9 08 PHP &24da c9 04 CMP #&04 &24dc d0 24 BNE &2502 ; leave # Leave if this isn't a v-sync event &24de 24 25 BIT &25 ; scrolling_paused &24e0 30 20 BMI &2502 ; leave # Leave if game paused &24e2 e6 18 INC &18 ; vsync_counter &24e4 18 CLC &24e5 a5 34 LDA &34 ; wave_energy_total_low # Give enemies a frame of energy &24e7 65 6b ADC &6b ; wave_energy_delta_low &24e9 85 34 STA &34 ; wave_energy_total_low &24eb a5 35 LDA &35 ; wave_energy_total_high &24ed 65 6c ADC &6c ; wave_energy_delta_high &24ef 85 35 STA &35 ; wave_energy_total_high &24f1 24 2c BIT &2c ; scrolling_paused_but_game_continuing &24f3 30 0b BMI &2500 ; leave_with_four # If the player is still alive, &24f5 c6 5b DEC &5b ; music_beat_cooldown # progress the music &24f7 d0 07 BNE &2500 ; leave_with_four &24f9 ad 0a 11 LDA &110a ; music_vsyncs_per_beat &24fc 85 5b STA &5b ; music_beat_cooldown &24fe c6 6a DEC &6a ; music_beats_missing ; leave_with_four &2500 a9 04 LDA #&04 ; leave &2502 28 PLP &2503 60 RTS ; irq1_routine &2504 08 PHP &2505 d8 CLD &2506 48 PHA &2507 a9 20 LDA #&20 &2509 2c 6d fe BIT &fe6d ; User VIA interrupt flag register # Top bit set if any interrupt has occurred &250c 10 04 BPL &2512 ; leave_irq1_routine # If not, leave &250e d0 07 BNE &2517 ; timer2_triggered # &20 set if User VIA Timer 2 timed out; call routine &2510 70 0e BVS &2520 ; timer1_triggered # &40 set if User VIA Timer 1 timed out; call routine ; leave_irq1_routine &2512 68 PLA &2513 28 PLP &2514 4c 88 3f JMP &3f88 # actually JMP previous_irq1_vector ; timer2_triggered # Called when User VIA Timer 2 times out &2517 ad 68 fe LDA &fe68 ; User VIA timer 2 counter LSB # Reset User VIA Timer 2 interrupt flag &251a 20 43 22 JSR &2243 ; timer2_frame_routine &251d 4c 12 25 JMP &2512 ; leave_irq1_routine ; timer1_triggered # Called when User VIA Timer 1 times out &2520 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB # Reset User VIA Timer 1 interrupt flag &2523 c6 54 DEC &54 ; frame_routine_state &2525 f0 4d BEQ &2574 ; timer1_frame_routine_part_two &2527 10 03 BPL &252c ; timer1_frame_routine_part_one &2529 4c be 25 JMP &25be ; timer1_frame_routine_part_three ; timer1_frame_routine_part_one # Called at start of invisible part of screen &252c a5 03 LDA &03 ; screen_new_vertical_scroll &252e 29 06 AND #&06 &2530 d0 03 BNE &2535 ; use_longer_delay &2532 a9 2b LDA #&2b &2534 2c a9 2c BIT &2ca9 ; use_longer_delay #2535 a9 2c LDA #&2c ; wait_for_top_row &2537 cd 65 fe CMP &fe65 ; User VIA timer 1 counter MSB # Wait for the start of visible part of screen &253a 90 fb BCC &2537 ; wait_for_top_row &253c a9 08 LDA #&08 # R8: Interlace and delay register &253e 8d 00 fe STA &fe00 ; video register number &2541 a9 c0 LDA #&c0 # Disable cursor output, normal sync, no blanking delay &2543 8d 01 fe STA &fe01 ; video register value # i.e. display video for first visible row &2546 a5 04 LDA &04 ; delay_for_final_rows &2548 8d 67 fe STA &fe67 ; User VIA timer 1 latch MSB # Set delay between second and third Timer 1 parts &254b a9 00 LDA #&00 &254d 85 3a STA &3a ; player_y_has_crossed_screen_boundary &254f 24 25 BIT &25 ; scrolling_paused # If the game isn't paused, &2551 70 02 BVS &2555 ; screen_not_scrolling &2553 e6 41 INC &41 ; player_energy # give the player a frame of energy ; screen_not_scrolling &2555 24 08 BIT &08 ; rows_to_scroll # Is the screen being scrolled? # If not, leave, A = 0, so don't disable any interrupts &2557 10 0e BPL &2567 ; set_interrupt_enable_register_and_leave_irq1_routine &2559 a5 03 LDA &03 ; screen_new_vertical_scroll &255b 29 07 AND #&07 &255d d0 0e BNE &256d ; not_new_group # If this starts a new group, ; note_rows_scrolled_loop # note rows that need plotting now &255f e6 09 INC &09 ; rows_of_background_to_plot &2561 e6 08 INC &08 ; rows_to_scroll &2563 d0 fa BNE &255f ; note_rows_scrolled_loop &2565 a9 32 LDA #&32 # Disable interrupts on System VIA # for Timer 2, CB1 (ADC) and CA1 (v-sync) ; set_interrupt_enable_register_and_leave_irq1_routine &2567 8d 4e fe STA &fe4e ; System VIA interrupt enable register ; use_alternative_timer_instruction &256a 20 66 b1 JSR &b166 # actually BIT &b166 ; not_new_group &256d a9 00 LDA #&00 # System VIA Timer 1 latch LSB was set to &02 at &2287 &256f 8d 45 fe STA &fe45 ; System VIA timer 1 counter MSB # so this triggers a System VIA Timer 1 interrupt, &2572 f0 9e BEQ &2512 ; leave_irq1_routine # updating sound ; timer1_frame_routine_part_two # Called at start of last visible group of rows &2574 38 SEC &2575 a5 03 LDA &03 ; screen_new_vertical_scroll &2577 29 06 AND #&06 &2579 d0 0d BNE &2588 ; skip_wait_for_bottom_group &257b a5 04 LDA &04 ; delay_for_final_rows &257d e9 02 SBC #&02 ; wait_for_bottom_group # Wait for the start of the last group &257f cd 65 fe CMP &fe65 ; User VIA timer 1 counter LSB &2582 90 fb BCC &257f ; wait_for_bottom_group &2584 20 af 25 JSR &25af ; limit_display_of_bottom_group # Set length of last group &2587 18 CLC ; skip_wait_for_bottom_group &2588 a5 04 LDA &04 ; delay_for_final_rows &258a e9 02 SBC #&02 ; wait_for_bottom_row # Wait for the last visible row to be displayed &258c cd 65 fe CMP &fe65 ; User VIA timer 1 counter LSB &258f 90 fb BCC &258c ; wait_for_bottom_row &2591 a9 08 LDA #&08 # R8: Interlace and delay register &2593 8d 00 fe STA &fe00 ; video register number &2596 a9 f0 LDA #&f0 # Disable cursor output, normal sync, disable video &2598 8d 01 fe STA &fe01 ; video register value # i.e. prevent any further rows from being displayed &259b 20 af 25 JSR &25af ; limit_display_of_bottom_group # Unnecessary call &259e 24 08 BIT &08 ; rows_to_scroll # Is the screen being scrolled? &25a0 10 06 BPL &25a8 ; no_scrolling ; note_rows_to_scroll_loop &25a2 e6 09 INC &09 ; rows_of_background_to_plot # For each row scrolled, one needs to be plotted &25a4 e6 08 INC &08 ; rows_to_scroll &25a6 d0 fa BNE &25a2 ; note_rows_to_scroll_loop ; no_scrolling &25a8 a9 ff LDA #&ff &25aa 85 3a STA &3a ; player_y_has_crossed_screen_boundary &25ac 4c 12 25 JMP &2512 ; leave_irq1_routine ; limit_display_of_bottom_group &25af 24 0a BIT &0a ; use_normal_top_and_bottom_groups &25b1 30 0a BMI &25bd ; leave &25b3 a9 09 LDA #&09 # R9: Scan lines per character register &25b5 8d 00 fe STA &fe00 ; video register number &25b8 a5 05 LDA &05 ; scan_lines_in_bottom_group &25ba 8d 01 fe STA &fe01 ; video register value ; leave &25bd 60 RTS ; timer1_frame_routine_part_three # Called after end of invisible part of screen &25be a9 09 LDA #&09 # R9: Scan lines per character register &25c0 8d 00 fe STA &fe00 ; video register number &25c3 a9 07 LDA #&07 # Restore the default value for the next frame &25c5 8d 01 fe STA &fe01 ; video register value # (i.e. all groups have eight rows displayed) &25c8 a9 00 LDA #&00 # Set User VIA Timer 1 to generate single interrupt &25ca 8d 6b fe STA &fe6b ; User VIA auxilliary control register # (i.e. disable repeated interrupts) &25cd a9 40 LDA #&40 # Disable interrupts from User VIA Timer 1 &25cf 8d 6e fe STA &fe6e ; User VIA interrupt enable register &25d2 a9 f2 LDA #&f2 # Re-enable interrupts on System VIA # for Timer 1, Timer 2, CB1 (ADC) and CA1 (v-sync) &25d4 4c 67 25 JMP &2567 ; set_interrupt_enable_register_and_leave_irq1_routine ; wait_for_a_vsync_while_updating_background &25d7 a5 18 LDA &18 ; vsync_counter ; wait_for_a_vsync_while_updating_background_loop &25d9 48 PHA &25da 20 1a 1e JSR &1e1a ; plot_rows_of_background &25dd 68 PLA &25de c5 18 CMP &18 ; vsync_counter &25e0 f0 f7 BEQ &25d9 ; wait_for_a_vsync_while_updating_background_loop &25e2 60 RTS ; compare_player_y_against_timer_2_counter &25e3 ad 26 0f LDA &0f26 ; player_sprite_y &25e6 38 SEC &25e7 e5 03 SBC &03 ; screen_new_vertical_scroll ; compare_a_against_timer_2_counter &25e9 18 CLC &25ea 69 0b ADC #&0b &25ec 4a LSR A &25ed 4a LSR A &25ee cd 69 fe CMP &fe69 ; User VIA timer 2 counter MSB &25f1 60 RTS ; play_sound_on_free_channel # Called with A = sound offset &25f2 85 92 STA &92 ; sound_offset &25f4 86 93 STX &93 ; x &25f6 a2 03 LDX #&03 ; find_free_channel_loop &25f8 b5 61 LDA &61,X ; sound_channels_cooldown &25fa f0 05 BEQ &2601 ; free_channel_found &25fc ca DEX &25fd d0 f9 BNE &25f8 ; find_free_channel_loop &25ff a2 03 LDX #&03 # Use channel 3 if no free channel can be found ; free_channel_found &2601 8a TXA &2602 48 PHA &2603 09 10 ORA #&10 # Flush channel &2605 a6 92 LDX &92 ; sound_offset &2607 9d 00 01 STA &0100,X ; sound_channel &260a 8a TXA &260b a8 TAY ; sound_offset &260c a6 93 LDX &93 ; x &260e 20 3c 26 JSR &263c ; play_game_sound &2611 86 92 STX &92 ; x &2613 68 PLA &2614 aa TAX ; channel &2615 56 61 LSR &61,X ; sound_channels_cooldown # Unclear what this does. &2617 a6 92 LDX &92 ; x &2619 60 RTS ; play_end_of_stage_chord &261a e6 6e INC &6e ; player_lives &261c a2 06 LDX #&06 ; play_start_of_stage_chord # Called with X = 0 at start of stage &261e bd d6 04 LDA &04d6,X ; stage_sounds_table # First byte of table is starting channel &2621 85 96 STA &96 ; channel &2623 bc d7 04 LDY &04d7,X ; stage_sounds_table + 1 # Second byte of table is offset to sound ; play_chord_channel_loop &2626 99 00 01 STA &0100,Y ; sound_channel &2629 bd d8 04 LDA &04d8,X ; stage_sounds_table + 2 # One byte for pitch of each channel &262c 99 04 01 STA &0104,Y ; sound_pitch &262f 20 42 26 JSR &2642 ; play_start_or_end_of_stage_sound &2632 e8 INX &2633 e6 96 INC &96 ; channel &2635 a5 96 LDA &96 ; channel &2637 c9 14 CMP #&14 &2639 d0 eb BNE &2626 ; play_chord_channel_loop &263b 60 RTS ; play_game_sound # Called with Y = offset to sound &263c a9 40 LDA #&40 # Firing, explosions, etc, muted if &40 set &263e 2c a9 80 BIT &80a9 ; play_music_sound #263f a9 80 LDA #&80 # Music muted if &80 set &2641 2c a9 20 BIT &20a9 ; play_start_or_end_of_stage_sound #2642 a9 20 LDA #&20 # Start and end of stage sounds muted if &20 set &2644 24 3d BIT &3d ; muting_flags &2646 d0 37 BNE &267f ; leave # If this particular type of sound isn't muted, &2648 8a TXA &2649 48 PHA &264a 84 92 STY &92 ; sound_offset &264c b9 00 01 LDA &0100,Y ; sound_channel # Get channel of desired sound &264f 29 03 AND #&03 &2651 aa TAX &2652 b9 06 01 LDA &0106,Y ; sound_duration # Get duration of desired sound &2655 0a ASL A &2656 95 61 STA &61,X ; sound_channels_cooldown # Occupy that channel for that duration &2658 a4 54 LDY &54 ; frame_routine_state &265a d0 17 BNE &2673 ; play_sound_and_postponed_sounds # Can the sound be played right now? &265c 8a TXA # If not, &265d 0a ASL A &265e 0a ASL A &265f 0a ASL A &2660 8d 69 26 STA &2669 ; postponed_sound_block_offset &2663 a6 92 LDX &92 ; sound_offset ; copy_sound_block_loop # Copy sound into sound_postponed &2665 bd 00 01 LDA &0100,X &2668 99 00 01 STA &0100,Y # actually STA &0100 + postponed_sound_block_offset, Y &266b e8 INX &266c c8 INY &266d c0 08 CPY #&08 &266f d0 f4 BNE &2665 ; copy_sound_block_loop &2671 f0 08 BEQ &267b ; leave_restoring_x_and_y ; play_sound_and_postponed_sounds &2673 a6 92 LDX &92 ; sound_offset &2675 20 80 26 JSR &2680 ; play_sound # Otherwise, play this sound &2678 20 8d 26 JSR &268d ; play_postponed_sounds # and any postponed sounds ; leave_restoring_x_and_y &267b 68 PLA &267c aa TAX &267d a4 92 LDY &92 ; sound_offset ; leave &267f 60 RTS ; play_sound &2680 a9 07 LDA #&07 ; Generate a sound &2682 a0 01 LDY #&01 ; &0100 + X &2684 38 SEC ; use_alternative_sound_instruction &2685 20 68 b1 JSR &b168 # actually BIT &b168 &2688 90 f5 BCC &267f ; leave &268a 4c f1 ff JMP &fff1 ; OSWORD ; play_postponed_sounds &268d a5 54 LDA &54 ; frame_routine_state &268f f0 22 BEQ &26b3 ; leave # Can sounds be played now? &2691 a2 00 LDX #&00 ; channel 0 &2693 20 a2 26 JSR &26a2 ; play_postponed_sound &2696 a2 08 LDX #&08 ; channel 1 &2698 20 a2 26 JSR &26a2 ; play_postponed_sound &269b a2 10 LDX #&10 ; channel 2 &269d 20 a2 26 JSR &26a2 ; play_postponed_sound &26a0 a2 18 LDX #&18 ; channel 3 ; play_postponed_sound &26a2 bd 06 01 LDA &0106,X ; postponed_sound_duration # Is there a sound waiting on this channel? &26a5 f0 0c BEQ &26b3 ; leave &26a7 8a TXA &26a8 48 PHA &26a9 20 80 26 JSR &2680 ; play_sound # If so, play it &26ac 68 PLA &26ad aa TAX &26ae a9 00 LDA #&00 &26b0 9d 06 01 STA &0106,X ; postponed_sound_duration # and mark it as having been played ; leave &26b3 60 RTS ; get_player_horizontal_movement &26b4 a2 02 LDX #&02 &26b6 a0 02 LDY #&02 # Check for horizontal movements &26b8 d0 04 BNE &26be ; get_player_movement ; get_player_vertical_movement &26ba a2 08 LDX #&08 &26bc a0 04 LDY #&04 # Check for vertical movements ; get_player_movement &26be 98 TYA &26bf 20 fe 26 JSR &26fe ; check_for_player_input &26c2 10 02 BPL &26c6 ; left_or_down_not_pressed &26c4 ca DEX &26c5 ca DEX ; left_or_down_not_pressed &26c6 c8 INY &26c7 98 TYA &26c8 20 fe 26 JSR &26fe ; check_for_player_input &26cb 10 02 BPL &26cf ; right_or_up_not_pressed &26cd e8 INX &26ce e8 INX ; right_or_up_not_pressed &26cf bc f5 07 LDY &07f5,X ; player_movement_offsets + 1 &26d2 bd f4 07 LDA &07f4,X ; player_movement_offsets &26d5 aa TAX &26d6 60 RTS ; check_for_space_or_fire_and_set_control_type &26d7 a9 00 LDA #&00 ; check_for_space_or_fire_and_set_control_type_loop # For each of two keyboard layouts and two joysticks, &26d9 85 23 STA &23 ; control_type &26db 20 fc 26 JSR &26fc ; check_for_fire_pressed # check if fire has been pressed &26de 30 16 BMI &26f6 ; set_control_type # If it has, use that as the control type &26e0 18 CLC &26e1 a5 23 LDA &23 ; control_type &26e3 69 07 ADC #&07 &26e5 c9 1c CMP #&1c &26e7 90 f0 BCC &26d9 ; check_for_space_or_fire_and_set_control_type_loop &26e9 20 15 22 JSR &2215 ; check_for_space_press # If SPACE pressed, &26ec 30 02 BMI &26f0 ; use_previous_control_type # use the previous control type &26ee 18 CLC # Leave with carry clear to indicate fire wasn't pressed &26ef 60 RTS ; use_previous_control_type &26f0 a5 24 LDA &24 ; previous_control_type &26f2 85 23 STA &23 ; control_type &26f4 38 SEC # Leave with carry set to indicate fire was pressed &26f5 60 RTS ; set_control_type &26f6 a5 23 LDA &23 ; control_type &26f8 85 24 STA &24 ; previous_control_type &26fa 38 SEC # Leave with carry set to indicate fire was pressed &26fb 60 RTS ; check_for_fire_pressed &26fc a9 06 LDA #&06 # Check for player pressing fire ; check_for_player_input # Called with A = direction to check &26fe 18 CLC &26ff 65 23 ADC &23 ; control_type &2701 85 92 STA &92 ; offset &2703 8a TXA &2704 48 PHA &2705 98 TYA &2706 48 PHA &2707 a6 23 LDX &23 ; control_type &2709 bd d8 07 LDA &07d8,X ; control_routine_address_table &270c 85 90 STA &90 ; call_address_low &270e bd d9 07 LDA &07d9,X ; control_routine_address_table + 1 &2711 85 91 STA &91 ; call_address_high &2713 a6 92 LDX &92 ; offset &2715 bd d8 07 LDA &07d8,X ; control_routine_address_table &2718 20 2f 22 JSR &222f ; call_routine # Call either check_key_press or check_joystick &271b 85 92 STA &92 ; result &271d 68 PLA &271e a8 TAY &271f 68 PLA &2720 aa TAX &2721 a5 92 LDA &92 ; result ; leave &2723 60 RTS ; initialise_player &2724 a2 00 LDX #&00 &2726 86 2c STX &2c ; scrolling_paused_but_game_continuing &2728 86 41 STX &41 ; player_energy &272a 86 26 STX &26 ; player_x_fraction &272c 86 27 STX &27 ; player_speed_fraction &272e 86 28 STX &28 ; player_speed_pixels &2730 a9 0c LDA #&0c ; PLAYER_STRAIGHT &2732 8d 42 0f STA &0f42 ; player_sprite_type &2735 a5 02 LDA &02 ; screen_vertical_scroll &2737 8d 96 0f STA &0f96 ; player_sprite_vertical_scroll &273a 38 SEC &273b e9 05 SBC #&05 &273d 8d 26 0f STA &0f26 ; player_sprite_y &2740 a5 6e LDA &6e ; player_lives # Add ships that accompany player at start of stage &2742 c9 07 CMP #&07 &2744 90 02 BCC &2748 ; skip_ceiling &2746 a9 07 LDA #&07 # one per life, to a maximum of seven ; skip_ceiling &2748 85 96 STA &96 ; ships ; initialise_player_ships_loop &274a c6 96 DEC &96 ; ships &274c a4 96 LDY &96 ; ships &274e b9 e1 04 LDA &04e1,Y ; accompanying_ships_x_positions &2751 8d 0a 0f STA &0f0a ; player_sprite_x &2754 a9 37 LDA #&37 ; INITIAL_PLAYER_SHIP &2756 20 32 37 JSR &3732 ; add_player_sprite_in_range_1 &2759 a5 96 LDA &96 ; ships &275b d0 ed BNE &274a ; initialise_player_ships_loop &275d a9 40 LDA #&40 # Stop scrolling while initial ships come forward &275f 85 2c STA &2c ; scrolling_paused_but_game_continuing ; wait_for_update_enemies_and_bullets_loop &2761 20 15 31 JSR &3115 ; update_enemies_and_bullets &2764 24 2c BIT &2c ; scrolling_paused_but_game_continuing &2766 70 f9 BVS &2761 ; wait_for_update_enemies_and_bullets_loop # Continue once initial ships start to separate &2768 a9 00 LDA #&00 &276a 85 41 STA &41 ; player_energy &276c 4c a6 19 JMP &19a6 ; update_player_sprite ; plot_score_and_leave &276f a5 41 LDA &41 ; player_energy &2771 f0 b0 BEQ &2723 ; leave &2773 a9 00 LDA #&00 &2775 85 41 STA &41 ; player_energy &2777 4c 34 23 JMP &2334 ; plot_score_to_screen ; handle_player &277a a5 2c LDA &2c ; scrolling_paused_but_game_continuing &277c 05 2d ORA &2d ; player_has_finished_exploding &277e 30 ef BMI &276f ; plot_score_and_leave &2780 a5 41 LDA &41 ; player_energy &2782 f0 eb BEQ &276f ; plot_score_and_leave &2784 85 42 STA &42 ; player_move_energy &2786 a2 00 LDX #&00 ; PLAYER &2788 20 17 19 JSR &1917 ; set_up_sprite_X_for_updating ; update_player_horizontal_position &278b 20 b4 26 JSR &26b4 ; get_player_horizontal_movement &278e 86 92 STX &92 ; movement_fraction &2790 84 93 STY &93 ; movement_pixels &2792 a4 42 LDY &42 ; player_move_energy &2794 a5 26 LDA &26 ; player_x_fraction &2796 85 94 STA &94 ; x_fraction &2798 ad 0a 0f LDA &0f0a ; player_sprite_x &279b 85 95 STA &95 ; x_pixels &279d a2 00 LDX #&00 # Ship banking left &279f a5 28 LDA &28 ; player_speed_pixels &27a1 30 08 BMI &27ab ; update_player_horizontal_position_loop &27a3 a2 02 LDX #&02 # Ship heading straight &27a5 05 27 ORA &27 ; player_speed_fraction &27a7 f0 02 BEQ &27ab ; update_player_horizontal_position_loop &27a9 a2 04 LDX #&04 # Ship banking right ; update_player_horizontal_position_loop &27ab 18 CLC &27ac a5 27 LDA &27 ; player_speed_fraction &27ae 65 92 ADC &92 ; movement_fraction &27b0 08 PHP &27b1 18 CLC &27b2 7d 0b 05 ADC &050b,X ; ship_banking_table &27b5 85 27 STA &27 ; player_speed_fraction &27b7 a5 28 LDA &28 ; player_speed_pixels &27b9 65 93 ADC &93 ; movement_pixels &27bb 28 PLP &27bc 7d 0c 05 ADC &050c,X ; ship_banking_table + 1 &27bf 85 28 STA &28 ; player_speed_pixels &27c1 30 04 BMI &27c7 ; player_moving_right &27c3 f0 0c BEQ &27d1 ; player_heading_straight &27c5 d0 06 BNE &27cd ; player_moving_left ; player_moving_right &27c7 c9 ff CMP #&ff &27c9 f0 06 BEQ &27d1 ; player_heading_straight &27cb e6 28 INC &28 ; player_speed_pixels ; player_moving_left &27cd a9 00 LDA #&00 &27cf 85 27 STA &27 ; player_speed_fraction ; player_heading_straight &27d1 18 CLC &27d2 a5 94 LDA &94 ; x_fraction &27d4 65 27 ADC &27 ; player_speed_fraction &27d6 85 94 STA &94 ; x_fraction &27d8 a5 95 LDA &95 ; x_pixels &27da 65 28 ADC &28 ; player_speed_pixels &27dc 85 95 STA &95 ; x_pixels &27de 88 DEY &27df d0 ca BNE &27ab ; update_player_horizontal_position_loop &27e1 a6 27 LDX &27 ; player_speed_fraction &27e3 a5 28 LDA &28 ; player_speed_pixels &27e5 30 08 BMI &27ef ; player_moving_left &27e7 d0 11 BNE &27fa ; use_right_ship &27e9 e0 6f CPX #&6f &27eb 90 10 BCC &27fd ; use_straight_ship &27ed b0 0b BCS &27fa ; use_right_ship ; player_moving_left &27ef c9 ff CMP #&ff &27f1 d0 04 BNE &27f7 ; use_left_ship &27f3 e0 92 CPX #&92 &27f5 b0 06 BCS &27fd ; use_straight_ship ; use_left_ship &27f7 a9 0e LDA #&0e ; PLAYER_LEFT &27f9 2c a9 10 BIT &10a9 ; use_right_ship #27fa a9 10 LDA #&10 ; PLAYER_RIGHT &27fc 2c a9 0c BIT &0ca9 ; use_straight_ship #27fd a9 0c LDA #&0c ; PLAYER_STRAIGHT &27ff 8d 42 0f STA &0f42 ; sprites_type &2802 a6 94 LDX &94 ; x_fraction &2804 a4 95 LDY &95 ; x_pixels &2806 a9 02 LDA #&02 &2808 c0 02 CPY #&02 &280a 30 0d BMI &2819 ; set_limit &280c a9 4d LDA #&4d &280e c0 4e CPY #&4e &2810 10 07 BPL &2819 ; set_limit &2812 86 26 STX &26 ; player_x_fraction &2814 8c 0a 0f STY &0f0a ; player_sprite_x &2817 30 03 BMI &281c ; update_player_vertical_position ; set_limit &2819 8d 0a 0f STA &0f0a ; player_sprite_x ; update_player_vertical_position &281c 20 ba 26 JSR &26ba ; get_player_vertical_movement &281f 86 92 STX &92 ; movement_fraction &2821 a6 42 LDX &42 ; player_move_energy &2823 ad 26 0f LDA &0f26 ; player_sprite_y ; update_player_vertical_position_loop &2826 18 CLC &2827 65 92 ADC &92 ; movement_fraction &2829 ca DEX &282a d0 fa BNE &2826 ; update_player_vertical_position_loop &282c 38 SEC &282d ed 96 0f SBC &0f96 ; player_sprite_vertical_scroll &2830 a0 0c LDY #&0c &2832 c9 0c CMP #&0c &2834 90 07 BCC &283d ; set_vertical_limit &2836 a0 87 LDY #&87 &2838 c9 88 CMP #&88 &283a b0 01 BCS &283d ; set_vertical_limit &283c a8 TAY ; set_vertical_limit &283d 18 CLC &283e 98 TYA &283f 65 02 ADC &02 ; screen_vertical_scroll &2841 8d 26 0f STA &0f26 ; player_sprite_y &2844 20 a6 19 JSR &19a6 ; update_player_sprite &2847 20 49 33 JSR &3349 ; check_for_player_collision_with_enemies # Did the player collide with an enemy? &284a 10 27 BPL &2873 ; no_collision &284c a9 ff LDA #&ff # If so, stop the stage from scrolling &284e 85 2c STA &2c ; scrolling_paused_but_game_continuing &2850 a5 18 LDA &18 ; vsync_counter # and allow the game to run for 75 more frames &2852 69 4b ADC #&4b &2854 85 6f STA &6f ; vsync_counter_at_death_or_quit &2856 a0 30 LDY #&30 ; &0130 = sound_explosion # Play a sound for the player exploding &2858 20 3c 26 JSR &263c ; play_game_sound &285b a9 05 LDA #&05 ; GROUND_EXPLOSION &285d 20 32 37 JSR &3732 ; add_player_sprite_in_range_1 # Add an explosion where the player was &2860 a2 00 LDX #&00 ; PLAYER &2862 20 17 19 JSR &1917 ; set_up_sprite_X_for_updating &2865 a9 ff LDA #&ff &2867 9d 42 0f STA &0f42,X ; sprites_type # Remove the player &286a 20 a8 19 JSR &19a8 ; update_sprite_X &286d 20 13 2d JSR &2d13 ; add_screen_of_blank_tiles &2870 4c 7c 28 JMP &287c ; skip_firing ; no_collision &2873 c6 41 DEC &41 ; player_energy &2875 c6 42 DEC &42 ; player_move_energy &2877 d0 fa BNE &2873 ; no_collision &2879 20 b4 29 JSR &29b4 ; handle_firing ; skip_firing &287c c6 3b DEC &3b ; function_key_check_cooldown # Once every 16 frames, &287e d0 31 BNE &29b1 ; handle_music_and_postponed_sounds &2880 a9 0f LDA #&0f &2882 85 3b STA &3b ; function_key_check_cooldown ; wait_for_unpause &2884 20 87 29 JSR &2987 ; check_for_function_key_presses # check for function key presses &2887 24 25 BIT &25 ; scrolling_paused # which may pause the game &2889 10 0d BPL &2898 ; unpause_game &288b 20 34 23 JSR &2334 ; plot_score_to_screen &288e a9 8f LDA #&8f ; ESCAPE &2890 20 17 22 JSR &2217 ; check_for_key_press # If so, wait for the game to be unpaused &2893 10 ef BPL &2884 ; wait_for_unpause # or for ESCAPE to be pressed to abandon it &2895 20 92 21 JSR &2192 ; unset_scrolling_paused ; unpause_game &2898 24 2d BIT &2d ; player_has_finished_exploding &289a 30 15 BMI &28b1 ; handle_music_and_postponed_sounds ; check_for_escape_and_handle_music_and_postponed_sounds &289c a9 8f LDA #&8f ; ESCAPE &289e 20 17 22 JSR &2217 ; check_for_key_press &28a1 10 0e BPL &28b1 ; handle_music_and_postponed_sounds &28a3 85 2d STA &2d ; player_has_finished_exploding &28a5 85 6e STA &6e ; player_lives &28a7 a5 18 LDA &18 ; vsync_counter &28a9 85 6f STA &6f ; vsync_counter_at_death_or_quit &28ab 20 1a 1e JSR &1e1a ; plot_rows_of_background &28ae 20 6a 21 JSR &216a ; remove_foreground_from_entire_screen ; handle_music_and_postponed_sounds &28b1 20 8d 26 JSR &268d ; play_postponed_sounds &28b4 a5 6a LDA &6a ; music_beats_missing &28b6 f0 08 BEQ &28c0 ; leave &28b8 24 2c BIT &2c ; scrolling_paused_but_game_continuing &28ba 10 05 BPL &28c1 ; handle_music &28bc a9 00 LDA #&00 &28be 85 6a STA &6a ; music_beats_missing ; leave &28c0 60 RTS ; handle_music &28c1 c6 5c DEC &5c ; music_notes_left_in_bar &28c3 d0 26 BNE &28eb ; not_end_of_bar &28c5 ad 00 11 LDA &1100 ; number_of_notes_in_bar &28c8 85 5c STA &5c ; music_notes_left_in_bar &28ca a4 69 LDY &69 ; music_bar &28cc c8 INY &28cd cc 01 11 CPY &1101 ; number_of_bars &28d0 90 02 BCC &28d4 ; not_end_of_music &28d2 a0 00 LDY #&00 ; not_end_of_music &28d4 84 69 STY &69 ; music_bar &28d6 a2 03 LDX #&03 ; start_new_bar_channel_loop &28d8 18 CLC &28d9 bd 02 11 LDA &1102,X ; channel_bar_offsets &28dc 65 69 ADC &69 ; music_bar &28de a8 TAY &28df b9 29 12 LDA &1229,Y ; channel_notes_offsets &28e2 95 65 STA &65,X ; music_channels_note_offset &28e4 a9 00 LDA #&00 &28e6 95 5d STA &5d,X ; music_channels_cooldown &28e8 ca DEX &28e9 10 ed BPL &28d8 ; start_new_bar_channel_loop ; not_end_of_bar &28eb a2 03 LDX #&03 &28ed 24 49 BIT &49 ; before_during_or_after_main_map # &40 set if at devil rock or end launch &28ef 50 3a BVC &292b ; channel_loop &28f1 a5 3e LDA &3e ; number_of_blank_rows_before_next_map &28f3 f0 36 BEQ &292b ; channel_loop # Is this the end of a CommSpace stage? &28f5 a5 79 LDA &79 ; first_byte_of_stage_flags &28f7 29 10 AND #&10 &28f9 f0 30 BEQ &292b ; channel_loop # If so, is this music track 1? &28fb a9 11 LDA #&11 &28fd 8d 50 01 STA &0150 ; sound_music_channel &2900 a9 05 LDA #&05 &2902 8d 52 01 STA &0152 ; sound_music_volume &2905 38 SEC &2906 a9 0f LDA #&0f # Play ascending notes on approach to end launchpad &2908 e5 3e SBC &3e ; number_of_blank_rows_before_next_map &290a 0a ASL A &290b 0a ASL A &290c 48 PHA &290d 8d 54 01 STA &0154 ; sound_music_pitch &2910 a9 02 LDA #&02 &2912 8d 56 01 STA &0156 ; sound_music_duration &2915 a9 50 LDA #&50 ; &0150 = sound_music &2917 20 3f 26 JSR &263f ; play_music_sound &291a ee 50 01 INC &0150 ; sound_music_channel # as a chord on channels 1 and 2 &291d 68 PLA &291e 18 CLC &291f 69 10 ADC #&10 &2921 8d 54 01 STA &0154 ; sound_music_pitch &2924 a0 50 LDY #&50 ; &0150 = sound_music &2926 20 3f 26 JSR &263f ; play_music_sound &2929 a2 00 LDX #&00 # and then play any percussion from the music ; channel_loop &292b d6 5d DEC &5d,X ; music_channels_cooldown &292d 10 4e BPL &297d ; skip_channel # Is this the end of a note? &292f 8a TXA &2930 09 10 ORA #&10 &2932 8d 50 01 STA &0150 ; sound_music_channel &2935 b4 65 LDY &65,X ; music_channels_note_offset &2937 f6 65 INC &65,X ; music_channels_note_offset &2939 b9 29 11 LDA &1129,Y ; music_notes &293c a8 TAY &293d 8a TXA &293e f0 11 BEQ &2951 ; is_percussion &2940 98 TYA # If this isn't percussion, &2941 29 03 AND #&03 # Lowest two bits of note are time until next note &2943 95 5d STA &5d,X ; music_channels_cooldown &2945 98 TYA &2946 29 fc AND #&fc &2948 bc 06 11 LDY &1106,X ; channel_instrument_offsets &294b c9 fc CMP #&fc # Top six bits of note are pitch (all set for silence) &294d d0 16 BNE &2965 ; is_note &294f f0 2c BEQ &297d ; skip_channel ; is_percussion &2951 98 TYA # If this is percussion, &2952 4a LSR A &2953 4a LSR A &2954 4a LSR A &2955 95 5d STA &5d,X ; music_channels_cooldown # Top five bits of note are time until next note &2957 98 TYA &2958 29 07 AND #&07 &295a f0 21 BEQ &297d ; skip_channel &295c 18 CLC &295d 7d 06 11 ADC &1106,X ; channel_instrument_offsets &2960 a8 TAY &2961 88 DEY &2962 b9 15 11 LDA &1115,Y ; percussion_pitches # Low three bits are pitch (all clear for silence) ; is_note &2965 8d 54 01 STA &0154 ; sound_music_pitch &2968 24 2d BIT &2d ; player_has_finished_exploding &296a 30 11 BMI &297d ; skip_channel &296c b9 0b 11 LDA &110b,Y ; music_instruments &296f 8d 52 01 STA &0152 ; sound_music_volume &2972 b9 1f 11 LDA &111f,Y ; music_durations &2975 8d 56 01 STA &0156 ; sound_music_duration &2978 a0 50 LDY #&50 ; &0150 = sound_music &297a 20 3f 26 JSR &263f ; play_music_sound ; skip_channel &297d ca DEX &297e 10 ab BPL &292b ; channel_loop &2980 e6 6a INC &6a ; music_beats_missing &2982 f0 2f BEQ &29b3 ; leave &2984 4c c1 28 JMP &28c1 ; handle_music ; check_for_function_key_presses &2987 a0 1e LDY #&1e &2989 a5 25 LDA &25 ; scrolling_paused &298b 85 94 STA &94 ; game_paused &298d c9 40 CMP #&40 # In the title and between stage screens, &298f d0 02 BNE &2993 ; check_for_function_key_presses_loop &2991 a0 18 LDY #&18 # exclude pause and unpause keys ; check_for_function_key_presses_loop &2993 be e6 04 LDX &04e6,Y ; function_key_action_table - 2 &2996 b5 00 LDA &00,X &2998 d9 e7 04 CMP &04e7,Y ; function_key_action_table - 1 &299b f0 0d BEQ &29aa ; not_pressed # Only check for key if it could change something &299d b9 e5 04 LDA &04e5,Y ; function_key_action_table - 3 &29a0 20 17 22 JSR &2217 ; check_for_key_press &29a3 10 05 BPL &29aa ; not_pressed &29a5 b9 e7 04 LDA &04e7,Y ; function_key_action_table - 1 &29a8 95 00 STA &00,X # Change variable associated with key ; not_pressed &29aa 88 DEY &29ab 88 DEY &29ac 88 DEY &29ad d0 e4 BNE &2993 ; check_for_function_key_presses_loop &29af a5 94 LDA &94 ; game_paused # May have been changed by function key press &29b1 85 25 STA &25 ; scrolling_paused ; leave &29b3 60 RTS ; handle_firing &29b4 20 fc 26 JSR &26fc ; check_for_fire_pressed # Returns &ff if fire pressed &29b7 0a ASL A &29b8 a0 7c LDY #&7c &29ba 90 09 BCC &29c5 ; fire_not_pressed # If the player pressed fire, &29bc a0 80 LDY #&80 # use a slightly different pitch for sound &29be 24 3c BIT &3c ; player_fire_cooldown # Did the player fire last time? V set if so &29c0 46 3c LSR &3c ; player_fire_cooldown &29c2 50 07 BVC &29cb ; fire # If not, fire this time &29c4 60 RTS ; fire_not_pressed &29c5 46 3c LSR &3c ; player_fire_cooldown # If the player didn't press fire, &29c7 d0 ea BNE &29b3 ; leave # Did the player fire in the previous two frames? &29c9 b0 e8 BCS &29b3 ; leave # If not, fire this time ; fire &29cb 38 SEC &29cc 66 3c ROR &3c ; player_fire_cooldown &29ce 8c 2c 01 STY &012c ; sound_firing_pitch &29d1 a9 00 LDA #&00 &29d3 a0 00 LDY #&00 # Range 0 = bullets &29d5 20 34 37 JSR &3734 ; add_player_sprite_in_range_Y # Find a slot for the bullet &29d8 b0 d9 BCS &29b3 ; leave # If a slot was found, &29da ad 26 0f LDA &0f26 ; player_sprite_y &29dd 69 10 ADC #&10 &29df 9d 26 0f STA &0f26,X ; sprites_y # put the bullet above the player &29e2 a9 28 LDA #&28 ; sound_firing &29e4 4c f2 25 JMP &25f2 ; play_sound_on_free_channel # Play sound for firing ; initialise_stage &29e7 a6 4a LDX &4a ; stage_offset &29e9 20 c7 20 JSR &20c7 ; get_stage_flags # Returns X = map, A = big target variant &29ec 48 PHA &29ed 20 51 2b JSR &2b51 ; use_map_X &29f0 b0 1d BCS &2a0f ; same_map_as_before &29f2 8a TXA &29f3 48 PHA &29f4 a5 79 LDA &79 ; first_byte_of_stage_flags &29f6 29 10 AND #&10 &29f8 d0 0b BNE &2a05 ; is_commspace_stage &29fa a2 1c LDX #&1c # Write "Search Team Location" and world name &29fc a0 49 LDY #&49 &29fe 20 e1 1e JSR &1ee1 ; write_title_screen_string &2a01 24 0a BIT &0a ; use_normal_top_and_bottom_groups &2a03 30 00 BMI &2a05 ; is_commspace_stage # Unnecessary branch; was code removed here? ; is_commspace_stage &2a05 68 PLA &2a06 aa TAX &2a07 20 d8 2a JSR &2ad8 ; initialise_map_data &2a0a 68 PLA &2a0b 20 97 2a JSR &2a97 ; initialise_stage_sprites_and_map # Called with X = map, A = big target variant &2a0e 24 68 BIT &68 ; same_map_as_before #2a0f PLA ; use_launch_map &2a10 a2 18 LDX #&18 ; map_launch &2a12 10 44 BPL &2a58 ; initialise_map_and_music ; end_of_stage &2a14 24 49 BIT &49 ; before_during_or_after_main_map # &40 set if at devil rock or end launch &2a16 a9 40 LDA #&40 &2a18 85 49 STA &49 ; before_during_or_after_main_map &2a1a a5 79 LDA &79 ; first_byte_of_stage_flags &2a1c 50 34 BVC &2a52 ; use_end_of_stage_map # Is this the end of devil rock or end launch? &2a1e e6 49 INC &49 ; before_during_or_after_main_map # If so, stop enemies appearing on second fly past &2a20 29 10 AND #&10 &2a22 f0 2e BEQ &2a52 ; use_end_of_stage_map # Is this a CommSpace stage? If not, use end map &2a24 c6 2c DEC &2c ; scrolling_paused_but_game_continuing &2a26 0a ASL A # Use starting bonus score of 200 &2a27 a4 6e LDY &6e ; player_lives &2a29 c0 01 CPY #&01 &2a2b d0 03 BNE &2a30 ; skip_double_extra_life # If the player only has one life, &2a2d c8 INY # award two extra lives &2a2e a9 05 LDA #&05 # and use a starting bonus score of 50 ; skip_double_extra_life &2a30 c8 INY # Otherwise, award one extra life &2a31 84 6e STY &6e ; player_lives &2a33 85 9b STA &9b ; bonus_score + 1 &2a35 20 d4 31 JSR &31d4 ; reset_enemies_and_bullets &2a38 a9 00 LDA #&00 &2a3a 85 9a STA &9a ; bonus_score &2a3c 85 9c STA &9c ; bonus_score + 2 &2a3e 85 9d STA &9d ; bonus_score + 3 &2a40 85 6a STA &6a ; music_beats_missing &2a42 a2 65 LDX #&65 # Write TAB(&02, &16); "Bonus..........0" &2a44 a0 15 LDY #&15 &2a46 20 e1 1e JSR &1ee1 ; write_title_screen_string &2a49 20 79 2a JSR &2a79 ; to_write_bonus &2a4c a9 be LDA #&be &2a4e 85 5b STA &5b ; music_beat_cooldown &2a50 d0 23 BNE &2a75 ; call_to_null_function_instruction_two ; use_end_of_stage_map &2a52 a2 1c LDX #&1c ; map_devil_rock &2a54 29 10 AND #&10 # Was the last stage a CommSpace stage? &2a56 d0 b8 BNE &2a10 ; use_launch_map # If so, use the Launch map ; initialise_map_and_music # Otherwise, use the Devil Rock map &2a58 20 51 2b JSR &2b51 ; use_map_X # Copy map data in enhanced version &2a5b 20 d8 2a JSR &2ad8 ; initialise_map_data ; initialise_colours_and_music &2a5e 20 b0 2a JSR &2ab0 ; get_stage_X_foreground_and_background_colours &2a61 a5 8b LDA &8b ; block_number_of_desired_music &2a63 c5 75 CMP &75 ; block_number_of_music &2a65 f0 0e BEQ &2a75 ; skip_copying_music &2a67 85 75 STA &75 ; block_number_of_music ; call_to_null_function_instruction_three &2a69 20 eb 1e JSR &1eeb ; null_function # actually BIT &1eeb # Always commented out, but wouldn't do anything anyway &2a6c a5 75 LDA &75 ; block_number_of_music &2a6e a2 00 LDX #&00 &2a70 a0 11 LDY #&11 ; &1100 = music_data &2a72 20 81 1e JSR &1e81 ; copy_block_A_to_address_X_Y # Copy music data in enhanced version ; skip_copying_music ; call_to_null_function_instruction_two &2a75 20 eb 1e JSR &1eeb ; null_function # actually BIT &1eeb # Always commented out, but wouldn't do anything anyway &2a78 60 RTS ; to_write_bonus &2a79 a9 ff LDA #&ff &2a7b 48 PHA &2a7c 4c a1 34 JMP &34a1 ; write_bonus ; reinitialise_map_sprites_colours_and_music # X = map, A = big target variant &2a7f 48 PHA &2a80 c6 2c DEC &2c ; scrolling_paused_but_game_continuing &2a82 20 51 2b JSR &2b51 ; use_map_X &2a85 08 PHP &2a86 20 d8 2a JSR &2ad8 ; initialise_map_data &2a89 28 PLP &2a8a b0 05 BCS &2a91 ; skip_initialisation &2a8c 68 PLA &2a8d 20 97 2a JSR &2a97 ; initialise_stage_sprites_and_map # Called with X = map, A = big target variant &2a90 24 68 BIT &68 ; skip_initialisation #2a91 68 PLA &2a92 e6 2c INC &2c ; scrolling_paused_but_game_continuing &2a94 4c 5e 2a JMP &2a5e ; initialise_colours_and_music ; initialise_stage_sprites_and_map # X = map, A = big target variant &2a97 48 PHA &2a98 a9 ff LDA #&ff &2a9a 85 74 STA &74 ; block_number_of_stage_map &2a9c 8a TXA &2a9d 48 PHA &2a9e a9 00 LDA #&00 ; unpack_background_sprites_code_relocatable_block &2aa0 a2 b5 LDX #&b5 &2aa2 a0 14 LDY #&14 ; &14b5 = unrelocated_unpack_background_sprites_code &2aa4 20 81 1e JSR &1e81 ; copy_block_A_to_address_X_Y # Move code to unpack background sprites &2aa7 68 PLA &2aa8 aa TAX &2aa9 68 PLA ; call_to_update_world_name_and_tiles &2aaa 20 3d 15 JSR &153d ; update_world_name_and_tiles # Called with X = map, A = big target variant # also BIT &153d in standard version # Standard version uses single set of tiles &2aad 4c 51 2b JMP &2b51 ; use_map_X ; get_stage_X_foreground_and_background_colours &2ab0 8a TXA &2ab1 48 PHA &2ab2 bd 03 06 LDA &0603,X ; map_addresses_and_colours_table + 2 &2ab5 85 48 STA &48 ; stage_foreground_colours_and_bevelling &2ab7 29 7f AND #&7f &2ab9 a8 TAY &2aba e0 1c CPX #&1c # Is this devil rock? &2abc f0 17 BEQ &2ad5 ; leave # If so, keep colours from previous stage &2abe 18 CLC &2abf a5 56 LDA &56 ; use_hexagonal_background # Use different colours depending on background type &2ac1 29 02 AND #&02 &2ac3 7d 04 06 ADC &0604,X ; map_addresses_and_colours_table + 3 &2ac6 85 38 STA &38 ; stage_background_colours &2ac8 aa TAX &2ac9 98 TYA &2aca 48 PHA &2acb 20 c3 21 JSR &21c3 ; set_background_colours_to_set_X # X is background, A is foreground &2ace 68 PLA &2acf aa TAX &2ad0 85 39 STA &39 ; stage_foreground_colours &2ad2 20 a5 21 JSR &21a5 ; set_foreground_and_background_colours ; leave &2ad5 68 PLA &2ad6 aa TAX &2ad7 60 RTS ; initialise_map_data # Called with X = map &2ad8 a5 96 LDA &96 ; map_address_low &2ada 85 19 STA &19 ; main_map_data_address_low &2adc a5 97 LDA &97 ; map_address_high &2ade 85 1a STA &1a ; main_map_data_address_low &2ae0 8a TXA &2ae1 48 PHA &2ae2 a2 00 LDX #&00 &2ae4 a0 00 LDY #&00 &2ae6 a9 ff LDA #&ff ; initialise_map_compression_table_loop &2ae8 9d 00 0a STA &0a00,X ; map_compression_table &2aeb ca DEX &2aec d0 fa BNE &2ae8 ; initialise_map_compression_table_loop &2aee 84 33 STY &33 ; unused # Unused variable &2af0 84 32 STY &32 ; stage_has_had_screen_of_blank_tiles &2af2 84 43 STY &43 ; run_length &2af4 84 30 STY &30 ; number_of_bits_used_in_current_byte_of_map_data &2af6 84 7a STY &7a ; rows_into_stage &2af8 84 7b STY &7b ; destroyed_background_record_bit &2afa 84 7c STY &7c ; destroyed_background_record_offset &2afc e6 7b INC &7b ; destroyed_background_record_bit &2afe b1 19 LDA (&19),Y ; copy_of_map_address &2b00 85 2e STA &2e ; length_of_compressed_map_data_low &2b02 c8 INY &2b03 b1 19 LDA (&19),Y ; copy_of_map_address &2b05 85 2f STA &2f ; length_of_compressed_map_data_high &2b07 c8 INY &2b08 b1 19 LDA (&19),Y ; copy_of_map_address &2b0a 85 31 STA &31 ; number_of_bits_used_in_last_byte_of_compressed_map_data &2b0c c8 INY &2b0d b1 19 LDA (&19),Y ; copy_of_map_address &2b0f 85 45 STA &45 ; number_of_entries_in_map_compression_table &2b11 38 SEC &2b12 98 TYA &2b13 65 19 ADC &19 ; main_map_data_address_low &2b15 85 96 STA &96 ; map_data_address_low # Address of compression data &2b17 8a TXA &2b18 65 1a ADC &1a ; main_map_data_address_high &2b1a 85 97 STA &97 ; map_data_address_high &2b1c a5 45 LDA &45 ; number_of_entries_in_map_compression_table &2b1e 65 96 ADC &96 ; map_data_address_low &2b20 85 98 STA &98 ; other_map_data_address_low &2b22 8a TXA &2b23 a8 TAY &2b24 65 97 ADC &97 ; map_data_address_high &2b26 85 99 STA &99 ; other_map_data_address_high ; populate_map_compression_table_loop &2b28 b1 98 LDA (&98),Y ; other_map_data_address &2b2a aa TAX &2b2b b1 96 LDA (&96),Y ; map_data_address &2b2d 9d 00 0a STA &0a00,X ; map_compression_table &2b30 c8 INY &2b31 c4 45 CPY &45 ; number_of_entries_in_map_compression_table &2b33 d0 f3 BNE &2b28 ; populate_map_compression_table_loop &2b35 68 PLA &2b36 aa TAX &2b37 18 CLC &2b38 a5 45 LDA &45 ; number_of_entries_in_map_compression_table &2b3a 65 98 ADC &98 ; other_map_data_address_low &2b3c 85 19 STA &19 ; main_map_data_address_low &2b3e a9 00 LDA #&00 &2b40 65 99 ADC &99 ; other_map_data_address_high &2b42 85 1a STA &1a ; main_map_data_address_high &2b44 a5 19 LDA &19 ; main_map_data_address_low &2b46 65 2e ADC &2e ; length_of_compressed_map_data_low &2b48 85 2e STA &2e ; end_of_main_map_data_address_low &2b4a a5 1a LDA &1a ; main_map_data_address_high &2b4c 65 2f ADC &2f ; length_of_compressed_map_data_high &2b4e 85 2f STA &2f ; end_of_main_map_data_address_high &2b50 60 RTS ; use_map_X &2b51 8a TXA &2b52 48 PHA &2b53 bd 01 06 LDA &0601,X ; map_addresses_and_colours_table &2b56 85 96 STA &96 ; map_address_low &2b58 bc 02 06 LDY &0602,X ; map_addresses_and_colours_table + 1 &2b5b 84 97 STY &97 ; map_address_high &2b5d d0 32 BNE &2b91 ; skip_copying_map_block # Don't copy map on standard version &2b5f a2 29 LDX #&29 &2b61 a0 13 LDY #&13 ; &1329 = map_data &2b63 84 97 STY &97 ; map_address_high &2b65 86 96 STX &96 ; map_address_low &2b67 a4 56 LDY &56 ; use_hexagonal_background &2b69 0a ASL A &2b6a c0 80 CPY #&80 &2b6c 6a ROR A &2b6d c5 74 CMP &74 ; block_number_of_stage_map &2b6f d0 0a BNE &2b7b ; set_block_number_of_stage_map &2b71 a5 76 LDA &76 ; copy_of_map_address_low &2b73 85 96 STA &96 ; map_address_low &2b75 a5 77 LDA &77 ; copy_of_map_address_high &2b77 85 97 STA &97 ; map_address_high &2b79 b0 17 BCS &2b92 ; leave_after_restoring_X # Leave with carry set if same map as before ; set_block_number_of_stage_map &2b7b 85 74 STA &74 ; block_number_of_stage_map ; call_to_null_function_instruction_one &2b7d 20 eb 1e JSR &1eeb ; null_function # actually BIT &1eeb # Always commented out, but wouldn't do anything anyway &2b80 a5 74 LDA &74 ; block_number_of_stage_map &2b82 29 7f AND #&7f &2b84 a2 96 LDX #&96 ; map_address &2b86 20 84 1e JSR &1e84 ; copy_address_of_block_A_into_zero_page_X &2b89 a5 96 LDA &96 ; map_address_low &2b8b 85 76 STA &76 ; copy_of_map_address_low &2b8d a5 97 LDA &97 ; map_address_high &2b8f 85 77 STA &77 ; copy_of_map_address_high ; skip_copying_map_block &2b91 18 CLC ; leave_after_restoring_X &2b92 68 PLA &2b93 aa TAX &2b94 60 RTS ; move_get_and_bevel_row_of_background_tiles &2b95 ac 11 05 LDY &0511 ; tile_row_offsets_table &2b98 a2 f7 LDX #&f7 ; rotate_tile_row_offsets_loop # Move &0512-&051a to &0511-&0519, put &0511 in &051a &2b9a bd 1b 04 LDA &041b,X ; tile_row_offsets_table - &f6 &2b9d 9d 1a 04 STA &041a,X ; tile_row_offsets_table - &f6 &2ba0 e8 INX &2ba1 d0 f7 BNE &2b9a ; rotate_tile_row_offsets_loop &2ba3 8c 1a 05 STY &051a ; tile_row_offsets_table + 9 ; move_background_tiles_down_a_row_loop &2ba6 bd 2d 0e LDA &0e2d,X ; background_tiles + 1 + &16 + &16 &2ba9 99 17 0e STA &0e17,Y ; background_tiles + 1 + &16 + &16 &2bac c8 INY &2bad e8 INX &2bae e0 14 CPX #&14 &2bb0 d0 f4 BNE &2ba6 ; move_background_tiles_down_a_row_loop &2bb2 20 b8 2b JSR &2bb8 ; get_row_of_background_tiles &2bb5 4c 39 2c JMP &2c39 ; bevel_row_of_background_tiles_loop ; get_row_of_background_tiles &2bb8 a5 7b LDA &7b ; destroyed_background_record_bit &2bba 85 7d STA &7d ; previous_destroyed_background_record_bit &2bbc a5 7c LDA &7c ; destroyed_background_record_offset &2bbe 85 7e STA &7e ; previous_destroyed_background_record_offset &2bc0 a2 2c LDX #&2c ; move_background_tiles_loop &2bc2 bd ff 0d LDA &0dff,X ; background_tiles - 1 &2bc5 9d 15 0e STA &0e15,X ; background_tiles - 1 + &16 &2bc8 ca DEX &2bc9 d0 f7 BNE &2bc2 ; move_background_tiles_loop &2bcb 86 55 STX &55 ; right_part_of_big_tile &2bcd 8e 00 0e STX &0e00 ; background_tiles &2bd0 a5 3e LDA &3e ; number_of_blank_rows_before_next_map &2bd2 05 49 ORA &49 ; before_during_or_after_main_map # Only increment rows_into_stage in main stage map &2bd4 d0 02 BNE &2bd8 ; get_row_of_background_tiles_start &2bd6 e6 7a INC &7a ; rows_into_stage ; get_row_of_background_tiles_start &2bd8 a2 00 LDX #&00 # also LDX #&35 ; get_row_of_background_tiles_loop &2bda bd b3 0d LDA &0db3,X ; previous_row_of_background_tiles &2bdd 20 20 2d JSR &2d20 ; get_background_tile &2be0 9d 01 0e STA &0e01,X ; background_tiles + 1 &2be3 9d b3 0d STA &0db3,X ; previous_row_of_background_tiles &2be6 a8 TAY &2be7 b9 00 04 LDA &0400,Y ; background_tile_flags_table &2bea 29 0f AND #&0f &2bec f0 45 BEQ &2c33 ; continue_to_next_tile # Is this tile destroyable? &2bee a8 TAY &2bef b9 1c 05 LDA &051c,Y ; destroyed_background_tiles_flags_table - 1 &2bf2 4a LSR A ; DESTROYED_FLAG_TALL &2bf3 90 0c BCC &2c01 ; not_double_height &2bf5 bc 17 0e LDY &0e17,X ; background_tiles + 1 + &16 # If this is the top half of a double height tile, &2bf8 b9 00 04 LDA &0400,Y ; background_tile_flags_table # consider whether its bottom half is destroyable &2bfb 29 0f AND #&0f &2bfd f0 25 BEQ &2c24 ; use_destroyed_background_tile # If not, use destroyableness of this part &2bff d0 32 BNE &2c33 ; continue_to_next_tile # Otherwise, it was dealt with previously ; not_double_height &2c01 29 04 AND #&04 ; DESTROYED_FLAG_RIGHT &2c03 f0 0c BEQ &2c11 ; not_double_width &2c05 bc 00 0e LDY &0e00,X ; background_tiles # If this is the right half of a double width tile, &2c08 b9 00 04 LDA &0400,Y ; background_tile_flags_table # consider whether its left half is destroyable &2c0b 29 0f AND #&0f &2c0d f0 15 BEQ &2c24 ; use_destroyed_background_tile # If not, use destroyableness of this part &2c0f d0 22 BNE &2c33 ; continue_to_next_tile # Otherwise, it was dealt with previously ; not_double_width &2c11 a4 7c LDY &7c ; destroyed_background_record_offset &2c13 b9 c0 09 LDA &09c0,Y ; record_of_destroyed_background &2c16 25 7b AND &7b ; destroyed_background_record_bit # Has the tile been destroyed? &2c18 08 PHP &2c19 06 7b ASL &7b ; destroyed_background_record_bit &2c1b 90 04 BCC &2c21 ; same_byte &2c1d 26 7b ROL &7b ; destroyed_background_record_bit &2c1f e6 7c INC &7c ; destroyed_background_record_offset ; same_byte &2c21 28 PLP &2c22 f0 0f BEQ &2c33 ; continue_to_next_tile ; use_destroyed_background_tile &2c24 bc 01 0e LDY &0e01,X ; background_tiles + 1 &2c27 b9 00 04 LDA &0400,Y ; background_tile_flags_table &2c2a 29 0f AND #&0f &2c2c a8 TAY &2c2d b9 33 05 LDA &0533,Y ; destroyed_background_tiles_table - 1 # If so, use destroyed tile &2c30 9d 01 0e STA &0e01,X ; background_tiles + 1 ; continue_to_next_tile ; get_row_of_background_tiles_increment &2c33 e8 INX # also DEX ; get_row_of_background_tiles_end &2c34 e0 14 CPX #&14 # also CPX #&ff &2c36 d0 a2 BNE &2bda ; get_row_of_background_tiles_loop &2c38 60 RTS ; bevel_row_of_background_tiles &2c39 ad 01 0e LDA &0e01 ; background_tiles + 1 &2c3c 8d 00 0e STA &0e00 ; background_tiles &2c3f ad 14 0e LDA &0e14 ; background_tiles - 2 + &16 &2c42 8d 15 0e STA &0e15 ; background_tiles - 1 + &16 ; bevel_row_of_background_tiles_loop &2c45 bd 16 0e LDA &0e16,X ; background_tiles + &16 &2c48 d0 46 BNE &2c90 ; set_tile &2c4a 24 48 BIT &48 ; stage_foreground_colours_and_bevelling &2c4c 10 42 BPL &2c90 ; set_tile &2c4e bc ff 0d LDY &0dff,X ; background_tiles - 1 &2c51 c0 01 CPY #&01 &2c53 6a ROR A &2c54 bc 00 0e LDY &0e00,X ; background_tiles &2c57 c0 01 CPY #&01 &2c59 6a ROR A &2c5a bc 01 0e LDY &0e01,X ; background_tiles + 1 &2c5d c0 01 CPY #&01 &2c5f 6a ROR A &2c60 bc 17 0e LDY &0e17,X ; background_tiles + 1 + &16 &2c63 c0 01 CPY #&01 &2c65 6a ROR A &2c66 bc 2d 0e LDY &0e2d,X ; background_tiles + 1 + &16 + &16 &2c69 c0 01 CPY #&01 &2c6b 6a ROR A &2c6c bc 2c 0e LDY &0e2c,X ; background_tiles + &16 + &16 &2c6f c0 01 CPY #&01 &2c71 6a ROR A &2c72 bc 2b 0e LDY &0e2b,X ; background_tiles - 1 + &16 + &16 &2c75 c0 01 CPY #&01 &2c77 6a ROR A &2c78 bc 15 0e LDY &0e15,X ; background_tiles - 1 + &16 &2c7b c0 01 CPY #&01 &2c7d 6a ROR A &2c7e f0 10 BEQ &2c90 ; set_tile &2c80 a0 35 LDY #&35 ; find_bevel_tile_loop &2c82 d9 6f 05 CMP &056f,Y ; bevel_values_table - 1 &2c85 f0 06 BEQ &2c8d ; use_bevel_tile &2c87 88 DEY &2c88 d0 f8 BNE &2c82 ; find_bevel_tile_loop &2c8a 98 TYA &2c8b f0 03 BEQ &2c90 ; set_tile ; use_bevel_tile &2c8d b9 a4 05 LDA &05a4,Y ; bevel_tiles_table - 1 ; set_tile &2c90 9d 9e 0d STA &0d9e,X ; this_row_of_background_tiles - 1 &2c93 ca DEX &2c94 d0 af BNE &2c45 ; bevel_row_of_background_tiles_loop &2c96 60 RTS ; record_destruction_of_tile # Called with X = offset_of_ground_target &2c97 86 90 STX &90 ; offset_of_ground_target &2c99 a5 7d LDA &7d ; previous_destroyed_background_record_bit &2c9b 85 92 STA &92 ; bit &2c9d a5 7e LDA &7e ; previous_destroyed_background_record_offset &2c9f 85 93 STA &93 ; offset &2ca1 a2 0b LDX #&0b # Starting from the bottom right of the screen, ; row_loop &2ca3 8a TXA &2ca4 48 PHA &2ca5 bd 11 05 LDA &0511,X ; tile_row_offsets_table &2ca8 18 CLC &2ca9 69 13 ADC #&13 &2cab aa TAX &2cac a0 14 LDY #&14 &2cae 84 91 STY &91 ; column ; column_loop &2cb0 bc 17 0e LDY &0e17,X ; background_tiles + 1 + &16 # search through the tiles for destroyable ones &2cb3 b9 00 04 LDA &0400,Y ; background_tile_flags_table &2cb6 29 0f AND #&0f &2cb8 d0 0d BNE &2cc7 ; tile_is_destroyable ; continue_search &2cba ca DEX &2cbb c6 91 DEC &91 ; column &2cbd d0 f1 BNE &2cb0 ; column_loop &2cbf 68 PLA &2cc0 aa TAX &2cc1 ca DEX &2cc2 10 df BPL &2ca3 ; row_loop &2cc4 a6 90 LDX &90 ; offset_of_ground_target &2cc6 60 RTS ; tile_is_destroyable &2cc7 a8 TAY &2cc8 b9 1c 05 LDA &051c,Y ; destroyed_background_tiles_flags_table - 1 &2ccb 29 09 AND #&09 ; DESTROYED_FLAG_LEFT | DESTROYED_FLAG_TALL &2ccd d0 eb BNE &2cba ; continue_search # If this is the bottom left of a destroyable tile, &2ccf a4 93 LDY &93 ; offset &2cd1 b9 c0 09 LDA &09c0,Y ; record_of_destroyed_background # move back in the record ; find_unset_bit_loop &2cd4 46 92 LSR &92 ; bit &2cd6 90 06 BCC &2cde ; same_byte &2cd8 66 92 ROR &92 ; bit &2cda 88 DEY &2cdb b9 c0 09 LDA &09c0,Y ; record_of_destroyed_background ; same_byte &2cde 24 92 BIT &92 ; bit &2ce0 d0 f2 BNE &2cd4 ; find_unset_bit_loop &2ce2 84 93 STY &93 ; offset &2ce4 e4 90 CPX &90 ; offset_of_ground_target &2ce6 d0 d2 BNE &2cba ; continue_search # until the tile being destroyed is found &2ce8 05 92 ORA &92 ; bit &2cea 99 c0 09 STA &09c0,Y ; record_of_destroyed_background # Mark that tile as being destroyed in the record &2ced 68 PLA &2cee 60 RTS ; deal_with_non_zero_number_of_runs &2cef c6 3e DEC &3e ; number_of_blank_rows_before_next_map &2cf1 d0 24 BNE &2d17 ; add_row_of_blank_tiles &2cf3 8a TXA # At the end of the screen of blank tiles, &2cf4 48 PHA &2cf5 24 49 BIT &49 ; before_during_or_after_main_map # &80 set if on starting launch &2cf7 30 10 BMI &2d09 ; set_carry &2cf9 08 PHP &2cfa 20 14 2a JSR &2a14 ; end_of_stage &2cfd 28 PLP &2cfe 70 03 BVS &2d03 ; skip_reactor_reset &2d00 20 9a 20 JSR &209a ; wipe_record_of_destroyed_background ; skip_reactor_reset &2d03 24 32 BIT &32 ; stage_has_had_screen_of_blank_tiles &2d05 30 0a BMI &2d11 ; add_screen_of_blank_tiles_with_pla_x # &80 set before start of map data &2d07 18 CLC &2d08 24 38 BIT &38 ; set_carry #2d09 38 SEC &2d0a 66 32 ROR &32 ; stage_has_had_screen_of_blank_tiles # Set &80 if on starting launch &2d0c 68 PLA &2d0d aa TAX &2d0e 4c 17 2d JMP &2d17 ; add_row_of_blank_tiles ; add_screen_of_blank_tiles_with_pla_x &2d11 68 PLA &2d12 aa TAX ; add_screen_of_blank_tiles &2d13 a9 0f LDA #&0f &2d15 85 3e STA &3e ; number_of_blank_rows_before_next_map ; add_row_of_blank_tiles &2d17 a9 13 LDA #&13 &2d19 85 43 STA &43 ; run_length &2d1b a9 00 LDA #&00 &2d1d 85 44 STA &44 ; run_tile &2d1f 60 RTS ; get_background_tile &2d20 85 92 STA &92 ; tile_below_this_one &2d22 a5 43 LDA &43 ; run_length &2d24 d0 04 BNE &2d2a ; not_blank &2d26 a4 3e LDY &3e ; number_of_blank_rows_before_next_map &2d28 d0 c5 BNE &2cef ; deal_with_non_zero_number_of_runs ; not_blank &2d2a 8a TXA &2d2b 48 PHA &2d2c a5 55 LDA &55 ; right_part_of_big_tile # If the tile to the left was part of a big tile, &2d2e d0 3d BNE &2d6d ; use_tile_from_A # use its right side for this tile &2d30 a6 92 LDX &92 ; tile_below_this_one &2d32 bd 00 04 LDA &0400,X ; background_tile_flags_table &2d35 29 20 AND #&20 ; TILE_HAS_TOP # If the tile below was part of a big tile, &2d37 d0 08 BNE &2d41 ; use_top_part_of_big_tile # use its top part for this tile &2d39 a5 43 LDA &43 ; run_length &2d3b f0 0b BEQ &2d48 ; end_of_run &2d3d c6 43 DEC &43 ; run_length # If the previous run of tiles hasn't finished, &2d3f 10 2a BPL &2d6b ; use_tile_from_run # use the same tile as before ; use_top_part_of_big_tile &2d41 a0 1b LDY #&1b &2d43 20 83 2d JSR &2d83 ; get_other_part_of_big_tile # Get top part of big tile into A &2d46 b0 25 BCS &2d6d ; use_tile_from_A # Carry is always set, so use top part of tile ; end_of_run &2d48 24 32 BIT &32 ; stage_has_had_screen_of_blank_tiles # &80 set before start of map data &2d4a 30 02 BMI &2d4e ; use_map &2d4c 70 c3 BVS &2d11 ; add_screen_of_blank_tiles_with_pla_x # Add a screen of blank tiles at end of map ; use_map &2d4e a2 ff LDX #&ff &2d50 20 9b 2d JSR &2d9b ; get_bits_of_map_data # Get a bit sequence with an entry in the compression &2d53 a6 47 LDX &47 ; compression_table_offset # table, moving on that many bits of map data &2d55 bc 00 0a LDY &0a00,X ; map_compression_table # From that entry, &2d58 98 TYA &2d59 4a LSR A &2d5a 4a LSR A &2d5b 4a LSR A &2d5c aa TAX # high five bits set tile, &2d5d bd f7 2d LDA &2df7,X ; stage_tiles_lookup_table &2d60 85 44 STA &44 ; run_tile &2d62 98 TYA &2d63 29 07 AND #&07 # low three bits set number of bits for run length &2d65 aa TAX &2d66 20 9b 2d JSR &2d9b ; get_bits_of_map_data # Get that many bits for the length of the run &2d69 85 43 STA &43 ; run_length ; use_tile_from_run &2d6b a5 44 LDA &44 ; run_tile ; use_tile_from_A &2d6d 85 46 STA &46 ; tile &2d6f aa TAX &2d70 a0 00 LDY #&00 ; check_for_tile_extending_horizontally &2d72 a9 40 LDA #&40 ; TILE_HAS_RIGHT # also LDA #&10 ; TILE_HAS_LEFT # in unused code path &2d74 3d 00 04 AND &0400,X ; background_tile_flags_table &2d77 f0 03 BEQ &2d7c ; tile_doesn't_extend_to_right &2d79 20 83 2d JSR &2d83 ; get_other_part_of_big_tile # Get right part of big tile into A ; tile_doesn't_extend_to_right &2d7c 85 55 STA &55 ; right_part_of_big_tile &2d7e 68 PLA &2d7f aa TAX &2d80 a5 46 LDA &46 ; tile &2d82 60 RTS ; get_other_part_of_big_tile # Called with A = TILE_HAS_TOP, Y = &1b, X = tile &2d83 86 92 STX &92 ; tile # or A = TILE_HAS_RIGHT, Y = &00, X = tile &2d85 a2 00 LDX #&00 ; get_other_part_of_big_tile_loop # Increment Y for every tile type that has flag &2d87 e4 92 CPX &92 ; tile &2d89 f0 0c BEQ &2d97 ; found_other_part_of_big_tile # before this tile &2d8b 8e 90 2d STX &2d90 ; get_other_part_of_big_tile_bit + 1 &2d8e e8 INX ; get_other_part_of_big_tile_bit &2d8f 2c 00 04 BIT &0400 ; background_tile_flags_table # actually BIT &04XX ; background_tile_flags_table + tile &2d92 f0 f3 BEQ &2d87 ; get_other_part_of_big_tile_loop &2d94 c8 INY &2d95 d0 f0 BNE &2d87 ; get_other_part_of_big_tile_loop # Always continue loop ; found_other_part_of_big_tile &2d97 b9 43 05 LDA &0543,Y ; big_tiles_parts_table # Return top or right part of tile, leave with carry set &2d9a 60 RTS ; get_bits_of_map_data &2d9b 8a TXA &2d9c f0 58 BEQ &2df6 ; leave # Leave with zero if X = 0 &2d9e a0 00 LDY #&00 &2da0 b1 19 LDA (&19),Y ; main_map_data &2da2 85 46 STA &46 ; byte_one &2da4 c8 INY &2da5 b1 19 LDA (&19),Y ; main_map_data &2da7 85 92 STA &92 ; byte_two &2da9 a4 30 LDY &30 ; number_of_bits_used_in_current_byte_of_map_data &2dab f0 07 BEQ &2db4 ; skip_rotation ; rotate_map_data_bytes_loop # Skip past the bits that have already been used &2dad 46 92 LSR &92 ; byte_two &2daf 66 46 ROR &46 ; byte_one &2db1 88 DEY &2db2 d0 f9 BNE &2dad ; rotate_map_data_bytes_loop ; skip_rotation &2db4 8a TXA &2db5 10 15 BPL &2dcc ; skip_finding_leading_bit_sequence # If called with X = &ff, &2db7 24 c8 BIT &c8 ; find_leading_bit_sequence_loop # Search for a sequence of bits that is a prefix #2db8 c8 INY # Consider 0, 1 (table entries 2-3) &2db9 a5 46 LDA &46 ; byte_one # then 00, 01, 10, 11 (table entries 4-7) &2dbb 39 54 04 AND &0454,Y ; cumulative_single_bit_table # then 000, 001, 010, 011, 100, 101, 110, 111 (8-15) &2dbe 19 4d 06 ORA &064d,Y ; single_bit_table # etc, until an entry is found that isn't &ff &2dc1 aa TAX &2dc2 bd 00 0a LDA &0a00,X ; map_compression_table &2dc5 c9 ff CMP #&ff &2dc7 f0 ef BEQ &2db8 ; find_leading_bit_sequence_loop &2dc9 86 47 STX &47 ; compression_table_offset &2dcb 98 TYA ; skip_finding_leading_bit_sequence # Otherwise, get X bits of map data &2dcc 18 CLC &2dcd 65 30 ADC &30 ; number_of_bits_used_in_current_byte_of_map_data &2dcf c9 08 CMP #&08 &2dd1 29 07 AND #&07 &2dd3 85 30 STA &30 ; number_of_bits_used_in_current_byte_of_map_data &2dd5 a5 46 LDA &46 ; byte_one &2dd7 3d 54 04 AND &0454,X ; cumulative_single_bit_table &2dda 90 06 BCC &2de2 ; skip_moving_to_next_map_data_byte # Move to the next byte of map data if necessary &2ddc e6 19 INC &19 ; main_map_data_address_low &2dde d0 02 BNE &2de2 &2de0 e6 1a INC &1a ; main_map_data_address_high ; skip_moving_to_next_map_data_byte &2de2 48 PHA ; x_bits_of_map_data &2de3 a5 30 LDA &30 ; number_of_bits_used_in_current_byte_of_map_data &2de5 c5 31 CMP &31 ; number_of_bits_used_in_last_byte_of_compressed_map_data &2de7 a5 19 LDA &19 ; main_map_data_address_low &2de9 e5 2e SBC &2e ; end_of_main_map_data_address_low &2deb a5 1a LDA &1a ; main_map_data_address_high &2ded e5 2f SBC &2f ; end_of_main_map_data_address_high &2def 90 04 BCC &2df5 ; leave_with_pla # Is this the end of the map data? &2df1 a9 40 LDA #&40 &2df3 85 32 STA &32 ; stage_has_had_screen_of_blank_tiles # &40 set to indicate end of map data ; leave_with_pla &2df5 68 PLA ; x_bits_of_map_data ; leave &2df6 60 RTS ; stage_tiles_lookup_table &2df7 00 ; &00 = TILE_SPACE &2df8 01 ; &01 = TILE_TRIANGLE_BR &2df9 02 ; &02 = TILE_TRIANGLE_BL &2dfa 03 ; &03 = TILE_TRIANGLE_TL &2dfb 04 ; &04 = TILE_TRIANGLE_TR &2dfc 05 ; &05 = TILE_MEDIUM_TARGET_ONE &2dfd 07 ; &06 = TILE_TRENCH_TOP &2dfe 09 ; &07 = TILE_TRENCH_BOTTOM &2dff 0b ; &08 = TILE_BACKGROUND &2e00 0c ; &09 = TILE_BACKGROUND_FILL &2e01 0d ; &0a = TILE_TRENCH_MIDDLE &2e02 17 ; &0b = TILE_REACTOR &2e03 21 ; &0c = TILE_PLUS &2e04 22 ; &0d = TILE_MULTIPLY &2e05 23 ; &0e = TILE_BIG_TARGET_ONE &2e06 26 ; &0f = TILE_MEDIUM_TARGET_TWO_TOP &2e07 28 ; &10 = TILE_BIG_TARGET_ONE_TOP &2e08 2b ; &11 = TILE_GIRDER_VERTICAL &2e09 2c ; &12 = TILE_UNUSED # Unused tile type &2e0a 2d ; &13 = TILE_TANK &2e0b 2e ; &14 = TILE_ANTENNA &2e0c 2f ; &15 = TILE_GIRDER_HORIZONTAL &2e0d 30 ; &16 = TILE_TARGET_RESERVOIR_TOP &2e0e 32 ; &17 = TILE_TARGET_RESERVOIR &2e0f 34 ; &18 = TILE_EARTH &2e10 35 ; &19 = TILE_SMALL_TARGET &2e11 36 ; &1a = TILE_TARGET_BALL &2e12 38 ; &1b = TILE_ICE &2e13 39 ; &1c = TILE_DUST &2e14 3a ; &1d = TILE_SPIKE_WITH_SHADOW &2e15 3b ; &1e = TILE_SPIKE &2e16 3d ; &1f = TILE_QUESTION ; initialise_stars &2e17 a9 ff LDA #&ff &2e19 85 4f STA &4f ; initialising_stars &2e1b a2 1e LDX #&1e &2e1d 20 35 2e JSR &2e35 ; update_stars_loop &2e20 e6 4f INC &4f ; initialising_stars ; leave &2e22 60 RTS ; consider_omitting_star &2e23 24 79 BIT &79 ; first_byte_of_stage_flags &2e25 10 21 BPL &2e48 ; set_star_pixel_value # Include the star if the level isn't dark &2e27 24 4f BIT &4f ; initialising_stars &2e29 30 1d BMI &2e48 ; set_star_pixel_value # or the stars are being initialised &2e2b 60 RTS ; update_stars &2e2c a5 02 LDA &02 ; screen_vertical_scroll &2e2e 29 07 AND #&07 &2e30 aa TAX &2e31 bd 2c 05 LDA &052c,X ; number_of_stars_to_update_table &2e34 aa TAX ; update_stars_loop &2e35 ca DEX &2e36 30 ea BMI &2e22 ; leave &2e38 a9 02 LDA #&02 # Colour 1, left pixel &2e3a e0 0a CPX #&0a &2e3c f0 e5 BEQ &2e23 ; consider_omitting_star &2e3e 90 08 BCC &2e48 ; set_star_pixel_value &2e40 a9 0a LDA #&0a # Colour 3, left pixel &2e42 e0 14 CPX #&14 &2e44 90 02 BCC &2e48 ; set_star_pixel_value &2e46 a9 08 LDA #&08 # Colour 2, left pixel ; set_star_pixel_value &2e48 85 4d STA &4d ; star_pixel_value &2e4a 38 SEC &2e4b bd 08 10 LDA &1008,X ; stars_y &2e4e e5 02 SBC &02 ; screen_vertical_scroll &2e50 c9 f0 CMP #&f0 &2e52 b0 57 BCS &2eab ; move_star_to_top_of_screen &2e54 24 4f BIT &4f ; initialising_stars &2e56 30 4b BMI &2ea3 ; initialise_star &2e58 bd 44 10 LDA &1044,X ; stars_screen_address_high &2e5b 30 11 BMI &2e6e ; skip_unplotting_star &2e5d 85 0e STA &0e ; screen_address_high &2e5f bd 26 10 LDA &1026,X ; stars_screen_address_low &2e62 85 0d STA &0d ; screen_address_low &2e64 a0 00 LDY #&00 &2e66 a5 4d LDA &4d ; star_pixel_value &2e68 49 ff EOR #&ff &2e6a 31 0d AND (&0d),Y ; screen_address &2e6c 91 0d STA (&0d),Y ; screen_address # Unplot star ; skip_unplotting_star &2e6e fe 08 10 INC &1008,X ; stars_y ; plot_star &2e71 bd ea 0f LDA &0fea,X ; stars_x &2e74 85 13 STA &13 ; check_x &2e76 bd 08 10 LDA &1008,X ; stars_y &2e79 85 14 STA &14 ; check_y &2e7b 20 c1 2e JSR &2ec1 ; get_flags_for_tile_at_check_x_y &2e7e 10 1b BPL &2e9b ; skip_plotting_star # Top bit of flags set if stars show through tile &2e80 8a TXA &2e81 48 PHA &2e82 20 be 1d JSR &1dbe ; calculate_screen_address &2e85 68 PLA &2e86 aa TAX &2e87 a0 00 LDY #&00 &2e89 b1 0d LDA (&0d),Y ; screen_address &2e8b 24 4c BIT &4c ; ten &2e8d d0 0c BNE &2e9b ; skip_plotting_star &2e8f 45 4d EOR &4d ; star_pixel_value # Plot star &2e91 91 0d STA (&0d),Y ; screen_address &2e93 a5 0d LDA &0d ; screen_address_low &2e95 9d 26 10 STA &1026,X ; stars_screen_address_low &2e98 a5 0e LDA &0e ; screen_address_high &2e9a 2c a9 ff BIT &ffa9 ; skip_plotting_star #2e9b a9 ff LDA #&ff &2e9d 9d 44 10 STA &1044,X ; stars_screen_address_high &2ea0 4c 35 2e JMP &2e35 ; update_stars_loop ; initialise_star &2ea3 20 32 22 JSR &2232 ; get_random_number &2ea6 c9 b4 CMP #&b4 &2ea8 b0 f9 BCS &2ea3 ; initialise_star &2eaa 2c a9 be BIT &bea9 ; move_star_to_top_of_screen #2eab a9 be LDA #&be &2ead 18 CLC &2eae 65 02 ADC &02 ; screen_vertical_scroll &2eb0 9d 08 10 STA &1008,X ; stars_y ; get_star_x &2eb3 20 32 22 JSR &2232 ; get_random_number &2eb6 29 7f AND #&7f &2eb8 c9 50 CMP #&50 &2eba b0 f7 BCS &2eb3 ; get_star_x &2ebc 9d ea 0f STA &0fea,X ; stars_x &2ebf 90 b0 BCC &2e71 ; plot_star ; get_flags_for_tile_at_check_x_y &2ec1 20 c9 2e JSR &2ec9 ; get_tile_at_check_x_y &2ec4 a8 TAY &2ec5 b9 00 04 LDA &0400,Y ; background_tile_flags_table &2ec8 60 RTS ; get_tile_at_check_x_y &2ec9 18 CLC &2eca a5 14 LDA &14 ; check_y &2ecc 29 f0 AND #&f0 &2ece e5 02 SBC &02 ; screen_vertical_scroll &2ed0 4a LSR A &2ed1 4a LSR A &2ed2 4a LSR A &2ed3 4a LSR A &2ed4 c9 0c CMP #&0c &2ed6 90 02 BCC &2eda ; skip_ceiling &2ed8 a9 00 LDA #&00 ; skip_ceiling &2eda a8 TAY &2edb a5 13 LDA &13 ; check_x &2edd 4a LSR A &2ede 4a LSR A &2edf 18 CLC &2ee0 79 11 05 ADC &0511,Y ; tile_row_offsets_table &2ee3 a8 TAY &2ee4 b9 17 0e LDA &0e17,Y ; background_tiles + 1 + &16 &2ee7 60 RTS ; wipe_screen_and_background_tiles_tables &2ee8 a9 40 LDA #&40 ; &4000 = start of screen memory &2eea 85 93 STA &93 ; screen_address_high &2eec a0 00 LDY #&00 &2eee 84 92 STY &92 ; screen_address_low &2ef0 98 TYA ; wipe_screen_loop &2ef1 91 92 STA (&92),Y ; screen_address &2ef3 c8 INY &2ef4 d0 fb BNE &2ef1 ; wipe_screen_loop &2ef6 e6 93 INC &93 ; screen_address_high &2ef8 10 f7 BPL &2ef1 ; wipe_screen_loop ; wipe_background_tiles &2efa a0 c8 LDY #&c8 ; wipe_nine_rows_of_background_tiles_loop &2efc 99 41 0e STA &0e41,Y ; background_tiles - 1 + &16 * 3 # Zero &0e42-&0f09 (nine rows of tiles) &2eff 88 DEY &2f00 d0 fa BNE &2efc ; wipe_nine_rows_of_background_tiles_loop &2f02 a0 42 LDY #&42 ; wipe_three_rows_of_background_tiles_loop &2f04 99 ff 0d STA &0dff,Y ; background_tiles - 1 # Zero &0e00-&0e42 (three rows of tiles) &2f07 88 DEY &2f08 d0 fa BNE &2f04 ; wipe_nine_rows_of_background_tiles_loop &2f0a a0 28 LDY #&28 ; wipe_this_and_previous_row_of_background_tiles_loop # Zero &0d9f-&0dc6 (this and previous row of tiles) &2f0c 99 9e 0d STA &0d9e,Y ; this_row_of_background_tiles - 1 &2f0f 88 DEY &2f10 d0 fa BNE &2f0c ; wipe_this_and_previous_row_of_background_tiles_loop &2f12 60 RTS ; plot_eight_pixel_rows_of_background &2f13 20 49 1e JSR &1e49 ; set_crtc_start_address_from_screen_start_address_after_moving_up_a_group ; plot_eight_pixel_rows_of_background_without_setting_crtc &2f16 a9 08 LDA #&08 &2f18 85 09 STA &09 ; rows_of_background_to_plot &2f1a 18 CLC &2f1b 65 03 ADC &03 ; screen_new_vertical_scroll &2f1d 85 03 STA &03 ; screen_new_vertical_scroll &2f1f 4c 1a 1e JMP &1e1a ; plot_rows_of_background ; scroll_into_position_on_stage # X = rows_into_stage &2f22 a9 00 LDA #&00 &2f24 85 09 STA &09 ; rows_of_background_to_plot &2f26 85 08 STA &08 ; rows_to_scroll &2f28 a5 03 LDA &03 ; screen_new_vertical_scroll &2f2a 29 f0 AND #&f0 &2f2c 09 07 ORA #&07 &2f2e 85 03 STA &03 ; screen_new_vertical_scroll &2f30 85 02 STA &02 ; screen_vertical_scroll &2f32 ad 50 03 LDA &0350 ; os_address_of_top_left_of_screen_low &2f35 85 06 STA &06 ; screen_start_address_low &2f37 ad 51 03 LDA &0351 ; os_address_of_top_left_of_screen_high &2f3a 85 07 STA &07 ; screen_start_address_high &2f3c 20 49 1e JSR &1e49 ; set_crtc_start_address_from_screen_start_address_after_moving_up_a_group &2f3f 20 e8 2e JSR &2ee8 ; wipe_screen_and_background_tiles_tables &2f42 8a TXA &2f43 48 PHA &2f44 20 17 2e JSR &2e17 ; initialise_stars &2f47 a6 38 LDX &38 ; stage_background_colours &2f49 20 c3 21 JSR &21c3 ; set_background_colours_to_set_X &2f4c 68 PLA &2f4d aa TAX ; find_position_in_map_loop # Work through map data until at desired row into stage &2f4e e0 0e CPX #&0e &2f50 90 0d BCC &2f5f ; in_position &2f52 8a TXA &2f53 48 PHA &2f54 20 b8 2b JSR &2bb8 ; get_row_of_background_tiles &2f57 20 b1 28 JSR &28b1 ; handle_music_and_postponed_sounds &2f5a 68 PLA &2f5b aa TAX &2f5c ca DEX &2f5d d0 ef BNE &2f4e ; find_position_in_map_loop ; in_position &2f5f 8a TXA &2f60 48 PHA &2f61 a9 5f LDA #&5f &2f63 85 5b STA &5b ; music_beat_cooldown &2f65 a2 00 LDX #&00 &2f67 20 1e 26 JSR &261e ; play_start_of_stage_chord &2f6a 68 PLA &2f6b aa TAX &2f6c f0 10 BEQ &2f7e ; skip_plotting_background # Don't scroll at very start of stage ; scroll_into_position_on_stage_loop &2f6e 8a TXA &2f6f 48 PHA &2f70 20 13 2f JSR &2f13 ; plot_eight_pixel_rows_of_background &2f73 20 13 2f JSR &2f13 ; plot_eight_pixel_rows_of_background &2f76 20 b1 28 JSR &28b1 ; handle_music_and_postponed_sounds &2f79 68 PLA &2f7a aa TAX &2f7b ca DEX &2f7c d0 f0 BNE &2f6e ; scroll_into_position_on_stage_loop ; skip_plotting_background &2f7e 20 16 2f JSR &2f16 ; plot_eight_pixel_rows_of_background_without_setting_crtc &2f81 a9 8b LDA #&8b ; f5 &2f83 20 17 22 JSR &2217 ; check_for_key_press # Returns &ff if f5 pressed &2f86 45 73 EOR &73 ; screen_tweak_enabled &2f88 85 73 STA &73 ; screen_tweak_enabled # Toggle screen_tweak_enabled when f5 pressed &2f8a 20 17 2e JSR &2e17 ; initialise_stars &2f8d 20 34 23 JSR &2334 ; plot_score_to_screen &2f90 a6 39 LDX &39 ; stage_foreground_colours &2f92 4c a5 21 JMP &21a5 ; set_foreground_and_background_colours ; plot_row_of_background_tiles &2f95 a5 02 LDA &02 ; screen_vertical_scroll &2f97 24 2a BIT &2a ; seven &2f99 d0 40 BNE &2fdb ; leave # Is this a new group? &2f9b a0 00 LDY #&00 ; top &2f9d 29 08 AND #&08 &2f9f d0 05 BNE &2fa6 ; skip_fetching_background # Is this the second half of a tile? &2fa1 20 95 2b JSR &2b95 ; move_get_and_bevel_row_of_background_tiles &2fa4 a0 01 LDY #&01 ; bottom ; skip_fetching_background &2fa6 84 2b STY &2b ; group &2fa8 ac 51 03 LDY &0351 ; os_address_of_top_left_of_screen_high &2fab ae 50 03 LDX &0350 ; os_address_of_top_left_of_screen_low &2fae 84 0e STY &0e ; screen_address_high &2fb0 86 0d STX &0d ; screen_address_low &2fb2 a0 00 LDY #&00 ; plot_row_of_background_tiles_loop &2fb4 98 TYA &2fb5 48 PHA &2fb6 b9 9f 0d LDA &0d9f,Y ; this_row_of_background_tiles &2fb9 0a ASL A &2fba 05 2b ORA &2b ; group &2fbc aa TAX &2fbd bd b0 0b LDA &0bb0,X ; background_sprites_index_table &2fc0 20 c4 30 JSR &30c4 ; plot_background_sprite &2fc3 18 CLC &2fc4 a5 0d LDA &0d ; screen_address_low &2fc6 69 20 ADC #&20 &2fc8 85 0d STA &0d ; screen_address_low &2fca 90 08 BCC &2fd4 ; skip_wrap_around &2fcc e6 0e INC &0e ; screen_address_high &2fce 10 04 BPL &2fd4 ; skip_wrap_around &2fd0 a9 40 LDA #&40 &2fd2 85 0e STA &0e ; screen_address_high ; skip_wrap_around &2fd4 68 PLA &2fd5 a8 TAY &2fd6 c8 INY &2fd7 c0 14 CPY #&14 &2fd9 d0 d9 BNE &2fb4 ; plot_row_of_background_tiles_loop ; leave &2fdb 60 RTS ; destroy_ground_target &2fdc a9 00 LDA #&00 &2fde 85 9e STA &9e ; collision_occurred &2fe0 a5 13 LDA &13 ; check_x &2fe2 29 fc AND #&fc &2fe4 85 9c STA &9c ; rounded_x &2fe6 a5 14 LDA &14 ; check_y &2fe8 29 f0 AND #&f0 &2fea 85 9d STA &9d ; rounded_y &2fec 20 c1 2e JSR &2ec1 ; get_flags_for_tile_at_check_x_y &2fef 29 0f AND #&0f &2ff1 a8 TAY &2ff2 b9 1c 05 LDA &051c,Y ; destroyed_background_tiles_flags_table - 1 &2ff5 f0 1b BEQ &3012 ; consider_single_tile &2ff7 4a LSR A ; DESTROYED_FLAG_TALL &2ff8 90 0a BCC &3004 ; consider_wide_tiles # Lowest bit set for double height tiles &2ffa 20 04 30 JSR &3004 ; consider_wide_tiles # Destroy top half &2ffd 38 SEC &2ffe a5 9d LDA &9d ; rounded_y &3000 e9 10 SBC #&10 &3002 85 9d STA &9d ; rounded_y # then the bottom half ; consider_wide_tiles &3004 a9 08 LDA #&08 ; DESTROYED_FLAG_LEFT &3006 a0 fc LDY #&fc &3008 20 16 30 JSR &3016 ; check_if_tile_can_be_destroyed # Consider destroying tile to left &300b a9 04 LDA #&04 ; DESTROYED_FLAG_RIGHT &300d a0 04 LDY #&04 &300f 20 16 30 JSR &3016 ; check_if_tile_can_be_destroyed # Consider destroying tile to right ; consider_single_tile # Consider destroying central tile &3012 a9 ff LDA #&ff &3014 a0 00 LDY #&00 ; check_if_tile_can_be_destroyed &3016 85 4d STA &4d ; flag_to_check &3018 84 99 STY &99 ; x_offset &301a a5 9c LDA &9c ; rounded_x &301c 85 13 STA &13 ; check_x &301e a5 9d LDA &9d ; rounded_y &3020 85 14 STA &14 ; check_y &3022 20 c9 2e JSR &2ec9 ; get_tile_at_check_x_y # Returns offset of tile in Y &3025 aa TAX &3026 84 98 STY &98 ; offset_of_ground_target &3028 bd 00 04 LDA &0400,X ; background_tile_flags_table &302b 29 0f AND #&0f &302d f0 20 BEQ &304f ; tile_isn't_destroyable &302f a8 TAY &3030 b9 1c 05 LDA &051c,Y ; destroyed_background_tiles_flags_table - 1 &3033 24 4d BIT &4d ; flag_to_check &3035 30 1b BMI &3052 ; tile_is_single &3037 f0 16 BEQ &304f ; tile_isn't_destroyable ; check_if_offset_tile_can_be_destroyed &3039 18 CLC &303a a5 13 LDA &13 ; check_x &303c 65 99 ADC &99 ; x_offset &303e 85 13 STA &13 ; check_x &3040 c9 50 CMP #&50 # Leave if position to check is off-screen &3042 b0 7f BCS &30c3 ; leave &3044 20 c9 2e JSR &2ec9 ; get_tile_at_check_x_y # Returns offset of tile in Y &3047 aa TAX &3048 84 98 STY &98 ; offset_of_ground_target &304a bd 00 04 LDA &0400,X ; background_tile_flags_table &304d 29 0f AND #&0f ; tile_isn't_destroyable &304f f0 72 BEQ &30c3 ; leave &3051 a8 TAY ; tile_is_single &3052 b9 33 05 LDA &0533,Y ; destroyed_background_tiles_table - 1 # Get the destroyed version of the tile &3055 0a ASL A &3056 48 PHA ; replot_background_tile_loop &3057 38 SEC &3058 a5 14 LDA &14 ; check_y &305a e5 02 SBC &02 ; screen_vertical_scroll &305c c9 f0 CMP #&f0 &305e b0 24 BCS &3084 ; tile_not_on_screen &3060 20 36 33 JSR &3336 ; get_row_and_group_of_calculated_screen_address &3063 68 PLA &3064 49 01 EOR #&01 &3066 aa TAX &3067 48 PHA &3068 a0 1f LDY #&1f ; store_foreground_screen_data_loop # Push foreground screen data to stack &306a b1 0d LDA (&0d),Y ; screen_address &306c 48 PHA &306d 88 DEY &306e 10 fa BPL &306a ; store_foreground_screen_data_loop &3070 bd b0 0b LDA &0bb0,X ; background_sprites_index_table &3073 20 c4 30 JSR &30c4 ; plot_background_sprite # Plot destroyed tile &3076 a0 00 LDY #&00 ; restore_foreground_screen_data_loop # Restore foreground screen data from stack &3078 68 PLA &3079 29 f0 AND #&f0 &307b 11 0d ORA (&0d),Y ; screen_address &307d 91 0d STA (&0d),Y ; screen_address &307f c8 INY &3080 c0 20 CPY #&20 &3082 d0 f4 BNE &3078 ; restore_foreground_screen_data_loop ; tile_not_on_screen &3084 a5 14 LDA &14 ; check_y &3086 49 08 EOR #&08 &3088 85 14 STA &14 ; check_y &308a c5 9d CMP &9d ; rounded_y &308c d0 c9 BNE &3057 ; replot_background_tile_loop &308e 68 PLA &308f e6 9e INC &9e ; collision_occurred # Note the need for an explosion sound &3091 a9 08 LDA #&08 # Score 80 for destroying ground target &3093 20 95 24 JSR &2495 ; increase_score # (multi-tile targets score multiples of 80) &3096 a6 98 LDX &98 ; offset_of_ground_target &3098 bc 17 0e LDY &0e17,X ; background_tiles + 1 + &16 &309b b9 00 04 LDA &0400,Y ; background_tile_flags_table &309e 29 0f AND #&0f &30a0 84 98 STY &98 ; type_of_ground_target &30a2 a8 TAY &30a3 b9 1c 05 LDA &051c,Y ; destroyed_background_tiles_flags_table - 1 &30a6 24 4d BIT &4d ; flag_to_check &30a8 08 PHP &30a9 b9 33 05 LDA &0533,Y ; destroyed_background_tiles_table - 1 &30ac 48 PHA &30ad b9 1c 05 LDA &051c,Y ; destroyed_background_tiles_flags_table - 1 &30b0 29 09 AND #&09 ; DESTROYED_FLAG_LEFT | DESTROYED_FLAG_TALL &30b2 d0 03 BNE &30b7 ; not_bottom_left_tile # If this is the bottom left tile of a target, &30b4 20 97 2c JSR &2c97 ; record_destruction_of_tile # note that it has been destroyed ; not_bottom_left_tile &30b7 68 PLA &30b8 9d 17 0e STA &0e17,X ; background_tiles + 1 + &16 &30bb 28 PLP &30bc 30 05 BMI &30c3 ; leave # Leave if this was a single tile &30be f0 03 BEQ &30c3 ; leave # Leave if this part of a wide tile wasn't destroyable &30c0 4c 39 30 JMP &3039 ; check_if_offset_tile_can_be_destroyed # Otherwise, consider destroying other part ; leave &30c3 60 RTS ; plot_background_sprite # A is background_sprites_index_table entry &30c4 a8 TAY &30c5 08 PHP # Store whether sprite is flipped &30c6 29 7f AND #&7f &30c8 a0 00 LDY #&00 # Calculate address of unpacked sprite from index entry &30ca 84 92 STY &92 ; background_sprite_address_low &30cc 4a LSR A &30cd 66 92 ROR &92 ; background_sprite_address_low &30cf 4a LSR A &30d0 66 92 ROR &92 ; background_sprite_address_low &30d2 4a LSR A &30d3 66 92 ROR &92 ; background_sprite_address_low &30d5 a8 TAY &30d6 a5 92 LDA &92 ; background_sprite_address_low &30d8 69 80 ADC #&80 &30da 85 92 STA &92 ; background_sprite_address_low &30dc 98 TYA &30dd 69 37 ADC #&37 ; &3780 = background_sprite_data &30df 85 93 STA &93 ; background_sprite_address_high &30e1 a0 1f LDY #&1f &30e3 28 PLP # Restore top bit of table entry &30e4 30 0a BMI &30f0 ; plot_flipped_background_sprite # If set, plot this sprite flipped vertically ; plot_background_sprite_loop &30e6 b1 92 LDA (&92),Y ; background_sprite_address_high &30e8 29 0f AND #&0f &30ea 91 0d STA (&0d),Y ; screen_address &30ec 88 DEY &30ed 10 f7 BPL &30e6 ; plot_background_sprite_loop &30ef 60 RTS ; plot_flipped_background_sprite &30f0 8d fe 30 STA &30fe ; flipped_background_sprite_address_high &30f3 a5 92 LDA &92 ; background_sprite_address_low &30f5 09 18 ORA #&18 &30f7 8d fd 30 STA &30fd ; flipped_background_sprite_address_low ; plot_flipped_background_sprite_column_loop &30fa a2 00 LDX #&00 ; plot_flipped_background_sprite_loop &30fc bd ff ff LDA &ffff,X # actually LDA flipped_background_sprite_address &30ff 29 0f AND #&0f &3101 91 0d STA (&0d),Y ; screen-address &3103 88 DEY &3104 e8 INX &3105 e0 08 CPX #&08 &3107 90 f3 BCC &30fc ; plot_flipped_background_sprite_loop &3109 ad fd 30 LDA &30fd ; flipped_background_sprite_address_low &310c e9 08 SBC #&08 &310e 8d fd 30 STA &30fd ; flipped_background_sprite_address_low &3111 98 TYA &3112 10 e6 BPL &30fa ; plot_flipped_background_sprite_column_loop &3114 60 RTS ; update_enemies_and_bullets &3115 a6 36 LDX &36 ; enemy_or_bullet_to_consider &3117 e8 INX &3118 e0 1b CPX #&1b &311a 90 02 BCC &311e ; skip_ceiling &311c a2 01 LDX #&01 ; skip_ceiling &311e 86 36 STX &36 ; enemy_or_bullet_to_consider &3120 bc 7a 0f LDY &0f7a,X ; sprites_typedata_offset &3123 c0 ff CPY #&ff # Is there an enemy in this slot? &3125 d0 08 BNE &312f ; update_enemy_or_bullet_in_slot_X # If so, update it &3127 bc 42 0f LDY &0f42,X ; sprites_type # Was there a sprite in this slot? &312a c0 ff CPY #&ff &312c d0 3d BNE &316b ; unplot_and_remove_sprite # If so, unplot it and remove it &312e 60 RTS ; update_enemy_or_bullet_in_slot_X &312f bd 0a 0f LDA &0f0a,X ; sprites_x &3132 85 b0 STA &b0 ; enemy_or_bullet_x &3134 bd 26 0f LDA &0f26,X ; sprites_y &3137 85 b1 STA &b1 ; enemy_or_bullet_y &3139 bd b2 0f LDA &0fb2,X ; sprites_timer &313c 85 6d STA &6d ; enemy_timer &313e 85 96 STA &96 ; initial_enemy_timer ; consider_another_movement &3140 20 cb 31 JSR &31cb ; get_energy &3143 85 92 STA &92 ; enemy_or_bullet_energy &3145 18 CLC &3146 bd 5e 0f LDA &0f5e,X ; sprites_energy &3149 79 70 06 ADC &0670,Y ; sprites_typedata_table + 1 # Second byte of table is energy required to move &314c c5 92 CMP &92 ; enemy_or_bullet_energy &314e f0 02 BEQ &3152 ; move_enemy_or_bullet &3150 10 5c BPL &31ae ; skip_further_changes_and_update_sprite ; move_enemy_or_bullet &3152 9d 5e 0f STA &0f5e,X ; sprites_energy &3155 b9 72 06 LDA &0672,Y ; sprites_typedata_table + 3 # Third and fourth bytes of table are routine address &3158 85 91 STA &91 ; enemy_movement_routine_address_high &315a b9 71 06 LDA &0671,Y ; sprites_typedata_table + 2 &315d 85 90 STA &90 ; enemy_movement_routine_address_low &315f bc ce 0f LDY &0fce,X ; sprites_movement_table_offset &3162 10 12 BPL &3176 ; apply_movement_from_movement_table &3164 fe ce 0f INC &0fce,X ; sprites_movement_table_offset &3167 d0 21 BNE &318a ; skip_adding_movement &3169 f0 38 BEQ &31a3 ; remove_enemy_or_bullet ; unplot_and_remove_sprite &316b 20 17 19 JSR &1917 ; set_up_sprite_X_for_updating ; unplot_and_remove_already_set_up_sprite &316e a9 ff LDA #&ff ; set_and_update_sprite_type &3170 9d 42 0f STA &0f42,X ; sprites_type &3173 4c a8 19 JMP &19a8 ; update_sprite_X ; apply_movement_from_movement_table &3176 c0 7f CPY #&7f &3178 f0 10 BEQ &318a ; skip_adding_movement &317a 18 CLC &317b a5 b0 LDA &b0 ; enemy_or_bullet_x &317d 79 55 06 ADC &0655,Y ; enemy_movement_table &3180 85 b0 STA &b0 ; enemy_or_bullet_x &3182 18 CLC &3183 a5 b1 LDA &b1 ; enemy_or_bullet_y &3185 79 56 06 ADC &0656,Y ; enemy_movement_table + 1 &3188 85 b1 STA &b1 ; enemy_or_bullet_y ; skip_adding_movement &318a 20 2f 22 JSR &222f ; call_routine &318d a6 36 LDX &36 ; enemy_or_bullet_to_consider &318f bc 7a 0f LDY &0f7a,X ; sprites_typedata_offset &3192 c0 ff CPY #&ff # Is there a sprite in this slot? &3194 f0 18 BEQ &31ae ; skip_further_changes_and_update_sprite # If not, do nothing more &3196 a5 02 LDA &02 ; screen_vertical_scroll &3198 38 SEC &3199 e5 b1 SBC &b1 ; enemy_or_bullet_y &319b c9 1e CMP #&1e &319d b0 a1 BCS &3140 ; consider_another_movement &319f c9 0a CMP #&0a &31a1 90 9d BCC &3140 ; consider_another_movement ; remove_enemy_or_bullet &31a3 e0 12 CPX #&12 &31a5 90 02 BCC &31a9 ; set_sprites_typedata_offset_to_ff # Slots &12 onwards are enemies, not player or bullet &31a7 c6 51 DEC &51 ; number_of_enemies ; set_sprites_typedata_offset_to_ff &31a9 a9 ff LDA #&ff # Remove sprite from this slot &31ab 9d 7a 0f STA &0f7a,X ; sprites_typedata_offset ; skip_further_changes_and_update_sprite &31ae 20 17 19 JSR &1917 ; set_up_sprite_X_for_updating &31b1 bc 7a 0f LDY &0f7a,X ; sprites_typedata_offset &31b4 c8 INY &31b5 f0 b7 BEQ &316e ; unplot_and_remove_already_set_up_sprite &31b7 a5 b0 LDA &b0 ; enemy_or_bullet_x &31b9 9d 0a 0f STA &0f0a,X ; sprites_x &31bc a5 b1 LDA &b1 ; enemy_or_bullet_y &31be 9d 26 0f STA &0f26,X ; sprites_y &31c1 a5 6d LDA &6d ; enemy_timer &31c3 9d b2 0f STA &0fb2,X ; sprites_timer &31c6 b9 6e 06 LDA &066e,Y ; sprites_typedata_table - 1 # Y = sprites_typedata_offset + 1 &31c9 10 a5 BPL &3170 ; set_and_update_sprite_type # Always branches ; get_energy &31cb a5 35 LDA &35 ; wave_energy_total_high &31cd e0 12 CPX #&12 # Is this an enemy? &31cf b0 02 BCS &31d3 ; leave # If so, use the wave's energy for speed &31d1 a5 18 LDA &18 ; vsync_counter # Otherwise, use the (constant) framerate ; leave &31d3 60 RTS ; reset_enemies_and_bullets &31d4 a2 00 LDX #&00 &31d6 86 51 STX &51 ; number_of_enemies &31d8 86 52 STX &52 ; number_of_enemies_still_to_add &31da a9 ff LDA #&ff &31dc 85 bc STA &bc ; previous_sprite_type &31de 85 bd STA &bd ; new_sprite_type &31e0 a2 01 LDX #&01 &31e2 86 36 STX &36 ; enemy_or_bullet_to_consider ; reset_enemies_and_bullets_loop &31e4 9d 42 0f STA &0f42,X ; sprites_type &31e7 9d 7a 0f STA &0f7a,X ; sprites_typedata_offset &31ea e8 INX &31eb e0 1b CPX #&1b &31ed 90 f5 BCC &31e4 ; reset_enemies_and_bullets_loop ; leave &31ef 60 RTS ; consider_adding_homing_enemy &31f0 a5 4a LDA &4a ; stage_offset &31f2 c9 04 CMP #&04 &31f4 90 f9 BCC &31ef ; leave # No homing enemies before first CommSpace stage &31f6 a5 72 LDA &72 ; delay_between_launch_of_homing_enemies &31f8 c5 18 CMP &18 ; vsync_counter &31fa 10 f3 BPL &31ef ; leave &31fc a9 0f LDA #&0f # Short pause between each homing enemy in batch &31fe c6 71 DEC &71 ; number_of_homing_enemies_still_to_add &3200 d0 06 BNE &3208 ; not_last_in_batch &3202 a5 70 LDA &70 ; maximum_number_of_homing_enemies_minus_one &3204 85 71 STA &71 ; number_of_homing_enemies_still_to_add &3206 a9 78 LDA #&78 # Longer pause between batches of homing enemies ; not_last_in_batch &3208 18 CLC &3209 65 18 ADC &18 ; vsync_counter &320b 85 72 STA &72 ; delay_between_launch_of_homing_enemies &320d a5 51 LDA &51 ; number_of_enemies &320f f0 de BEQ &31ef ; leave &3211 a2 12 LDX #&12 ; find_enemy_to_launch_homing_enemy_from_loop &3213 bd 7a 0f LDA &0f7a,X ; sprites_typedata_offset &3216 c9 ff CMP #&ff &3218 f0 07 BEQ &3221 ; not_an_enemy &321a bd 42 0f LDA &0f42,X ; sprites_type &321d c9 09 CMP #&09 # All enemies apart from ENEMY_H can launch homers &321f 90 06 BCC &3227 ; found_enemy ; not_an_enemy &3221 e8 INX &3222 e0 1b CPX #&1b &3224 90 ed BCC &3213 ; find_enemy_to_launch_homing_enemy_from_loop &3226 60 RTS ; found_enemy &3227 a9 46 LDA #&46 ; ENEMY_HOMING &3229 a0 02 LDY #&02 # Range 2 = homing enemies &322b 20 36 37 JSR &3736 ; add_sprite_X_in_range_Y &322e b0 bf BCS &31ef ; leave &3230 38 SEC &3231 ad 0a 0f LDA &0f0a ; player_sprite_x &3234 fd 0a 0f SBC &0f0a,X ; sprites_x &3237 9d 56 10 STA &1056,X ; homing_enemy_target_x &323a 38 SEC &323b ad 26 0f LDA &0f26 ; player_sprite_y &323e fd 26 0f SBC &0f26,X ; sprites_y &3241 9d 6b 10 STA &106b,X ; homing_enemy_target_y &3244 a9 38 LDA #&38 ; &0138 = sound_homing_launch &3246 4c f2 25 JMP &25f2 ; play_sound_on_free_channel ; consider_adding_single_enemy &3249 24 52 BIT &52 ; number_of_enemies_still_to_add &324b 30 06 BMI &3253 ; use_energy &324d c6 52 DEC &52 ; number_of_enemies_still_to_add &324f a5 35 LDA &35 ; wave_energy_total_high &3251 85 53 STA &53 ; energy_needed_for_new_enemy ; use_energy &3253 a5 53 LDA &53 ; energy_needed_for_new_enemy &3255 c5 35 CMP &35 ; wave_energy_total_high &3257 f0 02 BEQ &325b ; energy_is_enough &3259 10 1f BPL &327a ; leave ; energy_is_enough &325b 18 CLC &326c 69 28 ADC #&28 # Longer delay between single enemies &325e 24 82 BIT &82 ; stage_enemy_flags &3260 70 02 BVS &3264 ; faster_enemies &3262 69 14 ADC #&14 # Longer delay if &20 of stage_data byte one is unset ; faster_enemies &3264 48 PHA &3265 a9 0a LDA #&0a &3267 20 23 33 JSR &3323 ; get_random_number_within_range &326a 85 92 STA &92 ; rnd &326c 0a ASL A &326d 0a ASL A &326e 0a ASL A &326f 38 SEC &3270 e5 92 SBC &92 ; rnd &3272 85 81 STA &81 ; random_offset_into_prototype_table # Single enemies are chosen at random &3274 20 c1 32 JSR &32c1 ; add_enemy &3277 68 PLA &3278 85 53 STA &53 ; energy_needed_for_new_enemy ; leave &327a 60 RTS ; consider_adding_enemies &327b a5 8c LDA &8c ; inhibit_enemy_spawning # &40 set if stage has no enemies &327d 0a ASL A # Don't add enemies if stage has no enemies &327e 05 2d ORA &2d ; player_has_finished_exploding &3280 05 2c ORA &2c ; scrolling_paused_but_game_continuing # Don't add enemies if player exploding &3282 d0 f6 BNE &327a ; leave &3284 a5 49 LDA &49 ; before_during_or_after_main_map # &1 set on second fly past of devil rock &3286 4a LSR A &3287 b0 f1 BCS &327a ; leave # Don't add enemies on second fly past of devil rock &3289 24 82 BIT &82 ; stage_enemy_flags &328b 30 bc BMI &3249 ; consider_adding_single_enemy # Single enemies if &40 of stage_data byte one is set &328d a5 52 LDA &52 ; number_of_enemies_still_to_add &328f f0 08 BEQ &3299 ; no_enemies_needed_for_current_wave # If a wave of enemies is in progress, &3291 a5 35 LDA &35 ; wave_energy_total_high &3293 c5 53 CMP &53 ; energy_needed_for_new_enemy &3295 30 e3 BMI &327a ; leave &3297 10 26 BPL &32bf ; add_enemy # add another enemy when there is enough energy ; no_enemies_needed_for_current_wave &3299 a5 82 LDA &82 ; stage_enemy_flags # If &60 of stage_data byte one is &00, &329b f0 08 BEQ &32a5 ; wait_for_existing_enemies_to_leave # wait until existing wave of enemies leaves &329d a5 35 LDA &35 ; wave_energy_total_high &329f c5 53 CMP &53 ; energy_needed_for_new_enemy &32a1 30 d7 BMI &327a ; leave &32a3 10 04 BPL &32a9 ; start_new_wave # Otherwise, start new wave as soon as enough energy ; wait_for_existing_enemies_to_leave &32a5 a5 51 LDA &51 ; number_of_enemies &32a7 d0 d1 BNE &327a ; leave ; start_new_wave &32a9 a5 35 LDA &35 ; wave_energy_total_high &32ab 85 53 STA &53 ; energy_needed_for_new_enemy &32ad a4 50 LDY &50 ; wave_offset &32af b9 70 07 LDA &0770,Y ; wave_type_table # Waves arrive in a fixed order &32b2 85 81 STA &81 ; enemy_type &32b4 a8 TAY &32b5 38 SEC &32b6 b9 2f 07 LDA &072f,Y ; prototype_enemy_table + 5 # Number of enemies in wave depends on type of enemy &32b9 e5 83 SBC &83 ; reduction_in_enemies_per_wave # and &0c of stage_data byte two &32bb 90 45 BCC &3302 ; skip_adding_enemy &32bd 85 52 STA &52 ; number_of_enemies_still_to_add &32bf c6 52 DEC &52 ; number_of_enemies_still_to_add ; add_enemy &32c1 a4 81 LDY &81 ; enemy_type &32c3 b9 2a 07 LDA &072a,Y ; prototype_enemy_table # Type of enemy as offset into sprites_typedata_table &32c6 a0 03 LDY #&03 # Range 3 = enemies &32c8 20 36 37 JSR &3736 ; add_sprite_X_in_range_Y &32cb b0 35 BCS &3302 ; skip_adding_enemy # Carry set if slot couldn't be found &32cd a4 81 LDY &81 ; enemy_type &32cf b9 2c 07 LDA &072c,Y ; prototype_enemy_table + 2 &32d2 20 23 33 JSR &3323 ; get_random_number_within_range &32d5 79 2b 07 ADC &072b,Y ; prototype_enemy_table + 1 &32d8 9d 0a 0f STA &0f0a,X ; sprites_x # Set horizontal position of enemy &32db b9 2e 07 LDA &072e,Y ; prototype_enemy_table + 4 &32de 20 23 33 JSR &3323 ; get_random_number_within_range &32e1 79 2d 07 ADC &072d,Y ; prototype_enemy_table + 3 &32e4 9d b2 0f STA &0fb2,X ; sprites_timer # Set position in movement pattern &32e7 a5 53 LDA &53 ; energy_needed_for_new_enemy &32e9 9d 5e 0f STA &0f5e,X ; sprites_energy # Set energy for this enemy &32ec 18 CLC &32ed 79 30 07 ADC &0730,Y ; prototype_enemy_table + 6 &32f0 85 53 STA &53 ; energy_needed_for_new_enemy # and use to calculate energy needed for next enemy &32f2 a9 ff LDA #&ff &32f4 9d 42 0f STA &0f42,X ; sprites_type # No previous sprite to unplot &32f7 18 CLC &32f8 a5 02 LDA &02 ; screen_vertical_scroll &32fa 9d 96 0f STA &0f96,X ; sprites_vertical_scroll &32fd 69 c4 ADC #&c4 &32ff 9d 26 0f STA &0f26,X ; sprites_y # Set vertical position of enemy ; skip_adding_enemy &3302 a5 52 LDA &52 ; number_of_enemies_still_to_add &3304 d0 1c BNE &3322 ; leave # Leave if wave not finished &3306 a9 63 LDA #&63 &3308 24 82 BIT &82 ; stage_enemy_flags &330a 30 16 BMI &3322 ; leave # Leave if adding single enemy &330c 18 CLC &330d 65 35 ADC &35 ; wave_energy_total_high &330f 85 53 STA &53 ; energy_needed_for_new_enemy &3311 a4 50 LDY &50 ; wave_offset &3313 c8 INY &3314 c0 48 CPY #&48 &3316 90 02 BCC &331a ; skip_floor &3318 a0 24 LDY #&24 # Don't use "Cygni" wave order for other worlds ; skip_floor &331a 84 50 STY &50 ; wave_offset &331c e6 6b INC &6b ; wave_energy_delta_low &331e d0 02 BNE &3322 ; leave &3320 e6 6c INC &6c ; wave_energy_delta_high ; leave &3322 60 RTS ; get_random_number_within_range &3323 85 94 STA &94 ; range &3325 09 00 ORA #&00 &3327 f0 0b BEQ &3334 ; leave_with_carry_clear &3329 20 32 22 JSR &2232 ; get_random_number ; reduce_to_within_range_loop &332c c5 94 CMP &94 ; range &332e 90 04 BCC &3334 ; leave_with_carry_clear &3330 e5 94 SBC &94 ; range &3332 b0 f8 BCS &332c ; reduce_to_within_range_loop ; leave_with_carry_clear &3334 18 CLC &3335 60 RTS ; get_row_and_group_of_calculated_screen_address &3336 8a TXA &3337 48 PHA &3338 20 be 1d JSR &1dbe ; calculate_screen_address &333b a5 0d LDA &0d ; screen_address_low &333d 29 07 AND #&07 &333f a8 TAY # Leaves with Y = row in group &3340 a5 0d LDA &0d ; screen_address_low &3342 29 f8 AND #&f8 &3344 85 0d STA &0d ; screen_address_low &3346 68 PLA &3347 aa TAX &3348 60 RTS ; check_for_player_collision_with_enemies &3349 ad 0a 0f LDA &0f0a ; player_sprite_x &334c 85 13 STA &13 ; check_x &334e ad 26 0f LDA &0f26 ; player_sprite_y &3351 85 14 STA &14 ; check_y &3353 85 b1 STA &b1 ; also_player_y &3355 a2 10 LDX #&10 &3357 38 SEC ; check_for_collision_with_enemies # Used to check both player and bullets &3358 66 9c ROR &9c ; player_collisions # Carry set for player collisions, unset for bullet ; check_for_collision_with_enemies_loop &335a 20 36 33 JSR &3336 ; get_row_and_group_of_calculated_screen_address &335d b1 0d LDA (&0d),Y ; screen_address &335f 29 f0 AND #&f0 # Is there something in the foreground here? &3361 d0 38 BNE &339b ; carefully_check_for_collision_with_enemies &3363 ca DEX &3364 f0 07 BEQ &336d ; leave_with_carry_clear &3366 e6 14 INC &14 ; check_y &3368 88 DEY &3369 10 f2 BPL &335d ; leave_with_carry_clear &336b 30 ed BMI &335a ; check_for_collision_with_enemies_loop ; leave_with_carry_clear &336d 18 CLC # Carry isn't used; positive sign indicates no collision &336e 60 RTS ; update_bullet &336f 38 SEC &3370 a5 b1 LDA &b1 ; enemy_or_bullet_y &3372 85 14 STA &14 ; check_y &3374 e5 02 SBC &02 ; screen_vertical_scroll &3376 c9 c0 CMP #&c0 &3378 b0 18 BCS &3392 ; set_sprite_as_fallen_off_screen &337a 38 SEC &337b e9 b8 SBC #&b8 # If bullet is close to edge of screen, check only part &337d f0 13 BEQ &3392 ; set_sprite_as_fallen_off_screen &337f b0 02 BCS &3383 ; skip_floor &3381 a9 08 LDA #&08 # Otherwise check entire height ; skip_floor &3383 aa TAX &3384 a5 b0 LDA &b0 ; enemy_or_bullet_x &3386 85 13 STA &13 ; check_x &3388 18 CLC &3389 24 2c BIT &2c ; scrolling_paused_but_game_continuing &338b 30 cb BMI &3358 ; check_for_collision_with_enemies # Only check enemy collisions if player dying &338d 20 ba 33 JSR &33ba ; check_bullet_for_collision_with_background &3390 90 c6 BCC &3358 ; check_for_collision_with_enemies ; set_sprite_as_fallen_off_screen &3392 a5 02 LDA &02 ; screen_vertical_scroll &3394 38 SEC &3395 e9 0f SBC #&0f &3397 85 b1 STA &b1 ; enemy_or_bullet_y ; leave_with_carry_clear &3399 18 CLC &339a 60 RTS ; carefully_check_for_collision_with_enemies &339b a5 13 LDA &13 ; check_x &339d 85 b2 STA &b2 ; check_minimum_x &339f 85 b4 STA &b4 ; check_maximum_x &33a1 e6 b4 INC &b4 ; check_maximum_x &33a3 a5 b1 LDA &b1 ; enemy_or_bullet_y &33a5 85 b6 STA &b6 ; check_minimum_y &33a7 8a TXA &33a8 18 CLC &33a9 65 b6 ADC &b6 ; check_minimum_y &33ab 85 b8 STA &b8 ; check_maximum_y &33ad 20 b5 36 JSR &36b5 ; check_for_collision &33b0 24 9e BIT &9e ; collision_occurred &33b2 10 e5 BPL &3399 ; leave_with_carry_clear &33b4 24 9c BIT &9c ; player_collisions &33b6 10 da BPL &3392 ; set_sprite_as_fallen_off_screen &33b8 38 SEC # Carry isn't used; negative sign indicates collision &33b9 60 RTS ; check_bullet_for_collision_with_background &33ba 20 c1 2e JSR &2ec1 ; get_flags_for_tile_at_check_x_y &33bd 29 0f AND #&0f # Extract destroyed tile type &33bf c9 04 CMP #&04 # Is it the right part of a three-tile wide tile? &33c1 90 d6 BCC &3399 ; leave_with_carry_clear # If so, no collision, leave with carry clear &33c3 a8 TAY &33c4 b9 1c 05 LDA &051c,Y ; destroyed_background_tiles_flags_table - 1 &33c7 29 02 AND #&02 ; DESTROYED_FLAG_NO_BULLET # Is this the top part of a tall tile? &33c9 d0 ce BNE &3399 ; leave_with_carry_clear # If so, no collision, leave with carry clear &33cb a5 02 LDA &02 ; screen_vertical_scroll &33cd 29 f0 AND #&f0 &33cf 85 92 STA &92 ; vertical_scroll_to_nearest_tile &33d1 38 SEC &33d2 a5 b1 LDA &b1 ; enemy_or_bullet_y &33d4 e5 92 SBC &92 ; vertical_scroll_to_nearest_tile &33d6 c9 c0 CMP #&c0 # Is this target off-screen? &33d8 b0 bf BCS &3399 ; leave_with_carry_clear # If so, leave with carry clear &33da 20 dc 2f JSR &2fdc ; destroy_ground_target &33dd a5 98 LDA &98 ; type_of_ground_target &33df a0 00 LDY #&00 &33e1 c9 21 CMP #&21 ; TILE_PLUS &33e3 f0 05 BEQ &33ea ; is_plus_or_multiply &33e5 c8 INY &33e6 c9 22 CMP #&22 ; TILE_MULTIPLY &33e8 d0 0a BNE &33f4 ; isn't_plus_or_multipy ; is_plus_or_multiply &33ea 98 TYA &33eb a4 80 LDY &80 ; stage_bonus_count &33ed 99 01 0d STA &0d01,Y ; stage_bonus_type_table # Record bonus hits &33f0 e6 80 INC &80 ; stage_bonus_count &33f2 d0 20 BNE &3414 ; add_ground_explosion ; isn't_plus_or_multipy &33f4 c9 17 CMP #&17 : TILE_REACTOR &33f6 f0 36 BEQ &342e ; destroy_reactor &33f8 c9 3d CMP #&3d ; TILE_QUESTION &33fa d0 18 BNE &3414 ; add_ground_explosion &33fc c6 7f DEC &7f ; question_marks_or_reactors_destroyed &33fe 30 0f BMI &340f ; score_bonus_from_destroying_question_marks &3400 d0 12 BNE &3414 ; add_ground_explosion &3402 20 1a 26 JSR &261a ; play_end_of_stage_chord # Play chords for destroying eleven question marks &3405 a9 4b LDA #&4b &3407 85 5b STA &5b ; music_beat_cooldown &3409 a9 00 LDA #&00 &340b 85 6a STA &6a ; music_beats_missing &340d f0 05 BEQ &3414 ; add_ground_explosion ; score_bonus_from_destroying_question_marks &340f a9 42 LDA #&42 # Score 420 for destroying twelve question marks &3411 20 95 24 JSR &2495 ; increase_score ; add_ground_explosion &3414 a9 05 LDA #&05 ; GROUND_EXPLOSION &3416 a0 01 LDY #&01 # Range 1 = explosions and accompanying player ships &3418 20 36 37 JSR &3736 ; add_sprite_X_in_range_Y &341b b0 0a BCS &3427 ; skip_setting_explosion_position &341d a5 b0 LDA &b0 ; enemy_x &341f 9d 0a 0f STA &0f0a,X ; sprites_x &3422 a5 b1 LDA &b1 ; enemy_y &3424 9d 26 0f STA &0f26,X ; sprites_y ; skip_setting_explosion_position &3427 a9 20 LDA #&20 ; &0120 = sound_scoring &3429 20 f2 25 JSR &25f2 ; play_sound_on_free_channel &342c 38 SEC &342d 60 RTS ; destroy_reactor &342e a5 7f LDA &7f ; question_marks_or_reactors_destroyed # This is always either &0c or &00 here &3430 49 0c EOR #&0c &3432 85 7f STA &7f ; question_marks_or_reactors_destroyed &3434 f0 de BEQ &3414 ; add_ground_explosion # Destroy first reactor as per any other target ; second_reactor_destroyed &3436 c6 2c DEC &2c ; scrolling_paused_but_game_continuing &3438 a2 65 LDX #&65 # Write TAB(&02, &16); "Bonus..........0" &343a a0 15 LDY #&15 &343c 20 e1 1e JSR &1ee1 ; write_title_screen_string &343f a2 00 LDX #&00 &3441 86 9b STX &9b ; bonus_score + 1 &3443 86 9c STX &9c ; bonus_score + 2 &3445 86 9d STX &9d ; bonus_score + 3 &3447 a9 05 LDA #&05 # Start with 50 bonus score &3449 85 9a STA &9a ; bonus_score ; write_bonus_loop &344b e4 80 CPX &80 ; stage_bonus_count &344d b0 71 BCS &34c0 ; skip_bonus # Don't give any bonus if no bonus targets hit &344f a9 1f LDA #&1f &3451 20 ee ff JSR &ffee ; OSWRCH # TAB to position of bonus character &3454 a0 0a LDY #&0a &3456 8a TXA &3457 48 PHA ; find_x_loop &3458 c9 14 CMP #&14 &345a 90 05 BCC &3461 ; found_x &345c e9 14 SBC #&14 &345e c8 INY &345f b0 f7 BCS &3458 ; find_x_loop ; found_x &3461 20 ee ff JSR &ffee ; OSWRCH &3464 98 TYA &3465 20 ee ff JSR &ffee ; OSWRCH &3468 bc 01 0d LDY &0d01,X ; stage_bonus_type_table &346b d0 0e BNE &347b ; bonus_is_double &346d a9 58 LDA #&58 ; sound_plus # Play "plus" sound and write "+" &346f 48 PHA &3470 a9 2b LDA #&2b ; "+" &3472 48 PHA &3473 a9 05 LDA #&05 # Add 50 for each TILE_PLUS hit &3475 a2 00 LDX #&00 &3477 a0 00 LDY #&00 &3479 f0 0c BEQ &3487 ; add_bonus ; bonus_is_double &347b a9 60 LDA #&60 ; sound_multiply # Play "multiply" sound and write "X" &347d 48 PHA &347e a9 58 LDA #&58 ; "X" &3480 48 PHA &3481 a5 9a LDA &9a ; bonus_score # Double score for each TILE_MULTIPLY hit &3483 a6 9b LDX &9b ; bonus_score + 1 &3485 a4 9c LDY &9c ; bonus_score + 2 ; add_bonus &3487 f8 SED &3488 18 CLC &3489 65 9a ADC &9a ; bonus_score &348b 85 9a STA &9a ; bonus_score &348d 8a TXA &348e 65 9b ADC &9b ; bonus_score + 1 &3490 85 9b STA &9b ; bonus_score + 1 &3492 98 TYA &3493 65 9c ADC &9c ; bonus_score + 2 &3495 85 9c STA &9c ; bonus_score + 2 &3497 d8 CLD &3498 68 PLA &3499 20 ee ff JSR &ffee ; OSWRCH # Write character for bonus &349c 68 PLA &349d a8 TAY &349e 20 42 26 JSR &2642 ; play_start_or_end_of_stage_sound ; write_bonus &34a1 a2 62 LDX #&62 # TAB(&09, &16) &34a3 a0 03 LDY #&03 &34a5 20 e1 1e JSR &1ee1 ; write_title_screen_string &34a8 a2 03 LDX #&03 &34aa a9 2e LDA #&2e ; "." &34ac 85 92 STA &92 ; leading_character ; write_bonus_loop # Write bonus score &34ae b5 9a LDA &9a,X ; bonus_score &34b0 20 e6 34 JSR &34e6 ; write_two_digit_number &34b3 ca DEX &34b4 10 f8 BPL &34ae ; write_bonus_loop &34b6 a9 06 LDA #&06 &34b8 20 62 21 JSR &2162 ; delay_for_A_vsyncs &34bb 68 PLA &34bc aa TAX &34bd e8 INX &34be d0 8b BNE &344b ; write_bonus_loop ; skip_bonus &34c0 a2 fc LDX #&fc &34c2 f8 SED &34c3 18 CLC ; add_bonus_to_score_loop &34c4 b5 5b LDA &5b,X ; score + 4 &34c6 75 9e ADC &9e,X ; bonus_score + 4 &34c8 95 5b STA &5b,X ; score + 4 &34ca e8 INX &34cb d0 f7 BNE &34c4 ; add_bonus_to_score_loop &34cd d8 CLD &34ce 20 34 23 JSR &2334 ; plot_score_to_screen # Update score in top left of screen &34d1 20 38 20 JSR &2038 ; end_of_stage &34d4 a0 ff LDY #&ff &34d6 84 32 STY &32 ; stage_has_had_screen_of_blank_tiles &34d8 c8 INY &34d9 84 3e STY &3e ; number_of_blank_rows_before_next_map &34db 84 49 STY &49 ; before_during_or_after_main_map &34dd a9 64 LDA #&64 &34df 20 62 21 JSR &2162 ; delay_for_A_vsyncs &34e2 e6 2c INC &2c ; scrolling_paused_but_game_continuing &34e4 38 SEC &34e5 60 RTS ; write_two_digit_number &34e6 48 PHA &34e7 4a LSR A &34e8 4a LSR A &34e9 4a LSR A &34ea 4a LSR A &34eb 20 ef 34 JSR &34ef ; write_one_digit_number &34ee 68 PLA ; write_one_digit_number &34ef 29 0f AND #&0f &34f1 d0 04 BNE &34f7 ; use_digit &34f3 a5 92 LDA &92 ; leading_character &34f5 d0 06 BNE &34fd ; write_character ; use_digit &34f7 a0 30 LDY #&30 ; "0" &34f9 84 92 STY &92 ; leading_character &34fb 09 30 ORA #&30 ; "0" ; write_character &34fd 4c ee ff JMP &ffee ; OSWRCH ; update_initial_player_ships # Used by INITIAL_PLAYER_SHIP &3500 a5 b1 LDA &b1 ; enemy_or_bullet_y &3502 38 SEC &3503 e5 02 SBC &02 ; screen_vertical_scroll &3505 c9 27 CMP #&27 &3507 30 14 BMI &351d ; leave # Move initial ships upwards to start with &3509 a5 b0 LDA &b0 ; enemy_or_bullet_x &350b c9 27 CMP #&27 # Then separate them &350d f0 0f BEQ &351e ; update_first_player_ship # The middle one becomes the player &350f 30 03 BMI &3514 ; accompanying_ship_moving_left &3511 20 a3 36 JSR &36a3 ; change_typedata_offset_to_next # Those to the right become type &41 ; accompanying_ship_moving_left &3514 4c a3 36 JMP &36a3 ; change_typedata_offset_to_next # Those to the left become type &3c ; update_accompanying_player_ships &3517 a5 b0 LDA &b0 ; enemy_or_bullet_x &3519 c9 55 CMP #&55 # Remove ships when they reach either edge of screen &351b b0 0a BCS &3527 ; to_set_sprite_as_fallen_off_screen ; leave &351d 60 RTS ; update_first_player_ship &351e a9 00 LDA #&00 &3520 85 2c STA &2c ; scrolling_paused_but_game_continuing &3522 a5 b1 LDA &b1 ; enemy_or_bullet_y &3524 8d 26 0f STA &0f26 ; player_sprite_y ; to_set_sprite_as_fallen_off_screen &3527 4c 92 33 JMP &3392 ; set_sprite_as_fallen_off_screen ; wait_until_timer # Used by ENEMY_BIRD stage 1 &352a c6 6d DEC &6d ; enemy_timer &352c d0 70 BNE &359e ; leave # Stay in position until timer runs out &352e a9 08 LDA #&08 &3530 85 6d STA &6d ; enemy_timer &3532 4c a3 36 JMP &36a3 ; change_typedata_offset_to_next ; wait_until_time_and_store_target_x # Used by ENEMY_BIRD stage 2 &3535 c6 6d DEC &6d ; enemy_timer &3537 d0 65 BNE &359e ; leave &3539 38 SEC &353a ad 0a 0f LDA &0f0a ; player_sprite_x # Use player's position as target &353d e5 b0 SBC &b0 ; enemy_x &353f 9d 5c 10 STA &105c,X ; bird_homing_targets &3542 a9 00 LDA #&00 &3544 85 6d STA &6d ; enemy_timer &3546 4c a3 36 JMP &36a3 ; change_typedata_offset_to_next ; move_towards_stored_x_target # Used by ENEMY_BIRD stage 3 &3549 bd 5c 10 LDA &105c,X ; bird_homing_targets &354c 0a ASL A &354d 85 92 STA &92 ; fraction &354f a9 01 LDA #&01 &3551 90 02 BCC &3555 ; not_negative &3553 a9 ff LDA #&ff ; not_negative &3555 85 93 STA &93 ; sign &3557 a0 06 LDY #&06 ; move_towards_stored_x_target_loop &3559 18 CLC &355a a5 6d LDA &6d ; enemy_timer # enemy_timer used as fraction &355c 65 92 ADC &92 ; fraction &355e 85 6d STA &6d ; enemy_timer &3560 6a ROR A &3561 45 93 EOR &93 ; sign &3563 10 07 BPL &356c ; insufficient_energy &3565 18 CLC &3566 a5 b0 LDA &b0 ; enemy_x # Then move towards stored target &3568 65 93 ADC &93 ; sign &356a 85 b0 STA &b0 ; enemy_x ; insufficient_energy &356c 88 DEY &356d d0 ea BNE &3559 ; move_towards_stored_x_target_loop &356f 60 RTS ; move_towards_stored_x_y_target # Used by ENEMY_HOMING &3570 bd 56 10 LDA &1056,X ; homing_enemy_target_x &3573 20 9f 35 JSR &359f ; divide_a_by_thirty_two &3576 7d 5c 10 ADC &105c,X ; homing_enemy_target_x_fraction &3579 9d 5c 10 STA &105c,X ; homing_enemy_target_x_fraction &357c a5 92 LDA &92 ; result &357e 65 b0 ADC &b0 ; enemy_x &3580 85 b0 STA &b0 ; enemy_x &3582 bd 6b 10 LDA &106b,X ; homing_enemy_target_y &3585 20 9f 35 JSR &359f ; divide_a_by_thirty_two &3588 65 6d ADC &6d ; enemy_timer # Timer used as target_y_fraction &358a 85 6d STA &6d ; enemy_timer &358c a5 92 LDA &92 ; result &358e 65 b1 ADC &b1 ; enemy_y &3590 85 b1 STA &b1 ; enemy_y &3592 a9 04 LDA #&04 # Move with background, &3594 24 49 BIT &49 ; before_during_or_after_main_map # &40 set if at devil rock or end launch &3596 50 01 BVC &3599 ; not_at_end_of_stage &3598 4a LSR A # half as fast when at end of stage ; not_at_end_of_stage &3599 18 CLC &359a 65 b1 ADC &b1 ; enemy_y &359c 85 b1 STA &b1 ; enemy_y ; leave ; null_movement &359e 60 RTS ; divide_a_by_thirty_two &359f a0 00 LDY #&00 &35a1 0a ASL A &35a2 90 01 BCC &35a5 ; positive &35a4 88 DEY ; positive &35a5 84 92 STY &92 ; result &35a7 0a ASL A &35a8 26 92 ROL &92 ; result &35aa 0a ASL A &35ab 26 92 ROL &92 ; result &35ad 18 CLC &35ae 60 RTS ; move_in_oscillation_pattern_c # Used by ENEMY_SPIRAL &35af 20 83 36 JSR &3683 ; move_enemy_down &35b2 a2 0c LDX #&0c &35b4 2c a2 09 BIT &09a2 ; move_in_oscillation_pattern_9 # Used by ENEMY_BALL #35b5 a2 09 LDX #&09 &35b7 2c a2 03 BIT &03a2 ; move_in_oscillation_pattern_3 # Used by ENEMY_MIXER #35b8 a2 03 LDX #&03 &35ba 2c a2 00 BIT &00a2 ; move_in_oscillation_pattern_0 # Used by ENEMY_SHUTTLE #35bb a2 00 LDX #&00 ; move_in_oscillation_pattern_X &35bd a5 6d LDA &6d ; enemy_timer &35bf 85 96 STA &96 ; initial_enemy_timer &35c1 18 CLC &35c2 7d 1b 07 ADC &071b,X ; oscillation_patterns &35c5 85 6d STA &6d ; enemy_timer &35c7 a0 60 LDY #&60 # Offset x oscillation from y by 270 degrees &35c9 bd 1c 07 LDA &071c,X ; oscillation_patterns + 1 &35cc 20 e4 35 JSR &35e4 ; calculate_oscillation &35cf 18 CLC &35d0 65 b0 ADC &b0 ; enemy_x &35d2 85 b0 STA &b0 ; enemy_x &35d4 a0 00 LDY #&00 &35d6 bd 1d 07 LDA &071d,X ; oscillation_patterns + 2 &35d9 20 e4 35 JSR &35e4 ; calculate_oscillation &35dc 18 CLC &35dd 65 b1 ADC &b1 ; enemy_y &35df 85 b1 STA &b1 ; enemy_y ; leave_with_zero &35e1 a9 00 LDA #&00 ; leave &35e3 60 RTS ; calculate_oscillation &35e4 30 fb BMI &35e1 ; leave_with_zero &35e6 84 93 STY &93 ; angle_offset &35e8 48 PHA &35e9 29 07 AND #&07 &35eb 85 92 STA &92 ; magnitude_log_divisor &35ed 68 PLA &35ee 4a LSR A &35ef 4a LSR A &35f0 4a LSR A &35f1 48 PHA ; frequency_log_divisor &35f2 a8 TAY &35f3 a5 96 LDA &96 ; initial_enemy_timer &35f5 20 05 36 JSR &3605 ; calculate_cosine &35f8 85 94 STA &94 ; previous_cosine &35fa 68 PLA ; frequency_log_divisor &35fb a8 TAY &35fc a5 6d LDA &6d ; enemy_timer &35fe 20 05 36 JSR &3605 ; calculate_cosine &3601 38 SEC &3602 e5 94 SBC &94 ; previous_cosine &3604 60 RTS ; calculate_cosine &3605 20 2a 36 JSR &362a ; divide_a_by_two_to_the_y &3608 18 CLC &3609 65 93 ADC &93 ; angle_offset &360b a8 TAY &360c 0a ASL A &360d 0a ASL A &360e 98 TYA &360f 90 02 BCC &3613 ; skip_inversion &3611 49 3f EOR #&3f ; skip_inversion &3613 a8 TAY &3614 0a ASL A &3615 0a ASL A &3616 0a ASL A &3617 98 TYA &3618 90 02 BCC &361c ; skip_mirror &361a 49 1f EOR #&1f ; skip_mirror &361c 29 1f AND #&1f &361e a8 TAY &361f b9 b8 07 LDA &07b8,Y ; cosine_table &3622 a4 92 LDY &92 ; magnitude_log_divisor &3624 90 04 BCC &362a ; divide_by_two_to_the_y &3626 49 ff EOR #&ff &3628 69 00 ADC #&00 ; divide_a_by_two_to_the_y &362a 88 DEY &362b 30 b6 BMI &35e3 ; leave &362d c9 80 CMP #&80 &362f 6a ROR A &3630 4c 2a 36 JMP &362a ; divide_by_two_to_the_y ; drift_towards_player_every_four # Used by ENEMY_H &3633 a9 03 LDA #&03 &3635 2c a9 01 BIT &01a9 ; drift_towards_player_every_two # Used by ENEMY_TURRET #3636 a9 01 LDA #&01 &3638 e6 6d INC &6d ; enemy_timer &363a 25 6d AND &6d ; enemy_timer &363c d0 0e BNE &364c ; leave &363e a5 b0 LDA &b0 ; sprite_x &3640 cd 0a 0f CMP &0f0a ; player_sprite_x &3643 f0 07 BEQ &364c ; leave &3645 10 03 BPL &364a ; move_enemy_right ; move_enemy_right &3647 e6 b0 INC &b0 ; sprite_x &3649 2c c6 b0 BIT &b0c6 ; move_enemy_left #364a c6 b0 DEC &b0 ; sprite_x ; leave &364c 60 RTS ; keep_enemy_near_top_of_screen_until_timer # Used by ENEMY_SIDEWAYS stage 1 &364d a9 93 LDA #&93 &364f 2c a9 a3 BIT &a3a9 ; keep_enemy_at_top_of_screen_until_timer # Used by ENEMY_MASK stage 1 #3650 a9 a3 LDA #&a3 &3652 20 8f 36 JSR &368f ; set_enemy_y_allowing_for_scroll # Keep enemy at fixed vertical position &3655 c6 6d DEC &6d ; enemy_timer &3657 f0 4a BEQ &36a3 ; change_typedata_offset_to_next # When time runs out, set enemy moving down ; leave &3659 60 RTS ; move_enemy_down_until_level_with_player # Used by ENEMY_MASK stage 2 &365a ad 26 0f LDA &0f26 ; player_sprite_y &365d 38 SEC &365e e5 02 SBC &02 ; screen_vertical_scroll &3660 85 92 STA &92 &3662 a5 b1 LDA &b1 ; enemy_y &3664 38 SEC &3665 e5 02 SBC &02 ; screen_vertical_scroll &3667 c5 92 CMP &92 &3669 b0 ee BCS &3659 ; leave &366b 38 SEC &366c a5 b1 LDA &b1 ; enemy_y &366e e5 02 SBC &02 ; screen_vertical_scroll &3670 85 6d STA &6d ; enemy_timer &3672 4c a3 36 JMP &36a3 ; change_typedata_offset_to_next ; move_enemy_right_and_remove_when_off_screen # Used by ENEMY_MASK stage 3 &3675 a5 6d LDA &6d ; enemy_timer &3677 20 8f 36 JSR &368f ; set_enemy_y_allowing_for_scroll &367a a5 b0 LDA &b0 ; enemy_x &367c c9 52 CMP #&52 &367e 30 d9 BMI &3659 ; leave &3680 4c 92 33 JMP &3392 ; set_sprite_as_fallen_off_screen ; move_enemy_down &3683 a5 6d LDA &6d ; enemy_timer &3685 c5 96 CMP &96 ; initial_enemy_timer &3687 d0 0b BNE &3694 ; leave &3689 38 SEC &368a a5 b1 LDA &b1 ;enemy_y &368c fd 96 0f SBC &0f96,X ; sprites_vertical_scroll ; set_enemy_y_allowing_for_scroll &368f 18 CLC &3690 65 02 ADC &02 ; screen_vertical_scroll &3692 85 b1 STA &b1 ; enemy_y ; leave &3694 60 RTS ; move_enemy_down_until_timer # Used by ENEMY_SIDEWAYS stage 2 &3695 a5 6d LDA &6d ; enemy_timer &3697 c9 c0 CMP #&c0 &3699 b0 08 BCS &36a3 ; change_typedata_offset_to_next &369b 20 83 36 JSR &3683 ; move_enemy_down &369e a2 06 LDX #&06 &36a0 4c bd 35 JMP &35bd ; move_in_oscillation_pattern_X ; change_typedata_offset_to_next &36a3 bd 7a 0f LDA &0f7a,X ; sprites_typedata_offset &36a6 c9 46 CMP #&46 # Enemy sprites have six bytes of typedata (extra one &36a8 69 05 ADC #&05 # for score); player, bullets and explosions only five. &36aa 9d 7a 0f STA &0f7a,X ; sprites_typedata_offset &36ad a8 TAY &36ae b9 73 06 LDA &0673,Y ; sprites_typedata_table + 4 &36b1 9d ce 0f STA &0fce,X ; sprites_movement_table_offset &36b4 60 RTS ; check_for_collision &36b5 a9 09 LDA #&09 ; ENEMY_H # If checking for collisions with bullets, all enemies &36b7 a0 0a LDY #&0a ; ENEMY_HOMING # apart from the homer can absorb bullets (&0 - &a), &36b9 a2 12 LDX #&12 ; first enemy # but the H-ship enemy can't be destroyed (&0 - &9). &36bb 24 9c BIT &9c ; player_collisions &36bd 10 06 BPL &36c5 ; checking_for_bullet_collision &36bf a9 0b LDA #&0b ; ENEMY_HOMING + 1 # If checking for collision with the player, all &36c1 a0 0b LDY #&0b ; ENEMY_HOMING + 1 # enemies (&0 - &a) can both collide and be destroyed &36c3 a2 0c LDX #&0c ; first homing enemy ; checking_for_bullet_collision &36c5 85 95 STA &95 ; first_unexplodable_sprite &36c7 84 94 STY &94 ; first_uncollidable_sprite &36c9 a9 00 LDA #&00 &36cb 85 9e STA &9e ; collision_occurred ; check_for_collision_loop &36cd bc 7a 0f LDY &0f7a,X ; sprites_typedata_offset &36d0 c0 ff CPY #&ff # Is there an enemy in this slot? &36d2 f0 50 BEQ &3724 ; consider_next_enemy &36d4 b9 6f 06 LDA &066f,Y ; sprites_typedata_table # If so, can its sprite be collided with? &36d7 c5 94 CMP &94 ; first_uncollidable_sprite &36d9 b0 49 BCS &3724 ; consider_next_enemy &36db a8 TAY &36dc bd 0a 0f LDA &0f0a,X ; sprites_x # If so, is there actually a collision? &36df 79 a7 03 ADC &03a7,Y ; sprite_offset_x_table &36e2 c5 b4 CMP &b4 ; check_maximum_x &36e4 10 3e BPL &3724 ; consider_next_enemy &36e6 18 CLC &36e7 79 e8 0c ADC &0ce8,Y ; sprite_width_table &36ea 38 SEC &36eb e9 02 SBC #&02 &36ed c5 b2 CMP &b2 ; check_minimum_x &36ef 30 33 BMI &3724 ; consider_next_enemy &36f1 18 CLC &36f2 bd 26 0f LDA &0f26,X ; sprites_y &36f5 79 b9 03 ADC &03b9,Y ; sprite_offset_y_table &36f8 c5 b8 CMP &b8 ; check_maximum_y &36fa 10 28 BPL &3724 ; consider_next_enemy &36fc 18 CLC &36fd 79 ea 02 ADC &02ea,Y ; sprite_height_table &3700 c5 b6 CMP &b6 ; check_minimum_y &3702 30 20 BMI &3724 ; consider_next_enemy &3704 8a TXA &3705 48 PHA &3706 bc 7a 0f LDY &0f7a,X ; sprites_typedata_offset &3709 b9 74 06 LDA &0674,Y ; sprites_typedata_table + 5 # Score points depending on the type of enemy &370c 20 95 24 JSR &2495 ; increase_score # (homer and H-ship score, but have zero points for hit) &370f 68 PLA &3710 aa TAX &3711 bc 42 0f LDY &0f42,X ; sprites_type &3714 c4 95 CPY &95 ; first_unexplodable_sprite &3716 b0 05 BCS &371d ; skip_setting_explosion # Can this enemy be destroyed? &3718 a9 23 LDA #&23 ; ENEMY_SHIP_EXPLOSION &371a 9d 7a 0f STA &0f7a,X ; sprites_typedata_offset # If so, change it into an explosion ; skip_setting_explosion &371d 38 SEC &371e 66 9e ROR &9e ; collision_occurred &3720 24 9c BIT &9c ; player_collisions &3722 30 09 BMI &372d ; play_collision_sound # Leave on the first collision with the player ; consider_next_enemy &3724 e8 INX &3725 e0 1b CPX #&1b &3727 90 a4 BCC &36cd ; check_for_collision_loop &3729 24 9e BIT &9e ; collision_occurred &372b 10 29 BPL &3756 ; leave # Did a collision occur? ; play_collision_sound &372d a9 20 LDA #&20 ; &0120 = sound_scoring # Play a sound for collision &372f 4c f2 25 JMP &25f2 ; play_sound_on_free_channel ; add_player_sprite_in_range_1 &3732 a0 01 LDY #&01 # Range 1 = explosions and accompanying player ships ; add_player_sprite_in_range_Y &3734 a2 00 LDX #&00 ; PLAYER ; add_sprite_X_in_range_Y # Called with A = typedata_offset of new sprite &3736 48 PHA &3737 bd 0a 0f LDA &0f0a,X ; sprites_x # Take the position of the sprite in slot X &373a 48 PHA &373b bd 26 0f LDA &0f26,X ; sprites_y &373e 48 PHA &373f be 06 05 LDX &0506,Y ; sprite_slots_ranges ; find_free_slot_loop # Find an empty slot in the same range &3742 bd 42 0f LDA &0f42,X ; sprites_type &3745 3d 7a 0f AND &0f7a,X ; sprites_typedata_offset &3748 c9 ff CMP #&ff &374a f0 0b BEQ &3757 ; found_free_slot &374c e8 INX &374d 8a TXA &374e d9 07 05 CMP &0507,Y ; sprite_slots_ranges + 1 &3751 90 ef BCC &3742 ; find_free_slot_loop # Leaves with carry set if no slot found &3753 68 PLA &3754 68 PLA &3755 68 PLA ; leave &3756 60 RTS ; found_free_slot &3757 68 PLA &3758 9d 26 0f STA &0f26,X ; sprites_y # Copy the position into the empty slot &375b 68 PLA &375c 9d 0a 0f STA &0f0a,X ; sprites_x &375f 68 PLA &3760 9d 7a 0f STA &0f7a,X ; sprites_typedata_offset # Use the offset the routine was called with &3763 a8 TAY &3764 b9 73 06 LDA &0673,Y ; sprites_typedata_table + 5 &3767 c9 7f CMP #&7f &3769 f0 03 BEQ &376e ; skip_setting_movement_offset &376b 9d ce 0f STA &0fce,X ; sprites_movement_table_offset # Initialise the new sprite's movement offset ; skip_setting_movement_offset &376e 20 cb 31 JSR &31cb ; get_energy &3771 9d 5e 0f STA &0f5e,X ; sprites_energy # and energy &3774 e0 12 CPX #&12 &3776 90 02 BCC &377a ; not_an_enemy &3778 e6 51 INC &51 ; number_of_enemies # Note if the sprite is an enemy. ; not_an_enemy &377a 18 CLC # Leaves with carry clear if successful &377b 60 RTS # Relocatable block &00 # &02cd bytes copied from &3ad1-&3d9d to &0e00-&10cc at &43d0 # &02cd bytes copied from &0e00-&10cc to &4abd-&4d89 at &4474 # and to &8000-&82cc at &448a in enhanced version # then to &14b4-&1780 at &4640 # &0088 bytes copied from &14b5-&153c to &13b6-&143d at &1774 # # &13b6-&140a is also used for background_tiles_initialised_already ; unpack_background_sprites_code ; unpack_background_sprite_data # This is called once in standard version, &13b6 8a TXA # but at start of every stage in enhanced version &13b7 48 PHA &13b8 a9 06 LDA #&06 ; packed_background_sprite_data_part_one &13ba a2 00 LDX #&00 # First 52 sprites &13bc a0 1a LDY #&1a &13be 20 cd 13 JSR &13cd ; unpack_part_of_background_sprite_data &13c1 a9 08 LDA #&08 ; packed_background_sprite_data_part_two &13c3 a2 1a LDX #&1a # Last 52 sprites &13c5 a0 1a LDY #&1a &13c7 20 cd 13 JSR &13cd ; unpack_part_of_background_sprite_data &13ca 68 PLA &13cb aa TAX &13cc 60 RTS ; unpack_part_of_background_sprite_data &13cd 86 96 STX &96 ; offset &13cf 84 98 STY &98 ; remaining &13d1 a2 54 LDX #&54 &13d3 a0 14 LDY #&14 ; &1454 # Copy packed background sprite data to &1454 - &1793 &13d5 84 9b STY &9b ; packed_address_high &13d7 86 9a STX &9a ; packed_address_low &13d9 a2 9a LDX #&9a ; packed_address &13db 20 84 1e JSR &1e84 ; copy_address_of_block_A_into_zero_page_X ; unpack_part_of_background_sprite_data_loop &13de a6 96 LDX &96 ; offset &13e0 a9 00 LDA #&00 # Use low nibble &13e2 20 02 14 JSR &1402 ; unpack_background_sprite &13e5 18 CLC &13e6 a5 96 LDA &96 ; offset &13e8 69 34 ADC #&34 &13ea aa TAX &13eb a9 ff LDA #&ff # Use high nibble &13ed 20 02 14 JSR &1402 ; unpack_background_sprite &13f0 18 CLC &13f1 a5 9a LDA &9a ; packed_address_low &13f3 69 20 ADC #&20 &13f5 85 9a STA &9a ; packed_address_low &13f7 90 02 BCC &13fb &13f9 e6 9b INC &9b ; packed_address_high &13fb e6 96 INC &96 ; offset &13fd c6 98 DEC &98 ; remaining &13ff d0 dd BNE &13de ; unpack_part_of_background_sprite_data_loop &1401 60 RTS ; unpack_background_sprite # X is sprite offset &1402 85 92 STA &92 ; nibble_to_use &1404 bd 4d 13 LDA &134d,X ; background_sprites_used # Is this sprite used in any of the tiles? &1407 30 34 BMI &143d ; leave # If not, leave &1409 a0 00 LDY #&00 &140b 84 94 STY &94 ; unpacked_address_low &140d 4a LSR A &140e 66 94 ROR &94 ; unpacked_address_low &1410 4a LSR A &1411 66 94 ROR &94 ; unpacked_address_low &1413 4a LSR A &1414 66 94 ROR &94 ; unpacked_address_low &1416 aa TAX &1417 a5 94 LDA &94 ; unpacked_address_low &1419 69 80 ADC #&80 &141b 85 94 STA &94 ; unpacked_address_low &141d 8a TXA &141e 69 37 ADC #&37 ; &3780 = background_sprite_data # Unpack used background sprites at &3780 onwards &1420 85 95 STA &95 ; unpacked_address_high &1422 a0 1f LDY #&1f ; unpack_background_sprite_loop &1424 b1 94 LDA (&94),Y ; unpacked_address &1426 29 f0 AND #&f0 &1428 85 93 STA &93 ; high_nibble &142a b1 9a LDA (&9a),Y ; packed_address &142c 24 92 BIT &92 ; nibble_to_use &142e 10 04 BPL &1434 ; use_low_nibble &1430 4a LSR A &1431 4a LSR A &1432 4a LSR A &1433 4a LSR A ; use_low_nibble &1434 29 0f AND #&0f &1436 05 93 ORA &93 ; high_nibble &1438 91 94 STA (&94),Y ; unpacked_address &143a 88 DEY &143b 10 e7 BPL &1424 ; unpack_background_sprite_loop ; leave &143d 60 RTS # End of relocated code ; update_world_name_and_tiles # X = map, A = big target variant &153d a8 TAY &153e 8a TXA &153f 48 PHA &1540 98 TYA &1541 a0 14 LDY #&14 # Set variant for big target &1543 20 d3 15 JSR &15d3 ; adjust_stage_tiles_lookup_table &1546 a9 03 LDA #&03 &1548 25 56 AND &56 ; use_hexagonal_background # Either &00 or &ff, so variant is either &01 or &02 &154a 49 01 EOR #&01 &154c a0 00 LDY #&00 # Set variant for medium target and background &154e 20 d3 15 JSR &15d3 ; adjust_stage_tiles_lookup_table &1551 a2 1a LDX #&1a # Use right_big_tiles_parts_table &1553 a0 40 LDY #&40 ; TILE_HAS_RIGHT # Process map left to right &1555 a9 00 LDA #&00 &1557 24 56 BIT &56 ; use_hexagonal_background # Unnecessary check. Were hexagonal background maps &1559 4c 62 15 JMP &1562 ; use_right # once intended to be horizontally flipped? ; use_left # Unused code; would process map right to left &155c a2 35 LDX #&35 # Use left_big_tiles_parts_table &155e a0 10 LDY #&10 ; TILE_HAS_LEFT &1560 a9 13 LDA #&13 ; use_right &1562 8c 73 2d STY &2d73 ; check_for_tile_extending_horizontally + 1 &1565 8d d9 2b STA &2bd9 ; get_row_of_background_tiles_start + 1 &1568 a8 TAY &1569 08 PHP &156a a0 ca LDY #&ca ; DEX # Unused code; would process map right to left &156c a9 ff LDA #&ff &156e 28 PLP &156f d0 04 BNE &1575 ; use_dex &1571 a0 e8 LDY #&e8 ; INY # Always INY and &14; process map left to right &1573 a9 14 LDA #&14 ; use_dex &1575 8d 35 2c STA &2c35 ; get_row_of_background_tiles_end + 1 &1578 8c 33 2c STY &2c33 ; get_row_of_background_tiles_increment &157b a0 1a LDY #&1a ; initialise_big_tiles_parts_table_loop # Copy either left or right big tiles parts table &157d bd 11 16 LDA &1611,X ; right_big_tiles_parts_table # (but always right_big_tiles_parts_table) &1580 99 43 05 STA &0543,Y ; big_tiles_parts_table &1583 ca DEX &1584 88 DEY &1585 10 f6 BPL &157d ; initialise_big_tiles_parts_table_loop &1587 a6 4a LDX &4a ; stage_offset &1589 bd 21 06 LDA &0621,X ; stage_data_table &158c 29 1c AND #&1c &158e c9 10 CMP #&10 # Is this a CommSpace stage? &1590 b0 3e BCS &15d0 ; skip_delay # If so, skip the stage screen &1592 a8 TAY ; map &1593 a2 fc LDX #&fc ; copy_world_type_loop # Copy the type of the world &1595 b9 74 16 LDA &1674,Y ; world_type_strings &1598 9d 98 03 STA &0398,X ; title_screen_strings - &c4 &159b c8 INY &159c e8 INX &159d d0 f6 BNE &1595 ; copy_world_type_loop &159f a0 00 LDY #&00 # For every CommSpace stage up until this one, ; check_loop &15a1 e4 4a CPX &4a ; stage_offset &15a3 b0 0f BCS &15b4 &15a5 bd 21 06 LDA &0621,X ; stage_data_table &15a8 29 10 AND #&10 &15aa f0 04 BEQ &15b0 ; is_a_world_not_a_commspace &15ac 98 TYA &15ad 69 05 ADC #&05 # add five to an offset &15af a8 TAY ; is_a_world_not_a_commspace &15b0 e8 INX &15b1 e8 INX &15b2 d0 ed BNE &15a1 ; check_loop &15b4 a2 fb LDX #&fb ; copy_world_name_loop # which is used to copy the name of the world &15b6 b9 47 16 LDA &1647,Y ; world_names &15b9 9d a4 03 STA &03a4,X ; title_screen_strings - &b8 &15bc c8 INY &15bd e8 INX &15be d0 f6 BNE &15b6 ; copy_world_name_loop &15c0 a2 1c LDX #&1c # Write "Search Team Location", "Incomplete" &15c2 a0 49 LDY #&49 &15c4 20 e1 1e JSR &1ee1 ; write_title_screen_string &15c7 24 0a BIT &0a ; use_normal_top_and_bottom_groups &15c9 30 05 BMI &15d0 ; skip_delay # No delay if game has just started &15cb a9 50 LDA #&50 &15cd 20 62 21 JSR &2162 ; delay_for_A_vsyncs ; skip_delay &15d0 4c 6f 17 JMP &176f ; relocate_and_call_unpack_background_sprite_data ; adjust_stage_tiles_lookup_table &15d3 85 92 STA &92 ; variant &15d5 b9 f6 15 LDA &15f6,Y ; stage_tiles_adjustments_table # Single byte for number of tile variants &15d8 85 94 STA &94 ; number_of_variants ; adjust_stage_tiles_lookup_table &15da b9 f7 15 LDA &15f7,Y ; stage_tiles_adjustments_table + 1 # First byte in row is tile to be adjusted &15dd 30 16 BMI &15f5 ; leave &15df aa TAX &15e0 18 CLC &15e1 98 TYA &15e2 65 92 ADC &92 ; variant &15e4 a8 TAY &15e5 b9 f7 15 LDA &15f7,Y ; stage_tiles_adjustments_table + 1 # Get type of tile depending on variant &15e8 9d f7 2d STA &2df7,X ; stage_tiles_lookup_table &15eb 38 SEC &15ec 98 TYA &15ed e5 92 SBC &92 ; variant &15ef 18 CLC &15f0 65 94 ADC &94 ; number_of_variants &15f2 a8 TAY &15f3 90 e5 BCC &15da ; adjust_stage_tiles_lookup_table ; leave &15f5 60 RTS ; stage_tiles_adjustments_table &15f6 03 # Two variants; second is hexagonal background &15f7 01 01 54 # Change triangles &15fa 02 02 53 &15fd 03 03 52 &1600 04 04 51 &1603 08 0b 1f # Change background &1606 05 05 20 # Change medium target between ring and star &1609 ff # End of list ; &160a 05 # Four variants &160b 0e 23 40 46 4c # Change big target &1610 ff # End of list ; right_big_tiles_parts_table &1611 06 08 0a 0e 1d 1e 24 25 27 29 2a 31 33 37 3c 41 42 43 44 47 48 49 4a 4d 4e 4f 50 ; left_big_tiles_parts_table # Unused &162c 05 07 09 0d 1c 1e 23 24 26 28 29 30 32 36 3a 3f 40 41 42 45 46 47 48 4b 4c 4d 4e ; world_names &1647 43 79 67 6e 69 ; "Cygni" &1648 44 65 6c 61 6e ; "Delan" &1651 53 68 61 69 6c ; "Shail" &1656 54 65 73 6c 61 ; "Tesla" &165b 48 61 6e 61 68 ; "Hanah" &1660 41 62 65 6c 69 ; "Abeli" &1665 47 61 6c 79 65 ; "Galye" &166a 45 6e 6f 6c 61 ; "Enola" &166f 41 62 72 61 78 ; "Abrax" # Unused world name ; world_type_strings &1674 42 61 73 65 ; "Base" &1678 44 75 73 74 ; "Dust" &167c 4d 61 6c 6c ; "Mall" &1680 20 49 63 65 ; " Ice" ; initialise_background_sprites_and_tiles &1684 a9 ff LDA #&ff &1686 a2 69 LDX #&69 ; unset_background_sprites_used_loop &1688 9d 4c 13 STA &134c,X ; background_sprites_used -1 # Mark all background sprites as unused &168b ca DEX &168c d0 fa BNE &1688 ; unset_background_sprites_used_loop &168e a2 55 LDX #&55 ; unset_background_tiles_initialised_already_loop &1690 9d b5 13 STA &13b5,X ; background_tiles_initialised_already-1 # Mark all background tiles as needing processing &1693 ca DEX &1694 d0 fa BNE &1690 ; unset_background_tiles_initialised_already_loop &1696 a9 04 LDA #&04 ; tiles_to_background_sprites_table &1698 a2 0b LDX #&0b &169a a0 14 LDY #&14 ; &140b # Copy tiles_to_background_sprites_table to &140b &169c 84 9b STY &9b ; tiles_to_background_sprites_table_address_high &169e 86 9a STX &9a ; tiles_to_background_sprites_table_address_low &16a0 a2 9a LDX #&9a ; tiles_to_background_sprites_table &16a2 20 84 1e JSR &1e84 ; copy_address_of_block_A_into_zero_page_X &16a5 a2 00 LDX #&00 &16a7 86 96 STX &96 ; next_background_sprite_index &16a9 86 97 STX &97 ; unused # Unused variable &16ab a2 08 LDX #&08 # actually LDX start_of_tiles_to_always_initialise_list # &00 in standard version, &08 otherwise ; initialise_bevelled_tiles_loop &16ad bd db 16 LDA &16db,X ; tiles_to_always_initialise_table # Initialise bevelled tiles (not used in map) &16b0 10 0a BPL &16bc ; literal_tile_type &16b2 c9 ff CMP #&ff &16b4 f0 0c BEQ &16c2 ; end_of_bevelled_tiles &16b6 29 7f AND #&7f # If the top bit of an entry in the list is set, &16b8 a8 TAY &16b9 b9 f7 2d LDA &2df7,Y ; stage_tiles_lookup_table # use that as an index into stage_tiles_lookup_table ; literal_tile_type &16bc 20 fa 16 JSR &16fa ; initialise_tile_type # Otherwise, initialise that type of tile &16bf e8 INX &16c0 d0 eb BNE &16ad ; initialise_bevelled_tiles_loop ; end_of_bevelled_tiles &16c2 a2 00 LDX #&00 &16c4 c6 97 DEC &97 ; unused # Unnecessary instruction ; find_tiles_used_in_map_compression_table_loop &16c6 bd 00 0a LDA &0a00,X ; map_compression_table # Initialise tiles used in map &16c9 c9 ff CMP #&ff &16cb f0 0a BEQ &16d7 ; no_tile_in_this_entry &16cd 4a LSR A &16ce 4a LSR A &16cf 4a LSR A &16d0 a8 TAY &16d1 b9 f7 2d LDA &2df7,Y ; stage_tiles_lookup_table &16d4 20 fa 16 JSR &16fa ; initialise_tile_type ; no_tile_in_this_entry &16d7 e8 INX &16d8 d0 ec BNE &16c6 ; find_tiles_used_in_map_compression_table_loop &16da 60 RTS ; tiles_to_always_initialise_table ; in standard version &16db 94 ; TILE_ANTENNA &16dc 91 ; TILE_GIRDER_VERTICAL &16dd 93 ; TILE_TANK &16de 85 ; TILE_MEDIUM_TARGET_ONE &16df 8e ; TILE_BIG_TARGET_ONE &16e0 87 ; TILE_TRENCH_BOTTOM &16e1 86 ; TILE_TRENCH_TOP &16e2 8a ; TILE_TRENCH_MIDDLE ; in both versions &16e3 80 ; TILE_SPACE &16e4 81 ; TILE_TRIANGLE_BR &16e5 82 ; TILE_TRIANGLE_BL &16e6 83 ; TILE_TRIANGLE_TL &16e7 84 ; TILE_TRIANGLE_TR &16e8 88 ; TILE_BACKGROUND &16e9 89 ; TILE_BACKGROUND_FILL &16ea 8b ; TILE_REACTOR &16eb 95 ; TILE_GIRDER_HORIZONTAL &16ec 99 ; TILE_SMALL_TARGET &16ed 0f ; TILE_BEVEL_TL &16ee 10 ; TILE_BEVEL_T &16ef 11 ; TILE_BEVEL_L &16f0 12 ; TILE_BEVEL_BL &16f1 13 ; TILE_BEVEL_B &16f2 14 ; TILE_BEVEL_BR &16f3 15 ; TILE_BEVEL_R &16f4 16 ; TILE_BEVEL_TR &16f5 18 ; TILE_BEVEL_INSIDE_BL &16f6 19 ; TILE_BEVEL_INSIDE_TL &16f7 1a ; TILE_BEVEL_INSIDE_TR &16f8 1b ; TILE_BEVEL_INSIDE_BR &16f9 ff ; end of list ; initialise_tile_type # A is type of tile &16fa a8 TAY &16fb b9 b6 13 LDA &13b6,Y ; background_tiles_initialised_already # Has this type of tile been initialised already? &16fe 10 37 BPL &1737 ; leave &1700 a9 00 LDA #&00 &1702 99 b6 13 STA &13b6,Y ; background_tiles_initialised_already # Mark type of tile as having been initialised &1705 98 TYA &1706 48 PHA &1707 20 43 17 JSR &1743 ; set_tile_background_sprites # Store the sprites used for this tile &170a 68 PLA &170b a8 TAY &170c 48 PHA &170d b9 00 04 LDA &0400,Y ; background_tile_flags_table &1710 29 0f AND #&0f &1712 f0 0a BEQ &171e ; tile_isn't_destroyable &1714 a8 TAY &1715 b9 33 05 LDA &0533,Y ; destroyed_background_tiles_table - 1 # Initialise destroyed version of tile too &1718 20 fa 16 JSR &16fa ; initialise_tile_type &171b 68 PLA &171c a8 TAY &171d 48 PHA ; tile_isn't_destroyable &171e 8a TXA &171f 48 PHA &1720 98 TYA &1721 48 PHA &1722 aa TAX &1723 ad 73 2d LDA &2d73 ; check_for_tile_extending_to_right + 1 # Consider tile to right (always TILE_HAS_RIGHT) &1726 a0 00 LDY #&00 &1728 20 38 17 JSR &1738 ; initialise_part_of_big_tile &172b 68 PLA &172c aa TAX &172d a9 20 LDA #&20 ; TILE_HAS_TOP # Consider tile above &172f a0 1b LDY #&1b &1731 20 38 17 JSR &1738 ; initialise_part_of_big_tile &1734 68 PLA &1735 aa TAX &1736 68 PLA ; leave &1737 60 RTS ; initialise_part_of_big_tile &1738 3d 00 04 AND &0400,X ; background_tile_flags_table # Is this part of the tile destroyable? &173b f0 fa BEQ &1737 ; leave &173d 20 83 2d JSR &2d83 ; get_other_part_of_big_tile # returns A = other part of big tile &1740 4c fa 16 JMP &16fa ; initialise_tile_type # If so, initialise it too ; set_tile_background_sprites &1743 0a ASL A &1744 a8 TAY &1745 8a TXA &1746 48 PHA &1747 b1 9a LDA (&9a),Y ; tiles_to_background_sprites_table_address &1749 20 5b 17 JSR &175b ; get_background_sprite_index &174c 99 b0 0b STA &0bb0,Y ; background_sprites_index_table &174f c8 INY &1750 b1 9a LDA (&9a),Y ; tiles_to_background_sprites_table_address &1752 20 5b 17 JSR &175b ; get_background_sprite_index &1755 99 b0 0b STA &0bb0,Y ; background_sprites_index_table &1758 68 PLA &1759 aa TAX &175a 60 RTS ; get_background_sprite_index &175b 0a ASL A &175c 08 PHP # Store top bit in carry (vertical flip) &175d 4a LSR A # Lowest seven bits are background sprite &175e aa TAX &175f bd 4d 13 LDA &134d,X ; background_sprites_used # Has this sprite already been used? &1762 10 07 BPL &176b ; sprite_already_used &1764 a5 96 LDA &96 ; next_background_sprite_index &1766 9d 4d 13 STA &134d,X ; background_sprites_used # If not, give it the next index &1769 e6 96 INC &96 ; next_background_sprite_index ; sprite_already_used # If so, use the existing index &176b 0a ASL A &176c 28 PLP &176d 6a ROR A # Restore top bit from carry &176e 60 RTS ; relocate_and_call_unpack_background_sprite_data &176f 20 84 16 JSR &1684 ; initialise_background_sprites_and_tiles &1772 a2 88 LDX #&88 ; relocate_unpack_background_sprite_data_loop &1774 bd b4 14 LDA &14b4,X ; unrelocated_unpack_background_sprites_code - 1 &1777 9d b5 13 STA &13b5,X ; unpack_background_sprites_code - 1 # Relocate &14b5-&153c to &13b6-&143d &177a ca DEX &177b d0 f7 BNE &1774 ; relocate_unpack_background_sprite_data_loop &177d 68 PLA &177e aa TAX &177f 4c b6 13 JMP &13b6 ; unpack_background_sprite_data # Call relocated code # &001e bytes copied from &3d9e-&3dbb to &0c9c-&0cb9 at &43c7 ; relocatable_blocks_address_table # Read in pairs, start address, end address + 1 ; standard enhanced &0c9c 00 00 # &00 &4abd-&4d89 &8000-&82cc = unpack_background_sprites_code_relocatable_block &0c9e cd 02 # &02 &4d8a-&4d89 &82cd-&82cc # unused &0ca0 cd 02 # &04 &4d8a-&4e33 &82cd-&8376 = tiles_to_background_sprites_table &0ca2 77 03 # &06 &4e34-&5173 &8377-&86b6 = packed_background_sprite_data_part_one &0ca4 b7 06 # &08 &5174-&54b3 &86b7-&89f6 = packed_background_sprite_data_part_two &0ca6 f7 09 # &0a &54b4-&58c9 &89f7-&8e0c = map_0_data (Dust) &0ca8 0d 0e # &0c &58ca-&5d34 &8e0d-&9277 = map_1_data (Base) &0caa 78 12 # &0e &5d35-&60dd &9278-&9620 = map_2_data (Mall) &0cac 21 16 # &10 &60de-&6537 &9621-&9a7a = map_3_data (Ice) &0cae 7b 1a # &12 &6538-&6700 &9a7b-&9c43 = map_4_data (CommSpace 1) &0cb0 44 1c # &14 &6701-&68d3 &9c44-&9e16 = map_5_data (CommSpace 2) &0cb2 17 1e # &16 &68d4-&6afc &9e17-&a03f = music_track_0_data &0cb4 40 20 # &18 &6afd-&6d25 &a040-&a268 = music_track_1_data &0cb6 69 22 # &1a &6d26-&78f8 &a269-&a3eb = sideways_ram_completion_data &0cb8 3c 2e # &1c &78f9 &ae3c # end of relocatable blocks # &0400 bytes copied from &3dbc-&41bb to &0400-&07ff at &43be ; background_tile_flags_table # 8....... set if tiles show through tile # .4...... set for tiles that have right half # ..2..... set for tiles that have top half # ...1.... set for tiles that have left half # ....8421 type of destroyed tile (0 = indestructible) ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &0400 80 00 00 00 00 65 38 c0 90 c0 90 00 00 c0 90 80 ; &00 &0410 80 80 80 80 80 80 80 04 80 80 80 80 46 17 28 00 ; &10 &0420 75 04 04 65 7f 31 46 17 46 5e 11 80 80 80 80 80 ; &20 &0430 c6 97 e5 b8 00 04 4d 13 00 00 40 00 10 04 80 46 ; &30 &0440 65 5e 7f 12 32 46 65 5e 7f 11 31 46 65 5e 7f 12 ; &40 &0450 32 00 00 00 # Next byte is also used for tile &54 ; cumulative_single_bit_table &0454 00 01 03 07 0f 1f 3f 7f ; title_screen_strings ; &00 &045c 11 02 1f 04 04 06 20 46 69 72 65 20 54 72 61 63 ; COLOUR 2; TAB(&04, &04); Enable VDU; " Fire Track " &046c 6b 20 11 03 1f 02 16 48 69 67 68 3a ; COLOUR 3; TAB(&02, &16); "High:" ; &1c &0478 20 1f 00 0a 53 65 61 72 63 68 20 54 65 61 6d 20 ; " "; TAB(&00, &0a); "Search Team Location" &0488 4c 6f 63 61 74 69 6f 6e 11 02 1f 02 0c 2e 2e 2e ; COLOUR 2; TAB(&02, &0c); "....world "....." &0498 2e 77 6f 72 6c 64 20 22 2e 2e 2e 2e 2e 22 1f 00 ; TAB(&00, &11); "Zone Scan:"; &04a8 11 5a 6f 6e 65 20 53 63 61 6e 3a 11 03 49 6e 63 ; COLOUR 3; "Incomplete" &04b8 6f 6d 70 6c 65 74 65 ; &62 &04de 1f 09 16 ; TAB(&09, &16) ; &65 &04c1 11 02 1f 02 16 42 6f 6e 75 73 2e 2e 2e 2e 2e 2e ; COLOUR 2; TAB(&02, &16); "Bonus..........0" &04d0 2e 2e 2e 2e 30 ; stage_sounds_table ; c o p # Starting channel, sound offset, pitches for channels &04d6 10 40 06 00 1c 38 &04dc 11 48 84 74 60 ; accompanying_ships_x_positions &04e1 27 1e 30 15 39 42 42 ; function_key_action_table ; k a v # Key code, address to change, value &04e8 8e 3d e0 ; f1 - muting_flags = &e0 &04eb 8d 3d 40 ; f2 - muting_flags = &40 &04ee 8c 3d 80 ; f3 - muting_flags = &80 &04f1 eb 3d 00 ; f4 - muting_flags = &00 &04f4 8a 84 80 ; f6 - starting_stage = &80 - Baseworld "Cygni" &04f7 e9 84 87 ; f7 - starting_stage = &87 - Dustworld "Delan" &04fa 89 84 8e ; f8 - starting_stage = &8e - Iceworld "Shail" &04fd 89 84 8e ; f8 - starting_stage = &8e - Iceworld "Shail" # or 88 .. 95 ; f9 - starting_stage = &95 - Mallworld "Enola" if cheat activated ; keys checked in stage: &0500 df 94 ff ; f0 - game_paused = &ff &0503 9d 94 00 ; SPACE - game_paused = &00 ; sprite_slots_ranges ; 0 1 2 3 4 &0506 01 04 0c 12 1b ; ship_banking_table ; left - right &050b 10 00 00 00 f0 ff ; tile_row_offsets_table &0511 df cb b7 a3 8f 7b 67 53 3f 2b 16 00 ; destroyed_background_tiles_flags_table # ....8... DESTROYED_FLAG_LEFT # .....4.. DESTROYED_FLAG_RIGHT # ......2. DESTROYED_FLAG_NO_BULLET # .......1 DESTROYED_FLAG_TALL ; 1 2 3 4 5 6 7 8 9 a b c d e f &051d 08 08 08 00 06 05 09 0a 07 0d 0b 0e 04 0d 0e ; number_of_stars_to_update_table &052c 0a 00 14 00 0a 00 1e 00 ; destroyed_background_tiles_table &0534 0b ; destroyed &01 = TILE_BACKGROUND_SQUARE &0535 1f ; destroyed &02 = TILE_BACKGROUND_HEX &0536 39 ; destroyed &03 = TILE_DUST &0537 3e ; destroyed &04 = TILE_DESTROYED &0538 18 ; destroyed &05 = TILE_BEVEL_INSIDE_BL &0539 19 ; destroyed &06 = TILE_BEVEL_INSIDE_TL &053a 1a ; destroyed &07 = TILE_BEVEL_INSIDE_TR &053b 1b ; destroyed &08 = TILE_BEVEL_INSIDE_BR &053c 15 ; destroyed &09 = TILE_BEVEL_R (unused) &053d 13 ; destroyed &0a = TILE_BEVEL_B (unused) &053e 11 ; destroyed &0b = TILE_BEVEL_L (unused) &053f 10 ; destroyed &0c = TILE_BEVEL_T (unused) &0540 3e ; destroyed &0d = TILE_DESTROYED &0541 1a ; destroyed &0e = TILE_BEVEL_INSIDE_TR &0542 1b ; destroyed &0f = TILE_BEVEL_INSIDE_BR ; big_tiles_parts_table ; tiles with TILE_HAS_LEFT or TILE_HAS_RIGHT # This section is overwritten at &1580, so isn't used &0543 a2 11 LDX #&11 # This code is identical to &42e1-&42fb, which restores &0545 bd 80 04 LDA &0480,X # OS VDU zero page and sets video registers &0548 95 d0 STA &d0,X &054a ca DEX &054b 10 f8 BPL &0545 &054d e8 INX &054e bd 1d 42 LDA &421d,X &0551 30 fe BMI &0551 # Except for this infinite loop &0553 8d 00 fe STA &fe00 &0556 bd 1e 42 LDA &421e,X &0559 8d 01 fe STA &fe01 &055c e8 INX &055d e8 INX ; tiles with TILE_HAS_TOP # This section isn't overwritten; these are tiles &055e 1c 1d 27 26 28 29 2a 30 31 3f 41 43 45 47 49 4b &055f 4d 4f ; bevel_values_table &0570 10 40 01 04 03 02 06 07 0c 08 1c 18 30 20 70 60 &0580 c0 80 c1 81 83 87 c7 c3 0f 0e 1f 1e 28 2c 68 6c &0590 0a 1a 0b 1b 82 86 c2 c6 a0 b0 b1 a1 38 3c 7c 78 &05a0 e0 e1 f0 f1 ; unused &05a4 00 ; bevel_tiles_table &05a5 0f 16 14 12 13 13 13 13 11 11 11 11 10 10 10 10 &05b5 15 15 15 15 19 19 19 19 1a 1a 1a 1a 1b 1b 1b 1b &05c5 1a 1a 1a 1a 19 19 19 19 18 18 18 18 1b 1b 1b 1b &05d5 18 18 18 18 ; colour_table &05d9 00 00 00 00 ; &00 KKKK - foreground shadows &05dd 11 11 33 33 ; &04 RRYY - foreground ships &05e1 55 55 77 77 ; &08 MMYY - foreground ships &05e5 40 53 ; &0c KBYM - map_launch # Two sets of colours per map &05e7 10 46 ; &0e KRCB # second set for hexagonal background variant &05e9 40 67 ; &10 KBWC - map_4 (CommSpace 1) &05eb 10 46 ; &12 KRCB &05ed 40 56 ; &14 KBCM - map_5 (CommSpace 2) &05ef 40 13 ; &16 KBYR &05f1 50 46 ; &18 KMCB - map_3 (Ice) &05f3 40 67 ; &1a KBWC &05f5 10 27 ; &1c KRWG - map_0 (Dust) &05f7 40 23 ; &1e KBYG &05f9 40 53 ; &20 KBYM - map_1 (Base) &05fb 20 17 ; &22 KGWR &05fd 10 46 ; &24 KRCB - map_2 (Mall) &05ff 40 27 ; &26 KBWG ; map_addresses_and_colours_table ; addr fg bg ; fg = &4 for red/yellow foreground, &8 for white/magenta foreground, &80 set for bevelled maps &0601 0c 00 84 20 ; &00 ; &000c = map_1 in enhanced version, &1329 in standard version (Base) &0605 0a 00 88 1c ; &04 ; &000a = map_0 in enhanced version, &1329 in standard version (Dust) &0609 0e 00 84 24 ; &08 ; &000e = map_2 in enhanced version, &1329 in standard version (Mall) &060d 10 00 84 18 ; &0c ; &0010 = map_3 in enhanced version, &1329 in standard version (Ice) &0611 12 00 08 10 ; &10 ; &0012 = map_4 in enhanced version, &173f in standard version (CommSpace 1) &0615 14 00 08 14 ; &14 ; &0014 = map_5 in enhanced version, &173f in standard version (CommSpace 2) &0619 68 03 04 0c ; &18 ; &0368 = map_launch &061d 5a 0c 84 0c ; &1c ; &0c5a = map_devil_rock ; stage_data_table # 8....... ........ set if stage is dark # .42..... ........ stage_enemy_flags: &00 enemies arrive in waves, old wave must clear before new wave starts # &20 enemies arrive in waves, new wave starts as soon as enough energy # &40 enemies arrive individually # &60 enemies arrive individually and closer together # ...1.... ........ music track # ...184.. ........ world type: &00 = Base, &04 = Dust, &08 = Mall, &0c = Ice, &10 = CommSpace 1, &14 = CommSpace 2 # ......21 ........ variant used for big target # .......1 ........ variant used for background and medium target: 0 = square, ring; 1 = hexagonal, star # ........ 8421.... wave_energy_delta # ........ ....84.. reduction_in_enemies_per_wave # ........ ......21 maximum number of homing enemies minus one &0621 00 01 ; 0000 0000 base (Cygni) - starting stage &80 &0623 80 31 ; 8000 0000 dark, base &0625 12 55 ; 0001 0020 commspace1 &0627 06 99 ; 0000 0420 dust (Delan) - starting stage &87 &0629 86 48 ; 8000 0420 dark, dust &062b 14 8a ; 0001 0400 commspace2 &062d 0d 67 ; 0000 8401 ice, hex (Shail) - starting stage &8e (no enemies) &062f b3 a9 ; 8021 0021 dark, commspace1, hex &0631 4b 4d ; 0400 8021 mall, hex (Tesla) &0633 eb 59 ; 8420 8021 dark, mall, hex &0635 d5 9a ; 8401 0401 dark, commspace2, hex &0637 01 01 ; 0000 0001 base, hex (Hanah) (no enemies) &0639 b1 ba ; 8021 0001 dark, commspace1, hex &063b 47 7b ; 0040 0421 dust, hex (Abeli) &063d e7 96 ; 8420 0421 dark, dust, hex &063f b7 cb ; 8021 0421 dark, commspace2, hex &0641 ce b7 ; 8400 8420 dark, ice (Galye) &0643 ae cf ; 8020 8420 dark, ice &0645 f0 c5 ; 8421 0000 dark, commspace1 &0647 4a bc ; 0400 8020 mall (Enola) - starting stage &95 &0649 aa e8 ; 8020 8020 dark, mall &064b f6 c4 ; 8421 0420 commspace2 ; single_bit_table &064d 01 02 04 08 10 20 40 80 ; enemy_movement_table &0655 00 00 ; &00 &0657 0e 03 ; &02 &0659 00 01 ; &04 &065b 00 02 ; &06 &065d 00 04 ; &08 &065f 01 01 ; &0a &0661 ff 01 ; &0c &0663 03 01 ; &0e &0665 fd 01 ; &10 &0667 00 ff ; &12 &0669 00 fe ; &14 &066b 00 fc ; &16 &066d 00 fb ; &18 ; sprites_typedata_table ; 0 1 2 3 4 # Non-enemy sprites have five bytes per entry ; sp en addr mo # Sprite, energy, routine address, movement offset &066f 11 02 6f 33 01 ; &00 - &336f = update_bullet &0674 0f 10 a3 36 00 ; &05 - &36a3 = change_typedata_offset_to_next GROUND_EXPLOSION &0679 0d 08 a3 36 00 ; &0a - &36a3 = change_typedata_offset_to_next &067e 0f 0c a3 36 00 ; &0f - &36a3 = change_typedata_offset_to_next &0683 0d 06 a3 36 00 ; &14 - &36a3 = change_typedata_offset_to_next &0688 0b 05 a3 36 00 ; &19 - &36a3 = change_typedata_offset_to_next &068d 0d 04 9e 35 ff ; &1e - &359e = null_movement &0692 0d 10 a3 36 00 ; &23 - &36a3 = change_typedata_offset_to_next ENEMY_SHIP_EXPLOSION &0697 0b 0e a3 36 00 ; &28 - &36a3 = change_typedata_offset_to_next &069c 0d 0a a3 36 00 ; &2d - &36a3 = change_typedata_offset_to_next &06a1 0b 08 9e 35 ff ; &32 - &359e = null_movement &06a6 0c 02 00 35 08 ; &37 - &3500 = update_initial_player_ships INITIAL_PLAYER_SHIP &06ab 0e 03 17 35 0c ; &3c - &3517 = update_accompanying_player_ships &06b0 10 03 17 35 0a ; &41 - &3517 = update_accompanying_player_ships ; 0 1 2 3 4 5 # Enemy sprites have a sixth byte for score, BCD * 10 ; sp en addr mo sc &06b5 0a 04 70 35 da 00 ; &46 - &3570 = move_towards_stored_x_y_target ENEMY_HOMING &06bb 08 03 36 36 14 13 ; &4c - &3636 = drift_towards_player_every_two ENEMY_TURRET &06c1 09 04 33 36 12 00 ; &52 - &3633 = drift_towards_player_every_four ENEMY_H &06c7 05 03 bb 35 00 08 ; &58 - &35bb = move_in_oscillation_pattern_0 ENEMY_SHUTTLE &06cd 03 02 b8 35 12 14 ; &5e - &35b8 = move_in_oscillation_pattern_3 ENEMY_MIXER &06d3 02 03 b5 35 00 20 ; &64 - &35b5 = move_in_oscillation_pattern_9 ENEMY_BALL &06d9 04 02 50 36 10 12 ; &6a - &3650 = keep_enemy_at_top_of_screen_until_timer ENEMY_MASK stage 1 &06df 04 03 5a 36 16 12 ; &70 - &365a = move_enemy_down_until_level_with_player ENEMY_MASK stage 2 &06e5 04 03 75 36 0e 12 ; &76 - &3675 = move_enemy_right_and_remove_when_off_screen ENEMY_MASK stage 3 &06eb 06 03 9e 35 18 14 ; &7c - &359e = null_movement ENEMY_BIG_SHUTTLE &06f1 07 03 af 35 00 14 ; &82 - &35af = move_in_oscillation_pattern_c ENEMY_SPIRAL &06f7 01 03 4d 36 03 15 ; &88 - &364d = keep_enemy_near_top_of_screen_until_timer ENEMY_SIDEWAYS stage 1 &06fd 01 03 95 36 00 15 ; &8e - &3695 = move_enemy_down_until_timer ENEMY_SIDEWAYS stage 2 &0703 01 03 9e 35 01 15 ; &94 - &359e = null_movement ENEMY_SIDEWAYS stage 3 &0709 00 04 2a 35 04 19 ; &9a - &352a = wait_until_timer ENEMY_BIRD stage 1 &070f 00 02 35 35 06 19 ; &a0 - &3535 = wait_until_time_and_store_target_x ENEMY_BIRD stage 2 &0715 00 03 49 35 16 20 ; &a6 - &3549 = move_towards_stored_x_target ENEMY_BIRD stage 3 ; oscillation_patterns # Top bit of x or y set if no oscillation ; sp x y # Low three bits set magnitude of oscillation &071b 05 0a 80 ; &00 - ENEMY SHUTTLE # Remaining bits set frequency of oscillation &071e 06 0b 80 ; &03 - ENEMY_MIXER # (both values divided by 2^bits) &0721 05 03 09 ; &06 - ENEMY_SIDEWAYS &0724 fb 0b 09 ; &09 - ENEMY_BALL &0727 03 02 08 ; &0c - ENEMY_SPIRAL ; prototype_enemy_table ; 0 1 2 3 4 5 6 ; of x xr f fr nb sp sprite &072a 9a 00 50 06 08 07 0f ; &00 - ENEMY_BIRD 0 &0731 52 00 50 00 00 07 23 ; &07 - ENEMY_H 9 &0738 6a 53 00 12 0a 07 1d ; &0e - ENEMY_MASK 4 &073f 4c 06 44 00 00 08 10 ; &15 - ENEMY_TURRET 8 &0746 58 28 00 00 00 07 0e ; &1c - ENEMY_SHUTTLE 5 &074d 7c 03 4a 00 00 09 0f ; &23 - ENEMY_BIG_SHUTTLE 6 &0754 82 32 00 37 00 06 0f ; &2a - ENEMY_SPIRAL 7 &075b 64 22 00 d6 00 07 0e ; &31 - ENEMY_BALL 2 &0762 88 fd 00 0e 00 06 16 ; &38 - ENEMY_SIDEWAYS 1 &0769 5e 28 00 00 ff 06 16 ; &3f - ENEMY_MIXER 3 ; wave_type_table # Offsets into prototype_enemy_table &0770 1c 2a 1c 23 0e 2a 31 00 1c 23 15 31 2a 00 07 0e # The first &24 waves are used only for "Cygni" &0780 15 1c 31 23 00 2a 3f 0e 07 3f 15 31 1c 38 2a 0e &0790 23 15 00 07 &0794 38 31 3f 1c 0e 38 31 2a 07 23 38 3f 00 1c 15 23 # The last &24 waves are used for all other worlds &07a4 2a 0e 1c 31 15 3f 00 23 15 1c 38 2a 0e 07 3f 31 &07b4 38 15 1c 00 ; cosine_table &07b8 64 63 63 62 62 61 5f 5e 5c 5a 58 55 53 50 4d 4a &07c8 46 43 3f 3b 37 33 2f 2a 26 21 1d 18 13 0e 09 04 ; control_routine_address_table &07d8 17 22 9e bd 97 b7 b6 ; &2217 = check_key_press # Z, X, ?, *, RETURN &07df 17 22 bf fe a7 d7 c6 ; &2217 = check_key_press # CAPS LOCK, CTRL, ], -, CURSOR UP &07e6 80 08 01 81 82 02 00 ; &0880 = check_joystick &07ed 80 08 03 83 84 04 80 ; &0880 = check_joystick ; player_movement_offsets ; left - right down - up &07f4 e0 ff 00 00 20 00 fd ff 00 00 03 00 ; initialisation_part_two &41bc a9 40 LDA #&40 ; RTI &41be 8d 00 0d STA &0d00 # Return from non-maskable interrupts immediately &41c1 78 SEI &41c2 d8 CLD &41c3 a2 ff LDX #&ff # Reset stack &41c5 9a TXS &41c6 a9 21 LDA #&21 # Disable System Timer 2 and CA2 (keyboard) interrupts &41c8 8d 4e fe STA &fe4e ; System VIA interrupt enable register &41cb 8d 4d fe STA &fe4d ; System VIA interrupt flag register # Clear System Timer 2 time-out and CA2 (keyboard) flags &41ce a9 40 LDA #&40 # Set System Timer 1 to continuous count down &41d0 8d 4b fe STA &fe4b ; System VIA auxilliary control register # and System Timer 2 to single count down &41d3 a9 01 LDA #&01 # Set System Timer 2 about to trigger &41d5 8d 48 fe STA &fe48 ; System VIA timer 2 counter LSB &41d8 a9 00 LDA #&00 &41da 8d 49 fe STA &fe49 ; System VIA timer 2 counter MSB &41dd 2c ff ff BIT &ffff # Allow time for System Timer 2 time to trigger &41e0 2c ff ff BIT &ffff &41e3 a9 20 LDA #&20 # Clear System Timer 2 time-out flag; there will be &41e5 8d 4d fe STA &fe4d ; System VIA interrupt flag register # no further interrupts from System VIA Timer 2 &41e8 20 90 48 JSR &4890 ; copy_memory # Copy &0080 bytes from &4878-&48f7 to &7f80-&7fff &41eb 78 48 80 7f 80 00 # (copies copy_memory (!) and initialisation_part_four) &41f1 4c d6 42 JMP &42d6 ; initialisation_part_three ; check_for_match_against_configuration_strings # X,Y = address to check, A = offset &41f4 84 93 STY &93 ; address_high &41f6 86 92 STX &92 ; address_low &41f8 aa TAX &41f9 a0 00 LDY #&00 ; check_for_match_against_configuration_strings_loop &41fb bd 53 47 LDA &4753,X ; configuration_strings &41fe f0 0b BEQ &420b ; match # Don't need to match the null at the end &4200 d1 92 CMP (&92),Y ; address &4202 d0 05 BNE &4209 ; no_match &4204 e8 INX &4205 c8 INY &4206 4c fb 41 JMP &41fb ; check_for_match_against_configuration_strings_loop ; no_match &4209 18 CLC # Leave with carry unset if no match &420a 60 RTS ; match &420b 38 SEC # Leave with carry set if string matches &420c 60 RTS ; patch_control_routine_address_table # X = offset into table, Y = length of patch &420d 84 92 STY &92 ; length &420f a0 00 LDY #&00 ; patch_control_routine_address_table_loop &4211 b1 96 LDA (&96),Y ; patch_address &4213 9d d8 07 STA &07d8,X ; control_routine_address_table &4216 e8 INX &4217 c8 INY &4218 c6 92 DEC &92 ; length &421a d0 f5 BNE &4211 ; patch_control_routine_address_table_loop &421c 60 RTS ; video_registers_table &421d 00 7f ; R0: Horizontal total register &421f 01 50 ; R1: Number of characters per line &4221 02 62 ; R2: Horizontal sync position register &4223 03 28 ; R3: Sync width register &4225 04 25 ; R4: Vertical total register &4227 05 08 ; R5: Vertical total adjust register &4229 06 1a ; R6: Vertical displayed register &422b 07 1f ; R7: Vertical sync position &422d 08 01 ; R8: Interlace and delay register &422f 09 07 ; R9: Scan lines per character register &4231 0a 20 ; R10: Cursor start register &4233 0b 08 ; R11: Cursor end register &4235 ff ; add_offset_to_relocatable_blocks_addresses &4236 86 92 STX &92 ; offset_low &4238 a2 1e LDX #&1e ; add_offset_to_relocatable_blocks_addresses_loop &423a 18 CLC &423b a5 92 LDA &92 ; offset_low &423d 7d 9a 0c ADC &0c9a,X ; relocatable_blocks_address_table - 2 &4240 9d 9a 0c STA &0c9a,X ; relocatable_blocks_address_table - 2 &4243 98 TYA &4244 7d 9b 0c ADC &0c9b,X ; relocatable_blocks_address_table - 1 &4247 9d 9b 0c STA &0c9b,X ; relocatable_blocks_address_table - 1 &424a ca DEX &424b ca DEX &424c d0 ec BNE &423a ; add_offset_to_relocatable_blocks_addresses_loop &424e 60 RTS # &0003 bytes copied from &424f-&4251 to &1e84-&1e86 at &45c3 ; to_copy_block_A_to_address_in_zero_page_X &1e84 4c 52 42 JMP &4252 ; copy_block_A_to_address_in_zero_page_X ; copy_block_A_to_address_in_zero_page_X &4252 48 PHA &4253 b5 01 LDA &01,X &4255 a8 TAY &4256 b5 00 LDA &00,X &4258 aa TAX &4259 68 PLA &425a 4c 81 1e JMP &1e81 ; copy_block_A_to_address_X_Y # &0003 bytes copied from &1e84-&1e86 to &425d-&425f at &45ba # &0003 bytes copied from &425d-&425f to &1e84-&1e86 at &460b &425d 31 32 33 # These values are never used, overwritten at &45ba # &0009 bytes copied from &4260-&4268 to &1908-&1910 at &461d in standard version ; title_screen_routine # Replace title screen with cut down routine &4260 &1908 20 87 29 JSR &2987 ; check_for_function_key_presses &4263 &190b 20 d7 26 JSR &26d7 ; check_for_space_or_fire_and_set_control_type &4266 &190e 90 f8 BCC &4260 ; title_screen_routine &4268 &1910 RTS # &0039 bytes copied from &4268-&42a0 to &1e81-&1eb9 at &46a2 in standard version &4268 &1e81 60 RTS &4269 &1e82 ea NOP &426a &1e83 ea NOP &426b &1e84 60 RTS ; write_encrypted_completion_message &426c &1e85 a2 00 LDX #&00 &426e &1e87 8a TXA &426f &1e88 18 CLC ; write_encrypted_completion_message_loop # Write completion message for standard version &4270 &1e89 7d 31 0d ADC &0d31,X ; encrypted_completion_message &4273 &1e8c 20 ee ff JSR &ffee ; OSWRCH &4276 &1e8d e8 INX &4277 &1e90 e0 6e CPX #&6e &4279 &1e92 90 f5 BCC &1e89 ; write_encrypted_completion_message_loop &427b &1e94 8a TXA &427c &1e95 20 62 21 JSR &2162 ; delay_for_A_vsyncs &427f &1e98 20 34 23 JSR &2334 ; plot_score_to_screen ; begin_background_colour_change # End of game visual effects &4282 &1e9b a9 0c LDA #&0c &4284 &1e9d 85 96 STA &96 ; background_colours ; background_colour_change_loop &4286 &1e9f a0 03 LDY #&03 ; update_background_loop &4288 &1ea1 20 d7 25 JSR &25d7 ; wait_for_a_vsync_while_updating_background &428b &1ea4 88 DEY &428c &1ea5 d0 fa BNE &4288 ; update_background_loop &428e &1ea7 e6 96 INC &96 ; background_colours &4290 &1ea9 e6 96 INC &96 ; background_colours &4292 &1eab a6 96 LDX &96 ; background_colours &4294 &1ead e0 28 CPX #&28 &4296 &1eaf b0 ea BCS &4282 ; begin_background_colour_change &4298 &1eb1 20 c3 21 JSR &21c3 ; set_background_colours_to_set_X &429b &1eb4 20 d7 26 JSR &26d7 ; check_for_space_or_fire_and_set_control_type &429e &1eb7 90 e6 BCC &4286 ; background_colour_change_loop &42a0 &1eb9 60 RTS # &000c bytes copied from &42a1-&42ac to &1e84-&1e8f at &46d4 ; copy_block_A_to_address_at_zero_page_X &42a1 &1e84 48 PHA &42a2 &1e85 b5 01 LDA &01,X &42a4 &1e87 a8 TAY &42a5 &1e88 b5 00 LDA &00,X &42a7 &1e8a aa TAX &42a8 &1e8b 68 PLA &42a9 &1e8c 38 SEC &42aa &1e8d 2c ff ff BIT &ffff # &1e90 ; always_copy_block_A_to_address_X_Y # &0012 bytes copied from &42ad-&42be to &2059-&206a at &4626 in standard version ; end_screen_routine &42ad &2059 20 34 23 JSR &2334 ; plot_score_to_screen &42b0 &205c 20 85 1e JSR &1e85 ; write_encrypted_completion_message &42b3 &205f a2 00 LDX #&00 &42b5 &2061 86 6e STX &6e ; player_lives &42b7 &2063 ca DEX &42b8 &2064 86 2d STX &2d ; player_has_finished_exploding &42ba &2066 86 2c STX &2c ; scrolling_paused_but_game_continuing &42bc &2068 4c 20 20 JMP &2020 ; compare_score_against_high_score ; reset_vectors &42bf ac b8 ff LDY &ffb8 ; os_default_vector_table_address_high &42c2 ae b7 ff LDX &ffb7 ; os_default_vector_table_address_low &42c5 84 97 STY &97 ; default_vector_table_address_high &42c7 86 96 STX &96 ; default_vector_table_address_low &42c9 ac b6 ff LDY &ffb6 ; os_length_of_default_vector_table ; reset_vectors_loop &42cc 88 DEY &42cd b1 96 LDA (&96),Y ; default_vector_table_adress_high &42cf 99 00 02 STA &0200,Y ; os_vector_table &42d2 98 TYA &42d3 d0 f7 BNE &42cc ; reset_vectors_loop &42d5 60 RTS ; initialisation_part_three &42d6 a2 00 LDX #&00 ; restore_0300_loop # Restore &0300-&037f (OS VDU workspace) from loader &42d8 bd 00 04 LDA &0400,X &42db 9d 00 03 STA &0300,X &42de e8 INX &42df 10 f7 BPL &42d8 ; restore_0300_loop &42e1 a2 11 LDX #&11 ; restore_00d0_loop # Restore &00d0-&00e1 (OS VDU zero page) from loader &42e3 bd 80 04 LDA &0480,X &42e6 95 d0 STA &d0,X &42e8 ca DEX &42e9 10 f8 BPL &42e3 ; restore_00d0_loop &42eb e8 INX ; set_video_registers_loop &42ec bd 1d 42 LDA &421d,X ; video_registers_table &42ef 30 0d BMI &42fe ; finished_setting_video_registers &42f1 8d 00 fe STA &fe00 ; video register number &42f4 bd 1e 42 LDA &421e,X ; video_registers_table + 1 &42f7 8d 01 fe STA &fe01 ; video register value &42fa e8 INX &42fb e8 INX &42fc d0 ee BNE &42ec ; set_video_registers_loop ; finished_setting_video_registers &42fe a9 f4 LDA #&f4 # Change to MODE 2 without clearing screen &4300 8d 20 fe STA &fe20 ; video ULA control register &4303 a9 04 LDA #&04 # Set bits of addressable latch; B4 = 0, and &4305 8d 40 fe STA &fe40 ; System VIA port B input/ouput register &4308 a9 05 LDA #&05 # B5 = 0; set size of screen to be &4000 for scrolling &430a 8d 40 fe STA &fe40 ; System VIA port B input/ouput register &430d 20 bf 42 JSR &42bf ; reset_vectors &4310 18 CLC &4311 a9 07 LDA #&07 ; set_palette_loop # Set all colours to logical 0 (black) &4313 8d 21 fe STA &fe21 ; video ULA palette register &4316 69 10 ADC #&10 &4318 90 f9 BCC &4313 ; set_palette_loop &431a a2 a6 LDX #&a6 &431c a9 00 LDA #&00 ; wipe_zero_page_loop # Wipe &0002-&00a7 &431e 95 01 STA &01,X &4320 ca DEX &4321 d0 fb BNE &431e ; wipe_zero_page_loop &4323 a9 08 LDA #&08 &4325 85 1c STA &1c &4327 a0 09 LDY #&09 # offset = &00, length = &09, osbytes_one &4329 20 2e 48 JSR &482e ; do_osbytes_from_table &432c a9 40 LDA #&40 &432e 8d 54 03 STA &0354 ; os_screen_memory_length &4331 8d 4e 03 STA &034e ; os_high_byte_of_screen_memory_start_address &4334 a9 01 LDA #&01 &4336 8d 56 03 STA &0356 ; os_screen_memory_mode_type &4339 a9 11 LDA #&11 # COLOUR 2 &433b 20 ee ff JSR &ffee ; OSWRCH &433e a9 02 LDA #&02 &4340 20 ee ff JSR &ffee ; OSWRCH &4343 a9 08 LDA #&08 ; Define a sound envelope &4345 a2 5c LDX #&5c &4347 a0 7a LDY #&7a ; &7a5c = envelope_1 &4349 20 f1 ff JSR &fff1 ; OSWORD &434c a2 6a LDX #&6a &434e a0 7a LDY #&7a ; &7a6a = envelope_2 &4350 20 f1 ff JSR &fff1 ; OSWORD &4353 a2 78 LDX #&78 &4355 a0 7a LDY #&7a ; &7a78 = envelope_3 &4357 20 f1 ff JSR &fff1 ; OSWORD &435a a2 86 LDX #&86 &435c a0 7a LDY #&7a ; &7a86 = envelope_4 &435e 20 f1 ff JSR &fff1 ; OSWORD &4361 a2 94 LDX #&94 &4363 a0 7a LDY #&7a ; &7a94 = envelope_5 &4365 20 f1 ff JSR &fff1 ; OSWORD &4368 a2 a2 LDX #&a2 &436a a0 7a LDY #&7a ; &7aa2 = envelope_6 &436c 20 f1 ff JSR &fff1 ; OSWORD &436f a2 b0 LDX #&b0 &4371 a0 7a LDY #&7a ; &7ab0 = envelope_7 &4373 20 f1 ff JSR &fff1 ; OSWORD &4376 a2 be LDX #&be &4378 a0 7a LDY #&7a ; &7abe = envelope_8 &437a 20 f1 ff JSR &fff1 ; OSWORD &437d a2 cc LDX #&cc &437f a0 7a LDY #&7a ; &7acc = envelope_9 &4381 20 f1 ff JSR &fff1 ; OSWORD &4384 a2 da LDX #&da &4386 a0 7a LDY #&7a ; &7ada = envelope_10 &4388 20 f1 ff JSR &fff1 ; OSWORD &438b a2 e8 LDX #&e8 &438d a0 7a LDY #&7a ; &7ae8 = envelope_11 &438f 20 f1 ff JSR &fff1 ; OSWORD &4392 a2 f6 LDX #&f6 &4394 a0 7a LDY #&7a ; &7af6 = envelope_12 &4396 20 f1 ff JSR &fff1 ; OSWORD &4399 a2 04 LDX #&04 &439b a0 7b LDY #&7b ; &7b04 = envelope_13 &439d 20 f1 ff JSR &fff1 ; OSWORD &43a0 a2 12 LDX #&12 &43a2 a0 7b LDY #&7b ; &7b12 = envelope_14 &43a4 20 f1 ff JSR &fff1 ; OSWORD &43a7 a2 20 LDX #&20 &43a9 a0 7b LDY #&7b ; &7b20 = envelope_15 &43ab 20 f1 ff JSR &fff1 ; OSWORD &43ae a2 2e LDX #&2e &43b0 a0 7b LDY #&7b ; &7b2e = envelope_16 &43b2 20 f1 ff JSR &fff1 ; OSWORD &43b5 20 98 7f JSR &7f98 ; copy_memory # Copy &0068 bytes from &7b3c-&7ba3 to &0100-&0167 &43b8 3c 7b 00 01 68 00 &43be 20 98 7f JSR &7f98 ; copy_memory # Copy &0400 bytes from &3dbc-&41bb to &0400-&07ff &43c1 bc 3d 00 04 00 04 &43c7 20 98 7f JSR &7f98 ; copy_memory # Copy &001e bytes from &3d9e-&3dbb to &0c9c-&0cb9 &43ca 9e 3d 9c 0c 1e 00 &43d0 20 98 7f JSR &7f98 ; copy_memory # Copy &02cd bytes from &3ad1-&3d9d to &0e00-&10cc &43d3 d1 3a 00 0e cd 02 &43d9 20 98 7f JSR &7f98 ; copy_memory # Copy &003b bytes from &4718-&4752 to &0880-&08ba &43dc 18 47 80 08 3b 00 &43e2 20 98 7f JSR &7f98 ; copy_memory # Copy &1fd1 bytes from &1b00-&3ad0 to &17ab-&377b &43e5 00 1b ab 17 d1 1f &43eb 20 98 7f JSR &7f98 ; copy_memory # Copy &0036 bytes from &48dc-&4911 to &0cc4-&0cf9 &43ee dc 48 c4 0c 36 00 &43f4 20 98 7f JSR &7f98 ; copy_memory # Copy &0012 bytes from &4912-&4923 to &02ea-&02fb &43f7 12 49 ea 02 12 00 &43fd 20 98 7f JSR &7f98 ; copy_memory # Copy &0024 bytes from &4924-&4947 to &03a7-&03ca &4400 24 49 a7 03 24 00 ; add_offset_to_sprite_addresses &4406 a0 12 LDY #&12 ; add_offset_to_sprite_addresses_loop &4408 18 CLC &4409 a9 7b LDA #&7b &440b 79 c3 0c ADC &0cc3,Y ; sprite_address_low_table - 1 &440e 99 c3 0c STA &0cc3,Y ; sprite_address_low_table - 1 &4411 a9 37 LDA #&37 ; &377b = unpacked_sprite_data - 1 &4413 79 d5 0c ADC &0cd5,Y - sprite_address_high_table - 1 &4416 99 d5 0c STA &0cd5,Y - sprite_address_high_table - 1 &4419 88 DEY &441a d0 ec BNE &4408 ; add_offset_to_sprite_addresses_loop ; unpack_sprite_data &441c a2 48 LDX #&48 &441e a0 49 LDY #&49 ; &4948 = packed_sprite_data &4420 84 10 STY &10 ; packed_address_high &4422 86 0f STX &0f ; packed_address_low &4424 a2 7c LDX #&7c &4426 a0 37 LDY #&37 ; &377c = unpacked_sprite_data &4428 84 0e STY &0e ; unpacked_address_high &442a 86 0d STX &0d ; unpacked_address_low &442c a2 be LDX #&be &442e a0 fb LDY #&fb ; &fbbe = -&0442 &4430 84 0c STY &0c ; bytes_to_unpack_high &4432 86 0b STX &0b ; bytes_to_unpack_low &4434 a0 00 LDY #&00 ; unpack_sprite_data_loop # Unpack &4948-&4d89 to &377c-&3fff &4436 b1 0f LDA (&0f),Y ; packed_address &4438 aa TAX &4439 0a ASL A &443a 0a ASL A &443b 0a ASL A &443c 0a ASL A &443d 91 0d STA (&0d),Y ; unpacked_address &443f 8a TXA &4440 29 f0 AND #&f0 &4442 e6 0d INC &0d ; unpacked_address_low &4444 d0 02 BNE &4448 &4446 e6 0e INC &0e ; unpacked_address_high &4448 91 0d STA (&0d),Y ; unpacked_address &444a c8 INY &444b d0 04 BNE &4451 &444d e6 10 INC &10 ; packed_address_high &444f e6 0e INC &0e ; unpacked_address_high &4451 e6 0b INC &0b ; bytes_to_unpack_low &4453 d0 e1 BNE &4436 ; unpack_sprite_data_loop &4455 e6 0c INC &0c ; bytes_to_unpack_high &4457 d0 dd BNE &4436 ; unpack_sprite_data_loop &4459 20 98 7f JSR &7f98 ; copy_memory # Copy &0031 bytes from &78f9-&7929 to &0368-&0398 &445c f9 78 68 03 31 00 &4462 20 98 7f JSR &7f98 ; copy_memory # Copy &0031 bytes from &78f9-&7929 to &c440-&c470 &4465 f9 78 40 c4 31 00 &446b 20 98 7f JSR &7f98 ; copy_memory # Copy &0042 bytes from &792a-&796b to &0c5a-&0c9b &446e 2a 79 5a 0c 42 00 &4474 20 98 7f JSR &7f98 ; copy_memory # Copy &02cd bytes from &0e00-&10cc to &4abd-&4d89 &4477 00 0e bd 4a cd 02 &447d a5 00 LDA &00 ; use_sideways_ram &447f c9 fe CMP #&fe # &fe = no sideways RAM &4481 f0 10 BEQ &4493 ; no_sideways_ram &4483 a5 01 LDA &01 ; sideways_ram_slot # Swap in bank of sideways RAM &4485 85 f4 STA &f4 ; os_ram_copy_of_currently_selected_rom_number &4487 8d 30 fe STA &fe30 ; Paged ROM latch &448a 20 98 7f JSR &7f98 ; copy_memory # Copy &3000 bytes from &4abd-&7abc to &8000-&afff &448d bd 4a 00 80 00 30 ; no_sideways_ram &4493 20 98 7f JSR &7f98 ; copy_memory # Copy &0040 bytes from &7a1c-&7a5b to &c400-&c43f &4496 1c 7a 00 c4 40 00 ; process_digit_sprites &449c a0 00 LDY #&00 &449e 84 92 STY &92 ; previous_eor ; process_digit_sprites_loop # Process &00b0 bytes from &796c-&79ab to &0b00-&0baf &44a0 b9 6c 79 LDA &796c,Y ; unprocessed_digit_sprites &44a3 aa TAX &44a4 45 92 EOR &92 ; previous_eor &44a6 29 f0 AND #&f0 &44a8 99 00 0b STA &0b00,Y ; digit_sprites &44ab 86 92 STX &92 ; previous_eor &44ad c8 INY &44ae c0 b0 CPY #&b0 &44b0 d0 ee BNE &44a0 ; unpack_digit_sprites_loop ; initialise_vectors &44b2 a2 d9 LDX #&d9 &44b4 a0 24 LDY #&24 ; &24d9 = event_routine &44b6 8c 21 02 STY &0221 ; event_interrupt_vector_high &44b9 8e 20 02 STX &0220 ; event_interrupt_vector_low &44bc ac 05 02 LDY &0205 ; irq1_vector_high &44bf ae 04 02 LDX &0204 ; irq1_vector_low &44c2 8c 16 25 STY &2516 ; previous_irq1_vector_high &44c5 8e 15 25 STX &2515 ; previous_irq1_vector_low &44c8 a2 04 LDX #&04 &44ca a0 25 LDY #&25 ; &2504 = irq1_routine &44cc 8c 05 02 STY &0205 ; irq1_vector_high &44cf 8e 04 02 STX &0204 ; irq1_vector_low &44d2 ac 29 02 LDY &0229 ; keyboard_vector_high &44d5 ae 28 02 LDX &0228 ; keyboard_vector_low &44d8 8c a4 21 STY &21a4 ; previous_keyboard_vector_high &44db 8e a3 21 STX &21a3 ; previous_keyboard_vector_low &44de a2 9e LDX #&9e &44e0 a0 21 LDY #&21 ; &219e = keyboard_routine &44e2 8c 29 02 STY &0229 ; keyboard_vector_high &44e5 8e 28 02 STX &0228 ; keyboard_vector_low ; configuration_patches # Check for presence of strings in sideways RAM &44e8 a9 00 LDA #&00 ; "** FireTrack ** by Orlando.(C) Aardvark Software 1987." &44ea a2 00 LDX #&00 &44ec a0 b1 LDY #&b1 ; &b100 # Copyright string would occupy &b100 - &b135 &44ee 20 f4 41 JSR &41f4 ; check_for_match_against_configuration_strings &44f1 90 41 BCC &4534 ; configuration_strings_check_failed &44f3 a9 46 LDA #&46 ; "KEYS" &44f5 a2 40 LDX #&40 &44f7 a0 b1 LDY #&b1 ; &b140 # "KEYS" string would occupy &b140 - &b144 &44f9 20 f4 41 JSR &41f4 ; check_for_match_against_configuration_strings &44fc 90 0f BCC &450d ; skip_first_patch &44fe a2 45 LDX #&45 &4500 a0 b1 LDY #&b1 ; &b145 # Alternative keys would occupy &b145 - &b148 &4502 84 97 STY &97 ; patch_address_high &4504 86 96 STX &96 ; patch_address_low &4506 a2 09 LDX #&09 # Change second set of keys &4508 a0 05 LDY #&05 &450a 20 0d 42 JSR &420d ; patch_control_routine_address_table ; skip_first_patch &450d a9 3e LDA #&3e ; "DEVICE" &450f a2 50 LDX #&50 &4511 a0 b1 LDY #&b1 ; &b150 # "DEVICE" string would occupy &b150 - &b156 &4513 20 f4 41 JSR &41f4 ; check_for_match_against_configuration_strings &4516 90 0f BCC &4527 ; skip_second_patch &4518 a2 57 LDX #&57 &451a a0 b1 LDY #&b1 ; &b157 # Alternative joystick would occupy &b157 - &b15c &451c 84 97 STY &97 ; patch_address_high &451e 86 96 STX &96 ; patch_address_low &4520 a2 15 LDX #&15 # Change second joystick routine address and arguments &4522 a0 07 LDY #&07 &4524 20 0d 42 JSR &420d ; patch_control_routine_address_table ; skip_second_patch &4527 a9 37 LDA #&37 ; "MUSIC" &4529 a2 60 LDX #&60 &452b a0 b1 LDY #&b1 ; &b160 # "MUSIC" string would occupy &b160 - &b165 &452d 20 f4 41 JSR &41f4 ; check_for_match_against_configuration_strings &4530 a9 20 LDA #&20 ; JSR &4532 b0 02 BCS &4536 ; set_instructions ; configuration_strings_check_failed &4534 a9 2c LDA #&2c ; BIT ; set_instructions &4536 8d 85 26 STA &2685 ; use_alternative_sound_instruction # allowing for alternative_timer_instruction at &b166 &4539 8d 6a 25 STA &256a ; use_alternative_timer_instruction # and alternative_sound_instruction at &b168 ; &453c a9 40 LDA #&40 # Disable interrupts from User VIA Timer 1 &453e 8d 6e fe STA &fe6e ; User VIA interrupt enable register &4541 a2 00 LDX #&00 # Set User VIA Timer 1 to single interrupt &4543 8e 6b fe STX &fe6b ; User VIA auxilliary control register &4546 8e 64 fe STX &fe64 ; User VIA timer 1 counter LSB &4549 e8 INX &454a 8e 65 fe STX &fe65 ; User VIA timer 1 counter MSB # Set User VIA Timer 1 to time-out in 256 ticks ; wait_for_timer1 # then wait for it to time-out, counting loops &454d 2c ff ff BIT &ffff # 4 cycles &4550 24 00 BIT &00 # 3 cycles &4552 e8 INX # 2 cycles &4553 2c 6d fe BIT &fe6d ; User VIA interrupt flag register # 4 cycles &4556 50 f5 BVC &454d ; wait_for_timer1 # 3 cycles if branch taken, i.e. 16 cycles per loop &4558 e8 INX &4559 8a TXA &455a 09 0f ORA #&0f &455c 8d db 22 STA &22db ; screen_tweak_delay_length # Use result to calibrate screen tweak ; &455f a2 1b LDX #&1b # offset = &1b, length = &05, osbytes_two &4561 a0 05 LDY #&05 &4563 20 2e 48 JSR &482e ; do_osbytes_from_table &4566 a9 0c LDA #&0c ; PLAYER_STRAIGHT &4568 8d 42 0f STA &0f42 ; player_sprite_type &456b 20 97 21 JSR &2197 ; set_scrolling_paused_and_plot_rows_of_background &456e a9 01 LDA #&01 # Clear System VIA CA2 (keyboard) interrupt flag &4570 8d 4d fe STA &fe4d ; System VIA interrupt flag register &4573 20 43 22 JSR &2243 ; timer2_frame_routine # Start interrupt-driven scrolling routine &4576 58 CLI &4577 ea NOP &4578 a9 07 LDA #&07 &457a 85 2a STA &2a ; seven &457c a9 f0 LDA #&f0 &457e 85 4b STA &4b ; unused # Unused variable &4580 a9 0a LDA #&0a &4582 85 4c STA &4c ; ten &4584 a9 00 LDA #&00 &4586 85 24 STA &24 ; previous_control_type &4588 a9 0f LDA #&0f &458a 85 3b STA &3b ; function_key_check_cooldown &458c a9 ff LDA #&ff &458e 85 2c STA &2c ; scrolling_paused_but_game_continuing &4590 85 74 STA &74 ; block_number_of_stage_map &4592 85 75 STA &75 ; block_number_of_music &4594 a9 80 LDA #&80 # Start on Baseworld "Cygni" by default &4596 85 84 STA &84 ; starting_stage &4598 a2 00 LDX #&00 &459a a0 40 LDY #&40 &459c 8c 51 03 STY &0351 ; os_address_of_top_left_of_screen_high &459f 8e 50 03 STX &0350 ; os_address_of_top_left_of_screen_low &45a2 84 07 STY &07 ; screen_start_address_high &45a4 86 06 STX &06 ; screen_start_address_low &45a6 a9 07 LDA #&07 &45a8 85 02 STA &02 ; screen_vertical_scroll &45aa 85 03 STA &03 ; screen_new_vertical_scroll &45ac 20 5c 1e JSR &1e5c ; set_crtc_start_address_from_screen_start_address &45af a9 16 LDA #&16 &45b1 85 8b STA &8b ; block_number_of_desired_music &45b3 a2 bd LDX #&bd &45b5 a0 4a LDY #&4a ; &4abd = start_of_relocatable_blocks &45b7 20 36 42 JSR &4236 ; add_offset_to_relocatable_blocks_addresses &45ba 20 98 7f JSR &7f98 ; copy_memory # Copy &0003 bytes from &1e84-&1e86 to &425d-&425f &45bd 84 1e 5d 42 03 00 # (store original &1e84) &45c3 20 98 7f JSR &7f98 ; copy_memory # Copy &0003 bytes from &424f-&4251 to &1e84-&1e86 &45c6 4f 42 84 1e 03 00 # &1e84 becomes to_copy_block_A_to_address_in_zero_page_X &45cc a9 2c LDA #&2c ; BIT # Remove all calls to null_function in both versions &45ce 8d 7d 2b STA &2b7d ; call_to_null_function_instruction_one &45d1 8d 75 2a STA &2a75 ; call_to_null_function_instruction_two &45d4 8d 69 2a STA &2a69 ; call_to_null_function_instruction_three &45d7 8d 59 20 STA &2059 ; call_to_null_function_instruction_four &45da a9 15 LDA #&15 ; Disable VDU &45dc 20 ee ff JSR &ffee ; OSWRCH &45df a9 ff LDA #&ff &45e1 85 0a STA &0a ; use_normal_top_and_bottom_groups # Disable changes to video registers in frame routine &45e3 ad 1b 06 LDA &061b ; launch_map_foreground_colour &45e6 48 PHA &45e7 ad 1c 06 LDA &061c ; launch_map_background_colour &45ea 48 PHA &45eb a9 00 LDA #&00 &45ed 8d 1b 06 STA &061b ; launch_map_foreground_colour &45f0 8d 1c 06 STA &061c ; launch_map_background_colour &45f3 20 2a 21 JSR &212a ; reset_stage_variables &45f6 20 d4 31 JSR &31d4 ; reset_enemies_and_bullets &45f9 20 e7 29 JSR &29e7 ; initialise_stage &45fc 68 PLA &45fd 8d 1c 06 STA &061c ; launch_map_background_colour &4600 68 PLA &4601 8d 1b 06 STA &061b ; launch_map_foreground_colour &4604 a9 06 LDA #&06 ; Enable VDU &4606 20 ee ff JSR &ffee ; OSWRCH &4609 e6 0a INC &0a ; use_normal_top_and_bottom_groups # Re-enable changes to video registers in frame routine &460b 20 98 7f JSR &7f98 ; copy_memory # Copy &0003 bytes from &425d-&425f to &1e84-&1e86 &460e 5d 42 84 1e 03 00 # &1e84 becomes copy_address_of_block_A_into_zero_page_X &4614 a5 00 LDA &00 ; use_sideways_ram &4616 c9 ff CMP #&ff # &ff = sideways RAM present &4618 d0 03 BNE &461d ; standard_version_initialisation &461a 4c b7 46 JMP &46b7 ; enhanced_version_initialisation ; standard_version_initialisation &461d 20 98 7f JSR &7f98 ; copy_memory # Copy &0009 bytes from &4260-&4268 to &1908-&1910 &4620 60 42 08 19 09 00 # (replace title_screen_routine) &4626 20 98 7f JSR &7f98 ; copy_memory # Copy &0012 bytes from &42ad-&42be to &2059-&206a &4629 ad 42 59 20 12 00 # (replace end_screen_routine) &462f a9 2c LDA #&2c ; BIT &4631 8d aa 2a STA &2aaa ; call_to_update_world_name_and_tiles # Standard version uses single set of tiles &4634 a9 ff LDA #&ff &4636 85 0a STA &0a ; use_normal_top_and_bottom_groups # Disable changes to video registers in frame routine &4638 85 56 STA &56 ; use_hexagonal_background &463a a9 00 LDA #&00 ; unpack_background_sprites_code_relocatable_block &463c a2 b5 LDX #&b5 # This has been copied from &0e00 at &4474 &463e a0 14 LDY #&14 ; &14b5 = unrelocated_unpack_background_sprites_code &4640 20 81 1e JSR &1e81 ; copy_block_A_to_address_X_Y &4643 a9 15 LDA #&15 ; Disable VDU &4645 20 ee ff JSR &ffee ; OSWRCH &4648 a9 00 LDA #&00 # Initialise tiles used for CommSpace stage as well &464a 8d ac 16 STA &16ac ; start_of_tiles_to_always_initialise_list &464d a2 04 LDX #&04 # Use Dustworld for all stages in standard version &464f 20 51 2b JSR &2b51 ; use_map_X &4652 20 d8 2a JSR &2ad8 ; initialise_map_data &4655 a9 02 LDA #&02 &4657 20 3d 15 JSR &153d ; update_world_name_and_tiles # Called with X = map, A = big target variant &465a a9 06 LDA #&06 ; Enable VDU &465c 20 ee ff JSR &ffee ; OSWRCH &465f e6 0a INC &0a ; use_normal_top_and_bottom_groups # Re-enable changes to video registers in frame routine &4661 a9 04 LDA #&04 # Set all three starting stages to have four lives &4663 8d cb 1e STA &1ecb ; stage_starting_values_table + 6 &4666 8d d2 1e STA &1ed2 ; stage_starting_values_table + 13 &4669 8d d9 1e STA &1ed9 ; stage_starting_values_table + 20 &466c a9 0a LDA #&0a ; map_0_data # Use Dustworld for all regular stages &466e a2 29 LDX #&29 &4670 a0 13 LDY #&13 ; &1329 = map_data &4672 8c 02 06 STY &0602 ; map_0_address_high &4675 8e 01 06 STX &0601 ; map_0_address_low &4678 8c 06 06 STY &0606 ; map_1_address_high &467b 8e 05 06 STX &0605 ; map_1_address_low &467e 8c 0a 06 STY &060a ; map_2_address_high &4681 8e 09 06 STX &0609 ; map_2_address_low &4684 8c 0e 06 STY &060e ; map_3_address_high &4687 8e 0d 06 STX &060d ; map_3_address_low &468a 20 81 1e JSR &1e81 ; copy_block_A_to_address_X_Y &468d a9 12 LDA #&12 ; map_4_data # Use CommSpace 1 for all CommSpace stages &468f a2 3f LDX #&3f &4691 a0 17 LDY #&17 ; &173f = standard_commspace_map_data &4693 8c 12 06 STY &0612 ; map_4_address_high &4696 8e 11 06 STX &0611 ; map_4_address_low &4699 8c 16 06 STY &0616 ; map_5_address_high &469c 8e 15 06 STX &0615 ; map_5_address_low &469f 20 81 1e JSR &1e81 ; copy_block_A_to_address_X_Y &46a2 20 98 7f JSR &7f98 ; copy_memory # Copy &0039 bytes from &4268-&42a0 to &1e81-&1eb9 &46a5 68 42 81 1e 39 00 # &1e81 becomes a null function &46aa 20 98 7f JSR &7f98 ; copy_memory # Copy &006e bytes from &7ba4-&7c11 to &0d31-&0d9f &46ae a4 7b 31 0d 6e 00 # (encrypted_completion_message) &46b4 4c c3 46 JMP &46c3 ; both_versions_initialisation ; enhanced_version_initialisation &46b7 a2 43 LDX #&43 &46b9 a0 35 LDY #&35 ; &3543 = &8000 - &4abd # Relocatable blocks start at &8000 &46bb 20 36 42 JSR &4236 ; add_offset_to_relocatable_blocks_addresses &46be a5 01 LDA &01 ; sideways_ram_slot &46c0 8d ad 1e STA &1ead ; use_sideways_ram_slot + 1 # Use sideways RAM when copying blocks ; both_versions_initialisation &46c3 a9 00 LDA #&00 ; Return host/OS in X &46c5 a2 ff LDX #&ff &46c7 20 f4 ff JSR &fff4 ; OSBYTE &46ca e0 03 CPX #&03 &46cc 90 29 BCC &46f7 ; isn't_master &46ce a5 00 LDA &00 ; use_sideways_ram &46d0 c9 ff CMP #&ff # &ff = sideways RAM present &46d2 d0 09 BNE &46dd ; no_sideways_ram &46d4 20 98 7f JSR &7f98 ; copy_memory # Copy &000c bytes from &42a1-&42ac to &1e84-&1e8f &46d7 a1 42 84 1e 0c 00 # This sets &1e84 to copy_block_A_to_address_at_zero_page_X ; no_sideways_ram &46dd a2 40 LDX #&40 &46df a0 c4 LDY #&c4 ; &c440 = sideways_ram_map_launch &46e1 8c 1a 06 STY &061a ; map_launch_address_high &46e4 8e 19 06 STX &0619 ; map_launch_address_low &46e7 a2 00 LDX #&00 &46e9 a0 c4 LDY #&c4 ; &c400 = sideways_ram_multiplication_table &46eb 84 01 STY &01 ; sideways_ram_multiplication_table_address_high &46ed 86 00 STX &00 ; sideways_ram_multiplication_table_address_low &46ef a9 00 LDA #&00 &46f1 8d ef 1d STA &1def ; multiplication_table_variable &46f4 8d f9 1d STA &1df9 ; multiplication_table_variable ; isn't_master &46f7 a9 01 LDA #&01 &46f9 85 5b STA &5b ; music_beat_cooldown &46fb a9 63 LDA #&63 &46fd 85 4e STA &4e ; rnd &46ff a9 8e LDA #&8e &4701 85 4f STA &4f ; initialising_stars &4703 a9 18 LDA #&18 &4705 85 50 STA &50 ; wave_offset &4707 a9 00 LDA #&00 &4709 20 fa 2e JSR &2efa ; wipe_background_tiles &470c a9 00 LDA #&00 &470e a2 03 LDX #&03 ; zero_sound_channels_cooldown_loop &4710 95 61 STA &61,X ; sound_channels_cooldown &4712 ca DEX &4713 10 fb BPL &4710 ; zero_sound_channels_cooldown_loop &4715 4c 80 7f JMP &7f80 ; initialisation_part_four # &003b bytes copied from &4718-&4752 to &0880-&08ba at &43d9 ; check_joystick # A = channel, top bit indicates direction &0880 c9 80 CMP #&80 &0882 29 7f AND #&7f &0884 85 92 STA &92 ; channel &0886 08 PHP &0887 8a TXA &0888 48 PHA &0889 98 TYA &088a 48 PHA &088b a6 92 LDX &92 ; channel &088d a9 80 LDA #&80 ; Read I/O device or buffer status &088f 20 f4 ff JSR &fff4 ; OSBYTE &0892 86 94 STX &94 ; value_low &0894 84 95 STY &95 ; value_high &0896 68 PLA &0897 a8 TAY &0898 68 PLA &0899 aa TAX &089a 28 PLP # Carry is top bit of original A &089b a5 92 LDA &92 ; channel &089d f0 12 BEQ &08b1 ; check_joystick_buttons &089f a5 95 LDA &95 ; value_high &08a1 b0 07 BCS &08aa ; right_or_down &08a3 c9 33 CMP #&33 &08a5 b0 07 BCS &08ae ; leave_with_minus_one # Was the joystick sufficiently to the left or up? ; leave_with_zero &08a7 a9 00 LDA #&00 # No movement or fire occurred &08a9 60 RTS ; right_or_down &08aa c9 cd CMP #&cd &08ac b0 f9 BCS &08a7 ; leave_with_zero # Was the joystick sufficiently to the right or down? ; leave_with_minus_one &08ae a9 ff LDA #&ff # Movement or fire occurred &08b0 60 RTS ; check_joystick_buttons &08b1 a5 94 LDA &94 ; value_low &08b3 90 01 BCC &08b6 ; skip_shift &08b5 4a LSR A ; skip_shift &08b6 4a LSR A &08b7 90 ee BCC &08a7 ; leave_with_zero # Was fire pressed? &08b9 b0 f3 BCS &08ae ; leave_with_minus_one ; configuration_strings ; &00 &4753 2a 2a 20 46 69 72 65 54 72 61 63 6b 20 2a 2a 20 ; "** FireTrack ** by Orlando.(C) Aardvark Software 1987." &4763 62 79 20 4f 72 6c 61 6e 64 6f 2e 28 43 29 20 41 &4773 61 72 64 76 61 72 6b 20 53 6f 66 74 77 61 72 65 &4783 20 31 39 38 37 2e 00 ; &37 &478a ff 4d 55 53 49 43 00 ; "MUSIC" ; &3e &4791 ff 44 45 56 49 43 45 00 ; "DEVICE" ; &46 &4799 ff 4b 45 59 53 00 ; "KEYS" ; initialisation_part_one &479f a9 81 LDA #&81 ; Scan for a particular key &47a1 a2 dc LDX #&dc ; "T" &47a3 a0 ff LDY #&ff &47a5 20 f4 ff JSR &fff4 ; OSBYTE &47a8 8a TXA &47a9 30 2f BMI &47da ; skip_check_for_sideways_ram # If "T" pressed, don't check for sideways RAM &47ab a9 ff LDA #&ff &47ad 8d 38 fe STA &fe38 ; os_network_nmi_disable # Disable network interrupts &47b0 a9 00 LDA #&00 &47b2 8d 30 ff STA &ff30 ; os_paged_rom_id &47b5 a2 0f LDX #&0f # Find sideways RAM by checking each slot in turn ; check_for_ram_in_invalid_rom_slots_loop &47b7 bd a1 02 LDA &02a1,X ; os_paged_rom_type_table # 0 if valid ROM not present, otherwise ROM type &47ba d0 05 BNE &47c1 ; skip_valid_slot # Don't check slots with valid ROMs &47bc 20 08 48 JSR &4808 ; check_if_rom_slot_is_ram &47bf 30 1c BMI &47dd ; found_ram ; skip_valid_slot &47c1 ca DEX &47c2 10 f3 BPL &47b7 ; check_for_ram_in_invalid_rom_slots_loop &47c4 a2 0f LDX #&0f ; check_for_ram_in_valid_rom_slots_loop &47c6 bd a1 02 LDA &02a1,X ; os_paged_rom_type_table &47c9 f0 05 BEQ &47d0 ; skip_invalid_slot # Don't check slots without valid ROMs &47cb 20 08 48 JSR &4808 ; check_if_rom_slot_is_ram &47ce 30 0d BMI &47dd ; skip_further_checks # Stop checking once sideways RAM found ; skip_invalid_slot &47d0 ca DEX &47d1 10 f3 BPL &47c6 ; check_for_ram_in_valid_rom_slots_loop &47d3 a2 ff LDX #&ff &47d5 20 08 48 JSR &4808 ; check_if_rom_slot_is_ram &47d8 30 03 BMI &47dd ; skip_further_checks # Stop checking once sideways RAM found ; skip_check_for_sideways_ram &47da a9 fe LDA #&fe # No sideways RAM found &47dc aa TAX ; skip_further_checks &47dd 86 01 STX &01 ; sideways_ram_slot # &fe if no sideways RAM present &47df 85 00 STA &00 ; use_sideways_ram # &ff if using sideways RAM, &fe if not &47e1 20 bf 42 JSR &42bf ; reset_vectors &47e4 a9 ea LDA #&ea ; Read/Write Tube present flag # Disable Tube &47e6 a2 00 LDX #&00 &47e8 a0 00 LDY #&00 &47ea 20 f4 ff JSR &fff4 ; OSBYTE &47ed a9 00 LDA #&00 ; Identify Host/Operating System &47ef a2 01 LDX #&01 ; Return host/OS in X &47f1 20 f4 ff JSR &fff4 ; OSBYTE &47f4 e0 03 CPX #&03 &47f6 b0 0d BCS &4805 ; is_master # Don't wipe page ROM table on Master &47f8 a2 0f LDX #&0f ; wipe_paged_rom_table_loop &47fa a9 00 LDA #&00 &47fc 9d f0 0d STA &0df0,X ; os_paged_rom_workspace_storage_locations &47ff 9d a1 02 STA &02a1,X ; os_paged_rom_type_table &4802 ca DEX &4803 10 f5 BPL &47fa ; wipe_paged_rom_table_loop ; is_master &4805 4c bc 41 JMP &41bc ; initialisation_part_two ; check_if_rom_slot_is_ram &4808 86 f4 STX &f4 ; os_ram_copy_of_currently_selected_rom_number &480a 8e 30 fe STX &fe30 ; Paged ROM latch # Swap in this slot &480d 2c ff ff BIT &ffff &4810 ac 00 80 LDY &8000 ; test_address &4813 a9 ff LDA #&ff &4815 8d 00 80 STA &8000 ; test_address &4818 2c 00 80 BIT &8000 ; test_address &481b 10 0a BPL &4827 ; not_writeable &481d ee 00 80 INC &8000 ; test_address &4820 d0 05 BNE &4827 ; not_writeable &4822 ee 00 80 INC &8000 ; test_address &4825 10 02 BPL &4829 ; writeable ; not_writeable &4827 a9 00 LDA #&00 # Leave with &00 in A and Y if slot isn't writeable ; writeable &4829 8c 00 80 STY &8000 ; test_address # Restore original value for test address &482c a8 TAY # Leave with &ff in A and Y if slot is writeable &482d 60 RTS ; do_osbytes_from_table &482e 86 96 STX &96 ; offset &4830 84 97 STY &97 ; length ; do_osbytes_from_table_loop &4832 bc 50 48 LDY &4850,X ; osbytes_table + 2 &4835 bd 4e 48 LDA &484e,X ; osbytes_table &4838 48 PHA &4839 bd 4f 48 LDA &484f,X ; osbytes_table + 1 &483c aa TAX &483d 68 PLA &483e 20 f4 ff JSR &fff4 ; OSBYTE &4841 18 CLC &4842 a5 96 LDA &96 ; offset &4844 69 03 ADC #&03 &4846 85 96 STA &96 ; offset &4848 aa TAX &4849 c6 97 DEC &97 ; length &484b d0 e5 BNE &4832 ; do_osbytes_from_table_loop &484d 60 RTS ; osbytes_table ; A X Y ; osbytes_one &484e 9a f4 00 ; Write to Video ULA control register # Change to MODE 2 without clearing screen &4851 ca 20 cf ; Read/Write Keyboard Status # Turn Caps Lock on, Shift Lock off &4854 76 00 00 ; Reflect keyboard status in LEDs &4857 e5 01 00 ; Read/Write ESCAPE key status # Insert ASCII value for ESCAPE &485a e6 01 00 ; Read/Write ESCAPE effects # Stop default ESCAPE effects &485d be 08 00 ; Read/Write ADC type # Use 8-bit resolution (faster) &4860 05 00 00 ; Select the printer type # Select printer sink &4863 8c 00 00 ; Select Tape FS &4866 14 00 00 ; Implode user defined character font RAM ; osbytes_two &4869 eb 00 00 ; Read/Write speech Processor Presence &486c d1 20 00 ; Read/Write speech suppression status # Disable speech &486f 0e 04 00 ; Enable Event # Enable v-sync event &4872 04 01 00 ; Define action of cursor editing keys # Cursor keys return ASCII values &4875 0b 00 00 ; Set Auto Repeat Delay # Disable auto repeat delay ; &0080 bytes copied from &4878-&48f7 to &7f80-&7fff at &41e8 ; initialisation_part_four &7f80 a9 00 LDA #&00 &7f82 8d 00 40 STA &4000 ; start of screen memory &7f85 85 79 STA &79 &7f87 20 98 7f JSR &7f98 ; copy_memory # Copy &3f87 bytes from &4000-&7f87 to &4001-&7f88 &7f8a 00 40 01 40 87 3f # i.e. wipe screen memory, &4001-&7f88 &7f90 a2 18 LDX #&18 &7f92 20 b0 2a JSR &2ab0 ; get_stage_X_foreground_and_background_colours &7f95 4c ec 1e JMP &1eec ; title_and_stage_screen ; copy_memory # Also callable at &7f98 after &41e8 &4890 68 PLA # Get calling address from stack &4891 85 90 STA &90 ; called_from_address_low &4893 68 PLA &4894 85 91 STA &91 ; called_from_address_high &4896 a0 06 LDY #&06 # Use next six bytes as a block of parameters &4898 b1 90 LDA (&90),Y ; called_from_address &489a 85 92 STA &92 ; bytes_to_copy_high &489c 88 DEY ; 5 &489d b1 90 LDA (&90),Y ; called_from_address &489f aa TAX ; bytes_to_copy_low &48a0 88 DEY ; 4 &48a1 b1 90 LDA (&90),Y ; called_from_address &48a3 85 99 STA &99 ; target_address_high &48a5 88 DEY ; 3 &48a6 b1 90 LDA (&90),Y ; called_from_address &48a8 85 98 STA &98 ; target_address_low &48aa 88 DEY ; 2 &48ab b1 90 LDA (&90),Y ; called_from_address &48ad 85 97 STA &97 ; source_address_high &48af 88 DEY ; 1 &48b0 b1 90 LDA (&90),Y ; called_from_address &48b2 85 96 STA &96 ; source_address_low &48b4 88 DEY ; 0 ; copy_memory_loop &48b5 b1 96 LDA (&96),Y ; source_address &48b7 91 98 STA (&98),Y ; target_address &48b9 8a TXA &48ba d0 02 BNE &48be ; not_page &48bc c6 92 DEC &92 ; bytes_to_copy_high ; not_page &48be ca DEX &48bf 8a TXA &48c0 05 92 ORA &92 ; bytes_to_copy_high &48c2 f0 0a BEQ &48ce ; finished_copying &48c4 c8 INY &48c5 d0 ee BNE &48b5 ; copy_memory_loop &48c7 e6 97 INC &97 ; source_address_high &48c9 e6 99 INC &99 ; target_address_high &48cb 18 CLC &48cc 90 e7 BCC &48b5 ; copy_memory_loop ; finished_copying &48ce 18 CLC # Calculate immediately address after six byte block &48cf a5 90 LDA &90 ; called_from_address_low &48d1 69 06 ADC #&06 &48d3 aa TAX &48d4 a5 91 LDA &91 ; called_from_address_high &48d6 69 00 ADC #&00 &48d8 48 PHA &48d9 8a TXA &48da 48 PHA # Push that address to stack &48db 60 RTS # so that execution returns to it # &0036 bytes copied from &48dc-&4911 to &0cc4-&0cf9 at &43eb ; sprite_address_low_table &0cc4 00 65 04 3f bb 51 cf 60 e8 5f dd fe 78 17 a8 45 &0cd4 d7 77 ; sprite_address_high_table &0cd6 00 00 01 01 01 02 02 03 03 04 04 04 05 06 06 07 &0ce6 07 08 ; sprite_width_table &0ce8 07 08 06 08 08 07 07 08 07 09 05 08 08 08 08 09 &0c98 08 01 # &0012 bytes copied from &4912-&4923 to &02ea-&02fb at &43f4 ; sprite_height_table &02ea 0f 14 0a 10 13 12 15 11 11 0e 07 10 14 13 14 11 &02fa 14 0d # &0024 bytes copied from &4924-&4947 to &03a7-&03ca at &43fd ; sprite_offset_x_table &03a7 fe fd fe fd fd fe fd fe fe fd ff fd fe fd fe fd &03a9 fe 00 ; sprite_offset_y_table &03b9 fb fa fc fb fa fa fa fa fa fa fe f9 f9 f7 f9 f7 &03c9 f9 fc ; packed_sprite_data # One nibble per byte, lowest first, i.e. a2 -> 20 a0 &4948 a2 fb ff 57 01 00 00 00 00 20 ba 77 77 55 01 44 &4958 64 ee fb ff ff bf 06 90 39 93 33 66 00 00 22 62 &4968 66 cc cc cc cc 04 00 40 c4 cc cc 88 08 44 cc cc &4978 8c 08 00 00 50 f1 ff ff ff 1f 05 00 50 f5 77 e7 &4988 ff ff ff 7e 77 5f 35 33 33 c3 33 33 33 3c 33 33 &4998 83 c8 99 69 cc cc cc 96 99 8c c8 cc cc c6 cc cc &49a8 cc 6c cc cc cc cc cc cc cc cc cc cc cc cc 0c 80 &49b8 c8 cc cc cc cc cc 8c 08 00 00 00 80 88 88 88 08 &49c8 00 00 10 71 77 17 01 b3 33 33 33 3b 20 32 33 23 &49d8 02 c4 cc cc cc 4c c8 cc cc cc 8c 00 80 88 08 00 &49e8 b1 bb bb 00 00 00 00 00 d9 7d d7 dd 41 00 00 b0 &49f8 ff bf ff bf ff bb 2a 22 be 33 99 39 e3 82 2a 42 &4a08 d6 dd dd cc cc 44 44 c4 6c 66 66 cc cc cc 44 04 &4a18 cc cc cc cc 8c 00 00 00 c8 cc cc 00 00 00 00 10 &4a28 77 77 55 15 00 00 00 ba bb 9b fe bf bb ff 7f 15 &4a38 00 70 77 77 6b bb 66 bb bb 6b b1 bb eb 39 93 99 &4a48 33 63 82 00 c8 6c 33 33 66 c6 cc cc 4c 40 cc cc &4a58 cc cc cc cc cc cc 88 88 c8 cc cc cc cc 88 08 00 &4a68 00 00 80 88 08 00 00 00 00 f0 5f 05 00 00 00 00 &4a78 00 00 30 bb fb ff 55 55 15 00 20 ea ee 3e e3 9e &4a88 bb eb 2a 02 90 33 63 66 00 00 00 00 40 64 c6 cc &4a98 cc cc cc 44 44 04 c0 cc cc cc 88 88 00 00 00 c0 &4aa8 8c 88 00 00 00 00 00 10 b3 bb bb 3b 54 01 00 00 &4ab8 00 00 88 22 36 77 dd ff 7f 17 11 01 00 00 60 f3 &4ac8 7f bb ee f7 bb eb 26 31 bb bb bb b3 bf 66 88 08 &4ad8 00 80 28 62 66 c6 cc cc cc cc cc 44 40 44 cc cc &4ae8 cc cc cc 88 88 08 80 cc cc cc 8c 88 08 00 00 00 &4af8 00 11 e6 aa aa fa 4d 01 50 b7 aa 7b 4d 04 f5 0b &4b08 12 0f 00 14 3d 33 6e 0c 00 2f c1 f7 4e 8c be d7 &4b18 7d ab 84 82 fe dd dd d5 29 02 cc 40 cc 8c cc cc &4b28 04 40 c4 80 cc 4c 00 80 c8 cc 8c 00 00 80 88 88 &4b38 88 88 00 00 e1 bb bb 1e 00 00 00 00 80 dc 77 dd &4b48 55 f5 ee 55 00 90 66 66 bb b6 eb 9e a3 3a 7d ff &4b58 d7 09 48 66 08 00 68 c6 6c c6 cc cc cc 4c 04 c8 &4b68 cc 8c 88 c8 cc 88 00 c8 cc cc 8c 00 00 00 00 10 &4b78 75 ff ff ff ff 57 81 b2 bb bb bb bb 2b 08 40 44 &4b88 d6 6d 44 04 c0 cc cc fc cf cc cc 0c 90 dd 7f f7 &4b98 dd 09 60 fb ff ff ff ff bf 06 20 22 66 66 22 02 &4ba8 40 c4 cc cc cc cc 4c 84 c8 cc cc cc cc 8c 08 50 &4bb8 5f 00 ea b3 e3 0a 80 86 00 44 cc 4c 04 80 8c 00 &4bc8 10 11 14 55 15 11 00 00 b3 ff 6b be d3 ff 37 f5 &4bd8 ff d3 ff 7f 69 bb 06 b6 6b 6c bb 6b f3 dd 43 c0 &4be8 6c bb 69 cc 6c 6e 8c cc cc cc cc cc cc cc 0c c0 &4bf8 cc cc cc cc cc cc 08 00 88 cc cc 88 00 00 00 20 &4c08 aa ea bb eb 2a 00 00 00 00 00 00 11 6d 33 49 01 &4c18 51 55 75 77 f7 ff ff ff ff 7f 00 00 28 22 e2 bb &4c28 bf ff eb 8b 00 00 40 44 44 9c f7 6b cc 44 88 88 &4c38 c8 6c ee ee ee ee 6e cc 00 00 00 00 00 88 cc cc &4c48 88 00 00 00 00 40 44 c4 cc 4c 44 00 71 77 17 f7 &4c58 7f 37 04 00 00 e3 bb 9e 73 77 67 39 77 17 91 f7 &4c68 3f f7 ff ff 7b ff ff 6b b6 fb 6d fb ff 9b e6 eb &4c78 c6 cc cc 76 d7 9d 66 fb 9f c3 8c c0 cc b6 bb 6b &4c88 c6 66 c6 0c 00 c0 cc cc cc cc cc cc 08 00 00 80 &4c98 88 88 88 88 00 00 00 10 55 55 55 55 15 00 00 00 &4ca8 00 00 00 99 6d 93 04 00 51 55 75 77 f7 ff ff ff &4cb8 ff 17 00 00 28 22 bb fb bf ff eb 2e 00 00 44 14 &4cc8 55 7d f7 7f 9d 04 88 88 cc cc cc cc cc cc cc cc &4cd8 00 00 00 00 80 cc cc 8c 08 00 00 00 00 80 88 88 &4ce8 88 88 08 00 11 71 ff ff 57 01 00 40 b3 6e bb fb &4cf8 ff 6b 77 c1 73 3f f7 ff 37 d9 ff 6b 6c bb b6 ff &4d08 bf 76 77 97 cc 79 ff 6d 66 f9 ff bf c3 6c fb ff &4d18 ff 63 bb bb c6 c0 cc 66 66 c6 cc cc cc 00 c8 cc &4d28 cc cc cc cc 8c 00 00 80 cc cc cc 08 00 00 00 51 &4d38 55 55 55 55 01 00 00 00 00 00 10 e9 ff 97 04 10 &4d48 55 55 77 77 ff ff ff ff 7f 07 00 00 28 22 aa ea &4d58 fb bf ae 0a 00 00 44 11 91 39 33 99 49 84 88 88 &4d68 cc cc cc cc cc cc cc 08 00 00 00 00 80 cc cc 8c &4d78 08 00 00 00 00 88 88 88 88 88 08 10 55 55 55 55 &4d88 55 15 # Relocatable block &04 # &00aa bytes copied from &4d8a-&4e33 to &82cd-&8376 at &448a in enhanced version # to &140b-&14b4 at &16a2 in both versions ; tiles_to_background_sprites_table # Two sprites per tile, top bit set for flipped sprite &4d8a 00 00 ; tile &00 = TILE_SPACE &4d8c 01 02 ; tile &01 = TILE_TRIANGLE_BR &4d8e 03 04 ; tile &02 = TILE_TRIANGLE_BL &4d90 84 83 ; tile &03 = TILE_TRIANGLE_TL &4d92 82 81 ; tile &04 = TILE_TRIANGLE_TR &4d94 05 06 ; tile &05 = TILE_MEDIUM_TARGET_ONE &4d96 07 06 ; tile &06 = TILE_MEDIUM_TARGET_ONE_RIGHT &4d98 08 09 ; tile &07 = TILE_TRENCH_TOP &4d9a 0a 0b ; tile &08 = TILE_TRENCH_TOP_RIGHT &4d9c 09 0c ; tile &09 = TILE_TRENCH_BOTTOM &4d9e 0b 0d ; tile &0a = TILE_TRENCH_BOTTOM_RIGHT &4da0 86 06 ; tile &0b = TILE_BACKGROUND_SQUARE &4da2 0e 0e ; tile &0c = TILE_BACKGROUND_FILL &4da4 09 09 ; tile &0d = TILE_TRENCH_MIDDLE &4da6 0b 0b ; tile &0e = TILE_TRENCH_MIDDLE_RIGHT &4da8 00 0f ; tile &0f = TILE_BEVEL_TL &4daa 00 10 ; tile &10 = TILE_BEVEL_T &4dac 11 91 ; tile &11 = TILE_BEVEL_L &4dae 8f 00 ; tile &12 = TILE_BEVEL_BL &4db0 12 00 ; tile &13 = TILE_BEVEL_B &4db2 13 00 ; tile &14 = TILE_BEVEL_BR &4db4 14 94 ; tile &15 = TILE_BEVEL_R &4db6 00 93 ; tile &16 = TILE_BEVEL_TR &4db8 15 95 ; tile &17 = TILE_REACTOR &4dba 14 16 ; tile &18 = TILE_BEVEL_INSIDE_BL &4dbc 96 94 ; tile &19 = TILE_BEVEL_INSIDE_TL &4dbe 17 18 ; tile &1a = TILE_BEVEL_INSIDE_TR &4dc0 11 97 ; tile &1b = TILE_BEVEL_INSIDE_BR &4dc2 86 19 ; tile &1c = TILE_MEDIUM_TARGET_ONE_TOP &4dc4 86 87 ; tile &1d = TILE_MEDIUM_TARGET_ONE_TOP_RIGHT &4dc6 1a 1b ; tile &1e = TILE_MEDIUM_TARGET_TWO_RIGHT &4dc8 1c 1b ; tile &1f = TILE_BACKGROUND_HEX &4dca 1d 1b ; tile &20 = TILE_MEDIUM_TARGET_TWO &4dcc 1e 9e ; tile &21 = TILE_PLUS &4dce 1f 9f ; tile &22 = TILE_MULTIPLY &4dd0 20 21 ; tile &23 = TILE_BIG_TARGET_ONE &4dd2 22 23 ; tile &24 = TILE_BIG_TARGET_ONE_MIDDLE &4dd4 24 25 ; tile &25 = TILE_BIG_TARGET_ONE_RIGHT &4dd6 1c 26 ; tile &26 = TILE_MEDIUM_TARGET_TWO_TOP &4dd8 1c 27 ; tile &27 = TILE_MEDIUM_TARGET_TWO_TOP_RIGHT &4dda a1 a0 ; tile &28 = TILE_BIG_TARGET_ONE_TOP &4ddc a3 22 ; tile &29 = TILE_BIG_TARGET_ONE_TOP_MIDDLE &4dde a5 24 ; tile &2a = TILE_BIG_TARGET_ONE_TOP_RIGHT &4de0 28 29 ; tile &2b = TILE_GIRDER_VERTICAL &4de2 95 15 ; tile &2c = TILE_UNUSED &4de4 2a aa ; tile &2d = TILE_TANK &4de6 2b 2c ; tile &2e = TILE_ANTENNA &4de8 2d 2e ; tile &2f = TILE_GIRDER_HORIZONTAL &4dea 2f 30 ; tile &30 = TILE_TARGET_RESERVOIR_TOP &4dec 31 32 ; tile &31 = TILE_TARGET_RESERVOIR_TOP_RIGHT &4dee b0 af ; tile &32 = TILE_TARGET_RESERVOIR &4df0 b2 b1 ; tile &33 = TILE_TARGET_RESERVOIR_RIGHT &4df2 33 34 ; tile &34 = TILE_EARTH &4df4 35 b5 ; tile &35 = TILE_SMALL_TARGET &4df6 36 b6 ; tile &36 = TILE_TARGET_BALL &4df8 37 b7 ; tile &37 = TILE_TARGET_BALL_RIGHT &4dfa 38 39 ; tile &38 = TILE_ICE &4dfc 3a 3b ; tile &39 = TILE_DUST &4dfe 3c 3d ; tile &3a = TILE_SPIKE_WITH_SHADOW &4e00 3e 3f ; tile &3b = TILE_SPIKE &4e02 40 41 ; tile &3c = TILE_SPIKE_WITH_SHADOW_RIGHT &4e04 42 43 ; tile &3d = TILE_QUESTION &4e06 44 45 ; tile &3e = TILE_DESTROYED &4e08 46 47 ; tile &3f = TILE_BIG_TARGET_TWO_TOP &4e0a 48 49 ; tile &40 = TILE_BIG_TARGET_TWO &4e0c 4a 4b ; tile &41 = TILE_BIG_TARGET_TWO_TOP_MIDDLE &4e0e cb ca ; tile &42 = TILE_BIG_TARGET_TWO_MIDDLE &4e10 4c 4d ; tile &43 = TILE_BIG_TARGET_TWO_TOP_RIGHT &4e12 4e 4f ; tile &44 = TILE_BIG_TARGET_TWO_RIGHT &4e14 50 51 ; tile &45 = TILE_BIG_TARGET_THREE_TOP &4e16 d1 d0 ; tile &46 = TILE_BIG_TARGET_THREE &4e18 52 53 ; tile &47 = TILE_BIG_TARGET_THREE_TOP_MIDDLE &4e1a e3 d2 ; tile &48 = TILE_BIG_TARGET_THREE_MIDDLE &4e1c 54 55 ; tile &49 = TILE_BIG_TARGET_THREE_TOP_RIGHT &4e1e d5 d4 ; tile &4a = TILE_BIG_TARGET_THREE_RIGHT &4e20 56 57 ; tile &4b = TILE_BIG_TARGET_FOUR_TOP &4e22 58 59 ; tile &4c = TILE_BIG_TARGET_FOUR &4e24 5a 5b ; tile &4d = TILE_BIG_TARGET_FOUR_TOP_MIDDLE &4e26 db 5c ; tile &4e = TILE_BIG_TARGET_FOUR_MIDDLE &4e28 5d 5e ; tile &4f = TILE_BIG_TARGET_FOUR_TOP_RIGHT &422a 5f 1b ; tile &50 = TILE_BIG_TARGET_FOUR_RIGHT &4e2c 60 61 ; tile &51 = TILE_TRIANGLE_TR_HEX &4e2e 62 63 ; tile &52 = TILE_TRIANGLE_TL_HEX &4e30 64 65 ; tile &53 = TILE_TRIANGLE_BL_HEX &4e32 66 67 ; tile &54 = TILE_TRIANGLE_BR_HEX # Relocatable block &06 # &0340 bytes copied from &4e34-&5173 to &8377-&86b6 at &448a in enhanced version # to &1454-&1793 at &13be in both versions ; packed_background_sprite_data_part_one ; low nibbles high nibbles &4e34 f0 a0 f0 a0 f0 50 a0 f0 00 00 50 50 a0 f0 a0 f0 ; sprite &00 sprite &34 &4e44 f0 f0 50 00 50 00 50 f0 50 00 a0 a0 50 f0 50 a0 ; 88 88 8 ; 8 88 ; 88 8 88 ; 8 8 8 ; 888 8 8 ; 888 88 ; 8 8 8 8 ; 8888888 &4e54 1f 8a d1 d1 d1 d1 d1 d1 3f f3 f3 b3 d3 d3 83 83 ; sprite &01 sprite &35 &4e64 3f f3 f3 73 a3 a6 a6 ad 2a 0f a6 ad ad 0f 0f 0f ; 8888888 ...... ; 8 ....88 o 8888 ; ......o o888888 ; .....o8 o88..88 ; .....o8 o8o88 8 ; ....o88 o8o88 ; ....o88 o8o 8 ; ...o888 o8o 8 &4e74 31 31 31 31 31 34 74 7d 33 a6 36 7d ed ff df df ; sprite &02 sprite &36 &4e84 3d 3f 3f bf ff ff ff ff 3f 3f af 3f 3f 0f af af ; ...o888 ........ ; ..o8888 ..8 .... ; ..o8888 ......8 ; .o88888 ...88... ; .o88888 ..8o88.. ; o888888 ..8888 ; o888888 .8o8888 ; o8888888 .8o8888 &4e94 3f 30 30 3a 7a 3f 1f 0f 3f a3 33 31 11 30 20 0a ; sprite &03 sprite &37 &4ea4 3f 33 33 13 03 03 03 01 3a 3f 77 37 37 37 17 07 ; 8888888 ........ ; ....88 ..8 .... ; .....8 .......8 ; 8 ....8 .... ... ; 8 ....8 .8 . .. ; 88 ...8 .... .. ; 88 ...8 .. . ; 888 ..8 &4eb4 FF 5f ef ef ff ff ff ef fa ff 8f 5f ff ff ff 8f ; sprite &04 sprite &38 &4ec4 f1 f0 80 fa ea ff cf ff f7 87 f7 f5 55 f5 55 ff ; 888 ..8 88888888 ; 8888 .8 88888o ; 8888 .8 8oo o 88 ; 88888 8 8o 88888 ; 88888 8 88888o 8 ; 888888 8 88888888 ; 888888 8 8888oo 8 ; 88888888 8oo 8888 &4ed4 ff fa f1 f1 81 f1 f1 f1 fe f6 86 f6 f3 f3 c3 f3 ; sprite &05 sprite &39 &4ee4 8a fa fa cd ec fc 56 f3 f0 f0 f0 50 5a fc ec fa ; 888o8 8888o 88 ; 8 .o8 88888888 ; ..o8 88o 8888 ; ..oo8 8888oo 8 ; ...oo8 o 888o 8 ; ...oooo 88888888 ; ....ooo 88oo 88o ; .....8 88888888 &4ef4 31 11 71 71 31 31 3a 7f 33 33 a3 13 33 33 33 af ; sprite &06 sprite &3a &4f04 33 33 a3 33 73 33 f3 3f 37 a7 37 37 17 37 1f 3a ; ......8 ........ ; ......8 .....8 ; ......8 .88 8 .. ; ......8 .8 ..... ; ......8 .....8 . ; ......8 ........ ; 8 ....88 ....88 . ; 8888888 .88 .... &4f14 33 33 33 34 ac 3c 3d 30 3d 3d ad 3d 3a 3a f0 33 ; sprite &07 sprite &3b &4f24 a0 30 30 f0 70 31 13 33 30 35 35 17 17 37 77 37 ; ..o8 ....8 .. ; ..o8 8 ........ ; ..o8 8 ..8 .... ; oo8 .8 ....88 . ; oo8 .8 8 ...8 . ; oo8 ..8 ........ ; o8 ...8 ..88 ..8 ; .....8 ........ &4f34 f7 f3 eb e7 4b f7 eb e7 e7 fb 57 83 cb c7 cb d7 ; sprite &08 sprite &3c &4f44 5f fb 87 83 83 c2 f2 f2 ff 8f f7 5b 83 a0 80 00 ; .8.88888 888o 888 ; ..8.8.88 888888o ; 8..8.8.8 8o 8o 88 ; .8....8. 8oo o 8 ; 8.8..... oooo o ; .8.8. 88oooo8 ; 8.8.. 8ooo88o ; .8.8. 8oo888 &4f54 cb f7 fb f7 8b f7 fb f7 cb c7 cb e7 eb e7 cb f7 ; sprite &09 sprite &3d &4f64 e2 d2 82 a2 42 52 52 f2 00 a0 00 50 50 f0 e0 f0 ; 8.8.. oooo8o ; .8.8. 88ooo88 ; 8.8.. 88ooo ; .8.8. 888o8 8 ; 8.8.. o 8o o 8 ; .8.8. 888o 888 ; 8.8.. 88oo 88o ; .8.8. 88888888 &4f74 fb 8f fb ff e3 e0 e0 e0 ef f7 ff ef 43 c1 c1 d1 ; sprite &0a sprite &3e &4f84 5f ff fb 57 5f 0f fb af fb f7 8f ff ff f7 5f 0f ; 8.88888. 888o 888 ; 88.888.8 o 888888 ; 8.888.88 888888o ; 8888.888 888o 888 ; ....8888 8o o 888 ; .88.8 8ooo 88 ; .8.88 8ooo88 8 ; .8888 8oo88 &4f94 c0 e0 f0 f0 f0 e0 f0 f0 d1 d1 c1 c1 81 51 f1 e1 ; sprite &0b sprite &3f &4fa4 ab af af 8b ef fb ff 5f 0f 57 ff fb f7 ff eb ff ; .8.88 ooo88 ; .88.8 8oo88 8 ; .8888 88oo8 88 ; .8.8. 88ooo 88 ; .88.8 88o 8o88 ; .8.88 8o 88888 ; .888. 8888888o ; .8888 888o 888 &4fb4 fb f7 8b f7 5b 07 0b 07 8b f7 fb e7 fb 57 0b 07 ; sprite &0c sprite &40 &4fc4 f2 f2 f2 53 e3 f7 0b 0f f0 80 f0 f3 5b f7 fb 5f ; 8.8.. 88o 8888 ; .8.8. 888888o ; 8.8.. o 888888 ; .8.8.... 888o 888 ; 8.8...8. 8888o 8 ; .8.8.8.8 88888 ; 8.8.8.8. 88 ; .8.88888 8 &4fd4 00 00 50 f3 ff ef fb ff 01 51 81 f3 ff 57 ff f7 ; sprite &0d sprite &41 &4fe4 ff fb ff ef 87 fb ff ff ff ef f7 5f ff ff 87 fb ; .8888 8888 ; .8.88 8888o ; .88.8 8o 8888 ; ....8888 88888o 8 ; 8888.888 8888o 88 ; 88.88.88 8o 88888 ; 8.8888.8 888888o ; 88.8888. 88888888 &4ff4 ff ef 4f 0f 0f 4f 4f 4f ff cf 0f 0f cf cf cf cf ; sprite &0e sprite &42 &5004 ff cf 4f 0f 8f 8f 4f 4f af ff df df df df df df ; 88888888 8888888 ; 88888888 8ooooo88 ; 88888888 o oo8 ; 88888888 o8 ; 88888888 ooo o8 ; 88888888 oooo o8 ; 88888888 ooo oo8 ; 88888888 ooo oo8 &5014 40 40 40 40 40 40 e0 f0 80 80 80 c0 80 80 c5 f5 ; sprite &0f sprite &43 &5024 c0 c0 c5 c5 cf c5 cb f3 d0 df db d7 d3 d3 ff aa ; oo ooo8 ; 88 oo ooo8 ; 88. oo ooo8 ; 8.8 oooooo8 ; 88.. oo ooo8 ; 8.. oo ooo8 ; 88.88 8ooooo88 ; 8..8 8888888 &5034 30 25 3b 67 b3 53 5b ef 10 2a 27 23 83 03 03 0f ; sprite &10 sprite &44 &5044 10 65 8b db 03 43 03 0f 20 0a 37 13 13 03 6f da ; .. . .. ; 88 88 . . .o ; 8..88..8 ... o .. ; .8..8... .o. o8 . ; ........ 8.o . ; ........ 8 o ; 8.....88 8 .o ; 8888888 8o o8 &5054 f0 40 f0 70 a0 40 60 30 05 0b 0f 20 95 25 25 1b ; sprite &11 sprite &45 &5064 03 0b 0b 5b e3 63 3b 13 fa af 87 17 07 27 87 27 ; 8..8 88 88 ; 8.8.88 o 8 ; 888..8 88 o ; 8..8 .8. 8 . ; 8...8 8 o.8o ; 8...8 o. .o. ; 88..8 .o. ..o ; 8....8 .. . .. &5074 3f 3a 33 33 77 ab 15 10 7f 73 73 a3 43 67 ca c0 ; sprite &12 sprite &46 &5084 1f 13 43 c3 eb cb 65 60 3a 6f c3 b3 93 d7 ea 80 ; 8888888 ...8 ... ; 8 ....88 ...8 ..o ; ........ ...8 ooo ; ........ ..8 oo8. ; .8..8... .8 o8oo. ; 8..88..8 8 .oooo8 ; 88 88 .oo.o8o ; .oo.oo &5094 1a 4a 43 e3 67 cf c0 c0 e3 c7 ca 67 6f c0 c0 c0 ; sprite &13 sprite &47 &50a4 da ca a0 80 80 00 00 c0 00 00 50 00 10 30 60 d0 ; 8 ..8 .8oo8 ; 8 .88 ooooo ; ..8 ooo8 8 ; ...8 8o.oo ; .888 .o.oo . ; 88 oooo .. ; oooo .o ; ooooooo8 &50b4 ca ca c1 61 61 e1 41 11 c7 c7 c3 67 6f c7 c3 e7 ; sprite &14 sprite &48 &50c4 ca 00 0f 8a 80 a0 ca da d0 60 30 10 10 00 00 00 ; 8 .88 ooooooo8 ; 8 .8 oooo .o ; ...88 oooo .. ; ..88 .o.oo . ; .88 .o.oo . ; ..8 8ooo8 ; ...8 ooooo ; ..88 .8oo8 &50d4 1f 1f 1a aa 75 3e 3c 3c cf c0 60 60 1a af 7d 7d ; sprite &15 sprite &49 &50e4 6f 60 c0 e0 c0 e0 10 10 8a e7 d5 95 b0 c0 60 30 ; 8888888 .oo.oo ; 88 .8 .oo.o8o ; 8 8 ..oooo8 ; 8 8 8 .o8oo. ; 88 .8 .oo8. ; 8o88 ..8 8ooo ; ooo8 ...8 ..o ; ooo8 ...8 ... &50f4 31 91 b1 c1 e1 d1 ba cf 77 03 37 b3 33 33 b3 3f ; sprite &16 sprite &4a &5104 1a 0f 07 2b b3 33 93 9f 30 30 00 0f 03 03 2f 2a ; ..88 ...8 ... ; ...88 o. .. ; ..8.8 8... ; ...8.88 oo8.. ; ....... 8o..8. ; ....... o8.... ; 8 ....88 8.8.o.. ; 8888888 oo..o.. &5114 8f 8b 83 87 8f 8a f0 f0 df 63 63 13 1b 15 0a 3a ; sprite &17 sprite &4b &5124 3f 33 b3 93 9b 9b 65 6b aa 3f 37 97 97 37 37 37 ; 8888888 o o8..8 ; 8.....88 o .o.... ; .......8 o .o8... ; .8.....8 o .o.o. ; 888.8..8 o .o.o. ; 8 88..8 o .o... ; 8 8.8 88 .o.. ; 8 8..8 88...o.. &5134 30 30 30 10 00 00 00 00 7b 75 75 a5 10 30 15 15 ; sprite &18 sprite &4c &5144 13 1b 13 a3 7b 3b 3b 33 37 37 37 37 17 a7 7f 7a ; 8....8 ...8 ... ; 88..8 ...8 ... ; 8...8 ...8 ... ; 8...8 .8 8 .. ; 8..8 ..8 . ; 8..8 ....8 ; 88.88 ....8 ; 8..8 ....8 &5154 01 01 01 01 01 21 2a 2f 03 03 03 03 06 06 06 0e ; sprite &19 sprite &4d &5164 33 36 3c 3c 5d 0a 1a 1a 77 7c 7c aa 10 30 30 30 ; ......8 ...8 ; ....ooo ...8 ; ...oooo ...8 ; ...oo8 ..8 ; ..oo8 8 . ; ..o8 . .. ; 8 .o8 . ... ; 888o8 . ... # Relocatable block &08 # &0340 bytes copied from &5174-&54b3 to &86b7-&89f6 at &448a in enhanced version # to &1454-&1793 at &13c7 in both versions ; packed_background_sprite_data_part_two &5174 2c 20 20 00 00 02 02 01 00 00 00 01 01 03 03 03 ; sprite &1a sprite &4e &5184 10 11 11 0a 77 33 33 33 33 33 33 33 11 aa 77 77 ; oo .. . ... ; ... . ... ; ... . ... ; .8 .. .. ; ..8 . .8 . ; . ....8 ..8 ; . .....8 ...8 ; ......8 ...8 &5194 01 01 01 0a 57 33 33 33 13 13 33 33 11 aa 77 77 ; sprite &1b sprite &4f &51a4 33 33 33 33 77 aa 11 11 77 77 77 aa 11 33 33 33 ; ......8 ....8 ; ......8 ....8 ; ......8 .....8 ; 8 ....8 ....8 ; .8 ..8 . 8 ..8 . ; ..8 8 .. ..8 8 .. ; ...8 ... ...8 ... ; ...8 ... ...8 ... &51b4 f3 a3 b3 d3 d7 4a 41 41 f7 07 07 3a 31 b3 b3 d3 ; sprite &1c sprite &50 &51c4 f1 11 01 0a 07 33 33 33 a3 f3 53 03 01 0a 07 37 ; ...8 ... 8888888 ; ...8 ... 8 .88 ; ...8 ... 8. 8 ; ..8 8 .. o8.. ; .8 ..8 . o8.. ; 8 ....8 o8... ; ......8 o8... ; ......8 oo8.... &51d4 46 13 13 13 17 1a b1 f1 dc c6 c7 ce c4 68 68 e3 ; sprite &1d sprite &51 &51e4 3c b6 bc dc d4 c4 c4 c6 30 32 32 63 61 e0 e0 d0 ; .ooooo oo8.... ; ...o.o. .oo8... ; ...8oo. .oo8... ; ..8ooo.. .ooo8.o ; .8 o o . .ooo8.o ; 8 o o ..ooo8o ; .o o 8..ooo8o ; ....o 888oooo8 &51f4 fe ac 1c 0c 0c 4c 4c 69 fc 3c 3c 69 49 c9 c9 d3 ; sprite &1e sprite &52 &5204 fc 6c 6c dc dc bc bc 33 aa ad ad 2d 2d 0d 0d 0d ; 8ooooo8 8888888 ; ooooooo8 8 ...o8 ; ooooooo8 ....o8 ; ooo.ooo8 .oo8. ; ooo.ooo8 oo8. ; ooo.ooo8 ooo8. ; ooo.ooo8 ooo8. ; o.....o8 .oo8.. &5214 cf ce c9 d9 d9 bc bc 3c df bc bc 3c 36 36 33 39 ; sprite &1f sprite &53 &5224 2f 2c 29 29 23 06 06 0c 0a 0f 0d 0d 0d 0d 0d 0d ; 8888888 ooo8. ; 8ooooo88 oo8.. ; o.ooo.o8 oo8.. ; o.ooo.o8 o8... ; o..o..o8 o8... ; oo.o.oo8 8... ; oo...oo8 8... ; ooo.ooo8 .... &5234 fe a4 14 14 14 14 14 04 fc 3c 3c 3c 3c 3c 3c 3c ; sprite &20 sprite &54 &5244 f7 37 37 37 37 37 37 37 ae fe 7e 7e 7e 7e 7e 7e ; 8ooo.88o 8888888 ; ooo.88o 8 ....88 ; ooo.88o ......8 ; ooo.88o ......8 ; ooo.88o ......8 ; ooo.88o ......8 ; ooo.88o ......8 ; ooo.88o .....8 &5254 04 04 04 04 04 01 0a 0f 3c 3c 3c 1c 1c 1c 16 0f ; sprite &21 sprite &55 &5264 37 36 3c 3c 3c 3c 3c ff 7c 79 73 7c 7c 7c fc aa ; ooo.8oo .....8 ; ooo.oo. .....8 ; ooooo.. .....8 ; ooooooo ....8 ; ooooooo ....8 ; .oooooo ....8 ; 8 .ooooo ...88 ; 8888888 888 &5274 3c 3c 3c 3c 7c ac 1c 1c 7c 7c 7c ac 1c 3c 3c 3c ; sprite &22 sprite &56 &5284 19 19 19 a9 69 69 c9 c9 67 67 c7 c7 c7 d7 d7 b7 ; ooooo..8 ...8 ..o ; ooooo..8 ...8 ..o ; ooooo..8 ...8 .oo ; ooooo..8 ..8 8 oo ; ooooo..8 .8 ..ooo ; ooooo..8 8 ...oo8 ; ooooo..8 ...ooo8 ; ooooo..8 ...oo8. &5294 1c 13 1f ac 6c 6c cc cf 6c 6f cf cc cc dc dc bf ; sprite &23 sprite &57 &52a4 cc de df bc bc 3c 3c 3f b7 39 3c 3c 2c 2c 0c 0a ; oooooo.8 ..ooo8. ; ..888oo. ..oo8.. ; 888888oo .ooo8.. ; oooooooo 8 oo8... ; oooooooo .ooo8.. ; oooooooo .oo8... ; oooooooo ooo8.. ; 8888888 oo8... &52b4 cc cc 6c 6c 7c ac 1c 1c b8 d8 d8 c8 c8 c8 68 68 ; sprite &24 sprite &58 &52c4 30 30 30 b0 b0 d0 d0 c0 00 00 20 20 30 30 30 b0 ; ooo oo8... ; ooo ooo8.. ; ooo .oo8... ; ooo .ooo8.. ; ooo .8oo8... ; ooo 8 ooo8.. ; ooo ..oo8.. ; ooo ..ooo8. &52d4 1c 1c 1c ac 7c 3c 38 3f 38 38 38 38 18 a0 73 7f ; sprite &25 sprite &59 &52e4 c0 c0 60 60 71 a3 13 1f b5 d5 d7 c7 c7 c7 6f 6a ; ooo 8 ...oo8. ; ooo 8 ...ooo8 ; ooo .8 ....oo8 ; ooo .8 8 ...ooo ; ooo ..8 .8 ..8oo ; oo ...8 ..8 8 oo ; o ....88 ...8 ..o ; 8888888 ...8 ..o &52f4 21 21 31 3a 37 b3 b3 76 53 08 08 06 24 2a 36 3c ; sprite &26 sprite &5a &5304 16 14 14 04 0c 0c 06 0c 30 30 30 31 33 12 02 00 ; ....o . 8 ... ; .o o . ... ; .o o .. ... ; 8 .o o . .. .. ; .8 ooo.. ... .. ; ..8 oo. 8.. . ; ...o.o. 8... ; .ooooo .8.. &5314 71 62 c2 c0 40 40 10 3c 33 b3 b3 d1 d1 c0 c0 c0 ; sprite &27 sprite &5b &5324 23 23 33 33 37 ba b1 d0 07 07 07 0a 21 23 33 33 ; ......8 .8... ; . .....8 .o8.. ; . .....8 oo8... ; ...8 ooo8.. ; ..8 . oo8... ; 8 .. ooo8.. ; ... .oo8... ; oo .. ..ooo8.. &5334 75 b5 b5 35 35 35 25 27 32 3a 27 2a 02 02 02 52 ; sprite &28 sprite &5c &5344 05 0f 01 0f 55 05 15 15 02 52 52 a2 12 32 32 33 ; 8. 8. .8.. ; 88 88. 8... 8 ; 8.8 .. 8.. 8 ; 88 88. ... 8 ; 8. 8. .. 8 . ; 8. 8. .. .. ; 8. 8. . ... ; .8. 8.. . 8 ... &5354 37 35 35 35 75 a5 15 35 72 7a 77 aa 12 32 32 32 ; sprite &29 sprite &5d &5364 15 1f 11 af 75 35 35 35 33 32 32 32 12 a2 72 72 ; .8. 8.. ...8 ... ; 88 88. ...8 ... ; 8.8 .. ...8 ... ; 88 88. ..8 8 .. ; 8. 8. .8 ..8 . ; 8. 8. 8 ....8 ; 8. 8. ......8 ; 8. 8. .......8 &5374 10 14 04 04 0d 0d 0d 0d 3d 3b 3b 3b 13 13 53 53 ; sprite &2a sprite &5e &5384 33 33 33 33 73 a3 13 13 70 72 72 a2 13 33 33 33 ; o8.. ......8 ; o8.... ......8 ; o8.... .....8 ; o8.... ....8 ; o8...... ..8 . ; o8...... .8 .. ; o8...... 8 ... ; o8...... 8 ... &5394 00 00 00 00 01 01 11 11 50 50 53 13 32 30 30 34 ; sprite &2b sprite &5f &53a4 10 10 10 a6 76 39 39 30 30 30 30 30 10 a0 72 72 ; 8 ... ; 8 ... ; .. 8 ... ; ...o .8 .. ; .. .o ...8 . ; . o. ....8 ; . o.. ......8 ; . o . ......8 &53b4 d1 60 61 35 75 a0 10 10 f0 f2 f3 d1 d2 6b 6b 30 ; sprite &2c sprite &60 &53c4 f0 f0 f1 f3 f2 f0 f2 d0 f2 f2 f0 f0 f0 f0 f0 f0 ; . . o8888888 ; . . .o888888 ; ... . .o888888 ; 8 ... ..o88888 ; 8. . .8o88888 ; 8. 8 .o8888 ; 8.. ..o8888 ; ...o888 &53d4 10 1f 13 a5 7a 3a 35 3f 3a 3f 33 35 10 a0 75 7f ; sprite &2d sprite &61 &53e4 d0 6f 63 35 7a aa 15 1f fa ff f3 d5 d0 60 65 3f ; 8 8 ...o888 ; 88888888 ....o88 ; ........ ....o88 ; 8 8 8 8 8 ....o8 ; 8 8 .8 ..8o8 ; 8 8 ..8 8 .o ; 8 8 8 8 ...8 ..o ; 88888888 ...8 ... &53f4 f3 f5 f0 f0 f5 ff fb f0 f3 f5 fa fa f5 ff f3 a0 ; sprite &2e sprite &62 &5404 f3 f5 f0 a0 a5 0f 0b 10 a3 05 0a 1a 15 af 73 70 ; ........ 8888888 ; 8 8 8 8 888888 ; 8 8 888888 ; 8 8 88888 . ; 8 8 8 8 88888 . ; 88888888 8888 8 ; 8...8... 8888 .8 ; 888 ..8 &5414 ff ff f5 a1 a5 01 05 11 af 03 03 1b 1b af 76 7e ; sprite &2f sprite &63 &5424 1f 3b 3b 3b 77 a7 1c 10 7f 77 77 a7 17 37 3c 30 ; 88888888 888 ..8 ; 88..8..8 88 ...8 ; 8..8..8 88 ...8 ; .8.8..8 8 ...8 ; 88..8.8 8 ..8 . ; .88.8.8 8 8 .. ; 8.ooooo .8 ... ; .8o ..8 ... &5434 15 01 05 a1 a5 f1 f5 f1 76 7e 76 0e 16 0e 06 ae ; sprite &30 sprite &64 &5444 10 10 10 a0 70 30 30 10 30 30 30 30 11 a4 79 79 ; 8.o ..8 ... ; .8o .8 ... ; 8.o .8 ... ; .8o 8 8 .. ; 8.o . 8 ..8 . ; .8o o 88 ..8 ; 8.o o. 88 ...8 ; .8o o. 888 ..8 &5454 ff f3 f3 f3 f3 f3 fc f0 af f7 f7 fb fb fb fc f0 ; sprite &31 sprite &65 &5464 1f 03 03 a7 a7 fb f9 f9 7a 7f 7f 07 17 07 07 af ; 8888888 888 ..8 ; ...8..88 8888 .8 ; ...8..88 8888 .8 ; ..8..8.8 88888 ; ..8..8.8 88888 . ; ..8.8..8 888888 ; ooooo..8 888888 ; o.88 8888888 &5474 30 30 30 30 72 a2 13 13 70 70 70 a0 10 30 3c 34 ; sprite &32 sprite &66 &5484 1d 19 19 ad 7c 68 6c d4 37 67 67 df dd fd fd f5 ; o8.8 ...8 ... ; o..8 ...8 ..o ; o..8 ...8 ..o ; o888 ..8 8 o8 ; . ooo8 .8 ..8o8 ; . o o8 8 ...o88 ; ..ooooo8 ....o88 ; .. o o 8 ...o888 &5494 15 15 1a aa 7f 6a 6f d5 3f 60 60 df da ff fa f0 ; sprite &33 sprite &67 &54a4 d5 f0 fa fa ff ff f0 f5 fa ff f5 f5 f0 f5 ff fa ; 888 88 ...o888 ; 8 88 ..o8888 ; 8 8 8 ..o8888 ; 8 888 8 8 o88888 ; 888 88 .8o88888 ; 8 8888 8 .o888888 ; 888 88 .o888888 ; 8 88 o8888888 # Relocatable block &0a # &0416 bytes copied from &54b4-&58c9 to &89f7-&8e0c at &448a in enhanced version # or to &1329-&173e at &468a in standard version ; map_0_data &54b4 e9 03 ; compressed map data length = &3e9 &54b6 06 ; plus 6 bits &54b7 14 ; compression table has 20 entries: &54b8 04 e2 b8 49 c3 d0 20 10 43 c8 18 08 60 38 50 30 ; 001 => tile &18, 3 bits &54c8 da 68 28 71 ; 010 => tile &1b, 2 bits &54cc 0b 0e 47 1f 09 3c 38 28 0d 10 24 34 57 ac ec b7 ; 011 => tile &00, 4 bits &54dc 0a 4c 67 f7 ; 101 => tile &08, 3 bits ; 110 => tile &1c, 2 bits ; 0000 => tile &19, 0 bits ; 1111 => tile &09, 1 bit ; 00100 => tile &03, 0 bits ; 01000 => tile &02, 0 bits ; 10100 => tile &01, 0 bits ; 11000 => tile &04, 0 bits ; 11100 => tile &1a, 0 bits ; 000111 => tile &17, 0 bits ; 001100 => tile &0d, 0 bits ; 010111 => tile &0c, 0 bits ; 100111 => tile &05, 0 bits ; 0101100 => tile &07, 0 bits ; 0110111 => tile &06, 0 bits ; 1101100 => tile &0a, 0 bits ; 1110111 => tile &0e, 1 bit ; &54e0 fb a9 db 2f ec dc 1c 6e ec dd d6 fc 77 d8 e5 7f ; 0000000000000000000000000000000000000000 &54f0 de 0c cd 33 91 e5 66 66 7e 68 b8 9b e1 97 7a b7 ; 000000000000001c1c0000000000000000000000 .. &5500 7a 28 2a 22 17 b8 d5 2b 02 68 20 32 89 59 bd 22 ; 000000000000001c1c1c00000000000000000000 ... &5510 c0 8f 14 29 1f 3d 82 ff 2b 12 c3 03 37 a2 ff a3 ; 00000000001c17<<1c1c00000000000000000000 .[].. &5520 22 e1 f6 1a 15 0f 55 89 0d dc aa 78 05 ab 08 f0 ; 0000001c1c1c^^<<1c1c1c000000000000000000 ...[]... &5530 3f dc aa 78 05 bb c0 0f b9 19 7e e4 86 1f 32 81 ; 0000001c09090917<<1c1c1c0000000000000000 ....[]... &5540 9d fd ff 91 1f fa c0 71 b3 74 dc 9b 69 e0 f9 fc ; 00000909091c1c^^<<1c1c1c0000000000000000 .....[]... &5550 32 fb fd 44 ec 17 81 d8 0f 54 b0 1f a8 60 ad 03 ; 001c091c1818181c1c1c1a<<1c00000000000000 .........*.. &5560 3c 17 81 c0 6f 2e 1f da ca e4 7a cc 54 26 cd 2b ; 1c090918181818181c1a<<1c1c00000000000000 .........*... &5570 86 32 10 41 71 be 62 29 12 d1 bc 62 2a aa e3 17 ; 04091818181818181c1c1c1c1c1c000000000000 .............. &5580 5b d5 6d 45 20 ba 60 aa 45 93 ac 55 54 ac 55 50 ; 0902181818081818181c1c181c1c000000000000 .............. &5590 5c c5 56 33 d5 58 05 c5 dd 58 06 5b 58 88 a4 99 ; 090818190808191818181c18181c000000000000 ...*..*....... &55a0 ab 68 2f a2 bd 4a f6 03 b9 9f 88 fd 26 d8 4f 92 ; 090818040903081818181818181a<<0000000000 .............*. &55b0 fd e2 0a f6 81 28 a2 b1 02 52 24 63 51 5c af c8 ; 0903040909090818181c1a<<181c1c0000000000 ..........*.... &55c0 86 81 f8 f0 48 93 cd 44 f1 09 7d 77 c9 4c 04 a2 ; 0109090909020818181a<<1c1c1c0c0000000000 .........*....+ &55d0 a0 ef 4c 86 ea 7a d9 54 c0 8b d6 e2 7a c1 5a 05 ; 08090208080818181c1c1c181c1c000000000000 .............. &55e0 f0 c6 22 10 c5 f9 b6 12 8a 37 57 4c 41 f7 a2 38 ; 08090807<<081804090917<<1c1c000000000000 ..........[].. &55f0 f7 6a 3f 50 81 db 0f c4 65 f6 8b c2 ee 01 0a bb ; 0809080a<<080409021c^^<<1c00000000000000 ..........[]. &5600 fe 47 e1 c6 00 8d 9d 9e dd 65 a6 a2 f1 4b 11 14 ; 04090306<<0409021c181c1c1c00000000000000 ............. &5610 a7 db 8a a4 30 63 91 34 6e 2d 02 a6 30 73 11 14 ; 090909090909021c1c1c1c000000000000000000 ........... &5620 6e 2f dc 7e 61 f6 fb fd c2 ec 27 7c bf 00 e0 73 ; 1c1c1c1c181c1c1a<<1c00000000000000000000 .......*.. &5630 ee f8 96 83 03 cb 57 dc 71 ee c0 00 5f 70 03 1c ; 1c1c1a<<1c1c1c1c1c0000000000000000000000 ..*...... &5640 0c 07 e0 7e c0 c1 72 cf 0d 58 6e 02 c7 0d 70 30 ; 181c1c1c1c1a<<00000000000000000000000000 .....*. &5650 dc 81 49 4c 02 96 73 1f b8 d0 04 26 32 89 c9 f3 ; 00000c1c00000000000000000000000000000000 +. &5660 d8 44 ee 30 a1 c9 5c e0 4d 62 02 77 d8 c4 1c de ; 000000000000000000000000000000000000001b . &5670 7b ef dd e1 bd f7 de 1e 2e b2 87 f7 2e f4 e6 f0 ; 000000000000000000000000000000000000181b .. &5680 2e f5 f6 b0 a9 3f bc 0b 2d 78 6f 32 70 8d f7 e0 ; 00000000000000000000000000000000001b1b18 ... &5690 12 08 1a 53 39 f0 8d 49 fa ce 55 e6 ff ff ff ff ; 00000000000000000000000000000000001b1b18 ... &56a0 ff 93 22 e9 e8 43 77 f4 a1 86 3e 12 55 f7 15 7d ; 00000000000000000000000000001b1b1b1b1804 ...... &56b0 59 73 d7 d1 b0 2f 54 11 95 aa 51 05 c8 22 eb 24 ; 0000000000000000000000000000001b181b0409 ..... &56c0 68 09 99 68 54 a0 15 a8 41 24 41 6b 3d 08 b4 08 ; 0000000000000000000000000000001b1b1b0902 ..... &56d0 b4 00 b9 51 a0 65 a0 c5 46 4b d0 72 04 72 22 17 ; 0000000000000000000000001b1b1b18180c090d .....+.x &56e0 6a a5 37 6a 29 02 31 12 53 b9 1f 88 fd 7e bf df ; 00000000000000000000001b1b1b181808080908 ......... &56f0 ef f7 fb a9 d9 4f cc da 6c ec c8 4c cc c2 2e fc ; 0000000000000000001b1b1b181b180805<<0908 .......[].. &5700 c4 2d bc 37 95 f7 a6 f0 b6 b8 2b 5c 63 0a d3 d8 ; 000000000000000000001b18181b0808^^<<0908 ......[].. &5710 22 a9 ce e2 ac 4c 93 54 af 6f 82 22 60 bd 92 e9 ; 00000000000000000000001b08080817<<090908 ....[]... &5720 f0 23 4d c2 7e d5 59 9c ff c1 cb 6e ff 17 af a0 ; 0000000000000000000000001b1b08^^<<080808 ...[]... &5730 0f 65 e5 7f f0 5f 5e 40 f9 5f 93 77 aa 7a a2 c8 ; 0000000000000000000000001b181b0808080818 ........ &5740 0b 55 a8 42 14 4f 34 b1 16 8d 28 9e 96 91 d6 e2 ; 00000000000000000000001b1b1b1b1b08081818 ......... &5750 69 9d 68 05 ea 69 99 5c 1a 24 3c 75 c5 22 d1 ea ; 00000000000000000000000000001b1b18181808 ...... &5760 a9 d8 84 57 72 fd 97 f9 3c ba 22 f7 5f 1e ff e7 ; 00000000000000000000000000001b1b18080c08 ....+. &5770 52 6f b2 e7 c0 26 8e 3b 30 d1 f3 1e ec ff ff 7b ; 0000000000000000000000001b1b1b1b0d080808 ....x... &5780 03 de 3d 6f b9 37 dc 7e 0b de 9b c0 81 7b de 83 ; 000000000000000000000000001b1b18080e<<<< ....[]. &5790 09 5c e2 02 f3 4c e2 5d 1e 98 97 99 c0 e5 79 9e ; 000000000000000000000000001b1b1b18^^<<<< ....[]. &57a0 e7 79 9e e7 e9 95 27 57 de 64 4c d6 44 4c d4 05 ; 0000000000000000000000001900001b18180808 * ..... &57b0 5d d2 44 4d d0 f7 7d 4d 1a 82 1b dc 77 bf f8 c5 ; 0000000000000000000000000000001b1b181818 ..... &57c0 ef bb 47 49 83 d1 eb 3b 4a e8 47 18 f5 25 25 0d ; 000000000000000000000000000000001b181818 .... &57d0 46 7d 4d 3f ea fb be 2f f0 27 0d fe a4 24 05 fe ; 000000000000000000000000000000001b1b1818 .... &57e0 ef 7c cd 3b ff 23 05 a6 bf 7a cd ab 3e 2a e8 ff ; 00000000000000000000000000000000001b1b1b ... &57f0 1f 35 f4 ff 8f fa be fc a4 6f f1 6f e8 ff bf f9 ; 000000000000000000000000000000000000001b . &5800 ff a3 be f8 cd ef 71 f9 9b 5f 92 e6 91 ee 37 bf ; 0000000000000000000000000000000000000000 &5810 c3 af a1 8f 34 f8 a1 86 3e d2 e0 87 2a fa 08 7e ; 1800000000000000000000000000000000000000 . &5820 a8 a3 8f e0 87 4a fa 51 4b 3f ea fb be ef 5b 00 ; 1818000000000000000000000000000000000000 .. &5830 e8 01 a0 04 00 68 ce 0e 00 a0 fb 00 2d c0 af f0 ; 0c1800000000000000000000000000000000181b +. .. &5840 87 f6 6c e0 93 e6 a1 ea ac e9 6b 5e df be e6 f5 ; 08181818000000000000000000000000001b1b19 .... ..* &5850 05 fe ff bf e6 91 12 ff 7f d7 3c f2 1f 29 ae ff ; 03081818000000000000000000000000001b080c .... ..+ &5860 50 41 5f 43 5f 43 ff bf 6a 59 bc f2 7a 85 68 44 ; 090818181818000000000000000000181b090919 ...... ....* &5870 a3 3b d5 bc 42 6b d9 a9 e2 35 5a cb 46 c2 03 ad ; 0903080818181818000000000000001b08090903 ........ ..... &5880 b5 56 4f 6b 91 2d f4 d3 22 9f c8 27 f3 64 24 5e ; 01090e<<<<1818000000000000001b181b080109 ..[]... ...... &5890 1e 8e 82 97 87 23 f3 f2 a8 19 99 97 07 cd b9 61 ; 05<<^^<<<<18180000000000000000001b1b0c09 [][]... ..+. &58a0 cc 8b 1b d6 c6 3d 93 36 ec 66 63 ae 67 e2 e2 56 ; ^^<<1818181800000000000000000000001b1909 [].... .*. &58b0 5c 0b fb 5d 5e 4d dc 3b 1c cf 47 cf 70 6e d2 11 ; 18181800000000000000000000000000001b0c09 ... .+. &58c0 38 30 dc a5 4b bb 89 f6 fb 1d ; 1800000000000000000000000000001b1b181909 . ...*. ; 000000000000000000000000001b181b0805<<09 ....[]. ; 0000000000000000000000001b1b1b1908^^<<09 ...*.[]. ; 0000000000000000000000000000001b1b0d0801 ..x.. ; 000000000000000000000000000000001b0805<< ..[] ; 000000000000000000000000000000001b1b^^<< ..[] ; 00000000000000000000000000000000001b1b18 ... ; 1c1c00000000000000000000000000000000001b .. . ; 0c1c000000000000000000000000000000000000 +. ; 081c1c1c00000000000000000000000000000000 .... ; 1919081c1c1c0000000000000000000000000000 **.... ; 090917<<081c1c00000000000000000000000000 ..[]... ; 1919^^<<08081c1c1c0000000000000000000000 **[]..... ; 05<<080808080c1c00000000000000000000001b []....+. . ; ^^<<08081c1c1c1c000000000000000000001b18 []...... .. ; 0805<<1c1c0000000000000000000000001b1818 .[].. ... ; 08^^<<1c000000000000000000000000001b1818 .[]. ... ; 08081c1c00000000000000000000000000001b18 .... .. ; 0d081c0000000000000000000000000000001b18 x.. .. ; 081c1c000000000000000000000000000000001b ... . ; 1c1c000000000000000000000000000000000000 .. ; 1c00000000000000000000000000000000000000 . ; 0000000000000000000000000000000000000000 ; 00000000000000000000001c0000000000000000 . ; 00000000000000000000001a<<00000000000000 *. ; 000000000000000000000019191a<<0000000000 ***. ; 000000000000000000001a<<1c1c1a<<00000000 *...*. ; 00000000000000001a<<191c1c191c1c1c1a<<00 *.*..*...*. ; 00000000001a<<1c1c1a<<1a<<1c1c191c191a<< *...*.*...*.**. ; 00001a<<1c191a<<191c1a<<19191a<<1c1c1c1c *..**.*.*.***..... ; 001a<<191c1c1c1a<<1c1c1c1c1a<<1c191c1c1c *.*...*.....*..*... ; 1a<<1c181c1c1a<<1c191a<<191c1a<<1c1c191c *.....*..**.*.*...*. ; 18181c1818191c1c1c1a<<1a<<1c1c1c1c181c1c .....*...*.*........ ; 18181818181c181c1818181c18181c1818181818 .................... ; 1818181818181818181818181818181818181c18 .................... ; 18181c1c17<<1c18181818181c181818181c1c18 ....[].............. ; 1c1c1c1c^^<<1c18181c181c1c17<<1c1c1c1818 ....[].......[]..... ; 1c17<<1c1c1c1c1c1c1c1c1c1c^^<<1c1c1c1c1c .[]..........[]..... ; 1c^^<<1c1c1c1c1c1c17<<1c1c1c1c1c1c1c1c1c .[]......[]......... ; 1c1c1c1c1c1c1c1c1c^^<<1c1c1c1c1c17<<1c1c .........[].....[].. ; 1818181c1c1c17<<1c1c1c1c1c1c1c1c^^<<1c1c ......[]........[].. ; 18181818181c^^<<1c1c1c1c17<<1c1c1c1c1c1c ......[]....[]...... ; 1818181818181c1c1c1c1c1c^^<<1c17<<1c1c1c ............[].[]... ; 1818181818181c1c1c1c17<<1c1c1c^^<<1c1c1c ..........[]...[]... ; 18181818181c1c1c191c^^<<1c1c1c1c1c1c1c1c ........*.[]........ ; 18181818191c1c08081c1c1c1c1c1c1c1c191c1c ....*............*.. ; 1818191808081c0808081c1c191c1c1c1c08081c ..*.........*....... ; 18180808080808080808080808081c1c0808081c .................... ; 0909090909090909090909090909090909090308 .................... ; 1818080808080109020e<<<<0109020808010903 .........[]......... ; 1818180808080e<<<<^^<<<<0e<<<<0808080109 ......[].[].[]...... ; 181818180808^^<<<<0e<<<<^^<<<<0808080801 ......[].[].[]...... ; 181818181808080808^^<<<<08080808081b1b08 .........[]......... ; 18181808080808081b1b08081b1b08191b1b1b08 ...............*.... ; 18181818080808081b1b1b191b1b1b1b1b1b1b19 ...........*.......* ; 181818181b08081b1b181b1b1b1b1b1b191b1b00 ................*.. ; 1818181b1b1b191b1b1b1b1b1b1b1b1b1b1b1b00 ......*............ ; 181b1b1b1b1b181b1b1b1b1b191b1b1b00000000 ............*... ; 1b1b191b1b1b1b1b1b1b181b1b1b1b1b00000000 ..*............. ; 1b1b1b1b1b1b1b191b1b1b1b1b1b1b0000000000 .......*....... ; 191b1b1b0000001b1b1b00001b1b000000000000 *... ... .. ; 1b1b1b1b000000001b1b00000000000000000000 .... .. ; 1b181b00000000001b0000000000000000000000 ... . ; 1b1b1b0000000000000000000000000000000000 ... ; 1b00000000000000000000000000000000000000 . ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 1c00000000000000000000000000000000000000 . ; 1c00000000000000000000000000001c00000000 . . ; 1c1c1c00000000001c0000001c00001c1c1c0000 ... . . ... ; 1c1c1c1c0000001c1c00001c1c1c1c1c1c1c1c1c .... .. ......... ; 0808081c1c1c1c1c1c1c1c1c081c1c1c1c1c1c1c .................... ; 080e<<<<081c1c08081c081c08081c1c1c081818 .[]................. ; 08^^<<<<080805<<0805<<0808081c0808181808 .[]...[].[]......... ; 080809080808^^<<08^^<<080808080808180818 ......[].[]......... ; 07<<0908080808080d0808080804090308081818 ........x........... ; 0a<<0908080805<<0805<<090909190918181818 ......[].[]...*..... ; 06<<09090909^^<<08^^<<090801090218181818 ......[].[]......... ; 0808080808090909190909091818181818181818 ........*........... ; 0819080808080809090908081818181818181818 .*.................. ; 080808081b1b080808091b081818181818181818 .................... ; 081b1b081b1b081b08091b080818181818181818 .................... ; 1b1b1b1b1b08081b08091b1b1b1b1b1b1b181818 .................... ; 1b1b1b1b1b1b1b1b1b091b1b1b1b1b1b1b1b1818 .................... ; 1b1b1b1b1b1b191b1b091b1b1b1b1b1b1b18180c ......*............+ ; 1b1b1b1b191b1b1b19091b1b0c18181818181818 ....*...*...+....... ; 1b18181b1b1b1b1b1b091b1b181818181818181c .................... ; 18181818180c18180c090909181818181c1c1c1c .....+..+........... ; 18181818181818181818180c1818181c1c090909 ...........+........ ; 1818181818181818181818181818180909091c1c .................... ; 1818181818181c1c1c1c1c18181818091c1c191c ..................*. ; 1c1c18181c1c1a<<1c1c191c181818091c1c1c1c ......*...*......... ; 1c1c1c1c191c1c1c09090909090909091c1c1c1c ....*............... ; 1c191c1c1c1c1c1c091c1c1c1c1c1c1c1a<<1c1c .*..............*... ; 1c1c1c1a<<1c1c1c09091c1c1c191c1c1c1c1c1c ...*.........*...... ; 1c1c1c181c1c191c1c091c1c1c1c1c1c1c1c191c ......*...........*. ; 181c1c18181c1c181c091c18181c1c1c1c1c1c18 .................... ; 18181818181818181c09181818181c181c1c1818 .................... ; 1818181818181818181818181818181818181818 .................... ; 1818181818181818181818181818181818181818 .................... ; 1818181818181818181818181818181818181818 .................... ; 181818181818181818181818181818180c181818 ................+... ; 181818181818180c181818181818181808081818 .......+............ ; 18180d1818181808081818180d18181808080808 ..x.........x....... ; 1808080808181808081818180808180808080808 .................... ; 0808080808080808080808080808080808080808 .................... ; 0808080808080308080304080804080808080808 .................... ; 0808080808080909080909080909080808080808 .................... ; 0808080808080901030808040209080808080808 .................... ; 0808080808080103010909020402080808080808 .................... ; 0808080808080801030808040208080808080808 .................... ; 0808080808080808010909020808080808080808 .................... ; 0808080808080808080808080808080808080808 .................... ; 0808080808040909030808040909030808080808 .................... ; 03080409090905<<0908080905<<090909030804 ......[]....[]...... ; 010909080808^^<<09080809^^<<080808090902 ......[]....[]...... ; 0801090909090909020808010909090909090208 .................... ; 0808080808080808080808080808080808080808 .................... ; 0909030808080808080808080808080808040909 .................... ; 0808010909090909090808090909090909020808 .................... ; 0808080808080809090808090908080808080808 .................... ; 0804080808080809090808090908080808080308 .................... ; 0809030808080809090808090908080808040908 .................... ; 0801090308080409020808010903080804090208 .................... ; 0808010903040902080808080109030409020808 .................... ; 0808080109090208080808080801090902080808 .................... ; 0808080808080808080808080808080808080808 .................... ; 0808080808080808080808080808080808080808 .................... ; 0808081919190808080808080808191919080808 ...***........***... ; 080819191919080805<<08080808191919190808 ..****..[]....****.. ; 0808090919190808^^<<08080808191909090808 ....**..[]....**.... ; 080409091908080808080805<<08081909090308 ....*......[]..*.... ; 08090208080805<<080808^^<<08080808010908 ......[]...[]....... ; 080908080808^^<<080808080808080808080908 ......[]............ ; 0809080808080808080808040909090909090908 .................... ; 080903080808080804090909090e<<<<08080903 .............[]..... ; 09090903080c09090902080109^^<<<<08080109 .....+.......[]..... ; 080801090909090c080808080808081b1b1b0809 .......+............ ; 08080808080c09081b08081b08081b1b1b1b0808 .....+.............. ; 08081b1b080809081b1b1b1b1b1b1b1b1b1b1b08 .................... ; 0808081b1b080908081b1b1b1b1b1b1b1b1b1b1b .................... ; 08081b1b1b1909191b1b1b1b1b1b1b1b1b1b1b1b .....*.*............ ; 1b1b1b1b1b1b091b1b1b1b1b1b1b1b1b18181818 .................... ; 00001b1b1b1b091b1b1b1b1b1818181818181818 .................. ; 0000001b1b1b091b1b1b18181818181818181818 ................. ; 00000000001b0918181818181818181818181818 ............... ; 0000000000180918181818181818181818181818 ............... ; 00000000001c0918181818181818181818180808 ............... ; 00000000001c09181818181818181818080805<< .............[] ; 000000000d1c0918181818181818080807<<^^<< x.............[] ; 000000001c1c091c18181818181808080a<<0808 ................ ; 000000001c0c091c181818181818180806<<080c .+.............+ ; 00001c1c1c09091c1c1818181818181818080808 .................. ; 0000001c1c0917<<1c1c1a<<1818181818181818 ...[]..*......... ; 000000000009^^<<1c1a<<1a<<1c181818181818 .[].*.*........ ; 0000000000191c1c191c1a<<1c1c181818181818 *..*.*......... ; 000000000000000000001c1c1c00000000181818 ... ... ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 # Relocatable block &0c # &046b bytes copied from &58ca-&5d34 to &8e0d-&9277 at &448a in enhanced version ; map_1_data &58ca 46 04 ; compressed map data length = &446 &58cc 04 ; plus 4 bits &58cd 10 ; compression table has 16 entries: &58ce 04 42 c9 60 20 18 10 08 28 38 30 70 50 49 68 fb ; 11 => tile &08, 2 bits &58de 0d 07 3e 70 19 12 11 1a 28 26 36 20 2e 0c 50 38 ; 100 => tile &09, 1 bit ; 101 => tile &00, 4 bits ; 0001 => tile &02, 0 bits ; 0010 => tile &03, 0 bits ; 1001 => tile &04, 0 bits ; 1010 => tile &01, 0 bits ; 00000 => tile &0e, 0 bits ; 00110 => tile &07, 0 bits ; 01000 => tile &05, 0 bits ; 01110 => tile &0a, 0 bits ; 10110 => tile &06, 0 bits ; 11000 => tile &1f, 3 bits ; 11110 => tile &19, 1 bit ; 010000 => tile &0d, 0 bits ; 110000 => tile &0c, 0 bits ; &58ee fd 7e bf df 2f 4d 6d 9a e3 4d eb 7a e3 c1 de 94 ; 0000000000000000000000000000000000000000 &58fe ae 38 de 94 be 38 ad 49 99 7e 86 4a 7d 14 45 7d ; 0000000000000000000000000000000000000000 &590e 52 da a7 92 51 7e 8d 2b 9e 27 bf c5 c9 50 ef af ; 0000000000000000000000000000000000000000 &591e 77 9e 64 bc 69 fd a8 f7 63 4b ff 6b 50 09 a5 a4 ; 0000000000000000000000000000000000000000 &592e fc d8 92 a6 c4 af 29 5d 6a c8 af 6d 8d 86 c6 0f ; 0000000000080000000000000008000000000000 . . &593e ba da 82 6f fe 96 ff fa fd 7e bf 34 fd ca a1 fa ; 0000000008190800000000000008080000000000 .*. .. &594e 20 54 5d 34 9d 6d fc 9a ca 4f 61 53 de 4d e3 a7 ; 00000008190c1908000000000008080000000000 .*+*. .. &595e 70 19 2a 63 9c 19 f8 37 58 c7 5a fb 29 cf 97 92 ; 0000000008190800000000000808080800000000 .*. .... &596e 92 f2 1a cf 93 91 a1 a2 f2 3f 3c 2a 2a 19 19 93 ; 0000000000080000000000000804030800000000 . .... &597e f2 c7 a7 a1 a1 31 19 2a 3f 7c e6 cc 04 eb a1 e1 ; 0000000000000000000000000402010300000000 .... &598e 73 29 ee f8 f9 9c 86 3b fe e3 b3 67 8f ff f8 52 ; 0000000000000000000000080105<<0200000000 ..[]. &599e 52 52 8e ff 78 32 32 54 54 86 ff 78 54 54 32 32 ; 00000000000000000000000804^^<<0300000000 ..[]. &59ae 86 ff f8 34 34 34 8e 07 2d 0f 1a f3 fc 2c e3 7c ; 0000000000000000000008080103040200000000 ...... &59be 6f f8 8f 99 c4 82 e1 3f 65 26 39 fe 94 51 66 e6 ; 0000000000000000000808080801020808000000 ........ &59ce e3 d7 80 57 99 e3 f8 37 e5 94 63 f9 2f 43 e5 f8 ; 0000000000000808190308080808080808000000 ..*........ &59de f9 4f 53 e2 78 93 17 4d 86 ca b1 4c 32 bd 4a c6 ; 0000000000000804020119080808080808000000 ....*...... &59ee 40 cc 4c 31 68 53 43 26 99 39 7e 54 32 92 99 e3 ; 00000000000808190304020808080807<<000000 ..*......... &59fe 7f 34 92 29 fe 2f e5 92 79 d0 a4 a4 ac c6 24 33 ; 00000008080808080119080808080806<<000000 ......*....... &5a0e 49 46 8a ca 27 33 93 8c 8a 46 c6 33 c5 28 93 8c ; 0000080808080808080808080807<<05<<000000 .............[] &5a1e 86 c6 0f c7 2a 93 fc 0f 0f 3a 65 92 7f 7e 65 3a ; 000005<<04030403080808080806<<^^<<000000 []...........[] &5a2e 33 66 f8 52 52 46 f9 9c e7 86 27 23 43 65 f8 1c ; 0000^^<<010403020808080808080807<<000000 []............. &5a3e 64 87 47 45 53 62 f8 ec f3 a4 86 a8 0c ff f3 a8 ; 00000808040102030808080808080806<<000000 ............... &5a4e 64 64 0c ff a0 e1 d3 d0 38 fe e3 7f f6 26 e5 f9 ; 0000000801020102080808080805<<0808000000 ..........[].. &5a5e 9f bd 49 79 5e b3 ec 4d ca f3 ba 65 2f 43 e5 84 ; 000000000808080e<<<<080808^^<<0800000000 ...[]....[]. &5a6e f3 2c 7c ec a9 64 9c 4a c6 c2 66 d8 1b 8d d7 f8 ; 00000000000008^^<<<<08080808080800000000 .[]....... &5a7e 71 c3 de 68 fc a6 9c 1d f6 46 63 52 36 43 65 85 ; 0000000000000000000808080808080000000000 ...... &5a8e f3 35 56 51 ac 4a c6 0f b4 29 af 31 29 d7 58 95 ; 0000000000000000000000000000000000000000 &5a9e 8c bf 0c 95 a9 ac 06 42 97 81 54 3a 8f 54 32 3a ; 0000000000000000000000000000000000000000 &5aae df 58 95 8c d6 75 0e 8d 46 7b fb e8 fa d3 6f 5c ; 0000000000000000000000000000000000000000 &5abe bf df ef f7 3b d3 6f c0 db 5e 73 dd 4b 72 d7 9d ; 0000000008000000000000000000000000000000 . &5ace 8c 71 5f 9c 8c 24 fb c5 a1 21 b0 fe f5 86 86 2e ; 00000000080805<<000000000000000000000000 ..[] &5ade c9 bb de a8 28 4d 52 7c 6f 54 8e e2 a7 38 4a 43 ; 0000000805<<^^<<05<<00000000000000000000 .[][][] &5aee 7f c5 a7 bf ea d1 6f 75 e8 fd 6b 5c 6b 68 93 bc ; 00080808^^<<05<<^^<<08000000000808080000 ...[][][]. ... &5afe bf d6 d0 25 c5 7f 69 e8 28 7e fc 2b 0d 1d fd 24 ; 080808080808^^<<0807<<000000080808080800 ......[]... ..... &5b0e 79 db 19 3a fa a4 f8 ce d0 d1 26 c5 4f 87 99 2e ; 0808080403080808080a<<080000080808080800 ............ ..... &5b1e 29 7e 2b 43 a3 24 49 f1 5f 19 3a e5 f8 f3 a7 32 ; 0808040201030807<<0a<<07<<080c0808080808 ..............+..... &5b2e b4 4a f2 93 e4 5d 83 49 4e e9 93 e2 0b e1 29 2d ; 0808020909010806<<06<<06<<08080808040308 .................... &5b3e 6d 52 fc f9 1e 2d 5d 52 fc 18 c0 cc 1c 7f 8e 96 ; 0808080909080804030403040308080808010208 .................... &5b4e fe cf 09 94 b4 f4 7f 96 29 96 fe 7f e8 93 7e fc ; 0808080909080402040201030103080808080808 .................... &5b5e 3f da a4 f8 24 ef 8f 2e 29 3e 29 7e 69 92 65 93 ; 0808080909080103010304020402080403080808 .................... &5b6e e2 9f 29 94 64 92 e2 7f 68 e8 94 29 fe 8f 86 56 ; 0808080909080801020102010208040201030808 .................... &5b7e 29 fe 97 86 e4 7f cd d2 28 c9 ff 59 39 3a 25 79 ; 0808080909080807<<080807<<08020909010808 .................... &5b8e ff 95 8e 56 49 2e c9 fb a1 a3 57 e6 f8 a3 a3 ff ; 05<<08090908080a<<04030a<<08080909080808 [].................. &5b9e 7f 3a fa 97 fc a3 a3 f5 4f 51 fc d0 91 4c 92 77 ; ^^<<08090908080a<<01020a<<08080909080808 [].................. &5bae 29 3f 74 ca 14 1f 7a e6 e8 ff 2f ed d1 5f 86 a4 ; 0808080909080806<<080806<<08080909080808 .................... &5bbe ca 24 c5 d2 98 55 09 cd 18 8a a7 71 29 ff f4 43 ; 0808080909080804030403040308080909080808 .................... &5bce e3 42 d7 2c fd d0 58 8d 4b bb 24 4f 9b 72 14 af ; 0808080909080402040201030103080909080808 .................... &5bde 24 c9 7c 92 47 7f ca e1 91 d7 d0 38 fa 4b 0a 6f ; 0808080909080103010304020402080909080808 .................... &5bee 68 2a 4b f2 49 e1 1d 4d e7 94 64 29 bc 49 a6 d2 ; 08080809090808010201020102080809090805<< ..................[] &5bfe 29 c9 91 37 49 e1 69 69 95 64 c8 1b 0a df 2b bd ; 08080809090805<<0807<<08080808090908^^<< ......[]..........[] &5c0e 32 f3 80 d2 99 25 6f 48 3a 97 76 c9 1b 25 81 b2 ; 080808090903^^<<080a<<191919080909080808 ......[]...***...... &5c1e 73 14 63 86 c4 1b 65 ea 1c 9d 1b 25 f1 8e a6 b2 ; 08080809090909090306<<0e<<<<080909080808 ...........[]....... &5c2e 74 ee 94 c4 1b 9a ca 92 8c bd 64 f1 c8 2b 5c ca ; 0808080109090909090308^^<<<<080909080808 ...........[]....... &5c3e 28 c9 26 85 32 af c6 29 c9 24 c5 d3 ff 28 53 fc ; 0804030801090909090909090908080909080808 .................... &5c4e d0 82 ff 1f fa ff a7 7f f0 4f ff ff f4 83 fe 9f ; 0801020c08080801090909090208080909080808 ...+................ &5c5e fe 07 fc d0 ff 3f fd e0 fc 3f fd e0 fc 3f fd e0 ; 0808080804030808010909020808080909080808 .................... &5c6e fc 81 4b fa c5 f9 49 8a 5f 9c df a4 f8 3f 9c 4f ; 0808080402010308080909080808080909080808 .................... &5c7e 8a 2b e0 fc e1 ac 89 2d e0 e3 ac dd 0e ee ff b5 ; 0808080104030208080909080808040909080808 .................... &5c8e fe c0 16 ff ba 0b a6 7d f5 01 fd e9 79 35 d0 f3 ; 05<<080402010308080909030804090909080808 [].................. &5c9e db 3e d4 7e bf fb eb 75 c0 1f 00 d3 38 00 a6 f1 ; ^^<<0801030402080d09090909090909020805<< []......x.........[] &5cae ff 22 f2 ff 97 24 4c 28 05 21 84 90 f2 d0 68 24 ; 080808040102030804090909090909020808^^<< ..................[] &5cbe 2b c5 9a 1f 30 4a 71 e6 dc 99 5f 77 ee ec 9f 39 ; 0808080103040204090909090909020808080808 .................... &5cce 77 76 93 99 c4 9d 9d 64 66 0a a3 64 7f 28 ce ac ; 0808080801020409090902080808080808080808 .................... &5cde 1b 3a 16 38 c9 8c 5d 37 b4 ca 14 ee cf 26 a1 55 ; 080403080804090909090805<<08040304030808 ...........[]....... &5cee 1a f7 97 1c 4f 63 cf 1c 85 59 33 f4 e3 8e c4 ae ; 0801020804090909090903^^<<04020403010308 ...........[]....... &5cfe 4d 3a 03 db 53 92 2b 5c 52 9c 33 67 94 ae c0 14 ; 0808080409090909090909030801030102040208 .................... &5d0e 66 9c 3b 3b 74 85 77 63 dd 0f c9 14 cc d9 75 63 ; 0808080909090208010909090308010201020808 .................... &5d1e 4e a9 e1 de 8c 1d b7 da 70 03 9f 7b 7b 1d fb f6 ; 0808080909020808080109090903080808080808 .................... &5d2e b7 f5 df d8 7e bf 0d ; 08080809090805<<080801090909030808080808 ......[]............ ; 080808090908^^<<08080801090909080807<<08 ......[]............ ; 07<<0809090808040304030801090908080a<<19 ...................* ; 0a<<0809090804020402010308090908080a<<0d ...................x ; 06<<08090908010301040302080909080806<<08 .................... ; 0808080909080401020301030809090808080808 .................... ; 0808080909080103040204020809090808080808 .................... ; 05<<080909080801020102080809090808080808 [].................. ; ^^<<080909080808080808080809091908040308 [].............*.... ; 0808080909080808080808080809091908040308 ...............*.... ; 080808090908080807<<08080809091908040308 ...............*.... ; 08080809090808080a<<08080809091904020103 ...............*.... ; 080803090904080806<<0c080809091901030402 ..........+....*.... ; 0808010304020808080c07<<0809091908010208 .........+.....*.... ; 080808010208080808080a<<0809091908010208 ...............*.... ; 0808080808080403080806<<0809091908010208 ...............*.... ; 0403080808040201030808080309090408080808 .................... ; 01020808080105<<020808080103040208080808 ......[]............ ; 080d08080804^^<<030808080801020804030808 .x....[]............ ; 0000080808010304020808080808080402010308 .................. ; 000000080808010205<<05<<0808040205<<0103 .....[][]....[].. ; 0000000008080808^^<<^^<<05<<0103^^<<0402 ....[][][]..[].. ; 000000000808080800000808^^<<080103040200 .... ..[]..... ; 0000000000080800000000080805<<0801020000 .. ..[]... ; 00000000000000000000000008^^<<0808000000 .[].. ; 0000000000000000000000000005<<0808000000 [].. ; 00000000000000000000000000^^<<0800000000 []. ; 0000000000000000000000000000080800000000 .. ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 080000000000000000000000000000000000000c . + ; 0808080000000000000000000000000000080808 ... ... ; 07<<080800000000000000000000000008080409 .... .... ; 0a<<080800000000000000000000000008040208 .... .... ; 0a<<080808080000000000000000000804020409 ...... ..... ; 06<<08080808000000000000000000080908090e ...... ....[ ; 08080819190808000000000000000008090809^^ ...**.. ....[ ; 0808040919080800000000000000000801030109 ....*.. ..... ; 0804090208080808000000000000000008010308 ........ .... ; 0809020808080808000000000000000000080109 ........ ... ; 0809080808080808000000000000000000080808 ........ ... ; 0809080808080808000000000000000000000008 ........ . ; 0809080808080808080000000000000000000000 ......... ; 0809080808081919080800000808000000000000 ......**.. .. ; 0809080808040919080808080808000000000000 .......*...... ; 0809080804090208080808080808080000000000 ............... ; 0809080809020808080808191908080000000000 ...........**.. ; 0809080809080808080804091908080800000000 ............*... ; 0809080809080808080409020808080800000000 ................ ; 0809080809080808040902080808080800000000 ................ ; 0909090909080804090208080808080808000000 ................. ; 0809080109030409020808080808080808000000 ................. ; 0809080801090902080808080808191908000000 ..............**. ; 0809080808010903080808080804091908080000 ...............*.. ; 0909090308080109080808080409020808080800 ................... ; 0219010908080809080808040902080808080808 .*.................. ; 19191909080808090808040902080808080807<< ***................. ; 0e<<<<0909090909090909020808080808080a<< [].................. ; ^^<<<<0908080809080808080808080808080a<< [].................. ; 030d0409080808090808080808080808080806<< .x.................. ; 0909090208080809080808080808080808080808 .................... ; 0809080808080409080808080819190808080808 .............**..... ; 0809080808040902080808080409190808080808 ..............*..... ; 0809080804090208080808040902080808080808 .................... ; 0809080409090308080804090208080808080808 .................... ; 0809090902010903080409020808080808080808 .................... ; 0809080908080109090902080808080808080808 .................... ; 0809080908080801090208080808080808080808 .................... ; 0809080903080808080808080808080807<<0808 .................... ; 0809080109030808080808080808080806<<0308 .................... ; 0809080801090308080808191908080808010908 ...........**....... ; 0809080808010903080804091908080808080908 ............*....... ; 0809080808080109090909020808080808080908 .................... ; 0809080808080808080808080808080808080908 .................... ; 0809080808080808080803040808080808080908 .................... ; 0809080808191908080105<<0208080808080908 .....**...[]........ ; 08090308040919080804^^<<0308080808080908 ......*...[]........ ; 080109090902080808080201080807<<08080908 .................... ; 080808080808080808080808080406<<08080908 .................... ; 0808080808040203040103080409020808080908 .................... ; 07<<080808010302010402080902080808080908 .................... ; 0a<<040308080808080808080908080808080908 .................... ; 0a<<020108080807<<0808080908080808080908 .................... ; 06<<010208080406<<0808080903080808080908 .................... ; 0808040308080902080808080109030409090909 .................... ; 0808030408080908080808080801090902190919 .................*.* ; 0000010208080908080808080804090219080908 ..............*... ; 0000000808080903080808080409021908080908 ............*.... ; 0000000008080109030808080902190804090909 ..........*..... ; 0000000000080801090308080919080409021901 ........*....*. ; 0000000000080808010903080919080902191919 ........*...*** ; 00000000000808080801090909090909080e<<<< ............[]. ; 0000000000080807<<0808080919080903^^<<<< ........*...[]. ; 0000000008080406<<0808080919080109030d04 .........*....x. ; 00000000080809020807<<080903190801090909 ..........*..... ; 0000000008080908080a<<080109031908080908 ...........*.... ; 0000000808080908080a<<080801090319080908 .............*... ; 00000008080809030806<<080804090903190919 ..............*.* ; 0008080403080109030808080409020109090909 ................... ; 0808080102080801090308040902080808080908 .................... ; 0808080808080808010909090208080808080908 .................... ; 08080e<<<<080808080808080808080808080908 ..[]................ ; 0808^^<<<<080808080808080808080808080908 ..[]................ ; 080808080808080e<<<<08080808080808080908 .......[]........... ; 08080808080808^^<<<<08080808080808080908 .......[]........... ; 0808080805<<0808080808080808080808080908 ....[].............. ; 08080808^^<<080808080e<<<<08080808080908 ....[]....[]........ ; 08080808080808080808^^<<<<08080808080908 ..........[]........ ; 080808081f1f0808080808080808080808080908 ....??.............. ; 080808081f1f0808080808080808080808080908 ....??.............. ; 080808081f1f0808080808080e<<<<0808040908 ....??......[]...... ; 0808080808081f1f08080808^^<<<<0804090208 ......??....[]...... ; 0808080808081f1f080808080808080409020808 ......??............ ; 08080808080808081f1f08080808040902080800 ........??......... ; 1f1f0808080808081f1f08080807<<0208080800 ??......??......... ; 1f1f1f1f1f1f1f1f1f1f08080806<<0808080000 ??????????........ ; 00001f1f1f1f1f1f080808080808080808080000 ??????.......... ; 000000000808080808080e<<<<08080800000000 ......[].... ; 00000000000808080808^^<<<<08000000000000 .....[].. ; 0000000000000808080e<<<<0800000000000000 ...[].. ; 000000000000000808^^<<<<0000000000000000 ..[]. ; 00000000000000080e<<<<000000000000000000 .[]. ; 0000000000000008^^<<<<000000000000000019 .[]. * ; 000000000000000e<<<<00000000000000001919 []. ** ; 00000000000000^^<<<<0000000000000019190d []. **x ; 0000000000000000000000000000080808081919 ....** ; 0000000000000000000000000808080808080819 .......* ; 000000000e<<<<0808080808080e<<<<0e<<<<08 [].......[].[].. ; 00000808^^<<<<0e<<<<0e<<<<^^<<<<^^<<<<08 ..[].[].[].[].[].. ; 00000808080808^^<<<<^^<<<<08080808080808 .....[].[]........ ; 0303030808080808080808080808080808040903 .................... ; 09090905<<040305<<05<<05<<05<<05<<010909 ...[]..[][][][][]... ; 080908^^<<0102^^<<^^<<^^<<^^<<^^<<040909 ...[]..[][][][][]... ; 01090208080807<<08080808080e<<<<08010902 .............[]..... ; 080807<<08080a<<080807<<08^^<<<<08080808 .............[]..... ; 08080a<<08080a<<080806<<08080808080807<< .................... ; 08080a<<080806<<080808040909090909030a<< .................... ; 080806<<0804090909090909090207<<010906<< .................... ; 08080808080902080807<<0808080a<<08090808 .................... ; 0909030c040907<<0806<<0808080a<<08090808 ...+................ ; 0801090909020a<<08080808080806<<040905<< ..................[] ; 0808080109080a<<08080808080804090902^^<< ..................[] ; 08080808090806<<080807<<0808090207<<0808 .................... ; 0807<<080908080808080a<<0808090306<<0808 .................... ; 0806<<0409080807<<0c06<<0808010903080800 .........+......... ; 080804090208080a<<07<<080807<<0109080800 ................... ; 0909090207<<080a<<0a<<080806<<0809080800 ................... ; 080808080a<<0806<<0a<<080808080809030800 ................... ; 07<<080806<<0808080a<<0807<<080801090000 .................. ; 0a<<0808080807<<0806<<080a<<080808010000 .................. ; 0a<<080c08080a<<0808080806<<080800000000 ...+............ ; 06<<0808080806<<080808080808080000000000 ............... ; 0008080808080808080000080808000000000000 ........ ... ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 # Relocatable block &0e # &03a9 bytes copied from &5d35-&60dd to &9278-&9620 at &448a in enhanced version ; map_2_data &5d35 82 03 ; compressed map data length = &382 &5d37 01 ; plus 1 bits &5d38 11 ; compression table has 17 entries: &5d39 04 c8 20 18 43 ab 49 88 10 70 60 28 e3 d0 68 08 ; 10 => tile &00, 4 bits &5d49 b8 ; 000 => tile &09, 1 bit &5d4a 06 15 3d 23 0f 2b 08 33 31 61 29 5b 0c 39 41 2d ; 100 => tile &1c, 3 bits &5d5a 7b ; 111 => tile &08, 3 bits ; 0101 => tile &19, 0 bits ; 00011 => tile &03, 0 bits ; 01001 => tile &0c, 0 bits ; 01011 => tile &15, 3 bits ; 01101 => tile &01, 0 bits ; 10001 => tile &02, 0 bits ; 10011 => tile &11, 0 bits ; 11001 => tile &1a, 0 bits ; 11101 => tile &04, 0 bits ; 000001 => tile &0d, 0 bits ; 011011 => tile &05, 0 bits ; 100001 => tile &0e, 0 bits ; 111011 => tile &17, 0 bits ; &5d5b be 52 46 55 d9 25 54 1f 47 b9 b5 50 1d 47 89 55 ; 0000000000000000000000000000000000000019 * &5d6b 35 1f 84 58 6a cd 85 8e 51 0e 21 3e ee 01 87 71 ; 0000191919000000000000000000000000000019 *** * &5d7b 24 2d 19 c7 9c 0b 70 b8 57 18 0f 7d 3b f4 b9 e0 ; 0019040308190000000000000000000000001915 *...* *. &5d8b cf c7 22 c4 63 2e 1c 16 21 9d f3 91 b2 f7 cc c3 ; 1904090903190000000000000000001919191108 *....* ***.. &5d9b 62 0e 71 6a c4 23 06 12 91 8f a4 22 22 8c 23 d9 ; 0809090902190000000000000000000000191115 .....* *.. &5dab c4 d1 60 1c 36 f1 34 38 5c ea 82 27 99 44 26 1e ; 04090902000000000000000000000000000e<<<< .... []. &5dbb b8 92 4a 1d 30 2e 95 c8 47 c3 71 18 a1 46 36 18 ; 0902080800000000000000000000000008^^<<<< .... .[]. &5dcb 2e 91 1b 28 53 25 f2 01 ca d4 02 87 78 40 99 de ; 09080000080c000000000000000c000008111115 .. .+ + .... &5ddb a1 10 0f 1c c6 f4 0e e5 30 60 b1 ac 23 3c 0c d8 ; 09080000000000000000000000000808080e<<<< .. ...[]. &5deb a7 d8 15 98 ce 50 3a c4 c3 41 44 44 84 78 48 2d ; 0208000000000000000000000000000000^^<<<< .. []. &5dfb fa be 9d 8c cd d8 8d dd d8 8c 94 cc e4 fb e2 6e ; 05<<080000000000000000000000000000001115 []. .. &5e0b 6c c6 66 6c c6 ee fb be fa f8 c2 65 96 54 9f 78 ; ^^<<000000000000000000000000000000001108 [] .. &5e1b 54 55 d5 9f a4 b3 2f 05 6b 23 39 5f 5f 98 ef 5c ; 080000000000001c000000000000000000081115 . . ... &5e2b 18 49 19 4f 5f 98 ff 5c 18 0a 8c 5a 98 e3 e9 38 ; 080000000000001c000000000008080808081108 . . ....... &5e3b 9e 3e 17 94 06 c7 c4 8e b1 e1 c0 e9 40 4d 6c f1 ; 0800000000001a<<000000000000000008081108 . *. .... &5e4b 6b 11 a7 03 c7 44 78 fa 78 10 a6 03 35 11 c6 11 ; 0000000000001c1c080000000000000000001100 ... . &5e5b db d1 11 a6 03 c7 6c b1 c1 07 b1 c5 a9 1c 50 f3 ; 0000000000001c08080000000000000000000d00 ... x &5e6b 80 d1 c6 d3 63 87 63 2a 07 1c f3 68 d0 e1 81 01 ; 000000001c1a<<080c0000000000000000000000 .*..+ &5e7b f1 98 ca 01 35 1f 84 d1 11 9e a9 74 38 e6 d3 10 ; 0909090909090903080c00000000000000000000 .........+ &5e8b 31 3e 53 81 58 f3 42 c4 6b 1a 47 7c e6 fa da fc ; 000000001c080109030800000000000000000000 ...... &5e9b ff ff ff af 7a aa fe 5b a8 32 ea 7f 85 52 ea a8 ; 000000001c080801090800000000000000000000 ...... &5eab aa ff b1 4a a9 fa dd aa 3a f5 fa 86 5d 1f 8c c7 ; 00001c1c1c0808080908080c0000000000000000 .........+ &5ebb ab aa b3 81 58 75 27 50 eb ed 70 98 f5 42 3c d4 ; 00001c1a<<1c0808090808080c00000000000000 .*........+ &5ecb 3a e3 a3 d6 b9 c9 55 97 5e 47 8d 63 b3 4b 80 71 ; 000000001c1c1c08090308080800000000000000 ......... &5edb c9 0d c6 b1 3d ee d1 60 7c e6 d3 60 3c f2 d5 e0 ; 000000001c1a<<08010909030800000e<<<<0000 .*....... []. &5eeb 91 1f 03 2e b5 1e 03 0e b9 0e 05 e4 2a 07 dc da ; 00000000001c1c1c1c1c0109030000^^<<<<0000 ........ []. &5efb 1d 70 cb 01 b7 aa 1c 50 ab a3 03 46 f2 0a e2 e1 ; 00000000000000001c1a<<010900000011000000 .*... . &5f0b 80 71 24 ad e0 31 1e 30 be e4 74 78 82 0b c6 7f ; 00000000000000001c1a<<080900000011000000 .*... . &5f1b 74 88 6f c3 71 43 bc 88 27 6c 88 e3 e9 70 30 07 ; 000000000d000000001c08080900000011000000 x .... . &5f2b f1 84 47 43 04 f6 0b 9f 06 f4 7f 00 93 e9 9b 00 ; 0000000000080000001c08080908000011000000 . ..... . &5f3b 36 73 1f 05 8c c1 d3 40 28 99 a8 f5 22 0a 24 a6 ; 0000000000080000000800000915151515151900 . . ......* &5f4b f8 22 0a 2c a2 88 5a 2b a2 88 02 8b 28 a2 b8 22 ; 0000000000080e<<<<0800000917<<1100000000 .[].. .[]. &5f5b 8a 28 d0 8a 28 a2 b6 22 8a 28 d0 8a 28 22 25 a2 ; 000000000004^^<<<<00000009^^<<1100000000 .[]. .[]. &5f6b 88 02 ad 88 62 8b 28 d0 8a 48 ab 89 28 d0 8a 67 ; 0300000004090208000000000909090909090909 . .... ........ &5f7b 0a b4 60 7d 25 00 8d e7 80 90 78 12 28 e1 ec e3 ; 0909090909020800000000000102000000000000 ....... .. &5f8b 65 80 fb 7a 6c e3 25 80 bb 7a 4c a9 8d b7 21 f3 ; 0000000000000000000000000000000000000000 &5f9b f4 18 54 05 6d dc 0d 9f 36 fa e8 a3 c7 ff 68 e3 ; 0000000000000000000000000000000000000000 &5fab 69 b1 c5 16 df 8e 08 e3 ed 88 08 f1 6a 88 88 f1 ; 0c000005<<000017<<000017<<000005<<00000c + [] [] [] [] + &5fbb ff 8f 06 e3 0c ff a7 21 8e ff 6e 70 13 57 fe 88 ; 0c0000^^<<0000^^<<0000^^<<0000^^<<00000c + [] [] [] [] + &5fcb 03 ee 9c 99 27 13 07 1c c4 97 b9 7c e4 0c 39 13 ; 0000000000000000000000000000000000000000 &5fdb 07 9f 29 e0 32 4f 65 e0 79 0a a8 4c 65 9e 00 9e ; 0000000000000000000000000000000000000000 &5feb ce 0c f0 4c a6 81 c9 3c 0d 3c 99 39 e0 79 0a e8 ; 0017<<000005<<000005<<000005<<000017<<00 [] [] [] [] [] &5ffb cc 33 40 64 ee a0 33 71 00 7d 70 07 d9 81 3a 98 ; 00^^<<0000^^<<0000^^<<0000^^<<0000^^<<00 [] [] [] [] [] &5f0b 8f 39 88 a3 23 c4 87 fa 8f 0e f1 3f 10 11 21 1e ; 0000000000000000000000000000000000000000 &601b 55 55 55 55 f5 55 55 55 55 47 44 ac aa ea 88 08 ; 0000000000000000000000000000000000000000 &602b f1 d9 2e 44 88 5f 83 cf 38 d3 9e 8e 0e af f1 ed ; 0000000000000000080800000000000000000000 .. &603b 3b c4 c7 78 8c 6f 8f 8f 72 38 87 71 a4 74 c9 a7 ; 0000000000000008080800000000000000000000 ... &604b 2f 3c 66 a0 3d be f0 d8 a5 3c f6 54 0e 7d 2a c9 ; 1900000000001908080808000000000000000000 * *.... &605b 29 73 6a 75 78 55 0b 65 d5 51 da 57 a5 d4 d5 40 ; 08191919191908080808080808080c0000000000 .*****........+ &606b 7a b6 a7 aa 4e 74 ee f0 01 09 c6 df c1 42 1c 6f ; 0808080808041515150d15151515030c00000000 .........x.....+ &607b 07 0d 0d 1c c7 76 80 08 0e 8c 0e 22 48 70 74 d4 ; 080808080415110808080808081115030c000000 ................+ &608b a1 a3 8f e6 ae 81 af ed be af ef be ef fb be b1 ; 0308080415110808080808080808111503000000 ................. &609b 6b 87 bf 1d be b0 1d 7a 1d db 64 dc 7a 26 91 09 ; 0903191511030808040909030808041115000000 ..*.............. &60ab 75 6d e6 4c 58 55 46 3d 93 c9 84 55 db 69 4c b1 ; 0109081109090409090201090903090911000000 ................. &60bb 8e f0 30 0e b3 ea 50 8e cd 3c d2 e3 1c 62 4a c9 ; 0009191109090102080808080102090911000000 .*.............. &60cb 17 8e e4 ee c6 2e 24 f7 d1 0f e3 f0 0f e3 d0 f7 ; 0009081109090908080403080809090911000000 ................ &60db 67 f7 01 ; 0009191109090903080201080409090911000000 .*.............. ; 0009081101020109080808080902010211000000 ................ ; 0809191108090301030808040204090811000000 ..*.............. ; 0809081108010904090808090309020811000000 ................. ; 0809191108080909090304090909080811000000 ..*.............. ; 0409081108080109090909090902080811000000 ................. ; 0902191108080809090909090908080811000008 ..*.............. . ; 0208081115151515151515151515151511080808 .................... ; 0808080808080808080808080808080808080808 .................... ; 0808080808080808080808080808080808080808 .................... ; 1908081919080808080808080808080808080808 *..**............... ; 0019190000190808080808080808080808080808 ** *.............. ; 0019000000190819191908080808080808080808 * *.***.......... ; 0000000000001900000019190808080808080808 * **........ ; 0000000000000000000000001919190808080808 ***..... ; 0000000000000000000000000000001908080808 *.... ; 0300000000000000000000000000001908080808 . *.... ; 0903080800000000000000001919190808080808 .... ***..... ; 0109000000000000000000191908080808080808 .. **....... ; 0c09000000000000000000000019080808080808 +. *...... ; 0409080000000000000000000019080808080808 ... *...... ; 0902080000000000000000000000190808080808 ... *..... ; 0208080000000000000000000000190808080808 ... *..... ; 05<<000000000000000000000000001919080808 [] **... ; ^^<<000000000000000000000000000000190819 [] *.* ; 030805<<00000000000000000000000000001900 ..[] * ; 0903^^<<08080800000000000000000000000000 ..[]... ; 0109030805<<0808000000000000000000000000 ....[].. ; 08010903^^<<0808080800000000000000000000 ....[].... ; 0808010903080800000000000000000000000000 ....... ; 0808080109080800000000000000000000000000 ....... ; 0808000009080808000000000000000000000019 .. .... * ; 0808000009080000000000000000000000000019 .. .. * ; 0800000009000000000000000000000000001919 . . ** ; 00000000090000000000000000000000001917<< . *[] ; 000000000900000000000000000000000019^^<< . *[] ; 0000000009000000000000000000000000191919 . *** ; 0000000009000000000000000000000019040909 . *... ; 000000000900000c000000000000000019090208 . + *... ; 00000000090000080c0000000000000019090808 . .+ *... ; 00000808090000080808080c0000000004090808 ... ....+ .... ; 0d08080809030808080808080808080409020808 x................... ; 0808080801090903080808080808080902080808 .................... ; 1c08080e<<<<01090909090308080409081c1c08 ...[]............... ; 1c0808^^<<<<0e<<<<080109090909091c1c1c1c ...[].[]............ ; 1c1c08080808^^<<<<0e<<<<080801091c1c1c1c ......[].[]......... ; 1c1c1c080808080808^^<<<<080808091c1c1a<< .........[].......*. ; 1c1c1c1c1c1c1c080808080808081c091c1c1c1c .................... ; 1c1c1a<<1c1c1c1c080808081c1c1c091c1c0000 ..*............... ; 1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c091c000000 ................. ; 1a<<1c191515151515151515191c190900000000 *..*........*.*. ; 001c1c191c1c1c1c1c1c1c1c191c190900000000 ..*........*.*. ; 00001c191c1915151515191c191c190900000000 .*.*....*.*.*. ; 00001c191c191c1c1c1c191c191c190900000000 .*.*....*.*.*. ; 000000191c191c1905<<191c191c190900000000 *.*.*[]*.*.*. ; 000000191c191c0c^^<<0c1c191c190900000000 *.*.+[]+.*.*. ; 000000191c191c1c1c1c1c1c191c190900000000 *.*......*.*. ; 000000191c0c1515151515150c1c190900000000 *.+......+.*. ; 000000191c1c1c1c1c1c1c1c1c1c190900000000 *..........*. ; 0000000d151515151515151515150d0900000000 x..........x. ; 0000001c1c1c1c1c1c1c1c1c1c1c1c091c000000 .............. ; 00001c1c1c1c1c1c1c1c1c1c1c1c1c091c1c1c00 ................. ; 080808080804030808080808081c1c091c1c1c1c .................... ; 08080808040201030808080808081c091c1c1c1c .................... ; 08080804020c0c01030808080808080109091c1c .....++............. ; 080804020d19190d010308080808080808010909 ....x**x............ ; 0808010304030403040208080808080808080801 .................... ; 0308080102010201020808080808080409090909 .................... ; 0903080808080808040909090909090902080808 .................... ; 0109090909090909090208080808080808080808 .................... ; 0808080808080801090308080808080e<<<<0808 ...............[]... ; 080808080808080801090909090308^^<<<<0808 ...............[]... ; 0808080808080808080808080109080808080808 .................... ; 081c0808081a<<080808081c0809080808080808 .....*.............. ; 081a<<1a<<1c1c08081a<<1c0809081c08080808 .*.*.....*.......... ; 1a<<1c1c1c1c1a<<081a<<1a<<091a<<1a<<1c08 *.....*..*.*..*.*... ; 1c1c1c1c1c1c1c1c1a<<1c1c1c091c1c1c1c1a<< ........*.........*. ; 1c1c1c1c1c1c1c1c1c1c1c1a<<091c1c1c1c1c1c ...........*........ ; 1c1c1c1c1c1c1c1c1c1c1c1c1c091c1c1c1a<<1c .................*.. ; 1c1c1a<<1c1c1c1c1c1c1c1c1c091c1c1c1c1c1c ..*................. ; 1c1c1c1c1c1c1c1c1c1a<<1c1c091c1c1c1c1c1c .........*.......... ; 1c1c1c1c1a<<1c1c1c1c1c1c1c091c1c1a<<1c1c ....*...........*... ; 1c1c1c1c1c1c1c1c1c1c1c1c1c091c1c1c1c1c1c .................... ; 1c1c1c1c1c1c1c1a<<1c1c1c1c091c1c1c1c1c1c .......*............ ; 1c1c1c1c1c1c1c1c1c1c1c1c1c091c1c1c1c1c1c .................... ; 1c1a<<1c1c1c1c1c1c1c1c1c1c091c1a<<1c1c1c .*.............*.... ; 1c081c1c1c1c1c1c1c1a<<1c08091c1c1c1c1c1c .........*.......... ; 1c081c1c1c1c081c1c1c1c1c04091c1c1c081c1c .................... ; 080808081c1c081c08040909090208081c1c1c08 .................... ; 0808080808080808040902080808080808080808 .................... ; 0909090909090909090208191919191919191919 ...........********* ; 0808080819191919191919040909090909090909 ....*******......... ; 19191919040909090909090902080805<<080808 ****...........[]... ; 090909090902080808080109080808^^<<080000 ...............[]. ; 08080808080c17<<0c0804090808080808080000 .....+[]+......... ; 0808080817<<^^<<17<<09020808000008080000 ....[][][].... .. ; 08080808^^<<17<<^^<<02080800000008000000 ....[][][]... . ; 00080000080c^^<<0c0808080000000000000000 . .+[]+... ; 0000000000080808080800000000000000000000 ..... ; 000000000000000808000000000000000000000d .. x ; 0000000000000008080000000000000000000000 .. ; 0000000000000808000000000000000000000000 .. ; 0000190000000808000000000000000000000000 * .. ; 0000110000000800000000000000000000000000 . . ; 0000110000000c00000000190000000000000000 . + * ; 0000110000000000000019080000000000000000 . *. ; 1919151900000000000019081900000000000000 **.* *.* ; 0808080819190000001908080801090000000000 ....** *..... ; 080805<<08081919190808080808090900000000 ..[]..***....... ; 0808^^<<08080808080e<<<<0808090000000000 ..[].....[].... ; 090308080808080808^^<<<<0804090000000000 .........[].... ; 0009090909030808080808080409000000000000 ............. ; 00090900000909030805<<080900000000000000 .. ....[].. ; 000009000000000903^^<<040900000000000000 . ..[].. ; 0000090000000000090804090900000000000000 . ..... ; 0000000000000000090409090000000000000000 .... ; 0000000000000000090900000000000000000000 .. ; 17<<000000000000000900000000000000000000 [] . ; ^^<<0000000000000000000000000017<<000000 [] [] ; 000000000000000000000000000000^^<<000000 [] ; 0000000000000000000000000000000000000000 ; 00000000000017<<000000000000000000000000 [] ; 000000000000^^<<000000000000000000000000 [] ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 00000000000000000000000017<<000000000000 [] ; 000800000000000000000000^^<<000000000000 . [] ; 05<<080000000000000000000000000000000000 []. ; ^^<<05<<08000000000000000000000000000000 [][]. ; 1908^^<<05<<111c1c0000000000000000000000 *.[][]... ; 00190808^^<<111c1a<<1c000000000000000000 *..[]..*.. ; 000015151515111a<<1a<<1c0000000000001919 .....*.*.. ** ; 0000190808111c1c1a<<1c0000000000001905<< *.....*.. *[] ; 080808080800001100000000000000000019^^<< ..... . *[] ; 080e<<<<08000008000000000000000000001919 .[].. . ** ; 08^^<<<<0000000805<<00000000000000000000 .[]. .[] ; 080c080800000000^^<<08000000000000000000 .+.. []. ; 0c0c0c0000000000000000000000000000000000 +++ ; 080c00000000000000000000000017<<000017<< .+ [] [] ; 000c000000000000000000000000^^<<0808^^<< + []..[] ; 0000000000000000000000000000000800000800 . . ; 0000000000000000000000000000000800000800 . . ; 000000000000000000000000000017<<080817<< []..[] ; 0000000000000000000000000000^^<<0000^^<< []..[] # Relocatable block &10 # &045a bytes copied from &60de-&6537 to &9621-&9a7a at &448a in enhanced version ; map_3_data &60de 33 04 ; compressed map data length = &433 &60e0 05 ; plus 5 bits &60e1 11 ; compression table has 17 entries: &60e2 04 42 28 f0 da e8 c8 60 68 70 4a 20 10 18 08 b8 ; 00 => tile &00, 4 bits &60f2 fb ; 10 => tile &1b, 2 bits &60f3 04 0d 7b 17 06 23 11 6b 49 69 1f 4b 53 59 79 73 ; 101 => tile &08, 2 bits &6103 5b ; 0001 => tile &19, 0 bits ; 0111 => tile &1e, 0 bits ; 1111 => tile &09, 2 bits ; 00011 => tile &1d, 0 bits ; 001001 => tile &0d, 0 bits ; 001011 => tile &04, 0 bits ; 010011 => tile &02, 0 bits ; 011001 => tile &03, 0 bits ; 011011 => tile &1f, 3 bits ; 101001 => tile &0e, 0 bits ; 101011 => tile &0c, 0 bits ; 110011 => tile &17, 0 bits ; 111001 => tile &01, 0 bits ; 111011 => tile &05, 0 bits ; &6104 58 c7 db 5e f0 ca f6 b6 a3 65 6f d7 c8 6a 1d 6c ; 0000000000000008080808000000000000000000 .... &6114 2e a3 53 d5 86 d7 bd 20 ed dc ad 21 cd cf fd 7a ; 000000000000080805<<08000000000000000000 ..[]. &6124 71 2f 32 76 db 77 3d 2d 51 5c 8a 46 09 2b 61 51 ; 0000000000000808^^<<08000000000000000000 ..[]. &6134 ac 49 59 bd 44 b1 66 d5 9a bb bb f4 d5 12 6b 51 ; 00000008080808080805<<000000000000000000 ......[] &6144 a2 44 91 ba 37 a9 d1 a2 44 89 64 6f 6b 8d 12 ed ; 00000805<<08081e08^^<<080000000000000000 .[]....[]. &6154 24 7a 4b 5b 34 2d 61 4d 4e ea d0 28 5a ce 5a aa ; 000008^^<<08081b1b0808080800000000000000 .[]........ &6164 a7 31 dc 5d ce dd f5 dc 43 56 09 19 fe 3f be c6 ; 000008081b1b1b1b1b1d<<080808080000000000 ............. &6174 ea fa c9 c9 28 27 21 ab 84 df 37 e4 a4 b8 fe df ; 000808081b1b1d<<1b1b1b1b08080805<<080000 ..............[]. &6184 c9 bd 75 fc 7a ff 73 4f 97 c7 86 bb 3c 65 2f f1 ; 0008081e1b1b1b1b1b1b1b1b1b1b08^^<<080000 ..............[]. &6194 84 fb 59 79 4a 7c a1 65 48 f1 b2 97 78 a2 9d 4b ; 0008081b1b1b1b1e1b1b1b1b1b1b1b1b1e080808 ................... &61a4 91 62 25 96 27 ca 5e a5 49 b3 b2 7c 53 f4 be 64 ; 08081b1b1b1b1b1b1b1b081b1d<<05<<1b1b05<< ..............[]..[] &61b4 6d 79 a3 31 51 97 7c c9 4a fe 4d 0d 8b 92 4f d9 ; 05<<1b1b1b1e1b1b1b0819081b1b^^<<1b1b^^<< []........*...[]..[] &61c4 54 22 9f d8 92 4f bd b0 d1 1b 1d 65 2d e4 0e 45 ; ^^<<1b081b1b1b1908191b1b08191b1b19081b1b [].....*.*...*..*... &61d4 e3 81 42 ee 58 42 1e 7c ba ae ca b9 74 1d 86 c8 ; 08081b080c1b1b1b1b0819081b1b08081b1b0808 ....+.....*......... &61e4 b0 de 8b c6 b0 b2 b7 2b 6b b6 ac 45 4e e2 e4 ba ; 081b1b08081b1b1b1b1b1b1b1b1b1b1b1b1b1b1b .................... &61f4 e5 53 3e 35 0b eb f3 2c 57 d2 62 71 65 2e 5a 2f ; 1b1b080808080c1b1b0d1b1b0808190819081908 ......+..x....*.*.*. &6204 a4 d9 ec 52 d2 26 65 2e 7a de f7 e2 b2 5a 4b 5b ; 1b08080805<<08081b0808081908081908190819 ....[]......*..*.*.* &6214 34 1b 2e 45 a2 44 71 97 93 22 ed 4a 14 17 42 ce ; 0d05<<08^^<<080c08080819081908081e1b1908 x[].[].+...*.*....*. &6224 a5 59 19 94 12 5a ac 18 66 c4 d0 13 58 ce 69 e7 ; 08^^<<080808080e<<<<08081908081b1b1b0819 .[]....[]...*......* &6234 01 39 9e e7 79 9e 92 fd 85 fd 13 d4 f5 31 d2 ad ; 1b1b08081b1e1b^^<<<<0808081d<<1b1b1b1908 .......[].........*. &6244 3c c5 48 6f 4f 33 d0 96 69 5d 9e 6c cd 33 01 e5 ; 1b1b1b081e1b1b08080e<<<<1b1b1b1e1b1b1b19 .........[]........* &6254 29 4b 9a 95 47 10 81 e4 29 f9 54 1e 41 a4 40 79 ; 1d<<1b1b1b1b1b1b1b^^<<<<1b1b1b1b1b1b1e1b .........[]......... &6264 96 e4 cf 94 2c 93 20 52 0c 91 fa 54 43 a4 58 41 ; 1b1b1b1b1b1b1b1b1b1b1b1b1b1b1e1b1b1b1b1b .................... &6274 a4 3d 4d 11 e9 8c 94 a7 28 24 25 4a 30 f2 38 a4 ; 1b1b1b191b0c1b191b1d<<1b1b1b1b0909090909 ...*.+.*............ &6284 61 88 3c 2e 90 84 44 43 5e 67 04 69 d0 6f 88 40 ; 1b1b1b1b0c190c1b1b1b1b1b1b1b09091b1e1b1d ....+*+............. &6294 05 92 57 18 21 ed 33 46 38 fd 0c d2 de ec 33 c8 ; 081e1b191b0c1b191b1b1b1b1e09091d<<1b1e1b ...*.+.*............ &62a4 ca 8e 14 fb 0c 2b 88 ad b3 c1 32 af 02 4b 32 0b ; 081b1b1b1b1b1b1b0909090909091e1b1e090909 .................... &62b4 2c eb 2c b4 ac 27 b4 1b 2e a7 c8 32 d5 9c 1b 42 ; 0808081d<<090909091b1b1b1e09090909091e09 .................... &62c4 2c 4f 8b 96 73 46 7c bd 81 42 7c 59 2f a0 10 ff ; 080808081b091b1b1d<<1b1b1b1b1b1b1b1b1b09 .................... &62d4 93 35 f0 88 ff 6b 6c fe c5 57 16 38 7f a7 85 e7 ; 0805<<081909191b1b1b1b1b1b1b1b1e1b1b0809 .[].*.*............. &62e4 79 1e 71 5a a3 b1 1a cb 93 15 56 fa 33 15 56 fa ; 08^^<<190909191b1b1b081d<<1b081b1b1b1b08 .[]*..*............. &62f4 b4 14 52 a3 24 65 79 0a e6 d1 4b fe 4c 90 46 5d ; 05<<0819091908081e1b1b1b1b1b081b081b1b08 [].*.*.............. &6304 b2 3e 43 12 7d 69 59 85 a4 97 f5 5b db 5c 20 a9 ; ^^<<190409190805<<0808081b08081b08081b1b []*..*.[]........... &6314 73 de a6 4a 49 cd a7 36 37 cc 7a 2f 9c f4 b4 1b ; 08040909021908^^<<0808080808080804030808 .....*.[]........... &6324 e5 3d 1c d3 1a 11 6e 90 4b 44 84 bb bb 44 84 bb ; 0409090919080800000000190808080401040308 ....*.. *........ &6334 bb 86 bb bb eb 18 63 8c 31 5c c6 dd dd dd dd dd ; 0109090208080000000000000019080102030208 ...... *...... &6344 9d 0c 1b e7 ee 27 63 9c dc e9 9d de c9 c9 b0 93 ; 1901020000000000000000000000000801020808 *.. ..... &6354 d3 21 c3 4e ce c6 e9 10 c2 86 9d 0c 3b 3b 63 ec ; 0808080000000000000000000000001908080808 ... *.... &6364 ec 6c 9c 9d 31 76 76 32 ec 74 08 61 c3 ce c6 b9 ; 0808000000000000000000000000000019080c08 .. *.+. &6374 0c 19 7e 32 ec 74 08 61 c3 ce c6 d9 19 63 67 27 ; 0000000000000000000005<<0000000000190808 [] *.. &6384 c3 ce ce 18 3b 3b 1b a7 43 08 1b 76 32 ec e4 74 ; 00000000000000000000^^<<0000000000000008 [] . &6394 c8 b0 93 b3 71 72 a7 77 7a 27 27 43 c6 b9 fb 21 ; 0000000000000000000005<<000000000000000d [] x &63a4 36 ee ee ee ee ee ee 18 1d 63 8c 31 20 77 57 ce ; 00000000000000000000^^<<1e00000000000000 []. &63b4 dd 85 73 f7 08 ca ee ee 5c 22 22 18 b9 3b c3 22 ; 0000000000001e1b1b1b0c0c1b1b1b0000000000 ....++... &63c4 82 b9 c1 46 10 03 17 62 50 32 28 01 e4 b0 2b 3b ; 0000001b1b1b1b1b080808081b1b1b1d<<1b1b00 ................ &63d4 e4 d4 9e 40 52 22 02 2a 47 49 1a 02 c9 a0 24 04 ; 00001b1d<<1b1b0808080808080808081b1b1b19 .................* &63e4 b6 f2 34 23 5d 1e 77 77 7d dc dd f5 71 77 d7 5f ; 1d<<1b1b0805<<08081e080c03040c081b1e1b19 .....[]....+..+....* &63f4 ee ee ee ee ce 05 d0 ef 5c cf 05 b1 e7 64 d8 38 ; 1e1b1e0808^^<<08081b1b0102010208081b1b19 .....[]............* &6404 17 e8 39 43 ec 24 22 04 7a ce 10 3b 89 0b 81 9e ; 1b1b0808080817<<17<<1b1e080e<<<<081b1b19 ......[][]...[]....* &6414 33 c4 4e 22 42 10 7b 4e 86 8d 73 01 fc 39 d7 73 ; 1e0817<<081b^^<<^^<<1b1b08^^<<<<08081e19 ..[]..[][]...[]....* &6424 b7 e7 ee ee ee ee 5c c3 1e 77 0f b7 c7 c3 dd ed ; 1b08^^<<081b1b17<<1b1b1b1b1b080e<<<<0808 ..[]...[]......[]... &6434 71 77 d7 c7 dd 5d 4e 1e 3b 9b 5d 8b bf 6e a7 bb ; 1b0817<<081b1b^^<<1b1e1b1b1b1b^^<<<<0808 ..[]...[]......[]... &6444 9e 3c 32 cf b3 4b f1 c7 ad ef f2 e8 fc bf 4b b6 ; 0808^^<<05<<081b1b1b1b1b0c1b1b08080e<<<< ..[][]......+....[]. &6454 64 eb 33 e4 d1 b3 7c 9e ea ff ba dc 92 f5 d5 1f ; 08081908^^<<081b1b1d<<1b1b1b1b1b08^^<<<< ..*.[]...........[]. &6464 1d 92 4f f9 d4 f6 2e 8f 5b 6f 69 59 1f 3d e3 da ; 1b190819081b1b1b1b1b1b1b1b1b1e1b081b0808 .*.*................ &6474 23 e7 64 93 c7 e5 70 19 56 a2 44 63 ad 97 28 ec ; 1e0819081b1b1b1b1b00001b1e1b1b1b1b1b0808 ..*...... ......... &6484 b5 bd 46 51 4e da dc 1c 11 c4 ea 53 dc 11 e9 fb ; 1b1b081d<<0000000000001b1b1b00001b1b1b08 ..... ... .... &6494 6f c3 90 5e f4 71 25 f6 ea f2 84 bb 6b fc ff e7 ; 1b1b081b1b000000000000001b1b00001d<<1b1b ..... .. .... &64a4 f6 7f 11 11 91 fe 4f 7c 5e 22 22 fc b7 74 8f 28 ; 1b1e1b000000000000000000000000001b1e1b1b ... .... &64b4 a9 db 67 25 8a db 27 6d 6f ff e3 f6 c9 5a 1f 3b ; 1b1b00000000000000000000000000001b1b1b1b .. .... &64c4 b7 f8 a2 fd 8f ff ff af 4f 32 dc e2 0b 79 6c 7e ; 00000000000000000000000000000000001b1e00 .. &64d4 8a 14 d7 cf 1e e9 6d f8 27 73 b1 4e 68 b1 af 5d ; 0000000000000000000000000000000000000000 &64e4 a1 b4 d8 57 a4 62 c5 ea 57 b9 6b d2 ac 52 27 77 ; 0000000000000000000000000000000000000000 &64f4 bd 37 ec 4e 7a 6f 9c 5c dd d0 36 62 77 75 43 dd ; 0000000000000000000000000000000000000000 &6504 50 c1 ad 6d 43 e5 ca 86 b2 a1 97 0d bd 31 6d 4b ; 0000000000000000000000000000000000000000 &6514 db 50 37 d4 14 a9 1b ea a6 8e f4 de 7b 61 6a 20 ; 00000000001b05<<090909000000000000000000 .[]... &6524 bd 17 a8 44 40 2d 2d 54 04 16 5c 70 11 85 27 22 ; 000000001b1b^^<<1b1b09091b00000000000000 ..[]..... &6534 78 22 78 32 ; 000000001b1b1b1b1b1b1b091b1b000000000000 .......... ; 000000001b1b1b1b1b1b0809081b1b0000000000 ........... ; 00000000001b1b1b1b08080908081b1b00000000 ........... ; 00000000001b1b04020c0409030c01031b000000 ....+...+... ; 0000000000001b0908040e<<<<0308091b000000 ....[]..... ; 1b00000000001b090801^^<<<<0208091b000000 . ....[]..... ; 1b08000000000001030d0109020d04021b000000 .. ..x...x... ; 1b081b1b0000001b080808090808081b1b000000 .... .......... ; 1b081b1b080000001b08080908081b1b1b000000 ..... ......... ; 1b08080808000000001b0809081b1b1b00000000 ..... ....... ; 001b08190819000000001b091b1b1b1b00000000 ..*.* ...... ; 001b1b1b191b1b0000001b091b1b1b1b1b000000 ...*.. ....... ; 00001b191b1908080000000909091b1b1b1b0000 .*.*.. ....... ; 00001b00000008080000000000090909091b1b00 . .. ...... ; 00001b00000000000800000000001b0909091b00 . . ..... ; 0000001b000000000000000000001b1b09091b1b . ...... ; 000000001b00000000000000001b1b1b09091b1b . ....... ; 00000000001b1b1b0808080808081b1b09091b1b ............... ; 00000000001b1b0805<<000000081b1b09091b1b ...[] ....... ; 0000000000000008^^<<0000001b1b0c17<<1b1b .[] ..+[].. ; 000000000000000000000000001b17<<^^<<0c1b .[][]+. ; 000000000000000000000000001b^^<<0d17<<1b .[]x[]. ; 000000000000000000000000001b0c17<<^^<<1b .+[][]. ; 00000000000000000000000000001b^^<<0c1e1b .[]+.. ; 00000000000000000000000000001b1b1b1b1b1b ...... ; 0000000000000000000000000000001b1e1b1b1b ..... ; 00000004020808080100000000000000001d<<1b ...... ... ; 0000040908081908080100000000000000001b1b ....*... .. ; 000009090808080808080000000000000000001b ........ . ; 000009090308080808080000000000000000001b ........ . ; 000009090909090308080000000000000000001e ........ . ; 0000090909090909080800000000000000000000 ........ ; 0000010909190909080400000000000000000000 ...*.... ; 0000000109090902040000000000000000000000 ...... ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 000000000000000000000000000000001b1b1b1b .... ; 00000000000000000000000000001b1b1b190808 ...*.. ; 0000000000000000000000001b1b1b1904090308 ...*.... ; 0000000000000000000000001b08080808090208 ........ ; 0000000000000000000000001b08080808020408 ........ ; 000000000000000000001b1b1b19080d08040908 ...*.x.... ; 000000000000001b1b1b1b190808080808010902 ....*........ ; 00000000001b1b1b1908080804030808080817<< ...*.........[] ; 00000000001b190808080804080803080808^^<< .*...........[] ; 00000000001b08080808080c09090c080817<<08 ......+..+..[]. ; 00000000001b08080817<<010808020808^^<<08 ....[]......[]. ; 0000000000001b0808^^<<080102080817<<0808 ...[].....[].. ; 000000000000001b1b08080808080808^^<<0808 .........[].. ; 00000000000000001b080808080e<<<<08080808 .....[]..... ; 1b1b0000000000001b1b1b1b08^^<<<<08080819 .. .....[]....* ; 1b1b1b1b000000000000001b1b1b080808191919 .... ......*** ; 1b1b1b1b1b1b00000000001b1b1b1b1b19191919 ...... .....**** ; 1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b191919 .................*** ; 1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b19 ...................* ; 1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b .................... ; 1b1b1b1d<<1d<<1d<<1d<<1d<<1d<<1d<<1b1b1b .................... ; 1b1b1d<<1e1e1e1e1e1e1e1e1e1e1e1e1b1d<<1b .................... ; 1b1d<<1e1b1b1b1b1b1b1b1b1b1b1b1b1e1b1d<< .................... ; 1d<<1e1b1e1e1b1b1b1e1e1b1b1b1e1e1b1e1b1d .................... ; 1b1b1e1b1e1b1b1b1d<<1b1d<<1b1b1e1b1e1b1b .................... ; 1d<<1e1b1b1b1d<<1b00001b1b1d<<1b1b1e1b1d ......... ......... ; 1b1b1e1b1b1e1b1b000000001b1b1e1b1b1e1b1b ........ ........ ; 1d<<1e1b1b1e1b1b000000001b1b1e1b1b1e1b1d ........ ........ ; 1b1b1e1b1b1b1d<<1b00001b1b1d<<1b1b1e1b1b ......... ......... ; 1d<<1e1b1b1b1b1b1d<<1b1d<<1b1b1b1b1e1b1d .................... ; 1b1b1e1b1b1b1d<<1b00001b1b1d<<1b1b1e1b1b ......... ......... ; 1d<<1e1b1b1e1b1b000000001b1b1e1b1b1e1b1d ........ ........ ; 1b1b1e1b1b1e1b1b000000001b1b1e1b1b1e1b1b ........ ........ ; 1d<<1e1b1b1b1d<<1b00001b1b1d<<1b1b1e1b1d ......... ......... ; 1b1b1e1b1e1b1b1b1d<<1b1d<<1b1b1e1b1e1b1b .................... ; 1d<<1e1b1e1e1b1b1b1e1e1b1b1b1e1e1b1e1b1d .................... ; 1b1d<<1e1b1b1b1b1b1b1b1b1b1b1b1b1e000000 ................. ; 1b1b1d<<1e1e1e1e1e1e1e1e1e1e1e1e00000000 ................ ; 1b1b1b1d<<1d<<1d<<1d<<1d<<1d<<0000000000 ............... ; 1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b0000000000 ............... ; 0000001b1b1b1b1b1b1b1b1b1b1b1b1b00000000 ............. ; 000000001b1b1b1b1b1b1b1b1b1b1b1b19190000 ............** ; 000000001b1b1e1e1e1e1b1b1b1b1b1919191900 ...........**** ; 0000001b1e1e1e1b1b0000000000000019191900 ...... *** ; 0000001e1d<<0000000000000000000000001919 ... ** ; 00001d<<0000000000000000000000000000001b .. . ; 00001d<<0000000000001b1d<<0000000000001b .. ... . ; 001b1e000000000000001e0805<<00000000001b .. ..[] . ; 1b1b1b00000000000005<<0d^^<<00000000001b ... []x[] . ; 081919190000000000^^<<081e0000000000001b .*** [].. . ; 0e<<<<191b00000000001b1d<<0000000000001b [].*. ... . ; ^^<<<<191b000000000000000000000000001b1b [].*. .. ; 080908081b1b000000000000000000001b1b1b1b ...... .... ; 1b091b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b .................... ; 1b091b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b .................... ; 1b091b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b .................... ; 1b090909091b1e1e1e1e1e1e1e1e1e1b1b1b1b1b .................... ; 001b1b1b09091e1b1b1b1b1b1b1b1e1b1b1b1b1b ................... ; 0000001b1b091e1b1d<<1b1b1d<<1e1b1b1b1b1b ................. ; 0000000000091e1b1b0000001b1b1e1b1919191b .... ....***. ; 0000000000091e1b1b0000001b1b1e1b191e191b .... ....*.*. ; 0000000000091e1b1b0000001b1b1e1b1919191b .... ....***. ; 0000001b1b091e1b1d<<1b1b1d<<1e1b1b1b1b1b ................. ; 001b1b1b1b091e1b1b1b1b1b1b1b1e1b1b1b1b1b ................... ; 1b1b1b1b1b091e1e1e1e1e1e1e1e1e1b1b1b1b1b .................... ; 1b1b191b1b091b1b1b1b1b1b1b1b1b1b1b1b191b ..*...............*. ; 1b1b1b1b1b091b1b1b1b191b1b1b1b1b1b1b1b1b ..........*......... ; 1b1b1b1b1b091b1b1b1b1b1b1b1b1b1b1b1b1b1b .................... ; 1b1b1b1b1b091b1b1b1b1b1b1b1b1b1b1b1b1b1b .................... ; 1b1b1b1e1b091b1b1e1b1b17<<1b1b1b1b1b1b1b ...........[]....... ; 081b1b1b1b0909091b1b1b^^<<1b1b1b1e1b1b1b ...........[]....... ; 05<<1b1b1b1e1b091b17<<17<<17<<1b1b1b1b1b [].......[][][]..... ; ^^<<081b1b1b1b091b^^<<^^<<^^<<1b1b1b1b1b [].......[][][]..... ; 0808080805<<1b091b1b1b17<<09090909090909 ....[].....[]....... ; 04030403^^<<0c091d<<1b^^<<091b1b1b1e1b1b ....[]+....[]....... ; 0117<<02080808090909090909091b1b1b1b1b1e .[]................. ; 04^^<<03080808080c1b1b1b1b091b1b1b1d<<1b .[].....+........... ; 01020102080805<<080808081b091b1b1b1b1b1b ......[]............ ; 080808080808^^<<0e<<<<080c091b1b1b1e1b1b ......[][]..+....... ; 0000000000000000^^<<<<0808091b1e1b1b1b1b [].......... ; 0000000000000000000008081b091b1b1b1b1b1e .......... ; 0000000000000000000000000000001b1d<<1b1b ..... ; 0819081908080000000000000000000000001b1b .*.*.. .. ; 080808080819080000000000000000000000001e .....*. . ; 080805<<08080819081b1b1b0000000000000000 ..[]...*.... ; 1b08^^<<0817<<08081b1b1b1b0000001b000000 ..[].[]...... . ; 1b1b080808^^<<09081b1b1b1b1b1b1b1b000000 .....[].......... ; 1b0808080805<<090909091b1b1d<<1b1b000000 .....[].......... ; 0808080808^^<<1b1b1b091b1b1b1b1b1b1b0000 .....[]........... ; 05<<0808081b1b1b1b1b09191b1b1b1b1b1b1b1b [].........*........ ; ^^<<1b1b1b1b1b1b1b1909090909090909090909 [].......*.......... ; 1b1b1b1b1b1b09090909090919191919190e<<<< ............*****[]. ; 09090909091909091b1b1b1b0819191919^^<<<< .....*.......****[]. ; 1b1b1b1b090909091b1b0e<<<<05<<1919080e<< ..........[].[]**.[] ; 1b1b1b1b1b1b09091b1b^^<<<<^^<<081908^^<< ..........[].[].*.[] ; 1b1b1b1b1b1b09091b080805<<08080909090909 ...........[]....... ; 1b1b1b1b1b1b09091b0c08^^<<0808091b1b1e1b .........+.[]....... ; 1b1b1b1b1b19090919080809090909091b1b1b1b .....*..*........... ; 0909090909090909090909091b1b1b090d1d<<1b ................x... ; 1b1b1b1b1b190909191b091b1b17<<09081b081b .....*..*....[]..... ; 1b1b1b1b1b1b09091b1b091b08^^<<0808080808 .............[]..... ; 1d<<1b1b1b1b09091b17<<081b1b080808080000 .........[]....... ; 1b1b1b081b1b090908^^<<081e08000000000000 .........[]... ; 1b1b1b081b1b0909081b08080800000000000000 ............. ; 081b1b080808090908080800000000000000001e ........... . ; 08081b08081b1b0808080000000000001e1b1e1e .......... .... ; 08080808080808080808000000000000001e1e1b .......... ... ; 0808080808080808080800000000000000001b1e .......... .. ; 0808081f08081f1f1f1f1f000000000000001e1e ...?..????? .. ; 0808081f0808081f080808000000000000000000 ...?...?... ; 1f1f1f1f1f1f08081f0808080000000000000000 ??????..?... ; 081f081f08080808081f08080808080800000000 .?.?.....?...... ; 08081f1f08081f0808081f0808080e<<<<000000 ..??..?...?...[]. ; 0808081f0808081f1f1f08080808^^<<<<000000 ...?...???....[]. ; 0808080808080808080808080808080808000000 ................. ; 0008080819000000080808080808080808000000 ...* ......... ; 0000081919000000000008080e<<<<0800000000 .** ..[].. ; 000019190000000000000019^^<<<<0000000000 ** *[]. ; 0000001900000000000000001919080000000000 * **. ; 0000000000000000000000000019190000000000 ** ; 0000000000000000000000000019000000000000 * ; 0000000000000000000000000000000000000000 # Relocatable block &12 # &01c9 bytes copied from &6538-&6700 to &9a7b-&9c43 at &448a in enhanced version # or to &173f-&1907 at &469f in standard version ; map_4_data &6538 a2 01 ; compressed map data length = &1a2 &653a 02 ; plus 2 bits &653b 11 ; compression table has 17 entries: &653c 42 04 a8 a0 88 98 28 c8 70 39 30 20 49 18 08 10 ; 11 => tile &00, 4 bits &654c 50 ; 100 => tile &11, 0 bits &654d 0d 07 0e 21 0c 12 10 1a 71 d9 51 69 79 38 28 49 ; 101 => tile &08, 2 bits &655d 99 ; 110 => tile &15, 0 bits ; 0000 => tile &05, 0 bits ; 0010 => tile &13, 0 bits ; 1010 => tile &19, 0 bits ; 00001 => tile &14, 0 bits ; 01000 => tile &01, 0 bits ; 11000 => tile &03, 0 bits ; 001001 => tile &02, 0 bits ; 010001 => tile &06, 0 bits ; 101001 => tile &04, 0 bits ; 110001 => tile &0e, 0 bits ; 111001 => tile &09, 1 bit ; 0011001 => tile &0a, 0 bits ; 1011001 => tile &07, 1 bit ; &655e e5 1f 7a 79 6c db b6 dd db 14 86 30 84 21 0c 61 ; 0800000000000000000000000000000000000808 e 65 &656e e9 ff d0 6d db f6 58 78 84 21 0c 61 08 27 6f 79 ; 0808080000000015151515151515151508080808 ... ............. &657e 78 f3 e1 2b a6 e5 e0 cd 47 1e b9 c0 74 bb 78 99 ; 0808000000000014001400140014001400000008 .. . . . . . . &658e 6e 8f 58 2c 1b 47 5e cd 34 5c 72 35 d3 3f 37 f9 ; 0808080000000000000000000000000000000000 ... &659e c0 dc f8 99 86 43 2c 96 91 7e f8 81 b9 c9 67 1a ; 0808080815151515151515000000000000000000 ........... &65ae 7e fa e7 0f a6 db 6c ba 2d f2 72 69 e6 d8 4c 43 ; 0811000014001400140014000000000000000000 .. . . . . &65be 33 c7 66 7a a1 61 e4 45 8f b2 80 f9 9b ff 42 b7 ; 0011000000000000000000000000000013000000 . . &65ce 9f 6e af 36 f3 d6 6a ce 5a 74 a1 db aa 05 4c c7 ; 0011000000000000000000000000000011000000 . . &65de ab 9a 5e 0b 98 6e 5f 3b 8a f9 f5 72 94 85 63 37 ; 0011000000000000000000000000131511151300 . ..... &65ee cb 22 63 81 42 97 bb ef 4d 8b 96 5f b5 fd aa 5a ; 0011000000000000000000000000000011000000 . . &65fe ff 02 65 ef 65 2d 71 2f 67 b5 6d db b6 6d db b6 ; 0013000000001300000000000005<<1511150808 . . []..... &660e fb 5d b3 ca 5d a3 bf ff 43 fb ff 7f d0 41 07 fd ; 00000000000011000000000000^^<<1511150808 . []..... &661e d3 1c fe 35 a7 39 fd 11 93 53 8b 2e 3a 70 d0 4d ; 0000000013151315130000000000000011000000 ..... . &662e 4b 8a 53 fc f0 d3 86 f2 49 d1 83 63 4b f3 d8 b6 ; 00000000000011000000000000080815111505<< . .....[] &663e 69 db b6 97 82 12 94 3c 7c eb c3 ab 4c 7d e1 d4 ; 000000000000130000000000000808151115^^<< . .....[] &664e a6 12 2f 3c 7a 99 8a 6d db ee 57 7b 38 b5 8d 0f ; 0000000000000000000000000000000011000000 . &665e a7 b6 f1 e1 d4 36 da ee 4b f9 c2 a2 5a 54 35 cd ; 0000000013000000000000000005<<1511000000 . [].. &666e e1 53 07 55 2d aa ed d4 a5 22 4d 56 5d 7a f9 cb ; 00000000110000000000000000^^<<15111505<< . []...[] &667e d0 16 d9 cb c2 bd 2c 74 fb 69 f8 e9 9f 6e 33 98 ; 000013151315130000000000000000001115^^<< ..... ..[] &668e bf f9 c9 49 c3 c4 93 b6 e5 e0 06 e6 c4 83 9b 39 ; 0000000011000000000000000005<<1511000000 . [].. &669e f1 e0 c9 43 6c da b6 2d 93 39 f1 e0 c1 8b 9e 78 ; 00000000130000000000000000^^<<15111505<< . []...[] &66ae f0 08 17 2f 1e 1c 69 db b6 6d 8e 5c 2a 8f 30 ca ; 000000000000000000000000000000001115^^<< ..[] &66be d2 52 e2 af 4c 15 31 39 64 e8 e5 e9 b6 6d 0e 05 ; 0000000000000000000000000000000011000000 . &66ce da d4 cb c2 7e 95 78 61 6f 27 5b f6 6b bb 64 a2 ; 0000000000000000000000000005<<1511150808 []..... &66de 97 47 89 da 23 83 0c b2 70 e9 0f 4d d3 1c 3c b5 ; 00000000000000000000000000^^<<1511150808 []..... &66ee 45 8a 14 29 52 4c c3 52 1e 9a a6 39 d8 9f 0c 32 ; 0000001300000000000000000000000011000000 . . &66fe c8 bf 03 ; 08081511000000000000000000080815111505<< .... .....[] ; 080815110000000000000000000808151115^^<< .... .....[] ; 000000111505<<00000000000000000011000000 ..[] . ; 0000001115^^<<00000000000000000013000000 ..[] . ; 05<<151100000000000000000000000000000000 [].. ; ^^<<151100000000000000000000000000000000 [].. ; 0000001115080800000000000000000000000000 .... ; 0000001115080800000000000000000000000019 .... * ; 0808151100000000000000000000000000001908 .... *. ; 0808151100000000000000000000000000190819 .... *.* ; 0000001115080800000000000000000000001908 .... *. ; 05<<1511150e<<<<000000000000000000000019 []...[]. * ; ^^<<151115^^<<<<000000000000000000000008 []...[]. . ; 05<<151115080800000000000000000808000008 []..... .. . ; ^^<<151100000000000000000808080808000008 [].. ..... . ; 0000001100000000000000000008080808151108 . ....... ; 000000130000000000000000000805<<08111508 . .[].... ; 0000000000000000000000000000^^<<08080808 [].... ; 0000000000000000000000000000000808190819 ..*.* ; 0800000000000000000000000000000000191908 . **. ; 0800000000000000000000000000000000191919 . *** ; 0808080000000000000000000000000000000008 ... . ; 05<<080000000000000000000000000000000808 []. .. ; ^^<<0808080000000000000000000000080e<<<< []... .[]. ; 0808080808000000000000000000000808^^<<<< ..... ..[]. ; 0815151515151515151515151515151515151508 .................... ; 0808080000000000000000000000000000080808 ... ... ; 07<<080000000000000000000000000000080808 ... ... ; 06<<000000000000000000000000000000000808 .. .. ; 0808000000000000000000000000000000000008 .. . ; 0800000000000000000000000000000000000000 . ; 0000000000000000000000000000000000000000 ; 0000000000000000000019001900190000000000 * * * ; 0000000000000000000000040903000000000000 ... ; 0000000000000000000019091909190000000000 *.*.* ; 0000000000000000000000011102000000000000 ... ; 0000000019081900000019001100190000000000 *.* * . * ; 0000190804030403000000001100000000000000 *..... . ; 0019080801090902081900001100000000000000 *.......* . ; 0000080804090903151515151115151515151515 .................. ; 0000000801020102000000001100000000000000 ..... . ; 0000000000080808000000001100000000000008 ... . . ; 0000000000080808080000001100000000000808 .... . .. ; 0000000000080e<<<<0000001100000808080808 .[]. . ..... ; 000000000008^^<<<<1515151515151508080808 .[]............ ; 0000000000000808000000001100000000000808 .. . .. ; 0000000000000011000000001100000000000808 . . .. ; 0000000000000011000000001100000000000808 . . .. ; 0000000000000011151515080808080000000800 ........ . ; 0000000000000014000000191908191919040903 . **.***... ; 0000000000000000000019001919190819190808 * ***.**.. ; 0000000000000000000019000000080808011902 * ....*. ; 0000000000000000000000190000000808080808 * ..... ; 0000000000000000000000000000000008000808 . .. ; 0000001300000000000000000000000000000008 . . ; 0000001100000000000000000000000000000008 . . ; 0000001115080800000000000000000000000000 .... ; 000000111505<<00000000000000000000000000 ..[] ; 0000001115^^<<00000000000000000000000000 ..[] ; 0000001115080800000000000000000000000000 .... ; 05<<151100000000000000000000000000000000 [].. ; ^^<<151100000000000000001300000000000000 [].. . ; 000000111505<<00000000001100000000000000 ..[] . ; 0000001115^^<<15151300001100000000000000 ..[]... . ; 05<<151100000000001100001100000000000000 [].. . . ; ^^<<151100000000001100001100000000000000 [].. . . ; 0000001100001315151115151515151513000000 . ........... ; 0000151100000000001100001100001100000000 .. . . . ; 0000111500000000001100001100001400000000 .. . . . ; 0000110000000000001100001100000000000000 . . . ; 0000111515151515151515151100000000000000 ........... ; 0000110000000808081100001400000000000000 . .... . ; 0000130000000808041103000000000000000008 . ..... . ; 0000000000080808011102000013000808080808 ...... . ..... ; 0000000008080808151515151511000805<<0808 .......... .[].. ; 00000000000808080808000000110808^^<<0808 ..... ...[].. ; 000000000000080e<<<<00000011080808080808 .[]. ....... ; 00000000000000^^<<<<00000011080807<<07<< []. ....... ; 000000000000000000000000151515080a<<06<< ........ ; 0000000000000000000000001100000806<<0808 . ..... ; 0000000013001300130000001100000008080808 . . . . .... ; 0000000011151115111511001500000000000808 ....... . .. ; 000000130813081308130815111505<<00000008 ...........[] . ; 0000000011151115111511001515^^<<00000000 ....... ..[] ; 0000000013001300130000000000000000000000 . . . ; 0000000000000000000000000000000000000000 # Relocatable block &14 # &01d3 bytes copied from &6701-&68d3 to &9621-&9a7a at &448a in enhanced version ; map_5_data &6701 ae 01 ; compressed map data length = &1ae &6703 03 ; plus 3 bits &6704 10 ; compression table has 16 entries: &6705 a9 04 88 a0 98 18 20 c8 10 08 28 41 38 50 31 70 ; 11 => tile &00, 4 bits &6715 0e 07 09 52 18 72 4a 14 6a 20 3a 0d 22 3c 2c 30 ; 001 => tile &11, 0 bits ; 101 => tile &08, 1 bit ; 110 => tile &15, 1 bit ; 0100 => tile &19, 0 bits ; 1000 => tile &13, 0 bits ; 00000 => tile &01, 0 bits ; 00010 => tile &07, 0 bits ; 01100 => tile &06, 1 bit ; 10000 => tile &0e, 0 bits ; 11010 => tile &05, 0 bits ; 11100 => tile &0a, 0 bits ; 001010 => tile &04, 0 bits ; 010010 => tile &14, 0 bits ; 101010 => tile &02, 0 bits ; 110010 => tile &03, 0 bits ; &6725 ee 6e 97 bb 5b 92 24 5f 92 24 ee 76 ba 5b 92 bc ; 1515151515151500000000000015151515151515 67..... ....... &6735 49 e2 76 bb 25 7f 22 fd 87 34 e1 20 3f ca 80 9b ; 1111111111110000000000000000111111111111 ...... ...... &6745 7c c4 48 3e 14 b2 1c ca 43 b2 c5 48 3d 00 59 4c ; 1515151515000000000000000000001515151515 ..... ..... &6755 a1 87 54 cb a0 3e 60 88 01 7a d4 23 5f 0e b0 c5 ; 1111111100000000000000000000000011111111 .... .... &6765 f4 a1 2d 5b 5b ec b0 58 3f 6d f9 62 bd 05 2f cc ; 1515150000000000000000000000000000151515 ... ... &6775 58 96 2b ee be f4 90 2b 43 8e 2c a5 87 5c 31 dd ; 1111000000000000000000000000000000001111 .. .. &6785 47 5b ae 0c b5 e4 c8 90 2b 43 2f ee 9e 2b 56 ff ; 1400000000000000000000000000000000000014 . . &6795 ff ff ff ff a3 e3 1f 9d 3f f9 23 f2 87 e7 0f cf ; 0000000000130003000000000400130000000000 . . . . &67a5 8d 43 78 06 7c 63 61 62 b9 dc dd 44 0b 77 b7 29 ; 0000030000111519030000041915110000040000 . ..*. .*.. . &67b5 c5 9b 57 ce 14 6f 5e 39 53 4c 33 95 c9 dd 44 8b ; 0000190315111519020000011915111504190000 *....*. .*....* &67c5 16 ee b6 a4 78 f3 e6 95 2b c5 34 d3 4c 65 71 13 ; 0000190215110002000000000100111501190000 *... . . ...* &67d5 5a 58 84 16 6e 0b 1b 63 27 cc 1b 5c 30 f6 5a 70 ; 0000020000110000000000000000110000010000 . . . . &67e5 c0 d8 6d c1 d8 6f b1 ff b0 9d 88 fe 81 88 26 7c ; 0000000000111505<<000005<<15110000000000 ..[] [].. &67f5 73 e5 44 77 d3 96 53 7a 62 31 bd f6 12 5b 5b 5b ; 00000808151115^^<<0000^^<<15111508080000 .....[] []..... &6805 7e 8b e9 8f 88 a6 d8 47 44 87 b6 bc 59 2c a6 37 ; 0000080815110000000000000000111508080000 .... .... &6815 74 b7 25 b6 49 4f 96 dc 70 c1 ff ff ff 7f 81 37 ; 0000000000111300000000000013110000000000 .. .. &6825 b9 d3 9c 25 2f 5a 0f 38 f4 47 47 86 b6 58 1b 5e ; 0000000008151100000000000011151515151515 ... ....... &6835 19 ba 6b c8 d0 43 06 7a 62 5d 43 86 1c 5d 43 0e ; 0000000808001100000000000011001100001100 .. . . . . &6845 78 e4 e8 94 75 59 16 74 d7 75 e4 c8 93 23 47 b9 ; 00000805<<0011000000000000111505<<080800 .[] . ..[].. &6855 e3 00 8f 58 97 55 fa c8 93 a1 eb c8 90 a1 cb f2 ; 000808^^<<15110000000000001100^^<<080000 ..[].. . []. &6865 d0 90 a1 87 0c dd 35 e4 42 6b 8b f5 90 83 be 1e ; 0011000011001100000000000011000808000000 . . . . .. &6875 70 68 c3 37 4b 66 72 e8 f4 5f f8 2f f9 b5 e5 b7 ; 1515151515151100000000000011150800000000 ....... ... &6885 e0 7f 24 bb b6 c4 fa b5 c4 7a 4f f6 b6 c4 f4 db ; 0000000000000000000000000000000000000000 &6895 96 d8 9e ec da 12 d3 af 25 b6 27 7b 5b 62 fa 6d ; 0000000000000000000000000000000000000000 &68a5 4b 6c 4f fe 03 63 8a fc c7 80 ea ee 6e fd 54 de ; 0000000000000000000000000000000000000000 &68b5 ae 81 34 9e 5d a4 6b 6c d2 dd 57 93 2e d8 f5 14 ; 0000000000000000000000000000000000000000 &68c5 e9 ee ae a9 bb bb 60 6d 5d 4b f7 dc 0d ff 02 ; 0000000000000000000000000000000000000000 ; 0000000000000000131515130000000000000000 .... ; 00000000000000001105<<110000000000000000 .[]. ; 000000000000000011^^<<110000000000000000 .[]. ; 00000000000000001107<<110000000000000000 .... ; 0000000000000000110a<<110000000000000000 .... ; 0000000000000000110a<<110000000000000000 .... ; 0000000000001300110a<<110013000000000000 . .... . ; 00000000000011151106<<111511000000000000 ........ ; 1515151515151507<<080807<<15151515151515 .................... ; 000000000011080a<<08080a<<08110000000000 .......... ; 000000000011080a<<08080a<<08110000000000 .......... ; 0000000000110806<<080806<<08110000000000 .......... ; 151515151507<<080807<<080807<<1515151515 .................... ; 00000011080a<<08080a<<08080a<<0811000000 .............. ; 000000110806<<080806<<080806<<0811000000 .............. ; 15151507<<05<<07<<151107<<05<<07<<151515 .....[]......[]..... ; 00000006<<^^<<06<<111506<<^^<<06<<000000 ..[]......[].. ; 0000131100000000000000000000000011130000 .. .. ; 0013111500000000000000000000000015111300 ... ... ; 1311150000000000000000000000000000151113 ... ... ; 1115000000000000000000000000000000001511 .. .. ; 1500000000000000000000000000000000000015 . . ; 0000000000000000000000000000001919190000 *** ; 0000000000000000000000000000001919190000 *** ; 0000001300000000000000000000000011000000 . . ; 0000001100000000000000000000131515151515 . ...... ; 05<<151100000000000000000000140000000011 [].. . . ; ^^<<15111505<<00000000000000000000000808 []...[] .. ; 0000001115^^<<00000000000000000000000808 ..[] .. ; 05<<151100000000000000000000000000000000 [].. ; ^^<<15111505<<00000000000000001919190000 []...[] *** ; 0000001115^^<<00000000000000001919190000 ..[] *** ; 05<<151100000000000000000000000011000000 [].. . ; ^^<<15111505<<00000000000000131515151515 []...[] ...... ; 0000001115^^<<00000000000000140000000011 ..[] . . ; 0000001100000000000000000000000000000e<< . [] ; 000000130000000000000000000000000000^^<< . [] ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000000000000000000000000 ; 0000000000000000000e<<<<0000000000000000 []. ; 000000000000191515^^<<<<1515190000000000 *..[]...* ; 0000000000000000110000001100000000000000 . . ; 0000000000131508080013000808000000000000 .... . .. ; 0000190000110008081511150808151300000000 * . ......... ; 0000110008080808080011000808001100190000 . ..... . .. . * ; 0000111508080800110011000008080800110000 ..... . . ... . ; 0e<<<<0000110000080811081508080815110000 []. . .......... ; ^^<<<<00131515151505<<080000110000110000 []. .....[]. . . ; 000011000011000008^^<<1515151513000e<<<< . . .[]..... []. ; 0000111508080815081108080000110000^^<<<< .......... . []. ; 0000110008080800001100110008080815110000 . ... . . ..... ; 0000190011000808001100080808080800110000 * . .. . ..... . ; 0000000013150808151115080800110000190000 ......... . * ; 0000000000000808001300080815130000000000 .. . .... ; 0000000000000011000000110000000000000000 . . ; 00000000001915150e<<<<151519000000000000 *..[]...* ; 0000000000000000^^<<<<000000000000000013 []. . ; 0000000000000000000000000000000000000011 . ; 0000000000000000000000000000000005<<1511 [].. ; 00000000000000000000000000000000^^<<1511 [].. ; 1300000000000000000000000000000000000011 . . ; 1100000000000000000000000000000005<<1511 . [].. ; 11150808000000000000000000000000^^<<1511 .... [].. ; 1115080800000000000000000000000000000011 .... . ; 1100000000000000000000000000000008081511 . .... ; 111505<<00000000000000000000000008081511 ..[] .... ; 1115^^<<00000000000000000000000000000011 ..[] . ; 1100000000000000000000000000000005<<1511 . [].. ; 111505<<000000000000000000000000^^<<1511 ..[] [].. ; 1115^^<<00000000000000000000000000000011 ..[] . ; 1100000000000000000000000000000008081511 . .... ; 111505<<00000000000000000000000008081511 ..[] .... ; 1115^^<<00000000000000000000000000000011 ..[] . ; 1100000000000000000000000000000000000013 . . ; 1115040300000000000000000000000000000000 .... ; 1115010215151515151515151508080000000008 ............... . ; 11000000000000000000000000080808001905<< . ... *[] ; 13000000000000000000000808081905<<08^^<< . ...*[].[] ; 00000000000000000008081905<<08^^<<080808 ..*[].[]... ; 00000000000008081905<<08^^<<0e<<<<080808 ..*[].[][].... ; 00000000081905<<08^^<<080808^^<<<<080808 .*[].[]...[].... ; 000000000008^^<<08080808080808080e<<<<08 .[]........[].. ; 00000000000000080808000000080808^^<<<<08 ... ...[].. ; 00000000000000000000000000080808080e<<<< ....[]. ; 0000000000000000000000000000000008^^<<<< ....[]. # Relocatable block &16 # &0229 bytes copied from &68d4-&6afc to &9e17-&a03f at &448a in enhanced version # to &1100-&1328 at &2a72 in both versions ; music_track_0_data &1100 10 ; beats in bar &1101 3c ; number of bars &1102 00 3c 78 b4 ; bar offsets &1106 00 06 08 07 ; instrument offsets &110a 07 ; vsyncs per beat ; p0 p1 p2 p3 p4 p5 c1 c3 c2 &110b 01 02 07 01 03 08 05 04 09 00 ; instruments &1115 06 00 06 05 00 06 00 00 00 00 ; percussion pitches &111f 07 04 04 07 07 04 07 06 0c 00 ; durations ; channel_zero_notes &1129 78 ; &00 &112a 50 02 02 02 02 02 ; &01 &1130 19 22 01 09 12 02 ; &07 &1136 09 01 01 12 21 02 12 ; &0d &113d 19 02 09 21 02 02 0a ; &14 &1144 1b 1b 1b 1b ; &1b &1148 19 19 19 01 12 ; &1f ; silence &114d ff ff ff ff ; &24 ; channel_one_notes &1151 1d 1d 29 30 35 38 30 28 30 28 1c 08 ; &28 &115d 15 15 24 29 31 30 28 24 28 24 15 ; &34 &1168 0d 0d 1c 25 29 29 21 1c 0d ; &3f &1171 11 1d 31 10 19 25 39 30 29 ; &48 &117a 08 08 38 08 38 38 08 39 39 08 38 08 38 38 ; &51 ; channel_two_and_three_notes &1188 fc 7c ac 98 b8 ac a4 ad ad a4 ac a4 98 88 ; &5f 3 &1196 ff ff fc 98 90 88 90 88 84 88 ; &6d 3 &11a0 ff ff fc ac a4 98 90 88 84 74 ; &77 3 &11aa 6b 8a 69 68 68 68 8a 88 ; &81 3 &11b2 88 89 85 89 84 7b fc 68 98 90 ; &89 3 &11bc 6b 61 58 55 4f fd 4c ; &93 2 &11c3 55 54 59 55 63 fe 69 ; &9a 2 &11ca 7d 74 75 6a 7c 75 64 62 58 ; &a1 2 &11d3 89 84 85 76 88 85 7c 77 ; &aa 3 &11db 61 60 62 69 57 fd 69 ; &b2 2 &11e2 89 88 89 85 85 7f fc 68 68 ; &b9 2 &11eb 65 64 65 61 61 5b fe ; &c2 3 &11f2 7d 74 75 7d 64 63 fe 68 ; &c9 2 &12fa 7c 85 85 89 85 7f 7c 7c 7c ; &d1 2 &1203 90 91 91 89 94 93 ff ; &da 2 &120a 4f 56 5b ff fc ; &e1 2 &120f 60 61 61 59 64 63 ff ; &e6 2 &1216 7c 75 75 7d 64 63 ff ; &ed 2 ; unused &121d 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f ; channel_zero_bars &1229 1b 1b 00 01 07 0d 07 14 07 0d 07 14 07 0d 07 14 &1239 07 0d 07 01 07 0d 07 14 07 0d 07 14 07 0d 07 01 &1249 1f 1f 1f 01 00 00 00 01 07 0d 07 14 07 0d 07 01 &1259 1f 1f 1f 01 07 0d 07 14 07 0d 07 01 ; channel_one_bars &1265 28 34 3f 48 28 34 3f 48 28 34 3f 48 28 34 28 48 &1275 24 24 3f 48 28 34 3f 48 28 34 28 48 24 24 3f 48 &1285 51 51 51 51 28 34 28 48 28 34 3f 48 28 34 28 48 &1295 24 24 24 24 28 34 28 48 24 34 3f 24 ; channel_two_bars &12a1 24 24 24 24 24 24 24 24 93 9a a1 b2 b9 c9 d1 da &12b1 e1 e6 e1 ed e1 e6 e1 ed 24 24 24 24 e1 e6 e1 ed &12c1 24 9a 24 da 24 24 24 24 e1 24 e1 24 e1 24 e1 ed &12d1 24 24 9a 9a e1 e6 e1 ed e1 e6 e1 ed ; channel_three_bars &12dd 24 24 5f 24 5f 5f 5f 6d 24 5f aa 24 c2 6d 24 77 &12ed 5f 6d 5f 77 24 5f 24 24 5f 5f 5f 77 24 6d 5f 77 &12fd 24 6d 24 77 81 81 81 77 81 81 81 6d 81 81 24 6d &130d 89 89 24 77 5f 6d 5f 77 6d 24 6d 24 ; unused &1319 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f # Relocatable block &18 # &0229 bytes copied from &6afd-&6d25 to &a040-&a268 at &448a in enhanced version # then to &1100-&1328 at &2a72 ; music_track_1_data &1100 10 ; beats in bar &1101 13 ; number of bars &1102 00 13 26 39 ; bar offsets &1106 00 06 08 07 ; instrument offsets &110a 0a ; vsyncs per beat ; p0 p1 p2 p3 p4 p5 c1 c3 c2 &110b 01 02 07 01 03 08 05 04 09 00 ; instruments &1115 06 00 06 05 00 06 00 00 00 00 ; percussion pitches &111f 07 04 04 07 07 04 07 06 0c 00 ; durations ; channel_zero_notes &1129 78 ; &00 &112a 0b 06 03 0b 06 0b 03 0e 03 03 06 06 ; &01 &1136 09 06 01 0b 01 09 03 0e 03 01 02 06 ; &0d &1142 09 02 11 02 09 01 02 01 01 01 0a ; &19 &114d 01 01 02 01 09 02 09 01 02 01 01 01 02 02 ; &24 ; silence &115b ff ff ff ff ; &32 ; channel_one_notes &115f 26 16 24 1e 1e 30 2c 1c ; &36 &1167 26 16 10 0b 08 38 30 24 1c ; &3e &1170 26 15 10 00 0b 08 38 08 30 2c ; &47 &117a 0a 08 38 08 30 2c 0a 08 10 1c 24 30 ; &51 &1186 26 24 2d 2c 33 30 30 3a ; &5d &118e 25 24 2e 1c 3b 39 30 2c 1c ; &65 &1197 26 24 2d 1c 17 14 14 14 14 1c ; &6e &11a1 0a 08 0a 1d 1d 24 30 2c 24 1c ; &78 ; channel_two_notes &11ab ff ff ff fc 54 5c 5c ; &82 &11b2 fd 63 5c 61 5c 60 5c 4f ; &89 &11ba 71 69 68 60 54 69 68 60 6c 6b ; &91 &11c4 84 84 84 84 91 7c 7d 79 87 fc ; &9b &11ce 85 7c 7e 70 85 7c 7c 70 7c 86 ; &a5 &11d8 85 7c 7d 7c 70 85 6d 6b 70 ; &af &11e1 85 7c 7d 7c 70 85 7c 7c 84 6c 68 60 68 ; &b8 &11ee fc 60 68 60 68 61 71 68 60 68 63 ; &c5 ; channel_three_notes &11f9 55 5c 60 71 60 71 54 5c 60 68 70 60 4c ; &d0 &1206 54 54 5c 60 70 70 60 71 54 5c 60 70 7c 6c 68 ; &dd &1215 91 8c 8e 8c 92 90 8c 90 9a ; &ec &121e 85 a0 84 75 90 7f fd 7c ac 7c ; &f5 ; unused &1228 3f ; channel_zero_bars &1229 01 01 01 0d 24 01 0d 0d 24 19 19 19 24 24 19 19 &1239 19 24 24 ; channel_one_bars &123c 32 36 3e 47 51 36 3e 47 51 5d 65 6e 78 51 5d 65 &124c 6e 78 32 ; channel_two_bars &124f 82 32 32 32 82 89 91 9b 32 a5 af b8 c5 32 a5 af &125f b8 c5 32 ; channel_three_bars &1262 dd d0 dd d0 dd f5 f5 32 dd 32 32 32 32 dd ec 32 &1272 ec 32 dd ; unused &1275 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &1285 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &1295 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &12a5 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &12b5 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &12c5 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &12d5 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &12e5 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &12f5 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &1305 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &1315 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f &1325 3f 3f 3f 3f # Relocatable block &1a # &0bd3 bytes copied from &6d26-&78f9 to &a269-&a3eb at &448a in enhanced version # then to &2600-&31d2 at &2062 ; sideways_ram_completion_data ; completion_sound_0 &2600 10 00 02 00 04 00 01 00 ; completion_sound_1 &2608 11 00 01 00 dc 00 02 00 ; completion_sound_2 &2610 00 00 03 00 06 00 01 00 ; completion_sound_3 &2618 00 00 02 00 05 00 01 00 ; completion_sound_4 &2620 00 00 03 00 06 00 03 00 ; play_completion_sound_x &2628 a9 07 LDA #&07 ; Generate a sound &262a a0 26 LDY #&26 ; &2600 &262c 4c f1 ff JMP &fff1 ; OSWORD ; completion_envelope_1 &262f 01 01 00 00 00 01 01 01 3c e2 f6 f6 3c 14 ; completion_envelope_2 &263d 02 01 00 00 00 01 01 01 7d c4 ec ec 7d 28 ; completion_envelope_3 &264b 03 01 00 00 00 01 01 01 01 46 e2 e2 0c 64 ; completion_screen_string &2659 13 00 07 00 00 00 13 &2660 01 00 00 00 00 1c 04 1f 4b 01 0c 19 04 3f 00 ff &2670 ff 19 05 c0 04 ff ff 19 05 c0 04 e0 03 19 05 3f &2680 00 e0 03 19 05 3f 00 ff ff 0a 20 ; sideways_ram_completion_screen &268b a9 7f LDA #&7f # Disable all user interrupts &268d 8d 6e fe STA &fe6e ; User VIA interrupt enable register &2690 ad 64 fe LDA &fe64 ; User VIA timer 1 counter LSB # Reset User VIA Timer 1 interrupt flag &2693 ad 68 fe LDA &fe68 ; User VIA timer 2 counter LSB # Reset User VIA Timer 2 interrupt flag &2696 a9 f2 LDA #&f2 # Enable interrupts on System VIA &2698 8d 4e fe STA &fe4e ; System VIA interrupt enable register # for Timer 1, Timer 2, CB1 (ADC) and CA1 (v-sync) &269b a9 60 LDA #&60 # Restore default value &269d 8d 4b fe STA &fe4b ; System VIA auxilliary control register &26a0 a2 08 LDX #&08 # Restore close to default value (&2708 versus &270e) &26a2 a0 27 LDY #&27 &26a4 8e 46 fe STX &fe46 ; System VIA timer 1 latch LSB &26a7 8c 47 fe STY &fe47 ; System VIA timer 1 latch MSB &26aa 8e 44 fe STX &fe44 ; System VIA timer 1 counter LSB &26ad 8c 45 fe STY &fe45 ; System VIA timer 1 counter MSB &26b0 ad b7 ff LDA &ffb7 ; os_default_vector_table_address_low &26b3 85 b0 STA &b0 ; default_vector_table_address_low &26b5 ad b8 ff LDA &ffb8 ; os_default_vector_table_address_high &26b8 85 b1 STA &b1 ; default_vector_table_address_high &26ba ac b6 ff LDY &ffb6 ; os_length_of_default_vector_table ; reset_vectors_loop &26bd 88 DEY &26be b1 b0 LDA (&b0),Y ; default_vector_table_address &26c0 99 00 02 STA &0200,Y ; os_vector_table &26c3 98 TYA &26c4 d0 f7 BNE &26bd ; reset_vectors_loop &26c6 58 CLI &26c7 ea NOP &26c8 a9 02 LDA #&02 ; Specify Input Stream &26ca a2 03 LDX #&03 ; Use the keyboard for input, but listen to the serial port too &26cc 20 f4 ff JSR &fff4 ; OSBYTE &26cf a9 08 LDA #&08 ; Define a sound envelope &26d1 a2 2f LDX #&2f &26d3 a0 26 LDY #&26 ; &262f = completion_envelope_1 &26d5 20 f1 ff JSR &fff1 ; OSWORD &26d8 a9 08 LDA #&08 ; Define a sound envelope &26da a2 3d LDX #&3d &26dc a0 26 LDY #&26 ; &263d = completion_envelope_2 &26de 20 f1 ff JSR &fff1 ; OSWORD &26e1 a9 08 LDA #&08 ; Define a sound envelope &26e3 a2 4b LDX #&4b &26e5 a0 26 LDY #&26 ; &264b = completion_envelope_3 &26e7 20 f1 ff JSR &fff1 ; OSWORD &26ea a9 14 LDA #&14 ; Implode user defined character font RAM &26ec a2 00 LDX #&00 ; characters &80 to &9F only are redefineable &26ee 20 f4 ff JSR &fff4 ; OSBYTE # Release any memory used by exploded characters ; unpack_font_data &26f1 a2 ca LDX #&ca &26f3 a0 2b LDY #&2b ; &2bca = packed_font_data &26f5 86 b0 STX &b0 ; packed_address_low &26f7 84 b1 STY &b1 ; packed_address_high &26f9 a2 00 LDX #&00 &26fb a0 19 LDY #&19 ; &1900 = unpacked_font_data &26fd 86 b2 STX &b2 ; unpacked_address_low &26ff 84 b3 STY &b3 ; unpacked_address_high &2701 a0 00 LDY #&00 ; unpack_font_data_loop &2703 b1 b0 LDA (&b0),Y ; packed_address # Get a byte of packed font data for pixel value &2705 c9 80 CMP #&80 &2707 29 7f AND #&7f &2709 aa TAX &270a bd 87 2b LDA &2b87,X ; font_pixel_values_table &270d 91 b2 STA (&b2),Y ; unpacked_address &270f 90 0e BCC &271f ; single_byte_run &2711 48 PHA # If top bit set, &2712 c8 INY &2713 b1 b0 LDA (&b0),Y ; packed_address # get a second byte of packed font data &2715 a8 TAY # for length of run &2716 aa TAX &2717 68 PLA ; run_loop &2718 91 b2 STA (&b2),Y ; unpacked_address &271a 88 DEY &271b d0 fb BNE &2718 ; run_loop &271d f0 02 BEQ &2721 ; end_of_run ; single_byte_run &271f a2 00 LDX #&00 ; end_of_run &2721 a9 01 LDA #&01 # Move on one or two bytes in packed font data &2723 65 b0 ADC &b0 ; packed_address_low &2725 85 b0 STA &b0 ; packed_address_low &2727 90 02 BCC &272b &2729 e6 b1 INC &b1 ; packed_address_high &272b 38 SEC &272c 8a TXA # Move on number of length of run in unpacked font data &272d 65 b2 ADC &b2 ; unpacked_address_low &272f 85 b2 STA &b2 ; unpacked_address_low &2731 90 02 BCC &2735 &2733 e6 b3 INC &b3 ; unpacked_address_high &2735 a5 b3 LDA &b3 ; unpacked_address_high &2737 c9 25 CMP #&25 ; &2500 = end of unpacked font data &2739 90 c8 BCC &2703 ; unpack_font_data_loop &273b a9 16 LDA #&16 # Change to MODE 0 &273d 20 ee ff JSR &ffee ; OSWRCH &2740 a9 00 LDA #&00 &2742 20 ee ff JSR &ffee ; OSWRCH &2745 85 b0 STA &b0 ; screen_address_low &2747 a8 TAY &2748 a9 30 LDA #&30 ; &3000 &274a 85 b1 STA &b1 ; screen_address_high ; fill_screen_with_hatching_loop &274c a9 e0 LDA #&e0 &274e 91 b0 STA (&b0),Y ; screen_address &2750 c8 INY &2751 a9 0e LDA #&0e &2753 91 b0 STA (&b0),Y ; screen_address &2755 c8 INY &2756 d0 f4 BNE &274c ; fill_screen_with_hatching_loop &2758 e6 b1 INC &b1 ; screen_address_high &275a 10 f0 BPL &274c ; fill_screen_with_hatching_loop &275c a2 00 LDX #&00 &275e a0 32 LDY #&32 ; write_completion_screen_string_loop &2760 bd 59 26 LDA &2659,X ; completion_screen_string &2763 20 ee ff JSR &ffee ; OSWRCH &2766 e8 INX &2767 88 DEY &2768 d0 f6 BNE &2760 ; write_completion_screen_string_loop &276a a2 53 LDX #&53 &276c a0 28 LDY #&28 ; &2853 = sideways_ram_completion_message &276e 86 b4 STX &b4 ; text_address_low &2770 84 b5 STY &b5 ; text_address_high &2772 a9 00 LDA #&00 &2774 85 b0 STA &b0 ; x ; plot_completion_message_loop # Two bytes per character &2776 a0 01 LDY #&01 &2778 b1 b4 LDA (&b4),Y ; text_address # Second byte of each pair is delay &277a 4a LSR A &277b aa TAX &277c 88 DEY &277d a9 81 LDA #&81 ; Read key with time limit &277f 20 f4 ff JSR &fff4 ; OSBYTE &2782 a0 00 LDY #&00 &2784 b1 b4 LDA (&b4),Y ; text_address # First byte of each pair is character &2786 48 PHA &2787 c9 20 CMP #&20 &2789 f0 12 BEQ &279d ; plot_space &278b a2 00 LDX #&00 ; completion_sound_0 &278d 20 28 26 JSR &2628 ; play_completion_sound_x &2790 a2 08 LDX #&08 ; completion_sound_1 &2792 20 28 26 JSR &2628 ; play_completion_sound_x &2795 a2 10 LDX #&10 ; completion_sound_2 &2797 20 28 26 JSR &2628 ; play_completion_sound_x &279a 4c a7 27 JMP &27a7 ; plot_character ; plot_space &279d a2 18 LDX #&18 ; completion_sound_3 &279f 20 28 26 JSR &2628 ; play_completion_sound_x &27a2 a2 20 LDX #&20 ; completion_sound_4 &27a4 20 28 26 JSR &2628 ; play_completion_sound_x ; plot_character &27a7 68 PLA &27a8 c9 0d CMP #&0d &27aa d0 1b BNE &27c7 ; not_new_line ; new_line &27ac a9 0d LDA #&0d &27ae 20 ee ff JSR &ffee ; OSWRCH &27b1 a9 0a LDA #&0a &27b3 20 ee ff JSR &ffee ; OSWRCH &27b6 20 ee ff JSR &ffee ; OSWRCH &27b9 a9 20 LDA #&20 &27bb 20 ee ff JSR &ffee ; OSWRCH &27be 20 ee ff JSR &ffee ; OSWRCH &27c1 a9 00 LDA #&00 &27c3 85 b0 STA &b0 ; x &27c5 f0 0b BEQ &27d2 ; skip_character ; not_new_line &27c7 20 e7 27 JSR &27e7 ; plot_double_height_double_width_character &27ca e6 b0 INC &b0 ; x &27cc a5 b0 LDA &b0 ; x &27ce c9 22 CMP #&22 &27d0 f0 da BEQ &27ac ; new_line ; skip_character &27d2 18 CLC &27d3 a5 b4 LDA &b4 ; text_address_low &27d5 69 02 ADC #&02 &27d7 85 b4 STA &b4 ; text_address_low &27d9 a8 TAY &27da a5 b5 LDA &b5 ; text_address_high &27dc 69 00 ADC #&00 &27de 85 b5 STA &b5 ; text_address_high &27e0 c0 87 CPY #&87 &27e2 e9 2b SBC #&2b ; &2b87 = other_font_data, end of completion message + 1 &27e4 90 90 BCC &2776 ; plot_completion_message_loop &27e6 60 RTS ; plot_double_height_double_width_character &27e7 a2 00 LDX #&00 &27e9 86 b3 STX &b3 ; character_data_address_high &27eb 38 SEC &27ec e9 20 SBC #&20 &27ee a8 TAY &27ef 29 03 AND #&03 &27f1 85 b2 STA &b2 ; character_data_address_low &27f3 98 TYA &27f4 29 fc AND #&fc &27f6 0a ASL A &27f7 26 b3 ROL &b3 ; character_data_address_high &27f9 05 b2 ORA &b2 ; character_data_address_low &27fb 0a ASL A &27fc 26 b3 ROL &b3 ; character_data_address_high &27fe 0a ASL A &27ff 26 b3 ROL &b3 ; character_data_address_high &2801 0a ASL A &2802 26 b3 ROL &b3 ; character_data_address_high &2804 0a ASL A &2805 26 b3 ROL &b3 ; character_data_address_high &2807 69 00 ADC #&00 &2809 85 b2 STA &b2 ; character_data_address_low &280b a5 b3 LDA &b3 ; character_data_address_high &280d 69 19 ADC #&19 ; &1900 = unpacked_font_data &280f 85 b3 STA &b3 ; character_data_address_high &2811 a0 00 LDY #&00 &2813 20 37 28 JSR &2837 ; define_and_write_character_from_data &2816 a0 40 LDY #&40 &2818 20 37 28 JSR &2837 ; define_and_write_character_from_data &281b a9 08 LDA #&08 &281d 20 ee ff JSR &ffee ; OSWRCH &2820 20 ee ff JSR &ffee ; OSWRCH &2823 a9 0a LDA #&0a &2825 20 ee ff JSR &ffee ; OSWRCH &2828 a0 08 LDY #&08 &282a 20 37 28 JSR &2837 ; define_and_write_character_from_data &282d a0 48 LDY #&48 &282f 20 37 28 JSR &2837 ; define_and_write_character_from_data &2832 a9 0b LDA #&0b &2834 4c ee ff JMP &ffee ; OSWRCH ; define_and_write_character_from_data &2837 a9 17 LDA #&17 # Define character &e0 &2839 20 ee ff JSR &ffee ; OSWRCH &283c a9 e0 LDA #&e0 &283e 20 ee ff JSR &ffee ; OSWRCH &2841 a2 00 LDX #&00 ; define_character_loop &2843 b1 b2 LDA (&b2),Y ; character_data_address &2845 20 ee ff JSR &ffee ; OSWRCH &2848 c8 INY &2849 e8 INX &284a e0 08 CPX #&08 &284c d0 f5 BNE &2843 ; define_character_loop &284e a9 e0 LDA #&e0 # Write character &e0 &2850 4c ee ff JMP &ffee ; OSWRCH ; sideways_ram_completion_message # Two bytes per character: character, delay &2853 20 6d 20 14 20 02 20 02 20 02 20 02 20 02 20 02 ; " Epilogue\r" &2863 20 02 20 02 20 02 20 02 45 68 70 6c 69 39 6c 13 ; "The Pirate Industrials had\r" &2873 6f 18 67 1c 75 0e 65 10 0d 18 54 5e 68 24 65 0e ; "already discovered the White Light" &2883 20 11 50 2a 69 1a 72 24 61 0f 74 0c 65 10 20 10 ; "but were hiding it until they\r" &2893 49 2d 6e 1a 64 1c 75 17 73 16 74 11 72 0a 69 2a ; "could harness its potential. The\r" &28a3 61 12 6c 12 73 12 20 17 68 53 61 0c 64 29 0d 48 ; "attack upset its delicate\r" &28b3 61 34 6c 17 72 33 65 13 61 10 64 0a 79 16 20 19 ; "equilibrium, opening up (opening\r" &28c3 64 99 69 18 73 12 63 19 6f 11 76 21 65 11 72 10 ; "in?) a 'hole' within four-\r" &28d3 65 10 64 0c 20 1d 74 26 68 0b 65 0b 20 13 57 15 ; "dimensional space-time. Pulled\r" &28e3 68 12 69 14 74 0f 65 17 20 12 4c 23 69 10 67 13 ; "into the spiralling vortex, you\r" &28f3 68 13 74 13 62 49 75 16 74 0d 20 19 77 51 65 17 ; "re-emerge in strange alien\r" &2903 72 13 65 0f 20 27 68 39 69 15 64 19 69 13 6e 0c ; "surroundings -\r" &2913 67 12 20 15 69 ae 74 18 20 10 75 42 6e 0f 74 57 ; " Fire Track 2\r" &2923 69 0f 6c 10 20 17 74 3d 68 0b 65 10 79 0e 0d 6b ; " Beyond The White Light\r" &2933 63 46 6f 17 75 15 6c 10 64 15 20 15 68 87 61 15 ; "- the story continues..." &2943 72 10 6e 24 65 0e 73 15 73 0e 20 27 69 45 74 1d &2953 73 18 20 13 70 53 6f 0b 74 45 65 11 6e 13 74 1a &2963 69 19 61 12 6c 0c 2e 76 20 18 54 2b 68 24 65 07 &2973 0d 14 61 69 74 21 74 0e 61 13 63 1b 6b 11 20 19 &2983 75 37 70 12 73 23 65 12 74 0f 20 13 69 35 74 1f &2993 73 3a 20 37 64 45 65 12 6c 2c 69 14 63 1e 61 10 &29a3 74 0d 65 0c 0d 40 65 5b 71 0b 75 1a 69 73 6c 15 &29b3 69 37 62 31 72 21 69 31 75 18 6d 1e 2c 63 20 11 &29c3 6f 26 70 0a 65 24 6e 0f 69 0d 6e 0d 67 47 20 21 &29d3 75 25 70 0c 20 1f 28 44 6f 30 70 0b 65 14 6e 10 &29e3 69 0f 6e 0b 67 16 0d 5c 69 be 6e 09 3f 5f 29 29 &29f3 20 2e 61 20 20 11 27 25 68 45 6f 0d 6c 11 65 12 &2a03 27 76 20 2f 77 62 69 31 74 16 68 0f 69 17 6e 0d &2a13 20 2d 66 09 6f 1c 75 08 72 19 2d 23 0d 67 64 3d &2a23 69 1a 6d 09 65 18 6e 12 73 10 69 11 6f 0c 6e 14 &2a33 61 11 6c 0d 20 1e 73 46 70 11 61 0f 63 14 65 11 &2a43 2d 1d 74 27 69 19 6d 0a 65 10 2e e1 20 13 50 74 &2a53 75 3e 6c 4d 6c 14 65 40 64 10 0d 46 69 8b 6e 0b &2a63 74 19 6f 0b 20 14 74 1b 68 e0 65 33 20 0e 73 2c &2a73 70 11 69 17 72 2e 61 2e 6c 13 6c 11 69 a1 6e 08 &2a83 67 15 20 0e 76 39 6f 98 72 28 74 16 65 13 78 11 &2a93 2c 26 20 13 79 a0 6f 19 75 09 0d 55 72 50 65 0b &2aa3 2d 5a 65 1d 6d 11 65 12 72 15 67 0f 65 0b 20 49 &2ab3 69 2d 6e 08 20 12 73 1b 74 12 72 08 61 10 6e 3f &2ac3 67 16 65 0e 20 16 61 62 6c 19 69 11 65 18 6e 0d &2ad3 0d 30 73 6d 75 17 72 1b 72 10 6f 2f 75 14 6e 17 &2ae3 64 17 69 1a 6e 0d 67 16 73 18 20 fd 2d 3e 0d 9d &2af3 20 4d 20 14 20 02 20 02 20 02 20 02 20 20 20 0f &2b03 20 21 46 3c 69 2a 72 27 65 07 20 18 54 25 72 18 &2b13 61 2e 63 13 6b 4a 20 12 32 15 0d 29 20 2f 20 10 &2b23 20 31 20 31 20 45 42 3a 65 23 79 26 6f 2b 6e 07 &2b33 64 2f 20 10 54 52 68 21 65 15 20 13 57 4b 68 35 &2b43 69 13 74 16 65 09 20 12 4c 23 69 23 67 1e 68 11 &2b53 74 10 0d 09 2d 97 20 0d 74 3e 68 0c 65 0a 20 10 &2b63 73 1d 74 21 6f 17 72 15 79 0c 20 17 63 2f 6f 1f &2b73 6e 06 74 25 69 12 6e 0d 75 13 65 18 73 15 2e 62 &2b83 2e 12 2e 15 ; font_pixel_values_table &2b87 42 00 01 60 c0 03 07 0e 70 80 e0 06 1f 1c 38 fc &2b97 0f 18 30 31 33 36 3f f0 3c 6c cc 8c 0c 04 37 7f &2ba7 b0 32 fe 78 f8 7c dc 3e 10 1e ec 09 19 90 e4 1b &2bb7 1d 26 e6 c6 9c 20 41 c2 02 ff 68 73 ee b1 f6 d8 &2bc7 08 83 c7 ; packed_font_data &2bca 81 b2 02 81 3c 03 84 02 81 0b 02 85 01 86 04 85 &2bda 01 02 81 03 07 05 82 01 81 04 82 01 05 07 81 22 &2bea 08 04 89 01 81 04 89 01 04 08 81 03 09 84 01 8a &2bfa 04 84 01 09 81 2c 85 01 02 05 0b 81 07 8c 01 81 &2c0a 10 85 02 81 08 02 05 06 07 0d 0e 81 0d 89 02 81 &2c1a 09 8f 01 81 10 84 02 81 04 0d 0e 08 0a 04 09 81 &2c2a 08 10 0d 11 92 02 13 14 15 8d 01 10 81 03 82 01 &2c3a 05 10 82 06 10 81 03 10 11 12 81 03 02 05 0b 0d &2c4a 16 81 03 10 0d 11 81 01 05 81 02 12 11 06 81 03 &2c5a 17 0e 11 18 19 1a 1b 9c 01 11 0e 17 81 03 89 0a &2c6a 17 81 03 17 0e 91 01 12 03 04 09 01 1d 1c 0f 81 &2c7a 03 17 0d 9c 01 0d 17 11 9c 02 11 17 81 06 02 05 &2c8a 0b 1c 11 16 81 06 1e 0e 92 01 16 12 81 02 12 11 &2c9a 06 81 03 02 06 1c 91 01 12 1e 0e 92 01 11 10 81 &2caa 03 1f 03 01 82 01 85 05 06 81 03 12 08 17 20 92 &2cba 02 21 22 92 01 23 81 03 0f 1c 1d 01 0a 0e 9c 03 &2cca 11 0a 81 03 17 11 81 03 0a 12 91 01 12 0a 81 03 &2cda 0f 0e 0a 04 09 81 05 09 81 03 10 0d 91 01 0d 10 &2cea 11 92 02 18 10 81 03 10 0d 8e 02 0d 06 81 03 10 &2cfa 81 09 85 01 81 01 85 01 81 0a 85 01 01 05 02 05 &2d0a 0b 81 01 17 0e 91 01 0e 17 11 9c 02 0d 17 81 03 &2d1a 17 0e 8d 02 18 0f 8e 01 08 0a 81 0a 89 01 81 01 &2d2a 89 01 81 0a 89 01 01 89 01 81 07 05 07 0e 07 05 &2d3a 81 0a 0c 81 01 0c 81 08 0e 07 05 81 04 05 07 0e &2d4a 81 03 10 11 0e 12 81 01 82 02 01 82 01 81 04 07 &2d5a 0e 0a 09 81 02 09 0a 0e 07 81 07 24 81 01 24 81 &2d6a 0a 09 0a 0e 07 0e 0a 09 81 05 17 8e 01 08 0a 84 &2d7a 03 01 84 01 81 03 10 0e 92 01 93 03 12 11 0d 06 &2d8a 81 03 82 02 85 01 0b 06 9c 01 91 01 25 81 03 16 &2d9a 8d 03 0c 8d 04 16 81 03 05 07 11 92 05 11 07 05 &2daa 81 03 17 11 1c 0f 26 9b 01 26 0f 01 1c 24 81 03 &2dba 84 02 83 01 12 17 91 01 9c 01 16 81 03 17 0e 91 &2dca 01 12 17 11 9c 02 11 17 81 03 24 07 81 07 07 24 &2dda 81 03 16 0d 91 07 0d 16 81 03 16 0d 91 01 0d 0c &2dea 0d 91 02 0d 16 81 03 16 8d 03 0c 8d 04 27 81 03 &2dfa 05 07 11 92 05 11 1c 05 81 03 04 92 01 8d 05 92 &2e0a 01 04 81 03 0f 1c 1d 01 28 17 28 81 01 1d 1c 0f &2e1a 81 03 0f 1c 1d 01 28 17 28 81 08 24 0b 81 03 29 &2e2a 9c 01 8d 01 2a 81 03 18 91 03 0c 91 04 18 81 03 &2e3a 10 2b 82 07 2b 10 81 03 0c 28 81 06 92 01 10 81 &2e4a 03 18 91 02 2c 8c 01 2c 91 02 18 81 03 18 91 03 &2e5a 24 91 04 18 81 03 17 2d 89 07 2d 17 81 03 0f 2e &2e6a 8a 08 04 81 03 25 12 03 04 09 81 01 09 04 03 12 &2e7a 25 81 03 18 91 09 16 81 03 18 a9 01 2f ac 01 91 &2e8a 04 18 81 03 18 0d 29 8c 01 30 8d 04 27 81 03 10 &2e9a 91 01 92 05 91 01 10 81 0c 1d 1c 0f 81 03 10 a9 &2eaa 01 15 31 32 b3 01 8b 02 10 81 03 27 8d 02 34 26 &2eba 0f 25 18 8d 01 27 81 03 17 91 01 9c 05 91 01 17 &2eca 81 03 16 0d 91 02 0d 0c 91 03 18 81 03 10 91 01 &2eda 92 05 91 01 10 81 03 16 8d 03 0c 8d 04 27 81 03 &2eea 10 18 8e 01 18 0c 06 81 01 35 0e 10 81 03 17 18 &2efa 8d 02 12 0a 81 08 17 91 01 9c 04 1a 26 23 20 12 &2f0a 18 81 01 17 0e 91 01 0e 17 03 08 12 0e 11 18 81 &2f1a 03 17 0d 1d 81 01 0a 17 18 8d 01 18 17 81 03 1f &2f2a 36 82 08 05 81 03 25 92 07 91 01 10 81 03 24 92 &2f3a 01 91 01 9c 01 8b 01 85 02 81 03 18 91 01 2c 91 &2f4a 01 ac 01 2f 29 0d 27 81 03 22 37 84 08 0a 81 03 &2f5a 27 9c 07 91 01 17 81 03 27 91 01 92 01 83 01 84 &2f6a 01 89 02 81 03 10 8b 01 32 b3 01 32 31 15 29 07 &2f7a 0c 81 03 25 11 1c 0b 05 82 01 38 0b 1c 11 25 81 &2f8a 03 27 9c 01 8b 01 85 01 82 03 05 81 03 16 12 35 &2f9a 81 01 02 05 06 07 0d 0e 16 81 03 16 8d 09 16 81 &2faa 03 27 11 12 03 04 89 01 04 03 12 11 27 81 03 25 &2fba 92 01 83 01 84 01 89 03 04 81 03 0f 0d 0e 08 0a &2fca 04 09 81 01 1d 1c 0f 81 03 17 81 09 17 81 04 12 &2fda 11 1c 0b 05 02 81 08 10 81 09 10 81 20 b9 01 81 &2fea 06 09 04 03 12 11 81 04 0f 91 09 0f 81 20 b9 01 &2ffa 81 14 10 11 01 06 11 12 0e 10 81 03 0e 91 02 0c &300a 91 05 1e 81 07 10 11 92 03 11 10 81 17 0a 0e 11 &301a 24 91 01 3a 1b 81 07 17 0e 91 03 0e 17 81 07 17 &302a 11 81 03 11 17 81 07 10 11 92 03 11 10 81 07 05 &303a 1c 11 0c 91 01 07 05 81 07 05 81 05 02 81 07 10 &304a 11 92 02 11 1e 03 1f 12 11 10 23 8e 02 24 8e 05 &305a 0f 81 07 0a 91 01 24 81 01 11 0a 81 03 27 3b 83 &306a 01 22 83 05 24 81 07 0f 12 91 02 12 0a 01 0a 91 &307a 01 17 0e 91 02 0c 0d 91 04 18 81 04 85 01 01 06 &308a 85 05 06 81 04 85 01 01 06 85 07 0c 10 01 18 91 &309a 05 2c 29 91 01 18 81 07 17 0e 91 04 18 81 04 89 &30aa 01 01 89 06 04 81 04 89 01 01 04 89 08 81 05 24 &30ba 03 04 09 04 03 12 23 81 03 10 85 09 10 81 07 1e &30ca 30 91 04 18 81 07 1e 0d 91 04 18 81 07 10 0d 11 &30da 8e 01 11 0d 10 81 03 89 0a 0a 81 07 18 3c b3 01 &30ea 8b 02 10 81 07 17 0e 91 04 18 81 07 17 0e 11 8d &30fa 01 11 0e 17 81 07 16 91 05 0c 91 02 18 81 03 06 &310a 1c 91 03 1c 06 81 07 2f 10 9c 04 29 81 07 0c 0e &311a 12 0c 05 01 0e 10 81 07 17 0e 91 03 0e 17 81 07 &312a 17 0e 91 02 12 08 3d 14 15 18 0e 81 03 17 11 81 &313a 0d 17 0d 01 04 24 0d 18 17 81 03 87 01 a9 01 1f &314a 87 04 10 06 81 07 23 92 04 11 0c 81 07 23 92 02 &315a 11 1c 06 05 81 07 18 91 01 9c 01 0b 06 05 81 07 &316a 0a 81 04 28 0a 81 07 18 91 04 18 3e 81 07 18 91 &317a 02 12 03 04 09 81 07 10 0b 33 9a 01 3f 0e 12 81 &318a 07 18 1c 0b 85 01 0b 1c 18 81 07 25 11 1c 0b 05 &319a 02 01 82 01 30 07 81 04 0c 28 01 02 05 06 07 0c &31aa 81 17 18 12 03 84 01 03 12 18 81 07 25 92 01 83 &31ba 01 84 01 89 01 81 06 24 08 0a 04 09 01 40 24 81 &31ca 34 0c 0e 12 81 3c 41 42 25 # &0031 bytes copied from &78f9-&7929 to &0368-&0398 at &4459 (map_launch) # also to &c440-&c470 at &4462 (sideways_ram_map_launch) in enhanced version ; map_launch &0368 1c 00 ; compressed map data length = &1c &036a 06 ; plus 6 bits &036b 08 ; compression table has 8 entries: &036c 04 40 a8 49 08 10 18 20 ; 01 => tile &00, 4 bits &0374 05 0f 0a 0e 08 0c 13 1b ; 000 => tile &01, 0 bits ; 010 => tile &15, 0 bits ; 100 => tile &02, 0 bits ; 110 => tile &09, 1 bit ; 111 => tile &08, 0 bits ; 0011 => tile &03, 0 bits ; 1011 => tile &04, 0 bits ; &037c d9 e5 7a 7d b9 5e 5f ae d7 97 eb f9 c1 f7 07 9f ; 0000000000000008150909150800000000000000 ...... &038c 1f b3 7c 3d 07 bf 35 e6 5f d6 87 f3 19 ; 0000000000000008150909150800000000000000 ...... ; 0000000000000008150909150800000000000000 ...... ; 0000000000000008150909150800000000000000 ...... ; 0000000000000000080102080000000000000000 .... ; 0000000000000000080102080000000000000000 .... ; 0000000000000008010304020800000000000000 ...... ; 0000000000000003080102080400000000000000 ...... ; 0000000000000001030808040200000000000000 ...... ; 0000000000000008010909020800000000000000 ...... # &0042 bytes copied from &792a-&796b to &0c5a-&0c9b at &446b ; map_devil_rock &0c5a 2b 00 ; compressed map data length = &2b &0c5c 07 ; plus 7 bits &0c5d 09 ; compression table has 9 entries: &0c5e 04 cb 0a 12 20 43 18 58 49 ; 01 => tile &00, 4 bits &0c67 05 07 12 1a 16 08 1e 14 1c ; 11 => tile &19, 3 bits ; 000 => tile &08, 3 bits ; 0010 => tile &01, 2 bits ; 0100 => tile &0b, 0 bits ; 0110 => tile &04, 0 bits ; 1010 => tile &02, 2 bits ; 1100 => tile &09, 1 bit ; 1110 => tile &03, 0 bits ; &0c6f d9 8d 7f fb 5b 59 6f 0d f5 f4 98 99 bb 9f f2 9f ; 0000000000000019191919191900000000000000 ****** &0c7f f2 99 bf ee df 66 02 64 8a e0 04 cc 66 18 57 9e ; 0000000000001919191919191919000000000000 ******** &0c8f c0 7d 74 ff b4 b7 1e cd a8 47 33 32 ; 0000000000001919191919191919000000000000 ******** ; 0000000000000101010102020202000000000000 ........ ; 0000000000000408080808080803000000000000 ........ ; 0000000000191904040403030319190000000000 **......** ; 0000000000191919191919191919190000000000 ********** ; 0000000000191919190403191919190000000000 ****..**** ; 0000001919191919191919191919191919000000 ************** ; 001919191919080b040201030b08191919191900 *****.o....o.***** ; 0000001904090902191919190109090319000000 *....****....* ; 0000000000191919191919191919190000000000 ********** ; 0000000000000019191919191900000000000000 ****** ; 0000000000000019000000001900000000000000 * * ; 0000000000000019000000001900000000000000 * * ; unprocessed_digit_sprites &796c 6f fc ed ed ed ed fc 00 cf ed ed ed ed ed bd 00 ; "0" &797c 3f 7e fc 7e 7e 7e fc 00 9f 9f 9f 9f 9f cf bd 00 ; "1" &798c 6f fc 6f fc ed ed fc 00 cf ed ed bd 3f cf bd 00 ; "2" &799c 6f fc 3f 7e 3f 6f fc 00 cf ed ed ed ed ed bd 00 ; "3" &79ac 6f ed ed fc fc 7e 7e 00 3f 3f 9f cf bd 9f 3f 00 ; "4" &79bc 6f fc ed fc 3f 6f fc 00 cf bd cf ed ed ed bd 00 ; "5" &79cc 6f fc ed fc ed ed fc 00 cf bd cf ed ed ed bd 00 ; "6" &79dc 6f fc 3f 3f 7e 7e 7e 00 cf ed ed bd 9f 9f 3f 00 ; "7" &79ec 6f fc ed fc ed ed fc 00 cf ed ed ed ed ed bd 00 ; "8" &79fc 6f fc ed fc 3f 6f fc 00 cf ed ed ed ed ed bd 00 ; "9" &7a0c 3f 3f 3f 3f 3f 3f 3f 00 3f 3f 3f 3f 3f 3f 3f 00 ; " " # &0040 bytes copied from &7a1c-&7a5b to &c400-&c43f at &4493 in enhanced version ; sideways_ram_multiplication_table &c400 00 00 02 80 05 00 07 80 0a 00 0c 80 0f 00 11 80 &c410 14 00 16 80 19 00 1b 80 1e 00 20 80 23 00 25 80 &c420 28 00 2a 80 2d 00 2f 80 32 00 34 80 37 00 39 80 &c430 3c 00 3e 80 41 00 43 80 46 00 48 80 4b 00 4d 80 ; envelope_1 &7a5c 01 02 00 00 04 07 07 01 78 fb fe fe 78 28 ; envelope_2 &7a6a 02 01 04 00 00 01 5a 5a 78 fd ec ec 78 5a ; envelope_3 &7a78 03 01 04 00 00 01 5a 5a 03 07 88 88 2d 78 ; envelope_4 &7a86 04 01 00 01 ff 02 01 01 64 f6 fc fc 6e 46 ; envelope_5 &7a94 05 01 00 00 01 05 05 01 0f f6 ff fe 7e 50 ; envelope_6 &7aa2 06 02 00 ff 01 03 01 02 14 fe ff ff 64 56 ; envelope_7 &7ab0 07 01 00 00 00 01 01 01 78 d8 d8 d8 78 28 ; envelope_8 &7abe 08 01 00 00 00 01 01 01 3c ec fd fd 6e 1e ; envelope_9 &7acc 09 01 01 ff 00 01 01 0a 12 fe fe fe 69 50 ; envelope_10 &7ada 0a 01 00 01 ff 09 01 01 37 fb fe fe 6e 28 ; envelope_11 &7ae8 0b 02 00 08 00 06 01 06 0a 01 fc fc 50 7d ; envelope_12 &7af6 0c 02 00 00 00 07 02 03 01 03 fd ff 50 7d ; envelope_13 &7b04 0d 02 00 ff 00 4d 01 96 01 03 fd ff 50 7d ; envelope_14 &7b12 0e 82 00 03 fe 02 03 09 2d e2 fb fa 69 28 ; envelope_15 &7b20 0f 01 ff fa ff 0a 14 0a 69 fa fb fb 69 46 ; envelope_16 &7b2e 10 82 00 01 00 06 01 32 73 01 fe 88 73 7e # &0068 bytes copied from &7b3c-&7ba3 to &0100-&0167 at &43b5 ; sound_postponed_on_channel_0 ; chan vol pitch dur &0100 00 00 00 00 00 00 00 00 ; sound_postponed_on_channel_1 ; chan vol pitch dur &0108 00 00 00 00 00 00 00 00 ; sound_postponed_on_channel_2 ; chan vol pitch dur &0110 00 00 00 00 00 00 00 00 ; sound_postponed_on_channel_3 ; chan vol pitch dur &0118 00 00 00 00 00 00 00 00 ; sound_scoring ; chan vol pitch dur &0120 13 00 0e 00 96 00 01 00 ; sound_firing ; chan vol pitch dur &0128 13 00 0f 00 b4 00 02 00 ; sound_explosion ; chan vol pitch dur &0130 10 00 10 00 05 00 19 00 ; sound_homing_launch ; chan vol pitch dur &0138 13 00 f6 ff 96 00 01 00 ; sound_start_of_stage ; chan vol pitch dur &0140 11 00 0c 00 38 00 24 00 ; sound_end_of_stage ; chan vol pitch dur &0148 11 00 0b 00 60 00 1b 00 ; sound_music ; chan vol pitch dur &0150 00 00 00 00 00 00 00 00 ; sound_plus ; chan vol pitch dur &0158 10 00 01 00 06 00 07 00 ; sound_multiply ; chan vol pitch dur &0160 10 00 02 00 00 00 04 00 # &006e bytes copied from &7ba4-&7c11 to &0d31-&0d9f at &46aa in standard version ; encrypted_completion_message &0d31 1c e5 07 0a f0 0f 7e 82 ef 0c 13 e4 fd 46 fb 0d ; " FANTASTIC!!! &0d41 06 ed 12 01 f5 fa de 00 00 fe e1 02 2c 00 00 34 ; "...but the epic &0d51 13 ff ac 54 f4 fd bb 45 0b f9 fa bc e3 01 60 0c ; " continues with &0d61 ff 06 f5 05 07 f0 0e ad 57 f2 0b f4 b7 e2 03 29 ; " - Fire Track 2 - &0d71 f3 26 23 09 f3 bb 34 1e ef 02 08 b5 12 ee 0d f2 ; " Beyond the &0d81 e5 01 3d 23 14 f6 ff f6 bc 54 f4 fd ba e4 03 51 ; " White Light &0d91 11 01 0b f1 bb 00 2c 1d fe 01 0c a6 f7 6f