; Disassembly of kkapers.bin
; Disassembled Tue Oct 02 18:07:25 2012
; Using DiStella v3.0
;
; Command Line: C:\USERS\FAMILY~1.KEL\2600ASM\DISTELLA.EXE -pafs kkapers.bin 
;

      processor 6502
VSYNC   =  $00
VBLANK  =  $01
WSYNC   =  $02
NUSIZ0  =  $04
NUSIZ1  =  $05
COLUP0  =  $06
COLUP1  =  $07
COLUPF  =  $08
COLUBK  =  $09
CTRLPF  =  $0A
REFP0   =  $0B
REFP1   =  $0C
PF0     =  $0D
PF1     =  $0E
PF2     =  $0F
RESP0   =  $10
RESP1   =  $11
RESM0   =  $12
RESM1   =  $13
RESBL   =  $14
AUDC0   =  $15
AUDF0   =  $17
AUDV0   =  $19
GRP0    =  $1B
GRP1    =  $1C
ENAM0   =  $1D
ENAM1   =  $1E
ENABL   =  $1F
HMP0    =  $20
HMP1    =  $21
HMM0    =  $22
HMM1    =  $23
HMBL    =  $24
VDELP0  =  $25
VDELP1  =  $26
HMOVE   =  $2A
HMCLR   =  $2B
CXCLR   =  $2C
CXPPMM  =  $37
INPT4   =  $3C
SWCHA   =  $0280
SWCHB   =  $0282
INTIM   =  $0284
TIM64T  =  $0296
LF11F   =   $F11F
LF19D   =   $F19D
LF1C6   =   $F1C6
LF2A6   =   $F2A6
LF32A   =   $F32A
LF32D   =   $F32D
LF3E6   =   $F3E6
LF54B   =   $F54B
LF587   =   $F587
LF58A   =   $F58A
LF8F6   =   $F8F6

       ORG $F000

START:
       SEI            ;2
       CLD            ;2
       LDX    #$FF    ;2
       TXS            ;2
       INX            ;2
       TXA            ;2
LF007: STA    VSYNC,X ;4
       INX            ;2
       BNE    LF007   ;2
       LDY    #$0C    ;2
       JSR    LFA2C   ;6
LF011: LDX    #$03    ;2
       STX    WSYNC   ;3
       STX    VBLANK  ;3
       LDA    #$23    ;2
       STA    TIM64T  ;4
       LDY    #$FE    ;2
LF01E: LDA    #$48    ;2
       STA    $EC,X   ;4
       LDA    #$05    ;2
       STA    $B4,X   ;4
       STY    $E8,X   ;4
       DEX            ;2
       BPL    LF01E   ;2
       LDY    $8E     ;3
       BIT    $87     ;3
       BPL    LF061   ;2
       LDY    #$05    ;2
       LDA    $8E     ;3
       AND    #$03    ;2
       BNE    LF05F   ;2
       JSR    LFEF4   ;6
       BCS    LF042   ;2
       INC    $97     ;5
       BCC    LF07F   ;2
LF042: LDA    #$01    ;2
       STA    $8B     ;3
       STA    $86     ;3
       ROL            ;2
       LDY    $97     ;3
       CPY    #$10    ;2
       BCS    LF057   ;2
       TYA            ;2
       AND    #$08    ;2
       LSR            ;2
       LSR            ;2
       LSR            ;2
       ADC    #$01    ;2
LF057: JSR    LFDB6   ;6
       LDA    #$0C    ;2
       JSR    LFDE4   ;6
LF05F: LDY    #$00    ;2
LF061: LDA    $9D     ;3
       CMP    #$11    ;2
       BCC    LF069   ;2
       LDY    #$00    ;2
LF069: STY    $CA     ;3
       LDY    #$07    ;2
       BIT    $98     ;3
       BMI    LF082   ;2
       LDA    $87     ;3
       ORA    $88     ;3
       BMI    LF089   ;2
       LDA    $89     ;3
       CMP    #$09    ;2
       BNE    LF082   ;2
       DEC    $98     ;5
LF07F: JMP    LF09A   ;3
LF082: TYA            ;2
       AND    $8E     ;3
       BNE    LF089   ;2
       DEC    $8A     ;5
LF089: LDX    #$FF    ;2
       CPX    SWCHA   ;4
       BEQ    LF093   ;2
       INX            ;2
       STX    $99     ;3
LF093: LSR    SWCHB   ;6
       BCS    LF0AA   ;2
       LDY    #$0C    ;2
LF09A: LDX    #$41    ;2
       LDA    #$00    ;2
LF09E: STA    $4E,X   ;4
       DEX            ;2
       BNE    LF09E   ;2
       JSR    LFA2C   ;6
       DEC    $88     ;5
       BMI    LF0B1   ;2
LF0AA: JSR    LFCE7   ;6
       BIT    $88     ;3
       BMI    LF0B4   ;2
LF0B1: JMP    LF33C   ;3
LF0B4: LDY    $8B     ;3
       CPY    #$06    ;2
       BEQ    LF0D6   ;2
       INC    $F2     ;5
       BNE    LF0C0   ;2
       INC    $F0     ;5
LF0C0: LDA    #$7F    ;2
       CPY    #$05    ;2
       BNE    LF0C8   ;2
       LDA    #$03    ;2
LF0C8: AND    $8E     ;3
       BNE    LF0D6   ;2
       JSR    LFEF4   ;6
       BMI    LF0D3   ;2
       BNE    LF0D6   ;2
LF0D3: JMP    LF327   ;3
LF0D6: JSR    LFEBB   ;6
       STA    $9F     ;3
       CPY    #$05    ;2
       BCC    LF0E2   ;2
       JMP    LF338   ;3
LF0E2: BIT    $80     ;3
       BPL    LF132   ;2
       BVC    LF110   ;2
       TAY            ;2
       ROL            ;2
       ROL            ;2
       ROL            ;2
       SEC            ;2
       ROL            ;2
       ROL            ;2
       STA    $91     ;3
       LDA    $A0,X   ;4
       STA.wy $00A0,Y ;5
       LDA    LFEC5,Y ;4
       STA    $92     ;3
       LDA    $F2     ;3
       BPL    LF0B1   ;2
       CMP    #$F0    ;2
       BCS    LF0B1   ;2
       LDA    SWCHA   ;4
       AND    #$20    ;2
       BNE    LF0B1   ;2
       DEC    $91     ;5
       DEC    $91     ;5
       BPL    LF12B   ;2
LF110: LDY    $80     ;3
       LDA    $8E     ;3
       AND    #$03    ;2
       BNE    LF0B1   ;2
       CPY    #$A8    ;2
       BEQ    LF11F   ;2
       INC    $A0,X   ;6
       BIT    $A0D6   ;4
       INC    $91     ;5
       LDA    $91     ;3
       AND    #$1F    ;2
       BNE    LF0B1   ;2
       INC    $92     ;5
LF12B: LDA    #$0F    ;2
       AND    $80     ;3
       JMP    LF1D3   ;3
LF132: LDA    $E1     ;3
       LDY    $8D     ;3
       BNE    LF13B   ;2
       LDA    SWCHA   ;4
LF13B: BIT    $98     ;3
       BPL    LF142   ;2
       LDA    LFCF6,X ;4
LF142: STA    $9E     ;3
       AND    #$20    ;2
       BNE    LF14D   ;2
       LDA    #$07    ;2
       JMP    LF27E   ;3
LF14D: LDA    $9E     ;3
       ASL            ;2
       BMI    LF175   ;2
       LDA    #$08    ;2
       STA    $80     ;3
       DEC    $A0,X   ;6
       LDA    #$07    ;2
       CMP    $A0,X   ;4
       BCC    LF166   ;2
       CMP    $93     ;3
       BNE    LF169   ;2
       LDA    #$09    ;2
       STA    $A0,X   ;4
LF166: JMP    LF1D8   ;3
LF169: LDA    #$9A    ;2
       STA    $A0,X   ;4
       TXA            ;2
       LSR            ;2
       BCS    LF194   ;2
LF171: INC    $92     ;5
       BNE    LF196   ;2
