;  "Blast Droids"
;  For Bally Arcade/Astrocade
;  By Esoterica
;  Written by Dan Drescher, and J.P. Curran.
;
;  Blast Droids is a 4K cartridge released in 1983.
;
;  The Bally/Astrocade Game Cartridge and Hardware FAQ by Paul Thacker,
;  Adam Trionfo and Mike White states, "The cartridge reads
;  'Spectrecade (tm) Presents: Blast Droids,'' but Spectrecade had
;  nothing to do with this game. Esoterica, Inc. previously
;  manufactured "Treasure Cove" (a Spectrecade game). Somehow that name
;  ended up on this cartridge's label. It's a mistake.  
; 
;  Disassembly Started November 30, 2016 by Adam Trionfo.
;
;  This program can be assembled using ZMAC.  Make sure that HVGLIB.H
;  is in the same directory and then type:
;      zmac -i -m -o blast.bin -x blast.lst blast.asm
;
;
;  Version History:
;    .02 (Feb. 15, 2017) - First version added to BallyAlley.com
;    .01 (Nov. 30, 2016) - First Distributed version.
                                                     
        INCLUDE "HVGLIB.H"      ; Home Video Game Library

        ORG     FIRSTC

        DB      'U'             ; Sentinal for Menu Start

;  First Menu Item node
        DW      MENUST          ; ... Next Menu Node
        DW      L2DC4           ; ... Choice 1 Text is "BLAST DROIDS"
        DW      L2016           ; ... Start of "Blast Droids" 

;  Reset Vector Jumps - Used with RST Instruction      
        JP      L2BB8            ; Reset VECTor #1 /  8 / $08
        JP      L2BC6            ; Reset VECTor #2 / 16 / $10
        JP      L2BD4            ; Reset VECTor #3 / 24 / $18
        JP      L2BE2            ; Reset VECTor #4 / 32 / $20

        NOP
        NOP
        NOP

;  Start of "Blast Droids" Program

L2016:  NOP
L2017:  NOP
        NOP
        NOP
        NOP
        CALL    L282E

        LD      A,(HL)
        CP      $03
        JR      NC,L2017
        NOP     
        NOP     
        NOP     
        SYSTEM  INTPC            ;  UPI INTerPret with Context create
        ;
        DO      FILL             ;  UPI FILL memory with data
        DW      NORMEM           ;  ... Memory Address = $4000 (NORmal MEMory start)
        DW      $0F62            ;  ... Byte Count = 3938
        DB      $00              ;  ... Data = 0
        ;
        DO      SETOUT           ;  UPI SET some OUTput ports
        DB      $AA              ;  ... VERBL*2 = 170
        DB      $32              ;  ... HORCB/4 = 50
        DB      $08              ;  ... INMOD = 8
        ;
        DO      COLSET           ;  UPI COLors SET
        DW      L2BF8            ;  ... Table Address = 11256
        ;
        DO      MOVE             ;  UPI MOVE block transfer
        DW      $4E99            ;  ... Destination Address = 20121
        DW      $003E            ;  ... Byte Count = 62
        DW      $27E7            ;  ... Source Address = 10215
        ;
        DO      MOVE             ;  UPI MOVE block transfer
        DW      $4E2A            ;  ... Destination Address = 20010
        DW      $005F            ;  ... Byte Count = 95
        DW      $2F22            ;  ... Source Address = 12066
        ;
        DONT    INTPC            ;  UPI INTerPret with Context create
        ;
        DONT    XINTC            ;  UPI eXit INTerpreter with Context
        ;
L2045:  CALL    L2978
        
        NOP     
        NOP     
        NOP     
        NOP     
        NOP     
        NOP     
        
        CALL    L2B2E
        CALL    L2B7C
        CALL    L26A8
        CALL    L26C6            ;  This CALLs straight to a RETurn
        
        NOP     
        NOP     
        NOP     
        
        CALL    L2C02
        LD      HL,$239C
        LD      ($4F06),HL
        NOP     
        NOP     
        NOP     
        NOP     
        NOP     
        LD      A,$3F
        OUT     (TONMO),A    ; Port $10, write TONe Master Oscillator        
        LD      A,$64
        OUT     (VIBRA),A    ; Port $14, write VIBRAto frequency & range
        NOP     
        LD      HL,$0000
        LD      ($4F6C),HL
        LD      ($4ED5),HL
L207D:  JR      L207D        ; Infinite Loop ??
        NOP     
L2080:  JR      L2080        ; Infinite Loop ??

L2082:  DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $3E
        DB      $06
        DB      $32
        DB      $6E
        DB      $4F
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $DB
        DB      $10
        DB      $CB
        DB      $67
        DB      $28
        DB      $54
        DB      $21
        DB      $74
        DB      $4F
        DB      $7E
        DB      $A7
        DB      $20
        DB      $17
        DB      $36
        DB      $32
        DB      $21
        DB      $77
        DB      $4F
        DB      $CD
        DB      $18
        DB      $2C
        DB      $3A
        DB      $6B
        DB      $4F
        DB      $32
        DB      $6F
        DB      $4F
        DB      $2B
        DB      $CD
        DB      $34
        DB      $2C
        DB      $CD
        DB      $7A
        DB      $2C
        DB      $18
        DB      $36
        DB      $23
        DB      $7E
        DB      $A7
        DB      $20
        DB      $17
        DB      $36
        DB      $32
        DB      $21
        DB      $79
        DB      $4F
        DB      $CD
        DB      $18
        DB      $2C
        DB      $2B
        DB      $3A
        DB      $6B
        DB      $4F
        DB      $32
        DB      $70
        DB      $4F
        DB      $CD
        DB      $34
        DB      $2C
        DB      $CD
        DB      $8A
        DB      $2C
        DB      $18
        DB      $1A
        DB      $23
        DB      $7E
        DB      $A7
        DB      $20
        DB      $15
        DB      $36
        DB      $32
        DB      $21
        DB      $7B
        DB      $4F
        DB      $CD
        DB      $18
        DB      $2C
        DB      $2B
        DB      $3A
        DB      $6B
        DB      $4F
        DB      $32
        DB      $71
        DB      $4F
        DB      $CD
        DB      $34
        DB      $2C
        DB      $CD
        DB      $9B
        DB      $2C
        DB      $00

L20EA:  LD      DE,$0004
        LD      B,$03
        LD      (IX+$14),$06
        PUSH    IX
        POP     HL
        LD      A,L
        CP      $B4
        JR      C,L2100
        LD      HL,$4F5B
        JR      L2103
L2100:  LD      HL,$4F4F
L2103:  LD      A,(HL)
        AND     A
        JR      NZ,L211D
        LD      (HL),$3C
        LD      A,(IX+$13)
        PUSH    AF
        DEC     HL
        LD      (HL),A
        DEC     HL
        DEC     HL
        CALL    L2C18
        POP     AF
        CALL    L2C34
        CALL    L2C7A
        RET

        NOP

L211D:  ADD     HL,DE
        DJNZ    $2102
        RET     

        DB      $00
        DB      $00
        DB      $10
        DB      $DF
        DB      $00
        DB      $C9
        DB      $CD
        DB      $30
        DB      $26
        DB      $3A
        DB      $B4
        DB      $4E
        DB      $A7
        DB      $20
        DB      $07
        DB      $3A
        DB      $D3
        DB      $4E
        DB      $A7
        DB      $20
        DB      $01
        DB      $C9
        DB      $C3
        DB      $45
        DB      $20

L213A:  PUSH    DE
        PUSH    BC
        PUSH    HL
        PUSH    AF
        PUSH    IY
        PUSH    IX
        LD      C,$10
        LD      IX,$4E9A
L2148:  LD      A,(IX+$1A)
        AND     A
        JP      Z,L2243
        PUSH    BC
        LD      A,(IX+$0F)
        AND     A
        JP      NZ,L2CB0
        LD      L,(IX+$10)
        LD      H,(IX+$11)
; Write Player's Ship ??        
        SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        IN      A,($08)
        LD      A,(IX+$10)
        CP      $41
        JR      C,L216D
        SUB     $42
        LD      (IX+$10),A
L216D:  LD      A,$05
        LD      (IX+$02),A
        IN      B,(C)
        CALL    L26F8

L2177:  DB      $00
        DB      $00
        DB      $DD
        DB      $7E
        DB      $12
        DB      $A7
        DB      $28
        DB      $06
        DB      $3D
        DB      $DD
        DB      $77
        DB      $12
        DB      $18
        DB      $49
        DB      $00
        DB      $CB
        DB      $50
        DB      $28
        DB      $1E
        DB      $DD
        DB      $7E
        DB      $13
        DB      $A7
        DB      $20
        DB      $02
        DB      $3E
        DB      $08
        DB      $3D
        DB      $DD
        DB      $77
        DB      $13
        DB      $DD
        DB      $7E
        DB      $10
        DB      $A7
        DB      $20
        DB      $02
        DB      $C6
        DB      $40
        DB      $D6
        DB      $08
        DB      $DD
        DB      $77
        DB      $10
        DB      $00

L21A4:  LD      (IX+$12),$04
        BIT     3,B
        JR      Z,L21CE
        LD      A,(IX+$13)
        CP      $07
        JR      NZ,L21B9
        LD      (IX+$13),$00
        JR      L21BC
L21B9:  INC     (IX+$13)
L21BC:  LD      A,(IX+$10)
        CP      $38
        JR      NZ,L21C5
        SUB     $40
L21C5:  ADD     A,$08
        LD      (IX+$10),A
        LD      (IX+$12),$04
