From a36e5e001a4f17505c40b7f7a8f9c1f514f40de1 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 13 Apr 2024 22:27:54 +0300 Subject: Fix bugs, add tests --- atk16_emu/peripherals.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'atk16_emu/peripherals.py') diff --git a/atk16_emu/peripherals.py b/atk16_emu/peripherals.py index 0038a33..54020f4 100644 --- a/atk16_emu/peripherals.py +++ b/atk16_emu/peripherals.py @@ -8,6 +8,7 @@ class Peripherals: pygame.init() self.graphics = Graphics() self.keyboard = Keyboard() + self.terminal = Terminal() def step(self): for event in pygame.event.get(): @@ -23,6 +24,7 @@ class DummyPeripherals: def __init__(self): self.graphics = DummyGraphics() self.keyboard = DummyKeyboard() + self.terminal = Terminal() def step(self): pass @@ -127,3 +129,11 @@ class DummyKeyboard: def read(self) -> int: print("warning: reading from dummy keyboard") return 0xFFFF + +class Terminal: + def __init__(self): + pass + + def write(self, s: int): + print(chr(s), end="") + sys.stdout.flush() -- cgit v1.3