Update zsm pcm
This commit is contained in:
parent
de0422de20
commit
7ee0551c05
1 changed files with 17 additions and 15 deletions
|
@ -86,21 +86,23 @@ class ZsmBackend : public PlaybackBackend {
|
||||||
void audio_step(size_t samples) {
|
void audio_step(size_t samples) {
|
||||||
if (samples == 0) return;
|
if (samples == 0) return;
|
||||||
while (pcm_fifo_avail() < samples && remain > 0) {
|
while (pcm_fifo_avail() < samples && remain > 0) {
|
||||||
if (pcm_read_rate() == 0) break;
|
if (pcm_read_rate() == 0) break;
|
||||||
remain--;
|
remain--;
|
||||||
size_t oldpos = file->get_pos();
|
if (remain == 0) {
|
||||||
file->seek((cur++), SeekType::SET);
|
if (islooped) {
|
||||||
uint8_t sample;
|
cur = loop;
|
||||||
file->read(&sample, 1, 1);
|
remain = loop_rem;
|
||||||
pcm_write_fifo(sample);
|
} else {
|
||||||
if (remain == 0) {
|
break;
|
||||||
if (islooped) {
|
}
|
||||||
cur = loop;
|
}
|
||||||
remain = loop_rem;
|
size_t oldpos = file->get_pos();
|
||||||
}
|
file->seek((cur++), SeekType::SET);
|
||||||
}
|
uint8_t sample;
|
||||||
file->seek(oldpos, SeekType::SET);
|
file->read(&sample, 1, 1);
|
||||||
}
|
pcm_write_fifo(sample);
|
||||||
|
file->seek(oldpos, SeekType::SET);
|
||||||
|
}
|
||||||
samples *= 2;
|
samples *= 2;
|
||||||
int16_t *psg_ptr = psg_buf.get_item_sized<int16_t>(samples);
|
int16_t *psg_ptr = psg_buf.get_item_sized<int16_t>(samples);
|
||||||
int16_t *pcm_ptr = pcm_buf.get_item_sized<int16_t>(samples);
|
int16_t *pcm_ptr = pcm_buf.get_item_sized<int16_t>(samples);
|
||||||
|
|
Loading…
Reference in a new issue