From acbfa82a18b64dc91a3b324f40f5fc23de8672ea Mon Sep 17 00:00:00 2001 From: Ry Date: Sun, 25 Dec 2022 23:24:03 -0800 Subject: [PATCH] If `halt`ed, report that the entire tick was completed --- src/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu.c b/src/cpu.c index 5f28b10..7ba7aa1 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -1131,6 +1131,8 @@ static err_t vm_resume(vm_t *vm, uint32_t count, uint32_t *executed) { remaining -= 1; *executed += 1; } + if (vm->halted) + *executed = count; return FOX32_ERR_OK; } @@ -1170,7 +1172,6 @@ static fox32_err_t vm_raise(vm_t *vm, uint16_t vector) { } vm->pointer_instr = pointer_handler; - vm->halted = true; vm->flag_interrupt = false; return FOX32_ERR_OK;