; Bally Astrocade 'Dogpatch' - ZMAC Version
; Hand/dz80 disassembly      - Adam Trionfo 
; Version 1.34               - Nov. 30, 2003
;
; Version .01 - November 12, 2001
; 
; This disassembly has a LONG way to go, however...
; when this is assembled it IS 100% the same as
; the actual Dogpatch cartridge. 
;
; Assemble with Zmac, the Z80 cross-assembler:
;
; zmac -i -m -o <outfile> -x <listfile> <filename>
; 
; For example, to assemble this Astrocade Z-80 program:
;
; zmac -i -m -o dogdis.bin -x dogdis.lst dogdis.asm

INCLUDE "HVGLIB.H"

        ORG   FIRSTC      ; First Byte of cartridge

  ; All cartridges that use the menu must have $55 as the
  ; first byte, see Bally ROM source $0CDE for check of
  ; this byte.  A capital "U" is $55.
  
        DB    "U"         ; User Cartridge Sentinel
  
  ; O.S. Menu data structure
  
        DW    MENUST      ; Next menu link
        DW    DOGSTR      ; Address of menu text 
        DW    START       ; Jump here is item selected
  
  ; Start of Dogpatch Main Program
  
START   SYSSUK GETPAR     ; Get Option/Menu Selection
        DW    PROMPT      ; Prompt - '# of cans'
        DB    $82         ; Digits (How does this work?)
        DW    ENDSCR      ; Parameter - Variable Address
                          ; End Score = # of Cans

        LD    SP,$4FA0    ; Load SP (but why with this?)

  ; Color, Horizontal and Vertical blanking setup
  ;    - Vertical Blank starts on line 180
  ;    - Horizontal Color Boundary is 31 
  ;    - Background Color is 11 binary [this is what?]
  ; DNA manual page 88 has lots of details on this section

        LD    HL,COLTBL   ; Start add. of 8 bytes to send to
                          ; color reg. 
        LD    B,$08       ; Set for OTIR instruction
        LD    C,$0B       ; Setup for OTIR instruction
        OTIR              ; Reset color registers
        LD    A,$B4       ; Load A with screen num for Vert
                          ; Blank start
        OUT   (VERBL),A   ; Start Vertical blank on
                          ; line 90 (180/2)
        LD    A,$CF 
        OUT   (HORCB),A   ; Horizontal Color Boundary 

        SYSSUK FILL
        DW    NORMEM      ; Top of screen
        DW    $0E50       ; Fill for 3664 bytes
        DB    $00         ; Fill with zeroes

  ; I don't follow this yet.  What is it doing?  I think
  ; it's making room for variables in the purple (hidden)
  ; area of the screen (?)
        LD    A,$B4       ; 180 dec.
        OUT   (INLIN),A   ; Interrupt Line
        LD    A,$80       ; 128 dec.
        LD    ($4E11),A   ; $4E11 now holds $80

  ; Load Registers for Loop
        LD    C,$20
        LD    DE,$000D 
        LD    A,$01
        LD    B,$03 
        LD    IX,$4E10    ; IX holds $4E10

  ; Loop to fill RAM areas.  Loop runs 8 times.
LOOP1:  LD    (IX+$00),C  ; Put $20 in IX
        LD    (IX+$02),A  ; Put $01 in IX 
        LD    (IX+$07),A  ; Put $01 in IX 
        LD    (IX+$0C),A  ; Put $01 in IX 
        ADD   IX,DE       ; IX  + $000D
        DJNZ  LOOP1       ; Decrement B (is it 0?)

  ; Display top of Player 1
        SYSSUK WRIT       ; Screen Write
        DB    $04         ; X coordinate
        DB    $40         ; Y coordinate
        DB    $03         ; X Pattern Size
        DB    $18         ; Y Pattern Size
        DB    $00         ; Magic Register
        DW    PLAY1T      ; Pattern Address of
                          ; Player One Top

  ; Display top of Player 2
        SYSSUK WRIT       ; Screen Write
        DB    $90         ; X coordinate
        DB    $40         ; Y coordinate
        DB    $03         ; X Pattern Size
        DB    $18         ; Y Pattern Size
        DB    $00         ; Magic Register
        DW    PLAY2T      ; Pattern Address of
                          ; Player Two Top

  ; Display top of Computer "Can Tosser"
        SYSSUK WRIT       ; Screen Write
        DB    $50         ; X co-ordinate
        DB    $4A         ; Y co-ordinate
        DB    $02         ; X Pattern Size
        DB    $10         ; Y Pattern Size
        DB    $00         ; Magic Register
        DW    COMPT       ; Pattern Address of
                          ; Computer Top

        LD    A,(ENDSCR)  ; Place # of Cans into A
        OR    A           ; OR A with A
        JR    NZ,$20CA    ; Jump on Not Zero (+$5a)
        LD    HL,($4E45)
        LD    DE,($4E47)
        OR    A           ; OR A with A
        SBC   HL,DE
        JR    Z,$208D     ; Jump on Zero - (+$11)
        JR    NC,$2082    ; (+$04)
        LD    E,$66       ; $66 into E
        JR    $2084       ; (+$02)

