; Disassembly of atlantis.bin
; Disassembled Wed Sep 19 17:41:47 2012
; Using DiStella v3.0
;
; Command Line: C:\USERS\FAMILY~1.KEL\2600ASM\DISTELLA.EXE -pafs atlantis.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
AUDC0   =  $15
AUDC1   =  $16
AUDF0   =  $17
AUDF1   =  $18
AUDV0   =  $19
AUDV1   =  $1A
GRP0    =  $1B
GRP1    =  $1C
ENAM0   =  $1D
ENAM1   =  $1E
ENABL   =  $1F
HMP0    =  $20
HMP1    =  $21
VDELP0  =  $25
VDELP1  =  $26
HMOVE   =  $2A
HMCLR   =  $2B
CXCLR   =  $2C
SWCHA   =  $0280
SWCHB   =  $0282
$0285   =  $0285
TIM64T  =  $0296

       ORG $1000

START:
       SEI            ;2
       CLD            ;2
       LDX    #$FF    ;2
       TXS            ;2
       INX            ;2
       TXA            ;2
L1007: STA    VSYNC,X ;4
       INX            ;2
       BNE    L1007   ;2
       STX    $D3     ;3
       LDA    #$01    ;2
       STA    $8E     ;3
       STA    $C5     ;3
       STA    $C6     ;3
       STA    $EF     ;3
       JSR    L1CAF   ;6
L101B: LDA    #$02    ;2
       STA    VBLANK  ;3
       STA    WSYNC   ;3
       STA    VSYNC   ;3
       STA    WSYNC   ;3
       STA    WSYNC   ;3
       STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    VSYNC   ;3
       LDA    #$2C    ;2
       STA    TIM64T  ;4
       LDA    SWCHB   ;4
       ROR    $8E     ;5
       BCS    L103D   ;2
       LSR            ;2
       BCS    L106B   ;2
       ROL            ;2
L103D: LSR            ;2
       ROL    $8E     ;5
       LSR            ;2
       BIT    $8C     ;3
       BCC    L1049   ;2
       ROL    $8C     ;5
       BNE    L10A3   ;2
L1049: BPL    L1060   ;2
L104B: LDA    $FA     ;3
       AND    #$1F    ;2
       STA    $8C     ;3
       INC    $8D     ;5
       LDA    $8D     ;3
       CMP    #$04    ;2
       BNE    L1068   ;2
       LDA    #$00    ;2
       STA    $8D     ;3
       JMP    L1068   ;3
L1060: LDA    $8C     ;3
       EOR    $FA     ;3
       AND    #$1F    ;2
       BEQ    L104B   ;2
L1068: JMP    L1075   ;3
L106B: LDA    #$01    ;2
       STA    $8E     ;3
       STA    $D3     ;3
       STA    $F9     ;3
       BNE    L107B   ;2
L1075: LDA    #$00    ;2
       STA    $F9     ;3
       STA    $D3     ;3
L107B: LDA    #$0A    ;2
       STA    $F4     ;3
       STA    $F0     ;3
       LDA    #$01    ;2
       STA    $F7     ;3
       JSR    L1CAF   ;6
       LDA    #$00    ;2
       STA    $EF     ;3
       STA    $EE     ;3
       STA    $EC     ;3
       STA    $F6     ;3
       STA    $F5     ;3
       STA    $A1     ;3
       STA    $A2     ;3
       STA    $A3     ;3
       STA    $DB     ;3
       LDX    #$06    ;2
L109E: STA    $D4,X   ;4
       DEX            ;2
       BPL    L109E   ;2
L10A3: LDA    $D3     ;3
       BMI    L10AB   ;2
       BNE    L10D5   ;2
       BEQ    L10C5   ;2
L10AB: DEC    $F2     ;5
       BNE    L10C5   ;2
       DEC    $F3     ;5
       BNE    L10C5   ;2
       JSR    L1CAF   ;6
       LDA    #$00    ;2
       STA    $EE     ;3
       STA    $D3     ;3
       STA    $F5     ;3
       LDX    #$06    ;2
L10C0: STA    $D4,X   ;4
       DEX            ;2
       BPL    L10C0   ;2
L10C5: LDX    #$00    ;2
       STX    $EC     ;3
       STX    $BE     ;3
       STX    $C4     ;3
       LDA    $E0     ;3
       BNE    L10D5   ;2
       LDA    REFP1   ;3
       BPL    L106B   ;2
L10D5: LDX    #$0A    ;2
L10D7: LDA    #$1F    ;2
       STA    $81,X   ;4
       LDA    #$64    ;2
       STA    $80,X   ;4
       DEX            ;2
       DEX            ;2
       BPL    L10D7   ;2
       LDA    $EF     ;3
       BEQ    L10F6   ;2
       LDX    #$0A    ;2
       LDA    #$6E    ;2
L10EB: STA    $80,X   ;4
       CLC            ;2
       ADC    #$0A    ;2
       DEX            ;2
       DEX            ;2
       BPL    L10EB   ;2
       BMI    L113F   ;2
L10F6: LDA    $F9     ;3
       BNE    L1106   ;2
       LDA    $8D     ;3
       CLC            ;2
       ADC    #$01    ;2
       JSR    L1EE8   ;6
       STA    $80     ;3
       BNE    L113F   ;2
L1106: LDX    #$00    ;2
       STX    $9E     ;3
       LDX    #$02    ;2
       LDY    #$08    ;2
L110E: LDA    $A1,X   ;4
       LSR            ;2
       LSR            ;2
       LSR            ;2
       LSR            ;2
       JSR    L1EE8   ;6
       BNE    L111D   ;2
       LDA    $9E     ;3
       BEQ    L1124   ;2
L111D: INC    $9E     ;5
       LDA    $8F     ;3
       STA.wy $0082,Y ;5
L1124: LDA    $A1,X   ;4
       AND    #$0F    ;2
       JSR    L1EE8   ;6
       BNE    L1131   ;2
       LDA    $9E     ;3
       BEQ    L1138   ;2
L1131: INC    $9E     ;5
       LDA    $8F     ;3
       STA.wy $0080,Y ;5
L1138: DEX            ;2
       DEY            ;2
       DEY            ;2
       DEY            ;2
       DEY            ;2
       BPL    L110E   ;2
L113F: LDX    #$06    ;2
       STX    $F1     ;3
L1143: LDA    $D4,X   ;4
       BEQ    L117D   ;2
       CMP    #$05    ;2
       BEQ    L1155   ;2
       LDA    $FA     ;3
       AND    #$07    ;2
       BNE    L1161   ;2
       INC    $D4,X   ;6
       BPL    L1161   ;2
L1155: DEC    $F1     ;5
       BPL    L1161   ;2
       LDA    $F8     ;3
       BNE    L1161   ;2
       LDA    #$FF    ;2
       STA    $D3     ;3
L1161: LDY    $D4,X   ;4
       DEY            ;2
       CPX    #$06    ;2
       BNE    L1174   ;2
       LDA    L1E52,Y ;4
       STA    $9B     ;3
       LDA    L1E57,Y ;4
       STA    $9C     ;3
       BNE    L1196   ;2
L1174: LDA    L1E4D,Y ;4
       STA    $91     ;3
       STA    $95,X   ;4
       BNE    L1196   ;2
L117D: LDY    L1E38,X ;4
       LDA    $FA     ;3
       AND    L1E46,X ;4
       BNE    L118A   ;2
       LDY    L1E3F,X ;4
L118A: STY    $91     ;3
       STY    $95,X   ;4
       CPX    #$06    ;2
       BNE    L1196   ;2
       LDA    #$08    ;2
       STA    $9C     ;3
L1196: DEX            ;2
       BPL    L1143   ;2
       LDA    #$1D    ;2
       STA    $92     ;3
       STA    $94     ;3
       LDX    #$02    ;2
