From be3848eb2a0680372bdc7ed16e8c1bc0f581eac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Mon, 16 Jul 2012 00:32:46 +0000 Subject: [PATCH] fix BRSET mask --- src/emu/cpu/mc68hc11/hc11ops.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/emu/cpu/mc68hc11/hc11ops.c b/src/emu/cpu/mc68hc11/hc11ops.c index 50fb5973bd4..3538f773521 100644 --- a/src/emu/cpu/mc68hc11/hc11ops.c +++ b/src/emu/cpu/mc68hc11/hc11ops.c @@ -780,8 +780,7 @@ static void HC11OP(bclr_indx)(hc11_state *cpustate) { UINT8 offset = FETCH(cpustate); UINT8 mask = FETCH(cpustate); - UINT8 r = READ8(cpustate, cpustate->ix + offset); - r = r & ~mask; + UINT8 r = READ8(cpustate, cpustate->ix + offset) & ~mask; WRITE8(cpustate, cpustate->ix + offset, r); CLEAR_NZV(cpustate); SET_N8(r); @@ -901,7 +900,7 @@ static void HC11OP(brclr_dir)(hc11_state *cpustate) INT8 rel = FETCH(cpustate); UINT8 i = READ8(cpustate, d); - if(!(i & mask)) + if ((i & mask) == 0) { SET_PC(cpustate, cpustate->ppc + rel + 4); } @@ -918,7 +917,7 @@ static void HC11OP(brclr_indx)(hc11_state *cpustate) INT8 rel = FETCH(cpustate); UINT8 i = READ8(cpustate, cpustate->ix + offset); - if(!(i & mask)) + if ((i & mask) == 0) { SET_PC(cpustate, cpustate->ppc + rel + 4); } @@ -951,7 +950,7 @@ static void HC11OP(brset_indx)(hc11_state *cpustate) INT8 rel = FETCH(cpustate); UINT8 i = READ8(cpustate, cpustate->ix + offset); - if(i & mask) + if ((~i & mask) == 0) { SET_PC(cpustate, cpustate->ppc + rel + 4); } @@ -973,8 +972,7 @@ static void HC11OP(bset_indx)(hc11_state *cpustate) { UINT8 offset = FETCH(cpustate); UINT8 mask = FETCH(cpustate); - UINT8 r = READ8(cpustate, cpustate->ix + offset); - r = (r & ~mask) | mask; + UINT8 r = READ8(cpustate, cpustate->ix + offset) | mask; WRITE8(cpustate, cpustate->ix + offset, r); CLEAR_NZV(cpustate); SET_N8(r);