; Display "Winner"
        LD    E,$0A       ; Coordinates 
        LD    D,$32       ; Coordinates
        LD    C,$0C       ; Standard Options
        LD    HL,WINNER   ; "Winner" text address
        SYSTEM STRDIS     ; Display "Winner"

        CALL  PRNTOV      ; "Game Over, Boys" Routine

        LD    HL,CT1      ; Count Timer 1
        LD    A,$FF
        LD    (HL),A
L001:   LD    A,(HL)
        OR    A
        JR    NZ,L001     ; $FC (-$04)
        LD    HL,$3000
L003:   LD    B,$08
        LD    C,$10
L002:   IN    A,(C)
        AND   $3F
        JP    NZ,$0000
        INC   C
        DJNZ  L002        ; $F6 (-$10)
        LD    A,(CT1)
        OR    A
        JR    NZ,L003     ; $EC (-$20)
        LD    A,L
        OR    H
        JR    NZ,L004     ; $0D (+$13)
        LD    A,$00
        LD    B,$08
        LD    C,$00
L005    OUT   (C),A
        INC   C
        DJNZ  L005        ; $FB (-$05)
        JR    L003        ; $DB (-$37)
L004:   LD    A,$01
        LD    (CT1),A
        DEC   HL
        JR    L003        ; $D3 (-$45)
        LD    A,(ENDSCR)
        DEC   A
        DAA
        LD    (ENDSCR),A

  ; Display # of Cans left
        SYSSUK DISNUM     ; Display BCD number
        DB    $39         ; X
        DB    $50         ; Y
        DB    $0C         ; Options
        DB    $82         ; Extended options
        DW    ENDSCR      ; Number address

        CALL  $23BA
        CALL  $244C
        LD    HL,$2546
        CALL  $2336
        LD    B,$14
L009    EXX
        CALL  $2455
        CALL  $23BA
        EXX
        DJNZ  L009        ; $F6 (-$10)
        
        SYSSUK RECTAN     ; Paint rectangle
        DB    $18         ; X co-ordinate
        DB    $14         ; Y co-ordinate
        DB    $78         ; X size
        DB    $08         ; Y size
        DB    $00         ; Color Mask

        LD    HL,$254E
        CALL  $2336
        LD    B,$02
L006:   EXX     
        CALL  $23BA
        EXX     
        DJNZ  L006        ; $F9 (-$07)

        LD    HL,$2556
        CALL  $2336
        LD    B,$02
L007:   EXX     
        CALL  $23BA
        EXX     
        DJNZ  L007        ; $F9 (-$07)

        LD    HL,$255E
        CALL  $2336
        EI      
        LD    A,$FC
        LD    ($4E19),A
        LD    A,$4D
        LD    ($4E16),A
        LD    A,$44
        LD    ($4E1B),A
        CALL  $2466
        XOR   A
        LD    ($4E44),A
L008:   LD    A,(CT1)
        NOP     
        OR    A
        JR    NZ,L008     ; $F9 (-$07)
        LD    A,$01
        LD    (CT1),A
        CALL  $2466
        LD    A,($4E43)
        INC   A
        LD    ($4E43),A
        BIT   0,A
        JP    NZ,$21B0

        LD    HL,$2640    ; Limit table
        LD    IX,$4E10    ; Vector Address
        SYSTEM (VECT)     ; Vector Object in two dim.

        CALL  $227E
        LD    A,($4E1C)
        BIT   3,A
        JR    Z,L216B     ; (+$09)
        XOR   A
        LD    ($4E14),A
        CALL  $22A1       ; Begin Music Subroutine
        JR    L218A       ; (+$1F)
L216B:  LD    A,($4E17)
        BIT   3,A
        JR    Z,L21B0     ; (+$3E)
        LD    A,($4E16)
        CP    $50
        JR    C,L21A7     ; (+$2E)
        CALL  $2342
        LD    IX,$4E45
L2180:  LD    A,($4E44)
        LD    D,A
        CALL  $2369
        CALL  $2290
L218A:  XOR   A
        LD    ($4E44),A
        CALL  $237F
        CALL  $22AD
        CALL  $22B6
        XOR   A
        LD    ($4E37),A
        LD    ($4E38),A
        LD    ($4E1E),A
        LD    ($4E2B),A
        JP    $206A
L21A7:  CALL  $234B
        LD    IX,$4E47
        JR    L2180       ; (-$30)
L21B0:  CALL  $2466
        CALL  $23BA
        LD    B,$02
        LD    IX,$4E37
        LD    IY,$4E1E
        IN    A,($10)
L21C2:  BIT   4,A
        JP    Z,L21E4
        LD    A,(IX+$07)
        OR    A
        JP    NZ,L21E8
        INC   (IX+$07)
        BIT   7,(IY+$00)
        JR    NZ,L21E8    ; (+$11)
        SET   7,(IY+$00)
        LD    (IX+$00),$00
  ; Call Sound Effect from Gunfight
        CALL  $1885
        JR    L21E8       ; (+$04)
L21E4:  LD    (IX+$07),$00
L21E8:  DEC   B
        JP    Z,L21F7
        LD    DE,$000D
        ADD   IY,DE
        INC   IX
        IN    A,($11)
        JR    L21C2       ; (-$35)
