Use exceptions instead of panic

This commit is contained in:
madmaurice 2023-09-01 15:11:27 +02:00
parent a0377959dc
commit 66c19caaee
8 changed files with 134 additions and 68 deletions

View file

@ -0,0 +1,13 @@
#include "doctest.h"
#include <cpu/cpu.h>
#include <memory/ram.h>
#include <iostream>
TEST_CASE("Undefined instructions throw exception")
{
u8 test_mem[] = { 0xd3, 0x00, 0x00, 0x00 };
RAM r(test_mem, 0x4, true);
Cpu c(&r);
REQUIRE_THROWS_AS(c.step(), CpuException);
}