Add tests for 0x00E0 and 0x00EE
This commit is contained in:
parent
76bff833b5
commit
5d82b8ee40
2 changed files with 19 additions and 1 deletions
|
@ -21,6 +21,7 @@ struct EmulatorState {
|
|||
uint16_t stack[stack_size] = {};
|
||||
int stack_pointer = 0;
|
||||
|
||||
// this is technically 12-bits wide, but of course we dont have access to that :-)
|
||||
uint16_t I = 0;
|
||||
|
||||
uint8_t v[16] = {};
|
||||
|
|
|
@ -4,6 +4,23 @@
|
|||
|
||||
#include "emu.hpp"
|
||||
|
||||
TEST_CASE("Test 0x0") {
|
||||
state.reset();
|
||||
|
||||
state.pixels[0] = 1;
|
||||
|
||||
// Display clear
|
||||
process_opcode(0x00E0);
|
||||
CHECK(state.pixels[0] == 0);
|
||||
|
||||
state.stack_pointer = 1;
|
||||
|
||||
// Subroutine return
|
||||
process_opcode(0x00EE);
|
||||
CHECK(state.stack_pointer == 0);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Test 0x1") {
|
||||
state.reset();
|
||||
|
||||
|
|
Reference in a new issue