Random demo
Random demo
  • Entry name:
    TwoGun
  • Category:
    Games
  • Publisher/Developer:
    Analog Computing Magazine
  • Year:
    1985
  • Code:
    Conrad Tatge
  • Media format:
    Diskette, Tape
  • Controllers:
    Joystick
  • Programming language:
    Assembly language
TwoGun TwoGun TwoGun TwoGun
Listing 1
        TITLE 'TWOGUN - A Shootout'
        SUBTTL 'By Conrad Tatge 84'

CONSOL  EQU $D01F ;Console switch
RANDOM  EQU $D20A ;random byte
HPOSP0  EQU $D000 ;horizontal
M0PF    EQU $D000 ;collisions
M0PL    EQU $D008
P0PF    EQU $D004

        ORG $80 ;Page zero

VBIDO   DS 1 ;vertical blank shake
WINNER  DS 1 ;starts glow
LOOT    DS 1 ;where loot is
ENABLE  DS 1 ;VBI allowance
DOCPU   DS 1 ;game over flag
TIMER   DS 1 ;inc'ed every VBI
SND1    DS 1 ;firing sound
SND2    DS 1 ;ricochet
SND3    DS 1 ;fwooop
DOHOME  DS 1 ;flag for little music
VOLUME  DS 1 ;taps note volume
VOL2    DS 1 ;footstep volume
SUSTAI  DS 1 ;tune volume
TEMP    DS 1 ;work
NOLOOT  DS 1 ;countdown
COUNT   DS 1 ;counter
ONOFF   DS 1 ;foot switch
STEPTM  DS 1 ;time for next step
STEP    DS 1 ;step pointer
PICTUR  DS 1 ;frame
PIC     DS 2 ;Page zero PM point
CHANGE  DS 2 ;where to change color
NEWCOL  DS 2 ;what color to change
DEAD    DS 2 ;dead flag
AMMOS   DS 2 ;bullets
AMMOS2  DS 2 ;for displaying
PLPF2   DS 2
NOCOL   DS 2 ;after a collision
NOMOVE  DS 2 ;after a shot
MISSLF  DS 2 ;1 = shooting
PRESSF  DS 2 ;1 = aiming
HORIZ   DS 2 ;cowboy position
VERT    DS 2
HORIZ2  DS 2 ;previously
VERT2   DS 2
DIRX    DS 2 ;aim direction
DIRY    DS 2
SHORIZ  DS 2 ;shot position
SHVERT  DS 2
SHDIRX  DS 2 ;shot direction
SHDIRY  DS 2
SCORE   DS 2 ;BCD player score

        ASSERT * < $100 ;page zero!

PMHORZ  =  $30 ;For screen
PMVERT  =  $28 ;offsets
PMTITL  =  PMVERT+$30 ;for title page
AMMO    =  1 ;character codes
CACTUS  =  2
ROCK    =  3
CHAMMO  =  4 ;bullets character
GRAVE   =  9 ;gravestone
HOMES   =  74 ;length of song
CHRSET  EQU $3000 ;memory space
PMAREA  EQU $3800
DISP    EQU PMAREA ;screen memory
MIS     EQU PMAREA+$180
PL0     EQU PMAREA+$200
PL1     EQU PMAREA+$280
PL2     EQU PMAREA+$300
PL3     EQU PMAREA+$380
PLAREA  EQU DISP+20 ;play area

        ORG $2000

INIT    JSR $E465 ;init sound
        JSR PMCLR ;clear buffer
        JSR CLDISP ;clear screen
        LDA #LOW DLIST
        STA $230
        LDA #HIGH DLIST
        STA $231
        LDA #$2E
        STA $22F ;P/M
        LDA #HIGH PMAREA
        STA $D407
        LDA #3
        STA $D01D ;GRACTL
        LDA #0
        STA $D00C ;SIZEM
        LDA #$18
        STA $26F ;PRIOR
        LDA #0
        STA $D208 ;init
        LDA #$06 ;light grey
        STA $2C6 ;rocks
        LDA #$AA
        STA $2C7 ;bullets

        LDX #0