LF175: BCS    LF1A5   ;2
       LDA    #$00    ;2
       STA    $80     ;3
       LDY    $A0,X   ;4
       INY            ;2
       CPY    #$9B    ;2
       BCC    LF188   ;2
       LDA    $93     ;3
       BNE    LF18C   ;2
       LDY    #$99    ;2
LF188: STY    $A0,X   ;4
       BNE    LF1D8   ;2
LF18C: LDY    #$08    ;2
       STY    $A0,X   ;4
       TXA            ;2
       LSR            ;2
       BCS    LF171   ;2
LF194: DEC    $92     ;5
LF196: LDA    $80     ;3
       BNE    LF19D   ;2
       DEC    $93     ;5
       BIT    $93E6   ;4
       JSR    LFA4D   ;6
       JMP    LF1FB   ;3
LF1A5: LDY    #$06    ;2
       STY    $95     ;3
       ASL            ;2
       ASL            ;2
       BMI    LF1D5   ;2
       LDA    $93     ;3
       CMP    #$04    ;2
       BNE    LF1D5   ;2
       LDA    $8D     ;3
       BNE    LF1D5   ;2
       LDA    $F2     ;3
       BPL    LF1D5   ;2
       CMP    #$F0    ;2
       BCS    LF1D5   ;2
       CPX    $9F     ;3
       BNE    LF1D5   ;2
       LDA    $A0,X   ;4
       SBC    #$4C    ;2
       CMP    #$03    ;2
       BCS    LF1D5   ;2
       INC    $91     ;5
       INC    $91     ;5
       LDA    #$E0    ;2
       ORA    $80     ;3
LF1D3: STA    $80     ;3
LF1D5: JMP    LF280   ;3
LF1D8: LDA    $A0,X   ;4
       LSR            ;2
       LDY    $95     ;3
       BCC    LF1E8   ;2
       INY            ;2
       CPY    #$06    ;2
       BCC    LF1E6   ;2
       LDY    #$01    ;2
LF1E6: STY    $95     ;3
LF1E8: LDA    $8B     ;3
       BNE    LF1FB   ;2
       CPY    #$04    ;2
       BNE    LF1FB   ;2
       LDA    #$08    ;2
       JSR    LFDE4   ;6
       LDA    #$02    ;2
       STA    $8B     ;3
       STA    $86     ;3
LF1FB: JSR    LFCE7   ;6
       LDA    $93     ;3
       CMP    LFD09,X ;4
       BNE    LF20F   ;2
       LDA    $94     ;3
       CMP    $92     ;3
       BNE    LF280   ;2
       DEC    $94     ;5
       BPL    LF225   ;2
LF20F: CMP    LFD0A,X ;4
       BNE    LF280   ;2
       LDA    $94     ;3
       SBC    $92     ;3
       CMP    #$01    ;2
       BEQ    LF225   ;2
       TAY            ;2
       BNE    LF239   ;2
       INC    $94     ;5
       LDA    #$50    ;2   
       STA    $90     ;3
LF225: TXA            ;2
       LSR            ;2
       BCS    LF231   ;2
       LDA    #$78    ;2
       CMP    $90     ;3
       BCC    LF239   ;2
       BCS    LF237   ;2
LF231: LDA    #$28    ;2
       CMP    $90     ;3
       BCS    LF239   ;2
LF237: STA    $90     ;3
LF239: LDA    $93     ;3
       LSR            ;2
       LDA    $91     ;3
       AND    #$1F    ;2
       BCC    LF244   ;2
       EOR    #$FF    ;2
LF244: CLC            ;2
       ADC    LFBFA,X ;4
       CLC            ;2
       EOR    #$FF    ;2
       ADC    $A0,X   ;4
       CMP    #$02    ;2
       BCS    LF280   ;2
       LSR            ;2
       STA    $8D     ;3
       LDA    #$FC    ;2
       STA    $8C     ;3
       AND    $91     ;3
       STA    $91     ;3
       LDA    $F2     ;3
       LSR            ;2
       LSR            ;2
       AND    #$03    ;2
       ORA    $91     ;3
       STA    $91     ;3
       AND    #$1F    ;2
       CPX    #$01    ;2
       BEQ    LF271   ;2
       EOR    #$FF    ;2
       CLC            ;2
       ADC    #$03    ;2
LF271: CLC            ;2
       ADC    LFBFA,X ;4
       STA    $A0,X   ;4
       LDA    LFBFD,X ;4
       STA    $80     ;3
       LDA    #$06    ;2
LF27E: STA    $95     ;3
LF280: LDY    $8D     ;3
       BEQ    LF2B8   ;2
       LDA    $8B     ;3
       CMP    #$03    ;2
       BNE    LF28E   ;2
       TYA            ;2
       LSR            ;2
       STA    AUDV0   ;3
LF28E: TYA            ;2
       SEC            ;2
       SBC    #$06    ;2
       CMP    #$06    ;2
       BCS    LF29C   ;2
       LDA    $8E     ;3
       AND    #$03    ;2
       BNE    LF2A8   ;2
LF29C: DEY            ;2
       STY    $8D     ;3
       CPY    #$09    ;2
       BCC    LF2A6   ;2
       INC    $91     ;5
       BIT    $91C6   ;4
LF2A8: LDA    #$02    ;2
       STA    $95     ;3
       CPY    #$10    ;2
       BCC    LF2DC   ;2
       BIT    $E1     ;3
       BPL    LF2DC   ;2
       BVS    LF2D3   ;2
       BMI    LF2DC   ;2
LF2B8: LDY    #$00    ;2
       LDA    INPT4   ;3
       ORA    $98     ;3
       BMI    LF2DA   ;2
       BIT    $8C     ;3
       BMI    LF2DC   ;2
       LDX    #$03    ;2
       STX    $8B     ;3
       LDA    #$0C    ;2
       STA    AUDC0   ;3
       LDX    #$12    ;2
       STX    $8D     ;3
       DEX            ;2
       STX    $86     ;3
LF2D3: LDA    SWCHA   ;4
       STA    $E1     ;3
       LDY    #$FF    ;2
LF2DA: STY    $8C     ;3
LF2DC: JSR    LFCE7   ;6
       BIT    $8F     ;3
       BMI    LF327   ;2
       LDA    $87     ;3
       ORA    $80     ;3
       BMI    LF33C   ;2
       LDA    $81,X   ;4
       BPL    LF33C   ;2
       LDY    $AC,X   ;4
       CPY    #$06    ;2
       BCC    LF321   ;2
       BIT    $98     ;3
       BMI    LF33C   ;2
       CPY    #$08    ;2
       BCS    LF303   ;2
       LDA    $91     ;3
       AND    #$1F    ;2
       CMP    #$06    ;2
       BCS    LF33C   ;2
LF303: CPY    #$0A    ;2
       BCC    LF32D   ;2
       CPY    #$0C    ;2
       BCC    LF327   ;2
       CPY    #$0F    ;2
       BCC    LF33C   ;2
       STX    $9E     ;3
       STY    $F5,X   ;4
       LDA    #$02    ;2
       STA    $AC,X   ;4
       TAX            ;2
       LDA    #$50    ;2 
       JSR    LFDB8   ;6
       LDX    $9E     ;3
       BPL    LF32A   ;2
LF321: DEC    $87     ;5
       INC    $88     ;5
       BEQ    LF33C   ;2
LF327: LDA    #$06    ;2
       BIT    $04A9   ;4
       BIT    $05A9   ;4
       STA    $8B     ;3
       LDY    #$08    ;2
       STY    $86     ;3
       DEY            ;2
       STY    AUDC0   ;3
LF338: LDA    $86     ;3
       STA    AUDV0   ;3
LF33C: JSR    LFCE7   ;6
       LDY    $95     ;3
       LDA    $91     ;3
       AND    #$1F    ;2
       EOR    #$FF    ;2
       STA    $9E     ;3
       CLC            ;2
       ADC    LFECA,Y ;4
       STA    $E4,X   ;4
       LDA    #$35    ;2
       CPY    #$07    ;2
       BNE    LF357   ;2
       ADC    #$02    ;2
