mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Avoids over-greedy DMA.
This commit is contained in:
parent
c99dee86dd
commit
50a6496399
@ -20,14 +20,23 @@ using namespace Amiga;
|
||||
bool Audio::advance_dma(int channel) {
|
||||
switch(channels_[channel].state) {
|
||||
case Channel::State::WaitingForDMA:
|
||||
set_data(channel, ram_[pointer_[size_t(channel)]]);
|
||||
return true;
|
||||
if(!channels_[channel].has_data) {
|
||||
set_data(channel, ram_[pointer_[size_t(channel)]]);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case Channel::State::WaitingForDummyDMA:
|
||||
channels_[channel].has_data = true;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
if(!channels_[channel].has_data) {
|
||||
channels_[channel].has_data = true;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Audio::set_length(int channel, uint16_t length) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user