diff --git a/backends/playback/zsm/zsm_backend.cpp b/backends/playback/zsm/zsm_backend.cpp index 72971a8..a0ac843 100644 --- a/backends/playback/zsm/zsm_backend.cpp +++ b/backends/playback/zsm/zsm_backend.cpp @@ -179,7 +179,7 @@ void ZsmBackend::tick(bool step) { loop_rem |= bytes[8]; loop_rem <<= 8; loop_rem |= bytes[7]; - loop = loop_rem & 0xFFFF; + loop = loop_rem; islooped = bytes[6]; remain = bytes[5]; remain <<= 8; @@ -191,8 +191,9 @@ void ZsmBackend::tick(bool step) { cur |= bytes[1]; cur <<= 8; cur |= bytes[0]; - pcm_loop_point = cur + loop; - rem_point = remain - loop_rem; + cur += pcm_data_offs; + loop += cur; + loop_rem = remain - loop_rem; file->seek(file_pos, SeekType::SET); } break; } diff --git a/backends/playback/zsm/zsm_backend.hpp b/backends/playback/zsm/zsm_backend.hpp index f914d80..63be1b0 100644 --- a/backends/playback/zsm/zsm_backend.hpp +++ b/backends/playback/zsm/zsm_backend.hpp @@ -87,7 +87,7 @@ class ZsmBackend : public PlaybackBackend { while (((pcm_read_ctrl() & 0x80) == 0 || pcm_fifo_avail() < samples) && remain > 0) { remain--; size_t oldpos = file->get_pos(); - file->seek((cur++) + pcm_data_offs, SeekType::SET); + file->seek((cur++), SeekType::SET); uint8_t sample; file->read(&sample, 1, 1); pcm_write_fifo(sample);