LF357: ADC    $9E     ;3
       STA    $EC,X   ;4
       LDY    $80     ;3
       STY    $F9,X   ;4
       LDA    $9E     ;3
       CMP    #$F3    ;2
       BCS    LF377   ;2
       STY    $FA,X   ;4
       LDA    $E4,X   ;4
       ADC    #$20    ;2
       STA    $E5,X   ;4
       LDA    $EC,X   ;4
       ADC    #$20    ;2
       STA    $ED,X   ;4
       LDA    $A0,X   ;4
       STA    $A1,X   ;4
LF377: LDY    $8B     ;3
       BEQ    LF3BB   ;2
       CPY    #$04    ;2
       BCC    LF385   ;2
       LDA    $8E     ;3
       AND    #$03    ;2
       BNE    LF3C1   ;2
LF385: DEC    $86     ;5
       BMI    LF39E   ;2
       LDA    LFCF9,Y ;4
       STA    $9E     ;3
       LDA    #$FC    ;2
       STA    $9F     ;3
       LDY    $86     ;3
       LDA    ($9E),Y ;5
       BIT    $98     ;3
       BMI    LF3C1   ;2
       STA    AUDF0   ;3
       BPL    LF3C1   ;2
LF39E: CPY    #$04    ;2
       BCC    LF3BB   ;2
       CPY    #$06    ;2
       BNE    LF3B9   ;2
       LDY    $96     ;3
       DEY            ;2
       BPL    LF3B2   ;2
       INC    $88     ;5
       INY            ;2
       STY    $89     ;3
       BEQ    LF3BB   ;2
LF3B2: STY    $96     ;3
       LDY    #$05    ;2
       JMP    LF09A   ;3
LF3B9: STA    $AC,X   ;4
LF3BB: LDA    #$00    ;2
       STA    $8B     ;3
       STA    AUDV0   ;3
LF3C1: LDX    INTIM   ;4
       BNE    LF3C1   ;2
       LDY    #$82    ;2    
       STY    WSYNC   ;3
       STY    VSYNC   ;3
       STY    WSYNC   ;3
       STY    WSYNC   ;3
       STY    WSYNC   ;3
       STX    VSYNC   ;3
       INC    $8E     ;5
       BNE    LF3E7   ;2
       INC    $89     ;5
       LDA    $89     ;3
       AND    #$07    ;2
       BNE    LF3E7   ;2
       INC    $99     ;5
       BNE    LF3E7   ;2
       SEC            ;2
       ROR    $99     ;5
LF3E7: LDA    #$2D    ;2
       STA    WSYNC   ;3
       STA    TIM64T  ;4
       BIT    $88     ;3
       BPL    LF45A   ;2
       BIT    $8F     ;3
       BMI    LF45A   ;2
       LDA    $8E     ;3
       LSR            ;2
       BCC    LF45A   ;2
       LDY    $90     ;3
       LDA    $CC     ;3
       AND    #$08    ;2
       BNE    LF428   ;2
       INY            ;2
       CPY    #$9C    ;2
       BCC    LF449   ;2
       LDA    $94     ;3
       CMP    #$1F    ;2
       BNE    LF412   ;2
       DEC    $8F     ;5
       BMI    LF45A   ;2
LF412: LDY    #$04    ;2
       LDA    $94     ;3
       AND    #$08    ;2
       BNE    LF435   ;2
LF41A: DEC    $94     ;5
       BPL    LF424   ;2
       INC    $94     ;5
       LDY    #$9A    ;2
       BNE    LF449   ;2
LF424: LDA    #$07    ;2
       BPL    LF439   ;2
LF428: DEY            ;2
       CPY    #$04    ;2
       BCS    LF449   ;2
       LDY    #$9B    ;2
       LDA    $94     ;3
       AND    #$08    ;2
       BNE    LF41A   ;2
LF435: INC    $94     ;5
       LDA    #$00    ;2
LF439: STA    $85     ;3
       LDA    #$07    ;2
       AND    $94     ;3
       CMP    $85     ;3
       BNE    LF449   ;2
       TYA            ;2
       EOR    #$FF    ;2
       ADC    #$9E    ;2
       TAY            ;2
LF449: STY    $90     ;3
       TYA            ;2
       LSR            ;2
       BCC    LF45A   ;2
       LDY    $E2     ;3
       INY            ;2
       CPY    #$06    ;2
       BCC    LF458   ;2
       LDY    #$01    ;2
LF458: STY    $E2     ;3
LF45A: LDA    $94     ;3
       AND    #$0F    ;2
       CMP    #$08    ;2
       BCC    LF464   ;2
       EOR    #$0F    ;2
LF464: STA    $85     ;3
       LDA    $94     ;3
       AND    #$18    ;2
       STA    $9E     ;3
       EOR    #$08    ;2
       STA    $CC     ;3
       LDA    $92     ;3
       AND    #$18    ;2
       CMP    $9E     ;3
       BEQ    LF480   ;2
       BCC    LF48C   ;2
       LDA    $CC     ;3
       EOR    #$08    ;2
       BCS    LF48A   ;2
LF480: LDA    #$00    ;2
       LDY    $85     ;3
       CPY    $93     ;3
       BCC    LF48A   ;2
       LDA    #$08    ;2
LF48A: STA    $CC     ;3
LF48C: LDX    #$03    ;2
LF48E: LDA    $94     ;3
       LSR            ;2
       LSR            ;2
       LSR            ;2
       STA    $9E     ;3
       CPX    $9E     ;3
       BNE    LF4D7   ;2
       LDA    $85     ;3
       CMP    $93     ;3
       BNE    LF4D7   ;2
       LDY    $E2     ;3
       LDA    $94     ;3
       CMP    $92     ;3
       BEQ    LF4BF   ;2
       LDA    $CC     ;3
       STA    $F9,X   ;4
       LDA    #$01    ;2
       STA    $EC,X   ;4
       CLC            ;2
       ADC    LFFCE,Y ;4
       STA    $E4,X   ;4
       LDA    #$FB    ;2
       STA    $E8,X   ;4
       LDA    $90     ;3
       STA    $A0,X   ;4
       BNE    LF4D7   ;2
LF4BF: STY    $AC,X   ;4
       LDY    #$08    ;2
       LDA    $90     ;3
       STA    $A4,X   ;4
       CMP    $A0,X   ;4
       BCC    LF4CD   ;2
       LDY    #$00    ;2
LF4CD: STY    $CC     ;3
       STY    $B0,X   ;4
       LDY    #$1A    ;2
       STY    $A8,X   ;4
       BNE    LF4FF   ;2
LF4D7: LDA    $AC,X   ;4
       CMP    #$06    ;2
       BCC    LF4F8   ;2
       CMP    #$08    ;2
       BCS    LF502   ;2
       LDA    #$01    ;2
       JSR    LFD91   ;6
       BCC    LF4F8   ;2
       LDA    $8E     ;3
       LSR            ;2
       TAY            ;2
       LDA    LF6D4,Y ;4
       AND    #$01    ;2
       CLC            ;2
       ADC    #$06    ;2
       STA    $AC,X   ;4
       BPL    LF4FF   ;2
LF4F8: LDY    #$00    ;2
       STY    $AC,X   ;4
       INY            ;2
       STY    $A4,X   ;4
LF4FF: JMP    LF5B5   ;3
LF502: BNE    LF554   ;2
       LDA    #$00    ;2
       JSR    LFD91   ;6
       LDY    #$0D    ;2
       CMP    #$04    ;2
       BCS    LF514   ;2
       LSR            ;2
       BCS    LF514   ;2
       LDY    #$03    ;2
LF514: STY    $D9     ;3
       TYA            ;2
       CLC            ;2
       ADC    #$08    ;2
       ASL            ;2
       STA    $9E     ;3
       LDY    $F1     ;3
       INY            ;2
       CPY    $9E     ;3
       BCC    LF526   ;2
       LDY    #$00    ;2
LF526: STY    $9F     ;3
       TYA            ;2
       SEC            ;2
       SBC    $D9     ;3
       CMP    #$10    ;2
       BCS    LF53E   ;2
       CMP    #$08    ;2
       BCC    LF536   ;2
       EOR    #$0F    ;2
