Add files via upload

This commit is contained in:
alyosha-tas 2017-10-13 16:27:41 -04:00 committed by GitHub
parent 946c025cd6
commit 3be21c583e
4 changed files with 18 additions and 24 deletions

View File

@ -83,28 +83,28 @@ namespace BizHawk.Emulation.Common.Components.Z80A
}
// Interrupt mode 2 uses the I vector combined with a byte on the data bus
// Again for now we assume only a 0 on the data bus and jump to 0xI00
// Again for now we assume only a 0 on the data bus and jump to (0xI00)
private void INTERRUPT_2(ushort src)
{
cur_instr = new ushort[]
{IDLE,
IDLE,
IDLE,
IDLE,
IDLE,
IDLE,
DEC16, SPl, SPh,
IDLE,
WR, SPl, SPh, PCh,
IDLE,
DEC16, SPl, SPh,
IDLE,
WR, SPl, SPh, PCl,
IDLE,
IDLE,
ASGN, PCl, 0,
IDLE,
TR, PCh, I,
IDLE,
IDLE,
RD, Z, PCl, PCh,
INC16, PCl, PCh,
IDLE,
RD, W, PCl, PCh,
IDLE,
TR16, PCl, PCh, Z, W,
OP };
}
@ -116,6 +116,7 @@ namespace BizHawk.Emulation.Common.Components.Z80A
IFF2 = false;
NonMaskableInterrupt = false;
NonMaskableInterruptPending = false;
FlagI = false;
InterruptMode = 1;
}
}

View File

@ -43,8 +43,6 @@ namespace BizHawk.Emulation.Common.Components.Z80A
public ushort[] Regs = new ushort[36];
// The Z80 also has ports to communicate with external components
public bool FlagI;
public bool FlagC
@ -107,7 +105,7 @@ namespace BizHawk.Emulation.Common.Components.Z80A
private void ResetRegisters()
{
for (int i=0; i < 14; i++)
for (int i=0; i < 36; i++)
{
Regs[i] = 0;
}

View File

@ -440,11 +440,9 @@ namespace BizHawk.Emulation.Common.Components.Z80A
private void LD_SP_16(ushort src_l, ushort src_h)
{
cur_instr = new ushort[]
{IDLE,
IDLE,
{IDLE,
IDLE,
TR, SPl, src_l,
IDLE,
TR, SPh, src_h,
IDLE,
OP };
@ -526,6 +524,7 @@ namespace BizHawk.Emulation.Common.Components.Z80A
TR16, Z, W, dest_l, dest_h,
INC16, Z, W,
IDLE,
IDLE,
op, dest_l, dest_h, src_l, src_h,
IDLE,
IDLE,
@ -546,12 +545,8 @@ namespace BizHawk.Emulation.Common.Components.Z80A
cur_instr = new ushort[]
{IDLE,
IDLE,
IDLE,
IDLE,
TR16, Z, W, L, H,
IDLE,
IDLE,
IDLE,
RD, ALU, Z, W,
IDLE,
RRD, ALU, A,
@ -569,12 +564,8 @@ namespace BizHawk.Emulation.Common.Components.Z80A
cur_instr = new ushort[]
{IDLE,
IDLE,
IDLE,
IDLE,
TR16, Z, W, L, H,
IDLE,
IDLE,
IDLE,
RD, ALU, Z, W,
IDLE,
RLD, ALU, A,

View File

@ -177,6 +177,7 @@ namespace BizHawk.Emulation.Common.Components.Z80A
else if (iff1 && FlagI && NO_prefix)
{
iff1 = iff2 = false;
EI_pending = 0;
if (TraceCallback != null)
{
@ -310,6 +311,7 @@ namespace BizHawk.Emulation.Common.Components.Z80A
else if (iff1 && FlagI && NO_prefix)
{
iff1 = iff2 = false;
EI_pending = 0;
if (TraceCallback != null)
{
@ -384,6 +386,7 @@ namespace BizHawk.Emulation.Common.Components.Z80A
else if (iff1 && FlagI && NO_prefix)
{
iff1 = iff2 = false;
EI_pending = 0;
if (TraceCallback != null)
{
@ -415,7 +418,6 @@ namespace BizHawk.Emulation.Common.Components.Z80A
}
else
{
instr_pntr = 0;
Regs[R]++;
Regs[R] &= 0xFF;
cur_instr = new ushort[]
@ -424,6 +426,8 @@ namespace BizHawk.Emulation.Common.Components.Z80A
IDLE,
HALT };
}
instr_pntr = 0;
break;
case RD:
Read_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++], cur_instr[instr_pntr++]);