pattern data refactor, part 9
fix MOD/S3M/XM/IT import: - MOD was off by one octave - S3M was off by a couple octaves - several effects went missing in S3M/XM/IT
This commit is contained in:
parent
182a9e3b9d
commit
626120da8c
5 changed files with 21 additions and 22 deletions
|
|
@ -54,8 +54,8 @@ class DivWorkPool;
|
|||
|
||||
#define DIV_UNSTABLE
|
||||
|
||||
#define DIV_VERSION "dev234"
|
||||
#define DIV_ENGINE_VERSION 234
|
||||
#define DIV_VERSION "dev235"
|
||||
#define DIV_ENGINE_VERSION 235
|
||||
// for imports
|
||||
#define DIV_VERSION_MOD 0xff01
|
||||
#define DIV_VERSION_FC 0xff02
|
||||
|
|
|
|||
|
|
@ -1062,7 +1062,7 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) {
|
|||
int readRow=0;
|
||||
bool mustCommitInitial=true;
|
||||
|
||||
memset(effectCol,4,64);
|
||||
memset(effectCol,0,64);
|
||||
memset(vibStatus,0,64);
|
||||
memset(vibStatusChanged,0,64*sizeof(bool));
|
||||
memset(vibing,0,64*sizeof(bool));
|
||||
|
|
@ -1217,8 +1217,8 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) {
|
|||
p->newData[readRow][DIV_PAT_FX(0)+effectCol[j]++]=0;
|
||||
}
|
||||
|
||||
if ((effectCol[j]>>1)-2>ds.subsong[0]->pat[j].effectCols) {
|
||||
ds.subsong[0]->pat[j].effectCols=(effectCol[j]>>1)-1;
|
||||
if ((effectCol[j]>>1)>=ds.subsong[0]->pat[j].effectCols) {
|
||||
ds.subsong[0]->pat[j].effectCols=(effectCol[j]>>1)+1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1253,13 +1253,13 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) {
|
|||
p->newData[readRow-1][DIV_PAT_FX(0)+effectCol[0]++]=0x0d;
|
||||
p->newData[readRow-1][DIV_PAT_FX(0)+effectCol[0]++]=0;
|
||||
|
||||
if ((effectCol[0]>>1)-2>ds.subsong[0]->pat[0].effectCols) {
|
||||
ds.subsong[0]->pat[0].effectCols=(effectCol[0]>>1)-1;
|
||||
if ((effectCol[0]>>1)>=ds.subsong[0]->pat[0].effectCols) {
|
||||
ds.subsong[0]->pat[0].effectCols=(effectCol[0]>>1)+1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
memset(effectCol,4,64);
|
||||
memset(effectCol,0,64);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -198,8 +198,7 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
|
|||
int period=data[1]+((data[0]&0x0f)<<8);
|
||||
if (period>0 && period<0x0fff) {
|
||||
short note=(short)round(log2(3424.0/period)*12);
|
||||
// TODO: refactor test
|
||||
dstrowN[DIV_PAT_NOTE]=note+60;
|
||||
dstrowN[DIV_PAT_NOTE]=note+72;
|
||||
if (period<114) {
|
||||
bypassLimits=true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -771,7 +771,7 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
|||
|
||||
bool mustCommitInitial=true;
|
||||
|
||||
memset(effectCol,4,32);
|
||||
memset(effectCol,0,32);
|
||||
memset(vibStatus,0,32);
|
||||
memset(vibStatusChanged,0,32*sizeof(bool));
|
||||
memset(vibing,0,32*sizeof(bool));
|
||||
|
|
@ -889,17 +889,17 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
|||
p->newData[readRow][DIV_PAT_FX(0)+effectCol[j]++]=0;
|
||||
}
|
||||
|
||||
if (effectCol[j]>=4+8*2) {
|
||||
if (effectCol[j]>=8*2) {
|
||||
logE("oh crap!");
|
||||
}
|
||||
|
||||
if ((effectCol[j]>>1)-2>ds.subsong[0]->pat[j].effectCols) {
|
||||
ds.subsong[0]->pat[chanMap[j]].effectCols=(effectCol[j]>>1)-1;
|
||||
if ((effectCol[j]>>1)>=ds.subsong[0]->pat[j].effectCols) {
|
||||
ds.subsong[0]->pat[chanMap[j]].effectCols=(effectCol[j]>>1)+1;
|
||||
}
|
||||
}
|
||||
|
||||
readRow++;
|
||||
memset(effectCol,4,32);
|
||||
memset(effectCol,0,32);
|
||||
memcpy(vibingOld,vibing,32*sizeof(bool));
|
||||
memcpy(volSlidingOld,volSliding,32*sizeof(bool));
|
||||
memcpy(portingOld,porting,32*sizeof(bool));
|
||||
|
|
@ -937,7 +937,7 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
|||
if (note==254) { // note off
|
||||
p->newData[readRow][DIV_PAT_NOTE]=DIV_NOTE_OFF;
|
||||
} else if (note!=255) {
|
||||
p->newData[readRow][DIV_PAT_NOTE]=(note&15)+(note>>4)*12;
|
||||
p->newData[readRow][DIV_PAT_NOTE]=(note&15)+(note>>4)*12+60;
|
||||
}
|
||||
p->newData[readRow][DIV_PAT_INS]=(short)ins-1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -786,7 +786,7 @@ bool DivEngine::loadXM(unsigned char* file, size_t len) {
|
|||
|
||||
bool mustCommitInitial=true;
|
||||
|
||||
memset(effectCol,4,128);
|
||||
memset(effectCol,0,128);
|
||||
memset(vibStatus,0,128);
|
||||
memset(vibStatusChanged,0,128*sizeof(bool));
|
||||
memset(vibing,0,128*sizeof(bool));
|
||||
|
|
@ -1319,8 +1319,8 @@ bool DivEngine::loadXM(unsigned char* file, size_t len) {
|
|||
p->newData[j][DIV_PAT_FX(0)+effectCol[k]++]=0;
|
||||
}
|
||||
|
||||
if ((effectCol[k]>>1)-2>ds.subsong[0]->pat[k].effectCols) {
|
||||
ds.subsong[0]->pat[k].effectCols=(effectCol[k]>>1)-1;
|
||||
if ((effectCol[k]>>1)>=ds.subsong[0]->pat[k].effectCols) {
|
||||
ds.subsong[0]->pat[k].effectCols=(effectCol[k]>>1)+1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1343,11 +1343,11 @@ bool DivEngine::loadXM(unsigned char* file, size_t len) {
|
|||
p->newData[j][DIV_PAT_FX(0)+effectCol[0]++]=0x0d;
|
||||
p->newData[j][DIV_PAT_FX(0)+effectCol[0]++]=0;
|
||||
|
||||
if ((effectCol[0]>>1)-2>ds.subsong[0]->pat[0].effectCols) {
|
||||
ds.subsong[0]->pat[0].effectCols=(effectCol[0]>>1)-1;
|
||||
if ((effectCol[0]>>1)>=ds.subsong[0]->pat[0].effectCols) {
|
||||
ds.subsong[0]->pat[0].effectCols=(effectCol[0]>>1)+1;
|
||||
}
|
||||
}
|
||||
memset(effectCol,4,64);
|
||||
memset(effectCol,0,64);
|
||||
}
|
||||
|
||||
logV("seeking to %x...",packedSeek);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue