diff --git a/demos/c64/DOOM_E1M1.fur b/demos/c64/DOOM_E1M1.fur deleted file mode 100644 index d2c105fda..000000000 Binary files a/demos/c64/DOOM_E1M1.fur and /dev/null differ diff --git a/demos/c64/DOOM_E1M3.fur b/demos/c64/DOOM_E1M3.fur deleted file mode 100644 index d6dbf8b7c..000000000 Binary files a/demos/c64/DOOM_E1M3.fur and /dev/null differ diff --git a/demos/opl/E1M4OPL2.fur b/demos/opl/E1M4OPL2.fur deleted file mode 100644 index 19f8ce54f..000000000 Binary files a/demos/opl/E1M4OPL2.fur and /dev/null differ diff --git a/demos/opl/e3m2_opl3.fur b/demos/opl/e3m2_opl3.fur deleted file mode 100644 index 63d4751ec..000000000 Binary files a/demos/opl/e3m2_opl3.fur and /dev/null differ diff --git a/src/engine/fileOps/xm.cpp b/src/engine/fileOps/xm.cpp index 76acf1d15..71d583932 100644 --- a/src/engine/fileOps/xm.cpp +++ b/src/engine/fileOps/xm.cpp @@ -20,7 +20,7 @@ #include "fileOpsCommon.h" void readEnvelope(DivInstrument* ins, int env, unsigned char flags, unsigned char numPoints, unsigned char loopStart, unsigned char loopEnd, unsigned char susPoint, short* points) { - if (numPoints>24) numPoints=24; + if (numPoints>12) numPoints=12; if (loopStart>=numPoints) loopStart=numPoints-1; if (loopEnd>=numPoints) loopEnd=numPoints-1; @@ -49,12 +49,45 @@ void readEnvelope(DivInstrument* ins, int env, unsigned char flags, unsigned cha break; } target->len=0; - int point=0; - bool pointJustBegan=true; // mark loop end as end of envelope if (flags&4) { if (loopEndval[t0]=p0; + } + } else { + for (int j=t0; jval[j]=p0+(((p1-p0)*(j-t0))/(t1-t0)); + } + } + } + if (flags&4) { // loop + if (loopStart!=loopEnd && loopStartloop=CLAMP(pointTime[loopStart],0,254); + } + } + if (flags&2 && susPointrel=CLAMP(pointTime[susPoint]-1,0,254); + } + target->len=MIN(pointTime[numPoints-1]+1,255); + if (((flags&4) && (!(flags&2))) || ((flags&6)==0)) { + target->rel=target->len-1; + } + + // old crap + /* for (int i=0; i<255; i++) { int curPoint=MIN(point,numPoints-1); int nextPoint=MIN(point+1,numPoints-1); @@ -102,6 +135,7 @@ void readEnvelope(DivInstrument* ins, int env, unsigned char flags, unsigned cha target->len=i+1; target->val[i]=p0+(((p1-p0)*curTime)/timeDiff); } + */ // split L/R if (env==1) {