prevent saving unsupported systems to .dmf

This commit is contained in:
tildearrow 2022-01-13 03:05:36 -05:00
parent 0b352ecd9a
commit 11cf0dc560

View file

@ -1772,8 +1772,8 @@ SafeWriter* DivEngine::saveFur() {
SafeWriter* DivEngine::saveDMF() {
// fail if more than one system
if (song.systemLen!=1) {
logE("cannot save multiple systems in this format!\n");
lastError="multiple systems not possible on .dmf";
logE("cannot save multiple platforms in this format!\n");
lastError="multiple platforms not possible on .dmf";
return NULL;
}
// fail if this is an YMU759 song
@ -1782,6 +1782,12 @@ SafeWriter* DivEngine::saveDMF() {
lastError="YMU759 song saving is not supported";
return NULL;
}
// fail if the system is Furnace-exclusive
if (systemToFile(song.system[0])&0x80) {
logE("cannot save Furnace-exclusive platform song!\n");
lastError="this platform is not possible on .dmf";
return NULL;
}
SafeWriter* w=new SafeWriter;
w->init();