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 ; ---------------------------------------------------------------------------
51 ; ---------------------------------------------------------------------------
52 ; Vector and other locations
58 ; ---------------------------------------------------------------------------
62 VIC_LINES := $9003 ; Screen lines, bit 7 is bit 0 from VIC_HLINE
63 VIC_HLINE := $9004 ; Rasterline, bits 1-8
64 VIC_COLOR := $900F ; Border and background color
66 ; ---------------------------------------------------------------------------
69 VIA1 := $9110 ; VIA1 base address
70 VIA1_JOY := VIA1+$0 ; *** Deprecated ***
71 VIA1_PB := VIA1+$0 ; Port register B
72 VIA1_PA1 := VIA1+$1 ; Port register A
73 VIA1_DDRB := VIA1+$2 ; Data direction register B
74 VIA1_DDRA := VIA1+$3 ; Data direction register A
75 VIA1_T1CL := VIA1+$4 ; Timer 1, low byte
76 VIA1_T1CH := VIA1+$5 ; Timer 1, high byte
77 VIA1_T1LL := VIA1+$6 ; Timer 1 latch, low byte
78 VIA1_T1LH := VIA1+$7 ; Timer 1 latch, high byte
79 VIA1_T2CL := VIA1+$8 ; Timer 2, low byte
80 VIA1_T2CH := VIA1+$9 ; Timer 2, high byte
81 VIA1_SR := VIA1+$A ; Shift register
82 VIA1_CR := VIA1+$B ; Auxiliary control register
83 VIA1_PCR := VIA1+$C ; Peripheral control register
84 VIA1_IFR := VIA1+$D ; Interrupt flag register
85 VIA1_IER := VIA1+$E ; Interrupt enable register
86 VIA1_PA2 := VIA1+$F ; Port register A w/o handshake
88 ; ---------------------------------------------------------------------------
91 VIA2 := $9120 ; VIA2 base address
92 VIA2_JOY := VIA2+$0 ; *** Deprecated ***
93 VIA2_PB := VIA2+$0 ; Port register B
94 VIA2_PA1 := VIA2+$1 ; Port register A
95 VIA2_DDRB := VIA2+$2 ; Data direction register B
96 VIA2_DDRA := VIA2+$3 ; Data direction register A
97 VIA2_T1CL := VIA2+$4 ; Timer 1, low byte
98 VIA2_T1CH := VIA2+$5 ; Timer 1, high byte
99 VIA2_T1LL := VIA2+$6 ; Timer 1 latch, low byte
100 VIA2_T1LH := VIA2+$7 ; Timer 1 latch, high byte
101 VIA2_T2CL := VIA2+$8 ; Timer 2, low byte
102 VIA2_T2CH := VIA2+$9 ; Timer 2, high byte
103 VIA2_SR := VIA2+$A ; Shift register
104 VIA2_CR := VIA2+$B ; Auxiliary control register
105 VIA2_PCR := VIA2+$C ; Peripheral control register
106 VIA2_IFR := VIA2+$D ; Interrupt flag register
107 VIA2_IER := VIA2+$E ; Interrupt enable register
108 VIA2_PA2 := VIA2+$F ; Port register A w/o handshake