L11A1: LDY    #$98    ;2
       LDA    $D3     ;3
       BMI    L11B1   ;2
       LDY    #$80    ;2
       LDA    $DD,X   ;4
       BEQ    L11B1   ;2
       DEC    $DD,X   ;6
       LDY    #$88    ;2
L11B1: STY    $93,X   ;4
       DEX            ;2
       DEX            ;2
       BPL    L11A1   ;2
       LDA    #$05    ;2
       STA    CTRLPF  ;3
       LDA    #$30    ;2
       STA    PF0     ;3
       LDA    #$00    ;2
       STA    COLUPF  ;3
       STA    PF1     ;3
       STA    PF2     ;3
       LDA    #$03    ;2
       STA    $A9     ;3
L11CB: LDX    $A9     ;3
       LDA    $A4,X   ;4
       SEC            ;2
       SBC    #$08    ;2
       CMP    #$F7    ;2
       BCC    L11D8   ;2
       LDA    #$00    ;2
L11D8: LDX    #$00    ;2
       JSR    L1E82   ;6
       LDA    $A9     ;3
       ASL            ;2
       TAX            ;2
       LDA    $8F     ;3
       STA    $AA,X   ;4
       LDA    $90     ;3
       STA    $AB,X   ;4
       LDX    $A9     ;3
       LDA    $A4,X   ;4
       LDX    #$01    ;2
       JSR    L1E82   ;6
       LDA    $A9     ;3
       ASL            ;2
       TAX            ;2
       LDA    $8F     ;3
       STA    $B2,X   ;4
       LDA    $90     ;3
       STA    $B3,X   ;4
       DEC    $A9     ;5
       BPL    L11CB   ;2
       LDA    $BE     ;3
       BEQ    L120A   ;2
       LDA    $A4     ;3
       STA    $BE     ;3
L120A: LDX    #$04    ;2
L120C: LDA    $BA,X   ;4
       JSR    L1FC2   ;6
       DEX            ;2
       CPX    #$02    ;2
       BCS    L120C   ;2
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    WSYNC   ;3
       STA    HMCLR   ;3
       LDA    $FA     ;3
       AND    #$07    ;2
       BNE    L1230   ;2
       LDA    $C5     ;3
       AND    #$06    ;2
       BNE    L122C   ;2
       LDA    #$02    ;2
L122C: EOR    #$90    ;2   changed from NTSC value #$A0 - colour of surface of water
       STA    $A0     ;3
L1230: LDY    #$00    ;2
       LDA    $E0     ;3
       BEQ    L123E   ;2
       AND    #$01    ;2
       BEQ    L123C   ;2
       LDY    #$0F    ;2
L123C: DEC    $E0     ;5
L123E: STY    COLUBK  ;3
       INC    $FA     ;5
       BNE    L124C   ;2
       INC    $FB     ;5
       BNE    L124C   ;2
       LDA    #$F3    ;2
       STA    $FC     ;3
L124C: BIT    $0285   ;4
       BPL    L124C   ;2
       STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    CXCLR   ;3
       STA    VBLANK  ;3
       STA    NUSIZ0  ;3
       STA    NUSIZ1  ;3
       LDA    $D3     ;3
       BMI    L1268   ;2
       LDA    $DB     ;3
       BMI    L126B   ;2
       JMP    L1402   ;3
L1268: JMP    L136E   ;3
L126B: LDA    $FA     ;3
       AND    #$07    ;2
       BNE    L1291   ;2
       INC    $DB     ;5
       LDA    $DB     ;3
       CMP    #$85    ;2
       BCC    L1291   ;2
       LDX    #$03    ;2
L127B: LDA    #$07    ;2
       STA    $C7,X   ;4
       LDA    #$00    ;2
       STA    $A4,X   ;4
       DEX            ;2
       BPL    L127B   ;2
       STA    $BE     ;3
       STA    $DB     ;3
       STA    $BC     ;3
       STA    $BD     ;3
       JMP    L1404   ;3
L1291: LDA    $DB     ;3
       AND    #$07    ;2
       TAX            ;2
       STA    WSYNC   ;3
       LDA    L1C80,X ;4
       STA    $AA     ;3
       LDA    L1C85,X ;4
       STA    $AC     ;3
       LDA    #$1C    ;2
       STA    $AB     ;3
       STA    $AD     ;3
       LDA    L1CA0,X ;4
       STA    $AE     ;3
       LDA    L1CA5,X ;4
       STA    $B0     ;3
       LDA    L1CAA,X ;4
       STA    $B2     ;3
       LDY    $DC     ;3
       LDA    L1FF8,Y ;4
       SEC            ;2
       SBC    L1C99,X ;4
       STA    $B4     ;3
       LDA    #$00    ;2
       STA    PF0     ;3
       LDA    #$08    ;2
       STA    REFP1   ;3
       STA    WSYNC   ;3
       LDA    #$3E    ;2
       CPX    #$04    ;2
       BNE    L12DA   ;2
       LDA    $FA     ;3
       AND    #$0E    ;2
       EOR    #$0F    ;2
       ORA    #$30    ;2
L12DA: STA    COLUP0  ;3
       STA    COLUP1  ;3
       STA    COLUPF  ;3
       STA    WSYNC   ;3
       LDA    $C0     ;3
       CLC            ;2
       ADC    L1C8A,X ;4
       STA    $BF     ;3
       CLC            ;2
       ADC    L1C8F,X ;4
       STA    $BD     ;3
       SEC            ;2
       SBC    L1C94,X ;4
       STA    $BE     ;3
       SEC            ;2
       SBC    L1C9B,X ;4
       STA    $BC     ;3
       LDX    #$04    ;2
       LDA    $C0     ;3
       JSR    L1FC2   ;6
       DEX            ;2
       LDA    $BF     ;3
       JSR    L1FC2   ;6
       DEX            ;2
       LDA    $BE     ;3
       JSR    L1FC2   ;6
       DEX            ;2
       LDA    $BD     ;3
       JSR    L1FC2   ;6
       DEX            ;2
       LDA    $BC     ;3
       JSR    L1FC2   ;6
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    WSYNC   ;3
       LDX    #$C0    ;2
L1323: STA    WSYNC   ;3
L1325: TXA            ;2
       SEC            ;2
       SBC    $B4     ;3
       TAY            ;2
       AND    $AE     ;3
       BNE    L1350   ;2
       TYA            ;2
       AND    $B0     ;3
       BEQ    L1337   ;2
       TYA            ;2
       EOR    $B2     ;3
       TAY            ;2
L1337: LDA    ($AC),Y ;5
       STA    ENAM0   ;3
       STA    ENAM1   ;3
       ASL            ;2
       STA    ENABL   ;3
       LDA    ($AA),Y ;5
       DEX            ;2
       CPX    #$6B    ;2
       BEQ    L1357   ;2
       STA    WSYNC   ;3
       STA    GRP0    ;3
       STA    GRP1    ;3
       JMP    L1325   ;3
L1350: DEX            ;2
       CPX    #$6B    ;2
       BNE    L1323   ;2
       STA    WSYNC   ;3
L1357: STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       STA    ENAM0   ;3
       STA    ENAM1   ;3
       STA    ENABL   ;3
       LDA    $E4     ;3
       STA    COLUPF  ;3
       STA    WSYNC   ;3
       JMP    L1574   ;3
L136E: LDY    #$AA    ;2
       LDA    $FA     ;3
       AND    #$02    ;2
       BEQ    L1378   ;2
       LDY    #$B2    ;2
L1378: STY    $AA     ;3
       STA    WSYNC   ;3
       LDA    #$1F    ;2
       STA    $AB     ;3
       LDA    #$3E    ;2   changed from NTSC value $#DE - colour of escape ship in game over sequence
       STA    COLUP0  ;3
       LDA    #$00    ;2
       STA    $E6     ;3
       STA    $E7     ;3
       STA    $E8     ;3
       LDA    $FA     ;3
       AND    #$0F    ;2
       BNE    L13A2   ;2
       LDA    $E3     ;3
       BEQ    L1398   ;2
       DEC    $E3     ;5
