summaryrefslogtreecommitdiff
path: root/z80_decode.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2022-12-26 16:34:22 +0000
committerIan C <ianc@noddybox.co.uk>2022-12-26 16:34:22 +0000
commit33ebf50aa4a855fb1a0df2cf682796abbc39d07f (patch)
tree6a2a7a6b27c16a0dfe5f3522557da4af0a43c352 /z80_decode.c
parent6220948f30b0abe230ed9f93491bd7b83fba5246 (diff)
Failed attempts to fix runall for BIT. Also some tweaks to sources and
the initial noisy mode of EMMA.
Diffstat (limited to 'z80_decode.c')
-rw-r--r--z80_decode.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/z80_decode.c b/z80_decode.c
index f675fc5..445d122 100644
--- a/z80_decode.c
+++ b/z80_decode.c
@@ -441,6 +441,7 @@ do { \
#define BIT(REG,B) \
do { \
cpu->AF.b.lo&=C_Z80; \
+ cpu->AF.b.lo|=H_Z80; \
if ((REG)&(1<<B)) \
{ \
cpu->AF.b.lo|=S_Z80&REG; \
@@ -449,7 +450,6 @@ do { \
{ \
cpu->AF.b.lo|=Z_Z80|P_Z80; \
} \
- cpu->AF.b.lo|=H_Z80; \
SETHIDDEN(REG); \
} while(0)
@@ -879,7 +879,7 @@ do { \
\
case BASE+6: /* OP2 (HL) */ \
TSTATE(12); \
- OP_ON_MEM_WITH_ARG(OP2,cpu->HL.w,BIT_NO); \
+ OP_ON_MEM_WITH_ARG(OP2,cpu->HL.w,BIT_NO); \
break; \
\
case BASE+7: /* OP A */ \
@@ -1055,7 +1055,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
}
case 0x44: /* NEG */
- {
+ {
Z80Byte b;
TSTATE(8);
@@ -1064,7 +1064,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
cpu->AF.b.hi=0;
SUB8(b);
break;
- }
+ }
case 0x45: /* RETN */
TSTATE(14);
@@ -1134,6 +1134,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
CALLBACK(eZ80_RETI,0);
cpu->IFF1=cpu->IFF2;
POP(cpu->PC);
+ cpu->priv->memptr.w=cpu->PC;
break;
case 0x4e: /* IM 0/1 */
@@ -1182,7 +1183,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
}
case 0x54: /* NEG */
- {
+ {
Z80Byte b;
TSTATE(8);
@@ -1191,7 +1192,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
cpu->AF.b.hi=0;
SUB8(b);
break;
- }
+ }
case 0x55: /* RETN */
TSTATE(14);
@@ -1245,7 +1246,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
}
case 0x5c: /* NEG */
- {
+ {
Z80Byte b;
TSTATE(8);
@@ -1254,7 +1255,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
cpu->AF.b.hi=0;
SUB8(b);
break;
- }
+ }
case 0x5d: /* RETN */
TSTATE(14);
@@ -1383,7 +1384,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
}
case 0x6c: /* NEG */
- {
+ {
Z80Byte b;
TSTATE(8);
@@ -1392,7 +1393,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
cpu->AF.b.hi=0;
SUB8(b);
break;
- }
+ }
case 0x6d: /* RETN */
TSTATE(14);
@@ -1458,7 +1459,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
break;
case 0x74: /* NEG */
- {
+ {
Z80Byte b;
TSTATE(8);
@@ -1467,7 +1468,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
cpu->AF.b.hi=0;
SUB8(b);
break;
- }
+ }
case 0x75: /* RETN */
TSTATE(14);
@@ -1519,7 +1520,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
break;
case 0x7c: /* NEG */
- {
+ {
Z80Byte b;
TSTATE(8);
@@ -1528,7 +1529,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
cpu->AF.b.hi=0;
SUB8(b);
break;
- }
+ }
case 0x7d: /* RETN */
TSTATE(14);
@@ -1597,7 +1598,7 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
if (cpu->BC.w!=1)
{
- PRIV->memptr.w=cpu->PC-2;
+ PRIV->memptr.w=cpu->PC-1;
}
LDI;
@@ -1781,14 +1782,14 @@ static void ShiftedDecodeCB(Z80 *cpu, Z80Byte opcode, Z80Relative offset)
SHIFTED_CB_ALU_BLOCK(0x30,SLL)
SHIFTED_CB_ALU_BLOCK(0x38,SRL)
- SHIFTED_CB_BITMANIP_BLOCK(0x40,BIT,BIT_MEMPTR,0)
- SHIFTED_CB_BITMANIP_BLOCK(0x48,BIT,BIT_MEMPTR,1)
- SHIFTED_CB_BITMANIP_BLOCK(0x50,BIT,BIT_MEMPTR,2)
- SHIFTED_CB_BITMANIP_BLOCK(0x58,BIT,BIT_MEMPTR,3)
- SHIFTED_CB_BITMANIP_BLOCK(0x60,BIT,BIT_MEMPTR,4)
- SHIFTED_CB_BITMANIP_BLOCK(0x68,BIT,BIT_MEMPTR,5)
- SHIFTED_CB_BITMANIP_BLOCK(0x70,BIT,BIT_MEMPTR,6)
- SHIFTED_CB_BITMANIP_BLOCK(0x78,BIT,BIT_MEMPTR,7)
+ SHIFTED_CB_BITMANIP_BLOCK(0x40,BIT_MEMPTR,BIT_MEMPTR,0)
+ SHIFTED_CB_BITMANIP_BLOCK(0x48,BIT_MEMPTR,BIT_MEMPTR,1)
+ SHIFTED_CB_BITMANIP_BLOCK(0x50,BIT_MEMPTR,BIT_MEMPTR,2)
+ SHIFTED_CB_BITMANIP_BLOCK(0x58,BIT_MEMPTR,BIT_MEMPTR,3)
+ SHIFTED_CB_BITMANIP_BLOCK(0x60,BIT_MEMPTR,BIT_MEMPTR,4)
+ SHIFTED_CB_BITMANIP_BLOCK(0x68,BIT_MEMPTR,BIT_MEMPTR,5)
+ SHIFTED_CB_BITMANIP_BLOCK(0x70,BIT_MEMPTR,BIT_MEMPTR,6)
+ SHIFTED_CB_BITMANIP_BLOCK(0x78,BIT_MEMPTR,BIT_MEMPTR,7)
SHIFTED_CB_BITMANIP_BLOCK(0x80,BIT_RES,BIT_RES,0)
SHIFTED_CB_BITMANIP_BLOCK(0x88,BIT_RES,BIT_RES,1)