-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtests.yaml
500 lines (484 loc) · 14.2 KB
/
tests.yaml
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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
init:
load:
unit_tests:
program: /code/include_me_full.prg
tests:
- name: memory-fill
description: Fill an uneven block of memory
set_memory:
- description: Store $BD which is a weird number
address: "{r0L}"
byte_value: "$bd"
- description: Target memory
address: "{r1}"
word_value: "$1234"
- description: Store 300 bytes
address: "{r2}"
word_value: "$12c"
jump_address: "{FillMemory}"
assert:
- description: Memory filled correctly
type: memory_block
address: "$1234"
byte_value: "$bd"
byte_count: "$12c"
- name: memory-copy-kernal-to-userspace
description: Copy kernal to lower memory
set_memory:
- description: Source Address
address: "{r0}"
word_value: "$e000"
- description: Target Address
address: "{r1}"
word_value: "$4000"
- description: 8k
address: "{r2}"
word_value: "$2000"
jump_address: "{CopyMemory}"
assert:
- description: Memory copied successfully
type: memory_block_compare
address: "$e000"
target: "$4000"
byte_count: "$2000"
- description: Make sure performance is acceptable
type: cycle_count
cycle_count: 131721
op: lt
- name: sprites-enable-x-expand-correctly
description: Enable horizontal expansion of a sprite
set_memory:
- description: Sprite 1
address: "{r3L}"
byte_value: "$01"
- description: The horizontal expansion attribute
address: "{r3H}"
byte_value: "{SPR_X_EXPAND}"
- description: Set to True
address: "{r4L}"
byte_value: "{SPR_EXPAND}"
- description: Enable X expansion for Sprite 7
address: "{vic.XXPAND}"
byte_value: "$80"
jump_address: "{ChangeSpriteAttribute}"
assert:
- description: Sprite 1's horizontal expansion is set to True
type: memory_test
address: "{vic.XXPAND}"
op: eq
byte_value: "$82"
- name: sprites-disable-x-expand-correctly
description: Disable horizontal expansion of a sprite
set_memory:
- description: Sprite 5
address: "{r3L}"
byte_value: "$05"
- description: The horizontal expansion attribute
address: "{r3H}"
byte_value: "{SPR_X_EXPAND}"
- description: Set to False
address: "{r4L}"
byte_value: "{SPR_NORMAL}"
- description: Enable X expansion for Sprite 5 & 6
address: "{vic.XXPAND}"
byte_value: "$60"
jump_address: "{ChangeSpriteAttribute}"
assert:
- description: Sprite 5's horizontal expansion is set to False
type: memory_test
address: "{vic.XXPAND}"
op: eq
byte_value: "$40"
- name: sprites-enable-sprite-correctly
description: Enable a sprite
set_memory:
- description: Sprite 7
address: "{r3L}"
byte_value: "$07"
- description: The enable/disable attribute
address: "{r3H}"
byte_value: "{SPR_VISIBLE}"
- description: Set to True
address: "{r4L}"
byte_value: "{SPR_SHOW}"
- description: Start with sprite 0 enabled
address: "{vic.SPENA}"
byte_value: "$01"
jump_address: "{ChangeSpriteAttribute}"
assert:
- description: Sprite 7 and 0 are now enabled
type: memory_test
address: "{vic.SPENA}"
op: eq
byte_value: "$81"
- name: sprites-disable-sprite-correctly
description: Disable a sprite
set_memory:
- description: Sprite 3
address: "{r3L}"
byte_value: "$03"
- description: The enable/disable attribute
address: "{r3H}"
byte_value: "{SPR_VISIBLE}"
- description: Set to True
address: "{r4L}"
byte_value: "{SPR_HIDE}"
- description: Start with sprite 1 & 3 enabled
address: "{vic.SPENA}"
byte_value: "$0a"
jump_address: "{ChangeSpriteAttribute}"
assert:
- description: Sprite 3 is disabled and sprite 1 is still enabled
type: memory_test
address: "{vic.SPENA}"
op: eq
byte_value: "$02"
- name: sprites-positions-correctly-without-msb
description: Sprite X pos < 256 sets MSB to 0
set_memory:
- description: MSB for all sprites to 0
address: "{vic.MSIGX}"
byte_value: "$00"
- description: Sprite 0
address: "{r3L}"
byte_value: "$00"
- description: X pos at 255
address: "{r4}"
word_value: "$00ff"
- description: Y pos at 64
address: "{r5L}"
byte_value: "$40"
jump_address: "{PositionSprite}"
assert:
- description: Sprite 0's X pos is at ff
type: memory_test
address: "{vic.SP0X}"
op: eq
byte_value: "$ff"
- description: And sprite 0's MSB is set to 0
type: memory_test
address: "{vic.MSIGX}"
op: eq
byte_value: "$00"
- name: sprites-sets-msb-properly
description: Moving a sprite horizontally sets the MSB properly
set_memory:
- description: MSB for all sprites to 0
address: "{vic.MSIGX}"
byte_value: "$00"
- description: Sprite 0
address: "{r3L}"
byte_value: "$00"
- description: X pos at 256
address: "{r4}"
word_value: "$0100"
- description: Y pos at 64
address: "{r5L}"
byte_value: "$40"
jump_address: "{PositionSprite}"
assert:
- description: Sprite 0's X pos is at 0
type: memory_test
address: "{vic.SP0X}"
op: eq
byte_value: "$00"
- description: But sprite 0's MSB is set to 1
type: memory_test
address: "{vic.MSIGX}"
op: eq
byte_value: "$01"
- name: timer-single-disables-on-update
description: Single shot timer disables when it hits 0
set_memory:
- description: Enable timer 0
address: "{c64lib_timers}"
byte_value: "{ENABLE}"
- description: Single shot
address: "{c64lib_timers} + 1"
byte_value: "{TIMER_SINGLE}"
- description: Current value
address: "{c64lib_timers} + 2"
word_value: "$01"
- description: Frequency
address: "{c64lib_timers} + 4"
word_value: "{TIMER_ONE_SECOND}"
- description: Timer call address
address: "{c64lib_timers} + 6"
word_value: "{ReadJoysticks}"
jump_address: "{UpdateTimers}"
assert:
- description: Timer is disabled
type: memory_test
address: "{c64lib_timers}"
op: eq
byte_value: "{DISABLE}"
- name: timer-continuous-will-reset-on-update
description: Continuous timer resets when it hits 0
set_memory:
- description: Enable timer 0
address: "{c64lib_timers}"
byte_value: "{ENABLE}"
- description: Continuous
address: "{c64lib_timers} + 1"
byte_value: "{TIMER_CONTINUOUS}"
- description: Current value
address: "{c64lib_timers} + 2"
word_value: "$01"
- description: Frequency
address: "{c64lib_timers} + 4"
word_value: "{TIMER_ONE_SECOND}"
- description: Timer call address
address: "{c64lib_timers} + 6"
word_value: "{ReadJoysticks}"
jump_address: "{UpdateTimers}"
assert:
- description: Timer is still enabled
type: memory_test
address: "{c64lib_timers}"
op: eq
byte_value: "{ENABLE}"
- description: Current value has been reset
type: memory_test
address: "{c64lib_timers} + 2"
op: eq
word_value: "{TIMER_ONE_SECOND}"
- name: timer-enable
description: Enable a disabled timer
set_memory:
- description: Disable timer 0
address: "{c64lib_timers}"
byte_value: "{DISABLE}"
- description: Timer number 0
address: "{r2H}"
byte_value: "$00"
- description: Enable the timer
address: "{r3L}"
byte_value: "{ENABLE}"
jump_address: "{EnDisTimer}"
assert:
- description: Timer has been enabled
type: memory_test
address: "{c64lib_timers}"
op: eq
byte_value: "{ENABLE}"
- name: timer-disable
description: Disable an enabled timer
set_memory:
- description: Enable timer 0
address: "{c64lib_timers}"
byte_value: "{ENABLE}"
- description: Timer number 0
address: "{r2H}"
byte_value: "$00"
- description: Disable the timer
address: "{r3L}"
byte_value: "{DISABLE}"
jump_address: "{EnDisTimer}"
assert:
- description: Timer has been disabled
type: memory_test
address: "{c64lib_timers}"
op: eq
byte_value: "{DISABLE}"
- name: timer-init-timer-memory
description: Make sure initializing the timers clears timer memory
jump_address: "{ClearTimers}"
assert:
- description: Timer memory is cleared
type: memory_block
address: "{c64lib_timers}"
byte_count: "{TIMER_STRUCT_BYTES}"
byte_value: "$0"
- name: timer-create-single-shot
description: Make sure we can create a single shot timer
set_memory:
- description: Frequency
address: "{r0}"
word_value: "$0001"
- description: Call address
address: "{r1}"
word_value: "{ReadJoysticks}"
- description: Single or continuous
address: "{r2L}"
byte_value: "{TIMER_SINGLE}"
- description: Timer number
address: "{r2H}"
byte_value: "$00"
- description: Enabled
address: "{r3L}"
byte_value: "{ENABLE}"
jump_address: "{CreateTimer}"
assert:
- description: Enabled
type: memory_test
address: "{c64lib_timers} + 0 + peekbyte({r2H}) * 8"
op: eq
byte_value: "{ENABLE}"
- description: Single or continuous
type: memory_test
address: "{c64lib_timers} + 1 + peekbyte({r2H}) * 8"
op: eq
byte_value: "{TIMER_SINGLE}"
- description: Current value
type: memory_test
address: "{c64lib_timers} + 2 + peekbyte({r2H}) * 8"
op: eq
word_value: "$01"
- description: Frequency
type: memory_test
address: "{c64lib_timers} + 4 + peekbyte({r2H}) * 8"
op: eq
word_value: "$01"
- description: Call address
type: memory_test
address: "{c64lib_timers} + 6 + peekbyte({r2H}) * 8"
op: eq
word_value: "{ReadJoysticks}"
- description: Make sure we're executing within 85 cycles
type: cycle_count
op: lt
cycle_count: 85
- name: vic-set-bank-chars-and-screen-i
description: Set VIC bank to 0, screen to 1024 and chars to 12288
set_memory:
- description: r0L is bank 0
address: "{r0L}"
byte_value: "$00"
- description: r0H is character memory
address: "{r0H}"
byte_value: "$06"
- description: r1L is screen memory
address: "{r1L}"
byte_value: "$01"
jump_address: "{SetVICBank}"
assert:
- description: CIA 2 is set properly
type: memory_test
address: "{cia.CI2PRA}"
op: eq
byte_value: "$03"
- description: VIC is set properly
type: memory_test
address: "{vic.VMCSB}"
op: eq
byte_value: "$1c"
- description: Bank Memory Base is set properly
type: memory_test
address: "{vic.BankMemoryBase}"
op: eq
word_value: "$0000"
- description: Screen Memory Base is set properly
type: memory_test
address: "{vic.ScreenMemoryBase}"
op: eq
word_value: "$0400"
- description: Character Memory Base is set properly
type: memory_test
address: "{vic.CharacterMemoryBase}"
op: eq
word_value: "$3000"
- description: Sprite Pointer Base is set properly
type: memory_test
address: "{vic.SpritePointerBase}"
op: eq
word_value: "$07f8"
- description: Make sure we're executing within 170 cycles
type: cycle_count
op: lt
cycle_count: 170
- name: vic-set-bank-chars-and-screen-ii
description: Set VIC bank to 3, screen to 4096 and chars to 8192
set_memory:
- description: r0L is bank 0
address: "{r0L}"
byte_value: "$03"
- description: r0H is character memory
address: "{r0H}"
byte_value: "$04"
- description: r1L is screen memory
address: "{r1L}"
byte_value: "$04"
jump_address: "{SetVICBank}"
assert:
- description: CIA 2 is set properly
type: memory_test
address: "{cia.CI2PRA}"
op: eq
byte_value: "$00"
- description: VIC is set properly
type: memory_test
address: "{vic.VMCSB}"
op: eq
byte_value: "$48"
- description: Bank Memory Base is set properly
type: memory_test
address: "{vic.BankMemoryBase}"
op: eq
word_value: "$c000"
- description: Screen Memory Base is set properly
type: memory_test
address: "{vic.ScreenMemoryBase}"
op: eq
word_value: "$d000"
- description: Character Memory Base is set properly
type: memory_test
address: "{vic.CharacterMemoryBase}"
op: eq
word_value: "$e000"
- description: Sprite Pointer Base is set properly
type: memory_test
address: "{vic.SpritePointerBase}"
op: eq
word_value: "$d3f8"
- description: Make sure we're executing within 170 cycles
type: cycle_count
op: lt
cycle_count: 170
- name: vic-set-bank-chars-and-screen-iii
description: Set VIC bank to 2, screen to 8192 and chars to 0
set_memory:
- description: r0L is bank 0
address: "{r0L}"
byte_value: "$02"
- description: r0H is character memory
address: "{r0H}"
byte_value: "$00"
- description: r1L is screen memory
address: "{r1L}"
byte_value: "$08"
jump_address: "{SetVICBank}"
assert:
- description: CIA 2 is set properly
type: memory_test
address: "{cia.CI2PRA}"
op: eq
byte_value: "$01"
- description: VIC is set properly
type: memory_test
address: "{vic.VMCSB}"
op: eq
byte_value: "$80"
- description: Bank Memory Base is set properly
type: memory_test
address: "{vic.BankMemoryBase}"
op: eq
word_value: "$8000"
- description: Screen Memory Base is set properly
type: memory_test
address: "{vic.ScreenMemoryBase}"
op: eq
word_value: "$a000"
- description: Character Memory Base is set properly
type: memory_test
address: "{vic.CharacterMemoryBase}"
op: eq
word_value: "$8000"
- description: Sprite Pointer Base is set properly
type: memory_test
address: "{vic.SpritePointerBase}"
op: eq
word_value: "$a3f8"
- description: Make sure we're executing within 170 cycles
type: cycle_count
op: lt
cycle_count: 170