NESHawk: DMC timing on multiple write ocodes
This commit is contained in:
parent
37a6446996
commit
1aadfd1edf
|
@ -511,13 +511,13 @@ namespace BizHawk.Emulation.Cores.Components.M6502
|
||||||
private const int VOP_NUM = 264;
|
private const int VOP_NUM = 264;
|
||||||
|
|
||||||
//opcode bytes.. theoretically redundant with the temp variables? who knows.
|
//opcode bytes.. theoretically redundant with the temp variables? who knows.
|
||||||
private int opcode;
|
public int opcode;
|
||||||
private byte opcode2, opcode3;
|
private byte opcode2, opcode3;
|
||||||
|
|
||||||
private int ea, alu_temp; //cpu internal temp variables
|
private int ea, alu_temp; //cpu internal temp variables
|
||||||
private int mi; //microcode index
|
private int mi; //microcode index
|
||||||
private bool iflag_pending; //iflag must be stored after it is checked in some cases (CLI and SEI).
|
private bool iflag_pending; //iflag must be stored after it is checked in some cases (CLI and SEI).
|
||||||
private bool rdy_freeze; //true if the CPU must be frozen
|
public bool rdy_freeze; //true if the CPU must be frozen
|
||||||
|
|
||||||
//tracks whether an interrupt condition has popped up recently.
|
//tracks whether an interrupt condition has popped up recently.
|
||||||
//not sure if this is real or not but it helps with the branch_irq_hack
|
//not sure if this is real or not but it helps with the branch_irq_hack
|
||||||
|
|
|
@ -492,6 +492,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
dmc_realign = true;
|
dmc_realign = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// By this point the cpu should be frozen, if it is not, then we are in a multi-write opcode, add another cycle delay
|
||||||
|
if (!cpu.RDY && !cpu.rdy_freeze && ((cpu.TotalExecutedCycles & 1) == 1))
|
||||||
|
{
|
||||||
|
apu.dmc_dma_countdown+=2;
|
||||||
|
}
|
||||||
|
|
||||||
cpu.RDY = false;
|
cpu.RDY = false;
|
||||||
dmc_dma_exec = true;
|
dmc_dma_exec = true;
|
||||||
apu.dmc_dma_countdown--;
|
apu.dmc_dma_countdown--;
|
||||||
|
|
Loading…
Reference in New Issue