L21CE:  LD      A,($4E26)
        AND     A
        CALL    Z,L24D2
        OUT     (VOLN),A         ; Port $17, write VOLume of Noise
        BIT     0,B
        JR      Z,L2220
        LD      A,$FF
        OUT     ($17),A
        OUT     ($15),A
        LD      A,(IX+$10)
        ADD     A,$42
        LD      (IX+$10),A
        LD      A,(IX+$13)
        AND     A
        JR      NZ,L21F1
        RST     $08              ;  User ReStarT #1 of 6
        RST     $08              ;  User ReStarT #1 of 6
L21F1:  CP      $01
        JR      NZ,L21F7
        RST     $08              ;  User ReStarT #1 of 6
        RST     $20              ;  User ReStarT #4 of 6
L21F7:  CP      $02
        JR      NZ,L21FD
        RST     $20              ;  User ReStarT #4 of 6
        RST     $20              ;  User ReStarT #4 of 6
L21FD:  CP      $03
        JR      NZ,L2203
        RST     $10              ;  User ReStarT #2 of 6
        RST     $20              ;  User ReStarT #4 of 6
L2203:  CP      $04
        JR      NZ,L2209
        RST     $10              ;  User ReStarT #2 of 6
        RST     $10              ;  User ReStarT #2 of 6
L2209:  CP      $05
        JR      NZ,L220F
        RST     $10              ;  User ReStarT #2 of 6
        RST     $18              ;  User ReStarT #3 of 6
L220F:  CP      $06
        JR      NZ,L2215
        RST     $18              ;  User ReStarT #3 of 6
        RST     $18              ;  User ReStarT #3 of 6
L2215:  CP      $07
        JR      NZ,L221B
        RST     $08              ;  User ReStarT #1 of 6
        RST     $18              ;  User ReStarT #3 of 6
L221B:  NOP     
        NOP     
        NOP     
        NOP     
        NOP     
L2220:  LD      L,(IX+$10)
        LD      H,(IX+$11)
        SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        IN      A,($08)
        AND     A
        CALL    NZ,$2CF3
        NOP     

L222F:  LD      A,(IX+$14)
        AND     A
        JR      Z,L223A
        DEC     (IX+$14)
        JR      L223F
L223A:  BIT     4,B
        CALL    NZ,L20EA
L223F:  CALL    L2287
        POP     BC
L2243:  LD      A,($4F6E)
        DEC     A
        JR      Z,L2256
        LD      A,C
        CP      $10
        JR      NZ,L2256
        INC     C
        LD      IX,$4EB9
        JP      L2148

L2256:  LD      HL,$239C
        LD      ($4F06),HL
        POP     IX
        POP     IY
        POP     AF
        POP     HL
        POP     BC
        POP     DE
        EI      
        RET

L2266:  DB      $00
        DB      $00
        DB      $00
        DB      $21
        DB      $26
        DB      $4E
        DB      $7E
        DB      $A7
        DB      $28
        DB      $0C
        DB      $3D
        DB      $3D
        DB      $20
        DB      $05
        DB      $3E
        DB      $EF
        DB      $D3
        DB      $15
        DB      $AF
        DB      $D3
        DB      $17
        DB      $77
        DB      $21
        DB      $74
        DB      $4F
        DB      $7E
        DB      $A7
        DB      $28
        DB      $1F
        DB      $E5
        DB      $CD
        DB      $7B
        DB      $2C

L2287:  LD      HL,$4E26
        LD      A,(HL)
        AND     A
        JR      Z,L2299
        DEC     A
        DEC     A
        NOP     
        NOP     
        JR      NZ,L2299
        LD      A,$F0
        OUT     (VOLC),A         ; Port $15, write VOLume of tone C
        XOR     A
L2299:  OUT     (VOLN),A         ; Port $17, write VOLume of Noise
        LD      (HL),A
        XOR     A
        LD      (IX+$16),A
        NOP     
        INC     HL
        PUSH    BC
        PUSH    HL
        PUSH    DE
        LD      DE,$0004
        LD      B,$03
        PUSH    IX
        POP     HL
        LD      A,L
        CP      $B4
        JR      C,L22B7
        LD      HL,$4F5B
        JR      L22BA
L22B7:  LD      HL,$4F4F
L22BA:  PUSH    BC
        LD      A,(HL)
        AND     A
        JR      Z,L22E3
        PUSH    HL
        DEC     HL
        DEC     HL
        DEC     HL
        CALL    L2C7A
        IN      A,($08)
        POP     HL
        DEC     (HL)
        LD      A,(HL)
        JR      Z,L22E3
        NOP     
        NOP     
        NOP     
        DEC     HL
        LD      A,(HL)
        DEC     HL
        DEC     HL
        CALL    L2C39
        CALL    L2C7A
        IN      A,($08)
        AND     A
        JP      NZ,L2301
        INC     HL
        INC     HL
        INC     HL
L22E3:  POP     BC
        ADD     HL,DE
        DJNZ    $22B9
        POP     DE
        POP     HL
        POP     BC
        RET

L22EB:  DB      $00
        DB      $18
        DB      $23
        DB      $08
        DB      $00
        DB      $21
        DB      $9C
        DB      $23
        DB      $22
        DB      $06
        DB      $4F
        DB      $DD
        DB      $E1
        DB      $FD
        DB      $E1
        DB      $F1
        DB      $E1
        DB      $C1
        DB      $D1
        DB      $FB
        DB      $C9
        DB      $00

L2301:  LD      A,$01
        LD      (IX+$16),A
        INC     HL
        INC     HL
        INC     HL
        LD      (HL),A
        NOP     
        NOP     
        NOP     
        NOP     
        NOP     
        NOP     
        NOP     
        JP      L22E3

L2314:  DB      $32
        DB      $3A
        DB      $26
        DB      $4E
        DB      $D6
        DB      $04
        DB      $00
        DB      $00
        DB      $D3
        DB      $17
        DB      $00
        DB      $00
        DB      $32
        DB      $26
        DB      $4E
        DB      $C9

L2324:  LD      A,($4E99)
        CP      $04
        RET     Z

        CP      $06
        RET     Z

        SYSSUK  RANGED           ;  UPI RANGED random number
        DB      $04              ;  ... Cutoff = 4
        ;
        CP      $02
        RET     Z

        INC     (IX+$08)
        INC     (IX+$03)
        RET

        NOP

L233B:  DB      "1-GAME PLAY         2-TRAINING            SECTOR",$00

L236C:  DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        
L239C:  PUSH    DE
        PUSH    BC
        PUSH    HL
        PUSH    AF
        PUSH    IY
        PUSH    IX
        LD      B,$04
        LD      IX,$4E2A
L23AA:  CALL    L2324
        PUSH    BC
        LD      L,(IX+$0D)
        LD      H,(IX+$0E)
        LD      A,(IX+$0F)
        CP      $51
        JR      NC,L23C4
        CP      $50
        JR      NZ,L23E4
; Write Droid
        SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        JP      L2496

; This code is run as soon as a droid appears onscreen
L23C4:  LD      A,(IX+$10)
        AND     A
        JP      NZ,L243C
L23CB:  SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        CALL    L26FD
        IN      A,($08)
        INC     (IX+$02)
        PUSH    HL
        LD      HL,$4E7E         ; Limit Table Address
        SYSTEM  VECT             ; UPI VECTor move coordinate pair
        ;
        POP     HL
        SYSTEM  VWRITR           ; UPI Vector WRITe Relative
        ;
        IN      A,($08)
        AND     A
        CALL    NZ,L2414
L23E4:  NOP     
        CALL    L2698
        JP      L27CA


L23EB:  LD      DE,$0011
        ADD     IX,DE
        POP     BC
        DJNZ    L23AA
        NOP     
        NOP     
        NOP     
        LD      HL,$213A
        LD      ($4F06),HL
        NOP     
        NOP     
        NOP     
        NOP     
        LD      IX,$4E2A
        CALL    L245E
        POP     IX
        POP     IY
        POP     AF
        POP     HL
        POP     BC
        POP     DE
        EI      
        RET

        NOP
        NOP
        NOP
        
L2414:  CALL    L24E5
        AND     A
        RET     Z

        LD      A,(IX+$10)
        AND     A
        RET     NZ

        INC     (IX+$10)
        SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        LD      HL,$2FA4
        LD      (IX+$0D),L
        LD      (IX+$0E),H
        SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        LD      HL,$4E84
        INC     (HL)
        LD      A,(HL)
        INC     HL
        CP      (HL)
        JP      NC,L252C
        CALL    L2482
        RET     

; This routine is called when a droid is destroyed
L243C:  CP      $05
        JR      Z,L2446
        INC     (IX+$10)
        JP      L23CB
; Draw Droid Explosion
L2446:  SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        LD      HL,($4DBC)
        LD      (IX+$0D),L
        XOR     A
        LD      (IX+$10),A
        LD      (IX+$0F),A
        LD      (IX+$0E),H
        CALL    L2D9C
        JP      L248A

L245E:  LD      A,($4F6A)
        CP      $02
        RET     Z

L2464:  LD      DE,$0011
        LD      HL,$4E39
        LD      B,$04
L246C:  LD      A,$51
        CP      (HL)
        JR      Z,L2473
        INC     (HL)
        RET     

L2473:  ADD     HL,DE
        DJNZ    L246C
        RET

L2477:  DB      $00
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00

L2482:  LD      A,$00
        OUT     (COL0R),A        ; Port $00, write COLor 0 Right
        CALL    L24B4
        RET     

L248A:  XOR     A
        OUT     (COL0R),A        ; Port $00, write COLor 0 Right
        JP      L23E4
        LD      A,($4F72)
        AND     A
        RET     NZ

        NOP

