yay + prepare for sample system changes
This commit is contained in:
parent
ccfed873e8
commit
92e1553014
|
@ -1471,6 +1471,9 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
||||||
if (song.system[0]==DIV_SYSTEM_SMS && song.system[1]==DIV_SYSTEM_OPLL) {
|
if (song.system[0]==DIV_SYSTEM_SMS && song.system[1]==DIV_SYSTEM_OPLL) {
|
||||||
isFlat=true;
|
isFlat=true;
|
||||||
}
|
}
|
||||||
|
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_VRC7) {
|
||||||
|
isFlat=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// fail if more than one system
|
// fail if more than one system
|
||||||
if (!isFlat && song.systemLen!=1) {
|
if (!isFlat && song.systemLen!=1) {
|
||||||
|
@ -1490,6 +1493,12 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
||||||
lastError="Master System FM expansion not supported in 1.0/legacy .dmf!";
|
lastError="Master System FM expansion not supported in 1.0/legacy .dmf!";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
// fail if the system is NES+VRC7 and version<25
|
||||||
|
if (version<25 && song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_VRC7) {
|
||||||
|
logE("NES + VRC7 not supported in 1.0/legacy .dmf!\n");
|
||||||
|
lastError="NES + VRC7 not supported in 1.0/legacy .dmf!";
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
// fail if the system is Furnace-exclusive
|
// fail if the system is Furnace-exclusive
|
||||||
if (!isFlat && systemToFile(song.system[0])&0x80) {
|
if (!isFlat && systemToFile(song.system[0])&0x80) {
|
||||||
logE("cannot save Furnace-exclusive system song!\n");
|
logE("cannot save Furnace-exclusive system song!\n");
|
||||||
|
@ -1519,6 +1528,9 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
||||||
} else if (song.system[0]==DIV_SYSTEM_SMS && song.system[1]==DIV_SYSTEM_OPLL) {
|
} else if (song.system[0]==DIV_SYSTEM_SMS && song.system[1]==DIV_SYSTEM_OPLL) {
|
||||||
w->writeC(systemToFile(DIV_SYSTEM_SMS_OPLL));
|
w->writeC(systemToFile(DIV_SYSTEM_SMS_OPLL));
|
||||||
sys=DIV_SYSTEM_SMS_OPLL;
|
sys=DIV_SYSTEM_SMS_OPLL;
|
||||||
|
} else if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_VRC7) {
|
||||||
|
w->writeC(systemToFile(DIV_SYSTEM_NES_VRC7));
|
||||||
|
sys=DIV_SYSTEM_NES_VRC7;
|
||||||
} else {
|
} else {
|
||||||
w->writeC(systemToFile(song.system[0]));
|
w->writeC(systemToFile(song.system[0]));
|
||||||
sys=song.system[0];
|
sys=song.system[0];
|
||||||
|
@ -1599,12 +1611,12 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
||||||
w->writeC(op.rr);
|
w->writeC(op.rr);
|
||||||
w->writeC(op.sl);
|
w->writeC(op.sl);
|
||||||
w->writeC(op.tl);
|
w->writeC(op.tl);
|
||||||
if (sys==DIV_SYSTEM_SMS_OPLL && j==0) {
|
if ((sys==DIV_SYSTEM_SMS_OPLL || sys==DIV_SYSTEM_NES_VRC7) && j==0) {
|
||||||
w->writeC(i->fm.opllPreset);
|
w->writeC(i->fm.opllPreset);
|
||||||
} else {
|
} else {
|
||||||
w->writeC(op.dt2);
|
w->writeC(op.dt2);
|
||||||
}
|
}
|
||||||
if (sys==DIV_SYSTEM_SMS_OPLL) {
|
if (sys==DIV_SYSTEM_SMS_OPLL || sys==DIV_SYSTEM_NES_VRC7) {
|
||||||
w->writeC(op.ksr);
|
w->writeC(op.ksr);
|
||||||
w->writeC(op.vib);
|
w->writeC(op.vib);
|
||||||
w->writeC(op.ksl);
|
w->writeC(op.ksl);
|
||||||
|
|
|
@ -24,15 +24,34 @@ struct DivSample {
|
||||||
int length, rate, centerRate, loopStart, loopOffP;
|
int length, rate, centerRate, loopStart, loopOffP;
|
||||||
signed char vol, pitch;
|
signed char vol, pitch;
|
||||||
// valid values are:
|
// valid values are:
|
||||||
// - 0: ZX Spectrum overlay drum (1-bit PCM)
|
// - 0: ZX Spectrum overlay drum (1-bit)
|
||||||
// - 1: 1-bit NES DPCM
|
// - 1: 1-bit NES DPCM (1-bit)
|
||||||
// - 4: BRR
|
// - 4: QSound ADPCM ()
|
||||||
// - 5: raw ADPCM-A
|
// - 5: ADPCM-A
|
||||||
// - 6: raw ADPCM-B
|
// - 6: ADPCM-B
|
||||||
|
// - 7: X68000 ADPCM
|
||||||
// - 8: 8-bit PCM
|
// - 8: 8-bit PCM
|
||||||
|
// - 9: BRR (SNES)
|
||||||
|
// - 10: VOX
|
||||||
// - 16: 16-bit PCM
|
// - 16: 16-bit PCM
|
||||||
unsigned char depth;
|
unsigned char depth;
|
||||||
|
|
||||||
|
// TODO: drop
|
||||||
short* data;
|
short* data;
|
||||||
|
|
||||||
|
// these are the new data structures.
|
||||||
|
signed char* data8;
|
||||||
|
short* data16;
|
||||||
|
unsigned char* data1;
|
||||||
|
unsigned char* dataDPCM;
|
||||||
|
unsigned char* dataQSound;
|
||||||
|
unsigned char* dataA;
|
||||||
|
unsigned char* dataB;
|
||||||
|
unsigned char* dataX68;
|
||||||
|
unsigned char* dataBRR;
|
||||||
|
unsigned char* dataVOX;
|
||||||
|
|
||||||
|
|
||||||
unsigned int rendLength, adpcmRendLength, rendOff, rendOffP, rendOffContiguous, rendOffQsound;
|
unsigned int rendLength, adpcmRendLength, rendOff, rendOffP, rendOffContiguous, rendOffQsound;
|
||||||
short* rendData;
|
short* rendData;
|
||||||
unsigned char* adpcmRendData;
|
unsigned char* adpcmRendData;
|
||||||
|
|
|
@ -816,6 +816,7 @@ bool DivEngine::isFMSystem(DivSystem sys) {
|
||||||
return (sys==DIV_SYSTEM_GENESIS ||
|
return (sys==DIV_SYSTEM_GENESIS ||
|
||||||
sys==DIV_SYSTEM_GENESIS_EXT ||
|
sys==DIV_SYSTEM_GENESIS_EXT ||
|
||||||
sys==DIV_SYSTEM_SMS_OPLL ||
|
sys==DIV_SYSTEM_SMS_OPLL ||
|
||||||
|
sys==DIV_SYSTEM_NES_VRC7 ||
|
||||||
sys==DIV_SYSTEM_ARCADE ||
|
sys==DIV_SYSTEM_ARCADE ||
|
||||||
sys==DIV_SYSTEM_YM2610 ||
|
sys==DIV_SYSTEM_YM2610 ||
|
||||||
sys==DIV_SYSTEM_YM2610_EXT ||
|
sys==DIV_SYSTEM_YM2610_EXT ||
|
||||||
|
|
Loading…
Reference in New Issue