L1398: LDA    $E3     ;3
       TAY            ;2
       LDA    L1FBA,Y ;4
       STA    $E4     ;3
       STA    $E5     ;3
L13A2: STA    WSYNC   ;3
       LDA    $E2     ;3
       BNE    L13CA   ;2
       LDA    $8D     ;3
       CMP    #$03    ;2
       BEQ    L13B4   ;2
       LDA    $A3     ;3
       AND    #$F0    ;2
       ORA    $8D     ;3
L13B4: STA    $A1     ;3
       LDA    #$3F    ;2
       STA    $E9     ;3
       STA    $F3     ;3
       LDA    #$8F    ;2
       STA    $E0     ;3
       STA    $EB     ;3
       LDA    #$02    ;2
       STA    $ED     ;3
       LDA    #$4B    ;2
       STA    $E1     ;3
L13CA: CMP    #$80    ;2
       BCS    L13D0   ;2
       INC    $E2     ;5
L13D0: LDA    $E1     ;3
       CMP    #$D2    ;2
       BCS    L13D8   ;2
       INC    $E1     ;5
L13D8: LDX    #$00    ;2
       STA    WSYNC   ;3
       STX    PF0     ;3
       LDA    $E2     ;3
       JSR    L1FC2   ;6
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       STA    WSYNC   ;3
       LDX    #$C0    ;2
L13EB: STA    WSYNC   ;3
       TXA            ;2
       SEC            ;2
       SBC    $E1     ;3
       TAY            ;2
       AND    #$F8    ;2
       BNE    L13FA   ;2
       LDA    ($AA),Y ;5
       STA    GRP0    ;3
L13FA: DEX            ;2
       CPX    #$61    ;2
       BNE    L13EB   ;2
       JMP    L1357   ;3
L1402: STA    WSYNC   ;3
L1404: STA    WSYNC   ;3
       LDA    #$1D    ;2
       STA    $90     ;3
       STA    $9F     ;3
       LDA    #$C0    ;2
       STA    $C3     ;3
       LDA    #$03    ;2
       STA    $A9     ;3
L1414: LDX    #$1E    ;2
       TXS            ;2
       LDA    $A9     ;3
       ASL            ;2
       TAX            ;2
       LDY    $AA,X   ;4
       LDA    $AB,X   ;4
       DEC    $C3     ;5
       LDX    $C3     ;3
       STA    WSYNC   ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX.w  $00BA   ;4
       PHP            ;3
L142C: DEY            ;2
       BPL    L142C   ;2
       STA    HMP0    ;3
       STA    RESP0   ;3
       STA    WSYNC   ;3
       PLA            ;4
       PLA            ;4
       DEC    $C3     ;5
       LDX    $C3     ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       LDA    $A9     ;3
       ASL            ;2
       TAX            ;2
       LDY    $B2,X   ;4
       LDA    $B3,X   ;4
       DEC    $C3     ;5
       LDX    $C3     ;3
       STA    WSYNC   ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX.w  $00BA   ;4
       PHP            ;3
L1458: DEY            ;2
       BPL    L1458   ;2
       STA    HMP1    ;3
       STA    RESP1   ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       PLA            ;4
       PLA            ;4
       DEC    $C3     ;5
       LDX    $C3     ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       LDX    #$FF    ;2
       TXS            ;2
       DEC    $C3     ;5
       JSR    L1EB1   ;6
       LDA    #$98    ;2
       STA    $8F     ;3
       STA    $9E     ;3
       LDA    $C7     ;3
       BPL    L148E   ;2
       AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L1499   ;2
       LDA    $CF     ;3
       JMP    L14D9   ;3
L148E: AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L1499   ;2
       LDA    $CF     ;3
       JMP    L14EC   ;3
L1499: LDA    $C8     ;3
       BPL    L14A8   ;2
       AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L14B3   ;2
       LDA    $D0     ;3
       JMP    L14D9   ;3
L14A8: AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L14B3   ;2
       LDA    $D0     ;3
       JMP    L14EC   ;3
L14B3: LDA    $C9     ;3
       BPL    L14C2   ;2
       AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L14CD   ;2
       LDA    $D1     ;3
       JMP    L14D9   ;3
L14C2: AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L14CD   ;2
       LDA    $D1     ;3
       JMP    L14EC   ;3
L14CD: LDA    $CA     ;3
       BPL    L14E4   ;2
       AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L14F5   ;2
       LDA    $D2     ;3
L14D9: STA    $9E     ;3
       CLC            ;2
       ADC    #$08    ;2
       STA    $8F     ;3
       LDY    #$08    ;2
       BNE    L14F5   ;2
L14E4: AND    #$07    ;2
       CMP    $A9     ;3
       BNE    L14F5   ;2
       LDA    $D2     ;3
L14EC: STA    $8F     ;3
       CLC            ;2
       ADC    #$08    ;2
       STA    $9E     ;3
       LDY    #$00    ;2
L14F5: STY    REFP0   ;3
       STY    REFP1   ;3
       LDX    #$1E    ;2
       TXS            ;2
       LDX    $C3     ;3
       LDY    #$07    ;2
       LDA    L1E1F   ;4
L1503: STA    WSYNC   ;3
       STA    COLUP0  ;3
       STA    COLUP1  ;3
       LDA    ($8F),Y ;5
       STA    GRP0    ;3
       LDA    ($9E),Y ;5
       STA    GRP1    ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       LDA    L1E17,Y ;4
       DEX            ;2
       DEY            ;2
       BPL    L1503   ;2
       STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       STX    $C3     ;3
       DEC    $A9     ;5
       BMI    L1539   ;2
       JMP    L1414   ;3
L1539: STA    WSYNC   ;3
       DEC    $C3     ;5
       LDX    $C3     ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       LDA    #$10    ;2
       STA    CTRLPF  ;3
       LDY    #$02    ;2
       LDA    $D3     ;3
       BEQ    L1555   ;2
       LDA    $BE     ;3
       BNE    L1556   ;2
L1555: TAY            ;2
L1556: LDA    $FA     ;3
       AND    #$01    ;2
       BNE    L155D   ;2
       TAY            ;2
L155D: STY    ENABL   ;3
       LDA    #$00    ;2
       STA    PF0     ;3
       LDA    $E4     ;3
       AND    $FC     ;3
       STA    COLUPF  ;3
       DEC    $C3     ;5
       LDX    #$FF    ;2
       TXS            ;2
       JSR    L1EB1   ;6
       JSR    L1EB1   ;6
L1574: LDX    #$1E    ;2
       TXS            ;2
       LDA    #$00    ;2
       STA    NUSIZ0  ;3
       STA    NUSIZ1  ;3
       STA    ENAM0   ;3
       STA    ENAM1   ;3
       STA    REFP0   ;3
       LDA    #$14    ;2
       STA    CTRLPF  ;3
       LDY    #$08    ;2
       STY    REFP1   ;3
       LDX    $C3     ;3
       STA    WSYNC   ;3
L158F: DEY            ;2
       BPL    L158F   ;2
       STA    RESP0   ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       DEX            ;2
       LDY    #$0D    ;2
       STA    WSYNC   ;3
L15A1: DEY            ;2
       BPL    L15A1   ;2
       STA    RESP1   ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       DEX            ;2
       LDA    #$60    ;2
       STA    HMP0    ;3
       LDA    #$10    ;2
       STA    HMP1    ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       DEX            ;2
       LDY    #$07    ;2
       LDA    L1E2F   ;4
       STA    COLUP0  ;3
       LDA    L1E27   ;4
