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

@ -26,7 +26,7 @@
class DivPlatformAY8930: public DivDispatch {
protected:
struct Channel {
struct Channel: public SharedChannelFreq, public SharedChannelVolume<int> {
struct Envelope {
unsigned char mode;
unsigned short period;
@ -81,40 +81,23 @@ class DivPlatformAY8930: public DivDispatch {
furnaceDAC(0) {}
} dac;
int freq, baseFreq, note, pitch, pitch2;
int ins;
unsigned char autoEnvNum, autoEnvDen, duty;
signed char konCycles;
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
int vol, outVol;
DivMacroInt std;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
Channel():
SharedChannelFreq(),
SharedChannelVolume<int>(31),
envelope(Envelope()),
curPSGMode(PSGMode(0)),
nextPSGMode(PSGMode(1)),
dac(DAC()),
freq(0),
baseFreq(0),
note(0),
pitch(0),
pitch2(0),
ins(-1),
autoEnvNum(0),
autoEnvDen(0),
duty(4),
active(false),
insChanged(true),
freqChanged(false),
keyOn(false),
keyOff(false),
portaPause(false),
inPorta(false),
vol(0),
outVol(31) {}
duty(4) {}
};
Channel chan[3];
bool isMuted[3];