Unify shared channel struct, De-duplicate channel debug

This commit is contained in:
cam900 2022-12-13 16:22:48 +09:00
parent f455d2d942
commit ce09edef84
55 changed files with 209 additions and 714 deletions

View file

@ -20,46 +20,41 @@
#ifndef _CHIP_UTILS_H
#define _CHIP_UTILS_H
#include "macroInt.h"
// custom clock limits
#define MIN_CUSTOM_CLOCK 100000
#define MAX_CUSTOM_CLOCK 40000000
// common shared channel struct
template<typename T>
struct SharedChannel {
int ins;
int note;
bool active, insChanged, keyOn, keyOff;
SharedChannel():
ins(-1),
note(0),
active(false),
insChanged(true),
keyOn(false),
keyOff(false) {}
};
// common shared channel struct with frequency
struct SharedChannelFreq: public SharedChannel {
int freq, baseFreq, pitch, pitch2;
bool freqChanged, inPorta, portaPause;
SharedChannelFreq():
SharedChannel(),
int ins, note;
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
T vol, outVol;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
SharedChannel(T initVol):
freq(0),
baseFreq(0),
pitch(0),
pitch2(0),
ins(-1),
note(0),
active(false),
insChanged(true),
freqChanged(false),
keyOn(false),
keyOff(false),
portaPause(false),
inPorta(false),
portaPause(false) {}
};
// common shared channel volume struct
template<typename T>
struct SharedChannelVolume {
T vol, outVol;
SharedChannelVolume(T initVol):
vol(initVol),
outVol(initVol) {}
outVol(initVol),
std() {}
};
#endif