Merge pull request #1330 from TASVideos/z80fixes

Z80: fix IN A, (N) flag affection
This commit is contained in:
Asnivor 2018-09-19 23:01:30 +01:00 committed by GitHub
commit 2ed0c919d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -58,7 +58,13 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
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];
}

View File

@ -609,7 +609,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
IDLE,
WAIT,
WAIT,
IN, A, Z, W,
IN_A_N, A, Z, W,
INC16, Z, W,
WAIT,
OP_F,

View File

@ -80,6 +80,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
public const ushort RST = 65;
public const ushort REP_OP_I = 66;
public const ushort REP_OP_O = 67;
public const ushort IN_A_N = 68;
// non-state variables
public ushort Ztemp1, Ztemp2, Ztemp3, Ztemp4;
@ -478,6 +479,9 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
case IN:
IN_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++], cur_instr[instr_pntr++]);
break;
case IN_A_N:
IN_A_N_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++], cur_instr[instr_pntr++]);
break;
case NEG:
NEG_8_Func(cur_instr[instr_pntr++]);
break;