XM import: why does this module have inverted loop

This commit is contained in:
tildearrow 2024-07-01 04:04:04 -05:00
parent 552522e84c
commit fd253c37f0

View file

@ -234,6 +234,7 @@ bool DivEngine::loadXM(unsigned char* file, size_t len) {
ds.system[i]=DIV_SYSTEM_ES5506;
ds.systemFlags[i].set("amigaVol",true);
ds.systemFlags[i].set("amigaPitch",(ds.linearPitch==0));
ds.systemFlags[i].set("volScale",3900);
}
ds.systemLen=(totalChans+31)>>5;
@ -546,6 +547,12 @@ bool DivEngine::loadXM(unsigned char* file, size_t len) {
s->loopStart=reader.readI();
s->loopEnd=reader.readI()+s->loopStart;
if (s->loopStart>s->loopEnd) {
s->loopStart^=s->loopEnd;
s->loopEnd^=s->loopStart;
s->loopStart^=s->loopEnd;
}
sampleVol[i][j]=reader.readC();
signed char fine=reader.readC();