;****************************************************************************
;*                         ATARI PERSONAL COMPUTER                          *
;*                              SYSTEM EQUATES                              *
;****************************************************************************

FAKEADDR EQU $0002

ATRACT  EQU FAKEADDR
RTCLOK	EQU	$12	;REAL TIME CLOCK
;
; PAGE TWO RAM ASSIGNMENTS
;
VDSLST	EQU	FAKEADDR	;DSP LIST NMI VECTOR
VPRCED	EQU	FAKEADDR	;PROCEED IRQ VECTOR
VINTER	EQU	FAKEADDR	;INTERUPT IRQ VECTOR
VBREAK	EQU	FAKEADDR	;BRK INST IRQ VECTOR
VKEYBD	EQU	FAKEADDR	;POKEY KB IRQ VECTOR
VSERIN	EQU	FAKEADDR	;POKEY INPUT RDY IRQ
VSEROR	EQU	FAKEADDR	;POKEY OUTPUT RDY
VSEROC	EQU	FAKEADDR	;POKEY OUTPUT DONE
VTIMR1	EQU	FAKEADDR	;POKEY TIMER 1 IRQ
VTIMR2	EQU	FAKEADDR	;POKEY TIMER 2 IRQ
VTIMR4	EQU	FAKEADDR	;POKEY TIMER 4 IRQ
VIMIRQ	EQU	FAKEADDR	;IMMED IRQ VECTOR
CDTMV1	EQU	FAKEADDR	;COUNT DOWN TIMER 1
CDTMV2	EQU	FAKEADDR	;COUNT DOWN TIMER 2
CDTMV3	EQU	FAKEADDR	;COUNT DOWN TIMER 3
CDTMV4	EQU	FAKEADDR	;COUNT DOWN TIMER 4
CDTMV5	EQU	FAKEADDR	;COUNT DOWN TIMER 5
VVBLKI	EQU	FAKEADDR	;IMM VBLK NMI VECTOR
VVBLKD	EQU	FAKEADDR	;DEF VBLK NMI VECTOR
CDTMA1	EQU	FAKEADDR	;CDTMV1 JSR ADDRESS
CDTMA2	EQU	FAKEADDR	;CDTMV2 JSR ADDRESS
CDTMF3	EQU	FAKEADDR	;CDTMV3 FLAG
SRTIMR	EQU	FAKEADDR	;SOFTWARE REPEAT TMR
CDTMF4	EQU	FAKEADDR	;CDTMV4 FLAG
INTEMP	EQU	FAKEADDR	;IAN'S TEMP
CDTMF5	EQU	FAKEADDR	;CDTMV5 FLAG
DMACTLS	EQU	FAKEADDR	;SAVE DMACTL REG
DLPTRS	EQU	FAKEADDR	;SAVE DISP LIST LO
;SDLSTH	EQU	$0231	;SAVE DISP LIST HI
SSKCTL	EQU	FAKEADDR	;SKCTL REGISTER RAM
LCOUNT	EQU	FAKEADDR	;LOADER TEMP
LPENH 	EQU	FAKEADDR	;LIGHT PEN HORIZONTAL
LPENV 	EQU	FAKEADDR	;LIGHT PEN VERTICAL
BRKKY 	EQU	FAKEADDR	;BREAK KEY VECTOR
RELADR	EQU	FAKEADDR	;LOADER REL ADDR
CDEVIC	EQU	FAKEADDR	;COMMAND BUFFER-DEV
CCOMND	EQU	FAKEADDR	;COMMAND BUFFER-CMND
CAUX1 	EQU	FAKEADDR	;COMMAND BUFFER AUX1
CAUX2 	EQU	FAKEADDR	;COMMAND BUFFER AUX2
;TEMP  	EQU	$023E	;TEMPORARY RAM CELL
ERRFLG	EQU	FAKEADDR	;DEVICE ERROR FLAG
DFLAGS	EQU	FAKEADDR	;DISK FLAGS(SECTOR1)
DBSECT	EQU	FAKEADDR	;# DISK BOOT SECTORS
BOOTAD	EQU	FAKEADDR	;DISK BOOT ADDRESS
COLDST	EQU	FAKEADDR	;COLDSTART FLAG 1=CS
RECLEN	EQU	FAKEADDR	;LOADER LENGTH
DSKTIM	EQU	FAKEADDR	;DISK TIME OUT REG
VSFLAG	EQU	FAKEADDR	;FINE SCROLL TEMP
KEYDIS	EQU	FAKEADDR	;KEY DISABLE FLAG
FINE  	EQU	FAKEADDR	;FINE SCROLL ENABLE(A1200)
GPRIOR	EQU	FAKEADDR	;GLOBAL PRIORITY
PADDL0	EQU	FAKEADDR	;POT 0 RAM CELL
PADDL1	EQU	FAKEADDR
PADDL2	EQU	FAKEADDR
PADDL3	EQU	FAKEADDR
STICK0	EQU	FAKEADDR	;JOYSTICK 0 RAM CELL
STICK1	EQU	FAKEADDR
PTRIG0	EQU	FAKEADDR	;PADDLE TRIGGER 0
PTRIG1	EQU	FAKEADDR
PTRIG2	EQU	FAKEADDR
PTRIG3	EQU	FAKEADDR
STRIG0	EQU	FAKEADDR	;JOYSTICK TRIGGER 0
STRIG1	EQU	FAKEADDR
HIBYTE	EQU	FAKEADDR	;LOADER
WMODE 	EQU	FAKEADDR	;CASSETTE R/W MODE
BLIM  	EQU	FAKEADDR	;CASSETTE RECORD SIZE
IMASK 	EQU	FAKEADDR
JVECK 	EQU	FAKEADDR	;JUMP VECTOR
NEWADR	EQU	FAKEADDR	;LOADER NEW ADDRESS
TXTROW	EQU	FAKEADDR	;TEXT ROWCRS
TXTCOL	EQU	FAKEADDR	;TEXT COLCRS
TINDEX	EQU	FAKEADDR	;TEXT INDEX
TXTMSC	EQU	FAKEADDR	;TEXT WINDOW MEM ADD
TXTOLD	EQU	FAKEADDR	;TEXT OLDROW & COL
CRETRY	EQU	FAKEADDR	;# COMMAND RETRIES
HOLD3 	EQU	FAKEADDR
SUBTMP	EQU	FAKEADDR
HOLD2 	EQU	FAKEADDR
DMASK 	EQU	FAKEADDR	;PIXEL LOCATION MASK
TMPLBT	EQU	FAKEADDR
ESCFLG	EQU	FAKEADDR	;ESCAPE FLAG
TABMAP	EQU	FAKEADDR	;TAB STOP MAP
LOGMAP	EQU	FAKEADDR 	;LINE START BIT MAP
INVFLG	EQU	FAKEADDR	;INVERSE VIDEO FLAG
FILFLG	EQU	FAKEADDR	;FILL FLAG FOR DRAW
TMPROW	EQU	FAKEADDR
TMPCOL	EQU	FAKEADDR
SCRFLG	EQU	FAKEADDR	;SET IF SCROLLING
HOLD4 	EQU	FAKEADDR	;TEMP USED BY DRAW
DRETRY	EQU	FAKEADDR	;# OF DEVICE RETRIES
SHFLOK	EQU	FAKEADDR	;SHIFT/CTL LOCK FLAG
BOTSCR	EQU	FAKEADDR	;BOTTOM OF SCREEN
PCOLR0	EQU	FAKEADDR	;P0 COLOR
PCOLR1	EQU	FAKEADDR	;P1 COLOR
PCOLR2	EQU	FAKEADDR	;P2 COLOR
PCOLR3	EQU	FAKEADDR	;P3 COLOR
COLOR0	EQU	FAKEADDR	;COLOR 0
COLOR1	EQU	FAKEADDR
COLOR2	EQU	FAKEADDR
COLOR3	EQU	FAKEADDR
COLOR4	EQU	FAKEADDR
COLBAKS EQU COLOR4
CHBAS 	EQU	FAKEADDR	;CHBAS REGISTER RAM
;
;    COLLEEN MNEMONICS
;
; ---------------------------------------------------------------------------
POKEY 	EQU	FAKEADDR
; ---------------------------------------------------------------------------
;
; READ
;
POT0  	EQU	POKEY+$00
POT1  	EQU	POKEY+$00
POT2  	EQU	POKEY+$00
POT3  	EQU	POKEY+$00
POT4  	EQU	POKEY+$00
POT5  	EQU	POKEY+$00
POT6  	EQU	POKEY+$00
POT7  	EQU	POKEY+$00
ALLPOT	EQU	POKEY+$00
KBCODE	EQU	POKEY+$00
; !!!!!
;RANDOM	EQU	POKEY+$00
;
POTGO 	EQU	POKEY+$00
SERIN 	EQU	POKEY+$00
IRQST 	EQU	POKEY+$00
SKSTAT	EQU	POKEY+$00
;
; WRITE
;
AUDF1 	EQU	POKEY+$00
AUDC1 	EQU	POKEY+$00
AUDF2 	EQU	POKEY+$00
AUDC2 	EQU	POKEY+$00
AUDF3 	EQU	POKEY+$00
AUDC3 	EQU	POKEY+$00
AUDF4 	EQU	POKEY+$00
AUDC4 	EQU	POKEY+$00
AUDCTL	EQU	POKEY+$00
STIMER	EQU	POKEY+$00
SKRES 	EQU	POKEY+$00
SEROUT	EQU	POKEY+$00
IRQEN 	EQU	POKEY+$00
SKCTL 	EQU	POKEY+$00
;
;
;
; ---------------------------------------------------------------------------
GTIA  	EQU	FAKEADDR
; ---------------------------------------------------------------------------
;
; WRITE
;
HPOSP0	EQU	GTIA+$00
HPOSP1	EQU	GTIA+$00
HPOSP2	EQU	GTIA+$00
HPOSP3	EQU	GTIA+$00
HPOSM0	EQU	GTIA+$00
HPOSM1	EQU	GTIA+$00
HPOSM2	EQU	GTIA+$00
HPOSM3	EQU	GTIA+$00
SIZEP0	EQU	GTIA+$00
SIZEP1	EQU	GTIA+$00
SIZEP2	EQU	GTIA+$00
SIZEP3	EQU	GTIA+$00
SIZEM 	EQU	GTIA+$00
GRAFP0	EQU	GTIA+$00
GRAFP1	EQU	GTIA+$00
GRAFP2	EQU	GTIA+$00
GRAFP3	EQU	GTIA+$00
GRAFM 	EQU	GTIA+$00
COLPM0	EQU	GTIA+$00
COLPM1	EQU	GTIA+$00
COLPM2	EQU	GTIA+$00
COLPM3	EQU	GTIA+$00
COLPF0	EQU	GTIA+$00
COLPF1	EQU	GTIA+$00
COLPF2	EQU	GTIA+$00
COLPF3	EQU	GTIA+$00
COLBAK	EQU	GTIA+$00
PRIOR 	EQU	GTIA+$00
VDELAY	EQU	GTIA+$00
GRACTL	EQU	GTIA+$00
HITCLR	EQU	GTIA+$00
CONSOL	EQU	GTIA+$00
;
; READ
;
M0PF  	EQU	GTIA+$00
M1PF  	EQU	GTIA+$00
M2PF  	EQU	GTIA+$00
M3PF  	EQU	GTIA+$00
P0PF  	EQU	GTIA+$00
P1PF  	EQU	GTIA+$00
P2PF  	EQU	GTIA+$00
P3PF  	EQU	GTIA+$00
M0PL  	EQU	GTIA+$00
M1PL  	EQU	GTIA+$00
M2PL  	EQU	GTIA+$00
M3PL  	EQU	GTIA+$00
P0PL  	EQU	GTIA+$00
P1PL  	EQU	GTIA+$00
P2PL  	EQU	GTIA+$00
P3PL  	EQU	GTIA+$00
TRIG0 	EQU	GTIA+$00
TRIG1 	EQU	GTIA+$00
TRIG2 	EQU	GTIA+$00
TRIG3 	EQU	GTIA+$00
PAL     EQU GTIA+$00
;
;
; ---------------------------------------------------------------------------
ANTIC 	EQU	FAKEADDR
; ---------------------------------------------------------------------------
;
DMACTL	EQU	ANTIC+$00
CHACTL	EQU	ANTIC+$00
DLPTR	EQU	ANTIC+$00
;DLISTH	EQU	ANTIC+$00
HSCROL	EQU	ANTIC+$00
VSCROL	EQU	ANTIC+$00
PMBASE	EQU	ANTIC+$00
CHBASE	EQU	ANTIC+$00
WSYNC 	EQU	ANTIC+$00
; !!!!
VCOUNT	EQU	ANTIC+$00
; ----
PENH  	EQU	ANTIC+$00
PENV  	EQU	ANTIC+$00
NMIEN 	EQU	ANTIC+$00
NMIRES	EQU	ANTIC+$00
NMIST 	EQU	ANTIC+$00
;
;
; ---------------------------------------------------------------------------
PIA   	EQU	FAKEADDR
; ---------------------------------------------------------------------------
;
PORTA 	EQU	PIA+0
PORTB 	EQU	PIA+0
PACTL 	EQU	PIA+0
PBCTL 	EQU	PIA+0
;
; ---------------------------------------------------------------------------
;                 Atari ANTIC chip display list equates
; ---------------------------------------------------------------------------
;
JUMP	EQU	$01	; display list jump instruction (3 byte)
JVB	EQU	$41	; display list jump and wait for vblank instruction (3)
;
SCH	EQU	$10	; display list horizontal scrolling
SCV	EQU	$20	; display list vertical scrolling
LMS	EQU	$40	; display list load memory scan instruction (3 byte)
DLII	EQU	$80	; display list interrupt instruction
;
SKIP1	EQU	$00	; display list skip 1 scan line instruction
SKIP2	EQU	$10	; display list skip 2 scan lines instruction
SKIP3	EQU	$20	; display list skip 3 scan lines instruction
SKIP4	EQU	$30	; display list skip 4 scan lines instruction
SKIP5	EQU	$40	; display list skip 5 scan lines instruction
SKIP6	EQU	$50	; display list skip 6 scan lines instruction
SKIP7	EQU	$60	; display list skip 7 scan lines instruction
SKIP8	EQU	$70	; display list skip 8 scan lines instruction
;
MODE2	EQU	$02	; display list mode 2
MODE4	EQU	$04	; display list mode 4
MODE8	EQU	$08	; display list mode 8
MODEE	EQU	$0E	; display list mode E
MODEF	EQU	$0F	; display list mode F

