diff --git a/src/engine/engine.h b/src/engine/engine.h index 01a846e81..f64539c22 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -54,8 +54,8 @@ class DivWorkPool; #define DIV_UNSTABLE -#define DIV_VERSION "dev235" -#define DIV_ENGINE_VERSION 235 +#define DIV_VERSION "dev236" +#define DIV_ENGINE_VERSION 236 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 diff --git a/src/engine/fileOps/dmf.cpp b/src/engine/fileOps/dmf.cpp index 2b43ce275..8593993ef 100644 --- a/src/engine/fileOps/dmf.cpp +++ b/src/engine/fileOps/dmf.cpp @@ -840,6 +840,13 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) { pat->newData[k][DIV_PAT_FXVAL(l)]=128+((pat->newData[k][DIV_PAT_FXVAL(l)]-128)/4); } } + // YM2151: pitch effect range is different + if (ds.system[0]==DIV_SYSTEM_ARCADE && pat->newData[k][DIV_PAT_FX(l)]==0xe5 && pat->newData[k][DIV_PAT_FXVAL(l)]!=-1) { + int newVal=(2*((pat->newData[k][DIV_PAT_FXVAL(l)]&0xff)-0x80))+0x80; + if (newVal<0) newVal=0; + if (newVal>0xff) newVal=0xff; + pat->newData[k][DIV_PAT_FXVAL(l)]=newVal; + } } // instrument pat->newData[k][DIV_PAT_INS]=reader.readS(); diff --git a/src/engine/fileOps/fur.cpp b/src/engine/fileOps/fur.cpp index e4b8c70d2..efb1d2632 100644 --- a/src/engine/fileOps/fur.cpp +++ b/src/engine/fileOps/fur.cpp @@ -2143,6 +2143,37 @@ bool DivEngine::loadFur(unsigned char* file, size_t len, int variantID) { } } + // YM2151 E5xx range was different + if (ds.version<236) { + int ch=0; + // so much nesting + for (int i=0; ipat[j].data[l]; + if (p==NULL) continue; + + for (int m=0; mpat[j].effectCols; n++) { + if (p->newData[m][DIV_PAT_FX(n)]==0xe5 && p->newData[m][DIV_PAT_FXVAL(n)]!=-1) { + int newVal=(2*((p->newData[m][DIV_PAT_FXVAL(n)]&0xff)-0x80))+0x80; + if (newVal<0) newVal=0; + if (newVal>0xff) newVal=0xff; + p->newData[m][DIV_PAT_FXVAL(n)]=newVal; + } + } + } + } + } + } + } + ch+=getChannelCount(ds.system[i]); + } + } + if (active) quitDispatch(); BUSY_BEGIN_SOFT; saveLock.lock(); diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 856ceeb82..70e56ce7d 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -1380,12 +1380,6 @@ void DivEngine::processRow(int i, bool afterDelay) { break; case 0xe5: // pitch chan[i].pitch=effectVal-0x80; - // why isn't this removed yet? we shouldn't give this chip special treatment! - if (sysOfChan[i]==DIV_SYSTEM_YM2151) { // YM2151 pitch oddity - chan[i].pitch*=2; - if (chan[i].pitch<-128) chan[i].pitch=-128; - if (chan[i].pitch>127) chan[i].pitch=127; - } // send pitch now dispatchCmd(DivCommand(DIV_CMD_PITCH,i,chan[i].pitch+(((chan[i].vibratoDepth*vibTable[chan[i].vibratoPos]*chan[i].vibratoFine)>>4)/15))); dispatchCmd(DivCommand(DIV_CMD_HINT_PITCH,i,chan[i].pitch));