LF536: TAY            ;2
       LDA    LFCDF,Y ;4
       AND    $8E     ;3
       BNE    LF54D   ;2
LF53E: LDY    $9F     ;3
       STY    $F1     ;3
       LSR    $9E     ;5
       CPY    $9E     ;3
       BCS    LF54B   ;2
       DEC    $A8,X   ;6
       BIT    $A8F6   ;4
LF54D: LDA    $8E     ;3
       LSR            ;2
       BCC    LF4FF   ;2
       BCS    LF587   ;2
LF554: CMP    #$09    ;2
       BNE    LF568   ;2
       LDA    #$02    ;2
       JSR    LFD91   ;6
LF55D: BCC    LF4F8   ;2
       CMP    #$03    ;2
       BCS    LF587   ;2
       LSR            ;2
       BCS    LF58A   ;2
       BCC    LF587   ;2
LF568: CMP    #$0C    ;2
       BCS    LF5B5   ;2
       LDA    #$09    ;2
       STA    $A8,X   ;4
       LDA    $8E     ;3
       AND    #$02    ;2
       LSR            ;2
       ADC    #$0A    ;2
       STA    $AC,X   ;4
       LDA    #$03    ;2
       JSR    LFD91   ;6
       BCC    LF55D   ;2
       CMP    #$04    ;2
       BCC    LF586   ;2
       LDA    #$03    ;2
LF586: BIT.w  $00A9   ;4
       BIT    $01A9   ;4
       STA    $9E     ;3
LF58E: LDA    $8B     ;3
       CMP    #$05    ;2
       BCS    LF5B5   ;2
       BIT    $88     ;3
       BPL    LF5B5   ;2
       LDY    #$01    ;2
       LDA    #$08    ;2
       AND    $B0,X   ;4
       BNE    LF5A2   ;2
       LDY    #$FF    ;2
LF5A2: TYA            ;2
       ADC    $A4,X   ;4
       BNE    LF5A9   ;2
       LDA    #$A0    ;2
LF5A9: CMP    #$A1    ;2
       BCC    LF5AF   ;2
       LDA    #$01    ;2
LF5AF: STA    $A4,X   ;4
       DEC    $9E     ;5
       BPL    LF58E   ;2
LF5B5: DEX            ;2
       BMI    LF5BB   ;2
       JMP    LF48E   ;3
LF5BB: LDY    #$18    ;2
       LDA    $F2     ;3
       LSR            ;2
       LSR            ;2
       AND    #$03    ;2
       STA    $9E     ;3
       LDX    $93     ;3
       BEQ    LF5D1   ;2
       CPX    #$07    ;2
       BNE    LF5ED   ;2
       ADC    #$03    ;2
       LDY    #$31    ;2
LF5D1: TAX            ;2
       LDA    #$8A    ;2
       SEC            ;2
       SBC    $9E     ;3
       STA    $F3     ;3
       LDA    LFFC6,X ;4
       STA    $F4     ;3
       LDX    #$18    ;2
LF5E0: LDA    LFBC1,Y ;4
       CMP    #$FF    ;2
       BEQ    LF5E9   ;2
       STA    $A4,X   ;4
LF5E9: DEY            ;2
       DEX            ;2
       BPL    LF5E0   ;2
LF5ED: CPX    #$04    ;2
       BEQ    LF5F4   ;2
       JMP    LF686   ;3
LF5F4: DEX            ;2
       LDA    #$06    ;2
LF5F7: STA    $B7,X   ;4
       DEX            ;2
       BNE    LF5F7   ;2
       JSR    LFEBB   ;6
       TAX            ;2
       LDA    $F2     ;3
       AND    #$7F    ;2
       CMP    #$70    ;2
       BCC    LF662   ;2
       LSR            ;2
       LSR            ;2
       AND    #$03    ;2
       CMP    #$03    ;2
       BNE    LF63E   ;2
       LDA    #$80    ;2
       BIT    $F2     ;3
       BPL    LF62A   ;2
       LDA    $F0     ;3
       AND    #$03    ;2
       TAY            ;2
       LDA    $94     ;3
       CMP    LFEC6,Y ;4
       BNE    LF626   ;2
       DEC    $F2     ;5
       BNE    LF67E   ;2
LF626: LDA    #$00    ;2
       INC    $F0     ;5
LF62A: STA    $F2     ;3
       LDY    #$1A    ;2
       STY    $A8,X   ;4
       LDY    #$01    ;2
       STY    $A4,X   ;4
       LDY    $FD     ;3
       STY    $B0,X   ;4
       LDA    $F1     ;3
       STA    $AC,X   ;4
       BPL    LF676   ;2
LF63E: BIT    $F2     ;3
       BMI    LF646   ;2
       EOR    #$03    ;2
       SBC    #$00    ;2
LF646: LDY    #$18    ;2
       STY    $A8,X   ;4
       LDY    #$4C    ;2
       STY    $A4,X   ;4
       LDY    #$04    ;2
       STY    $B4,X   ;4
       LDY    #$0E    ;2   
       STY    $AC,X   ;4
       TAY            ;2
       LDA    LFDFD,Y ;4
       STA    $B0,X   ;4
       BNE    LF660   ;2
       INC    $A4,X   ;6
LF660: BNE    LF67A   ;2
LF662: CMP    #$6F    ;2
       BNE    LF676   ;2
       LDA    $A4,X   ;4
       CMP    #$03    ;2
       BCC    LF66E   ;2
       DEC    $F2     ;5
LF66E: LDA    $AC,X   ;4
       STA    $F1     ;3
       LDA    $B0,X   ;4
       STA    $FD     ;3
LF676: BIT    $F2     ;3
       BPL    LF67E   ;2
LF67A: INC    $B8,X   ;6
       BNE    LF686   ;2
LF67E: BIT    $80     ;3
       BPL    LF686   ;2
       LDA    #$48    ;2
       STA    $EC,X   ;4
LF686: LDX    #$03    ;2
LF688: TXA            ;2
       ASL            ;2
       ASL            ;2
       TAY            ;2
       LDA    $9A,X   ;4
       AND    #$F0    ;2
       LSR            ;2
       STA.wy $00BD,Y ;5
       LDA    $9A,X   ;4
       AND    #$0F    ;2
       ASL            ;2
       ASL            ;2
       ASL            ;2
       STA.wy $00BF,Y ;5
       DEX            ;2
       BPL    LF688   ;2
       INX            ;2
       LDY    #$58    ;2
LF6A4: LDA    $BD,X   ;4
       BNE    LF6B0   ;2
       STY    $BD,X   ;4
       INX            ;2
       INX            ;2
       CPX    #$0A    ;2
       BCC    LF6A4   ;2
LF6B0: JSR    LFCE7   ;6
       LDA    $A0,X   ;4
       LDY    $93     ;3
       JSR    LFDA7   ;6
       STA    $9E     ;3
       LDA    $90     ;3
       LDY    $85     ;3
       JSR    LFDA7   ;6
       STA    $9F     ;3
       LDY    #$09    ;2
LF6C7: LDA.wy $009E,Y ;4
       JSR    LFD0D   ;6
       BPL    LF6C7   ;2
       LDA    #$BA    ;2 changed from NTSC value 88
       STA    COLUBK  ;3
       NOP            ;2
LF6D4: LDA    INTIM   ;4
       BNE    LF6D4   ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       BIT    $99     ;3
       BPL    LF6E3   ;2
       LDA    #$02    ;2
LF6E3: STA    VBLANK  ;3
       JSR    LFD24   ;6
       TAX            ;2
       LDA    $C9     ;3
       STA    $C5     ;3
       LDA    $CB     ;3
       STA    $C7     ;3
       LDY    #$40    ;2
       STY    HMP0    ;3
       STY    HMP1    ;3
       LDY    $96     ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
LF6FD: LDA    #$58    ;2
       DEY            ;2
       BMI    LF704   ;2
       LDA    #$50    ;2  
