]> git.sur5r.net Git - cc65/blob - asminc/vic20.inc
Added VIC control register names
[cc65] / asminc / vic20.inc
1 ;
2 ; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
3 ;
4
5
6 ; ---------------------------------------------------------------------------
7 ; Zero page, Commodore stuff
8
9 VARTAB          := $2D          ; Pointer to start of BASIC variables
10 MEMSIZE         := $37          ; Pointer to highest BASIC RAM location (+1)
11 TXTPTR          := $7A          ; Pointer into BASIC source code
12 TIME            := $A0          ; 60HZ clock
13 FNAM_LEN        := $B7          ; Length of filename
14 SECADR          := $B9          ; Secondary address
15 DEVNUM          := $BA          ; Device number
16 FNAM            := $BB          ; Pointer to filename
17 KEY_COUNT       := $C6          ; Number of keys in input buffer
18 RVS             := $C7          ; Reverse flag
19 CURS_FLAG       := $CC          ; 1 = cursor off
20 CURS_BLINK      := $CD          ; Blink counter
21 CURS_CHAR       := $CE          ; Character under the cursor
22 CURS_STATE      := $CF          ; Cursor blink state
23 SCREEN_PTR      := $D1          ; Pointer to current char in text screen
24 CURS_X          := $D3          ; Cursor column
25 CURS_Y          := $D6          ; Cursor row
26 CRAM_PTR        := $F3          ; Pointer to current char in color RAM
27
28 BASIC_BUF       := $200         ; Location of command-line
29 BASIC_BUF_LEN   = 89            ; Maximum length of command-line
30
31 CHARCOLOR       := $286
32 CURS_COLOR      := $287         ; Color under the cursor
33
34 KBDREPEAT       := $28a
35 KBDREPEATRATE   := $28b
36 KBDREPEATDELAY  := $28c
37
38 ; ---------------------------------------------------------------------------
39 ; Screen size
40
41 XSIZE           = 22
42 YSIZE           = 23
43
44 ; ---------------------------------------------------------------------------
45 ; Kernal routines
46
47 ; Direct entries
48 CLRSCR          := $E55F
49 KBDREAD         := $E5CF
50
51 ; ---------------------------------------------------------------------------
52 ; Vector and other locations
53
54 IRQVec          := $0314
55 BRKVec          := $0316
56 NMIVec          := $0318
57
58 ; ---------------------------------------------------------------------------
59 ; I/O: 6560 VIC
60
61 VIC             := $9000
62 VIC_CR0         := VIC+$0
63 VIC_CR1         := VIC+$1
64 VIC_CR2         := VIC+$2
65 VIC_CR3         := VIC+$3
66 VIC_LINES       := VIC+$3       ; Screen lines, bit 7 is bit 0 from VIC_HLINE
67 VIC_CR4         := VIC+$4
68 VIC_HLINE       := VIC+$4       ; Rasterline, bits 1-8
69 VIC_CR5         := VIC+$5
70 VIC_CR6         := VIC+$6
71 VIC_CR7         := VIC+$7
72 VIC_CR8         := VIC+$8
73 VIC_CR9         := VIC+$9
74 VIC_CRA         := VIC+$A
75 VIC_CRB         := VIC+$B
76 VIC_CRC         := VIC+$C
77 VIC_CRD         := VIC+$D
78 VIC_CRE         := VIC+$E
79 VIC_CRF         := VIC+$F
80 VIC_COLOR       := VIC+$F       ; Border and background color
81
82 ; ---------------------------------------------------------------------------
83 ; I/O: 6522 VIA1
84
85 VIA1            := $9110        ; VIA1 base address
86 VIA1_JOY        := VIA1+$0      ; *** Deprecated ***
87 VIA1_PB         := VIA1+$0      ; Port register B
88 VIA1_PA1        := VIA1+$1      ; Port register A
89 VIA1_DDRB       := VIA1+$2      ; Data direction register B
90 VIA1_DDRA       := VIA1+$3      ; Data direction register A
91 VIA1_T1CL       := VIA1+$4      ; Timer 1, low byte
92 VIA1_T1CH       := VIA1+$5      ; Timer 1, high byte
93 VIA1_T1LL       := VIA1+$6      ; Timer 1 latch, low byte
94 VIA1_T1LH       := VIA1+$7      ; Timer 1 latch, high byte
95 VIA1_T2CL       := VIA1+$8      ; Timer 2, low byte
96 VIA1_T2CH       := VIA1+$9      ; Timer 2, high byte
97 VIA1_SR         := VIA1+$A      ; Shift register
98 VIA1_CR         := VIA1+$B      ; Auxiliary control register
99 VIA1_PCR        := VIA1+$C      ; Peripheral control register
100 VIA1_IFR        := VIA1+$D      ; Interrupt flag register
101 VIA1_IER        := VIA1+$E      ; Interrupt enable register
102 VIA1_PA2        := VIA1+$F      ; Port register A w/o handshake
103
104 ; ---------------------------------------------------------------------------
105 ; I/O: 6522 VIA2
106
107 VIA2            := $9120        ; VIA2 base address
108 VIA2_JOY        := VIA2+$0      ; *** Deprecated ***
109 VIA2_PB         := VIA2+$0      ; Port register B
110 VIA2_PA1        := VIA2+$1      ; Port register A
111 VIA2_DDRB       := VIA2+$2      ; Data direction register B
112 VIA2_DDRA       := VIA2+$3      ; Data direction register A
113 VIA2_T1CL       := VIA2+$4      ; Timer 1, low byte
114 VIA2_T1CH       := VIA2+$5      ; Timer 1, high byte
115 VIA2_T1LL       := VIA2+$6      ; Timer 1 latch, low byte
116 VIA2_T1LH       := VIA2+$7      ; Timer 1 latch, high byte
117 VIA2_T2CL       := VIA2+$8      ; Timer 2, low byte
118 VIA2_T2CH       := VIA2+$9      ; Timer 2, high byte
119 VIA2_SR         := VIA2+$A      ; Shift register
120 VIA2_CR         := VIA2+$B      ; Auxiliary control register
121 VIA2_PCR        := VIA2+$C      ; Peripheral control register
122 VIA2_IFR        := VIA2+$D      ; Interrupt flag register
123 VIA2_IER        := VIA2+$E      ; Interrupt enable register
124 VIA2_PA2        := VIA2+$F      ; Port register A w/o handshake