Skip to content

Commit

Permalink
saving
Browse files Browse the repository at this point in the history
  • Loading branch information
tildearrow committed Dec 6, 2024
1 parent 8263a32 commit 8215371
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/engine/fileOps/dmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,9 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_FDS) {
isFlat=true;
}
if (song.system[0]==DIV_SYSTEM_AY8910 && song.system[1]==DIV_SYSTEM_SCC) {
isFlat=true;
}
}
// fail if more than one system
if (!isFlat && song.systemLen!=1) {
Expand Down Expand Up @@ -1216,6 +1219,12 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
lastError="FDS not supported in 1.0/legacy .dmf!";
return NULL;
}
// fail if the system is SCC and version<25
if (version<25 && song.system[0]==DIV_SYSTEM_AY8910 && song.system[1]==DIV_SYSTEM_SCC) {
logE("AY + SCC not supported in 1.0/legacy .dmf!");
lastError="AY + SCC not supported in 1.0/legacy .dmf!";
return NULL;
}
// fail if the system is Furnace-exclusive
if (!isFlat && systemToFileDMF(song.system[0])==0) {
logE("cannot save Furnace-exclusive system song!");
Expand Down Expand Up @@ -1277,6 +1286,9 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
} else if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_FDS) {
w->writeC(systemToFileDMF(DIV_SYSTEM_NES_FDS));
sys=DIV_SYSTEM_NES_FDS;
} else if (song.system[0]==DIV_SYSTEM_AY8910 && song.system[1]==DIV_SYSTEM_SCC) {
w->writeC(systemToFileDMF(DIV_SYSTEM_MSX2));
sys=DIV_SYSTEM_MSX2;
} else {
w->writeC(systemToFileDMF(song.system[0]));
sys=song.system[0];
Expand Down

0 comments on commit 8215371

Please sign in to comment.