MOVEIT  LDA $E000,X ;move ROM set 
        STA CHRSET,X
        LDA $E100,X
        STA CHRSET+$100,X
        INX
        BNE MOVEIT
        LDA #HIGH CHRSET
        STA 756 ;point to new one
        LDX #$48 ;move 9 characters
NEWCHR  LDA NEWSET,X ;and copy new
        STA CHRSET+8,X
        DEX 
        BPL NEWCHR
        LDA #0
        LDX #$7F
CLPZER  STA $80,X ;zero variables
        DEX
        BPL CLPZER
        LDX #7
ZHORIZ  STA HPOSP0,X ;horizontals
        DEX
        BPL ZHORIZ

        LDA #0
        STA ENABLE ;Not yet
        LDX #HIGH VBLANK ;Set up
        LDY #LOW VBLANK ;NMI
        LDA #6
        JSR $E45C

        LDX #18 ;19 characters
PRINT   LDA CHRS,X
        LDY CHRPOS,X
        STA DISP,Y ;put to screen
        DEX
        BPL PRINT

        LDX #$F
        LDY #PMTITL
DOMAN   LDA THEMAN,X
        STA PL0,Y
        DEY
        STA PL0,Y
        DEY
        DEX
        BPL DOMAN
        LDX #$7
        LDY #PMTITL
DOCAC   LDA NEWSET+8,X ;display dudes
        STA PL1,Y
        STA PL1+1,Y
        STA PL1+2,Y
        STA PL1+3,Y
        LDA NEWSET+$10,X
        STA PL2,Y
        STA PL2+1,Y
        STA PL2+2,Y
        STA PL2+3,Y
        DEY
        DEY
        DEY
        DEY
        DEX
        BPL DOCAC

        LDA #3
        STA $D008 ;x4 width
        STA $D009
        STA $D00A
        LDA #$36 ;red cowboy
        STA $2C0
        LDA #$C2 ;green cactus
        STA $2C1
        LDA #$06 ;grey rocks
        STA $2C2
        LDA #$78 ;horizontals
        STA $D000
        LDA #$A8
        STA $D001
        LDA #$48
        STA $D002
        LDA #HOMES ;set it up...
        STA HOMEON
        LDA #1 ;and
        STA DURAT2
        LDA #1 ;start the tune...
        STA DOHOME

        LDX #32
AGAIN   LDA $2C4 ;switch $2C4 & $2C5
        PHA
        LDA $2C5
        STA $2C4
        PLA
        STA $2C5
        LDA #16 ;quarter of a second
        STA TIMER
TWAITA  LDA TIMER
        BNE TWAITA
        DEX
        BNE AGAIN
        JSR PMCLR ;clear PM title
        LDA #7 ;glow title
        STA WINNER
START   LDA #0
        STA ENABLE
        LDX #7
NOSNDS  STA $D200,X
        DEX
        BPL NOSNDS
        LDA RANDOM
        ORA #1 ;at least one
        STA NOLOOT ;set up timer
        LDA #0
        STA $D008
        STA $D009
        sta ONOFF
        STA PIC
        STA TAPS
        STA VOL2
        STA VOLUME
        STA STEPTM
        STA STEP
        LDA #2 ;Sound freq'
        STA $D200 ;AUDF1
        LDA #$AA
        STA $D203 ;sound ctrl 2
        LDA #$FF
        STA SND1
        STA SND2
        STA SND3

        LDX #19
PRESS   LDA PRESSM,X ;write message
        STA DISP+220,X
        DEX
        BPL PRESS

        LDX WINNER
DOWN    LDA $14 ;Glow
        ORA #7
        STA $2C0,X
        CPX #2
        BCS DOGAME
        AND #$F0
        ORA #$A
        STA $2C4,X
DOGAME  LDA CONSOL
        AND #1 ;START?
        BNE DOWN
        JSR PMCLR
        JSR CLDISP

UP      LDA CONSOL
        AND #1 ;Let go yet?
        BEQ UP

        LDA #$F2 ;brown
        STA $2C8
        LDA #$BA ;color of loot
        STA $2C7
        LDX #1 ;Set up game
