mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-03-03 16:28:58 +00:00
6502: Better wrapping for the executing/executed events to avoid "fetchByte" issue.
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
4cd2dc68e1
commit
04fd979e56
@ -25,7 +25,10 @@ void EightBit::MOS6502::initialise() {
|
||||
}
|
||||
|
||||
int EightBit::MOS6502::step() {
|
||||
return Execute(FetchByte());
|
||||
ExecutingInstruction.fire(*this);
|
||||
auto returned = Execute(FetchByte());
|
||||
ExecutedInstruction.fire(*this);
|
||||
return returned;
|
||||
}
|
||||
|
||||
void EightBit::MOS6502::Reset() {
|
||||
@ -56,12 +59,10 @@ void EightBit::MOS6502::Interrupt(uint16_t vector) {
|
||||
|
||||
int EightBit::MOS6502::Execute(uint8_t cell) {
|
||||
cycles = 0;
|
||||
ExecutingInstruction.fire(*this);
|
||||
const auto& instruction = instructions[cell];
|
||||
const auto& method = instruction.vector;
|
||||
method();
|
||||
cycles += instruction.count;
|
||||
ExecutedInstruction.fire(*this);
|
||||
return cycles;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user