LF704: STA    $BD,X   ;4
       INX            ;2
       INX            ;2
       CPX    #$06    ;2
       BNE    LF6FD   ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       INX            ;2
       STX    $9F     ;3
       LDA    #$58    ;2
       STA    $C3     ;3
       LDX    $CA     ;3
       STX    COLUP0  ;3
       STX    COLUP1  ;3
       JSR    LFD5A   ;6
       STA    VDELP1  ;3
       STA    NUSIZ1  ;3
       STA    CXCLR   ;3
       LDA    #$FB    ;2
       STA    $BE     ;3
       LDA    #$FC    ;2
       STA    $C8     ;3
       STA    $C2     ;3
       STA    $C0     ;3
       LDY    #$03    ;2
       BPL    LF73C   ;2
LF736: JMP    LF8A6   ;3
LF739: LDY    $C4     ;3
       DEY            ;2
LF73C: BMI    LF736   ;2
       LDA.wy $00E4,Y ;4
       STA    $C5     ;3
       LDA.wy $00E8,Y ;4
       STA    $C6     ;3
       STY    $C4     ;3
       LDX    #$22    ;2
       STX    HMBL    ;3
       LDA    #$31    ;2
       STA    CTRLPF  ;3
       LDA    #$00    ;2
       STX    ENABL   ;3
       STA    RESBL   ;3
       STA    HMOVE   ;3
       STA    GRP0    ;3
       STA    GRP1    ;3
       STA    PF1     ;3
       STA    COLUPF  ;3
       LDX    $B9,Y   ;4
       CPX    #$08    ;2
       BNE    LF76A   ;2
       LDA    #$F0    ;2
LF76A: STA    PF2     ;3
       LDX    $AC,Y   ;4
       LDA    LFE00,X ;4
       STA    $C3     ;3
       LDA    LFFCE,X ;4
       STA    $BD     ;3
       LDA    LFFDF,X ;4
       STA    $C1     ;3
       LDA.wy $00F9,Y ;4
       STA    REFP1   ;3
       LDA    CXPPMM  ;3
       STA.wy $0082,Y ;5
       LDA.wy $00D9,Y ;4
       STA    WSYNC   ;3
       STA    HMP1    ;3
       LDA    #$00    ;2
       STA    PF2     ;3
       LDX    $CF,Y   ;4
LF794: DEX            ;2
       BPL    LF794   ;2
       LDX    $D3,Y   ;4
       STA    RESP1   ;3
       STA    WSYNC   ;3
       LDA.wy $00DD,Y ;4
       STA    HMP0    ;3
       LDA    LFEDF,Y ;4
       STA    COLUBK  ;3
LF7A7: DEX            ;2
       BPL    LF7A7   ;2
       NOP            ;2
       STA    RESP0   ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    COLUPF  ;3
       LDX    $B8,Y   ;4
       LDA.wy $00EC,Y ;4
       STA    $C7     ;3
       LDA    LFE22,X ;4
       STA    PF2     ;3
       LDA    LFE1A,X ;4
       STA    PF1     ;3
       LDA    LFE11,X ;4
       LDX    $B4,Y   ;4
       NOP            ;2
       STA    RESBL   ;3
       BNE    LF7D0   ;2
       STA    RESBL   ;3
LF7D0: CPX    #$04    ;2
       BCS    LF7D6   ;2
       LDA    $F3     ;3
LF7D6: STA    $BF     ;3
       STA    HMCLR   ;3
       LDA    #$21    ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    CTRLPF  ;3
       LDA    LFFC0,X ;4
       STA    GRP0    ;3
       LDA.wy $00B0,Y ;4
       STA    NUSIZ0  ;3
       STA    REFP0   ;3
       LDA    LFCDB,X ;4
       STA    ENABL   ;3
       STA    HMP0    ;3
       CPY    #$03    ;2
       BEQ    LF819   ;2
       NOP            ;2
       LDA    #$c0    ;2 
       STA    COLUP0  ;3
       STA    CXCLR   ;3
       NOP            ;2
       LDA    $F4     ;3
       STA    HMBL    ;3
       LDX    $A8,Y   ;4
       LDY    #$1A    ;2
       LDA    ($C7),Y ;5
       STA    COLUP1  ;3
       NOP            ;2
       LDA    #$54    ;2   background colour (NTSC value C4)
       STA    COLUBK  ;3
       STA    HMOVE   ;3
       LDA    ($C7),Y ;5
       JMP    LF863   ;3
LF819: LDA    $AB     ;3
       SBC    #$06    ;2
       STA    $9E     ;3
       LDA    #$04    ;2
       STA    COLUPF  ;3
       LDY    #$1D    ;2
LF825: DEY            ;2
       LDA    ($C7),Y ;5
       TAX            ;2
       AND    #$01    ;2
       BEQ    LF82F   ;2
       LDA    ($C5),Y ;5
LF82F: STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    GRP1    ;3
       STX    COLUP1  ;3
       LDX    LFCEC,Y ;4
       STX    COLUBK  ;3
       LDA    LFE3C,Y ;4
       STA    PF0     ;3
       STA    PF1     ;3
       STA    PF2     ;3
       LDX    $9E     ;3
       CPY    #$14    ;2
       BEQ    LF873   ;2
       BNE    LF825   ;2
LF84D: JSR    LFEFE   ;6
       LDA    #$B0    ;2   ntsc value c0 (staircase colour)
       BNE    LF883   ;2   changed from BMI in ntsc code (NEW VALUE MEANS +VE INSTEAD OF -VE IN ACCUMULATOR)
LF854: STA.w  $001C   ;4
       BEQ    LF86B   ;2
LF859: DEX            ;2
       STA.w  $0006   ;4
       STA    HMOVE   ;3
       LDA    ($C7),Y ;5
       STA    COLUP1  ;3
LF863: AND    #$01    ;2
       BEQ    LF854   ;2
       LDA    ($C5),Y ;5
       STA    GRP1    ;3
LF86B: LDA    ($BF),Y ;5
       STA    COLUPF  ;3
       AND    $BC     ;3
       STA    HMBL    ;3
LF873: STY    $9E     ;3
       CPX    $C3     ;3
       BCS    LF84D   ;2
       TXA            ;2
       TAY            ;2
       LDA    ($BD),Y ;5
       STA    GRP0    ;3
       LDA    ($C1),Y ;5
       LDY    $9E     ;3
LF883: DEY            ;2
       BNE    LF859   ;2
       LDX    #$2C    ;2 floor colour NTSC value 18
       STA    COLUP0  ;3
       STA    HMOVE   ;3
       STX    COLUBK  ;3
       LDA    ($C7),Y ;5
       STA    COLUP1  ;3
       AND    #$01    ;2
       BEQ    LF8A1   ;2
       LDA    ($C5),Y ;5
       STA    GRP1    ;3
LF89A: STY    ENABL   ;3
       NOP            ;2
       NOP            ;2
       JMP    LF739   ;3
LF8A1: STA.w  $001C   ;4
       BEQ    LF89A   ;2
LF8A6: INY            ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STY    PF1     ;3
       STY    PF2     ;3
       STY    GRP0    ;3
       STY    GRP1    ;3
       STY    GRP0    ;3
       STY    REFP1   ;3
       STY    REFP0   ;3
       STY    VDELP0  ;3
       STY    NUSIZ0  ;3
       LDA    $91     ;3
       LSR            ;2
       LSR            ;2
       LSR            ;2
       EOR    #$FF    ;2
       CLC            ;2
       STA    RESBL   ;3
       ADC    #$65    ;2
       STA    $CF     ;3
       LDA    CXPPMM  ;3
       STA    $81     ;3
       LDA    #$FC    ;2
       STA    $D0     ;3
       STA    $D4     ;3
       STA    HMCLR   ;3
       LDX    $CD     ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    $DA     ;3
       LDA    #$0F    ;2
       STA    COLUP1  ;3
       LDA    $D7     ;3
       NOP            ;2
LF8E6: DEX            ;2
       BPL    LF8E6   ;2
       STA    RESM0   ;3
       STA    HMCLR   ;3
       STA    HMM0    ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STY    COLUP0  ;3
       LDY    #$28    ;2 floor colour (NTSC value 16) used for bottom floor.
       STY    COLUBK  ;3
       NOP            ;2
       LDX    $CE     ;3