SETUP   LDA #$1A ;fleshy
        STA $2C0,X ;COLPM0
        LDA TCOLOR,X
        ORA #4
        STA $2C4,X ;COLPF0
        LDA THORIZ,X
        STA HORIZ,X
        STA HORIZ2,x ;old
        LDA #$30
        STA VERT,X
        STA VERT2,X ;old
        LDA #0
        STA NOMOVE,X
        STA DEAD,X
        STA NOCOL,X
        STA SCORE,X
        STA MISSLF,X
        STA PRESSF,X ;etc...
        LDA #3 ;give him some!
        STA AMMOS,X
        DEX
        BPL SETUP
        STA $D01E ;HITCLR
        LDA #1 ;Now it can
        STA ENABLE
        LDA #0
        STA DOCPU
        STA VOLUME ;quiet!

* CPU moves the random gun, checks
* for it's collision, and does color

CPU     PROC
        LDA VBIDO ;wait for VBI
        BEQ CPU
        LDA DOCPU ;end game?
        BEQ :CPU.2
        JMP START ;do it again!
:CPU.2  LDA #0
        STA VBIDO
        LDX #1
setvp   LDA VERT,X
        CLC
        ADC #30 ;where to change
        STA CHANGE,X
        LDA TCOLOR,X
        ORA #6
        STA NEWCOL,X
        LDA ONOFF ;alternate
        BEQ SETVP3 ;natural color
        LDA NOMOVE,X
        BEQ SETVP2
        LDA #4
        STA NEWCOL,X ;darken him!
SETVP2  LDA AMMOS,X
        CMP #2
        BCS SETVP3
        LDA #$CA ;embarassment
        STA NEWCOL,X
SETVP3  DEX
        BPL SETVP
KERNEL  LDX #1
        LDA $D40B
        STA $D40A ;WSYNC
CKVP    CMP CHANGE,X ;time to change?
        BNE nochan
        PHA
        LDA NEWCOL,X ;get new color
        STA $D012,X
        PLA
nochan  DEX
        BPL CKVP
        CMP #$70
        BCC KERNEL

        LDX #1
:CPU1   LDA P0PF,X ;have we run into
        AND MISHIT,X ;a cactus?
        PHA ;hold on to
        CMP PLPF2,X
        BEQ :CPU1.2
        BCC :CPU1.2
        LDA DEAD,X ;O.K. if dead...
        BNE :CPU1.2
        LDA NOCOL,X ;or already hit
        BNE :CPU1.2
        LDA #45 ;.75 seconds
        STA NOMOVE,X ;stop there
        LDA #$10 ;start boing
        STA SND3
:CPU1.2 PLA
        STA PLPF2,X ;remember it
        LDA P0PF,X
        AND #8 ;got the loot?
        BEQ :CPU3
        LDA #$10
        STA SND3 ;boing
        LDY LOOT
        LDA GOTIT,X ;make a cactus
        STA PLAREA,Y
        STA $D01E ;HITCLR
        LDA RANDOM
        AND #3
        ORA #1
        CLC     
        ADC AMMOS,X
        STA AMMOS,X
loottm  LDA RANDOM ;wait a little
        ORA #$40 ;not zero
        STA NOLOOT
:CPU3   LDA NOLOOT ;waiting?
        BNE lootdn
        LDA RANDOM ;chance it
        BNE :CPU3.1
        LDY LOOT ;erase old one
        LDA #0
        STA DISP+20,y
        BEQ LOOTTM    
LOOTDN  DEC NOLOOT
        BNE :CPU3.1
:CPU2   JSR RANDY ;hide loot
        BEQ DOLOOT
        AND #$3F ;remove color
        CMP #CACTUS
        BEQ DOLOOT
        CMP #LOOT ;the loot?
        BEQ :CPU2
        LDA #0 ;erase it
        STA PLAREA,Y
        BEQ :CPU2 ;now try again
DOLOOT  STY LOOT ;use this value
        LDA #AMMO OR $C0 ;PF3
        STA PLAREA,Y
        LDA #$10
        STA SND3 ;boing
:CPU3.1 DEX
        BMI RECPU
        JMP :CPU1
RECPU   JMP CPU

        SUBTTL 'Subroutines'

RANDY   LDA RANDOM ;find a random
        CMP #200 ;byte on screen
        BCS RANDY
        TAY ;and get its contents
        LDA PLAREA,Y
        RTS
                 
