mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-20 14:29:11 +00:00
Extend PAL/NTSC selection to audio.
This commit is contained in:
parent
8219beeb1a
commit
6fa29c204b
@ -78,7 +78,7 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
void set_constrol(uint8_t value) {
|
||||
void set_control(const uint8_t value) {
|
||||
audio_queue_.enqueue([this, value] {
|
||||
volume_ = std::min(value & 0xf, 8); // Only nine volumes are available.
|
||||
masks_[0] = (value & 0x10) ? 1 : 0;
|
||||
@ -90,6 +90,12 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
void set_divider(const uint8_t value) {
|
||||
audio_queue_.enqueue([this, value] {
|
||||
frequency_multiplier_ = value & 0x40 ? 4 : 5;
|
||||
});
|
||||
}
|
||||
|
||||
private:
|
||||
// Calling-thread state.
|
||||
Concurrency::AsyncTaskQueue<false> &audio_queue_;
|
||||
|
@ -347,7 +347,11 @@ public:
|
||||
case 0xff04: timers_.write<4>(*value); break;
|
||||
case 0xff05: timers_.write<5>(*value); break;
|
||||
case 0xff06: video_.write<0xff06>(*value); break;
|
||||
case 0xff07: video_.write<0xff07>(*value); break;
|
||||
case 0xff07:
|
||||
video_.write<0xff07>(*value);
|
||||
update_audio();
|
||||
audio_.set_divider(*value);
|
||||
break;
|
||||
case 0xff08:
|
||||
// Observation here: the kernel posts a 0 to this
|
||||
// address upon completing each keyboard scan cycle,
|
||||
@ -398,7 +402,7 @@ public:
|
||||
case 0xff11:
|
||||
ff11_ = *value;
|
||||
update_audio();
|
||||
audio_.set_constrol(*value);
|
||||
audio_.set_control(*value);
|
||||
break;
|
||||
case 0xff12:
|
||||
ff12_ = *value & 0x3f;
|
||||
|
Loading…
x
Reference in New Issue
Block a user