furnace/src/engine/platform/sms.h

47 lines
1.0 KiB
C
Raw Normal View History

2021-05-15 21:59:57 +00:00
#ifndef _SMS_H
#define _SMS_H
#include "../dispatch.h"
#include "../macroInt.h"
#include "sound/sn76496.h"
class DivPlatformSMS: public DivDispatch {
struct Channel {
int freq, baseFreq, pitch;
unsigned char ins, note;
bool active, insChanged, freqChanged, keyOn, keyOff;
signed char vol, outVol;
DivMacroInt std;
Channel():
freq(0),
baseFreq(0),
pitch(0),
ins(-1),
note(0),
active(false),
insChanged(true),
freqChanged(false),
keyOn(false),
keyOff(false),
2021-12-08 06:31:35 +00:00
vol(15),
outVol(15) {}
};
Channel chan[4];
unsigned char snNoiseMode;
bool updateSNMode;
sn76496_device* sn;
public:
int acquireOne();
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
2021-12-11 18:14:38 +00:00
void reset();
void tick();
2021-12-08 05:33:00 +00:00
bool keyOffAffectsArp(int ch);
2021-12-15 22:32:08 +00:00
void setPAL(bool pal);
int init(DivEngine* parent, int channels, int sugRate, bool pal);
void quit();
~DivPlatformSMS();
};
2021-05-15 21:59:57 +00:00
#endif