	.code
	.bank 0
	.org $6000
l6000_00: ORA     #$00
          BPL     l6006_00
          LDA     #$ff
l6006_00: LDX     #$01
          BRA     l6012_00
          ORA     #$00
          BPL     l6010_00
          LDA     #$40
l6010_00: LDX     #$ff
l6012_00: STA     $6025
          STX     $6020
          JSR     l6297_00
l601b_00: LDA     $6025
          CLC     
          ADC     #$00
          STA     $6025
          LDA     #$00
          CMP     #$40
          BCS     l6042_00
          LDA     $6025
          JSR     l42da_00
          JSR     l6448_00
          CMP     #$00
          BEQ     l603d_00
          CMP     #$03
          BEQ     l601b_00
l603b_00: SEC     
          RTS     
l603d_00: LDA     $6025
          CLC     
          RTS     
l6042_00: LDA     #$ff
          CLC     
          RTS     
          STZ     $604d
          JSR     l6297_00
l604c_00: LDA     #$00
          JSR     l42da_00
          JSR     l6448_00
          CMP     #$03
          BEQ     l606a_00
          CMP     #$00
          BNE     l603b_00
          INC     $604d
          LDA     $604d
          CMP     #$3f
          BCC     l604c_00
          SEC     
          LDA     #$03
          RTS     
l606a_00: LDA     $604d
          CLC     
          RTS     
          STZ     $e20b
          STZ     $e20c
          INC     <$28
          JSR     l61c6_00
          JSR     l618c_00
          ORA     #$00
          BMI     l60a5_00
          JSR     l61e2_00
          CLA     
          JSR     l61cc_00
          CLA     
          LDX     #$02
          JSR     l61d1_00
          LDA     #$01
          JSR     l61cc_00
          CLA     
          JSR     l61cc_00
          CLA     
          LDX     #$04
          JSR     l61d1_00
          JSR     l6279_00
          JSR     l61c6_00
          LDA     #$00
l60a5_00: DEC     <$28
          RTS     
l60a8_00: INC     <$28
          JSR     l618c_00
          BMI     l610b_00
          STZ     $e202
          STZ     $e203
          LDA     <$12
          STA     $e206
          LDA     <$13
          STA     $e207
          JSR     l6220_00
          JSR     l61e2_00
          LDA     $e200
          JSR     l61cc_00
          LDA     $e201
          LDX     #$02
          JSR     l61d1_00
          JSR     l623e_00
l60d6_00: JSR     l6253_00
          STA     [$10]
          CLC     
          ADC     $e202
          STA     $e202
          LDA     $e203
          ADC     #$00
          STA     $e203
          INC     <$10
          BNE     l60f0_00
          INC     <$11
l60f0_00: LDA     $e204
          BNE     l60f8_00
          DEC     $e205
l60f8_00: DEC     $e204
          LDA     $e204
          ORA     $e205
          BNE     l60d6_00
          JSR     l61c6_00
          LDA     #$00
          JMP     l610d_00
l610b_00: LDA     #$01
l610d_00: DEC     <$28
          ORA     #$00
          RTS     
l6112_00: INC     <$28
          JSR     l618c_00
          BMI     l6185_00
          STZ     $ea11
          STZ     $ea12
          LDA     <$12
          STA     $e206
          LDA     <$13
          STA     $e207
          JSR     l6220_00
          JSR     l61de_00
          LDA     $e200
          JSR     l61cc_00
          LDA     $e201
          LDX     #$02
          JSR     l61d1_00
          JSR     l623e_00
l6140_00: LDA     [$10]
          JSR     l61cc_00
          LDA     $ea11
          CLC     
          ADC     [$10]
          STA     $ea11
          LDA     $ea12
          ADC     #$00
          STA     $ea12
          INC     <$10
          BNE     l615c_00
          INC     <$11
l615c_00: LDA     $e204
          BNE     l6164_00
          DEC     $e205
l6164_00: DEC     $e204
          LDA     $e204
          ORA     $e205
          BNE     l6140_00
          JSR     l6279_00
          JSR     l6279_00
          PHA     
          JSR     l61c6_00
          PLA     
          BNE     l6180_00
          LDA     #$00
          BRA     l6182_00
l6180_00: LDA     #$06
l6182_00: JMP     l6187_00
l6185_00: LDA     #$01
l6187_00: DEC     <$28
          ORA     #$00
          RTS     
l618c_00: LDA     #$03
          STA     $e209
l6191_00: INC     $e20b
          LDA     #$a8
          JSR     l61cc_00
          LDA     #$00
          JSR     l6200_00
          TAY     
          LDA     #$01
          JSR     l6200_00
          CPY     #$00
          BNE     l61af_00
          CMP     #$04
          BNE     l61af_00
          JMP     l61c3_00
l61af_00: INC     $e20c
          DEC     $e209
          BEQ     l61ba_00
          JMP     l6191_00
l61ba_00: CLA     
          LDX     #$03
          JSR     l61d1_00
          LDA     #$ff
          RTS     
l61c3_00: LDA     #$00
          RTS     
l61c6_00: CLA     
          LDX     #$03
          JMP     l61d1_00
l61cc_00: LDX     #$08
          JMP     l61d1_00
l61d1_00: STA     $e20a
l61d4_00: LSR     $e20a
          JSR     l61e3_00
          DEX     
          BNE     l61d4_00
          RTS     
l61de_00: CLC     
          JMP     l61e3_00
l61e2_00: SEC     
l61e3_00: CLA     
          ROL     A
          STA     $1000
          PHA     
          PLA     
          ORA     #$02
          STA     $1000
          PHY     
          PLY     
          PHY     
          PLY     
          PHY     
          PLY     
          NOP     
          NOP     
          NOP     
          AND     #$fd
          STA     $1000
          PHA     
          PLA     
          RTS     
