fix some macroInt issues with volume

This commit is contained in:
tildearrow 2023-03-17 18:16:04 -05:00
parent 69c3700ab4
commit d58270efed
2 changed files with 8 additions and 6 deletions

View file

@ -20,6 +20,7 @@
#include "macroInt.h" #include "macroInt.h"
#include "instrument.h" #include "instrument.h"
#include "engine.h" #include "engine.h"
#include "../ta-log.h"
#define ADSR_LOW source.val[0] #define ADSR_LOW source.val[0]
#define ADSR_HIGH source.val[1] #define ADSR_HIGH source.val[1]
@ -52,6 +53,7 @@ void DivMacroStruct::doMacro(DivInstrumentMacro& source, bool released, bool tic
} }
if (masked) { if (masked) {
had=false; had=false;
has=false;
return; return;
} }
if (delay>0) { if (delay>0) {
@ -246,8 +248,10 @@ void DivMacroInt::setEngine(DivEngine* eng) {
} }
#define ADD_MACRO(m,s) \ #define ADD_MACRO(m,s) \
macroList[macroListLen]=&m; \ if (!m.masked) { \
macroSource[macroListLen++]=&s; macroList[macroListLen]=&m; \
macroSource[macroListLen++]=&s; \
}
void DivMacroInt::init(DivInstrument* which) { void DivMacroInt::init(DivInstrument* which) {
ins=which; ins=which;

View file

@ -75,15 +75,13 @@ void DivPlatformVIC20::acquire(short** buf, size_t len) {
} }
void DivPlatformVIC20::calcAndWriteOutVol(int ch, int env) { void DivPlatformVIC20::calcAndWriteOutVol(int ch, int env) {
logV("calcAndWriteOutVol (%d, %d)",ch,env);
chan[ch].outVol=MIN(chan[ch].vol*env/15,15); chan[ch].outVol=MIN(chan[ch].vol*env/15,15);
writeOutVol(ch); writeOutVol(ch);
} }
void DivPlatformVIC20::writeOutVol(int ch) { void DivPlatformVIC20::writeOutVol(int ch) {
if (chan[ch].active) { rWrite(14,chan[ch].outVol);
logV("writeOutVol (%d): %d",ch,chan[ch].outVol);
rWrite(14,chan[ch].outVol);
}
} }
void DivPlatformVIC20::tick(bool sysTick) { void DivPlatformVIC20::tick(bool sysTick) {