mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-28 06:29:37 +00:00
Merge pull request #968 from TomHarte/DaveAudio
Dave: apply ring modulation during sync, too.
This commit is contained in:
commit
c6fcd9a1eb
@ -67,7 +67,7 @@ Analyser::Static::TargetList Analyser::Static::Enterprise::GetTargets(const Medi
|
|||||||
|
|
||||||
if(!has_exdos_ini) {
|
if(!has_exdos_ini) {
|
||||||
if(did_pick_file) {
|
if(did_pick_file) {
|
||||||
target->loading_command = std::string("run \"") + selected_file->name + "." + selected_file->extension + "\"";
|
target->loading_command = std::string("run \"") + selected_file->name + "." + selected_file->extension + "\"\n";
|
||||||
} else {
|
} else {
|
||||||
target->loading_command = ":dir\n";
|
target->loading_command = ":dir\n";
|
||||||
}
|
}
|
||||||
|
@ -69,14 +69,12 @@ void Audio::set_sample_volume_range(int16_t range) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Audio::update_channel(int c) {
|
void Audio::update_channel(int c) {
|
||||||
if(channels_[c].sync) {
|
|
||||||
channels_[c].count = channels_[c].reload;
|
|
||||||
channels_[c].output <<= 1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto output = channels_[c].output & 1;
|
auto output = channels_[c].output & 1;
|
||||||
channels_[c].output <<= 1;
|
channels_[c].output <<= 1;
|
||||||
|
if(channels_[c].sync) {
|
||||||
|
channels_[c].count = channels_[c].reload;
|
||||||
|
output = 0;
|
||||||
|
} else {
|
||||||
if(!channels_[c].count) {
|
if(!channels_[c].count) {
|
||||||
channels_[c].count = channels_[c].reload;
|
channels_[c].count = channels_[c].reload;
|
||||||
|
|
||||||
@ -84,16 +82,19 @@ void Audio::update_channel(int c) {
|
|||||||
output ^= 1;
|
output ^= 1;
|
||||||
else
|
else
|
||||||
output = poly_state_[int(channels_[c].distortion)];
|
output = poly_state_[int(channels_[c].distortion)];
|
||||||
|
} else {
|
||||||
|
--channels_[c].count;
|
||||||
|
}
|
||||||
|
|
||||||
if(channels_[c].high_pass && (channels_[(c+1)%3].output&3) == 2) {
|
if(channels_[c].high_pass && (channels_[(c+1)%3].output&3) == 2) {
|
||||||
output = 0;
|
output = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ring modulation applies even when sync is enabled, per SIDBasic.
|
||||||
if(channels_[c].ring_modulate) {
|
if(channels_[c].ring_modulate) {
|
||||||
output = ~(output ^ channels_[(c+2)%3].output) & 1;
|
output = ~(output ^ channels_[(c+2)%3].output) & 1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
--channels_[c].count;
|
|
||||||
}
|
|
||||||
|
|
||||||
channels_[c].output |= output;
|
channels_[c].output |= output;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user