From c21d596ca45d9e0f65f3b33482ce4aeec396bca3 Mon Sep 17 00:00:00 2001 From: cam900 Date: Mon, 6 Mar 2023 08:32:51 +0900 Subject: [PATCH 1/2] Fix default instrument for SM8521 --- src/engine/platform/sm8521.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/sm8521.cpp b/src/engine/platform/sm8521.cpp index 3cabdfef..e1f359c0 100644 --- a/src/engine/platform/sm8521.cpp +++ b/src/engine/platform/sm8521.cpp @@ -169,7 +169,7 @@ void DivPlatformSM8521::tick(bool sysTick) { int DivPlatformSM8521::dispatch(DivCommand c) { switch (c.cmd) { case DIV_CMD_NOTE_ON: { - DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_PCE); + DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_SM8521); if (c.value!=DIV_NOTE_NULL) { chan[c.chan].baseFreq=NOTE_PERIODIC(c.value); chan[c.chan].freqChanged=true; @@ -263,7 +263,7 @@ int DivPlatformSM8521::dispatch(DivCommand c) { break; case DIV_CMD_PRE_PORTA: if (chan[c.chan].active && c.value2) { - if (parent->song.resetMacroOnPorta) chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_PCE)); + if (parent->song.resetMacroOnPorta) chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_SM8521)); } if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_PERIODIC(chan[c.chan].note); chan[c.chan].inPorta=c.value; From 1436da8a6620153abcbc6f48881dd98ccd941814 Mon Sep 17 00:00:00 2001 From: cam900 Date: Mon, 6 Mar 2023 08:38:41 +0900 Subject: [PATCH 2/2] Add debug status support for SM8521 --- src/gui/debug.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/gui/debug.cpp b/src/gui/debug.cpp index c46002c0..04d84c11 100644 --- a/src/gui/debug.cpp +++ b/src/gui/debug.cpp @@ -51,6 +51,7 @@ #include "../engine/platform/pcmdac.h" #include "../engine/platform/k007232.h" #include "../engine/platform/ga20.h" +#include "../engine/platform/sm8521.h" #include "../engine/platform/dummy.h" #define COMMON_CHIP_DEBUG \ @@ -528,6 +529,14 @@ void putDispatchChip(void* data, int type) { COMMON_CHIP_DEBUG_BOOL; break; } + case DIV_SYSTEM_SM8521: { + DivPlatformSM8521* ch=(DivPlatformSM8521*)data; + ImGui::Text("> SM8521"); + COMMON_CHIP_DEBUG; + COMMON_CHIP_DEBUG_BOOL; + ImGui::TextColored(ch->antiClickEnabled?colorOn:colorOff,">> AntiClickEnabled"); + break; + } default: ImGui::Text("Unimplemented chip! Help!"); break; @@ -1047,6 +1056,18 @@ void putDispatchChan(void* data, int chanNum, int type) { ImGui::TextColored(ch->setPos?colorOn:colorOff,">> SetPos"); break; } + case DIV_SYSTEM_SM8521: { + DivPlatformSM8521::Channel* ch=(DivPlatformSM8521::Channel*)data; + ImGui::Text("> SM8521"); + COMMON_CHAN_DEBUG; + ImGui::Text("* AntiClick:"); + ImGui::Text(" - periodCount: %d",ch->antiClickPeriodCount); + ImGui::Text(" - wavePos: %d",ch->antiClickWavePos); + ImGui::Text("- wave: %d",ch->wave); + COMMON_CHAN_DEBUG_BOOL; + ImGui::TextColored(ch->volumeChanged?colorOn:colorOff,">> VolumeChanged"); + break; + } default: ImGui::Text("Unimplemented chip! Help!"); break;