From 4a8deb992e34089f87f110cc9c5b6d4fa746a2c2 Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Tue, 19 Aug 2014 23:02:10 -0700 Subject: [PATCH] Fixed playptmod offset command, and disabled offset bug handling for FT2 files --- Frameworks/playptmod/playptmod/playptmod.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Frameworks/playptmod/playptmod/playptmod.c b/Frameworks/playptmod/playptmod/playptmod.c index 40cf59e3e..081c8e14a 100644 --- a/Frameworks/playptmod/playptmod/playptmod.c +++ b/Frameworks/playptmod/playptmod/playptmod.c @@ -1515,6 +1515,7 @@ static void fxVibratoVolumeSlide(player *p, mod_channel *ch); static void fxTremolo(player *p, mod_channel *ch); static void fxNotInUse(player *p, mod_channel *ch); static void fxSampleOffset(player *p, mod_channel *ch); +static void fxSampleOffset_FT2(player *p, mod_channel *ch); static void fxVolumeSlide(player *p, mod_channel *ch); static void fxPositionJump(player *p, mod_channel *ch); static void fxSetVolume(player *p, mod_channel *ch); @@ -1575,7 +1576,7 @@ static effect_routine fxRoutines_FT2[16] = fxVibratoVolumeSlide, fxTremolo, fxPan, - fxSampleOffset, + fxSampleOffset_FT2, fxVolumeSlide, fxPositionJump, fxSetVolume, @@ -2249,7 +2250,7 @@ static void fxSampleOffset(player *p, mod_channel *ch) if (p->modTick == 0) { if (ch->param > 0) - ch->offsetTemp = ch->param * 256; + ch->offsetTemp = (uint16_t)(ch->param) * 256; ch->offset += ch->offsetTemp; @@ -2258,6 +2259,17 @@ static void fxSampleOffset(player *p, mod_channel *ch) } } +static void fxSampleOffset_FT2(player *p, mod_channel *ch) +{ + if (p->modTick == 0) + { + if (ch->param > 0) + ch->offset = (uint16_t)(ch->param) * 256; + + ch->offsetBugNotAdded = true; + } +} + static void fxVolumeSlide(player *p, mod_channel *ch) { unsigned char hiNybble;