# HG changeset patch # User Michael Pavone # Date 1692853775 25200 # Node ID 959a3e9aaac5fee4088cf8027b07d7ce9b55940a # Parent 06d5e9b08bdb37ab7f09ece039a42ea28d5a8834 Fix M68K STOP instruction for sub CPU diff -r 06d5e9b08bdb -r 959a3e9aaac5 m68k_core_x86.c --- a/m68k_core_x86.c Wed Aug 23 21:38:39 2023 -0700 +++ b/m68k_core_x86.c Wed Aug 23 22:09:35 2023 -0700 @@ -2372,6 +2372,12 @@ } code_ptr loop_top = code->cur; call(code, opts->do_sync); + cmp_irdisp(code, 0, opts->gen.context_reg, offsetof(m68k_context, should_return), SZ_B); + code_ptr no_return = code->cur + 1; + jcc(code, CC_Z, no_return); + mov_irdisp(code, (intptr_t)loop_top, opts->gen.context_reg, offsetof(m68k_context, resume_pc), SZ_PTR); + retn(code); + *no_return = code->cur - (no_return+1); cmp_rr(code, opts->gen.cycles, opts->gen.limit, SZ_D); code_ptr normal_cycle_up = code->cur + 1; jcc(code, CC_A, code->cur + 2);