-
Notifications
You must be signed in to change notification settings - Fork 0
/
vcs.wiz
340 lines (290 loc) · 8.67 KB
/
vcs.wiz
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
import "banks";
namespace vcs {
namespace sync {
var vsync @ 0x00 : u8;
let VSYNC_START = 0x02;
var vblank @ 0x01 : u8;
let VBLANK_START = 0x02;
let VBLANK_RESET_TRIGGER = 0x40;
let VBLANK_RESET_POTS = 0x80;
var wsync @ 0x02 : u8;
var rsync @ 0x03 : u8;
}
namespace audio {
var volumes @ 0x19 : [u8; 2];
var volume1 @ 0x19 : u8;
var volume2 @ 0x1A : u8;
var frequencies @ 0x17 : [u8; 2];
var frequency1 @ 0x17 : u8;
var frequency2 @ 0x18 : u8;
var tones @ 0x15 : [u8; 2];
var tone1 @ 0x15 : u8;
var tone2 @ 0x16 : u8;
}
namespace io {
var pots @ 0xC : [u8; 4];
var pot1 @ 0x8 : u8;
var pot2 @ 0x9 : u8;
var pot3 @ 0xA : u8;
var pot4 @ 0xB : u8;
var triggers @ 0x3C : [u8; 2];
var trigger1m30 @ 0x0C : u8;
var trigger1 @ 0x3C : u8;
var trigger2 @ 0x3D : u8;
let TRIGGER_JOY_FIRE = 0x80;
var port_a @ 0x280 : u8;
var port_b @ 0x282 : u8;
var ddr_a @ 0x281 : u8;
var ddr_b @ 0x023 : u8;
let PORT_A_JOY_UP = 0x10;
let PORT_A_JOY_DOWN = 0x20;
let PORT_A_JOY_LEFT = 0x40;
let PORT_A_JOY_RIGHT = 0x80;
let PORT_A_JOY2_UP = 0x01;
let PORT_A_JOY2_DOWN = 0x02;
let PORT_A_JOY2_LEFT = 0x04;
let PORT_A_JOY2_RIGHT = 0x08;
}
namespace timer {
var value @ 0x284 : u8;
var stat @ 0x285 : u8;
var set1 @ 0x294 : u8;
var set8 @ 0x295 : u8;
var set64 @ 0x296 : u8;
var set1024 @ 0x297 : u8;
}
namespace control {
var players @ 0x04 : [u8; 2];
var player1 @ 0x04 : u8;
var player2 @ 0x05 : u8;
let PLAYER_SINGLE = 0x00;
let PLAYER_SINGLE_2X = 0x05;
let PLAYER_SINGLE_4X = 0x07;
let PLAYER_DOUBLE_CLOSE = 0x01;
let PLAYER_DOUBLE_MEDIUM = 0x02;
let PLAYER_DOUBLE_FAR = 0x04;
let PLAYER_TRIPLE_CLOSE = 0x03;
let PLAYER_TRIPLE_MEDIUM = 0x06;
let MISSILE_1PX = 0x00;
let MISSILE_2PX = 0x10;
let MISSILE_4PX = 0x20;
let MISSILE_8PX = 0x30;
var playfield @ 0x0A : u8;
let FIELD_REFLECT = 0x1;
let FIELD_SCORE = 0x2;
let FIELD_PRIORITY = 0x4;
let BALL_1PX = 0x00;
let BALL_2PX = 0x10;
let BALL_4PX = 0x20;
let BALL_8PX = 0x30;
}
namespace color {
var players @ 0x06 : [u8; 2];
var player1 @ 0x06 : u8;
var player2 @ 0x07 : u8;
var fg @ 0x08 : u8;
var bg @ 0x09 : u8;
let LUMINOSITY_SHIFT = 1;
let LUMINOSITY_MASK = 0x0E;
let COLOR_SHIFT = 4;
let COLOR_MASK = 0xF0;
let SECAM_BLACK = 0x0;
let SECAM_BLUE = 0x2;
let SECAM_RED = 0x4;
let SECAM_MAGENTA = 0x6;
let SECAM_GREEN = 0x8;
let SECAM_CYAN = 0xA;
let SECAM_YELLOW = 0xC;
let SECAM_WHITE = 0xE;
let PAL_GREY = 0x0;
let PAL_YELLOW = 0x2;
let PAL_OLIVE = 0x3;
let PAL_BROWN = 0x4;
let PAL_GREEN = 0x5;
let PAL_RED = 0x6;
let PAL_CYAN = 0x7;
let PAL_MAGENTA = 0x8;
let PAL_LIGHT_BLUE = 0x9;
let PAL_PURPLE = 0xA;
let PAL_SKY_BLUE = 0xB;
let PAL_INDIGO = 0xC;
let PAL_BLUE = 0xD;
let NTSC_WHITE = 0x0;
let NTSC_YELLOW = 0x1;
let NTSC_ORANGE = 0x2;
let NTSC_RED_ORANGE = 0x3;
let NTSC_RED = 0x4;
let NTSC_MAGENTA = 0x5;
let NTSC_PURPLE = 0x6;
let NTSC_BLUE_PURPLE = 0x7;
let NTSC_BLUE = 0x8;
let NTSC_SKY_BLUE = 0x9;
let NTSC_CYAN = 0xA;
let NTSC_MINT = 0xB;
let NTSC_GREEN = 0xC;
let NTSC_GREEN_YELLOW = 0xD;
let NTSC_OLIVE = 0xE;
let NTSC_BROWN = 0xF;
}
namespace pattern {
var players @ 0x1B : [u8; 2];
var player1 @ 0x1B : u8;
var player2 @ 0x1C : u8;
var missiles @ 0x1D : [u8; 2];
var missile1 @ 0x1D : u8;
var missile2 @ 0x1E : u8;
let MISSILE_FILL = 0x2;
var ball @ 0x1F : u8;
let BALL_FILL = 0x2;
var playfields @ 0x0D : [u8; 3];
var playfield1 @ 0x0D : u8;
var playfield2 @ 0x0E : u8;
var playfield3 @ 0x0F : u8;
}
namespace hmove {
var players @ 0x20 : [u8; 2];
var player1 @ 0x20 : u8;
var player2 @ 0x21 : u8;
var missiles @ 0x22 : [u8; 2];
var missile1 @ 0x22 : u8;
var missile2 @ 0x23 : u8;
var ball @ 0x24 : u8;
var apply @ 0x2A : u8;
var clear @ 0x2B : u8;
}
namespace vdelay {
var players @ 0x25 : [u8; 2];
var player1 @ 0x25 : u8;
var player2 @ 0x26 : u8;
var ball @ 0x27 : u8;
}
namespace reflect {
var players @ 0x0B : [u8; 2];
var player1 @ 0x0B : u8;
var player2 @ 0x0C : u8;
let ENABLE = 0x08;
}
namespace warp {
var missiles @ 0x28 : [u8; 2];
var missile1 @ 0x28 : u8;
var missile2 @ 0x29 : u8;
let ENABLE = 0x02;
}
namespace reset {
var players @ 0x10 : [u8; 2];
var player1 @ 0x10 : u8;
var player2 @ 0x11 : u8;
var missiles @ 0x12 : [u8; 2];
var missile1 @ 0x12 : u8;
var missile2 @ 0x13 : u8;
var ball @ 0x14 : u8;
}
namespace collision {
var clear @ 0x2C : u8;
var missile1_vs_players @ 0x30 : u8;
var missile2_vs_players @ 0x31 : u8;
var player1_vs_playfieldm30 @ 0x02 : u8;
var player1_vs_playfield @ 0x32 : u8;
var player2_vs_playfield @ 0x33 : u8;
var missile1_vs_playfield @ 0x34 : u8;
var missile2_vs_playfield @ 0x35 : u8;
var ball_vs_field @ 0x36 : u8;
var pvp_mvm @ 0x37 : u8;
var pvp_mvm_m30 @ 0x07 : u8;
}
}
namespace tiamirror {
in tia @ 0xE000 {
var HMBL @ 0xE024 : u8;
var RESP1 @ 0xE011 : u8;
var ENABL @ 0xE01F : u8;
}
}
let VSYNC = vcs.sync.vsync;
let WSYNC = vcs.sync.wsync;
let NUSIZ0 = vcs.control.player1;
let NUSIZ1 = vcs.control.player2;
let HMBL = vcs.hmove.ball;
let RESP = vcs.reset.players;
let RESP0 = vcs.reset.player1;
let RESP1 = vcs.reset.player2;
let HMOVE = vcs.hmove.apply;
let HMP0 = vcs.hmove.player1;
let HMP1 = vcs.hmove.player2;
let REFP0 = vcs.reflect.player1;
let REFP1 = vcs.reflect.player2;
let CXCLR = vcs.collision.clear;
let VDELP0 = vcs.vdelay.player1;
let VDELP1 = vcs.vdelay.player2;
let HMCLR = vcs.hmove.clear;
let COLUP = vcs.color.players;
let COLUP0 = vcs.color.player1;
let COLUP1 = vcs.color.player2;
let COLUPF = vcs.color.fg;
let COLUBK = vcs.color.bg;
let GRP0 = vcs.pattern.player1;
let GRP1 = vcs.pattern.player2;
let PF0 = vcs.pattern.playfield1;
let PF1 = vcs.pattern.playfield2;
let PF2 = vcs.pattern.playfield3;
let ENABL = vcs.pattern.ball;
let CXP0FB = vcs.collision.player1_vs_playfield;
let CXP0FBm30 = vcs.collision.player1_vs_playfieldm30;
let CXPPMM = vcs.collision.pvp_mvm;
let CXPPMMm30 = vcs.collision.pvp_mvm_m30;
let CTRLPF = vcs.control.playfield;
let RESBL = vcs.reset.ball;
let AUDV = vcs.audio.volumes;
let AUDV0 = vcs.audio.volume1;
let AUDV1 = vcs.audio.volume2;
let AUDF = vcs.audio.frequencies;
let AUDF0 = vcs.audio.frequency1;
let AUDF1 = vcs.audio.frequency2;
let AUDC = vcs.audio.tones;
let AUDC0 = vcs.audio.tone1;
let AUDC1 = vcs.audio.tone2;
let INTIM = vcs.timer.value;
let TIM64T = vcs.timer.set64;
let VBLANK = vcs.sync.vblank;
let SWCHB = vcs.io.port_b;
let SWCHA = vcs.io.port_a;
let INPT4 = vcs.io.trigger1;
let INPT4m30 = vcs.io.trigger1m30;
namespace riot {
/*
SEG.U RIOT
ORG $280
; RIOT MEMORY MAP
SWCHA ds 1 ; $280 Port A data register for joysticks:
; Bits 4-7 for player 1. Bits 0-3 for player 2.
SWACNT ds 1 ; $281 Port A data direction register (DDR)
SWCHB ds 1 ; $282 Port B data (console switches)
SWBCNT ds 1 ; $283 Port B DDR
INTIM ds 1 ; $284 Timer output
TIMINT ds 1 ; $285
; Unused/undefined registers ($285-$294)
ds 1 ; $286
ds 1 ; $287
ds 1 ; $288
ds 1 ; $289
ds 1 ; $28A
ds 1 ; $28B
ds 1 ; $28C
ds 1 ; $28D
ds 1 ; $28E
ds 1 ; $28F
ds 1 ; $290
ds 1 ; $291
ds 1 ; $292
ds 1 ; $293
TIM1T ds 1 ; $294 set 1 clock interval
TIM8T ds 1 ; $295 set 8 clock interval
TIM64T ds 1 ; $296 set 64 clock interval
T1024T ds 1 ; $297 set 1024 clock interval
;-------------------------------------------------------------------------------
; The following required for back-compatibility with code which does not use
; segments.
SEG
; EOF
*/
}