aboutsummaryrefslogtreecommitdiffstats
path: root/atk16_emu/peripherals.py
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2024-04-13 22:27:54 +0300
committerJan Tuomi <jan@jantuomi.fi>2024-04-13 22:27:54 +0300
commita36e5e001a4f17505c40b7f7a8f9c1f514f40de1 (patch)
tree7511fff343ef5eb0329e18e5cb5584387c4f653a /atk16_emu/peripherals.py
parent46459fc1b753abc83c355440a014c696c0dacd3a (diff)
Fix bugs, add tests
Diffstat (limited to 'atk16_emu/peripherals.py')
-rw-r--r--atk16_emu/peripherals.py10
1 files changed, 10 insertions, 0 deletions
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()