mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-27 18:55:48 +00:00
Don't set interrupt flags before capture.
This commit is contained in:
parent
c25d0e8843
commit
1979d2e5ba
@ -147,11 +147,6 @@ struct Registers {
|
|||||||
/// Updates the program counter, interupt flags and link register if applicable to begin @c exception.
|
/// Updates the program counter, interupt flags and link register if applicable to begin @c exception.
|
||||||
template <Exception type>
|
template <Exception type>
|
||||||
void exception() {
|
void exception() {
|
||||||
interrupt_flags_ |= ConditionCode::IRQDisable;
|
|
||||||
if constexpr (type == Exception::Reset || type == Exception::FIQ) {
|
|
||||||
interrupt_flags_ |= ConditionCode::FIQDisable;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case Exception::IRQ: {
|
case Exception::IRQ: {
|
||||||
const auto r14 = pc_status(8);
|
const auto r14 = pc_status(8);
|
||||||
@ -170,6 +165,11 @@ struct Registers {
|
|||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interrupt_flags_ |= ConditionCode::IRQDisable;
|
||||||
|
if constexpr (type == Exception::Reset || type == Exception::FIQ) {
|
||||||
|
interrupt_flags_ |= ConditionCode::FIQDisable;
|
||||||
|
}
|
||||||
|
|
||||||
set_pc(uint32_t(type));
|
set_pc(uint32_t(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ struct Interrupts {
|
|||||||
// IRQ A.
|
// IRQ A.
|
||||||
case 0x3200010 & AddressMask:
|
case 0x3200010 & AddressMask:
|
||||||
value = irq_a_.status;
|
value = irq_a_.status;
|
||||||
logger.error().append("IRQ A status is %02x", value);
|
// logger.error().append("IRQ A status is %02x", value);
|
||||||
return true;
|
return true;
|
||||||
case 0x3200014 & AddressMask:
|
case 0x3200014 & AddressMask:
|
||||||
value = irq_a_.request();
|
value = irq_a_.request();
|
||||||
@ -403,7 +403,7 @@ struct Interrupts {
|
|||||||
// IRQ B.
|
// IRQ B.
|
||||||
case 0x3200020 & AddressMask:
|
case 0x3200020 & AddressMask:
|
||||||
value = irq_b_.status;
|
value = irq_b_.status;
|
||||||
logger.error().append("IRQ B status is %02x", value);
|
// logger.error().append("IRQ B status is %02x", value);
|
||||||
return true;
|
return true;
|
||||||
case 0x3200024 & AddressMask:
|
case 0x3200024 & AddressMask:
|
||||||
value = irq_b_.request();
|
value = irq_b_.request();
|
||||||
@ -434,7 +434,7 @@ struct Interrupts {
|
|||||||
case 0x3200060 & AddressMask:
|
case 0x3200060 & AddressMask:
|
||||||
case 0x3200070 & AddressMask:
|
case 0x3200070 & AddressMask:
|
||||||
value = counters_[(target >> 4) - 0x4].output & 0xff;
|
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;
|
return true;
|
||||||
|
|
||||||
case 0x3200044 & AddressMask:
|
case 0x3200044 & AddressMask:
|
||||||
@ -442,7 +442,7 @@ struct Interrupts {
|
|||||||
case 0x3200064 & AddressMask:
|
case 0x3200064 & AddressMask:
|
||||||
case 0x3200074 & AddressMask:
|
case 0x3200074 & AddressMask:
|
||||||
value = counters_[(target >> 4) - 0x4].output >> 8;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1041,7 +1041,7 @@ class ConcreteMachine:
|
|||||||
// printf("");
|
// printf("");
|
||||||
// }
|
// }
|
||||||
// log |= (executor_.pc() > 0x02000000 && executor_.pc() < 0x02000078);
|
// log |= (executor_.pc() > 0x02000000 && executor_.pc() < 0x02000078);
|
||||||
log |= executor_.pc() == 0x0381201c;
|
// log |= executor_.pc() == 0x0381201c;
|
||||||
// log = executor_.pc() == 0x0381202c;
|
// log = executor_.pc() == 0x0381202c;
|
||||||
// log |= (executor_.pc() > 0x03801000);
|
// log |= (executor_.pc() > 0x03801000);
|
||||||
// log &= executor_.pc() != 0x03801a0c;
|
// log &= executor_.pc() != 0x03801a0c;
|
||||||
|
Loading…
Reference in New Issue
Block a user