refuse to save YMU759 songs

the .dmf format no longer allows YMU759 songs...
This commit is contained in:
tildearrow 2022-01-08 02:04:43 -05:00
parent 121a9b2cb8
commit 073703f8ba
2 changed files with 12 additions and 0 deletions

View file

@ -1007,6 +1007,13 @@ bool DivEngine::load(unsigned char* f, size_t slen) {
} }
SafeWriter* DivEngine::save() { SafeWriter* DivEngine::save() {
// fail if this is an YMU759 song
if (song.system==DIV_SYSTEM_YMU759) {
logE("cannot save YMU759 song!\n");
lastError="YMU759 song saving is not supported";
return NULL;
}
SafeWriter* w=new SafeWriter; SafeWriter* w=new SafeWriter;
w->init(); w->init();
// write magic // write magic

View file

@ -2383,6 +2383,11 @@ int FurnaceGUI::save(String path) {
return 1; return 1;
} }
SafeWriter* w=e->save(); SafeWriter* w=e->save();
if (w==NULL) {
lastError=e->getLastError();
fclose(outFile);
return 3;
}
#ifdef FURNACE_ZLIB_COMPRESS #ifdef FURNACE_ZLIB_COMPRESS
unsigned char zbuf[131072]; unsigned char zbuf[131072];
int ret; int ret;