L15CE: STA    WSYNC   ;3
       STA    COLUP1  ;3
       LDA    ($91),Y ;5
       STA    GRP0    ;3
       LDA    ($93),Y ;5
       STA    GRP1    ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       LDA    L1E27,Y ;4
       STA    COLUP0  ;3
       LDA    L1E1F,Y ;4
       DEX            ;2
       DEY            ;2
       BPL    L15CE   ;2
       STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       LDA    #$00    ;2
       STA    REFP1   ;3
       LDA    $E6     ;3
       STA    PF2     ;3
       LDY    #$08    ;2
       LDX    #$FF    ;2
       TXS            ;2
       STA    WSYNC   ;3
       STA    RESP0   ;3
L160F: DEY            ;2
       BPL    L160F   ;2
       STA    RESP1   ;3
       LDA    #$00    ;2
       STA    ENAM0   ;3
       STA    ENAM1   ;3
       LDA    #$30    ;2
       STA    HMP0    ;3
       LDA    #$50    ;2
       STA    HMP1    ;3
       LDA    $95     ;3
       STA    $91     ;3
       LDA    $96     ;3
       STA    $93     ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDY    #$07    ;2
       LDX    L1E37   ;4
       LDA    L1E27   ;4
L1636: STA    WSYNC   ;3
       STA    COLUP0  ;3
       STX    COLUP1  ;3
       LDA    ($91),Y ;5
       STA    GRP0    ;3
       LDA    ($93),Y ;5
       STA    GRP1    ;3
       LDA    L1E1F,Y ;4
       LDX    L1E2F,Y ;4
       DEY            ;2
       BPL    L1636   ;2
       STA    WSYNC   ;3
       LDA    $A0     ;3
       STA    COLUBK  ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       LDA    $E7     ;3
       STA    PF0     ;3
       LDA    $E8     ;3 
       STA    PF2     ;3
       LDA    $A0     ;3
       EOR    #$04    ;2
       LDY    #$06    ;2
       STA    WSYNC   ;3
       STA    COLUBK  ;3
L166B: DEY            ;2
       BPL    L166B   ;2
       STA    RESP0   ;3
       LDA    $A0     ;3
       LDY    #$0C    ;2
       STA    WSYNC   ;3
       STA    COLUBK  ;3
L1678: DEY            ;2
       BPL    L1678   ;2
       STA    RESP1   ;3
       LDA    #$D0    ;2
       STA    HMP0    ;3
       LDA    #$50    ;2 
       STA    HMP1    ;3
       LDA    #$90    ;2 changed from NTSC value #$A0 - water colour
       STA    COLUBK  ;3
       LDA    $97     ;3
       STA    $91     ;3
       LDA    $98     ;3
       STA    $93     ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDA    $E5     ;3
       AND    $FC     ;3
       STA    COLUPF  ;3
       LDA    #$7C    ;2 colour of twirler 2(NTSC value #$BC)
       STA    COLUP0  ;3
       LDA    #$9E    ;2 colour of twirler 3 (NTSC value #$7e)
       STA    COLUP1  ;3
       LDY    #$07    ;2
L16A5: STA    WSYNC   ;3
       LDA    ($91),Y ;5
       STA    GRP0    ;3
       LDA    ($93),Y ;5
       STA    GRP1    ;3
       DEY            ;2
       BPL    L16A5   ;2
       STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       LDA    #$F8    ;2
       STA    PF2     ;3
       LDA    #$08    ;2
       STA    REFP1   ;3
       LDY    #$05    ;2
       STA    WSYNC   ;3
L16C6: DEY            ;2
       BPL    L16C6   ;2
       STA    RESP0   ;3
       STA    RESP1   ;3
       LDA    #$B0    ;2
       STA    HMP0    ;3
       LDA    #$C0    ;2
       STA    HMP1    ;3
       LDA    $99     ;3
       STA    $91     ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDY    #$07    ;2
L16DF: STA    WSYNC   ;3
       LDA    ($91),Y ;5
       STA    GRP0    ;3
       STA    GRP1    ;3
       LDA    L1E00,Y ;4
       STA    COLUP0  ;3
       STA    COLUP1  ;3
       DEY            ;2
       BPL    L16DF   ;2
       STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       LDA    #$70    ;2
       STA    PF0     ;3
       LDA    #$07    ;2
       STA    PF1     ;3
       LDA    #$FB    ;2
       STA    PF2     ;3
       LDY    #$09    ;2
       STA    WSYNC   ;3
L1709: DEY            ;2
       BPL    L1709   ;2
       STA    RESP0   ;3
       STA    RESP1   ;3
       LDA    #$D0    ;2
       STA    HMP0    ;3
       LDA    #$E0    ;2
       STA    HMP1    ;3
       LDA    $9A     ;3
       STA    $91     ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDY    #$07    ;2
L1722: STA    WSYNC   ;3
       CPY    #$03    ;2
       BCS    L1734   ;2
       LDA    #$F0    ;2
       STA    PF0     ;3
       LDA    #$0F    ;2
       STA    PF1     ;3
       LDA    #$FF    ;2
       STA    PF2     ;3
L1734: LDA    ($91),Y ;5
       STA    GRP0    ;3
       STA    GRP1    ;3
       LDA    L1E08,Y ;4
       STA    COLUP0  ;3
       STA    COLUP1  ;3
       DEY            ;2
       BPL    L1722   ;2
       STA    WSYNC   ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       STA    REFP1   ;3
       LDY    #$04    ;2
       STA    WSYNC   ;3
L1752: DEY            ;2
       BPL    L1752   ;2
       STA    RESP0   ;3
       STA    RESP1   ;3
       LDA    #$20    ;2
       STA    HMP0    ;3
       LDA    #$30    ;2
       STA    HMP1    ;3
       LDA    $9B     ;3
       STA    $91     ;3
       LDA    $9C     ;3
       STA    $93     ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDY    #$07    ;2
L176F: STA    WSYNC   ;3
       LDA    ($91),Y ;5
       STA    GRP0    ;3
       LDA    ($93),Y ;5
       STA    GRP1    ;3
       LDA    L1E10,Y ;4
       STA    COLUP0  ;3
       STA    COLUP1  ;3
       DEY            ;2
       BPL    L176F   ;2
       STA    WSYNC   ;3
       STA    HMCLR   ;3
       LDA    #$FF    ;2
       STA    PF1     ;3
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       STA    ENAM0   ;3
       STA    ENAM1   ;3
       STA    ENABL   ;3
       LDA    #$00    ;2
       STA    COLUBK  ;3
       LDY    #$06    ;2
L179D: STA    WSYNC   ;3
       DEY            ;2
       BPL    L179D   ;2
       LDA    #$00    ;2
       STA    CTRLPF  ;3
       LDA    #$4E    ;2   changed from NTSC value #$3E - colour of score digits
       AND    $FC     ;3
       STA    COLUP1  ;3
       STA    COLUP0  ;3
       LDA    #$03    ;2
       STA    NUSIZ0  ;3
       STA    NUSIZ1  ;3
       LDY    #$06    ;2
       STA    WSYNC   ;3
L17B8: DEY            ;2
       BPL    L17B8   ;2
       NOP            ;2
       STA    RESP0   ;3
       STA    RESP1   ;3
       LDA    #$00    ;2
       STA    HMP1    ;3
       LDA    #$F0    ;2
       STA    HMP0    ;3
       LDA    #$01    ;2
       STA    VDELP0  ;3
       STA    VDELP1  ;3
       STA    WSYNC   ;3
       STA    HMOVE   ;3
       LDA    #$52    ;2  changed from NTSC value #$C2 - colour of score area background
       AND    $FC     ;3
       STA    COLUPF  ;3
       LDA    #$09    ;2
       STA    $91     ;3