L2496:  LD      A,($4E87)
        AND     A
        JR      NZ,L24A9
        LD      A,$32
        OUT     (TONEA),A        ; Port $11, write TONe A oscillator
        LD      A,$FF
        OUT     (VOLAB),A        ; Port $16, write VOLumes of tones A & B
        LD      ($4E87),A
        JR      L24B0
L24A9:  LD      A,$96
        LD      ($4E88),A
        OUT     (TONEB),A        ; Port $12, write TONe B oscillator
L24B0:  JP      L23EB

        NOP

L24B4:  LD      A,($4E88)
        AND     A
        JR      Z,L24C5
        XOR     A
        LD      ($4E88),A
        OUT     (TONEB),A        ; Port $12, write TONe B oscillator
        LD      A,$00
        OUT     (VOLC),A         ; Port $15, write VOLume of tone C
        RET     

L24C5:  XOR     A
        LD      ($4E87),A
        OUT     (TONEA),A        ; Port $11, write TONe A oscillator
        RET     

L24CC:  DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00

L24D2:  NOP     
        XOR     A
        NOP     
        NOP     
        NOP     
        OUT     (VOLN),A         ; Port $17, write VOLume of Noise
        OUT     (VOLC),A         ; Port $15, write VOLume of tone C
        OUT     (TONEC),A        ; Port $13, write TONe C oscillator
        LD      A,$64
        OUT     (VIBRA),A        ; Port $14, write VIBRAto frequency & range
        RET

L24E2:  DB      $00
        DB      $00
        DB      $00

L24E5:  PUSH    HL
        LD      A,($4EB0)
        LD      HL,$4F6C
        ADD     A,(HL)
        LD      (HL),A
        INC     HL
        LD      A,($4ECF)
        ADD     A,(HL)
        LD      (HL),A
        POP     HL
        LD      A,($4EB0)
        AND     A
        RET     NZ

        LD      A,($4ECF)
        RET

        NOP

L24FF:  LD      A,($4F6C)
        AND     A
        JR      Z,L251F
        LD      B,A
L2506:  LD      A,$50
        LD      HL,$4EB5
        ADD     A,(HL)
        DAA     
        LD      (HL),A
        INC     HL
        LD      A,$00
        ADC     A,(HL)
        DAA     
        LD      (HL),A
        NOP     
        NOP     
        NOP     
        INC     HL
        LD      A,$00
        ADC     A,(HL)
        DAA     
        LD      (HL),A
        DJNZ    L2506
L251F:  LD      A,($4F6D)
        AND     A
        RET     Z

        JP      L2572
        JP      L2572

        NOP
        NOP

L252C:  CALL    L2B6C
        XOR     A
        OUT     (VOLN),A         ; Port $17, write VOLume of Noise
        LD      SP,$4FEE
        CALL    L2630
        NOP     
        LD      HL,$4E99
        INC     (HL)
        LD      A,(HL)
        CP      $0A
        JR      NZ,L2544
        LD      (HL),$03
L2544:  NOP     
        NOP     
        XOR     A
        OUT     (VOLAB),A        ; Port $16, write VOLumes of tones A & B
        OUT     (COL0R),A        ; Port $00, write COLor 0 Right
        LD      ($4E84),A
        SYSSUK  MOVE             ;  UPI MOVE block transfer
        DW      $4E2A            ;  ... Destination Address = 20010
        DW      $005F            ;  ... Byte Count = 95
        DW      $2F22            ;  ... Source Address = 12066
        ;
        SYSSUK  MOVE             ;  UPI MOVE block transfer
        DW      $4E9A            ;  ... Destination Address = 20122
        DW      $0018            ;  ... Byte Count = 24
        DW      $27E8            ;  ... Source Address = 10216
        ;
        SYSSUK  MOVE             ;  UPI MOVE block transfer
        DW      $4EB9            ;  ... Destination Address = 20153
        DW      $0018            ;  ... Byte Count = 24
        DW      $2807            ;  ... Source Address = 10247
        ;
        SYSSUK  FILL             ;  UPI FILL memory with data
        DW      $4F4C            ;  ... Memory Address = 20300
        DW      $0018            ;  ... Byte Count = 24
        DB      $00              ;  ... Data = 0
        ;
        JP      L2045

        NOP     
        NOP

L2572:  LD      A,($4F6D)
        LD      B,A
L2576:  LD      A,$50
        LD      HL,$4F08
        ADD     A,(HL)
        DAA     
        LD      (HL),A
        INC     HL
        LD      A,$00
        ADC     A,(HL)
        DAA     
        LD      (HL),A
        NOP     
        NOP     
        NOP     
        INC     HL
        LD      A,$00
        ADC     A,(HL)
        DAA     
        LD      (HL),A
        DJNZ    L2576
        RET

