More pinout oriented method of executing instructions (especially interrupts)

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2017-12-10 21:41:48 +00:00
parent 384484d228
commit 1edabd79f3
21 changed files with 217 additions and 180 deletions

View File

@@ -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();
}