L17DC: LDY    $91     ;3
       LDA    ($8A),Y ;5
       STA    GRP0    ;3
       STA    WSYNC   ;3
       LDA    ($88),Y ;5
       STA    GRP1    ;3
       LDA    ($86),Y ;5
       STA    GRP0    ;3
       LDA    ($84),Y ;5
       STA    $93     ;3
       LDA    ($82),Y ;5
       TAX            ;2
       LDA    ($80),Y ;5
       TAY            ;2
       LDA    $93     ;3
       STA    GRP1    ;3
       STX    GRP0    ;3
       STY    GRP1    ;3
       STY    GRP0    ;3
       DEC    $91     ;5
       BPL    L17DC   ;2
       LDA    #$00    ;2
       STA    GRP0    ;3
       STA    GRP1    ;3
       STA    VDELP0  ;3
       STA    VDELP1  ;3
       LDA    #$1F    ;2
       STA    TIM64T  ;4
       LDA    $D3     ;3
       CMP    #$01    ;2
       BNE    L186C   ;2
       LDA    $DB     ;3
       BMI    L186C   ;2
       LDA    REFP1   ;3
       BPL    L1825   ;2
       STA    $C4     ;3
       BNE    L1857   ;2
L1825: LDA    $C4     ;3
       BPL    L1857   ;2
       LDX    #$01    ;2
       LDY    #$02    ;2
       STY    $C4     ;3
       CPY    $8D     ;3
       BEQ    L184F   ;2
       LDA    SWCHA   ;4
       BMI    L183C   ;2
       LDY    #$00    ;2
       BEQ    L184B   ;2
L183C: AND    #$40    ;2
       BEQ    L184B   ;2
       LDA    $8D     ;3
       CMP    #$01    ;2
       BEQ    L186C   ;2
       LDA    $D4     ;3
       BNE    L186C   ;2
       DEY            ;2
L184B: LDA    $BB     ;3
       BEQ    L1854   ;2
L184F: DEX            ;2
       LDA    $BA     ;3
       BNE    L1857   ;2
L1854: JSR    L1ECF   ;6
L1857: LDA    $8D     ;3
       CMP    #$02    ;2
       BNE    L186C   ;2
       LDA    PF0     ;3
       BMI    L186C   ;2
       LDX    #$01    ;2
       LDY    #$00    ;2
       LDA    $BB     ;3
       BNE    L186C   ;2
       JSR    L1ECF   ;6
L186C: LDX    #$01    ;2
L186E: LDA    $BA,X   ;4
       BEQ    L1891   ;2
       LDA    $BC,X   ;4
       CLC            ;2
       ADC    $C1,X   ;4
       STA    $BC,X   ;4
       INC    $BA,X   ;6
       INC    $BA,X   ;6
       LDY    $C1,X   ;4
       BNE    L1883   ;2
       INC    $BA,X   ;6
L1883: LDA    $BA,X   ;4
       CMP    #$BC    ;2
       BCC    L1891   ;2
       LDA    #$00    ;2
       STA    $BA,X   ;4
       STA    $BC,X   ;4
       BEQ    L1891   ;2
L1891: DEX            ;2
       BPL    L186E   ;2
       LDY    #$01    ;2
L1896: LDX    #$03    ;2
L1898: LDA    $A4,X   ;4
       SEC            ;2
       SBC.wy $00BC,Y ;4
       BPL    L18A5   ;2
       EOR    #$FF    ;2
       CLC            ;2
       ADC    #$01    ;2
L18A5: CMP    #$09    ;2
       BCC    L18AC   ;2
       JMP    L1932   ;3
L18AC: LDA    L1E69,X ;4
       SEC            ;2
       SBC.wy $00BA,Y ;4
       BPL    L18BA   ;2
       EOR    #$FF    ;2
       CLC            ;2
       ADC    #$01    ;2
L18BA: CMP    #$04    ;2
       BCS    L1932   ;2
       STY    $90     ;3
       LDY    #$03    ;2
L18C2: LDA.wy $00C7,Y ;4
       AND    #$47    ;2
       STA    $8F     ;3
       CPX    $8F     ;3
       BNE    L1927   ;2
       LDA.wy $00CF,Y ;4
       CMP    #$50    ;2
       BNE    L18F8   ;2
       LDA    #$10    ;2
       JSR    L1CDB   ;6
       LDA    #$80    ;2
       STA    $DB     ;3
       STX    $DC     ;3
       LDA    $E0     ;3
       BNE    L18E7   ;2
       LDA    #$20    ;2
       STA    $E0     ;3
L18E7: LDA    $A4,X   ;4
       STA    $C0     ;3
       LDA    #$00    ;2
       STA    $BA     ;3
       STA    $BB     ;3
       STA    $EC     ;3
       SEC            ;2
       LDA    #$3F    ;2
       BNE    L1908   ;2
L18F8: LDA.wy $00C7,Y ;4
       ORA    #$40    ;2
       STA.wy $00C7,Y ;5
       LDA    #$01    ;2
       JSR    L1CDB   ;6
       CLC            ;2
       LDA    #$2F    ;2
L1908: STA    $E9     ;3
       LDY    $90     ;3
       LDA.wy $00C1,Y ;4
       BEQ    L191A   ;2
       LDA    #$01    ;2
       BCC    L1917   ;2
       LDA    #$10    ;2
L1917: JSR    L1CDB   ;6
L191A: CPX    #$00    ;2
       BNE    L1920   ;2
       STX    $BE     ;3
L1920: LDA    #$00    ;2
       STA.wy $00BA,Y ;5
       BEQ    L192C   ;2
L1927: DEY            ;2
       BPL    L18C2   ;2
       LDY    $90     ;3
L192C: DEY            ;2
       BMI    L1938   ;2
       JMP    L1896   ;3
L1932: DEX            ;2
       BMI    L192C   ;2
       JMP    L1898   ;3
L1938: LDA    $DB     ;3
       BMI    L1973   ;2
       LDX    #$06    ;2
L193E: LDA    L1E74,X ;4
       SEC            ;2
       SBC    $BE     ;3
       BPL    L194B   ;2
       EOR    #$FF    ;2
       CLC            ;2
       ADC    #$01    ;2
L194B: CMP    L1E7B,X ;4
       BCS    L1970   ;2
       CPX    #$00    ;2
       BEQ    L1958   ;2
       LDA    $D4     ;3
       BEQ    L1970   ;2
L1958: LDA    $D4,X   ;4
       BNE    L1970   ;2
       STA    $BE     ;3
       STA    $F0     ;3
       INC    $D4,X   ;6
       LDA    #$3F    ;2
       STA    $E9     ;3
       LDA    $E0     ;3
       BNE    L1973   ;2
       LDA    #$03    ;2
       STA    $E0     ;3
       BNE    L1973   ;2
L1970: DEX            ;2
       BPL    L193E   ;2
L1973: LDA    $DB     ;3
       BMI    L197B   ;2
       LDA    $D3     ;3
       BPL    L197E   ;2
L197B: JMP    L1A68   ;3
L197E: LDY    #$03    ;2
L1980: LDA    #$03    ;2
       STA    $90     ;3
       LDA.wy $00A4,Y ;4
       BEQ    L198C   ;2
       JMP    L1A24   ;3
L198C: LDX    $90     ;3
       LDA    $C7,X   ;4
       AND    #$03    ;2
       STA    $8F     ;3
       CPY    $8F     ;3
       BEQ    L199F   ;2
L1998: DEC    $90     ;5
       BPL    L198C   ;2
L199C: JMP    L1A1E   ;3
L199F: LDA    $C7,X   ;4
       AND    #$04    ;2
       BEQ    L1998   ;2
       CPY    #$03    ;2
       BNE    L19FB   ;2
       LDA    $D3     ;3
       BEQ    L19B1   ;2
       LDA    $F0     ;3
       BEQ    L1998   ;2
L19B1: LDA    $FA     ;3
       AND    #$1F    ;2
       BNE    L199C   ;2
       LDA    $C5     ;3
       AND    #$80    ;2
       ORA    $C7,X   ;4
       STA    $C7,X   ;4
       DEC    $F0     ;5
       LDA    $C5     ;3
       AND    #$03    ;2
       CLC            ;2
       ADC    $EE     ;3
       TAX            ;2
       LDA    L1EF3,X ;4
       STA    $9E     ;3
       LDA    $C6     ;3
       AND    #$03    ;2
       TAX            ;2
