NESHawk: DMC timing on multiple write ocodes

This commit is contained in:
alyosha-tas 2021-06-28 14:17:41 -04:00
parent 37a6446996
commit 1aadfd1edf
2 changed files with 9 additions and 3 deletions

View File

@ -511,13 +511,13 @@ namespace BizHawk.Emulation.Cores.Components.M6502
private const int VOP_NUM = 264;
//opcode bytes.. theoretically redundant with the temp variables? who knows.
private int opcode;
public int opcode;
private byte opcode2, opcode3;
private int ea, alu_temp; //cpu internal temp variables
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 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.
//not sure if this is real or not but it helps with the branch_irq_hack

View File

@ -491,7 +491,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{
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;
dmc_dma_exec = true;
apu.dmc_dma_countdown--;