-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathC64Constants.asm
209 lines (193 loc) · 6.27 KB
/
C64Constants.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#importonce
//===============================================================================
// $00-$FF PAGE .label Zero (256 bytes)
// $00-$01 Reserved for IO
.label ZeroPageTemp = $02
// $03-$8F Reserved for BASIC
// using $73-$8A CHRGET as BASIC not used for our game
.label ZeroPageParam1 = $73
.label ZeroPageParam2 = $74
.label ZeroPageParam3 = $75
.label ZeroPageParam4 = $76
.label ZeroPageParam5 = $77
.label ZeroPageParam6 = $78
.label ZeroPageParam7 = $79
.label ZeroPageParam8 = $7A
.label ZeroPageParam9 = $7B
// $90-$FA Reserved for Kernal
.label ZeroPageLow = $45
.label ZeroPageHigh = $46
.label ZeroPageLow2 = $47
.label ZeroPageHigh2 = $48
// $FF Reserved for Kernal
//===============================================================================
// $0200-$9FFF RAM (40K)
.label SCREENRAM = $0400
.label COLORRAM = $D800
.label SPRITE0 = $07F8
// $0801
// Game code is placed here by using the *=$0801 directive
// in gameMain.asm
// 192 decimal * 64(sprite size) = 10880(hex $2A80)
.label SPRITERAM = 170
//===============================================================================
// $D000-$DFFF IO (4K)
// These are some of the C64 registers that are mapped into
// IO memory space
// Names taken from 'Mapping the Commodore 64' book
.label VIC_SP0X = $D000
.label VIC_SP0Y = $D001
.label VIC_MSIGX = $D010
.label VIC_SCROLY = $D011
.label VIC_RASTER = $D012
.label VIC_SPENA = $D015
.label VIC_SCROLX = $D016
.label VIC_YXPAND = $D017
.label VIC_VMCSB = $D018
.label VIC_VICIRQ = $D019
.label VIC_IRQMSK = $D01A
.label VIC_SPBGPR = $D01B
.label VIC_SPMC = $D01C
.label VIC_XXPAND = $D01D
.label VIC_SPSPCL = $D01E
.label VIC_SPBGCL = $D01F
.label VIC_EXTCOL = $D020
.label VIC_BGCOL0 = $D021
.label VIC_BGCOL1 = $D022
.label VIC_BGCOL2 = $D023
.label VIC_BGCOL3 = $D024
.label VIC_SPMC0 = $D025
.label VIC_SPMC1 = $D026
.label VIC_SP0COL = $D027
.label SID_FRELO1 = $D400 //(54272)
.label SID_FREHI1 = $D401 //(54273)
.label SID_PWLO1 = $D402 //(54274)
.label SID_PWHI1 = $D403 //(54275)
.label SID_VCREG1 = $D404 //(54276)
.label SID_ATDCY1 = $D405 //(54277)
.label SID_SUREL1 = $D406 //(54278)
.label SID_FRELO2 = $D407 //(54279)
.label SID_FREHI2 = $D408 //(54280)
.label SID_PWLO2 = $D409 //(54281)
.label SID_PWHI2 = $D40A //(54282)
.label SID_VCREG2 = $D40B //(54283)
.label SID_ATDCY2 = $D40C //(54284)
.label SID_SUREL2 = $D40D //(54285)
.label SID_FRELO3 = $D40E //(54286)
.label SID_FREHI3 = $D40F //(54287)
.label SID_PWLO3 = $D410 //(54288)
.label SID_PWHI3 = $D411 //(54289)
.label SID_VCREG3 = $D412 //(54290)
.label SID_ATDCY3 = $D413 //(54291)
.label SID_SUREL3 = $D414 //(54292)
.label SID_SIGVOL = $D418 //(54296)
.label CIAPRA = $DC00
.label CIAPRB = $DC01
// Kernel Jump Vectors
.label krljmp_PCINT = $FF81
.label krljmp_IOINIT = $FF84
.label krljmp_RAMTAS = $FF87
.label krljmp_RESTOR = $FF8A
.label krljmp_VECTOR = $FF8D
.label krljmp_SETMSG = $FF90
.label krljmp_SECOND = $FF93
.label krljmp_TKSA = $FF96
.label krljmp_MEMTOP = $FF99
.label krljmp_MEMBOT = $FF9C
.label krljmp_SCNKEY = $FF9F
.label krljmp_SETTMO = $FFA2
.label krljmp_ACPTR = $FFA5
.label krljmp_CIOUT = $FFA8
.label krljmp_UNTALK = $FFAB
.label krljmp_UNLSN = $FFAE
.label krljmp_LISTEN = $FFB1
.label krljmp_TALK = $FFB4
.label krljmp_READST = $FFB7
.label krljmp_SETLFS = $FFBA
.label krljmp_SETNAM = $FFBD
.label krljmp_OPEN = $FFC0
.label krljmp_CLOSE = $FFC3
.label krljmp_CHKIN = $FFC6
.label krljmp_CHKOUT = $FFC9
.label krljmp_CLRCHN = $FFCC
.label krljmp_CHRIN = $FFCF
.label krljmp_CHROUT = $FFD2
.label krljmp_LOAD = $FFD5
.label krljmp_SAVE = $FFD8
.label krljmp_SETTIM = $FFDB
.label krljmp_RDTIM = $FFDE
.label krljmp_STOP = $FFE1
.label krljmp_GETIN = $FFE4
.label krljmp_CLALL = $FFE7
.label krljmp_UDTIM = $FFEA
.label krljmp_SCREEN = $FFED
.label krljmp_PLOT = $FFF0
.label krljmp_BASE = $FFF3
.label krljmpLSTX = 197
//Peek(197) Codes
.const scanCode_INS_DEL = 0
.const scanCode_RET = 1
.const scanCode_CUR_RI = 2
.const scanCode_F7 = 3
.const scanCode_F1 = 4
.const scanCode_F3 = 5
.const scanCode_F5 = 6
.const scanCode_CUR_DN = 7
.const scanCode_3 = 8
.const scanCode_W = 9
.const scanCode_A = 10
.const scanCode_4 = 11
.const scanCode_Z = 12
.const scanCode_S = 13
.const scanCode_E = 14
.const scanCode_5 = 16
.const scanCode_R = 17
.const scanCode_D = 18
.const scanCode_6 = 19
.const scanCode_C = 20
.const scanCode_F = 21
.const scanCode_T = 22
.const scanCode_X = 23
.const scanCode_7 = 24
.const scanCode_Y = 25
.const scanCode_G = 26
.const scanCode_8 = 27
.const scanCode_B = 28
.const scanCode_H = 29
.const scanCode_U = 30
.const scanCode_V = 31
.const scanCode_9 = 32
.const scanCode_I = 33
.const scanCode_J = 34
.const scanCode_0 = 35
.const scanCode_M = 36
.const scanCode_K = 37
.const scanCode_O = 38
.const scanCode_N = 39
.const scanCode_PLUS = 40
.const scanCode_P = 41
.const scanCode_L = 42
.const scanCode_MINUS = 43
.const scanCode_FULSTP = 44
.const scanCode_COLON = 45
.const scanCode_AT = 46
.const scanCode_COMMA = 47
.const scanCode_POUND = 48
.const scanCode_ASTRIK = 49
.const scanCode_SEMICOLON = 50
.const scanCode_CLEAR_HOME = 51
.const scanCode_EQUALS = 53
.const scanCode_EXPONENT_ARROW = 54
.const scanCode_FWD_SLASH = 55
.const scanCode_1 = 56
.const scanCode_LEFT_ARROW = 57
.const scanCode_2 = 59
.const scanCode_SPACEBAR = 60
.const scanCode_Q = 62
.const scanCode_RUNSTOP = 63
.const scanCode_NO_KEY = 64
.const joystickUp = %00000001
.const joystickDown = %00000010
.const joystickLeft = %00000100
.const joystickRight = %00001000
.const joystickFire = %00010000