L2590:  XOR     A
        OUT     (VOLN),A         ; Port $17, write VOLume of Noise
        NOP     
        NOP     
        OUT     (VOLC),A         ; Port $15, write VOLume of tone C
        NOP     
        LD      A,C
        SUB     $10
        JR      NZ,L25AE
        SYSSUK  MOVE             ;  UPI MOVE block transfer
        DW      $4E9A            ;  ... Destination Address = 20122
        DW      $0015            ;  ... Byte Count = 21
        DW      $27E8            ;  ... Source Address = 10216
        ;
        LD      HL,$4EAF
        DEC     (HL)
        LD      HL,L2E00         ; Pattern (Player's Ship)
        JR      L25BD
L25AE:  SYSSUK  MOVE             ;  UPI MOVE block transfer
        DW      $4EB9            ;  ... Destination Address = 20153
        DW      $0015            ;  ... Byte Count = 21
        DW      $2807            ;  ... Source Address = 10247
        ;
        LD      HL,$4ECE
        DEC     (HL)
        LD      HL,$2E00
L25BD:  XOR     A
        LD      ($4E25),A
        DEC     (IX+$1A)
        CALL    Z,L25DA
        RET

        NOP

L25C9:  CALL    L2B6C
        CALL    L2B94
        CALL    L2658
        CALL    L2642
        XOR     A
        OUT     (VOLAB),A  ; Port $16, write VOLumes of tones A & B

L25D8:  JR      L25D8      ; End of Game (Infinite Loop, must Reset to replay)

L25DA:  LD      HL,$263C
        LD      A,($4F6E)
        DEC     A
        JR      Z,L25E8
        LD      A,($4ED3)
        AND     A
        RET     NZ

L25E8:  LD      A,($4EB4)
        AND     A
        RET     NZ

        JP      L25C9

        DB      $00
        DB      $00
        DB      $00

L25F3:  LD      IX,$4E2A
        LD      B,$04
        LD      DE,$0011
        LD      HL,($4DBC)
L25FF:  LD      (IX+$0D),L
        LD      (IX+$0E),H
        ADD     IX,DE
        DJNZ    L25FF
        RET

L260A:  DB      $00
        DB      $00
        DB      $00
        DB      $21
        DB      $DC
        DB      $2E
        DB      $22
        DB      $BC
        DB      $4D
        DB      $CD
        DB      $F3
        DB      $25
        DB      $C9
        DB      $21
        DB      $E0
        DB      $2F
        DB      $22
        DB      $BC
        DB      $4D
        DB      $CD
        DB      $F3
        DB      $25
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $AF
        DB      $32
        DB      $1F
        DB      $4E
        DB      $3E
        DB      $03
        DB      $32
        DB      $CA
        DB      $4D
        DB      $C9

L2630:  LD      A,($4E99)
        LD      B,A
L2634:  PUSH    BC
        CALL    L24FF
        POP     BC
        DJNZ    L2634
        RET  

L263C:  DB      $00
        DB      $00
        DB      $01
        DB      $01
        DB      $00
        DB      $00

L2642:  SYSSUK  STRDIS           ;  UPI STRing DISplay
        DB      $2D              ;  ... X = 45
        DB      $02              ;  ... Y = 2
        DB      $08              ;  ... Options = 8
        DW      L2DD8            ;  ... String "GAME OVER"
        ;
        RET     

        DB      $00
        DB      $00
        DB      $00
        DB      $00

L264E:  NOP     
        NOP     
        NOP     
        CALL    L2B6C
        NOP     
        NOP     
        NOP     
        NOP     
L2658:  SYSSUK  STRDIS           ;  UPI STRing DISplay
        DB      $08              ;  ... X = 8
        DB      $14              ;  ... Y = 20
        DB      $08              ;  ... Options = 8
        DW      L2DAD            ;  ... String "PLYR  SCORE  SHIPS"
        ;
        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $14              ;  ... X = 20
        DB      $28              ;  ... Y = 40
        DB      $28              ;  ... Options = 40
        DB      $01              ;  ... Extended = 1
        DW      $27EA            ;  ... Number Address = 10218
        ;
        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $38              ;  ... X = 56
        DB      $28              ;  ... Y = 40
        DB      $28              ;  ... Options = 40
        DB      $06              ;  ... Extended = 6
        DW      $4EB5            ;  ... Number Address = 20149
        ;
        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $82              ;  ... X = 130
        DB      $28              ;  ... Y = 40
        DB      $28              ;  ... Options = 40
        DB      $01              ;  ... Extended = 1
        DW      $4EB4            ;  ... Number Address = 20148
        ;
        LD      A,($4F6E)
        CP      $02
        RET     NZ

        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $14              ;  ... X = 20
        DB      $3C              ;  ... Y = 60
        DB      $28              ;  ... Options = 40
        DB      $01              ;  ... Extended = 1
        DW      $267B            ;  ... Number Address = 9851
        ;
        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $38              ;  ... X = 56
        DB      $3C              ;  ... Y = 60
        DB      $28              ;  ... Options = 40
        DB      $06              ;  ... Extended = 6
        DW      $4F08            ;  ... Number Address = 20232
        ;
        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $82              ;  ... X = 130
        DB      $3C              ;  ... Y = 60
        DB      $28              ;  ... Options = 40
        DB      $01              ;  ... Extended = 1
        DW      $4ED3            ;  ... Number Address = 20179
        ;
        RET     

        NOP
        NOP

; Is this the code that continuously cycles through the colors?   
L2698:  LD      A,($4E25)
        DEC     A
        OUT     (COL1L),A        ; Port $05, write COLor 1 Left
        LD      ($4E25),A
        RET

        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $03

L26A8:  LD      A,($4F6E)
        CP      $02
        JR      NZ,L26BB
        LD      A,($4ED3)
        AND     A
        JR      Z,L26BB
        SYSSUK  VWRITR           ;  UPI Vector WRITe Relative
        DW      $4EB9            ;  ... Vector Block = 20153
        DW      L2E00            ;  ... Pattern (Player's Ship)
        ;
L26BB:  LD      A,($4EB4)
        AND     A
        RET     Z

        SYSSUK  VWRITR           ;  UPI Vector WRITe Relative
        DW      $4E9A            ;  ... Vector Block = 20122
        DW      L2E00            ;  ... Pattern (Player's Ship)
        ;
L26C6:  RET

L26C7:  DB      $00
        DB      $B9
        DB      $4E
        DB      $00
        DB      $2E
        DB      $C9
        DB      $00
        DB      $00
        DB      $00

L26D0:  LD      A,(HL)
        CP      $03
        JR      NC,L26D7
        LD      (HL),$9C
L26D7:  CP      $9D
        JR      C,L26DD
        LD      (HL),$03
L26DD:  INC     HL
        LD      A,(HL)
        CP      $03
        JR      C,L26EB
        NOP     
        NOP     
        CP      $54
        JR      NC,L26EB
        DEC     HL
        RET

L26EB:  INC     HL
        INC     HL
        LD      A,$01
        LD      (HL),A
        DEC     HL
        DEC     HL
        DEC     HL
        RET

L26F4:  DB      $00
        DB      $00
        DB      $00
        DB      $00

L26F8:  LD      HL,L2825         ; Limit Table Address
        SYSTEM  VECT             ; UPI VECTor move coordinate pair
        ;
L26FD:  LD      A,(IX+$06)
        CP      $03
        JR      NC,L2709
        LD      A,$9C
        LD      (IX+$06),A
L2709:  CP      $9D
        JR      C,L2712
        LD      A,$03
        LD      (IX+$06),A
L2712:  LD      A,(IX+$0B)
        CP      $03
        JR      NC,L271E
        LD      A,$50
        LD      (IX+$0B),A
L271E:  CP      $51
        JR      C,L2727
        LD      A,$03
        LD      (IX+$0B),A
L2727:  RET


L2728:  NOP
        NOP

L272A:  LD      A,($4E99)
        LD      HL,$4E85
        DEC     A
        LD      (HL),$08
        RET     Z

        DEC     A
        LD      (HL),$0E
        RET     Z

        DEC     A
        LD      (HL),$0E
        RET     Z

        DEC     A
        LD      (HL),$01
        RET     Z

        DEC     A
        LD      (HL),$0C
        RET     Z

        DEC     A
        LD      (HL),$08
        RET     Z

        LD      (HL),$14
        RET     

        NOP     

L274C:  CALL    L272A
        XOR     A
        LD      A,(HL)
        DAA     
        LD      ($4E86),A
        SYSSUK  STRDIS           ;  UPI STRing DISplay
        DB      $14              ;  ... X = 20
        DB      $3C              ;  ... Y = 60
        DB      $08              ;  ... Options = 8
        DW      L2DCA            ;  ... String "DROIDS"
        ;
        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $78              ;  ... X = 120
        DB      $3C              ;  ... Y = 60
        DB      $28              ;  ... Options = 40
        DB      $02              ;  ... Extended = 2
        DW      $4E86            ;  ... Number Address = 20102
        ;
        RET

        NOP

L2766:  LD      A,$FF
        OUT     (VOLAB),A     ; Port $16, write VOLumes of tones A & B
        LD      A,$64
        OUT     (VIBRA),A     ; Port $14, write VIBRAto frequency & range
L276E:  IN      A,(SW0)       ; Port, read SWitch bank 0 for player 1 hand control
        BIT     4,A
        JR      NZ,L2784
        IN      A,(SW1)       ; Port $11, read SWitch bank 1 for player 2 hand control
        BIT     4,A
        JR      NZ,L2784
        INC     DE
        LD      A,D
        OUT     (TONEA),A     ; Port $11, write TONe A oscillator
        OUT     (TONEB),A     ; Port $12, write TONe B oscillator
        OUT     (TONMO),A     ; Port $10, write TONe Master Oscillator
        JR      L276E
L2784:  LD      A,$35
        OUT     (TONMO),A     ; Port $10, write TONe Master Oscillator
        XOR     A
        OUT     (TONEB),A     ; Port $12, write TONe B oscillator
        OUT     (TONEA),A     ; Port $11, write TONe A oscillator
        RET     

; Draw "Space Fortress" (the maze-like level) ??
L278E:   SYSTEM  INTPC            ;  UPI INTerPret with Context create
        ;
        DO      RECTAN           ;  UPI paint a RECTANgle
        DB      20               ;  ... X = 20
        DB      28               ;  ... Y = 28
        DB      120              ;  ... Width = 120
        DB      52               ;  ... Height = 52
        DB      $AA              ;  ... Color = 170
        ;
        DO      RECTAN           ;  UPI paint a RECTANgle
        DB      22               ;  ... X = 22
        DB      8                ;  ... Y = 8
        DB      116              ;  ... Width = 116
        DB      70               ;  ... Height = 70
        DB      $00              ;  ... Color = 0
        ;
        DO      RECTAN           ;  UPI paint a RECTANgle
        DB      36               ;  ... X = 36
        DB      10               ;  ... Y = 10
        DB      88               ;  ... Width = 88
        DB      50               ;  ... Height = 50
        DB      $AA              ;  ... Color = 170
        ;
        DO      RECTAN           ;  UPI paint a RECTANgle
        DB      38               ;  ... X = 38
        DB      12               ;  ... Y = 12
        DB      84               ;  ... Width = 84
        DB      50               ;  ... Height = 50
        DB      $00              ;  ... Color = 0
        ;
        DO      RECTAN           ;  UPI paint a RECTANgle
        DB      50               ;  ... X = 50
        DB      28               ;  ... Y = 28
        DB      60               ;  ... Width = 60
        DB      30               ;  ... Height = 30
        DB      $FF              ;  ... Color = 255
        ;
        DO      RECTAN           ;  UPI paint a RECTANgle
        DB      54               ;  ... X = 54
        DB      28               ;  ... Y = 28
        DB      52               ;  ... Width = 52
        DB      26               ;  ... Height = 26
        DB      $00              ;  ... Color = 0
        ;
        DONT    XINTC            ;  UPI eXit INTerpreter with Context
        ;
        LD      A,($4E99)
        CP      $06
        RET     NZ

;  ??  Possibly draw the extra line for the Sector 6 "Space Fortree"          
        SYSSUK  RECTAN           ;  UPI paint a RECTANgle
        DB      34               ;  ... X = 34
        DB      66               ;  ... Y = 66
        DB      94               ;  ... Width = 94
        DB      1                ;  ... Height = 1
        DB      $55              ;  ... Color = 85
        ;
        RET

L27C3:  DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00

L27CA:  NOP     
        NOP     
        NOP     
        NOP     
        NOP     
        LD      HL,$4DC2
        NOP     
        NOP     
        LD      A,($4E99)
        CP      $04
        JP      Z,L2D62
        CP      $06
        JP      Z,L2D61
        JP      L23EB

L27e4:  DB      $00
        DB      $00
        DB      $00

; Data for MOVE Routine at $2035.
; The next 62 bytes ($27E7-$2824) are moved to RAM beginning at $4E99.
; What are these bytes?  Could these possibly be vector tables? ??
L27E7:  DB      $01
        DB      $20
        DB      $80
        DB      $01
        DB      $00
        DB      $00
        DB      $00
        DB      $0A
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $28
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $2E
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $03
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $20
        DB      $80
        DB      $01
        DB      $00
        DB      $00
        DB      $00
        DB      $8E
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $2C
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $2E
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $03
        DB      $00 
        DB      $00
        DB      $00

;  VECT Limit Table Address
L2825:  DB      0                ; X Lower Limit (Left Edge of Screen)
        DB      150              ; X Upper Limit (Right Edge of Screen)
        DB      0                ; Y Lower Limit (Top of Screen)
        DB      70               ; Y Upper Limit ()

        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        
L282E:  SYSSUK  GETPAR           ;  UPI GET game PARameter from user
        DW      L233B            ;  ... Prompt Address-Gameplay/Training Sector
        DB      $01              ;  ... Digits = 1
        DW      $4F6A            ;  ... Parameter Address
        ;
        SYSSUK  GETPAR           ;  UPI GET game PARameter from user
        DW      NOPLAY           ;  ... Prompt Address 'Number Of PLAYers'
        DB      $01              ;  ... Digits = 1
        DW      $4F6E            ;  ... Parameter Address = 20334
        ;
        RET     

        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $FF
        DB      $1D
        DB      $3C
        DB      $20
        DB      $28
        DB      $14
        DB      $AA
        DB      $FF
        DB      $1D
        DB      $46
        DB      $25
        DB      $14
        DB      $0A
        DB      $55
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00

L2978:  SYSSUK  STRDIS           ;  UPI STRing DISplay
        DB      $28              ;  ... X = 40
        DB      $14              ;  ... Y = 20
        DB      $08              ;  ... Options = 8
        DW      L2DC4            ;  ... String "BLAST DROIDS"
        ;
        SYSSUK  STRDIS           ;  UPI STRing DISplay
        DB      $14              ;  ... X = 20
        DB      $28              ;  ... Y = 40
        DB      $0C              ;  ... Options = 12
        DW      L2DD1            ;  ... String "SECTOR"
        ;
        SYSSUK  DISNUM           ;  UPI DISplay NUMber
        DB      $78              ;  ... X = 120
        DB      $28              ;  ... Y = 40
        DB      $2C              ;  ... Options = 44
        DB      $02              ;  ... Extended = 2
        DW      $4E99            ;  ... Number Address = 20121
        ;
        CALL    L274C
        NOP     
        CALL    L2766
        CALL    L2B6C
        CALL    L2B6C
        CALL    L264E
        CALL    L2766
        CALL    L2B6C
        RET

L29A5:  DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $CD
        DB      $FB
        DB      $29
        DB      $FF
        DB      $21
        DB      $14
        DB      $3C
        DB      $20
        DB      $00
        DB      $2E
        DB      $21
        DB      $B4
        DB      $4E
        DB      $34
        DB      $3A
        DB      $6E
        DB      $4F
        DB      $FE
        DB      $02
        DB      $20
        DB      $0B
        DB      $FF
        DB      $21
        DB      $8C
        DB      $3C
        DB      $20
        DB      $00
        DB      $2E
        DB      $21
        DB      $D3
        DB      $4E
        DB      $34
        DB      $CD
        DB      $66
        DB      $27
        DB      $CD
        DB      $6C
        DB      $2B
        DB      $CD
        DB      $9B
        DB      $29
        DB      $CD
        DB      $6C
        DB      $2B
        DB      $C9
        DB      $00
        DB      $CD
        DB      $66
        DB      $27
        DB      $CD
        DB      $6C
        DB      $2B
        DB      $E1
        DB      $C1
        DB      $F1
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00

L29E6:  DB      "* BONUS *",$00
L29F0:  DB      "EXTRA SHIP",$00

L29FB:  SYSSUK  STRDIS           ;  UPI STRing DISplay
        DB      $08              ;  ... X = 8
        DB      $04              ;  ... Y = 4
        DB      $44              ;  ... Options = 68
        DW      L29E6            ;  ... String "* BONUS *"
        ;
        SYSSUK  STRDIS           ;  UPI STRing DISplay
        DB      $28              ;  ... X = 40
        DB      $28              ;  ... Y = 40
        DB      $0C              ;  ... Options = 12
        DW      L29F0            ;  ... String "EXTRA SHIP" 
        ;
        RET

        DB      $00
        DB      $00
        DB      $00
        DB      $00
        
LFF1D:  SYSSUK  RECTAN           ;  UPI paint a RECTANgle
        DB      20               ;  ... X = 20
        DB      20               ;  ... Y = 20
        DB      120              ;  ... Width = 120
        DB      46               ;  ... Height = 46
        DB      $55              ;  ... Color = 85
        ;
        SYSSUK  RECTAN           ;  UPI paint a RECTANgle
        DB      21               ;  ... X = 21
        DB      21               ;  ... Y = 21
        DB      118              ;  ... Width = 118
        DB      44               ;  ... Height = 44
        DB      $00              ;  ... Color = 0
        ;
        LD      HL,$4E85
        LD      (HL),$08
        CALL    L2B62
        LD      HL,$2EC8
        LD      ($4DBC),HL
        CALL    L25F3
        RET

L2A2E:  DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $FF
        DB      $1D
        DB      $0A
        DB      $0A
        DB      $8C
        DB      $42
        DB      $FF
        DB      $FF
        DB      $1D
        DB      $0C
        DB      $0C
        DB      $88
        DB      $3E
        DB      $00
        DB      $0D
        DB      $62
        DB      $2B
        DB      $21
        DB      $7E
        DB      $4E
        DB      $36
        DB      $10
        DB      $23
        DB      $36
        DB      $8C
        DB      $23
        DB      $36
        DB      $10
        DB      $23
        DB      $36
        DB      $42
        DB      $21
        DB      $85
        DB      $4E
        DB      $00
        DB      $00
        DB      $CD
        DB      $0D
        DB      $26
        DB      $C9
        DB      $CD
        DB      $62
        DB      $2B
        DB      $DD
        DB      $21
        DB      $2A
        DB      $4E
        DB      $DD
        DB      $35
        DB      $04
        DB      $DD
        DB      $34
        DB      $26
        DB      $DD
        DB      $36
        DB      $54
        DB      $00
        DB      $DD
        DB      $36
        DB      $55
        DB      $B4
        DB      $DD
        DB      $36
        DB      $56
        DB      $02
        DB      $DD
        DB      $36
        DB      $57
        DB      $5A
        DB      $DD
        DB      $36
        DB      $5B
        DB      $0E
        DB      $CD
        DB      $17
        DB      $26
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $CD
        DB      $8E
        DB      $27
        DB      $21
        DB      $85
        DB      $4E
        DB      $36
        DB      $01
        DB      $CD
        DB      $62
        DB      $2B
        DB      $3E
        DB      $32
        DB      $32
        DB      $C4
        DB      $4D
        DB      $CD
        DB      $24
        DB      $2D
        DB      $AF
        DB      $32
        DB      $C2
        DB      $4D
        DB      $21
        DB      $04
        DB      $2F
        DB      $22
        DB      $BC
        DB      $4D
        DB      $CD
        DB      $F3
        DB      $25
        DB      $C9
        DB      $00
        DB      $08
        DB      $C4
        DB      $2D
        DB      $FF
        DB      $35
        DB      $3B
        DB      $CD
        DB      $AA
        DB      $29
        DB      $CD
        DB      $5E
        DB      $2A
        DB      $FF
        DB      $1D
        DB      $28
        DB      $28
        DB      $50
        DB      $01
        DB      $55
        DB      $21
        DB      $C4
        DB      $2F
        DB      $22
        DB      $BC
        DB      $4D
        DB      $CD
        DB      $F3
        DB      $25
        DB      $C9
        DB      $00
        DB      $2B
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $06
        DB      $10
        DB      $11
        DB      $00
        DB      $00
        DB      $21
        DB      $42
        DB      $2D
        DB      $3E
        DB      $17
        DB      $CD
        DB      $8E
        DB      $27
        DB      $21
        DB      $85
        DB      $4E
        DB      $36
        DB      $01
        DB      $CD
        DB      $62
        DB      $2B
        DB      $3E
        DB      $32
        DB      $32
        DB      $C4
        DB      $4D
        DB      $CD
        DB      $24
        DB      $2D
        DB      $C9
        DB      $00
        DB      $00
        DB      $36
        DB      $32
        DB      $23
        DB      $36
        DB      $46
        DB      $36
        DB      $64
        DB      $1E
        DB      $23
        DB      $36
        DB      $32
        DB      $C9
        DB      $00
        DB      $FE
        DB      $58
        DB      $20
        DB      $E1
        DB      $CD
        DB      $CD
        DB      $AE
        DB      $2A
        DB      $21
        DB      $F0
        DB      $2E
        DB      $22
        DB      $BC
        DB      $4D
        DB      $CD
        DB      $F3
        DB      $25
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $CD
        DB      $5E
        DB      $2A
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00

L2B2E:  LD      A,($4F6A)
        CP      $02
        JR      NZ,L2B3A
        LD      A,$0A
        LD      ($4E99),A
L2B3A:  LD      A,($4E99)
        NOP     
        LD      B,A
        LD      HL,L29E6         ; String "* BONUS *"
        LD      DE,$0028
L2B45:  ADD     HL,DE
        DJNZ    L2B45
        XOR     A
        LD      A,($4E84)
        JP      (HL)

L2B4D:  DB      $00
        DB      $FF
        DB      $1D
        DB      $50
        DB      $02
        DB      $01
        DB      $50
        DB      $55
        DB      $21
        DB      $DC
        DB      $2E
        DB      $22
        DB      $BC
        DB      $4D
        DB      $CD
        DB      $F3
        DB      $25
        DB      $C9
        DB      $00
        DB      $00
        DB      $00

L2B62:  SYSSUK  MOVE             ;  UPI MOVE block transfer
        DW      $4E2A            ;  ... Destination Address = 20010
        DW      $005A            ;  ... Byte Count = 90
        DW      $2F22            ;  ... Source Address = 12066
        ;
        RET

        DB      $00

L2B6C:  SYSSUK  RECTAN           ;  UPI paint a RECTANgle
        DB      $00              ;  ... X = 0
        DB      $00              ;  ... Y = 0
        DB      $A0              ;  ... Width = 160
        DB      $5A              ;  ... Height = 90
        DB      $00              ;  ... Color = 0
        ;
        RET     

        DB      $00
        DB      $00
        DB      $CD
        DB      $42
        DB      $28
        DB      $00
        DB      $C9
        DB      $00

L2B7C:  LD      A,($4E99)
        CP      $03
        RET     NC

        SYSSUK  RECTAN           ;  UPI paint a RECTANgle
        DB      $02              ;  ... X = 2
        DB      $26              ;  ... Y = 38
        DB      $96              ;  ... Width = 150
        DB      $14              ;  ... Height = 20
        DB      $00              ;  ... Color = 0
        
        NOP     

        SYSSUK  RECTAN           ;  UPI paint a RECTANgle
        DB      $4B              ;  ... X = 75
        DB      $02              ;  ... Y = 2
        DB      $14              ;  ... Width = 20
        DB      $46              ;  ... Height = 70
        DB      $00              ;  ... Color = 0
        ;
        RET

        NOP
        NOP

L2B94:  CALL    L2630
        LD      A,($4EB4)
        AND     A
        JR      NZ,L2BAA
        LD      A,($4F6E)
        CP      $01
        RET     Z

        LD      A,($4ED3)
        AND     A
        JR      NZ,L2BAA
        RET     

L2BAA:  JP      L2045

        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00

; Reset VECTor #1 /  8 / $08
L2BB8:  LD      E,(IX+$08)
        LD      D,(IX+$09)
        DEC     DE
        LD      (IX+$08),E
        LD      (IX+$09),D
        RET     

; Reset VECTor #2 / 16 / $10        
L2BC6:  LD      E,(IX+$08)
        LD      D,(IX+$09)
        INC     DE
        LD      (IX+$08),E
        LD      (IX+$09),D
        RET     

; Reset VECTor #3 / 24 / $18
L2BD4:  LD      E,(IX+$03)
        LD      D,(IX+$04)
        DEC     DE
        LD      (IX+$03),E
        LD      (IX+$04),D
        RET     

; Reset VECTor #4 / 32 / $20
L2BE2:  LD      E,(IX+$03)
        LD      D,(IX+$04)
        INC     DE
        LD      (IX+$03),E
        LD      (IX+$04),D
        RET     

        DB      $00
        DB      $4E
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $3A

;  Color Table
L2BF8:  DB      $FA             ; color 3 Left = 
        DB      $53             ; color 2 Left = 
        DB      $A2             ; color 1 Left = 
        DB      $00             ; color 0 Left = Black
        
        DB      $00

        DB      $53
        DB      $A2
        DB      $00
        DB      $00
        DB      $00

L2C02:  DI      
        LD      A,$08       ; Set Bit 3 of INterrupt MODe (Screen Interrupts Only)        
        OUT     (INMOD),A   ; Port $E, write INterrupt MODe
        LD      A,$4F       ; High Order Byte Address of Interrupt Vector
        LD      I,A
        LD      A,$06       ; Get Low Order Byte Address
        OUT     (INFBK),A   ; Port $D, write INterrupt FeedBacK        
        IM      2
        LD      A,80*2      ; Screen Line
        OUT     (INLIN),A   ; Port $F, write INterrupt LINe
        EI      
        RET

        DB      $F3

L2C18:  LD      A,(IX+$06)
        LD      (HL),A
        INC     HL
        LD      A,(IX+$0B)
        LD      (HL),A
        LD      A,$F0
        OUT     (VOLC),A         ; Port $15, write VOLume of tone C
        LD      A,$3C
        LD      ($4E26),A
        OUT     ($13),A
        DEC     HL
        RET

L2C2E:  DB      $00
        DB      $3A
        DB      $12
        DB      $4E
        DB      $77
        DB      $23

L2C34:  NOP     
        LD      B,$04
        JR      L2C3B
L2C39:  LD      B,$02
L2C3B:  CP      $00
        JR      NZ,L2C42
        INC     HL
        DEC     (HL)
        DEC     HL
L2C42:  CP      $01
        JR      NZ,L2C4A
        INC     (HL)
        INC     HL
        DEC     (HL)
        DEC     HL
L2C4A:  CP      $02
        JR      NZ,L2C4F
        INC     (HL)
L2C4F:  CP      $03
        JR      NZ,L2C57
        INC     (HL)
        INC     HL
        INC     (HL)
        DEC     HL
L2C57:  CP      $04
        JR      NZ,L2C5E
        INC     HL
        INC     (HL)
        DEC     HL
L2C5E:  CP      $05
        JR      NZ,L2C66
        DEC     (HL)
        INC     HL
        INC     (HL)
        DEC     HL
L2C66:  CP      $06
        JR      NZ,L2C6B
        DEC     (HL)
L2C6B:  CP      $07
        JR      NZ,L2C73
        DEC     (HL)
        INC     HL
        DEC     (HL)
        DEC     HL
L2C73:  DJNZ    L2C3B
        CALL    L26D0
        RET

        NOP

L2C7A:  PUSH    HL
        PUSH    DE
        LD      E,(HL)
        INC     HL
        LD      D,(HL)
        LD      HL,L2E84         ; Pattern Address (Bullet)
        LD      A,$20
        SYSTEM  WRITR            ; UPI WRITe RELATIVE
        ;
        POP     DE
        POP     HL
        RET

L2C89:  DB      $00
        DB      $00
        DB      $21
        DB      $79
        DB      $4F
        DB      $5E
        DB      $23
        DB      $56
        DB      $21
        DB      $84
        DB      $2E
        DB      $3E
        DB      $20
        DB      $FF
        DB      $20
        DB      $C9
        DB      $00
        DB      $E5
        DB      $E5
        DB      $21
        DB      $7B
        DB      $4F
        DB      $5E
        DB      $23
        DB      $56
        DB      $21
        DB      $84
        DB      $2E
        DB      $3E
        DB      $20
        DB      $FF
        DB      $20
        DB      $E1
        DB      $C9
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00

L2CB0:  PUSH    BC
        LD      L,(IX+$10)
        LD      H,(IX+$11)
; Write Player's ship explosion        
        SYSTEM  VWRITR           ; UPI Vector WRITe Relative
        ;
        LD      HL,L2825         ; VECT Limit Table Address
        CALL    L26F8
        INC     (IX+$02)
        LD      HL,L2EAA         ; Pattern (Player's Ship, Explosion Frame 3)
        LD      A,(IX+$0F)
        NOP     
        CP      $14
        JR      C,L2CD7
        LD      HL,L2E9A         ; Pattern (Player's Ship, Explosion Frame 2)
        CP      $28
        JR      C,L2CD7
        LD      HL,L2E8C         ; Pattern (Player's Ship, Explosion Frame 1)
L2CD7:  DEC     A
        BIT     0,A
        JR      NZ,L2CDE
        OUT     (COL0R),A        ; Port $00, write COLor 0 Right
L2CDE:  DEC     (IX+$0F)
        POP     BC
        CALL    Z,L2590        
        OUT     (VOLN),A         ; Port $17, write VOLume of Noise
        LD      (IX+$10),L
        LD      (IX+$11),H
        SYSTEM  VWRITR           ;  UPI Vector WRITe Relative
        ;
        JP      L222F

        NOP

L2CF3:  DB      $DD
        DB      $36
        DB      $0F
        DB      $56
        DB      $FF
        DB      $1E
        DB      $21
        DB      $8C
        DB      $2E
        DB      $DD
        DB      $75
        DB      $10
        DB      $DD
        DB      $74
        DB      $11
        DB      $FF
        DB      $1E
        DB      $3E
        DB      $FF
        DB      $D3
        DB      $15
        DB      $00
        DB      $00
        DB      $32
        DB      $25
        DB      $4E
        DB      $3E
        DB      $32
        DB      $D3
        DB      $13
        DB      $C9
        DB      $00
        DB      $1A
        DB      $C9
        DB      $00
        DB      $4E
        DB      $32
        DB      $26
        DB      $4E
        DB      $C9
        DB      $CD
        DB      $62
        DB      $2B
        DB      $21
        DB      $85
        DB      $4E
        DB      $36
        DB      $04
        DB      $00
        DB      $21
        DB      $00
        DB      $00
        DB      $22
        DB      $2D
        DB      $4E
        DB      $22
        DB      $32
        DB      $4E
        DB      $22
        DB      $3E
        DB      $4E
        DB      $22
        DB      $43
        DB      $4E
        DB      $22
        DB      $4F
        DB      $4E
        DB      $22
        DB      $54
        DB      $4E
        DB      $22
        DB      $60
        DB      $4E
        DB      $22
        DB      $65
        DB      $4E
        DB      $C9
        DB      $00
        DB      $00
        DB      $02
        DB      $05
        DB      $08
        DB      $00
        DB      $2E
        DB      $00
        DB      $BF
        DB      $80
        DB      $2E
        DB      $00
        DB      $08
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $35

L2D61:  DEC     (HL)
L2D62:  DEC     (HL)
        DEC     (HL)
        LD      A,(HL)
        CP      $03
        JR      NC,L2D7C
        LD      D,$1C
        LD      HL,$4DC4
        INC     (HL)
        LD      A,(HL)
        LD      E,(HL)
        CP      $6C
        JR      Z,L2D7F
        LD      BC,$0201
        LD      A,$55
        SYSTEM  RECTAN           ;  UPI paint a RECTANgle
        ;
L2D7C:  JP      L23EB

L2D7F:  LD      HL,$4EB4
        LD      A,(HL)
        AND     A
        JR      Z,L2D87
        DEC     (HL)
L2D87:  LD      HL,$4ED3
        LD      A,(HL)
        AND     A
        JR      Z,L2D8F
        DEC     (HL)
L2D8F:  CALL    L25DA
        LD      HL,$4E99
        DEC     (HL)
        JP      L252C

L2D99:  DB      $77
        DB      $0B
        DB      $C9

L2D9C:  SYSSUK  RANGED           ;  UPI RANGED random number
        DB      $50              ;  ... Cutoff = 80
        ;
        ADD     A,$28
        LD      (IX+$06),A
        SYSSUK  RANGED           ;  UPI RANGED random number
        DB      $14              ;  ... Cutoff = 20
        ;
        ADD     A,$14
        LD      (IX+$0B),A
        RET  

L2DAD:  DB      "PLYR  SCORE  SHIPS",$00  

        DB      $00
        DB      $00
        DB      $00
        DB      $00

L2DC4:  DB      "BLAST "
L2DCA:  DB      "DROIDS",$00
L2DD1:  DB      "SECTOR",$00
L2DD8:  DB      "GAME OVER",$00
L2DE2:  DB      "PLAYER LNE",$00

        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00

;  Pattern of Object (Player's Ship, Facing North)
L2E00:  DB      0,1              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00110000B        ; . 3 . .
        DB      00110000B        ; . 3 . . 
        DB      11111100B        ; 3 3 3 . 
        DB      11001100B        ; 3 . 3 . 

;  Pattern of Object (Player's Ship, Facing Northeast)
L2E08:  DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00110011B        ; . 3 . 3 
        DB      11111100B        ; 3 3 3 .
        DB      00001111B        ;. . 3 3
        DB      00001100B        ; . . 3 .

;  Pattern of Object (Player's Ship, Facing East) 
L2E10:  DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      11110000B        ; 3 3 . . 
        DB      00111111B        ; . 3 3 3 
        DB      11110000B        ; 3 3 . . 
        DB      00000000B        ; . . . . 

;  Pattern of Object (Player's Ship, Facing Southeast)
L2E18:  DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00001100B        ; . . 3 . 
        DB      00001111B        ; . . 3 3 
        DB      11111100B        ; 3 3 3 . 
        DB      00110011B        ; . 3 . 3 

;  Pattern of Object (Player's Ship, Facing South)
L2E20:  DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      11001100B        ; 3 . 3 . 
        DB      11111100B        ; 3 3 3 . 
        DB      00110000B        ; . 3 . . 
        DB      00110000B        ; . 3 . . 

;  Pattern of Object (Player's Ship, Facing Southwest)
L2E28:  DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00110000B        ; . 3 . . 
        DB      11110000B        ; 3 3 . . 
        DB      00111111B        ; . 3 3 3 
        DB      11001100B        ; 3 . 3 . 

;  Pattern of Object (Player's Ship, Facing West) 
L2E30:  DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00001111B        ; . . 3 3 
        DB      11111100B        ; 3 3 3 . 
        DB      00001111B        ; . . 3 3 
        DB      00000000B        ; . . . . 

;  Pattern of Object (Player's Ship, Facing Northwest) 
L2E38:  DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      11001100B        ; 3 . 3 . 
        DB      00111111B        ; . 3 3 3 
        DB      11110000B        ; 3 3 . . 
        DB      00110000B        ; . 3 . . 

        DB      $00,$00

;  Pattern of Object (Player's Ship, Facing North with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00110000B        ; . 3 . . 
        DB      00110000B        ; . 3 . . 
        DB      11101100B        ; 3 2 3 . 
        DB      01100100B        ; 1 2 1 . 

;  Pattern of Object (Player's Ship, Facing Northeast with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00110011B        ; . 3 . 3 
        DB      01001100B        ; 1 . 3 . 
        DB      00100011B        ; . 2 . 3 
        DB      10000100B        ; 2 . 1 . 

;  Pattern of Object (Player's Ship, Facing East with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      01110000B        ; 1 3 . . 
        DB      10101111B        ; 2 2 3 3 
        DB      01110000B        ; 1 3 . . 
        DB      00000000B        ; . . . . 

;  Pattern of Object (Player's Ship, Facing Southeast with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      10000100B        ; 2 . 1 . 
        DB      00100011B        ; . 2 . 3 
        DB      01001100B        ; 1 . 3 . 
        DB      00110011B        ; . 3 . 3 

;  Pattern of Object (Player's Ship, Facing South with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      01100100B        ; 1 2 1 . 
        DB      11101100B        ; 3 2 3 . 
        DB      00110000B        ; . 3 . . 
        DB      00110000B        ; . 3 . . 

;  Pattern of Object (Player's Ship, Facing Southwest with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00010010B        ; . 1 . 2 
        DB      11001000B        ; 3 . 2 . 
        DB      00110001B        ; . 3 . 1 
        DB      11001100B        ; 3 . 3 . 

;  Pattern of Object (Player's Ship, Facing West with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      00001101B        ; . . 3 1 
        DB      11111010B        ; 3 3 2 2 
        DB      00001101B        ; . . 3 1 
        DB      00000000B        ; . . . . 

;  Pattern of Object (Player's Ship, Facing Northwest with flame exhaust)
        DB      0,0              ; X,Y Displacement
        DB      1,4              ; X, Y Size
        DB      11001100B        ; 3 . 3 . 
        DB      00110001B        ; . 3 . 1 
        DB      11001000B        ; 3 . 2 . 
        DB      00010010B        ; . 1 . 2

        DB      $00,$00
 
; Pattern Address (Bullet)
L2E84:  DB      1,2                   ; X,Y Displacement
        DB      1,1                   ; X, Y Size
        DB      10000000B             ; 2 . . . 
        
        DB      $00,$00,$00

; Pattern (Player's Ship, Explosion Frame 1) 
L2E8C:  DB      0,0                   ; X,Y Displacement
        DB      2,5                   ; X, Y Size
        DB      00001000B,00000000B   ; . . 2 . . . . . 
        DB      00001000B,00000000B   ; . . 2 . . . . . 
        DB      00010101B,00000000B   ; . 1 1 1 . . . . 
        DB      10100110B,10000000B   ; 2 2 1 2 2 . . . 
        DB      10010101B,10000000B   ; 2 1 1 1 2 . . . 

; Pattern (Player's Ship, Explosion Frame 2)       
L2E9A:  DB      0,0                   ; X,Y Displacement
        DB      2,6                   ; X, Y Size
        DB      00001010B,00000000B   ; . . 2 2 . . . . 
        DB      00000101B,00000000B   ; . . 1 1 . . . . 
        DB      00011001B,01000000B   ; . 1 2 1 1 . . . 
        DB      00010110B,01101000B   ; . 1 1 2 1 2 2 . 
        DB      10000100B,00011000B   ; 2 . 1 . . 1 2 . 
        DB      10100000B,10000000B   ; 2 2 . . 2 . . . 

; Pattern (Player's Ship, Explosion Frame 3)
L2EAA:  DB      0,0                   ; X,Y Displacement
        DB      2,8                   ; X, Y Size
        DB      00000011B,00000000B   ; . . . 3 . . . . 
        DB      00000011B,00000011B   ; . . . 3 . . . 3 
        DB      11000000B,00000000B   ; 3 . . . . . . . 
        DB      00000000B,00000000B   ; . . . . . . . . 
        DB      00000000B,00001100B   ; . . . . . . 3 . 
        DB      00000011B,00001111B   ; . . . 3 . . 3 3 
        DB      00110000B,00000000B   ; . 3 . . . . . . 
        DB      11110000B,00000000B   ; 3 3 . . . . . . 

        DB      $00,$00,$00,$00,$00,$00,$00,$00        
        DB      $00,$00

; Pattern (Droid, UFO Ship)
;         The UFO is first used on Sector 1
L2EC8:  DB      0,0                   ; X,Y Displacement
        DB      2,3                   ; X, Y Size
        DB      00101010B,10101000B   ; . 2 2 2 2 2 2 . 
        DB      10010101B,01010110B   ; 2 1 1 1 1 1 1 2 
        DB      00101010B,10101000B   ; . 2 2 2 2 2 2 . 

        DB      $00
        DB      $F8
        DB      $9D
        DB      $76
        DB      $2F
        DB      $F8
        DB      $1A
        DB      $C1
        DB      $50
        DB      $05

; Pattern (Droid, Square Satellite)
;         The Satellite is first used on Sector 2
L2EDC:  DB      0,0                   ; X,Y Displacement
        DB      2,8                   ; X, Y Size
        DB      10101000B,00101010B   ; 2 2 2 . . 2 2 2 
        DB      10000001B,01000010B   ; 2 . . 1 1 . . 2 
        DB      10000111B,11010010B   ; 2 . 1 3 3 1 . 2 
        DB      10011111B,11110110B   ; 2 1 3 3 3 3 1 2 
        DB      10011111B,11110110B   ; 2 1 3 3 3 3 1 2 
        DB      10000111B,11010010B   ; 2 . 1 3 3 1 . 2 
        DB      10000001B,01000010B   ; 2 . . 1 1 . . 2 
        DB      10101000B,00101010B   ; 2 2 2 . . 2 2 2 

; Pattern (Droid, "Barrel" Droid)
;         The "Barrel" droid is first used on Sector 7
L2EF0:  DB      0,0                   ; X,Y Displacement
        DB      2,7                   ; X, Y Size
        DB      10101010B,10101010B   ; 2 2 2 2 2 2 2 2 
        DB      00001111B,11110000B   ; . . 3 3 3 3 . . 
        DB      00111101B,01111100B   ; . 3 3 1 1 3 3 . 
        DB      11111101B,01111111B   ; 3 3 3 1 1 3 3 3 
        DB      00111101B,01111100B   ; . 3 3 1 1 3 3 . 
        DB      00001111B,11110000B   ; . . 3 3 3 3 . . 
        DB      10101010B,10101010B   ; 2 2 2 2 2 2 2 2  

        DB      $00,$00

; Pattern (Droid, "Bomb" Droid)
;         The "Bomb" Droid is first used on Sector 4 (the "Space Fortress")
L2F04:  DB      0,0                   ; X,Y Displacement
        DB      2,8                   ; X, Y Size
        DB      00001010B,10000000B   ; . . 2 2 2 . . . 
        DB      00001011B,10000000B   ; . . 2 3 2 . . . 
        DB      00101011B,10100000B   ; . 2 2 3 2 2 . . 
        DB      10111111B,11111000B   ; 2 3 3 3 3 3 2 . 
        DB      10010101B,01011000B   ; 2 1 1 1 1 1 2 . 
        DB      10111111B,11111000B   ; 2 3 3 3 3 3 2 . 
        DB      00101001B,10100000B   ; . 2 2 1 2 2 . . 
        DB      00001001B,10000000B   ; . . 2 1 2 . . . 

        DB      $00
        DB      $00
        DB      $00
        DB      $40
        DB      $00
        DB      $01
        DB      $10
        DB      $00
        DB      $00
        DB      $40

; Data for MOVE Routine at $203C (and various other locations)
; The next 95 bytes ($2F22-$????) are moved to RAM beginning at $4E2A.
; What are these bytes?  Could these possibly be vector tables? ??
L2F22:  DB      $20
        DB      $80
        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $36
        DB      $03
        DB      $96
        DB      $00 ; 10

        DB      $00 
        DB      $1E
        DB      $03
        DB      $C8
        DB      $2E
        DB      $00
        DB      $00
        DB      $20
        DB      $80
        DB      $00 ; 20

        DB      $64
        DB      $00
        DB      $00
        DB      $5A
        DB      $03
        DB      $3C
        DB      $00
        DB      $00
        DB      $1E
        DB      $03 ; 30

        DB      $C8
        DB      $2E
        DB      $00
        DB      $00
        DB      $20
        DB      $80
        DB      $00
        DB      $96
        DB      $FE
        DB      $00 ; 40

        DB      $36
        DB      $03
        DB      $50
        DB      $00
        DB      $00
        DB      $28
        DB      $03
        DB      $C8
        DB      $2E
        DB      $00 ; 50

        DB      $00
        DB      $20
        DB      $80
        DB      $00
        DB      $14
        DB      $01
        DB      $00
        DB      $5A
        DB      $03
        DB      $32 ;60

        DB      $00
        DB      $00
        DB      $28
        DB      $03
        DB      $C8
        DB      $2E
        DB      $00
        DB      $00
        DB      $20
        DB      $80 ; 70

        DB      $00
        DB      $00
        DB      $00
        DB      $1E
        DB      $03
        DB      $64
        DB      $00
        DB      $00
        DB      $14
        DB      $03 ; 80

        DB      $8C
        DB      $2E
        DB      $00
        DB      $00
        DB      $1A
        DB      $78
        DB      $18
        DB      $38        
        DB      $00
        DB      $00 ; 90

        DB      $00
        DB      $00
        DB      $00
        DB      $00
        DB      $00 ; 95
        
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00,$00

; Pattern (Droid, Explosion)
L2FA4:  DB      0,0                   ; X,Y Displacement
        DB      2,8                   ; X, Y Size  
        DB      10000000B,11000000B   ; 2 . . . 3 . . .
        DB      00000100B,01000000B   ; . . 1 . 1 . . .
        DB      01000000B,00100001B   ; 1 . . . . 2 . 1
        DB      00000110B,00000000B   ; . . 1 2 . . . .
        DB      00100000B,11000100B   ; . 2 . . 3 . 1 .
        DB      00000100B,00110000B   ; . . 1 . . 3 . .
        DB      00010010B,00000000B   ; . 1 . 2 . . . .
        DB      00001000B,00000100B   ; . . 2 . . . 1 .

; Is this a Pattern ??
L2FB8:  DB      0,0                   ; X,Y Displacement
        DB      2,4                   ; X, Y Size  
        DB      10000000B,10011011B   ; 2 . . . 2 1 2 3 
        DB      10001111B,00100000B   ; 2 . 3 3 . 2 . . 
        DB      10001111B,00100000B   ; 2 . 3 3 . 2 . . 
        DB      10000000B,10000000B   ; 2 . . . 2 . . . 

; Pattern (Droid, "Bow Tie" Droid)
;         The "Bow Tie" droid is first used on Sector 5
L2FC4:  DB      0,0                   ; X,Y Displacement
        DB      2,8                   ; X, Y Size
        DB      10000000B,00000011B   ; 2 . . . . . . 3 
        DB      11100000B,00001110B   ; 3 2 . . . . 3 2 
        DB      10111001B,01111011B   ; 2 3 2 1 1 3 2 3 
        DB      11101101B,01101110B   ; 3 2 3 1 1 2 3 2 
        DB      10111001B,01111011B   ; 2 3 2 1 1 3 2 3 
        DB      11101101B,00101110B   ; 3 2 3 1 . 2 3 2 
        DB      10110000B,00001011B   ; 2 3 . . . . 2 3 
        DB      11000000B,00000010B   ; 3 . . . . . . 2 

        DB      $00,$00,$00,$00,$00,$00,$00,$00
        
; Pattern (Droid, "Barbell" Droid)
;         The "Barbell" droid is first used on Sector 3
L2FE0:  DB      0,0                   ; X,Y Displacement
        DB      3,6                   ; X, Y Size
        DB      00111100B,00000000B,11110000B ; . 3 3 . . . . . 3 3 . .
        DB      11010111B,00000011B,01011100B ; 3 1 1 3 . . . 3 1 1 3 .
        DB      11010111B,10101011B,01011100B ; 3 1 1 3 2 2 2 3 1 1 3 .
        DB      11010111B,10101011B,01011100B ; 3 1 1 3 2 2 2 3 1 1 3 .
        DB      11010111B,00000011B,01011100B ; 3 1 1 3 . . . 3 1 1 3 .
        DB      00111100B,00000000B,11110000B ; . 3 3 . . . . . 3 3 . .

        DB      $00,$00,$00,$00,$00,$00,$00,$00
        DB      $00,$00

End     ; 

Instructions from Blast Droids Manual
-------------------------------------

SPECTRECADE Presents Blast Droids (c) Mfg. & Dist. By Esoterica, Inc.

Intergalactic Stardate
3939

From: Chief of Operations
      Spectrecade School for Intergalactic Space Pilots, Inc.

To:   All Future Star Pilots

Dear Prospective Intergalactic Space Pilot,

The Spectrecade School for Intergalactic Space Pilots is pleased to announce
that you have passed our entrance exam with flying (ha, ha) colors and have
been accepted for our Home Study Course I. This program consists of:

1. Four lessons in "Ship Maneuvering I," after which you will

2. Solo in the training sector (perhaps alongside another new cadet)
   followed by

3. Your first real mission. We sincerely hope it will not be your last.

Successful completion of this Home Study Course will earn you fame (for
fortune you need to take the more expensive Home Study Course II) and your
name will be ranked with the late Buck Rodgers and Flash Gorgon.

Ship Maneuvering I

Lesson I. This ship is only capable of forward thrust. To fire thrusters
push joystick forward. For delicate maneuvering short thrusts are required.
Hold stick forward for additional speed and quickness.

To fire thrusters, push joystick __________.
Answer this question correctly and move to Lesson II.

Lesson II. To change heading push stick to the right or left.

Pushing the joystick to the right or left will change __________.
Answer this question correctly and move on to Lesson III.

Lesson III. To achieve a braking action while ship is in motion you must
first reverse your heading and then fire thruster until ship comes to a
stop or reverses momentum.

To achieve a braking action first change __________ and then
fire __________.
Answer this question correctly and move to Lesson IV.

Lesson IV. To fire bullets pull the trigger.

Pulling the trigger will fire the __________.
Answer this question correctly and move on to the training sector.

The Training Sector

This sector is designed to test your knowledge of Lessons I thru IV. Some
of our graduates, because of overinflated egos and overestimated confidence,
have opted to skip this phase of their training. While we point out that
you also have this option (enter Training Sector or game play from hand
control or keypad), these so-called pilots have not been heard from since.

In this sector you will be given the option of flying alongside a fellow
cadet. (Enter number of players off keypad or hand control.) Each player
will be given 3 ships as a test of their ability. Each player must avoid
the Barrier in the center of the screen. "Accidentally" shooting your
opponent may be grounds for dismissal. (So, if you shoot him, be sure it's
on purpose). YOU ARE NOW READY FOR YOUR FIRST MISSION.

Mission Impossible

Android space ships have begun building force fields in deep space. Your
job, should you choose to accept it, is to seek out and eliminate these
alien intruders.

Before each sector begins the screen will display the number of ships
you have remaining and the number of droids you must shoot to go on to
the next sector.

In each sector you will encounter several android spaceships guarding
force fields in various stages of construction. Each player must avoid
contact with all droids, force fields, bullets and his opponent's ship.

In sector 1 and 2, the droids are confined inside the force fields. After
this, they will begin to wrap around so every angle must be watched
carefully. In sectors 4 and 6, the droids have retreated to their space
fortress located in the center of a maze. Players must maneuver the maze
and shoot one droid before the door of their fortress shuts. Successful
completion of this task, by either player, results in a bonus ship for
both. Failure results in a loss of a ship.

We know that you have learned your lessons well and feel confident that
you will succeed. We regret, however, that we cannot be with you.

Scoring

Each droid is worth 50 points times its sector number. So that you may
evaluate your progress, we have provided you with the following
comparison chart.

     0 - 5,000  - Go directly to Lesson I. Do not pass the Training
                  sector.  Do not collect a bonus ship.

 5,000 - 15,000 - Return to the Training Sector. You are not quite
                  ready for the big time.

15,000 - 40,000 - You are now a Class II Pilot, but your endurance
                  is suspect.

40,000 - 90,000 - As this score shows, when your number 2 you
                  try harder.

90,000 and over - It's Diploma time! You are now promoted to Supreme
                  Allied Commander of the Spectrecade Intergalactic
                  Space Pilots.
                  
- Chief of Operations