l6200_00: AND     #$01
          STA     $1000
          PHA     
          PLA     
          ORA     #$02
          STA     $1000
          PHY     
          PLY     
          PHY     
          PLY     
          PHY     
          PLY     
          NOP     
          NOP     
          NOP     
          STZ     $1000
          LDA     $1000
          AND     #$0f
          PHA     
          PLA     
          RTS     
l6220_00: LDA     $e206
          STA     $e204
          LDA     $e207
          STA     $e205
          STZ     $e208
          LDX     #$03
l6231_00: ASL     $e206
          ROL     $e207
          ROL     $e208
          DEX     
          BNE     l6231_00
          RTS     
l623e_00: LDA     $e206
          JSR     l61cc_00
          LDA     $e207
          JSR     l61cc_00
          LDA     $e208
          LDX     #$04
          JSR     l61d1_00
          RTS     
l6253_00: STZ     $e20a
          LDX     #$08
l6258_00: LDA     #$02
          STA     $1000
          PHY     
          PLY     
          PHY     
          PLY     
          PHY     
          PLY     
          NOP     
          NOP     
          NOP     
          LDA     $1000
          LSR     A
          ROR     $e20a
          STZ     $1000
          PHA     
          PLA     
          DEX     
          BNE     l6258_00
          LDA     $e20a
          RTS     
l6279_00: STZ     $1000
          PHA     
          PLA     
          LDA     #$02
          STA     $1000
          PHY     
          PLY     
          PHY     
          PLY     
          PHY     
          PLY     
          NOP     
          NOP     
          NOP     
          LDA     $1000
          STZ     $1000
          PHA     
          PLA     
          AND     #$0f
          RTS     
l6297_00: LDA     #$0d
          STA     <$10
          LDA     #$e2
          STA     <$11
          STZ     <$12
          LDA     #$04
          STA     <$13
          STZ     $e200
          STZ     $e201
          JSR     l60a8_00
          BNE     l62b3_00
          JSR     l634d_00
l62b3_00: RTS     
l62b4_00: LDA     #$0d
          STA     <$10
          LDA     #$e2
          STA     <$11
          STZ     <$12
          LDA     #$04
          STA     <$13
          STZ     $e200
          STZ     $e201
          JSR     l6112_00
          BNE     l62d0_00
          JSR     l634d_00
l62d0_00: RTS     
          JSR     l6297_00
          LDA     <$1e
          CLC     
          ADC     #$01
          STA     <$10
          LDA     <$1f
          ADC     #$00
          STA     <$11
          LDA     #$1d
          STA     <$12
          LDA     #$e2
          STA     <$13
          STZ     <$15
          LDA     #$3f
          STA     <$14
l62ef_00: LDA     [$12]
          BEQ     l6326_00
          LDA     <$12
          CLC     
          ADC     #$06
          STA     <$12
          BCC     l62fe_00
          INC     <$13
l62fe_00: CLY     
l62ff_00: LDA     [$12], Y
          STA     [$10], Y
          INY     
          CPY     #$0a
          BCC     l62ff_00
          CLA     
          STA     [$10], Y
          INY     
          STA     [$10], Y
          INC     <$15
          LDA     <$10
          CLC     
          ADC     #$0c
          STA     <$10
          BCC     l631b_00
          INC     <$11
l631b_00: LDA     <$12
          SEC     
          SBC     #$06
          STA     <$12
          BCS     l6326_00
          DEC     <$13
l6326_00: LDA     <$12
          CLC     
          ADC     #$10
          STA     <$12
          BCC     l6331_00
          INC     <$13
l6331_00: DEC     <$14
          BNE     l62ef_00
          LDA     <$15
          STA     [$1e]
          RTS     
          LDA     #$01
          STA     $e80d
          LDA     #$01
          STA     $e80e
          LDX     #$02
l6346_00: STZ     $e80d, X
          INX     
          BNE     l6346_00
          RTS     
l634d_00: LDA     #$11
          STA     <$10
          LDA     #$e2
          STA     <$11
          LDA     #$d1
          STA     <$12
          LDA     #$63
          STA     <$13
          JSR     l6368_00
          BPL     l6365_00
          LDA     #$02
          RTS     
l6365_00: LDA     #$00
          RTS     
l6368_00: LDA     [$10]
          CMP     [$12]
          BEQ     l6371_00
          LDA     #$ff
          RTS     
l6371_00: INC     <$10
          BNE     l6377_00
          INC     <$11
l6377_00: INC     <$12
          BNE     l637d_00
          INC     <$13
l637d_00: LDA     [$12]
          BNE     l6368_00
          LDA     #$00
          RTS     
l6384_00: LDA     [$12]
          STA     [$10]
          INC     <$10
          BNE     l638e_00
          INC     <$11
l638e_00: INC     <$12
          BNE     l6394_00
          INC     <$13
l6394_00: LDA     [$12]
          BNE     l6384_00
          RTS     
          LDA     #$0d
          STA     <$10
          LDA     #$e2
          STA     <$11
          LDY     #$04
          CLX     
l63a4_00: LDA     #$00
          STA     [$10]
          INC     <$10
          BNE     l63ae_00
          INC     <$11
l63ae_00: INX     
          BNE     l63a4_00
          DEY     
          BNE     l63a4_00
          LDA     #$11
          STA     <$10
          LDA     #$e2
          STA     <$11
          LDA     #$d1
          STA     <$12
          LDA     #$63
          STA     <$13
          JSR     l6384_00
          JSR     l66ee_00
          JSR     l62b4_00
          STA     $ea15
          RTS     
memory_base_128_str:
    .db $D2, $D3, $D8, $CD, $DE, $B0, $BD, $31, $32, $38, $00

