1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Don't set interrupt flags before capture.

This commit is contained in:
Thomas Harte 2024-03-15 21:34:39 -04:00
parent c25d0e8843
commit 1979d2e5ba
2 changed files with 10 additions and 10 deletions

View File

@ -147,11 +147,6 @@ struct Registers {
/// Updates the program counter, interupt flags and link register if applicable to begin @c exception.
template <Exception type>
void exception() {
interrupt_flags_ |= ConditionCode::IRQDisable;
if constexpr (type == Exception::Reset || type == Exception::FIQ) {
interrupt_flags_ |= ConditionCode::FIQDisable;
}
switch(type) {
case Exception::IRQ: {
const auto r14 = pc_status(8);
@ -170,6 +165,11 @@ struct Registers {
} break;
}
interrupt_flags_ |= ConditionCode::IRQDisable;
if constexpr (type == Exception::Reset || type == Exception::FIQ) {
interrupt_flags_ |= ConditionCode::FIQDisable;
}
set_pc(uint32_t(type));
}

View File

@ -389,7 +389,7 @@ struct Interrupts {
// IRQ A.
case 0x3200010 & AddressMask:
value = irq_a_.status;
logger.error().append("IRQ A status is %02x", value);
// logger.error().append("IRQ A status is %02x", value);
return true;
case 0x3200014 & AddressMask:
value = irq_a_.request();
@ -403,7 +403,7 @@ struct Interrupts {
// IRQ B.
case 0x3200020 & AddressMask:
value = irq_b_.status;
logger.error().append("IRQ B status is %02x", value);
// logger.error().append("IRQ B status is %02x", value);
return true;
case 0x3200024 & AddressMask:
value = irq_b_.request();
@ -434,7 +434,7 @@ struct Interrupts {
case 0x3200060 & AddressMask:
case 0x3200070 & AddressMask:
value = counters_[(target >> 4) - 0x4].output & 0xff;
logger.error().append("%02x: Counter %d low is %02x", target, (target >> 4) - 0x4, value);
// logger.error().append("%02x: Counter %d low is %02x", target, (target >> 4) - 0x4, value);
return true;
case 0x3200044 & AddressMask:
@ -442,7 +442,7 @@ struct Interrupts {
case 0x3200064 & AddressMask:
case 0x3200074 & AddressMask:
value = counters_[(target >> 4) - 0x4].output >> 8;
logger.error().append("%02x: Counter %d high is %02x", target, (target >> 4) - 0x4, value);
// logger.error().append("%02x: Counter %d high is %02x", target, (target >> 4) - 0x4, value);
return true;
}
@ -1041,7 +1041,7 @@ class ConcreteMachine:
// printf("");
// }
// log |= (executor_.pc() > 0x02000000 && executor_.pc() < 0x02000078);
log |= executor_.pc() == 0x0381201c;
// log |= executor_.pc() == 0x0381201c;
// log = executor_.pc() == 0x0381202c;
// log |= (executor_.pc() > 0x03801000);
// log &= executor_.pc() != 0x03801a0c;