2 ; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
6 ; ---------------------------------------------------------------------------
7 ; Zero page, Commodore stuff
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
28 BASIC_BUF := $200 ; Location of command-line
29 BASIC_BUF_LEN = 89 ; Maximum length of command-line
32 CURS_COLOR := $287 ; Color under the cursor
36 KBDREPEATDELAY := $28c
38 ; ---------------------------------------------------------------------------
44 ; ---------------------------------------------------------------------------
45 ; Vector and other locations
51 ; ---------------------------------------------------------------------------
59 VIC_LINES := VIC+$3 ; Screen lines, bit 7 is bit 0 from VIC_HLINE
61 VIC_HLINE := VIC+$4 ; Rasterline, bits 1-8
73 VIC_COLOR := VIC+$F ; Border and background color
75 ; ---------------------------------------------------------------------------
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
97 ; ---------------------------------------------------------------------------
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