mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-24 12:30:17 +00:00
Ensure that reading the interrupt flags really clears the master bit.
Also makes some guesses on one-shot and reload timing. Alas the test isn't in itself specific enough to be more systematic here.
This commit is contained in:
parent
c640132699
commit
77c627e822
@ -170,6 +170,7 @@ uint8_t MOS6526<BusHandlerT, personality>::read(int address) {
|
|||||||
case 13: {
|
case 13: {
|
||||||
const uint8_t result = interrupt_state_;
|
const uint8_t result = interrupt_state_;
|
||||||
interrupt_state_ = 0;
|
interrupt_state_ = 0;
|
||||||
|
pending_ &= ~(InterruptNow | InterruptInOne);
|
||||||
update_interrupts();
|
update_interrupts();
|
||||||
return result;
|
return result;
|
||||||
} break;
|
} break;
|
||||||
|
@ -60,12 +60,12 @@ struct MOS6526Storage {
|
|||||||
pending |= ApplyClockInTwo;
|
pending |= ApplyClockInTwo;
|
||||||
}
|
}
|
||||||
if(control & 0x08) {
|
if(control & 0x08) {
|
||||||
pending |= OneShotInTwo;
|
pending |= OneShotInOne;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((pending & ReloadNow) || (hit_zero && (pending & ApplyClockInTwo))) {
|
if((pending & ReloadNow) || (hit_zero && (pending & ApplyClockInTwo))) {
|
||||||
value = reload;
|
value = reload;
|
||||||
pending &= ~ApplyClockInOne; // Skip one decrement.
|
pending &= ~ApplyClockNow; // Skip one decrement.
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pending & ApplyClockNow) {
|
if(pending & ApplyClockNow) {
|
||||||
@ -86,12 +86,12 @@ struct MOS6526Storage {
|
|||||||
private:
|
private:
|
||||||
int pending = 0;
|
int pending = 0;
|
||||||
|
|
||||||
static constexpr int ReloadInThree = 1 << 0;
|
// static constexpr int ReloadInThree = 1 << 0;
|
||||||
static constexpr int ReloadInTwo = 1 << 1;
|
// static constexpr int ReloadInTwo = 1 << 1;
|
||||||
static constexpr int ReloadInOne = 1 << 2;
|
static constexpr int ReloadInOne = 1 << 2;
|
||||||
static constexpr int ReloadNow = 1 << 3;
|
static constexpr int ReloadNow = 1 << 3;
|
||||||
|
|
||||||
static constexpr int OneShotInTwo = 1 << 4;
|
// static constexpr int OneShotInTwo = 1 << 4;
|
||||||
static constexpr int OneShotInOne = 1 << 5;
|
static constexpr int OneShotInOne = 1 << 5;
|
||||||
static constexpr int OneShotNow = 1 << 6;
|
static constexpr int OneShotNow = 1 << 6;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user