From 11cf0dc5606b09cfbb656446922d4e0e74bbb346 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 13 Jan 2022 03:05:36 -0500 Subject: [PATCH] prevent saving unsupported systems to .dmf --- src/engine/engine.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 96da3c293..fd99aa5c2 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -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();