* Multiply by 20 for screen plotting

MULT20  ASL A ;*2
        ASL A ;*4
        STA TEMP
        ASL A ;*8
        ASL A ;*16
        CLC
        ADC TEMP ;*20
        RTS

* Finds screen location from a missle

PMDISP  CLC ;offset is on A
        ADC SHVERT,X ;get horizontal
        LSR A
        LSR A
        LSR A ;/8
        JSR MULT20 ;times 20
        STA TEMP ;hold
        LDA SHORIZ,X
        CLC
        ADC #1
        LSR A
        LSR A
        LSR A ;/8
        CLC
        ADC TEMP ;add on to
        TAY ;and put in Y
        RTS

CLDISP  LDX #240 ;Clear screen
        LDA #0
CLEAR   STA DISP-1,X
        DEX
        BNE CLEAR
        RTS

PMCLR   LDX #$7F ;clear out P/M
        LDA #0
ZPLYR   STA MIS,X
        STA PL0,X
        STA PL1,X
        STA PL2,X
        STA PL3,X
        DEX
        BPL ZPLYR
        RTS

        SUBTTL 'The Vertical Blank'

* Vertical BLANK does everything else

VBLANK  PROC
        LDA #1 ;VBI call flag
        STA VBIDO
        DEC TIMER
        
        LDA DOHOME ;Home on the range
        BEQ CKENAB
        DEC DURAT2 ;count it down
        LDA DURAT2
        BNE DONOTE
        INC HOMEON ;next note
        LDA HOMEON
        CMP #HOMES ;done yet?
        BCC NEWDUR
        LDA #1 ;yes, start again
        STA HOMEON
NEWDUR  TAX ;note getter
        LDA DURAT2,X
        STA DURAT2        
        LDA #$A ;start volume
        STA SUSTAI
DONOTE  LDX HOMEON
        LDA HOMEON,X ;play the note
        STA $D206
        LDA TIMER ;decrease volume?
        AND #1
        BNE CKENAB
        DEC SUSTAI ;a little softer
        LDA SUSTAI
        BMI CKENAB ;not too much!
        ORA #$A0 ;adjust sound
        STA $D207
CKENAB  LDA ENABLE ;should we?
        BNE :L1
        JMP LOOP6
:L1     DEC STEPTM
        BPL DOSNDS
        LDA #$1F ;wait for next
        STA STEPTM
        LDA STEP ;take a step!
        EOR #$10
        STA STEP
        LDA ONOFF
        EOR #1
        STA ONOFF
NEWAMO  LDA RANDOM
        ORA #6
        CMP $2C7
        BEQ NEWAMO
        STA $2C7 ;new ammo color
        LDA SND1 ;not during a shot!
        BPL DOSNDS
        LDA NOMOVE ;if not moving...
        AND NOMOVE+1
        BNE DOSNDS
        LDX ONOFF
        LDA FEET,X ;make footsteps
        STA $D200
        LDA #8
        STA VOL2
DOSNDS  LDA VOL2
        BEQ DOSND1
        DEC VOL2
        LDA SND1
        BPL DOSNDS
        LDA VOL2
        ORA #$80 ;decrease volume
        STA $D201
        BMI CKSND2
DOSND1  LDA SND1 ;gunshot
        BMI CKSND2
        DEC SND1
        AND #$F
        STA $D201
CKSND2  LDA SND2
        BMI CKSND3
        DEC SND2
        LDX SND2
        LDA CONT2,X
        STA $D203
        LDA FREQ2,X
        STA $D202
CKSND3  LDA SND3 ;boing
        BMI CKTAPS
        DEC SND3
        LDX SND3
        TXA ;use pointer as volume
        ORA #$40
        STA $D205 ;AUDC3
        LDA FREQ3,X
        STA $D204 ;AUDF3
CKTAPS  LDY TAPS
        BNE DOTAPS
        LDA VOLUME ;of last note?
        BPL TAPS2
        LDA #1 ;we're done!
        STA DOHOME
        BNE LOOP
