2022-01-14 08:37:36 +00:00
|
|
|
#ifndef _TIA_H
|
|
|
|
#define _TIA_H
|
|
|
|
#include "../dispatch.h"
|
|
|
|
#include "../macroInt.h"
|
|
|
|
#include <queue>
|
|
|
|
#include "sound/tia/TIASnd.h"
|
|
|
|
|
|
|
|
class DivPlatformTIA: public DivDispatch {
|
|
|
|
protected:
|
|
|
|
struct Channel {
|
2022-01-20 21:56:35 +00:00
|
|
|
int freq, baseFreq, pitch, note;
|
|
|
|
unsigned char ins, shape;
|
2022-01-14 08:37:36 +00:00
|
|
|
signed char konCycles;
|
|
|
|
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
|
|
|
|
int vol, outVol;
|
|
|
|
DivMacroInt std;
|
2022-01-20 21:56:35 +00:00
|
|
|
Channel(): freq(0), baseFreq(0), pitch(0), note(0), ins(-1), shape(4), active(false), insChanged(true), freqChanged(false), keyOn(false), keyOff(false), portaPause(false), inPorta(false), vol(0), outVol(15) {}
|
2022-01-14 08:37:36 +00:00
|
|
|
};
|
|
|
|
Channel chan[2];
|
|
|
|
bool isMuted[2];
|
|
|
|
TIASound tia;
|
2022-01-27 05:29:16 +00:00
|
|
|
friend void putDispatchChan(void*,int,int);
|
2022-01-28 05:55:51 +00:00
|
|
|
|
|
|
|
unsigned char dealWithFreq(unsigned char shape, int base, int pitch);
|
2022-01-14 08:37:36 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
|
|
|
int dispatch(DivCommand c);
|
2022-01-27 05:29:16 +00:00
|
|
|
void* getChanState(int chan);
|
2022-01-14 08:37:36 +00:00
|
|
|
void reset();
|
|
|
|
void forceIns();
|
|
|
|
void tick();
|
|
|
|
void muteChannel(int ch, bool mute);
|
2022-01-28 17:59:53 +00:00
|
|
|
void setFlags(unsigned int flags);
|
2022-01-14 08:37:36 +00:00
|
|
|
bool isStereo();
|
|
|
|
bool keyOffAffectsArp(int ch);
|
|
|
|
void notifyInsDeletion(void* ins);
|
2022-01-28 17:59:53 +00:00
|
|
|
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
2022-01-14 08:37:36 +00:00
|
|
|
void quit();
|
|
|
|
};
|
|
|
|
#endif
|