furnace/src/engine/platform/sms.h

52 lines
1.2 KiB
C
Raw Normal View History

2021-05-15 17:59:57 -04:00
#ifndef _SMS_H
#define _SMS_H
#include "../dispatch.h"
#include "../macroInt.h"
#include "sound/sn76496.h"
class DivPlatformSMS: public DivDispatch {
struct Channel {
2022-01-20 16:56:35 -05:00
int freq, baseFreq, pitch, note;
unsigned char ins;
bool active, insChanged, freqChanged, keyOn, keyOff;
signed char vol, outVol;
DivMacroInt std;
Channel():
freq(0),
baseFreq(0),
pitch(0),
note(0),
2022-01-20 16:56:35 -05:00
ins(-1),
active(false),
insChanged(true),
freqChanged(false),
keyOn(false),
keyOff(false),
2021-12-08 01:31:35 -05:00
vol(15),
outVol(15) {}
};
Channel chan[4];
2021-12-18 03:25:42 -05:00
bool isMuted[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 13:14:38 -05:00
void reset();
void tick();
2021-12-18 03:25:42 -05:00
void muteChannel(int ch, bool mute);
2021-12-08 00:33:00 -05:00
bool keyOffAffectsArp(int ch);
bool keyOffAffectsPorta(int ch);
int getPortaFloor(int ch);
2021-12-15 17:32:08 -05:00
void setPAL(bool pal);
void notifyInsDeletion(void* ins);
int init(DivEngine* parent, int channels, int sugRate, bool pal);
void quit();
~DivPlatformSMS();
};
2021-05-15 17:59:57 -04:00
#endif