mirror of
https://github.com/OldUnreal/libxmp.git
synced 2026-04-02 21:37:43 -07:00
When a bidirectional sustain loop in reverse is released, the reverse state should be canceled unless the forward loop is also bidirectional. This bug was preventing the OpenMPT SusAfterLoop.it test from working. Prior to this fix, the voice would instead stop playing and generate very negative voice position values due a separate bug, which was the lack of reverse handling for non-bidirectional samples. This would eventually cause undefined behavior due to invalid double to integer conversion. The easiest way to verify I fixed this second bug was to just implement the Modplug S9F Play Reverse IT effect (also support for XM, MED, and partially DBM; no DIGI or ULT currently). In addition to adding a test for SusAfterLoop.it, I added a separate regression test for the reverse effect, particularly its interactions with IT sample loops.
22 lines
529 B
C
22 lines
529 B
C
#include "test.h"
|
|
|
|
/* Test the Modplug extended effects S9E/X9E Play Forward and
|
|
* S9F/X9E Play Reverse (particularly how S9F interacts with
|
|
* IT loops). Also make sure similar reverse effects for other
|
|
* tracker formats render roughly how they're supposed to.
|
|
*/
|
|
|
|
TEST(test_effect_reverse)
|
|
{
|
|
compare_mixer_data(
|
|
"data/reverse_it.it",
|
|
"data/reverse_it.data");
|
|
compare_mixer_data(
|
|
"data/reverse_xm.xm",
|
|
"data/reverse_xm.data");
|
|
compare_mixer_data(
|
|
"data/reverse_mmd3.med",
|
|
"data/reverse_mmd3.data");
|
|
}
|
|
END_TEST
|