DOTAPS  LDA #0 ;reset flag
        STA DOHOME
        DEC DURAT ;note length
        BPL TAPS2
        LDA DURAT,Y
        STA DURAT
        LDA TAPS,Y ;new note
        STA $D206 ;AUDF4
        LDA #$10 ;new volume
        STA VOLUME
        DEC TAPS ;next note
TAPS2   LDA TIMER
        AND #1
        BNE LOOP
        DEC VOLUME
        LDA VOLUME
        ORA #$A0
        STA $D207
LOOP    LDX #1
LOOP1   LDA DEAD,X ;6 feet under?
        BEQ ALIVE1
        LDA #1 ;elongate him
        STA $D008,X
        DEC DEAD,X ;and decrement
        BNE ALIVE1
        LDA #$40
        STA NOCOL,X
        LDA #0 ;back to normal
        STA $D008,X
ALIVE1  LDA NOCOL,X
        BEQ DECMOV
        DEC NOCOL,X
DECMOV  LDA NOMOVE,X ;movement?
        BEQ SHOAMM
        DEC NOMOVE,X
        BNE SHOAMM
        LDA #$20
        STA NOCOL,X
SHOAMM  LDY WHERE2,X ;get posit'
        LDA #5
        STA COUNT
        LDA AMMOS,X ;replicate
        STA AMMOS2,X
SHOAM1  LDA AMMOS2,X ;ammo left
        CMP #4
        BCS SHOAM2 ;full four?
        CLC ;partial
        ADC #CHAMMO OR $80
        STA DISP,Y
        LDA #0 ;no more
        STA AMMOS2,X
        BEQ SHOAM3
SHOAM2  LDA #CHAMMO+4 OR $80
        STA DISP,Y
        LDA AMMOS2,X
        SEC
        SBC #4
        STA AMMOS2,X
SHOAM3  INY ;go right one
        DEC COUNT
        BNE SHOAM1
        LDA $D00C,X
        AND MISHIT,X ;other guy?
        BEQ safety
        LDA HORIZ2,X ;move back!
        STA HORIZ,X
        LDA VERT2,X
        STA VERT,X
        JMP GETSTK
safety  LDA HORIZ,X ;safe place!
        STA HORIZ2,X
        LDA VERT,X
        STA VERT2,X
GETSTK  LDY $278,X ;Y is STICK
        LDA TDIRX,Y
        STA DIRX,X ;hold direction
        CLC
        ADC HORIZ,X ;new HORIZ
        CMP #$98 ;off of screen?
        BCS CKVERT
        STA TEMP ;no...could use
        LDA PRESSF,X ;unless aiming
        ORA NOMOVE,X
        BNE CKVERT
        LDA TEMP
        STA HORIZ,X ;update it
        
CKVERT  LDA TDIRY,Y ;same for VERT
        STA DIRY,X
        CLC
        ADC VERT,X
        CMP #$40
        BCS CKPRES
        STA TEMP
        LDA PRESSF,X
        ORA NOMOVE,X
        BNE CKPRES
        LDA TEMP
        STA VERT,X

* Joystick fire button code:
*   test for ammos then
*   if not strig then set PRESSF
*   if strig and PRESSF then fire

CKPRES  LDA PRESSF,X ;already?
        BEQ CKBUTT
        LDA $284,X ;letting go?
        BEQ CKBUTT
        LDA DIRX,X
        ORA DIRY,X
        BNE FIRE ;any direction?
NOFLIP  STA 77   ;stop attract
        STA PRESSF,X ;not pressing
        BEQ CKBUTT
FIRE    LDA AMMOS,X ;any bullets?
        BEQ NOFLIP
        LDA DEAD,X ;if dead
        ORA NOMOVE,X ;or immobile...
        BNE CKBUTT ;don't shoot!
        DEC AMMOS,X ;use a bullet
        LDA #1 ;he's shooting
        STA MISSLF,X
        LDA #0
        STA PRESSF,X
        LDA #$18 ;fire sound
        STA SND1
        LDA HORIZ,X ;make a bullet
        CLC
        ADC #3 ;center it
        STA SHORIZ,X
        LDA VERT,X
        STA SHVERT,X
        LDA DIRX,X
        ASL A ;4 times as fast
        ASL A
        STA SHDIRX,X
        LDA DIRY,X
        ASL A ;twice as fast
        STA SHDIRY,X
        JMP LOOP2
