You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_A collection of ROM images with tests that will aid you in developing your own
6
-
CHIP-8, SCHIP or XO-CHIP interpreter (or "emulator")_
6
+
CHIP-8, SUPER-CHIP or XO-CHIP interpreter (or "emulator")_
7
7
8
8
## Table of contents
9
9
10
10
*[Introduction](#introduction)
11
+
*[Baseline](#baseline)
11
12
*[Available tests](#available-tests)
12
13
*[CHIP-8 splash screen](#chip-8-splash-screen)
13
14
*[IBM logo](#ibm-logo)
14
15
*[Corax+ opcode test](#corax-opcode-test)
15
16
*[Flags test](#flags-test)
16
17
*[Quirks test](#quirks-test)
17
18
*[Keypad test](#keypad-test)
19
+
*[Beep test](#beep-test)
20
+
*[Scrolling test](#scrolling-test)
18
21
*[Contributing](#contributing)
19
22
*[Community response 😄](#community-response-)
20
23
21
24
# Introduction
22
25
23
26
I found it hard to find reliable sources on what is the right behaviour and what
24
27
is not, especially with the subtle differences between the original "Cosmac VIP"
25
-
CHIP-8 and the HP84's SCHIP (or "superchip"). Now that I have written and ported
26
-
a couple of interpreters as well as a few programs and games for the platform, I
27
-
thought it was time to put that knowledge into code.
28
+
CHIP-8 and the HP48's SUPER-CHIP (or "S-CHIP"). Now that I have written and
29
+
ported a couple of interpreters as well as a few programs and games for the
30
+
platform, I thought it was time to put that knowledge into code.
28
31
29
32
If you're having issues with your interpreter, you can find help in the [EmuDev
30
33
discord channel `#chip-8`](https://discord.gg/dkmJAes). Every test has a clearly
@@ -33,6 +36,40 @@ share a screenshot. If you discover a problem with this test ROM itself, feel
33
36
free to file an issue or open a pull request. It's open source, licensed under
34
37
the GPLv3, and you're welcome to [contribute](#contributing).
35
38
39
+
# Baseline
40
+
41
+
Most tests have been written to run equally well on all three major CHIP-8
42
+
platforms, unless otherwise specified. The [quirks test](#quirks-test) is the
43
+
most interesting one, since it was designed to test the differences between
44
+
those three platforms. If the test suite itself is wrong, we're not helping
45
+
anyone. So what are we testing the test suite against?
46
+
47
+
## CHIP-8
48
+
49
+
There are several good Cosmac VIP emulators, so we can quite faithfully run the
50
+
original CHIP-8 interpreter and check the results. We use [Emma
51
+
O2](https://www.emma02.hobby-site.com/) and/or
52
+
[Cadmium](https://github.com/gulrak/cadmium) in `VIP-CHIP-8` mode to validate
53
+
the test suite.
54
+
55
+
If you have an actual, physical Cosmac VIP and would like to verify the test
56
+
suite, let me know! 😄
57
+
58
+
## SUPER-CHIP
59
+
60
+
For SUPER-CHIP, the test suite has been tested against real HP48 graphing
61
+
calculators, in the various interpreters that exist for that system.
62
+
[Gulrak](https://github.com/gulrak) from the CHIP-8 community has both an HP48SX
63
+
and an HP48GX, and has been so kind as to check if the test suite ROMs behave as
64
+
expected.
65
+
66
+
## XO-CHIP
67
+
68
+
The XO-CHIP extension was written by [John
69
+
Earnest](https://github.com/johnearnest) and was first implemented in his IDE
70
+
slash interpreter Octo. As such, we treat [Octo](http://octo-ide.com/) as the
71
+
gold standard for how an XO-CHIP system should behave, and test against that.
72
+
36
73
# Available tests
37
74
38
75
## CHIP-8 splash screen
@@ -242,20 +279,22 @@ for more information on the arithmetic operations and the flags.
242
279
*[Run this ROM in Octo](https://timendus.github.io/chip8-test-suite/5-quirks.html)
243
280
to see what's supposed to happen
244
281
245
-
CHIP-8, SCHIP and XO-CHIP have subtle differences in the way they interpret the
246
-
bytecode. We often call these differences quirks. This test detects which quirks
247
-
your interpreter implements, and if those quirks match the platform you're
248
-
trying to target. This is one of the hardest parts to "get right" and often a
249
-
reason why "some games work, but some don't".
282
+
CHIP-8, SUPER-CHIP and XO-CHIP have subtle differences in the way they interpret
283
+
the bytecode. We often call these differences quirks. This test detects which
284
+
quirks your interpreter implements, and if those quirks match the platform
285
+
you're trying to target. This is one of the hardest parts to "get right" and
286
+
often a reason why "some games work, but some don't".
250
287
251
288
### The menu
252
289
253
-
The test asks you to choose the platform you are targeting:
290
+
The test asks you to choose the platform you are targeting. If you select
291
+
SUPER-CHIP, if will then also ask you if you want to test for the "modern" or
292
+
the "legacy" behaviour. When in doubt, go for the "modern" one.
254
293
255
294

256
295
257
-
You can press any of the numbers `1` to `3` on the CHIP-8 keypad to jump to the
258
-
corresponding test.
296
+
You can press any of the numbers `1` to `3` on the CHIP-8 keypad to make the
297
+
corresponding selection.
259
298
260
299
Alternatively, you can move the cursor up and down with CHIP-8 keys `E` and `F`
261
300
and select an item with `A`. This feature mainly exists so people implementing
@@ -264,9 +303,14 @@ can map their buttons to those CHIP-8 keys and have an intuitive interface too.
264
303
265
304
If you want to repeat a test often or even automate them, having to use the
266
305
graphical menu just gets in the way. In that case, you can force this ROM to
267
-
select a specific platform by loading a value between `1` and `3` into memory at
306
+
select a specific platform by loading a value between `1` and `4` into memory at
268
307
the address `0x1FF` (`512`).
269
308
309
+
*`1` - CHIP-8
310
+
*`2` - SUPER-CHIP with modern behaviour
311
+
*`3` - XO-CHIP
312
+
*`4` - SUPER-CHIP with legacy behaviour
313
+
270
314
### The test
271
315
272
316
The test will now run through a couple of steps, which you will see on the
@@ -280,14 +324,15 @@ or an error) and if that matches your chosen target platform (a checkmark or a
280
324
cross).
281
325
282
326
*`vF reset` - The AND, OR and XOR opcodes (`8xy1`, `8xy2` and `8xy3`) reset the
283
-
flags register to zero. Test will show `E1` if the AND and OR tests don't
284
-
behave the same and `E2` if the AND and XOR tests don't behave the same.
327
+
flags register to zero. Test will show `ERR1` if the AND and OR tests don't
328
+
behave the same and `ERR2` if the AND and XOR tests don't behave the same.
285
329
*`Memory` - The save and load opcodes (`Fx55` and `Fx65`) increment the index
286
-
register. More information [here](https://laurencescotford.net/chip-8-on-the-cosmac-vip-loading-and-saving-variables/) and [here](https://tobiasvl.github.io/blog/write-a-chip-8-emulator/#fx55-and-fx65-store-and-load-memory).
330
+
register. More information [here](https://laurencescotford.net/chip-8-on-the-cosmac-vip-loading-and-saving-variables/)
331
+
and [here](https://tobiasvl.github.io/blog/write-a-chip-8-emulator/#fx55-and-fx65-store-and-load-memory).
287
332
*`Display wait` - Drawing sprites to the display waits for the vertical blank
288
333
interrupt, limiting their speed to max 60 sprites per second. More information
(source code available [here](./src/tests/8-scrolling.8o))
475
+
*[Run this ROM in Octo](https://timendus.github.io/chip8-test-suite/8-scrolling.html)
476
+
to see what's supposed to happen
477
+
478
+
This test is only applicable to SUPER-CHIP and XO-CHIP interpreters, since
479
+
regular CHIP-8 does not have scrolling instructions. It will test to see if your
480
+
scrolling opcodes scroll the display in the right directions by the right
481
+
amounts of pixels. One literal "edge"-case that it does **not** cover is what
482
+
happens at the edges of the screen.
483
+
484
+
### The menu
485
+
486
+
The test asks you to choose the platform and resolution you are targeting. For
487
+
SUPER-CHIP `lores`, it will also ask you to choose between "modern" or "legacy"
488
+
behaviour. When in doubt, go for the "modern" one.
489
+
490
+

491
+
492
+
You can press any of the numbers `1` or `2` on the CHIP-8 keypad to select the
493
+
corresponding entry.
494
+
495
+
Alternatively, you can move the cursor up and down with CHIP-8 keys `E` and `F`
496
+
and select an item with `A`. This feature mainly exists so people implementing
497
+
interpreters for platforms with limited input devices (like a game controller)
498
+
can map their buttons to those CHIP-8 keys and have an intuitive interface too.
499
+
500
+
If you want to repeat a test often or even automate them, having to use the
501
+
graphical menu just gets in the way. In that case, you can force this ROM to
502
+
select a specific platform by loading a value between `1` and `5` into memory at
503
+
the address `0x1FF` (`512`).
504
+
505
+
*`1` - SUPER-CHIP `lores` with modern behaviour
506
+
*`2` - SUPER-CHIP `lores` with legacy behaviour
507
+
*`3` - SUPER-CHIP `hires`
508
+
*`4` - XO-CHIP `lores`
509
+
*`5` - XO-CHIP `hires`
510
+
511
+
### The test
512
+
513
+
The test will show you a visual with arrows and boxes. If everything works as
514
+
expected for the target you have selected, all the arrows will end up in their
515
+
boxes, like so:
516
+
517
+

518
+
519
+
If you have issues with one or more of your scrolling instructions, some arrows
520
+
will be (partially) outside their boxes. The arrows all point in the directions
521
+
that they should be scrolled in, so the ones that have not moved in the
522
+
direction that they point in represent the scrolling instructions that are not
523
+
working properly.
524
+
525
+
For example, this is what you see if none of the scrolling instructions have
526
+
been implemented:
527
+
528
+

529
+
530
+
A note on legacy versus modern behaviour for SUPER-CHIP's `lores` mode can be
531
+
found in the document [Legacy SUPER-CHIP](./legacy-superchip.md).
532
+
533
+
# Contributing
387
534
388
535
Do you find an issue in this test suite that you think you can fix? Feel free to
389
536
submit a PR! Here's how to build the project, assuming you have Nodejs and NPM
@@ -399,12 +546,14 @@ npm install
399
546
npm start
400
547
401
548
# Build a specific test:
402
-
npm run build-logo
403
-
npm run build-ibm
404
-
npm run build-corax
405
-
npm run build-flags
406
-
npm run build-quirks
407
-
npm run build-keypad
549
+
TEST=1-chip8-logo npm run build-test
550
+
TEST=2-ibm-logo npm run build-test
551
+
TEST=3-corax+ npm run build-test
552
+
TEST=4-flags npm run build-test
553
+
TEST=5-quirks npm run build-test
554
+
TEST=6-keypad npm run build-test
555
+
TEST=7-scrolling npm run build-test
556
+
TEST=8-beep npm run build-test
408
557
```
409
558
410
559
Note that the `npm` scripts use the MacOS command `pbcopy` to copy
@@ -416,7 +565,7 @@ not work properly. Edit `package.json` and remove this part from the end of `scr
416
565
&& cat bin/${TEST}.8o | pbcopy
417
566
```
418
567
419
-
##Community response 😄
568
+
# Community response 😄
420
569
421
570
[](https://github.com/Timendus/chip8-test-suite/issues/1)
0 commit comments