emulator improvements
This commit is contained in:
16
h8536/emulator/errors.py
Normal file
16
h8536/emulator/errors.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from ..formatting import h16
|
||||
|
||||
|
||||
class EmulatorError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class UnsupportedInstruction(EmulatorError):
|
||||
def __init__(self, pc: int, raw: bytes, text: str) -> None:
|
||||
raw_text = " ".join(f"{byte:02X}" for byte in raw)
|
||||
super().__init__(f"unsupported instruction at {h16(pc)}: {raw_text} {text}".rstrip())
|
||||
self.pc = pc
|
||||
self.raw = raw
|
||||
self.text = text
|
||||
Reference in New Issue
Block a user