L21F7:  CALL  $22AD

        LD    HL,$268F    ; Limit table 
        LD    IX,$4E1D    ; Vector Address
        SYSTEM  (VECT)    ; Vector Object in two dim.

        DB   $FD
        DB   $21
        DB   $AD
        DB   $22
        DB   $21
        DB   $37
        DB   $4E
        DB   $DD
        DB   $21
        DB   $1D
        DB   $4E
        DB   $CD
        DB   $98
        DB   $23
        DB   $3A
        DB   $1E
        DB   $4E
        DB   $CB
        DB   $7F
        DB   $28
        DB   $20
        DB   $16
        DB   $FF
        DB   $3A
        DB   $23
        DB   $4E
        DB   $47
        DB   $3A
        DB   $28
        DB   $4E
        DB   $CD
        DB   $0E
        DB   $23
        DB   $CB
        DB   $7A
        DB   $20
        DB   $10
        DB   $CD
        DB   $C5
        DB   $22
        DB   $CD
        DB   $AD
        DB   $22
        DB   $CD
        DB   $59
        DB   $23
        DB   $AF
        DB   $32
        DB   $1E
        DB   $4E
        DB   $32
        DB   $37
        DB   $4E
        DB   $CD
        DB   $B6
        DB   $22
        DB   $21
        DB   $AF
        DB   $26
        DB   $DD
        DB   $21
        DB   $2A
        DB   $4E
        DB   $FF
        DB   $3E
        DB   $DD
        DB   $21
        DB   $2A
        DB   $4E
        DB   $21
        DB   $38
        DB   $4E
        DB   $FD
        DB   $21
        DB   $B6
        DB   $22
        DB   $CD
        DB   $98
        DB   $23
        DB   $3A
        DB   $2B
        DB   $4E
        DB   $CB
        DB   $7F
        DB   $CA
        DB   $34
        DB   $21
        DB   $16
        DB   $FF
        DB   $3A
        DB   $30
        DB   $4E
        DB   $47
        DB   $3A
        DB   $35
        DB   $4E
        DB   $CD
        DB   $0E
        DB   $23
        DB   $CB
        DB   $7A
        DB   $C2
        DB   $34
        DB   $21
        DB   $CD
        DB   $D5
        DB   $22
        DB   $CD
        DB   $B6
        DB   $22
        DB   $CD
        DB   $61
        DB   $23
        DB   $AF
        DB   $32
        DB   $2B
        DB   $4E
        DB   $32
        DB   $38
        DB   $4E
        DB   $C3
        DB   $34
        DB   $21

        LD      HL,($4E18)
        LD      A,($4E1B)
        LD      B,A
        LD      A,$50
        SUB     B
        LD      E,A
        LD      D,$00
        ADD     HL,DE
        LD      ($4E18),HL
        RET     

  ; Start Music Routine #1
  ; Called from $2187
        LD    HL,$247F    ; Music Score Address
        JR    SKIP01
        LD    HL,$2475    ; Music Score Address
SKIP01  LD    A,$0C       ; Voices to Start With
        LD    IX,$4F12    ; Music SP
        SYSTEM BMUSIC
        RET

  ; Start Music Routine #2
  ; Called from $2166
        LD   HL,$248B     ; Music Score Address
        LD   IX,$4F12     ; Music SP
        LD   A,$FE        ; Voices to Start With
        SYSTEM BMUSIC
        RET

  ; Called from $21F7
        LD   A,($4E37)
        LD   IX,$4E1D
        JR   SKIP02

  ; VWRITR Routine #1
  ; Called from $2194
        LD    A,($4E38)
        LD    IX,$4E2A    ; Vector Address
SKIP02  OR    A
        RET   Z
        LD    HL,$2745    ; Pattern Address
        SYSTEM VWRITR
        RET

        DB   $11
        DB   $80
        DB   $00
        DB   $21
        DB   $00
        DB   $01
        DB   $3A
        DB   $16
        DB   $4E
        DB   $D6
        DB   $A0
        DB   $ED
        DB   $44
        DB   $C3
        DB   $DE
        DB   $22
        DB   $11
        DB   $80
        DB   $FF
        DB   $21
        DB   $00
        DB   $FF
        DB   $3A
        DB   $16
        DB   $4E
        DB   $FE
        DB   $1E
        DB   $38
        DB   $05
        DB   $19
        DB   $D6
        DB   $1E
        DB   $18
        DB   $F9
        DB   $22
        DB   $13
        DB   $4E
        DB   $3A
        DB   $44
        DB   $4E
        DB   $3C
        DB   $B7
        DB   $27
        DB   $32
        DB   $44
        DB   $4E
        DB   $CD
        DB   $95
        DB   $22
        DB   $11
        DB   $80
        DB   $FF
        DB   $21
        DB   $00
        DB   $FF
        DB   $3A
        DB   $1B
        DB   $4E
        DB   $FE
        DB   $14
        DB   $DA
        DB   $0A
        DB   $23
        DB   $19
        DB   $D6
        DB   $14
        DB   $C3
        DB   $01
        DB   $23
        DB   $22
        DB   $18
        DB   $4E
        DB   $C9
        DB   $4F
        DB   $3A
        DB   $16
        DB   $4E
        DB   $90
        DB   $FA
        DB   $1C
        DB   $23
        DB   $FE
        DB   $06
        DB   $D0
        DB   $C3
        DB   $21
        DB   $23
        DB   $ED
        DB   $44
        DB   $FE
        DB   $06
        DB   $D0
        DB   $3A
        DB   $1B
        DB   $4E
        DB   $91
        DB   $FA
        DB   $2E
        DB   $23
        DB   $FE
        DB   $06
        DB   $D0
        DB   $C3
        DB   $33
        DB   $23
        DB   $ED
        DB   $44
        DB   $FE
        DB   $06
        DB   $D0
        DB   $16
        DB   $00
        DB   $C9

  ; Misc. Routine
  ; Called from $20E3
        XOR   A
        LD    B,$08       ; Y Pattern Size
        LD    C,$01       ; X Pattern Size
        LD    D,$4A       ; Y Coordinate
        LD    E,$4B       ; X Coordinate
        SYSTEM WRIT
        RET

  ; Misc. Routine #1
  ; Called from $2179
        LD    HL,$FF80
        LD    IX,$4E45
        JR    SKIP03

  ; Misc. Routine #2
  ; Called from $21A7
        LD    HL,$0080
        LD    IX,$4E47
