mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-22 15:28:56 +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) {
|
bool Audio::advance_dma(int channel) {
|
||||||
switch(channels_[channel].state) {
|
switch(channels_[channel].state) {
|
||||||
case Channel::State::WaitingForDMA:
|
case Channel::State::WaitingForDMA:
|
||||||
set_data(channel, ram_[pointer_[size_t(channel)]]);
|
if(!channels_[channel].has_data) {
|
||||||
return true;
|
set_data(channel, ram_[pointer_[size_t(channel)]]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case Channel::State::WaitingForDummyDMA:
|
case Channel::State::WaitingForDummyDMA:
|
||||||
channels_[channel].has_data = true;
|
if(!channels_[channel].has_data) {
|
||||||
return true;
|
channels_[channel].has_data = true;
|
||||||
default:
|
return true;
|
||||||
return false;
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Audio::set_length(int channel, uint16_t length) {
|
void Audio::set_length(int channel, uint16_t length) {
|
||||||
|
Loading…
Reference in New Issue
Block a user