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

@ -21,6 +21,8 @@
#define _FMSHARED_BASE_H
#include "../dispatch.h"
#include "../instrument.h"
#include "../macroInt.h"
#include <deque>
#define KVS(x,y) ((chan[x].state.op[y].kvs==2 && isOutput[chan[x].state.alg][y]) || chan[x].state.op[y].kvs==1)
@ -46,6 +48,38 @@ class DivPlatformFMBase: public DivDispatch {
0,2,1,3
};
struct FMChannel: public SharedChannelFreq, public SharedChannelVolume<int> {
DivInstrumentFM state;
DivMacroInt std;
unsigned char freqH, freqL;
int portaPauseFreq;
unsigned char opMask;
signed char konCycles;
bool hardReset, opMaskChanged;
void macroInit(DivInstrument* which) {
std.init(which);
pitch2=0;
}
FMChannel():
SharedChannelFreq(),
SharedChannelVolume<int>(0),
freqH(0),
freqL(0),
portaPauseFreq(0),
opMask(15),
konCycles(0),
hardReset(false),
opMaskChanged(false) {}
};
struct FMChannelStereo: public FMChannel {
unsigned char pan;
FMChannelStereo():
FMChannel(),
pan(3) {}
};
struct QueuedWrite {
unsigned short addr;
unsigned char val;