L19D3: LDA    L1E65,X ;4
       LDX    $90     ;3
       STA    $CF,X   ;4
       CMP    #$50    ;2
       BNE    L19EA   ;2
       LDX    #$01    ;2
       LDA    $F5     ;3
       BEQ    L19D3   ;2
       INC    $9E     ;5
       DEC    $F5     ;5
       STA    $EC     ;3
L19EA: LDX    $90     ;3
       LDA    $C7,X   ;4
       BMI    L19F7   ;2
       LDA    #$00    ;2
       SEC            ;2
       SBC    $9E     ;3
       STA    $9E     ;3
L19F7: LDA    $9E     ;3
       STA    $CB,X   ;4
L19FB: LDA    $C7,X   ;4
       AND    #$FB    ;2
       STA    $C7,X   ;4
       LDA    $C7,X   ;4
       BPL    L1A09   ;2
       LDA    #$08    ;2
       BNE    L1A0B   ;2
L1A09: LDA    #$98    ;2
L1A0B: STA.wy $00A4,Y ;5
       CPY    #$00    ;2
       BNE    L1A1E   ;2
       STA    $BE     ;3
       LDA    $CF,X   ;4
       CMP    #$50    ;2
       BNE    L1A1E   ;2
       LDA    #$00    ;2
       STA    $EC     ;3
L1A1E: DEY            ;2
       BMI    L1A68   ;2
       JMP    L1980   ;3
L1A24: LDX    $90     ;3
       LDA    $C7,X   ;4
       AND    #$07    ;2
       STA    $8F     ;3
       CPY    $8F     ;3
       BNE    L1A62   ;2
       LDA    $C7,X   ;4
       AND    #$40    ;2
       BNE    L1A1E   ;2
       LDA.wy $00A4,Y ;4
       CLC            ;2
       ADC    $CB,X   ;4
       STA.wy $00A4,Y ;5
       CMP    #$08    ;2
       BCC    L1A47   ;2
       CMP    #$98    ;2
       BCC    L1A1E   ;2
L1A47: LDA    #$00    ;2
       STA.wy $00A4,Y ;5
       CPY    #$00    ;2
       BNE    L1A58   ;2
       STA    $BE     ;3
       LDA    #$07    ;2
       STA    $C7,X   ;4
       BNE    L1A1E   ;2
L1A58: DEC    $C7,X   ;6
       LDA    #$04    ;2
       ORA    $C7,X   ;4
       STA    $C7,X   ;4
       BNE    L1A1E   ;2
L1A62: DEC    $90     ;5
       BPL    L1A24   ;2
       BMI    L1A1E   ;2
L1A68: CLC            ;2
       LDA    $C6     ;3
       AND    #$40    ;2
       ROL            ;2
       ROL            ;2
       ROL            ;2
       STA    $8F     ;3
       LDA    $C5     ;3
       AND    #$01    ;2
       EOR    $8F     ;3
       ROR            ;2
       ROL    $C5     ;5
       ROL    $C6     ;5
       LDA    $C6     ;3
       AND    #$7F    ;2
       STA    $C6     ;3
       LDY    #$00    ;2
       LDA    $D3     ;3
       CMP    #$01    ;2
       BNE    L1A93   ;2
       LDX    #$1F    ;2
       LDY    #$02    ;2
       LDA    #$0F    ;2
       STA    AUDC0   ;3
L1A93: LDA    $E9     ;3
       BEQ    L1AA1   ;2
       LSR            ;2
       LSR            ;2
       TAX            ;2
       TAY            ;2
       DEC    $E9     ;5
       LDA    #$02    ;2
       STA    AUDC0   ;3
L1AA1: STX    AUDF0   ;3
       STY    AUDV0   ;3
       LDY    #$00    ;2
       LDA    $EA     ;3
       BEQ    L1ABB   ;2
       EOR    #$1F    ;2
       TAX            ;2
       LDA    $EA     ;3
       LSR            ;2
       LSR            ;2
       TAY            ;2
       DEC    $EA     ;5
       LDA    #$06    ;2
       STA    AUDC1   ;3
       BNE    L1B0F   ;2
L1ABB: LDA    $EB     ;3
       BEQ    L1ACF   ;2
       DEC    $EB     ;5
       LDA    $EB     ;3
       AND    $ED     ;3
       BEQ    L1ACF   ;2
       LDA    #$04    ;2
       STA    AUDC1   ;3
       LDX    #$0A    ;2
       LDY    #$08    ;2
L1ACF: LDA    $EC     ;3
       BEQ    L1AED   ;2
       LDA    $E9     ;3
       BNE    L1AED   ;2
       LDA    #$0D    ;2
       STA    AUDC0   ;3
       STA    AUDC1   ;3
       LDY    #$06    ;2
       STY    AUDV0   ;3
       LDX    #$19    ;2
       STX    AUDF0   ;3
       LDA    $FA     ;3
       AND    #$04    ;2
       BNE    L1AED   ;2
       LDX    #$18    ;2
L1AED: LDA    $BE     ;3
       BEQ    L1B0F   ;2
       LDA    $D3     ;3
       BEQ    L1B0F   ;2
       LDA    $DB     ;3
       BMI    L1B0F   ;2
       LDA    #$01    ;2
       STA    AUDC1   ;3
       STA    AUDC0   ;3
       LDY    #$06    ;2
       STY    AUDV0   ;3
       LDX    #$1F    ;2
       STX    AUDF0   ;3
       LDA    $FA     ;3
       AND    #$04    ;2
       BNE    L1B0F   ;2
       LDX    #$1E    ;2
L1B0F: STX    AUDF1   ;3
       STY    AUDV1   ;3
       LDA    $D3     ;3
       CMP    #$02    ;2
       BNE    L1B72   ;2
       LDA    $F2     ;3
       CMP    #$4F    ;2
       BNE    L1B3E   ;2
       LDA    $F8     ;3
       BEQ    L1B36   ;2
       LDX    #$00    ;2
L1B25: LDA    $D4,X   ;4
       BEQ    L1B31   ;2
       LDA    #$00    ;2
       STA    $D4,X   ;4
       DEC    $F8     ;5
       BEQ    L1B36   ;2
L1B31: INX            ;2
       CPX    #$07    ;2
       BNE    L1B25   ;2
L1B36: LDA    #$40    ;2
       STA    $EB     ;3
       LDA    #$08    ;2
       STA    $ED     ;3
L1B3E: DEC    $F2     ;5
       BNE    L1B9F   ;2
       JSR    L1CAF   ;6
       LDA    #$01    ;2
       STA    $D3     ;3
       LDA    $F4     ;3
       CLC            ;2
       ADC    #$02    ;2
       STA    $F4     ;3
       STA    $F0     ;3
       INC    $F6     ;5
       LDA    $F6     ;3
       STA    $F5     ;3
       LDA    $8D     ;3
       CMP    #$03    ;2
       BNE    L1B64   ;2
       LDA    $F5     ;3
       AND    #$07    ;2
       BNE    L1B9F   ;2
L1B64: INC    $EE     ;5
       LDA    $EE     ;3
       CMP    #$08    ;2
       BCC    L1B9F   ;2
       LDA    #$08    ;2
       STA    $EE     ;3
       BNE    L1B9F   ;2
L1B72: CMP    #$01    ;2
       BNE    L1BA3   ;2
       LDA    $F0     ;3
       BNE    L1B9F   ;2
       LDX    #$03    ;2
