1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-04 01:57:54 +00:00

Keep audio fetches in bounds.

This commit is contained in:
Thomas Harte 2021-12-03 07:16:21 -05:00
parent 6bc5268cbd
commit 57789092c1

View File

@ -34,7 +34,7 @@ bool Audio::advance_dma(int channel) {
return false; return false;
} }
set_data(channel, ram_[pointer_[size_t(channel)]]); set_data(channel, ram_[pointer_[size_t(channel) & ram_mask_]]);
if(channels_[channel].state != Channel::State::WaitingForDummyDMA) { if(channels_[channel].state != Channel::State::WaitingForDummyDMA) {
++pointer_[size_t(channel)]; ++pointer_[size_t(channel)];
} }