; ---------------------------------------------------------------------------
; KBCODEs
; ---------------------------------------------------------------------------
.enum @kbcode
    _none = 255
    _esc = 28
    _1 = 31
    _2 = 30
    _3 = 26
    _4 = 24
    _5 = 29
    _6 = 27
    _7 = 51
    _8 = 53
    _9 = 48
    _0 = 50
    _lt = 54
    _gt = 55
    _del = 52
    _tab = 44
    _Q = 47
    _W = 46
    _E = 42
    _R = 40
    _T = 45
    _Y = 43
    _U = 11
    _I = 13
    _O = 8
    _P = 10
    _min = 14
    _up =  14  ; cursor function 
    _eq = 15
    _down = 15 ; cursor function
    _ret = 12
    _A = 63
    _S = 62
    _D = 58
    _F = 56
    _G = 61
    _H = 57
    _J = 1
    _K = 5
    _L = 0
    _semicolon = 2
    _plus = 6
    _left = 6  ; cursor function
    _asterisk = 7
    _right = 7 ; cursor function
    _caps = 60
    _Z = 23
    _X = 22
    _C = 18
    _V = 16
    _B = 21
    _N = 36
    _M = 37
    _comma = 32
    _dot = 34
    _slash = 38
    _atari = 39
    _help = 17
    _F1 = 3
    _F2 = 4
    _F3 = 19
    _F4 = 20
    _space = 33
.ende