mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-10-22 07:02:37 +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:
1 parent
4cd2dc68e1
commit
04fd979e56
1 file changed
+4
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user