From 799d54106ff1f763e64fe6a8165363d5854afa21 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 12 Feb 2023 14:45:29 +0900 Subject: [PATCH] Change to int --- src/engine/platform/es5506.cpp | 16 ++++++++-------- src/engine/platform/es5506.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/engine/platform/es5506.cpp b/src/engine/platform/es5506.cpp index 27056409f..aa6bc0818 100644 --- a/src/engine/platform/es5506.cpp +++ b/src/engine/platform/es5506.cpp @@ -191,7 +191,7 @@ void DivPlatformES5506::tick(bool sysTick) { signed int k1=chan[i].k1Prev,k2=chan[i].k2Prev; // volume/panning macros if (chan[i].std.vol.had) { - const unsigned int nextVol=VOL_SCALE_LOG(VOL_CALC(chan[i].vol),(0xffff*(unsigned int)chan[i].std.vol.val)/chan[i].volMacroMax,0xffff); + const int nextVol=VOL_SCALE_LOG(VOL_CALC(chan[i].vol),(0xffff*(unsigned int)chan[i].std.vol.val)/chan[i].volMacroMax,0xffff); if (chan[i].outVol!=nextVol) { chan[i].outVol=nextVol; chan[i].volChanged.lVol=1; @@ -199,14 +199,14 @@ void DivPlatformES5506::tick(bool sysTick) { } } if (chan[i].std.panL.had) { - const unsigned int nextLVol=VOL_SCALE_LOG(VOL_CALC(chan[i].lVol),(0xffff*(unsigned int)chan[i].std.panL.val)/chan[i].panMacroMax,0xffff); + const int nextLVol=VOL_SCALE_LOG(VOL_CALC(chan[i].lVol),(0xffff*(unsigned int)chan[i].std.panL.val)/chan[i].panMacroMax,0xffff); if (chan[i].outLVol!=nextLVol) { chan[i].outLVol=nextLVol; chan[i].volChanged.lVol=1; } } if (chan[i].std.panR.had) { - const unsigned int nextRVol=VOL_SCALE_LOG(VOL_CALC(chan[i].rVol),(0xffff*(unsigned int)chan[i].std.panR.val)/chan[i].panMacroMax,0xffff); + const int nextRVol=VOL_SCALE_LOG(VOL_CALC(chan[i].rVol),(0xffff*(unsigned int)chan[i].std.panR.val)/chan[i].panMacroMax,0xffff); if (chan[i].outRVol!=nextRVol) { chan[i].outRVol=nextRVol; chan[i].volChanged.rVol=1; @@ -799,7 +799,7 @@ int DivPlatformES5506::dispatch(DivCommand c) { } break; case DIV_CMD_VOLUME: - if (chan[c.chan].vol!=(unsigned int)(c.value)) { + if (chan[c.chan].vol!=c.value) { chan[c.chan].vol=c.value; if (!chan[c.chan].std.vol.has) { chan[c.chan].outVol=VOL_CALC(chan[c.chan].vol); @@ -819,7 +819,7 @@ int DivPlatformES5506::dispatch(DivCommand c) { chan[c.chan].volChanged.ca=1; } // Left volume - if (chan[c.chan].lVol!=(unsigned int)(c.value)) { + if (chan[c.chan].lVol!=c.value) { chan[c.chan].lVol=c.value; if (!chan[c.chan].std.panL.has) { chan[c.chan].outLVol=VOL_CALC(c.value); @@ -827,7 +827,7 @@ int DivPlatformES5506::dispatch(DivCommand c) { } } // Right volume - if (chan[c.chan].rVol!=(unsigned int)(c.value2)) { + if (chan[c.chan].rVol!=c.value2) { chan[c.chan].rVol=c.value2; if (!chan[c.chan].std.panR.has) { chan[c.chan].outRVol=VOL_CALC(c.value2); @@ -844,7 +844,7 @@ int DivPlatformES5506::dispatch(DivCommand c) { } if ((c.value&1)==0) { // Left volume - if (chan[c.chan].lVol!=(unsigned int)(c.value2)) { + if (chan[c.chan].lVol!=c.value2) { chan[c.chan].lVol=c.value2; if (!chan[c.chan].std.panL.has) { chan[c.chan].outLVol=VOL_CALC(c.value2); @@ -854,7 +854,7 @@ int DivPlatformES5506::dispatch(DivCommand c) { } else if ((c.value&1)==1) { // Right volume - if (chan[c.chan].rVol!=(unsigned int)(c.value2)) { + if (chan[c.chan].rVol!=c.value2) { chan[c.chan].rVol=c.value2; if (!chan[c.chan].std.panR.has) { chan[c.chan].outRVol=VOL_CALC(c.value2); diff --git a/src/engine/platform/es5506.h b/src/engine/platform/es5506.h index cb358a20e..3bd158a8f 100644 --- a/src/engine/platform/es5506.h +++ b/src/engine/platform/es5506.h @@ -28,7 +28,7 @@ #include "vgsound_emu/src/es550x/es5506.hpp" class DivPlatformES5506: public DivDispatch, public es550x_intf { - struct Channel : public SharedChannel { + struct Channel : public SharedChannel { struct PCM { bool isNoteMap; int index, next; @@ -184,7 +184,7 @@ class DivPlatformES5506: public DivDispatch, public es550x_intf { DivInstrumentES5506::Filter filter; DivInstrumentES5506::Envelope envelope; Channel(): - SharedChannel(0xff), + SharedChannel(0xff), pcm(PCM()), nextFreq(0), nextNote(0),