From 45196daf95ef5feeb5fec4116664f099243dc086 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 7 Aug 2022 01:32:28 -0500 Subject: [PATCH] Game Boy: fix serious typo --- src/engine/instrument.cpp | 2 +- src/engine/instrument.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index 37c6a9b2..b1afc395 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -534,7 +534,7 @@ void DivInstrument::putInsData(SafeWriter* w) { // GB hardware sequence w->writeC(gb.hwSeqLen); - for (int i=0; gb.hwSeqLen; i++) { + for (int i=0; iwriteC(gb.hwSeq[i].cmd); w->writeS(gb.hwSeq[i].data); } diff --git a/src/engine/instrument.h b/src/engine/instrument.h index 33e2856b..eddf9f79 100644 --- a/src/engine/instrument.h +++ b/src/engine/instrument.h @@ -262,6 +262,16 @@ struct DivInstrumentSTD { struct DivInstrumentGB { unsigned char envVol, envDir, envLen, soundLen, hwSeqLen; + enum HWSeqCommands: unsigned char { + DIV_GB_HWCMD_ENVELOPE=0, + DIV_GB_HWCMD_SWEEP, + DIV_GB_HWCMD_WAIT, + DIV_GB_HWCMD_WAIT_REL, + DIV_GB_HWCMD_LOOP, + DIV_GB_HWCMD_LOOP_REL, + + DIV_GB_HWCMD_MAX + }; struct HWSeqCommand { unsigned char cmd; unsigned short data;