SKIP03  LD    ($4E13),HL        
        LD    D,$10
        JR    L2369       ; (+$10)
        LD    IX,$4E45
        LD    D,$01
        JR    L2369       ; (+$08)
        LD    IX,$4E47
        LD    D,$01
        JR    L2369       ; (+$00)
L2369:  LD    L,(IX+$00)
        LD    H,(IX+$01)
        LD    A,L
        OR    A
        ADC   A,D
        DAA     
        LD    L,A
        LD    A,$00
        ADC   A,H
        DAA     
        LD    H,A
        LD    (IX+$00),L
        LD    (IX+$01),H

  ; Display Routine #1
  ; Called from $218E
        SYSSUK DISNUM
        DB   $0F          ; X
        DB   $03          ; Y
        DB   $04          ; Options
        DB   $84          ; Extended Options
        DW   $4E45        ; Number Address

        SYSSUK DISNUM
        DB   $70          ; X 
        DB   $03          ; Y
        DB   $04          ; Options
        DB   $84          ; Extended Options
        DW   $4E47        ; Number Address

        SYSSUK DISNUM
        DB   $48          ; X 
        DB   $08          ; Y
        DB   $0C          ; Options
        DB   $82          ; Extended Options
        DW   $4E44        ; Number Address
        
        RET

  ; Misc. Routine #2
        LD      (IX+$02),$01
        BIT     3,(IX+$07)
        JP      NZ,L23B3
        BIT     3,(IX+$0C)
        JP      NZ,L23B3
        BIT     7,(IX+$01)
        RET     Z
        LD      (HL),$01
        JP      (IY)
L23B3:  LD      (IX+$01),$00
        LD      (HL),$00
        RET     

  ; Misc. Routine #3
  ; Called from $21B3
        IN      A,(POT0)
        AND     $E0
        LD      HL,$4E39
        CP      (HL)
        JR      Z,L23E4                 ; (+$20)
        LD      (HL),A
        INC     HL
        RRCA    
        RRCA    
        LD      (HL),A
        XOR     A
        LD      B,$0C
        LD      C,$0C
        LD      D,$40
        LD      E,$0D
        SYSTEM RECTAN
        LD      A,($4E39)
        LD      E,A
        XOR     A
        LD      D,A
        LD      HL,$2566
        ADD     HL,DE
        LD      D,$40
        LD      E,$0D
        SYSTEM WRITR
L23E4   LD      A,($4E1E)
        BIT     7,A
        JR      NZ,L2403                ; (+$18)
        LD      A,($4E3A)
        LD      BC,$0004
        LD      E,A
        XOR     A
        LD      D,A
        LD      HL,$275F
        ADD     HL,DE
        LD      DE,$4E20
        LDIR    
        INC     DE
        LD      BC,$0004
        LDIR    
L2403:  IN      A,($1D)
        AND     $E0
        LD      HL,$4E41
        CP      (HL)
        JR      Z,L242D                 ; (+$20)
        LD      (HL),A
        INC     HL
        RRCA    
        RRCA    
        LD      (HL),A
        XOR     A
        LD      B,$0C
        LD      C,$0C
        LD      D,$40
        LD      E,$87
        SYSTEM RECTAN
        LD      A,($4E41)
        LD      E,A
        XOR     A
        LD      D,A
        LD      HL,$2655
        ADD     HL,DE
        LD      D,$40
        LD      E,$87
        SYSTEM WRITR
L242D   LD      A,($4E2B)
        BIT     7,A
        RET     NZ
        LD      A,($4E42)
        LD      BC,$0004
        LD      E,A
        XOR     A
        LD      D,A
        LD      HL,$279F
        ADD     HL,DE
        LD      DE,$4E2D
        LDIR    
        INC     DE
        LD      BC,$0004
        LDIR    
        RET     

  ; Misc. Routine #3
        LD      HL,$2620
        LD      D,$00
        LD      E,$3E
        JR      L2461                   ; (+$0c)
        LD      HL,$2576
        JR      L245D                   ; (+$03)

  ; Display "Game Over, Boys" Subroutine
