Merge pull request #1330 from TASVideos/z80fixes
Z80: fix IN A, (N) flag affection
This commit is contained in:
commit
2ed0c919d2
|
@ -58,7 +58,13 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
Flag3 = Regs[dest].Bit(3);
|
Flag3 = Regs[dest].Bit(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TR_Func(ushort dest, ushort src)
|
public void IN_A_N_Func(ushort dest, ushort src_l, ushort src_h)
|
||||||
|
{
|
||||||
|
Regs[dest] = ReadHardware((ushort)(Regs[src_l] | (Regs[src_h]) << 8));
|
||||||
|
Regs[DB] = Regs[dest];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TR_Func(ushort dest, ushort src)
|
||||||
{
|
{
|
||||||
Regs[dest] = Regs[src];
|
Regs[dest] = Regs[src];
|
||||||
}
|
}
|
||||||
|
|
|
@ -609,7 +609,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
IDLE,
|
IDLE,
|
||||||
WAIT,
|
WAIT,
|
||||||
WAIT,
|
WAIT,
|
||||||
IN, A, Z, W,
|
IN_A_N, A, Z, W,
|
||||||
INC16, Z, W,
|
INC16, Z, W,
|
||||||
WAIT,
|
WAIT,
|
||||||
OP_F,
|
OP_F,
|
||||||
|
|
|
@ -80,6 +80,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
public const ushort RST = 65;
|
public const ushort RST = 65;
|
||||||
public const ushort REP_OP_I = 66;
|
public const ushort REP_OP_I = 66;
|
||||||
public const ushort REP_OP_O = 67;
|
public const ushort REP_OP_O = 67;
|
||||||
|
public const ushort IN_A_N = 68;
|
||||||
|
|
||||||
// non-state variables
|
// non-state variables
|
||||||
public ushort Ztemp1, Ztemp2, Ztemp3, Ztemp4;
|
public ushort Ztemp1, Ztemp2, Ztemp3, Ztemp4;
|
||||||
|
@ -478,6 +479,9 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
case IN:
|
case IN:
|
||||||
IN_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++], cur_instr[instr_pntr++]);
|
IN_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++], cur_instr[instr_pntr++]);
|
||||||
break;
|
break;
|
||||||
|
case IN_A_N:
|
||||||
|
IN_A_N_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++], cur_instr[instr_pntr++]);
|
||||||
|
break;
|
||||||
case NEG:
|
case NEG:
|
||||||
NEG_8_Func(cur_instr[instr_pntr++]);
|
NEG_8_Func(cur_instr[instr_pntr++]);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue