mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-03-12 10:41:58 +00:00
More pinout oriented method of executing instructions (especially interrupts)
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -6,13 +6,14 @@ EightBit::Processor::Processor(Bus& bus)
|
||||
}
|
||||
|
||||
void EightBit::Processor::reset() {
|
||||
if (lowered(POWER()))
|
||||
throw std::logic_error("POWER cannot be low");
|
||||
raise(INT());
|
||||
raise(NMI());
|
||||
raise(RESET());
|
||||
PC().word = MEMPTR().word = 0;
|
||||
}
|
||||
|
||||
void EightBit::Processor::initialise() {
|
||||
reset();
|
||||
}
|
||||
|
||||
int EightBit::Processor::run(int limit) {
|
||||
int current = 0;
|
||||
while (LIKELY(powered()) && current < limit) {
|
||||
@@ -22,6 +23,8 @@ int EightBit::Processor::run(int limit) {
|
||||
}
|
||||
|
||||
int EightBit::Processor::singleStep() {
|
||||
if (UNLIKELY(lowered(RESET())))
|
||||
reset();
|
||||
return step();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user