PRNTOV  LD   HL,GMOVER    ; "Game Over Boys" Text
L245D   LD   D,$14        ; Coordinates
        LD   E,$18        ; Coordinates
L2461   LD   C,$C         ; Standard Options
        SYSTEM STRDIS
        RET

  ; VWRITR Subroutine
        LD   HL,$27DF     ; Pattern Address
        LD   IX,$4E10     ; Vector Address
        SYSTEM VWRITR
        LD   A,$01
        LD   ($4E12),A
        RET

  ; Music Score #1
        MASTER $A1
        VOLUME $FF, $FF
        DB   $04
        DB   $02
        DB   $02
        DB   $50
        QUIET

  ; Music Score #2
  ; Called From $2290
        MASTER $FF
        VOLUME $FF, $FF
        DB   $19
        DB   $03
        DB   $13
        DB   $06
        DB   $0C
        DB   $0C
        QUIET

  ; Music Score #3
  ; Called From $22A1
        MASTER $FF
        VOLUME $FF, $FF
        DB   $30
        DB   $30
        DB   $12
        DB   $34
        DB   $56
        QUIET

  ; Characters
  ;
  ; Pattern for top of Left Character ($2496-$24C9)
  ; Called from $204F (WRIT sub)
PLAY1T  DB  $01,$50,$00   ; 000000010101000000000000 -       X X X
        DB  $01,$55,$00   ; 000000010101010100000000 -       X X X X X
        DB  $15,$55,$40   ; 000101010101010101000000 -   X X X X X X X X
        DB  $02,$A8,$00   ; 000000101010100000000000 -      X X X X
        DB  $02,$88,$00   ; 000000101000100000000000 -      X X   X            
        DB  $02,$AA,$00   ; 000000101010101000000000 -      X X X X X          
        DB  $02,$A8,$00   ; 000000101010100000000000 -      X X X X            
        DB  $00,$A0,$00   ; 000000001010000000000000 -        X X              
        DB  $14,$01,$40   ; 000101000000000101000000 -   X X         X X       
        DB  $54,$01,$40   ; 010100000000000101000000 - X X           X X       
        DB  $54,$01,$40   ; 010101000000000101000000 - X X X         X X      
        DB  $04,$01,$00   ; 000001000000000100000000 -     X         X        
        DB  $05,$01,$00   ; 000001010000000100000000 -     X X       X         
        DB  $05,$41,$00   ; 000001010100000100000000 -     X X X     X        
        DB  $05,$55,$54   ; 000001010101010101010100 -     X X X X X X X X X   
        DB  $05,$55,$54   ; 000001010101010101010100 -     X X X X X X X X X  
        DB  $05,$55,$54   ; 000001010101010101010100 -     X X X X X X X X X  
        DB  $01,$50,$14   ; 000000010101000000010100 -       X X X       X X 
  ;  Pattern for bottom of Left Character ($24CC-$24DB)
        DB  $01,$50,$14   ; 000000010101000000010100 -       X X X       X X  
        DB  $01,$50,$14   ; 000000010101000000010100 -       X X X       X X  
        DB  $01,$50,$14   ; 000000010101000000010100 -       X X X       X X  
        DB  $55,$50,$14   ; 010101010101000000010100 - X X X X X X       X X
        DB  $55,$50,$14   ; 010101010101000000010100 - X X X X X X       X X
        DB  $40,$00,$15   ; 010000000000000000010101 - X                 X X X
  ;
  ;
  ;  Pattern for top of Right Character ($24DE-$2513)
  ;  Called from $2065 (WRIT sub)
PLAY2T  DB  $00,$05,$40   ; 000000000000010101000000 -             X X X      
        DB  $00,$55,$40   ; 000000000101010101000000 -         X X X X X      
        DB  $01,$55,$54   ; 000000010101010101010100 -       X X X X X X X X  
        DB  $00,$2A,$80   ; 000000000010101010000000 -          X X X X       
        DB  $00,$22,$80   ; 000000000010001010000000 -          X   X X       
        DB  $00,$AA,$80   ; 000000001010101010000000 -        X X X X X
        DB  $00,$2A,$80   ; 000000000010101010000000 -          X X X X 
        DB  $00,$0A,$00   ; 000000000000101000000000 -            X X         
        DB  $01,$40,$14   ; 000000010100000000010100 -       X X         X X  
        DB  $01,$40,$15   ; 000000010100000000010101 -       X X         X X X
        DB  $01,$40,$15   ; 000000010100000000010101 -       X X         X X X
        DB  $00,$40,$10   ; 000000000100000000010000 -         X         X    
        DB  $00,$40,$50   ; 000000000100000001010000 -         X       X X   
        DB  $00,$41,$50   ; 000000000100000101010000 -         X     X X X     
        DB  $15,$55,$50   ; 000101010101010101010000 -   X X X X X X X X X    
        DB  $15,$55,$50   ; 000101010101010101010000 -   X X X X X X X X X    
        DB  $15,$55,$50   ; 000101010101010101010000 -   X X X X X X X X X    
        DB  $14,$05,$40   ; 000101000000010101000000 -   X X       X X X      
  ;  Pattern for bottom of Left Character ($2514-$2525)
        DB  $14,$05,$40   ; 000101000000010101000000 -   X X       X X X      
        DB  $14,$05,$40   ; 000101000000010101000000 -   X X       X X X      
        DB  $14,$05,$40   ; 000101000000010101000000 -   X X       X X X      
        DB  $14,$05,$55   ; 000101000000010101010101 -   X X       X X X X X X
        DB  $14,$05,$55   ; 000101000000010101010101 -   X X       X X X X X X
        DB  $54,$00,$01   ; 010101000000000000000001 - X X X                 X

  ;  Pattern for Computer "Can Tosser" (Top)
  ;  Called from $2068 (WRIT sub)
