diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2024-05-16 23:38:13 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2024-05-16 23:38:13 +0300 |
| commit | 51980405aa4c574845854c14bf31142ee5558f99 (patch) | |
| tree | e99ea05333080a80f4ab0c3e70d14447c05eecd9 /atk16_emu/peripherals.py | |
| parent | a568629bf316e3cb7fe9baa0e14c3e8ec398b682 (diff) | |
Make text memory readable
Diffstat (limited to 'atk16_emu/peripherals.py')
| -rw-r--r-- | atk16_emu/peripherals.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/atk16_emu/peripherals.py b/atk16_emu/peripherals.py index b8a5b14..3bc0443 100644 --- a/atk16_emu/peripherals.py +++ b/atk16_emu/peripherals.py @@ -72,6 +72,9 @@ class TPU: # address: 5 bits y, 6 bits x self.text_mem.write(addr, char & 0xFF) + def read_char(self, addr: int) -> int: + return self.text_mem.read(addr) + class Graphics: def __init__(self): pygame.display.init() @@ -111,6 +114,9 @@ class Graphics: # take only the lower 11 bits self.tpu.write_char(addr & 0x7FF, char) + def read(self, addr: int) -> int: + return self.tpu.read_char(addr & 0x7FF) + class DummyGraphics: def __init__(self): pass @@ -130,6 +136,10 @@ class DummyGraphics: def write(self, addr: int, char: int): pass + def read(self, addr: int) -> int: + print("warning: reading from dummy graphics") + return 0 + class Keyboard: def __init__(self, set_irq_line: Callable[[int], None]): # mimic electronic behaviour my assigning a random value at start |
