changeset 605:49d9928353be

Fix a bug in ori to SR that was swapping USP and SSP inappropriately
author Michael Pavone <pavone@retrodev.com>
date Fri, 26 Dec 2014 19:38:27 -0800
parents 39d7d463ed5b
children cf73b72c6d1e
files m68k_core_x86.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/m68k_core_x86.c	Fri Dec 26 19:37:59 2014 -0800
+++ b/m68k_core_x86.c	Fri Dec 26 19:38:27 2014 -0800
@@ -1896,7 +1896,7 @@
 		} else {
 			or_irdisp(code, inst->src.params.immed >> 8, opts->gen.context_reg, offsetof(m68k_context, status), SZ_B);
 		}
-		if ((base_flag == X0) ^ (((inst->src.params.immed >> 8) & (1 << BIT_SUPERVISOR)) > 0)) {
+		if (inst->op == M68K_ANDI_SR && !(inst->src.params.immed & (1 << (BIT_SUPERVISOR + 8)))) {
 			//leave supervisor mode
 			swap_ssp_usp(opts);
 		}