From 1eb1ee1a6d10cdfc8ce17947b8642c8d6ef05b77 Mon Sep 17 00:00:00 2001 From: Stian Skjelstad Date: Wed, 4 Dec 2024 08:25:09 +0100 Subject: [PATCH] [XM]: On big-endian, the endian reverse code for sample envelopes had the two loop counters in reverse order causing the code reverse endian on some "random" values upward on the stack. Fixes #120 --- playxm/xmload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playxm/xmload.c b/playxm/xmload.c index 78650935..b75b5a89 100644 --- a/playxm/xmload.c +++ b/playxm/xmload.c @@ -453,8 +453,8 @@ OCP_INTERNAL int xmpLoadModule (struct cpifaceSessionAPI_t *cpifaceSession, stru cpifaceSession->cpiDebug (cpifaceSession, "[XM/XM] warning, Panning loop end point (%d) >= Number of panning points (%d), truncating\n", ins2.ploope, ins2.pnum); ins2.ploope=ins2.pnum-1; } - for (k=0;k<12;k++) - for (j=0;j<2;j++) + for (k=0;k<2;k++) + for (j=0;j<12;j++) { ins2.venv[j][k] = uint16_little (ins2.venv[j][k]); ins2.penv[j][k] = uint16_little (ins2.penv[j][k]);