From 68eecb723f5aed317708ebd1fada67e72b8aa174 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 19 Feb 2022 23:11:20 -0500 Subject: [PATCH] fix bugged notes in .dmf --- src/engine/fileOps.cpp | 5 +++++ src/gui/gui.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index 37ab0f835..6240f3f5d 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -550,6 +550,11 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) { pat->data[k][1]-=2; } } + if (pat->data[k][0]==0 && pat->data[k][1]!=0) { + logD("what? %d:%d:%d note %d octave %d\n",i,j,k,pat->data[k][0],pat->data[k][1]); + pat->data[k][0]=12; + pat->data[k][1]--; + } // volume pat->data[k][3]=reader.readS(); if (ds.version<0x0a) { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index b19d461e3..dab64bbb3 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -98,6 +98,8 @@ const char* FurnaceGUI::noteName(short note, short octave) { return "REL"; } else if (octave==0 && note==0) { return "..."; + } else if (note==0 && octave!=0) { + return "BUG"; } int seek=(note+(signed char)octave*12)+60; if (seek<0 || seek>=180) {