COMPT   DB  $05,$40   ; 0000010101000000 -     X X X       
        DB  $15,$50   ; 0001010101010000 -   X X X X X    
        DB  $0A,$80   ; 0000101010000000 -     X X X        
        DB  $0A,$80   ; 0000101010000000 -     X X X        
        DB  $02,$00   ; 0000001000000000 -       X         
        DB  $55,$55   ; 0101010101010101 - X X X X X X X X
        DB  $55,$55   ; 0101010101010101 - X X X X X X X X
        DB  $15,$51   ; 0001010101010001 -   X X X X X   X
        DB  $15,$51   ; 0001010101010001 -   X X X X X   X
        DB  $15,$51   ; 0001010101010001 -   X X X X X   X
  ;  Pattern for Computer "Can Tosser" (Bottom)
COMPB   DB  $3F,$F0   ; 0011111111110000 -   X X X X X 
        DB  $3F,$F0   ; 0011111111110000 -   X X X X X 
        DB  $3C,$F0   ; 0011110011110000 -   X X   X X   
        DB  $3C,$F0   ; 0011110011110000 -   X X   X X   
        DB  $3C,$F0   ; 0011110011110000 -   X X   X X   
        DB  $3C,$F0   ; 0011110011110000 -   X X   X X   

  ;  Pattern ? (Called from $20E0)
        DB    00000000B
        DB    00000000B
        DB    00000000B
        DB    00000000B
        DB    00000000B
        DB    11110101B
        DB    11110101B
        DB    11110000B

  ;  Pattern ? (Called from $20F9)
        DB    00000000B
        DB    00000000B
        DB    11111100B
        DB    11111100B
        DB    11111100B
        DB    00010101B
        DB    00010101B
        DB    00000000B

  ;  Pattern ? (Called from $2108)
        DB    00111111b
        DB    00111111b
        DB    00111111b
        DB    00000100b
        DB    00000100b
        DB    00000101b
        DB    00000101b
        DB    00000000b

  ;  Pattern ? (Called from $2117)
        DB    00000100b
        DB    00000100b
        DB    00000100b
        DB    00000100b
        DB    00000100b
        DB    00000101b
        DB    00000101b
        DB    00000000b

        DB    $00
        DB    $08
        DB    $03
        DB    $04
        DB    $7F
        DB    $FF
        DB    $FF
        DB    $50
        DB    $05
        DB    $00
        DB    $54
        DB    $14
        DB    $00
        DB    $15
        DB    $54
        DB    $00

        DB    'G','E','T',' '
        DB    'R','E','A','D','Y'
        DB    ' ','B','O','Y','S'
        DW    $0000               ; End string

        DB    $00
        DB    $05
        DB    $03
        DB    $07
        DB    $00
        DB    $00
        DB    $0F
        DB    $00
        DB    $03
        DB    $F0
        DB    $00
        DB    $FD
        DB    $00
        DB    $5F
        DB    $05
        DB    $00
        DB    $54
        DB    $05
        DB    $00
        DB    $55
        DB    $55
        DB    $00
        DB    $15
        DB    $36
        DB    $00

