Reduce duplicates of channel struct

Add/Fix custom clock limit defines (for YMF278B)
This commit is contained in:
cam900 2022-12-04 19:58:58 +09:00
parent fd3f381bc3
commit 2ec4237076
69 changed files with 457 additions and 1151 deletions

View file

@ -27,11 +27,11 @@
#include "sound/nes_nsfplay/nes_fds.h"
class DivPlatformFDS: public DivDispatch {
struct Channel {
int freq, baseFreq, pitch, pitch2, prevFreq, note, modFreq, ins;
struct Channel: public SharedChannelFreq, public SharedChannelVolume<signed char> {
int prevFreq, modFreq;
unsigned char duty, sweep, modDepth, modPos;
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, modOn;
signed char vol, outVol, wave;
bool sweepChanged, modOn;
signed short wave;
signed char modTable[32];
DivMacroInt std;
void macroInit(DivInstrument* which) {
@ -39,28 +39,16 @@ class DivPlatformFDS: public DivDispatch {
pitch2=0;
}
Channel():
freq(0),
baseFreq(0),
pitch(0),
pitch2(0),
SharedChannelFreq(),
SharedChannelVolume<signed char>(32),
prevFreq(65535),
note(0),
modFreq(0),
ins(-1),
duty(0),
sweep(8),
modDepth(0),
modPos(0),
active(false),
insChanged(true),
freqChanged(false),
sweepChanged(false),
keyOn(false),
keyOff(false),
inPorta(false),
modOn(false),
vol(32),
outVol(32),
wave(-1) {
memset(modTable,0,32);
}