mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-26 15:32:04 +00:00
Add 8250 feature of 'count, regardless'.
This commit is contained in:
parent
5cc25d0846
commit
f8380d2d4c
@ -79,10 +79,10 @@ void MOS6526<BusHandlerT, personality>::write(int address, uint8_t value) {
|
||||
break;
|
||||
|
||||
// Counters; writes set the reload values.
|
||||
case 4: counter_[0].template set_reload<0>(value); break;
|
||||
case 5: counter_[0].template set_reload<8>(value); break;
|
||||
case 6: counter_[1].template set_reload<0>(value); break;
|
||||
case 7: counter_[1].template set_reload<8>(value); break;
|
||||
case 4: counter_[0].template set_reload<0, personality == Personality::P8250>(value); break;
|
||||
case 5: counter_[0].template set_reload<8, personality == Personality::P8250>(value); break;
|
||||
case 6: counter_[1].template set_reload<0, personality == Personality::P8250>(value); break;
|
||||
case 7: counter_[1].template set_reload<8, personality == Personality::P8250>(value); break;
|
||||
|
||||
// Time-of-day clock.
|
||||
case 8: tod_.template write<0>(value); break;
|
||||
|
@ -189,12 +189,19 @@ struct MOS6526Storage {
|
||||
uint16_t value = 0;
|
||||
uint8_t control = 0;
|
||||
|
||||
template <int shift> void set_reload(uint8_t v) {
|
||||
template <int shift, bool is_8250> void set_reload(uint8_t v) {
|
||||
reload = (reload & (0xff00 >> shift)) | uint16_t(v << shift);
|
||||
|
||||
if constexpr (shift == 8) {
|
||||
if(!(control&1)) {
|
||||
// This seems to be a special 8250 feature per the Amiga
|
||||
// Hardware Reference Manual; cf. Appendix F.
|
||||
if(is_8250) {
|
||||
control |= 1;
|
||||
pending |= ReloadInOne;
|
||||
} else {
|
||||
if(!(control&1)) {
|
||||
pending |= ReloadInOne;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user