L1B7C: LDA    $C7,X   ;4
       CMP    #$07    ;2
       BNE    L1B9F   ;2
       DEX            ;2
       BPL    L1B7C   ;2
       LDA    #$02    ;2
       STA    $D3     ;3
       LDX    $F1     ;3
       BMI    L1B97   ;2
       LDA    L1E6D,X ;4
       JSR    L1CDB   ;6
       LDA    #$18    ;2
       STA    $EB     ;3
L1B97: LDA    #$02    ;2
       STA    $ED     ;3
       LDA    #$9F    ;2
       STA    $F2     ;3
L1B9F: LDA    #$FF    ;2
       STA    $FC     ;3
L1BA3: LDX    #$03    ;2
L1BA5: LDA    $C7,X   ;4
       AND    #$40    ;2
       BEQ    L1BDD   ;2
       LDA    $FA     ;3
       AND    #$07    ;2
       BNE    L1BF3   ;2
       LDA    $C7,X   ;4
       CLC            ;2
       ADC    #$08    ;2
       STA    $C7,X   ;4
       LSR            ;2
       LSR            ;2
       LSR            ;2
       AND    #$07    ;2
       CMP    #$04    ;2
       BNE    L1BD7   ;2
       LDA    $C7,X   ;4
       AND    #$03    ;2
       TAY            ;2
       LDA    #$00    ;2
       STA.wy $00A4,Y ;5
       CPY    #$00    ;2
       BNE    L1BD1   ;2
       STA    $BE     ;3
L1BD1: LDA    #$07    ;2
       STA    $C7,X   ;4
       BNE    L1BF3   ;2
L1BD7: TAY            ;2
       LDA    L1E52,Y ;4
       STA    $CF,X   ;4
L1BDD: LDA    $CF,X   ;4
       CMP    #$20    ;2
       BEQ    L1BE7   ;2
       CMP    #$30    ;2
       BNE    L1BF3   ;2
L1BE7: LDY    #$20    ;2
       LDA    $FA     ;3
       AND    #$04    ;2
       BNE    L1BF1   ;2
       LDY    #$30    ;2
L1BF1: STY    $CF,X   ;4
L1BF3: DEX            ;2
       BPL    L1BA5   ;2
L1BF6: BIT    $0285   ;4
       BPL    L1BF6   ;2
       JMP    L101B   ;3
L1BFE: .byte $00,$00,$00,$00,$00,$00,$01,$01,$02,$03,$00,$00,$00,$03,$03,$02
       .byte $03,$01,$00,$02,$00,$05,$12,$07,$0A,$07,$00,$00,$01,$02,$01,$03
       .byte $02,$01,$00,$00,$00,$00,$00,$00,$01,$04,$00,$16,$02,$49,$1C,$0B
       .byte $25,$8E,$00,$00,$00,$00,$00,$01,$00,$00,$02,$01,$00,$02,$02,$00
       .byte $01,$02,$00,$00,$00,$04,$21,$00,$02,$12,$40,$12,$09,$00,$46,$12
       .byte $88,$01,$00,$02,$00,$00,$01,$00,$02,$00,$00,$01,$02,$02,$00,$02
       .byte $01,$00,$00,$00,$00,$02,$00,$40,$00,$00,$00,$02,$00,$00,$20,$00
       .byte $02,$00,$00,$00,$02,$00,$00,$00,$00,$01,$00,$00,$00,$00,$02,$00
       .byte $01,$00
L1C80: .byte $00,$10,$20,$40,$60
L1C85: .byte $08,$18,$30,$50,$70
L1C8A: .byte $01,$01,$01,$02,$03
L1C8F: .byte $01,$01,$01,$02,$04
L1C94: .byte $03,$03,$03,$06,$0A
L1C99: .byte $00,$00
L1C9B: .byte $08,$08,$08,$09,$0B
L1CA0: .byte $F0,$F0,$E0,$E0,$E0
L1CA5: .byte $08,$08,$10,$10,$10
L1CAA: .byte $0F,$0F,$1F,$1F,$1F
L1CAF: LDX    #$03    ;2
L1CB1: LDA    #$00    ;2
       STA    $E1     ;3
       STA    $E2     ;3
       STA    $BE     ;3
       STA    $A4,X   ;4
       LDA    #$07    ;2
       STA    $C7,X   ;4
       STA    $E3     ;3
       DEX            ;2
       BPL    L1CB1   ;2
       STX    $FC     ;3
       LDA    #$7A    ;2 changed from NTSC #$BA  - above water ground colour
       STA    $E4     ;3
       LDA    #$56    ;2 changed from NTSC #$C6  - underwater ground colour
       STA    $E5     ;3
       LDA    #$C0    ;2
       STA    $E6     ;3
       LDA    #$30    ;2
       STA    $E7     ;3
       LDA    #$E0    ;2
       STA    $E8     ;3
       RTS            ;6

L1CDB: SED            ;2
       BIT    $D3     ;3
       BMI    L1CFE   ;2
       CLC            ;2
       ADC    $A2     ;3
       STA    $A2     ;3
       LDA    $A3     ;3
       ADC    #$00    ;2
       STA    $A3     ;3
       LDA    $A1     ;3
       ADC    #$00    ;2
       STA    $A1     ;3
       LDA    $A3     ;3
       CMP    $F7     ;3
       BNE    L1CFE   ;2
       CLC            ;2
       ADC    #$01    ;2
       STA    $F7     ;3
       INC    $F8     ;5
L1CFE: CLD            ;2
       RTS            ;6

L1D00: .byte $FF,$7D,$2C,$2C,$08,$08,$00,$00,$FF,$F6,$D4,$D4,$D0,$C0,$C0,$00
       .byte $8F,$8F,$43,$43,$21,$11,$08,$07,$09,$1B,$FF,$4B,$29,$1D,$09,$09
       .byte $00,$00,$07,$FF,$01,$00,$00,$00,$7E,$F8,$FE,$54,$FE,$3C,$0C,$00
       .byte $00,$00,$07,$FF,$01,$00,$00,$00,$7E,$F8,$FE,$A8,$FE,$3C,$0C,$00
       .byte $38,$44,$92,$BB,$BB,$92,$44,$38,$3E,$1C,$78,$F0,$F0,$78,$1C,$3E
       .byte $00,$00,$00,$0F,$00,$00,$00,$00,$78,$10,$30,$F8,$30,$10,$78,$00
       .byte $10,$10,$34,$10,$34,$10,$34,$18,$08,$08,$2C,$08,$2C,$08,$2C,$18
       .byte $90,$60,$90,$60,$90,$60,$90,$60,$60,$60,$60,$60,$60,$60,$60,$60
       .byte $FF,$AB,$95,$36,$1E,$0C,$06,$03,$FF,$FF,$F5,$3E,$1E,$0C,$06,$00
       .byte $5A,$FF,$5A,$7E,$5A,$10,$10,$10,$00,$00,$00,$00,$00,$00,$00,$00
       .byte $00,$00,$00,$05,$0A,$05,$00,$00,$00,$00,$00,$50,$A8,$50,$00,$00
       .byte $00,$09,$12,$04,$12,$0C,$00,$00,$00,$48,$A4,$10,$A0,$04,$80,$00
       .byte $00,$12,$04,$09,$24,$11,$00,$08,$04,$90,$42,$08,$A0,$50,$A2,$00
       .byte $22,$05,$10,$04,$4A,$04,$22,$00,$02,$48,$A1,$04,$20,$48,$A1,$08
       .byte $45,$AA,$3A,$4D,$98,$22,$08,$00,$00,$25,$A8,$0A,$44,$20,$81,$08
       .byte $00,$12,$41,$24,$01,$44,$01,$14,$20,$01,$80,$00,$82,$00,$00,$41

;L1E00: .byte $3C,$3C,$FC,$FC,$5A,$5A,$CC,$CC ; colour of domed palace(NTSC)
L1E00: .byte $4C,$4C,$2C,$2C,$8A,$8A,$5C,$5C ; colour of domed palace (PAL60)

