aboutsummaryrefslogtreecommitdiffstats
path: root/atk16_emu
diff options
context:
space:
mode:
Diffstat (limited to 'atk16_emu')
-rw-r--r--atk16_emu/emu.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/atk16_emu/emu.py b/atk16_emu/emu.py
index 4257636..f0671bd 100644
--- a/atk16_emu/emu.py
+++ b/atk16_emu/emu.py
@@ -2,6 +2,7 @@ import random
from typing import Literal
from dataclasses import dataclass
import sys
+import time
from .opcodes import *
from .colors import C
@@ -278,6 +279,11 @@ class Machine:
while self.running:
self.step()
+ # TODO limit emulation speed to 393359.375 Hz ~= 2542 ns per instruction
+ # this is in order to have similar speed as the actual machine
+ # see: test_emulation_speed.py
+ # naive time.sleep is slow and not accurate enough
+
def check_nth_flag(self, n: int) -> bool:
match n:
case 0: return self.fr.carry