2021-05-15 21:59:57 +00:00
|
|
|
#ifndef _SMS_H
|
|
|
|
#define _SMS_H
|
|
|
|
|
2021-05-15 19:18:16 +00:00
|
|
|
#include "../dispatch.h"
|
2021-05-15 21:42:48 +00:00
|
|
|
#include "../macroInt.h"
|
2021-05-15 19:18:16 +00:00
|
|
|
#include "sound/sn76496.h"
|
|
|
|
|
|
|
|
class DivPlatformSMS: public DivDispatch {
|
|
|
|
struct Channel {
|
2022-01-20 21:56:35 +00:00
|
|
|
int freq, baseFreq, pitch, note;
|
|
|
|
unsigned char ins;
|
2021-05-15 19:18:16 +00:00
|
|
|
bool active, insChanged, freqChanged, keyOn, keyOff;
|
2021-05-17 08:06:45 +00:00
|
|
|
signed char vol, outVol;
|
2021-05-15 21:42:48 +00:00
|
|
|
DivMacroInt std;
|
2021-05-17 08:06:45 +00:00
|
|
|
Channel():
|
|
|
|
freq(0),
|
|
|
|
baseFreq(0),
|
|
|
|
pitch(0),
|
|
|
|
note(0),
|
2022-01-20 21:56:35 +00:00
|
|
|
ins(-1),
|
2021-05-17 08:06:45 +00:00
|
|
|
active(false),
|
|
|
|
insChanged(true),
|
|
|
|
freqChanged(false),
|
|
|
|
keyOn(false),
|
|
|
|
keyOff(false),
|
2021-12-08 06:31:35 +00:00
|
|
|
vol(15),
|
|
|
|
outVol(15) {}
|
2021-05-15 19:18:16 +00:00
|
|
|
};
|
|
|
|
Channel chan[4];
|
2021-12-18 08:25:42 +00:00
|
|
|
bool isMuted[4];
|
2021-05-15 19:18:16 +00:00
|
|
|
unsigned char snNoiseMode;
|
|
|
|
bool updateSNMode;
|
|
|
|
sn76496_device* sn;
|
|
|
|
public:
|
2021-12-06 10:21:42 +00:00
|
|
|
int acquireOne();
|
2021-12-06 21:51:18 +00:00
|
|
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
2021-05-15 19:18:16 +00:00
|
|
|
int dispatch(DivCommand c);
|
2021-12-11 18:14:38 +00:00
|
|
|
void reset();
|
2022-01-25 21:52:55 +00:00
|
|
|
void forceIns();
|
2021-05-15 19:18:16 +00:00
|
|
|
void tick();
|
2021-12-18 08:25:42 +00:00
|
|
|
void muteChannel(int ch, bool mute);
|
2021-12-08 05:33:00 +00:00
|
|
|
bool keyOffAffectsArp(int ch);
|
2021-12-29 07:08:50 +00:00
|
|
|
bool keyOffAffectsPorta(int ch);
|
|
|
|
int getPortaFloor(int ch);
|
2021-12-15 22:32:08 +00:00
|
|
|
void setPAL(bool pal);
|
2022-01-14 00:36:02 +00:00
|
|
|
void notifyInsDeletion(void* ins);
|
2021-12-08 06:56:40 +00:00
|
|
|
int init(DivEngine* parent, int channels, int sugRate, bool pal);
|
2021-12-15 05:37:27 +00:00
|
|
|
void quit();
|
|
|
|
~DivPlatformSMS();
|
2021-05-15 19:18:16 +00:00
|
|
|
};
|
2021-05-15 21:59:57 +00:00
|
|
|
|
|
|
|
#endif
|