WINNER  DB   'W','I','N','N','E','R'
        DW   $0000                    ; End string 

        DB    $02
        DB    $03
        DB    $09
        DB    $00
        DB    $00
        DB    $03
        DB    $00
        DB    $00
        DB    $3F
        DB    $00
        DB    $03
        DB    $C0
        DB    $00
        DB    $0D
        DB    $00
        DB    $00
        DB    $F5
        DB    $00
        DB    $0F
        DB    $05
        DB    $00
        DB    $54
        DB    $05
        DB    $00
        DB    $55
        DB    $55
        DB    $00
        DB    $55
        DB    $54
        DB    $00
        DB    $00
        DB    $00
        DB    $02
        DB    $03
        DB    $09
        DB    $00
        DB    $00
        DB    $3C
        DB    $00
        DB    $03
        DB    $C0
        DB    $00
        DB    $0F
        DB    $00
        DB    $00
        DB    $3D
        DB    $00
        DB    $00
        DB    $C5
        DB    $00
        DB    $03
        DB    $C5
        DB    $00
        DB    $5F
        DB    $05
        DB    $00
        DB    $55
        DB    $55
        DB    $00
        DB    $55
        DB    $55
        DB    $00
        DB    $00
        DB    $00
        DB    $02
        DB    $03
        DB    $09
        DB    $00
        DB    $03
        DB    $C0
        DB    $00
        DB    $0F
        DB    $00
        DB    $00
        DB    $3C
        DB    $00
        DB    $00
        DB    $F4
        DB    $00
        DB    $00
        DB    $D4
        DB    $00
        DB    $03
        DB    $14
        DB    $00
        DB    $5C
        DB    $14
        DB    $00
        DB    $55
        DB    $54
        DB    $00
        DB    $55
        DB    $54
        DB    $00
        DB    $00
        DB    $00
        DB    $00
        DB    $02
        DB    $0B
        DB    $00
        DB    $03
        DB    $00
        DB    $0C
        DB    $00
        DB    $30
        DB    $00
        DB    $30
        DB    $00
        DB    $D0
        DB    $00
        DB    $D0
        DB    $03
        DB    $40
        DB    $03
        DB    $40
        DB    $5C
        DB    $40
        DB    $55
        DB    $50
        DB    $55
        DB    $50
        DB    $42
        DB    $4F
        DB    $4E
        DB    $55
        DB    $53
        DB    $00
        DB    $00
        DB    $00
        DB    $02
        DB    $0B
        DB    $00
        DB    $30
        DB    $00
        DB    $C0
        DB    $00
        DB    $C0
        DB    $00
        DB    $C0
        DB    $03
        DB    $40
        DB    $03
        DB    $40
        DB    $0C
        DB    $40
        DB    $0C
        DB    $40
        DB    $5C
        DB    $40
        DB    $55
        DB    $40
        DB    $55
        DB    $40

  ; Limit Table
        DB    02D         ; X Lower Limit
        DB    154D        ; X Upper Limit
        DB    6D          ; Y Lower Limit
        DB    80D         ; Y Upper Limit

        DB    $00
        DB    $00
        DB    $00
        DB    $00
        DB    $01
        DB    $0B
        DB    $30
        DB    $30
        DB    $30
        DB    $30
        DB    $34
        DB    $34
        DB    $34
        DB    $34
        DB    $54
        DB    $54
        DB    $54
        DB    $08
        DB    $00
        DB    $01
        DB    $0B
        DB    $30
        DB    $30
        DB    $30
        DB    $30
        DB    $70
        DB    $70
        DB    $70
        DB    $70
        DB    $75
        DB    $55
        DB    $55

GMOVER  DB    'G','A','M','E'
        DB    ' ','O','V','E','R'
        DB    ' ','B','O','Y','S'
        DW    $0000               ; End string

        DB    $00
        DB    $04
        DB    $00
        DB    $02
        DB    $0B
        DB    $0C
        DB    $00
        DB    $0C
        DB    $00
        DB    $03
        DB    $00
        DB    $03
        DB    $00
        DB    $03
        DB    $00
        DB    $01
        DB    $C0
        DB    $01
        DB    $C0
        DB    $01
        DB    $C0
        DB    $01
        DB    $35
        DB    $01
        DB    $55
        DB    $01
        DB    $55

  ; Limit Table
        DB    00D         ; X Lower Limit
        DB    144D        ; X Upper Limit
        DB    5D          ; Y Lower Limit
        DB    88D         ; Y Upper Limit

        DB    $00
        DB    $00
        DB    $04
        DB    $00
        DB    $02
        DB    $0B
        DB    $C0
        DB    $00
        DB    $30
        DB    $00
        DB    $30
        DB    $00
        DB    $0C
        DB    $00
        DB    $0C
        DB    $00
        DB    $07
        DB    $00
        DB    $04
        DB    $C0
        DB    $04
        DB    $C0
        DB    $04
        DB    $35
        DB    $05
        DB    $55
        DB    $05
        DB    $55
        DB    $10
        DB    $A0
        DB    $05
        DB    $58
        DB    $00
        DB    $00
        DB    $04
        DB    $02
        DB    $02
        DB    $09
        DB    $C0
        DB    $00
        DB    $30
        DB    $00
        DB    $3C
        DB    $00
        DB    $1F
        DB    $00
        DB    $17
        DB    $00
        DB    $14
        DB    $C0
        DB    $14
        DB    $35
        DB    $15
        DB    $55
        DB    $15
        DB    $55

