1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Writes to a timer _during reload_ now have effect.

Net: one CIA test passed.
This commit is contained in:
Thomas Harte 2021-08-03 16:57:05 -04:00
parent ef58ce6277
commit ee6039bfa5

View File

@ -39,6 +39,11 @@ struct MOS6526Storage {
pending |= ReloadInOne;
}
}
// If this write has hit during a reload cycle, reload.
if(pending & ReloadNow) {
value = reload;
}
}
template <bool is_counter_2> void set_control(uint8_t v) {
@ -46,9 +51,9 @@ struct MOS6526Storage {
}
template <bool is_counter_2> bool advance(bool chained_input) {
// TODO: remove most of the conditionals here.
// TODO: remove most of the conditionals here in favour of bit shuffling.
pending <<= 1;
pending = (pending & PendingClearMask) << 1;
//
// Apply feeder states inputs: anything that
@ -117,11 +122,6 @@ struct MOS6526Storage {
}
//
// Clear any bits that would flow into the wrong field.
//
pending &= PendingClearMask;
return should_reload;
}