CKBUTT  LDA $284,X ;now button?
        BNE LOOP2
        LDA MISSLF,X ;or shoot?
        BNE LOOP2
        LDA #1
        STA PRESSF,X ;pressed...
LOOP2   LDA M0PL,X
        AND MISHIT,X ;player hit?
        BEQ MOVEM
        LDA #0 ;stop shooting
        STA MISSLF,X
        LDA #$F ;offset
        JSR PMDISP ;find where
        LDA #GRAVE OR $80
        STA DISP,Y ;put on screen
        LDY OPPON,X
        LDA DEAD,Y ;already dead?
        BEQ KILLEM
        LDA #$A0 ;slow shooter
        STA NOMOVE,x
        BNE MOVEM ;JMP
killem  LDA #0 ;play taps
        STA DURAT
        LDA #6
        STA TAPS
        LDA #$B0 ;kill him
        STA DEAD,Y
        LDA #$A8
        STA NOMOVE,Y
        SED
        LDA SCORE,X
        CLC
        ADC #1 ;Give him 1 point
        CLD
        STA SCORE,X
        PHA ;And display his score
        LDY WHERE,X
        AND #$F
        ORA COLSCO,X
        STA DISP,Y
        PLA
        LSR A
        LSR A
        LSR A
        LSR A
        ORA COLSCO,X
        STA DISP-1,Y
        AND #$F
        CMP #1 ;20 points wins
        BCC MOVEM
        STX WINNER
        LDY OPPON,X
        LDA #0 ;darken loser
        STA $2C0,Y
        LDA #0
        STA ENABLE
        LDA #1
        STA DOCPU
        JMP LOOP4 ;Remember who

MOVEM   LDA HORIZ,X
        CLC
        ADC #PMHORZ ;Small adjust
        STA HPOSP0,X ;horizontal
        TXA
        PHA
        LDA PLOFF1,X ;Set up PM
        STA PIC+1 ;pointers for
        LDA PLOFF2,X ;players
        STA PIC
        LDA #$B0 ;hold him still
        STA PICTUR
        LDA NOMOVE,X
        BNE :L2
        LDA STEP ;now animate
        STA PICTUR
        LDA PRESSF,X ;aiming?
        BEQ :L2
        LDA $278,X
        CMP #15 ;stick centered?
        BEQ :L2
        LDA AMMOS,X ;or out?
        BEQ :L2
        LDY $278,X
        LDA PICOFF,Y ;According
        STA PICTUR ;to STICK0
:L2     LDA VERT,X
        CLC
        ADC #PMVERT
        TAY ;No more Y!
        LDA DEAD,X
        BEQ ALIVE
        LDA #$A0 ;draw dead guy
        STA PICTUR
ALIVE   LDA PICTUR
        CLC 
        ADC #$F ;16 bytes
        TAX ;X is saved on stack
DRAW    LDA SHAPE,X ;draw him!
        STA (PIC),Y
        DEY
        DEX
        CPX PICTUR ;done yet?
        BPL DRAW
        PLA
        TAX ;restore player X
        LDA MISSLF,X ;Should we
        BNE MVHORZ ;kill missle?
        LDA SHVERT,X ;Y not stick
        CLC
        ADC #PMVERT-9
        TAY
        LDA MIS,Y
        AND BITSOF,X ;Out bits
        STA MIS,Y
        LDA #0
        STA $D004,X ;Zero HPOSM0
        JMP LOOP3
MVHORZ  LDA M0PF,X ;have we hit
        AND MISHIT,X ;a cactus?
        BEQ HORZ1 ;no collision
        LDA #7 ;offset
        JSR PMDISP ;figure out where
        LDA #ROCK OR $80
        STA DISP+20,Y ;make rock
        LDA #$10 ;make boing
        STA SND3
        JMP KILMSL ;kill missle
HORZ1:  LDA M0PF,X ;have we hit a
        AND #4 ;PF2 rock?
        BEQ HORZ3
        LDA #10 ;ricochet
        STA SND2
