mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-22 09:30:32 +00:00
The clock still has to tick, even while held on RDY low, otherwise cycle timing won't work.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
a90ca6ba38
commit
8b187e7614
@ -22,18 +22,21 @@ void EightBit::MOS6502::powerOn() {
|
||||
int EightBit::MOS6502::step() {
|
||||
resetCycles();
|
||||
ExecutingInstruction.fire(*this);
|
||||
if (LIKELY(powered() && raised(RDY()))) {
|
||||
if (LIKELY(powered())) {
|
||||
addCycle();
|
||||
if (UNLIKELY(lowered(SO())))
|
||||
handleSO();
|
||||
lower(SYNC()); // Instruction fetch beginning
|
||||
opcode() = fetchByte();
|
||||
if (UNLIKELY(lowered(RESET())))
|
||||
handleRESET();
|
||||
else if (UNLIKELY(lowered(NMI())))
|
||||
handleNMI();
|
||||
else if (UNLIKELY(lowered(IRQ()) && !interruptMasked()))
|
||||
handleIRQ();
|
||||
execute();
|
||||
if (LIKELY(raised(RDY()))) {
|
||||
lower(SYNC()); // Instruction fetch beginning
|
||||
opcode() = BUS().read(PC()++); // can't use fetchByte
|
||||
if (UNLIKELY(lowered(RESET())))
|
||||
handleRESET();
|
||||
else if (UNLIKELY(lowered(NMI())))
|
||||
handleNMI();
|
||||
else if (UNLIKELY(lowered(IRQ()) && !interruptMasked()))
|
||||
handleIRQ();
|
||||
execute();
|
||||
}
|
||||
}
|
||||
ExecutedInstruction.fire(*this);
|
||||
return cycles();
|
||||
|
Loading…
Reference in New Issue
Block a user