6502X: CPU does a read or write regardless if the result is trashed, even during reset and dummy pushes

This commit is contained in:
SaxxonPike 2019-07-09 19:46:33 -05:00
parent a8fd85157c
commit 9758efe604
1 changed files with 14 additions and 19 deletions

View File

@ -524,13 +524,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
bool interrupt_pending; bool interrupt_pending;
bool branch_irq_hack; //see Uop.RelBranch_Stage3 for more details bool branch_irq_hack; //see Uop.RelBranch_Stage3 for more details
bool Interrupted bool Interrupted => RDY && (NMI || (IRQ && !FlagI));
{
get
{
return RDY && (NMI || (IRQ && !FlagI));
}
}
void FetchDummy() void FetchDummy()
{ {
@ -560,10 +554,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502
void Fetch1() void Fetch1()
{ {
rdy_freeze = !RDY;
if (!RDY)
return;
my_iflag = FlagI; my_iflag = FlagI;
FlagI = iflag_pending; FlagI = iflag_pending;
if (!branch_irq_hack) if (!branch_irq_hack)
@ -671,16 +661,22 @@ namespace BizHawk.Emulation.Cores.Components.M6502
} }
void PushP_Reset() void PushP_Reset()
{
rdy_freeze = !RDY;
if (RDY)
{ {
ea = ResetVector; ea = ResetVector;
S--; _link.DummyReadMemory((ushort)(S-- + 0x100));
FlagI = true; FlagI = true;
}
} }
void PushDummy() void PushDummy()
{ {
S--; rdy_freeze = !RDY;
if (RDY)
{
_link.DummyReadMemory((ushort)(S-- + 0x100));
}
} }
void FetchPCLVector() void FetchPCLVector()
{ {
@ -2702,7 +2698,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502
mi = 0; mi = 0;
iflag_pending = FlagI; iflag_pending = FlagI;
ExecuteOneRetry(); ExecuteOneRetry();
return;
} }
void End_BranchSpecial() void End_BranchSpecial()
{ {
@ -2973,7 +2968,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
public void ExecuteOne() public void ExecuteOne()
{ {
// total cycles now incraments every time a cycle is called to accurately count during RDY // total cycles now increments every time a cycle is called to accurately count during RDY
TotalExecutedCycles++; TotalExecutedCycles++;
if (!rdy_freeze) if (!rdy_freeze)
{ {