HORZ2:  LDA RANDOM ;new direc'
        AND #$F
        TAY
        LDA TDIRX,Y
        ORA TDIRY,Y
        BEQ HORZ2 ;some delta
        LDA TDIRX,Y
        ASL A ;a little slower
        STA SHDIRX,X
        LDA TDIRY,Y
        STA SHDIRY,X

HORZ3:  LDA SHORIZ,X ;update
        CLC
        ADC SHDIRX,X
        CMP #$9E ;off screen?
        BCS KILMSL
        STA SHORIZ,X
        CLC
        ADC #PMHORZ ;Compensate
        STA $D004,X

        LDA SHVERT,X ;Remove old
        CLC
        ADC #PMVERT-9
        TAY
        LDA MIS,Y
        AND BITSOF,X
        STA MIS,Y
        LDA SHVERT,X ;Now update
        CLC
        ADC SHDIRY,X
        CMP #$50 ;off screen?
        BCS KILMSL
        STA SHVERT,X
        CLC
        ADC #PMVERT-9 ;Compensate
        TAY
        LDA MIS,Y
        ORA BITSON,X ;Turn on bit
        STA MIS,Y
        JMP LOOP3
KILMSL  LDA #0 ;kill this missle
        STA MISSLF,X
        STA PRESSF,X
LOOP3   DEX ;Next player
        BMI LOOP4 ;end part of VBI
        JMP LOOP1
LOOP4   STA $D01E
        LDA CONSOL
        AND #1
        BNE LOOP6
        LDA #1
        STA DOCPU

LOOP6   JMP $E7D1 ;Exit VBI

        SUBTTL 'Data Tables'

* Various tables

PRESSM  DB $B0,$B2,$A5,$B3,$B3,0
        DB $F3,$F4,$E1,$F2,$F4,0
        DB $B4,$AF,0,$A2,$A5,$A7
        DB $A9,$AE ;press start...
CHRS    DB $34,$77,$2f,$67,$35,$6E
        DB 'byconradtatge'
CHRPOS  DB 41,61,81,101,121,141
        DB 63,64,66,67,68,69,70,71
        DB 73,74,75,76,77 ;position
PLOFF1  DB HIGH PL0 ;PM pointers
        DB HIGH PL1
PLOFF2  DB LOW PL0
        DB LOW PL1
COLSCO  DB $10,$50 ;masks
GOTIT   DB CACTUS OR $00 ;PF0
        DB CACTUS OR $40 ;PF1
WHERE   DB 1,19 ;score posit'
WHERE2  DB 2,13 ;ammo position
OPPON   DB 1,0 ;opponent
MISHIT  DB 2,1 ;collision checks
BITSON  DB 3,$C ;ORA turn ons
BITSOF  DB $FC,$F3 ;AND turn offs
TDIRX   DB 0,0,0,0,0,1,1,1 ;stick
        DB 0,$FF,$FF,$FF,0 ;deltas
        DB 0,0,0
TDIRY   DB 0,0,0,0,0,1,$FF
        DB 0,0,1,$FF,0,0
        DB 1,$FF,0
FEET    DB 10,16 ;footsteps
FREQ2   DB 40,24,16,12,10,9,8,10
        DB 15,22,16,64 ;ricochet
CONT2   DB $AC,$AD,$AE,$AF,$AD,$AA
        DB $A6,$A2,$A0
FREQ3   DB 10,11,10,9,11,10,8 ;boing
        DB 7,9,12,13,10,6,5,8,10
        DB 15,16,15,10,6,7,10,10
TAPS    DB 0
        DB $51,$60,$79 ;notes
        DB $60,$79,$79
DURAT   DB 0
        DB 64,8,16,64,8,16 ;durations
HOMEON  DB 0 ;Home, home on the...
        DB 108,108,81,72,64 ;Oh give
        DB 81,85,96,60,60,60
        DB 60,60,53,81,81,81,85,81,72
        DB 108,108,81,72,64 ;where
        DB 81,85,96,60,60,60
        DB 60,60,64,72,81,85,81,72,81
        DB 53,60,64,72,64 ;Home, home
        DB 72,81,81,81,81,85,81,72
        DB 108,108,81,72,64 ;where
        DB 81,85,96,60,60,60
        DB 60,60,64,72,81,85,81,72,81