LF8FC: DEX            ;2
       BPL    LF8FC   ;2
       STA    RESM1   ;3
       LDA    $D8     ;3
       STA    HMCLR   ;3
       STA    HMM1    ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STY    COLUPF  ;3
       LDA    #$11    ;2
       STA    CTRLPF  ;3
       LDA    $F0     ;3
       AND    #$03    ;2
       TAY            ;2
       LDA    LFBF6,Y ;4
       STA    $D9     ;3
       LDA    $94     ;3
       AND    #$18    ;2
       LSR            ;2
       EOR    #$FF    ;2
       ADC    #$65    ;2
       STA    $D3     ;3
       LDY    #$10    ;2
       LDA    #$FC    ;2
       STA    PF1     ;3
       STX    PF0     ;3
       STA    HMCLR   ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       TXA            ;2
       LDX    #$0B    ;2
LF937: STA    $BD,X   ;4
       DEX            ;2
       DEX            ;2
       BPL    LF937   ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDA    #$08    ;2
       STA    COLUPF  ;3
       BNE    LF975   ;2
LF947: DEY            ;2
       LDX    #$00    ;2
       LDA    #$26    ;2 radar map colour for floor(NTSC 16)
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    COLUBK  ;3
       STX    GRP0    ;3
       STX    ENAM0   ;3
       STX    ENAM1   ;3
       JSR    LFEFF   ;6
       LDA    #$90    ;2
       STA    RESP0   ;3
       STA    HMP0    ;3
       TYA            ;2
       AND    #$04    ;2
       BNE    LF988   ;2
       JSR    LFEFF   ;6
       STA    RESP0   ;3
       BPL    LF988   ;2
LF96D: STA    WSYNC   ;3
       STA    HMOVE   ;3
       STX    GRP0    ;3
       STA    ENABL   ;3
LF975: LDA    ($D3),Y ;5
       STA    ENAM1   ;3
       LDA    ($CF),Y ;5
       STA    ENAM0   ;3
       LDA    LFEE3,Y ;4
       STA    COLUBK  ;3
       STA    HMCLR   ;3
       CMP    #$18    ;2
       BEQ    LF947   ;2
LF988: LDA    ($D9),Y ;5
       LDX    LFDEC,Y ;4
       DEY            ;2
       BPL    LF96D   ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDA    #$08    ;2
       STA    COLUBK  ;3
       INY            ;2
       STY    PF1     ;3
       STY    PF0     ;3
       LDY    #$07    ;2
       LDA    $8A     ;3
       AND    #$1F    ;2
       CMP    #$14    ;2
       BCS    LF9AE   ;2
       LDY    #$00    ;2
       SBC    #$0B    ;2
       BCC    LF9AE   ;2
       TAY            ;2
LF9AE: STY    $9F     ;3
       TYA            ;2
       EOR    #$07    ;2
       STA    $85     ;3
       LDA    #$85    ;2
       LDX    #$08    ;2
       SEC            ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
LF9BE: STA    $BF,X   ;4
       SBC    #$08    ;2
       STA    $BD,X   ;4
       SBC    #$08    ;2
       DEX            ;2
       DEX            ;2
       DEX            ;2
       DEX            ;2
       BPL    LF9BE   ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDA    #$00    ;2
       STA    COLUBK  ;3
       STA    COLUPF  ;3
       JSR    LFD28   ;6
       LDA    #$78    ;2 
       STA    PF1     ;3
       LDA    #$31    ;2
       STA    CTRLPF  ;3
       STA    NUSIZ1  ;3
       STA    HMCLR   ;3
       LSR            ;2
       STA    HMBL    ;3
       LDY    #$07    ;2
       STY    ENABL   ;3
LF9EC: LDX    LFFB8,Y ;4
       LDA    LFF98,Y ;4
       STA    GRP0    ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDA    LFF8D,Y ;4
       STA    COLUPF  ;3
       LDA    LFFA0,Y ;4
       STA    GRP1    ;3
       LDA    LFFA8,Y ;4
       STA    GRP0    ;3
       LDA    ($BD),Y ;5
       LDA    LFFB0,Y ;4
       STA    GRP1    ;3
       STX    GRP0    ;3
       STA    GRP1    ;3
       LDA    #$00    ;2
       STA    COLUPF  ;3
       DEY            ;2
       DEC    $85     ;5
       BPL    LF9EC   ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    GRP0    ;3
       STA    GRP1    ;3
       STA    GRP0    ;3
       STA    PF1     ;3
       STA    ENABL   ;3
       JMP    LF011   ;3
LFA2C: LDA    LFED2,Y ;4
       STA.wy $0090,Y ;5
       DEY            ;2
       BPL    LFA2C   ;2
       STA    $A0     ;3
       LDA    #$50    ;2 
       STA    $9D     ;3
       LDX    #$03    ;2
LFA3D: LDY    $F1,X   ;4
       LDA    LF011,Y ;4
       AND    #$07    ;2
       TAY            ;2
       LDA    LFCEE,Y ;4
       STA    $F5,X   ;4
       DEX            ;2
       BPL    LFA3D   ;2
LFA4D: LDA    $93     ;3
       AND    #$03    ;2
       STA    $9E     ;3
       STA    $B8     ;3
       STA    $BA     ;3
       CLC            ;2
       ADC    #$02    ;2
       STA    $B9     ;3
       LDX    #$03    ;2
LFA5E: LDA    $93     ;3
       BEQ    LFA8D   ;2
       CMP    $F5,X   ;4
       BNE    LFA6D   ;2
       TXA            ;2
       AND    #$01    ;2
       ADC    #$0E    ;2  
       BPL    LFA8D   ;2
LFA6D: TXA            ;2
       CLC            ;2
       ADC    $9E     ;3
       ADC    #$07    ;2
       CMP    #$0B    ;2
       BCC    LFA79   ;2
       SBC    #$04    ;2
LFA79: LDY    $9E     ;3
       BNE    LFA83   ;2
       CMP    #$09    ;2
       BCS    LFA83   ;2
       ADC    #$02    ;2
LFA83: CPX    #$03    ;2
       BNE    LFA8D   ;2
       ROR            ;2
       BCS    LFA8C   ;2
       SBC    #$00    ;2
LFA8C: ROL            ;2
LFA8D: STA    $AC,X   ;4
       LDY    #$00    ;2
       STY    $BB     ;3
       STY    $F1     ;3
       STY    $B0,X   ;4
       STY    $81,X   ;4
       LDY    #$1A    ;2
       STY    $A8,X   ;4
       TAY            ;2
       BEQ    LFAF3   ;2
       CMP    #$0F    ;2
       BCS    LFAEF   ;2
       LDA    LFFE9,Y ;4
       STA    $BD     ;3
       LDA    $97     ;3
       LSR            ;2
       LSR            ;2
       STA    $85     ;3
       LDA    $97     ;3
       AND    #$03    ;2
       CMP    LFF8D,Y ;4
       LDA    $85     ;3
       BEQ    LFAC2   ;2
       SBC    #$00    ;2
       CMP    #$04    ;2
       BCC    LFAC2   ;2
       LDA    #$03    ;2
LFAC2: TAY            ;2
       LDA    ($BD),Y ;5
       LDY    #$04    ;2
       CPY    $93     ;3
       BNE    LFACD   ;2
       LDA    #$00    ;2
LFACD: ORA    $80     ;3
       STA    $B0,X   ;4
       LDY    $AC,X   ;4
       CPY    #$07    ;2
       BEQ    LFAE9   ;2
       LDY    #$06    ;2
       AND    #$08    ;2
       BNE    LFAF1   ;2
       LDY    #$9A    ;2
       LDA    #$04    ;2
       AND    $B0,X   ;4
       BEQ    LFAF1   ;2
       LDY    #$5A    ;2
       BNE    LFAF1   ;2
LFAE9: LDY    #$2D    ;2
       AND    #$07    ;2
       BNE    LFAF1   ;2
LFAEF: LDY    #$4D    ;2
LFAF1: STY    $A4,X   ;4
LFAF3: DEX            ;2
       BMI    LFAF9   ;2
       JMP    LFA5E   ;3
