]> git.sur5r.net Git - cc65/blob - asminc/vic20.inc
Moved kernal entries to cbm_kernal.inc
[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 ; Vector and other locations
46
47 IRQVec          := $0314
48 BRKVec          := $0316
49 NMIVec          := $0318
50
51 ; ---------------------------------------------------------------------------
52 ; I/O: 6560 VIC
53
54 VIC             := $9000
55 VIC_CR0         := VIC+$0
56 VIC_CR1         := VIC+$1
57 VIC_CR2         := VIC+$2
58 VIC_CR3         := VIC+$3
59 VIC_LINES       := VIC+$3       ; Screen lines, bit 7 is bit 0 from VIC_HLINE
60 VIC_CR4         := VIC+$4
61 VIC_HLINE       := VIC+$4       ; Rasterline, bits 1-8
62 VIC_CR5         := VIC+$5
63 VIC_CR6         := VIC+$6
64 VIC_CR7         := VIC+$7
65 VIC_CR8         := VIC+$8
66 VIC_CR9         := VIC+$9
67 VIC_CRA         := VIC+$A
68 VIC_CRB         := VIC+$B
69 VIC_CRC         := VIC+$C
70 VIC_CRD         := VIC+$D
71 VIC_CRE         := VIC+$E
72 VIC_CRF         := VIC+$F
73 VIC_COLOR       := VIC+$F       ; Border and background color
74
75 ; ---------------------------------------------------------------------------
76 ; I/O: 6522 VIA1
77
78 VIA1            := $9110        ; VIA1 base address
79 VIA1_JOY        := VIA1+$0      ; *** Deprecated ***
80 VIA1_PB         := VIA1+$0      ; Port register B
81 VIA1_PA1        := VIA1+$1      ; Port register A
82 VIA1_DDRB       := VIA1+$2      ; Data direction register B
83 VIA1_DDRA       := VIA1+$3      ; Data direction register A
84 VIA1_T1CL       := VIA1+$4      ; Timer 1, low byte
85 VIA1_T1CH       := VIA1+$5      ; Timer 1, high byte
86 VIA1_T1LL       := VIA1+$6      ; Timer 1 latch, low byte
87 VIA1_T1LH       := VIA1+$7      ; Timer 1 latch, high byte
88 VIA1_T2CL       := VIA1+$8      ; Timer 2, low byte
89 VIA1_T2CH       := VIA1+$9      ; Timer 2, high byte
90 VIA1_SR         := VIA1+$A      ; Shift register
91 VIA1_CR         := VIA1+$B      ; Auxiliary control register
92 VIA1_PCR        := VIA1+$C      ; Peripheral control register
93 VIA1_IFR        := VIA1+$D      ; Interrupt flag register
94 VIA1_IER        := VIA1+$E      ; Interrupt enable register
95 VIA1_PA2        := VIA1+$F      ; Port register A w/o handshake
96
97 ; ---------------------------------------------------------------------------
98 ; I/O: 6522 VIA2
99
100 VIA2            := $9120        ; VIA2 base address
101 VIA2_JOY        := VIA2+$0      ; *** Deprecated ***
102 VIA2_PB         := VIA2+$0      ; Port register B
103 VIA2_PA1        := VIA2+$1      ; Port register A
104 VIA2_DDRB       := VIA2+$2      ; Data direction register B
105 VIA2_DDRA       := VIA2+$3      ; Data direction register A
106 VIA2_T1CL       := VIA2+$4      ; Timer 1, low byte
107 VIA2_T1CH       := VIA2+$5      ; Timer 1, high byte
108 VIA2_T1LL       := VIA2+$6      ; Timer 1 latch, low byte
109 VIA2_T1LH       := VIA2+$7      ; Timer 1 latch, high byte
110 VIA2_T2CL       := VIA2+$8      ; Timer 2, low byte
111 VIA2_T2CH       := VIA2+$9      ; Timer 2, high byte
112 VIA2_SR         := VIA2+$A      ; Shift register
113 VIA2_CR         := VIA2+$B      ; Auxiliary control register
114 VIA2_PCR        := VIA2+$C      ; Peripheral control register
115 VIA2_IFR        := VIA2+$D      ; Interrupt flag register
116 VIA2_IER        := VIA2+$E      ; Interrupt enable register
117 VIA2_PA2        := VIA2+$F      ; Port register A w/o handshake