RESET clears the interrupt-queue
This commit is contained in:
parent
4bf488212b
commit
841d0d9720
2 changed files with 11 additions and 3 deletions
13
cpu.cpp
13
cpu.cpp
|
@ -15,9 +15,6 @@
|
|||
|
||||
cpu::cpu(bus *const b, uint32_t *const event) : b(b), event(event)
|
||||
{
|
||||
for(int level=0; level<8; level++)
|
||||
queued_interrupts.insert({ level, { } });
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
|
@ -25,6 +22,14 @@ cpu::~cpu()
|
|||
{
|
||||
}
|
||||
|
||||
void cpu::init_interrupt_queue()
|
||||
{
|
||||
queued_interrupts.clear();
|
||||
|
||||
for(int level=0; level<8; level++)
|
||||
queued_interrupts.insert({ level, { } });
|
||||
}
|
||||
|
||||
void cpu::emulation_start()
|
||||
{
|
||||
instruction_count = 0;
|
||||
|
@ -83,6 +88,7 @@ void cpu::reset()
|
|||
psw = 7 << 5;
|
||||
fpsr = 0;
|
||||
runMode = false;
|
||||
init_interrupt_queue();
|
||||
}
|
||||
|
||||
uint16_t cpu::getRegister(const int nr, const bool prev_mode) const
|
||||
|
@ -1372,6 +1378,7 @@ bool cpu::misc_operations(const uint16_t instr)
|
|||
|
||||
case 0b0000000000000101: // RESET
|
||||
b->init();
|
||||
init_interrupt_queue();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
1
cpu.h
1
cpu.h
|
@ -85,6 +85,7 @@ public:
|
|||
void pushStack(const uint16_t v);
|
||||
uint16_t popStack();
|
||||
|
||||
void init_interrupt_queue();
|
||||
void queue_interrupt(const uint8_t level, const uint8_t vector);
|
||||
|
||||
void busError();
|
||||
|
|
Loading…
Add table
Reference in a new issue