LFAF9: LDA    $8E     ;3
       AND    #$F3    ;2
       STA    $8E     ;3
       RTS            ;6

LFB00: .byte $00,$3C,$7E,$7E,$7E,$7E,$3C,$80,$80,$C6,$64,$6C,$7C,$38,$30,$7C
       .byte $7E,$72,$70,$30,$38,$38,$3C,$38,$38,$38,$38,$00,$00,$03,$62,$F2
       .byte $BE,$3C,$B8,$B8,$FC,$7E,$32,$32,$38,$38,$3C,$38,$38,$38,$38,$04
       .byte $86,$88,$E8,$28,$38,$38,$30,$7C,$7E,$72,$70,$30,$38,$38,$3C,$38
       .byte $38,$38,$38,$18,$50,$50,$7E,$16,$3C,$38,$3C,$3C,$38,$38,$30,$30 
       .byte $38,$38,$3C,$38,$38,$38,$38,$20,$42,$44,$62,$66,$2E,$3C,$38,$3C
       .byte $3C,$38,$30,$30,$38,$38,$3C,$38,$38,$38,$38,$E7,$BD,$E7,$BD,$FF
       .byte $A5,$DB,$5A,$66,$3C,$42,$18,$00,$00,$E7,$BD,$E7,$BD,$FF,$A5,$DB
       .byte $5A,$66,$3C,$00,$00,$81,$24,$66,$7F,$09,$FE,$AA,$FE,$AA,$FE,$AA
       .byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$24,$3C,$3E,$7F,$7F,$7F,$7F,$7F
       .byte $3E,$1C,$08,$1C,$36,$07,$0F,$13,$23,$43,$47,$7E,$7C,$00,$60,$20
       .byte $78,$76,$6F,$DF,$B3,$83,$78,$00,$60,$20,$78,$F6,$EF,$DF,$33,$03
       .byte $78
LFBC1: .byte $FF,$4C,$6C,$FF,$FF,$1A,$15,$FF,$FF,$0C,$0D,$FF,$FF,$05,$05,$FF
       .byte $FF,$00,$02,$FF,$03,$00,$08,$00,$40,$44,$24,$44,$22,$1A,$15,$1A
       .byte $15,$0C,$0D,$0C,$0D,$0D,$0D,$0D,$0D,$01,$03,$01,$03,$00,$08,$00
       .byte $08,$C0,$4D,$2D,$2D
LFBF6: .byte $81,$7D,$79,$7D
LFBFA: .byte $61,$38,$61
LFBFD: .byte $A8,$80,$A8,$01,$03,$03,$03,$03,$0D,$03,$0D,$03,$0D,$03,$0D,$03
;       .byte $2B,$2B,$2B,$2B,$2B,$0D,$03,$0D,$14,$16,$18,$1A,$1C,$1E,$1C,$18 ; money bag & suitcase colours (ntsc)
;       .byte $10,$16,$18,$18,$18,$18,$16,$14,$00,$00,$00,$1C,$1C,$1C,$1C,$1C ; money bag & suitcase colours (ntsc)
       .byte $2B,$2B,$2B,$2B,$2B,$0D,$03,$0D,$24,$26,$28,$2A,$2C,$2E,$2C,$28 ;money bag and suitcase colours (pal60)
       .byte $20,$26,$28,$28,$28,$28,$26,$24,$00,$00,$00,$1C,$1C,$1C,$1C,$1C ;money bag and suitcase colours (pal60)

;       .byte $00,$42,$44,$46,$46,$44,$42,$83,$83,$83,$83,$83,$83,$83,$83,$83 ; cop colour ntsc value 83 + ball colours 42,44,46,46,44,42
       .byte $00,$62,$64,$66,$66,$64,$62,$b3,$b3,$b3,$b3,$b3,$b3,$b3,$b3,$b3 ; cop colour pal60 value d3
       .byte $b3,$2B,$2B,$2B,$2B,$2B,$01,$01,$01,$01,$01,$00,$00,$00,$0C,$0C ; 1st byte part of cop colour ntsc val 83 changed to b3
       .byte $0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C

;       .byte $0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$FF,$FF,$FF,$18,$C0,$C0,$C0,$C0 ;staircase (ntsc)
;       .byte $C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0 ; ''
;       .byte $C0,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$FF,$FC,$0C,$0C,$0C,$FC,$0C,$0C ; ''
       .byte $0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$FF,$FF,$FF,$18,$B0,$B0,$B0,$B0 ; staircase (pal60)
       .byte $B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0,$B0 ; ''
       .byte $B0,$B0,$B0,$B0,$B0,$B0,$B0,$FF,$FF,$FC,$0C,$0C,$0C,$FC,$0C,$0C ; ''

       .byte $0C,$FC,$0C,$0C,$0C,$FC,$0C,$0C,$0C,$FC,$0C,$0C,$0C,$FC,$0C,$0C
       .byte $0C,$FC,$0C,$0C,$0C,$FC,$0C,$0C,$0C,$FC,$18,$18,$B6,$B6,$B6,$B6
       .byte $B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6
;       .byte $B6,$B6,$BE,$BE,$96,$96,$96,$96,$96,$96,$96,$96,$9A,$9A,$C4,$C4 ; background graphics ntsc colour values
       .byte $B6,$B6,$BE,$BE,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$B6,$BA,$BA,$54,$54 ; background graphics pal60 colour values
;       .byte $C4,$C4,$C4,$C4,$C4,$C4,$C4,$C4,$C4,$C4,$C4,$C4,$C4,$C4 ; background graphics ntsc colour values
       .byte $54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54,$54 ; background graphics pal60 colour values
LFCDB: .byte $12,$F2,$10,$F0
LFCDF: .byte $01,$01,$01,$03,$03,$07,$07,$0F
LFCE7: LDA    $92     ;3
       LSR            ;2
       LSR            ;2
       LSR            ;2
LFCEC: TAX            ;2
       RTS            ;6

LFCEE: .byte $01,$01,$02,$03,$03,$05,$06,$06
LFCF6: .byte $BF,$7F,$BF
;LFCF9: .byte $7F,$F1,$83,$87,$EE,$4B,$DF,$04,$18,$18,$28,$28,$38,$48,$58,$68 ; sunset colours (68-18) NTSC values
LFCF9: .byte $7F,$F1,$83,$87,$EE,$4B,$DF,$04,$28,$2C,$28,$28,$48,$68,$88,$A8 ; sunset colours (A8-18) PAL60 values
LFD09: .byte $68
LFD0A: .byte $07,$00,$07
LFD0D: LDX    #$FF    ;2
       SEC            ;2
LFD10: INX            ;2
       SBC    #$0F    ;2
       BCS    LFD10   ;2
       STX    $CD,Y   ;4
       EOR    #$0F    ;2
       ASL            ;2
       ASL            ;2
       ASL            ;2
       ASL            ;2
       ADC    #$90    ;2
       STA.wy $00D7,Y ;5
       DEY            ;2
       RTS            ;6

LFD24: LDA    #$07    ;2
       STA    $9F     ;3
LFD28: STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDA    #$0F    ;2
       STA    COLUP0  ;3
       STA    COLUP1  ;3
       LDX    #$F3    ;2
       STX    NUSIZ0  ;3
       STX    NUSIZ1  ;3
       LDY    #$01    ;2
       LDA    #$40    ;2
       NOP            ;2
       STA    RESP0   ;3
       STA    RESP1   ;3
       STA    RESBL   ;3
       STY    CTRLPF  ;3
       STA    HMBL    ;3
       STX    HMP0    ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STY    VDELP0  ;3
       STY    VDELP1  ;3
       DEY            ;2
       STY    GRP0    ;3
       STY    GRP1    ;3
       STY    GRP0    ;3
       STA    $9E     ;3