DURAT2  DB 0
        DB 16,16,16,16,32
        DB 8,8,24,8,16,32
        DB 8,8,24,8,16,16,16,16,64
        DB 16,16,16,16,32
        DB 8,8,24,8,16,32
        DB 8,8,24,8,16,24,8,16,64
        DB 48,24,8,16,48
        DB 16,24,8,16,16,16,16,64
        DB 16,16,16,16,32
        DB 8,8,24,8,16,32
        DB 8,8,24,8,16,16,16,16,128
PICOFF  DB 0,0,0,0,0,$20,$30,$40
        DB 0,$50,$60,$70,0,$80
        DB $90,0
TCOLOR  DB $70,$30 ;player colors
THORIZ  DB $10,$88 ;and positions

* Alternate character set

NEWSET  DB 0,$41,$CF,$7F ;ammo dump
        DB $F0,$F8,$E0,0

        DB $18,$1B,$1B ;cactus
        DB $DB,$DF,$D8,$F8,$18

        DB 0,0,$30,$7C,$72
        DB $FE,$FF,$1F ;rock

        DB 0,0,0,$FF ;empty
        DB 0,$FF,0,0
        DB 0,$80,$80,$FF ;1
        DB $80,$FF,$80,0
        DB 0,$A0,$A0,$FF ;2
        DB $A0,$FF,$A0,0
        DB 0,$A8,$A8,$FF ;3
        DB $A8,$FF,$A8,0
        DB 0,$AA,$AA,$FF ;4
        DB $AA,$FF,$AA,0

        DB 0,$18,$3C,$18 ;a grave
        DB $18,$3C,$7E,$7E

* Cowboy shape table

SHAPE   DB $00,$28,$7C,$54 ;+1
        DB $7C,$38,$7C,$BA
        DB $BA,$BA,$79,$28
        DB $28,$68,$0C,$00

        DB $00,$14,$3E,$2A ;+2
        DB $3E,$1C,$3E,$5D
        DB $5D,$5D,$9E,$14
        DB $14,$16,$30,$00

        DB $04,$14,$7C,$68 ;
        DB $74,$38,$78,$BC
        DB $BA,$B9,$78,$28
        DB $28,$28,$2C,$60

        DB $04,$14,$7C,$69 ;
        DB $76,$3C,$78,$B8
        DB $B8,$B8,$78,$28
        DB $28,$28,$2C,$60

        DB $04,$14,$7C,$68 ;
        DB $74,$38,$7F,$B8
        DB $B8,$B8,$78,$28
        DB $28,$28,$2C,$60

        DB $20,$28,$3E,$16 ;
        DB $2E,$1C,$1E,$3D
        DB $5D,$9D,$1E,$14
        DB $14,$14,$34,$06

        DB $20,$28,$3E,$96 ;
        DB $6E,$3C,$1E,$1D
        DB $1D,$1D,$1E,$14
        DB $14,$14,$34,$06

THEMAN  DB $20,$28,$3E,$16 ;
        DB $2E,$1C,$FE,$1D
        DB $1D,$1D,$1E,$14
        DB $14,$14,$34,$06

        DB $04,$14,$7C,$68 ;
        DB $74,$38,$7E,$BA
        DB $BA,$BA,$7A,$28
        DB $28,$28,$2C,$60

        DB $20,$28,$7E,$56 ;
        DB $6E,$5C,$7E,$1D
        DB $1D,$1D,$1E,$14
        DB $14,$14,$34,$06

        DB 0,0,0,0,0,0,0,0,0,0 ;DEAD
        DB $10,$3B,$BB,$FF,0,0

        DB $00,$14,$3E,$2A ;NOMOVE
        DB $3E,$1C,$3E,$5D
        DB $5D,$5D,$5D,$14
        DB $14,$14,$36,$00

* The display list is 12 graphic 2's

DLIST   DB $70,$70,$70
        DB $47
        DW DISP
        DB 7,7,7,7,7,7,7,7,7,7,7
        DB $41
        DW DLIST

        ;and that's all she wrote!

        END INIT  

This is non-commercial site, its content is based on Atari 8-bit home computer contents and references.
If you feel your rights are violated by showing/using any part of contents of your product represented on this page, please contact me immediatelly so I can remove it!