diff --git a/README.md b/README.md index 88df69b..bf29482 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ I wanted to learn how to use C++ and SDL, and I recently saw a youtube video lis ## References * [Cowgod's Chip-8 Technical Reference](http://devernay.free.fr/hacks/chip8/C8TECH10.HTM) +- [Chip-8 Test Suite](https://github.com/Timendus/chip8-test-suite) # License diff --git a/libs/reader.hpp b/libs/reader.hpp index 1cf694c..2f2ab18 100644 --- a/libs/reader.hpp +++ b/libs/reader.hpp @@ -171,7 +171,7 @@ inline Bytecode parse(uint16_t opcode) { bytecode.instruction_type = LOAD_BYTE; break; } - case 0x700: { + case 0x7000: { bytecode.instruction_type = ADD_BYTE; break; } diff --git a/test.sh b/test.sh index 3645178..5f5af7b 100755 --- a/test.sh +++ b/test.sh @@ -1,6 +1,18 @@ #!/bin/bash -roms=($(find tests/ -type f)) +if [ ! -d tests/extern ]; then + mkdir tests/extern +fi + +extern_roms=("https://github.com/Timendus/chip8-test-suite/raw/main/bin/1-chip8-logo.ch8" "https://github.com/Timendus/chip8-test-suite/raw/main/bin/2-ibm-logo.ch8") +for rom in "${extern_roms[@]}"; do + if [ ! -f tests/extern/$(basename $rom) ]; then + echo "Downloading $rom" + curl -L $rom -o tests/extern/$(basename $rom) + fi +done + +roms=($(find tests/ -type f -name "*.ch8")) testOutput=$(mktemp) @@ -8,6 +20,7 @@ if ${VERBOSE:-false}; then testOutput=2 fi + for rom in "${roms[@]}"; do echo -n "$rom " ./bin/voidEmu $rom 1>&$testOutput