LFD5A: STA    HMCLR   ;3
LFD5C: LDY    $9F     ;3
       LDA    ($C7),Y ;5
       STA    $9E     ;3
       LDA    ($C5),Y ;5
       TAX            ;2
       LDA    ($BD),Y ;5
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    GRP0    ;3
       LDA    ($BF),Y ;5
       STA    GRP1    ;3
       LDA    ($C1),Y ;5
       STA    GRP0    ;3
       LDA    ($C3),Y ;5
       LDY    $9E     ;3
       STA    GRP1    ;3
       STX    GRP0    ;3
       STY    GRP1    ;3
       STA    GRP0    ;3
       DEC    $9F     ;5
       BPL    LFD5C   ;2
       LDA    #$80    ;2
       STA    HMP0    ;3
       STA    HMP1    ;3
       ASL            ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       RTS            ;6

LFD91: STA    $9E     ;3
       LDA    $97     ;3
       LSR            ;2
       LSR            ;2
       TAY            ;2
       LDA    $97     ;3
       AND    #$03    ;2
       CMP    $9E     ;3
       BCS    LFDA5   ;2
       TYA            ;2
       BEQ    LFDA5   ;2
       SEC            ;2
       DEY            ;2
LFDA5: TYA            ;2
       RTS            ;6

LFDA7: LSR            ;2
       LSR            ;2
       LSR            ;2
       LSR            ;2
LFDAB: CLC            ;2
       ADC    #$0A    ;2
       INY            ;2
       CPY    #$08    ;2
       BCC    LFDAB   ;2
       ADC    #$1F    ;2
       RTS            ;6

LFDB6: LDX    #$01    ;2
LFDB8: BIT    $98     ;3
       BMI    LFDE3   ;2
       LDY    $9A     ;3
       SED            ;2
       CLC            ;2
LFDC0: ADC    $9A,X   ;4
       STA    $9A,X   ;4
       LDA    #$00    ;2
       DEX            ;2
       BPL    LFDC0   ;2
       CLD            ;2
       BCC    LFDD6   ;2
       LDA    #$AA    ;2
       STA    $9C     ;3
       STA    $9B     ;3
       STA    $9A     ;3
       INC    $88     ;5
LFDD6: CPY    $9A     ;3
       BEQ    LFDE3   ;2
       LDX    $96     ;3
       INX            ;2
       CPX    #$04    ;2
       BCS    LFDE3   ;2
       STX    $96     ;3
LFDE3: RTS            ;6

LFDE4: BIT    $98     ;3
       BMI    LFDEC   ;2
       STA    AUDC0   ;3
       STA    AUDV0   ;3
LFDEC: RTS            ;6

LFDED: .byte $00,$06,$0C,$18,$00,$60,$30,$18,$00,$06,$0C,$18,$00,$00,$00,$00
LFDFD: .byte $00,$05,$07
LFE00: .byte $01,$15,$15,$15,$15,$15,$0F,$0F,$07,$0B,$0A,$0A,$05,$04,$01,$0B
       .byte $0C
LFE11: .byte $4A,$4A,$c0,$c0,$c0,$4A,$67,$A6,$A6 
LFE1A: .byte $00,$10,$1C,$03,$1C,$10,$00,$00
LFE22: .byte $00,$08,$00,$0F,$1C,$08,$80,$80,$00,$70,$78,$FE,$F6,$FC,$78,$38
       .byte $0C,$1C,$1C,$1E,$1C,$3F,$1E,$1E,$1E,$0C
LFE3C: .byte $3E,$34,$3E,$3E,$7E,$76,$7E,$76,$7E,$34,$18,$38,$38,$3C,$38,$7E
       .byte $3C,$3C,$3C,$18,$00,$7F,$7F,$5F,$5F,$5A,$1A,$00,$00,$00,$00,$B3
       .byte $FE,$36,$BE,$F4,$7E,$19,$39,$39,$3D,$39,$7E,$3C,$3C,$3C,$18,$80
       .byte $83,$FF,$7E,$7E,$36,$7E,$77,$7D,$34,$18,$38,$38,$3C,$38,$7E,$3C
       .byte $3C,$3C,$18,$02,$83,$FC,$FC,$3C,$34,$7E,$77,$7D,$34,$18,$38,$38
       .byte $3C,$38,$7E,$3C,$3C,$3C,$18,$18,$50,$7E,$7E,$3C,$3E,$3E,$3C,$3C
       .byte $34,$18,$38,$38,$3C,$38,$7E,$3C,$3C,$3C,$18,$20,$46,$7C,$7E,$7E
       .byte $34,$3E,$3E,$3C,$34,$18,$38,$38,$3C,$38,$7E,$3C,$3C,$3C,$18
LFEBB: LDA    $F0     ;3
       AND    #$03    ;2
       CMP    #$03    ;2
       BNE    LFEC4   ;2
       LSR            ;2
LFEC4: RTS            ;6

LFEC5: .byte $04
LFEC6: .byte $0B,$14,$0B,$04
LFECA: .byte $3D,$6C,$58,$80,$94,$A8,$3D,$2C
LFED2: .byte $4D,$00,$00,$00,$0B,$06,$03,$00,$00,$00,$00,$00,$00
LFEDF: .byte $28,$28,$28,$C8 ; last byte value first scanline of sunset (NTSC value 78). 1st three bytes - floor colour of top 3 floors
;LFEE3: .byte $16,$18,$C4,$C4,$16,$18,$C4,$C4,$16,$18,$C4,$C4,$16,$18,$08,$08  ; values for radar (NTSC)
LFEE3: .byte $26,$28,$54,$54,$26,$18,$54,$54,$26,$18,$54,$54,$26,$18,$08,$08  ; values for radar (PAL60)
       .byte $08
LFEF4: SED            ;2
       LDA    $9D     ;3
       SEC            ;2
       SBC    #$01    ;2
       BCC    LFEFE   ;2
       STA    $9D     ;3
LFEFE: CLD            ;2
LFEFF: RTS            ;6

LFF00: .byte $00,$3C,$66,$66,$66,$66,$66,$3C,$00,$3C,$18,$18,$18,$18,$38,$18
       .byte $00,$7E,$60,$60,$3C,$06,$46,$3C,$00,$3C,$46,$06,$0C,$06,$46,$3C
       .byte $00,$0C,$0C,$7E,$4C,$2C,$1C,$0C,$00,$7C,$46,$06,$7C,$60,$60,$7E
       .byte $00,$3C,$66,$66,$7C,$60,$62,$3C,$00,$18,$18,$18,$0C,$06,$42,$7E
       .byte $00,$3C,$66,$66,$3C,$66,$66,$3C,$00,$3C,$46,$06,$3E,$66,$66,$3C
       .byte $00,$3F,$1E,$1E,$1E,$1E,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00
       .byte $F7,$95,$87,$90,$F0,$00,$47,$41,$77,$55,$75,$00,$00,$00,$03,$00
       .byte $4B,$4A,$6B,$00,$08,$00,$80,$80,$AA,$AA,$BA,$27,$22,$00,$00,$00
       .byte $11,$11,$17,$15,$17,$00,$00,$00,$77,$51,$73,$51,$77
LFF8D: .byte $84,$D6,$D6,$1A,$26,$26,$44,$01,$00,$02,$03
LFF98: .byte $0C,$06,$03,$01,$00,$00,$00,$00
LFFA0: .byte $2D,$29,$E9,$A9,$ED,$61,$2F,$00
LFFA8: .byte $50,$58,$5C,$56,$53,$11,$F0,$00 
LFFB0: .byte $BA,$8A,$BA,$A2,$3A,$80,$FE,$00
LFFB8: .byte $E9,$AB,$AF,$AD,$E9,$00,$00,$00
LFFC0: .byte $43,$43,$00,$00,$C0,$00
LFFC6: .byte $E0,$D0,$C0,$F0,$D0,$E0,$F0,$C0
LFFCE: .byte $00,$06,$1A,$2E,$42,$56,$6A,$78,$00,$86,$AD,$B7,$A4,$A9,$00,$8F
       .byte $99
LFFDF: .byte $2D,$00,$00,$00,$00,$00,$79,$79,$2D,$47
LFFE9: .byte $24,$24,$69,$69,$69,$1C,$14,$F4,$F8,$F8,$58,$00,$04,$06,$06,$00
       .byte $00,$04,$04,$00,$F0,$00,$F0
