diff m68k_core_x86.c @ 2226:d15c68157288

Fix implementation ot 68K trapv instruction
author Michael Pavone <pavone@retrodev.com>
date Mon, 05 Sep 2022 12:00:02 -0700
parents e22137f0aca4
children 0c42982dd4d8
line wrap: on
line diff
--- a/m68k_core_x86.c	Mon Sep 05 01:15:15 2022 -0700
+++ b/m68k_core_x86.c	Mon Sep 05 12:00:02 2022 -0700
@@ -2393,7 +2393,6 @@
 void translate_m68k_trapv(m68k_options *opts, m68kinst *inst)
 {
 	code_info *code = &opts->gen.code;
-	cycles(&opts->gen, BUS);
 	flag_to_carry(opts, FLAG_V);
 	code_ptr no_trap = code->cur + 1;
 	jcc(code, CC_NC, no_trap);
@@ -2401,6 +2400,7 @@
 	ldi_native(opts, inst->address+2, opts->gen.scratch1);
 	jmp(code, opts->trap);
 	*no_trap = code->cur - (no_trap + 1);
+	cycles(&opts->gen, BUS);
 }
 
 void translate_m68k_odd(m68k_options *opts, m68kinst *inst)