diff --git a/inc/EightBitCompilerDefinitions.h b/inc/EightBitCompilerDefinitions.h index 7b79991..10f6bc4 100644 --- a/inc/EightBitCompilerDefinitions.h +++ b/inc/EightBitCompilerDefinitions.h @@ -72,7 +72,7 @@ inline void EightBit::assume(int expression) { # define PARITY(x) EightBit::oddParity(x) -# define UNREACHABLE ASSUME(0) +# define UNREACHABLE { ASSUME(0); throw new std::exception("unreachable"); } #elif defined(__GNUG__) diff --git a/src/Bus.cpp b/src/Bus.cpp index c315976..04106aa 100644 --- a/src/Bus.cpp +++ b/src/Bus.cpp @@ -32,7 +32,7 @@ void EightBit::Bus::loadHexFile(const std::string path) { const auto address = chunk.first; const auto content = chunk.second; for (size_t i = 0; i != content.size(); ++i) - write(address + i, content[i]); + write((uint16_t)(address + i), content[i]); const auto mapped = mapping(address); mapped.memory.load(content, address - mapped.begin); }