From f9d130ba97ff41481f1be7a37c250dc2092b1c77 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 6 Apr 2018 11:49:54 -0500 Subject: [PATCH] Add an extremely crude method to slow things down It's not configurable, and not accurate to any particular measure. But it's something for now. --- src/apple2.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/apple2.c b/src/apple2.c index 3c4237b..7575270 100644 --- a/src/apple2.c +++ b/src/apple2.c @@ -338,12 +338,21 @@ void apple2_run_loop(apple2 *mach) { FILE *dlog = (FILE *)vm_di_get(VM_DISASM_LOG); + int sleep = 5; if (dlog != NULL) { vm_reflect_disasm(NULL); } + int i = 0; while (vm_screen_active(mach->screen)) { + i++; + + if (i % sleep == 0) { + usleep(10); + i = 0; + } + if (vm_debug_broke(mach->cpu->PC)) { mach->paused = true; }