PROMPT  DB   '#',' ','O','F',' '
        DB   'C','A','N','S'
        DW   $0000                    ; End string 

        DB    $02
        DB    $03
        DB    $09
        DB    $0F
        DB    $00
        DB    $00
        DB    $03
        DB    $F0
        DB    $00
        DB    $00
        DB    $30
        DB    $00
        DB    $00
        DB    $1C
        DB    $00
        DB    $00
        DB    $17
        DB    $00
        DB    $00
        DB    $14
        DB    $F0
        DB    $00
        DB    $14
        DB    $35
        DB    $00
        DB    $15
        DB    $55
        DB    $00
        DB    $15
        DB    $55
        DB    $00
        DB    $00
        DB    $02
        DB    $03
        DB    $09
        DB    $F0
        DB    $00
        DB    $00
        DB    $3C
        DB    $00
        DB    $00
        DB    $03
        DB    $00
        DB    $00
        DB    $00
        DB    $F0
        DB    $00
        DB    $00
        DB    $5C
        DB    $00
        DB    $00
        DB    $53
        DB    $C0
        DB    $00
        DB    $50
        DB    $35
        DB    $00
        DB    $55
        DB    $55
        DB    $00
        DB    $55
        DB    $55
        DB    $00
        DB    $00
        DB    $05
        DB    $03
        DB    $07
        DB    $F0
        DB    $00
        DB    $00
        DB    $0F
        DB    $00
        DB    $00
        DB    $00
        DB    $F3
        DB    $00
        DB    $00
        DB    $53
        DB    $F5
        DB    $00
        DB    $50
        DB    $15
        DB    $00
        DB    $55
        DB    $55
        DB    $00
        DB    $15
        DB    $54
        DB    $01
        DB    $3E
        DB    $0A
        DB    $01
        DB    $3E
        DB    $01
        DB    $01
        DB    $00
        DB    $08
        DB    $03
        DB    $04
        DB    $FF
        DB    $FF
        DB    $FD
        DB    $00
        DB    $50
        DB    $05
        DB    $00
        DB    $14
        DB    $15
        DB    $00
        DB    $15
        DB    $54
        DB    $00
        DB    $00
        DB    $01
        DB    $05
        DB    $C0
        DB    $0C
        DB    $C0
        DB    $03
        DB    $30

; Color Table - Colors for Color Register
; 8 Bytes  (Called from $2011)
  ; Left side of Horizontal Color Boundary  
COLTBL  DB    $22         ; Color 11B - Border (purple)
        DB    $64         ; Color 10B - Head (orange)  
        DB    $74         ; Color 01B - Body (gold)
        DB    $07         ; Color 00B - Background (white)
  ; Right side of Horizontal Color Boundary
        DB    $22         ; Color 11B - Border (purple)
        DB    $64         ; Color 10B - Head (orange)  
        DB    $C8         ; Color 01B - Body (green)
        DB    $07         ; Color 00B - Background (white) 

  ; "DOGPATCH" String
DOGSTR  DB    'D','O','G','P','A','T','C','H'
        DW    $0000       ; End string 

        DB    $05
        DB    $00
        DB    $1F
        DB    $80
        DB    $FF
        DB    $00
        DB    $48
        DB    $BE
        DB    $04
        DB    $00
        DB    $1F
        DB    $6C
        DB    $FE
        DB    $00
        DB    $44
        DB    $29
        DB    $04
        DB    $00
        DB    $1F
        DB    $3B
        DB    $FD
        DB    $00
        DB    $40
        DB    $A3
        DB    $03
        DB    $00
        DB    $1F
        DB    $92
        DB    $FC
        DB    $00
        DB    $3C
        DB    $2E
        DB    $03
        DB    $00
        DB    $1B
        DB    $24
        DB    $FC
        DB    $00
        DB    $3A
        DB    $8A
        DB    $02
        DB    $00
        DB    $17
        DB    $B8
        DB    $FB
        DB    $00
        DB    $3A
        DB    $A9
        DB    $01
        DB    $00
        DB    $13
        DB    $4B
        DB    $FB
        DB    $00
        DB    $3A
        DB    $50
        DB    $00
        DB    $00
        DB    $0F
        DB    $90
        DB    $FB
        DB    $00
        DB    $3A
        DB    $80
        DB    $FF
        DB    $00
        DB    $8D
        DB    $90
        DB    $FB
        DB    $00
        DB    $3A
        DB    $5C
        DB    $FE
        DB    $00
        DB    $89
        DB    $4B
        DB    $FB
        DB    $00
        DB    $3A
        DB    $7B
        DB    $FD
        DB    $00
        DB    $85
        DB    $B8
        DB    $FB
        DB    $00
        DB    $3A
        DB    $D0
        DB    $FC
        DB    $00
        DB    $81
        DB    $B8
        DB    $FB
        DB    $00
        DB    $3A
        DB    $52
        DB    $FC
        DB    $00
        DB    $7D
        DB    $92
        DB    $FC
        DB    $00
        DB    $3C
        DB    $D8
        DB    $FB
        DB    $00
        DB    $7D
        DB    $3B
        DB    $FD
        DB    $00
        DB    $40
        DB    $48
        DB    $FB
        DB    $00
        DB    $7D
        DB    $6C
        DB    $FE
        DB    $00
        DB    $44
        DB    $90
        DB    $FB
        DB    $00
        DB    $7D
        DB    $80
        DB    $FF
        DB    $00
        DB    $48

; Pattern called from $246D
        DB    $00         ; No X Offset
        DB    $00         ; No Y Offset
        DB    $01         ; 1 Byte Wide
        DB    $04         ; 4 Bytes High
        DB    11111111B   ; Can(?) Pattern
        DB    11111111B   
        DB    11111111B 
        DB    11111111B 

        DB    $00
        DB    $00
        DB    $01
        DB    $02
        DB    $01
        DB    $04
        DB    $02
        DB    $06
        DB    $02
        DB    $08
        DB    $03
        DB    $0A
        DB    $03
        DB    $0C
        DB    $04
        DB    $0E
        DB    $05
        DB    $10
        DB    $05
        DB    $12
        DB    $05
        DB    $14
        DB    $05
        DB    $16
        DB    $05         ; Last Byte
                          ; End of 2k ROM