;L1E08: .byte $0C,$0C,$8A,$7A,$6A,$5A,$4A,$3A ; colour of bridged bazarr (NTSC)
L1E08: .byte $0C,$0C,$DA,$CA,$AA,$8A,$6A,$2A ; colour of bridged bazarr (PAL60)

;L1E10: .byte $CA,$8A,$6A,$5A,$2A,$2A,$4E; colour of aqua plain (NTSC)
L1E10: .byte $5A,$DA,$AA,$8A,$2A,$2A,$6E; colour of aque plain (PAL60)

;L1E17: .byte $4E,$64,$A4,$78,$DA,$3A,$56,$18 ; colour of ship (sharp nosed) and fast small ship (NTSC)
L1E17: .byte $4E,$A4,$94,$C8,$3A,$4A,$86,$28 ; colour of ship (sharp nosed) and fast small ship (PAL60)

;L1E1F: .byte $98,$FE,$CA,$CA,$98,$56,$18,$3A colour of side guns and round-nosed ship(NTSC)
L1E1F: .byte $B8,$2E,$5A,$5A,$B8,$86,$28,$4A ; colour of side guns and round-nosed ship (PAL60)

;L1E27: .byte $3A,$1A,$2A,$3A,$4A,$68,$68,$68  ; colour of centre gun (NTSC)
L1E27: .byte $4A,$2A,$2A,$4A,$6A,$A8,$A8,$A8  ; colour of centre gun (PAL60)

;L1E2F: .byte $68,$FC,$C8,$8A,$CB,$4A,$CB,$78 ; colour of twirler 1 (NTSC)
L1E2F: .byte $A8,$2C,$58,$DA,$5B,$4A,$5B,$78 ; colour of twirler 1 (PAL60)

;L1E37: .byte $CB ; colour of topmost pixel of 1 twirler (NTSC)
L1E37: .byte $5B ; colour of topmost pixel of 1 twirler (PAL60)
L1E38: .byte $90,$70,$60,$70,$10,$18,$00

L1E3F: .byte $90,$78,$68,$78,$10,$18,$00
L1E46: .byte $04,$04,$02,$04,$04,$04,$04
L1E4D: .byte $E0,$E8,$F0,$F8,$98
L1E52: .byte $A0,$B0,$C0,$D0,$98
L1E57: .byte $A8,$B8,$C8,$D8,$98
L1E5C: .byte $5C,$55,$52
L1E5F: .byte $9A,$4B,$05
L1E62: .byte $FD,$00,$03
L1E65: .byte $20,$40,$20,$50
L1E69: .byte $74,$88,$9C,$B0
L1E6D: .byte $05,$10,$15,$20,$25,$30,$35
L1E74: .byte $4C,$54,$3E,$90,$2E,$68,$1C
L1E7B: .byte $04,$02,$02,$02,$08,$08,$08
L1E82: STA    $8F     ;3
       INC    $8F     ;5
       CPX    #$02    ;2
       BCC    L1E8C   ;2
       INC    $8F     ;5
L1E8C: LDA    $8F     ;3
       PHA            ;3
       LSR            ;2
       LSR            ;2
       LSR            ;2
       LSR            ;2
       STA    $8F     ;3
       TAY            ;2
       PLA            ;4
       AND    #$0F    ;2
       CLC            ;2
       ADC    $8F     ;3
       CMP    #$0F    ;2
       BCC    L1EA3   ;2
       SBC    #$0F    ;2
       INY            ;2
L1EA3: SEC            ;2
       SBC    #$08    ;2
       EOR    #$FF    ;2
       ASL            ;2
       ASL            ;2
       ASL            ;2
       ASL            ;2
       STA    $90     ;3
       STY    $8F     ;3
       RTS            ;6

L1EB1: LDY    #$06    ;2
       TSX            ;2
       STX    $8F     ;3
       LDX    #$1E    ;2
       TXS            ;2
       LDX    $C3     ;3
L1EBB: STA    WSYNC   ;3
       CPX    $BB     ;3
       PHP            ;3
       CPX    $BA     ;3
       PHP            ;3
       PLA            ;4
       PLA            ;4
       DEX            ;2
       DEY            ;2
       BPL    L1EBB   ;2
       STX    $C3     ;3
       LDX    $8F     ;3
       TXS            ;2
       RTS            ;6

L1ECF: LDA    L1E5C,Y ;4
       STA    $BA,X   ;4
       LDA    L1E5F,Y ;4
       STA    $BC,X   ;4
       LDA    L1E62,Y ;4
       STA    $C1,X   ;4
       LDA    #$1F    ;2
       STA    $EA     ;3
       LDA    #$03    ;2
       STA.wy $00DD,Y ;5
       RTS            ;6

L1EE8: ASL            ;2
       STA    $8F     ;3
       ASL            ;2
       ASL            ;2
       CLC            ;2
       ADC    $8F     ;3
       STA    $8F     ;3
       RTS            ;6

L1EF3: .byte $01,$01,$01,$01,$02,$02,$02,$02,$03,$03,$03,$03,$00,$1C,$36,$36
       .byte $36,$36,$77,$36,$36,$36,$1C,$7E,$18,$18,$18,$3C,$18,$18,$18,$38
       .byte $28,$7F,$3F,$19,$0C,$06,$03,$63,$63,$73,$5E,$7E,$67,$63,$03,$03
       .byte $1E,$03,$63,$73,$5E,$09,$06,$06,$06,$7F,$66,$36,$1E,$0E,$05,$3E
       .byte $7F,$63,$03,$03,$7E,$40,$40,$7E,$7F,$1E,$33,$23,$23,$7E,$20,$20
       .byte $23,$33,$1E,$30,$30,$30,$78,$30,$18,$0C,$06,$3F,$7F,$3E,$77,$63
       .byte $63,$36,$3E,$77,$63,$77,$3E,$3C,$66,$66,$06,$06,$7F,$66,$46,$6E
       .byte $3C,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$38,$44,$44,$92,$A2
       .byte $A2,$92,$44,$44,$38,$00,$00,$45,$45,$45,$5D,$55,$5D,$00,$00,$00
       .byte $00,$DC,$50,$50,$DC,$44,$DC,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA
       .byte $AA,$94,$00,$00,$93,$94,$94,$95,$F4,$94,$94,$63,$00,$00,$26,$A9
       .byte $A8,$A8,$28,$28,$A9,$26,$00,$00,$18,$FF,$70,$FF,$18,$00,$00,$00
       .byte $18,$FF,$0E,$FF,$18,$00,$00
;L1FBA: .byte $A0,$A2,$A4,$A6,$A8,$AA,$AC,$AE   ; game over underwater ground fading colours (NTSC colours)
L1FBA: .byte $90,$92,$94,$96,$98,$9A,$9C,$9E   ; game over underwater ground fading colours (PAL colours)
L1FC2: STA    $8F     ;3
       INC    $8F     ;5
       CPX    #$02    ;2
       BCC    L1FCC   ;2
       INC    $8F     ;5
L1FCC: LDA    $8F     ;3
       PHA            ;3
       LSR            ;2
       LSR            ;2
       LSR            ;2
       LSR            ;2
       STA    $8F     ;3
       TAY            ;2
       PLA            ;4
       AND    #$0F    ;2
       CLC            ;2
       ADC    $8F     ;3
       CMP    #$0F    ;2
       BCC    L1FE3   ;2
       SBC    #$0F    ;2
       INY            ;2
L1FE3: SEC            ;2
       SBC    #$08    ;2
       EOR    #$FF    ;2
       STA    WSYNC   ;3
       ASL            ;2
       ASL            ;2
       ASL            ;2
       ASL            ;2
       STA    HMP0,X  ;4
L1FF0: DEY            ;2
       BPL    L1FF0   ;2
       STA    $8F     ;3
       STA    RESP0,X ;4
       RTS            ;6

L1FF8: .byte $78,$8C,$A0,$AC,$00,$10,$00,$10
