Fix incorrect PCM data offset

This commit is contained in:
Zachary Hall 2024-10-15 13:14:24 -07:00
parent 187e6bab24
commit 906ed530b8

View file

@ -46,7 +46,7 @@ void ZsmBackend::load(const char *filename) {
file->seek(pcm_offset, SeekType::SET);
file->read(loop_point, 1, 1);
pcm_offset++;
pcm_data_offs = (loop_point[0] * 16) + pcm_offset;
pcm_data_offs = (((uint16_t)loop_point[0]) + 1) * 16) + pcm_offset;
file->seek(music_data_start, SeekType::SET);
this->loop_point = std::max(this->loop_point, (uint32_t)music_data_start);
double prev_time = 0.0;