GUI: add a debug window

This commit is contained in:
tildearrow 2022-01-27 00:29:16 -05:00
parent 30b012cc5e
commit 0e633ea69b
44 changed files with 490 additions and 4 deletions

View file

@ -6,6 +6,10 @@ void DivDispatch::acquire(short* bufL, short* bufR, size_t start, size_t len) {
void DivDispatch::tick() {
}
void* DivDispatch::getChanState(int chan) {
return NULL;
}
void* DivDispatch::getState() {
return NULL;
}

View file

@ -205,6 +205,10 @@ void DivPlatformAmiga::forceIns() {
}
}
void* DivPlatformAmiga::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformAmiga::reset() {
for (int i=0; i<4; i++) {
chan[i]=DivPlatformAmiga::Channel();

View file

@ -45,9 +45,12 @@ class DivPlatformAmiga: public DivDispatch {
Channel chan[4];
bool isMuted[4];
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -548,6 +548,10 @@ void DivPlatformArcade::notifyInsChange(int ins) {
}
}
void* DivPlatformArcade::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformArcade::reset() {
while (!writes.empty()) writes.pop();
if (useYMFM) {

View file

@ -63,9 +63,12 @@ class DivPlatformArcade: public DivDispatch {
void acquire_nuked(short* bufL, short* bufR, size_t start, size_t len);
void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -290,6 +290,10 @@ void DivPlatformAY8910::forceIns() {
immWrite(0x0d,ayEnvMode);
}
void* DivPlatformAY8910::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformAY8910::reset() {
while (!writes.empty()) writes.pop();
ay->device_reset();

View file

@ -49,10 +49,13 @@ class DivPlatformAY8910: public DivDispatch {
short ayEnvSlide;
short* ayBuf[3];
size_t ayBufLen;
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -328,6 +328,10 @@ void DivPlatformAY8930::forceIns() {
}
}
void* DivPlatformAY8930::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformAY8930::reset() {
while (!writes.empty()) writes.pop();
ay->device_reset();

View file

@ -43,10 +43,13 @@ class DivPlatformAY8930: public DivDispatch {
short ayEnvSlide[3];
short* ayBuf[3];
size_t ayBufLen;
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -327,6 +327,10 @@ void DivPlatformC64::notifyInsDeletion(void* ins) {
}
}
void* DivPlatformC64::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformC64::reset() {
for (int i=0; i<3; i++) {
chan[i]=DivPlatformC64::Channel();

View file

@ -52,10 +52,13 @@ class DivPlatformC64: public DivDispatch {
SID sid;
friend void putDispatchChan(void*,int,int);
void updateFilter();
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -31,6 +31,10 @@ void DivPlatformDummy::tick() {
}
}
void* DivPlatformDummy::getChanState(int ch) {
return &chan[ch];
}
int DivPlatformDummy::dispatch(DivCommand c) {
switch (c.cmd) {
case DIV_CMD_NOTE_ON:

View file

@ -15,10 +15,12 @@ class DivPlatformDummy: public DivDispatch {
Channel chan[128];
bool isMuted[128];
unsigned char chans;
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
void muteChannel(int ch, bool mute);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void tick();
int init(DivEngine* parent, int channels, int sugRate, bool pal);

View file

@ -301,6 +301,10 @@ void DivPlatformGB::forceIns() {
updateWave();
}
void* DivPlatformGB::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformGB::reset() {
for (int i=0; i<4; i++) {
chan[i]=DivPlatformGB::Channel();

View file

@ -38,9 +38,11 @@ class DivPlatformGB: public DivDispatch {
GB_gameboy_t* gb;
unsigned char procMute();
void updateWave();
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -567,6 +567,10 @@ void DivPlatformGenesis::toggleRegisterDump(bool enable) {
psg.toggleRegisterDump(enable);
}
void* DivPlatformGenesis::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformGenesis::reset() {
while (!writes.empty()) writes.pop();
OPN2_Reset(&fm);

View file

@ -67,10 +67,13 @@ class DivPlatformGenesis: public DivDispatch {
int octave(int freq);
int toFreq(int freq);
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -296,6 +296,12 @@ void DivPlatformGenesisExt::forceIns() {
}
}
void* DivPlatformGenesisExt::getChanState(int ch) {
if (ch>=6) return &chan[ch-3];
if (ch>=2) return &opChan[ch-2];
return &chan[ch];
}
void DivPlatformGenesisExt::reset() {
DivPlatformGenesis::reset();

View file

@ -16,8 +16,10 @@ class DivPlatformGenesisExt: public DivPlatformGenesis {
};
OpChannel opChan[4];
bool isOpMuted[4];
friend void putDispatchChan(void*,int,int);
public:
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -344,6 +344,10 @@ void DivPlatformNES::forceIns() {
}
}
void* DivPlatformNES::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformNES::reset() {
for (int i=0; i<5; i++) {
chan[i]=DivPlatformNES::Channel();

View file

@ -42,10 +42,12 @@ class DivPlatformNES: public DivDispatch {
struct NESAPU* nes;
float freqBase;
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -340,6 +340,10 @@ void DivPlatformPCE::forceIns() {
}
}
void* DivPlatformPCE::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformPCE::reset() {
while (!writes.empty()) writes.pop();
for (int i=0; i<6; i++) {

View file

@ -56,9 +56,11 @@ class DivPlatformPCE: public DivDispatch {
unsigned char sampleBank;
PCE_PSG* pce;
void updateWave(int ch);
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -255,6 +255,10 @@ void DivPlatformSAA1099::forceIns() {
rWrite(0x16,saaNoise[0]|(saaNoise[1]<<4));
}
void* DivPlatformSAA1099::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformSAA1099::reset() {
while (!writes.empty()) writes.pop();
saa=saa1099_device();

View file

@ -47,10 +47,12 @@ class DivPlatformSAA1099: public DivDispatch {
size_t saaBufLen;
unsigned char saaEnv[2];
unsigned char saaNoise[2];
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -187,6 +187,10 @@ void DivPlatformSMS::forceIns() {
}
}
void* DivPlatformSMS::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformSMS::reset() {
for (int i=0; i<4; i++) {
chan[i]=DivPlatformSMS::Channel();

View file

@ -31,10 +31,12 @@ class DivPlatformSMS: public DivDispatch {
unsigned char snNoiseMode;
bool updateSNMode;
sn76496_device* sn;
friend void putDispatchChan(void*,int,int);
public:
int acquireOne();
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -228,6 +228,10 @@ void DivPlatformTIA::forceIns() {
}
}
void* DivPlatformTIA::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformTIA::reset() {
tia.reset();
for (int i=0; i<2; i++) {

View file

@ -19,10 +19,12 @@ class DivPlatformTIA: public DivDispatch {
Channel chan[2];
bool isMuted[2];
TIASound tia;
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -570,6 +570,10 @@ void DivPlatformYM2610::forceIns() {
immWrite(0x0d,ayEnvMode);
}
void* DivPlatformYM2610::getChanState(int ch) {
return &chan[ch];
}
void DivPlatformYM2610::reset() {
while (!writes.empty()) writes.pop();
if (dumpWrites) {

View file

@ -63,10 +63,12 @@ class DivPlatformYM2610: public DivDispatch {
int octave(int freq);
int toFreq(int freq);
friend void putDispatchChan(void*,int,int);
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();

View file

@ -268,6 +268,13 @@ void DivPlatformYM2610Ext::forceIns() {
}
}
void* DivPlatformYM2610Ext::getChanState(int ch) {
if (ch>=5) return &chan[ch-3];
if (ch>=1) return &opChan[ch-1];
return &chan[ch];
}
void DivPlatformYM2610Ext::reset() {
DivPlatformYM2610::reset();

View file

@ -16,8 +16,10 @@ class DivPlatformYM2610Ext: public DivPlatformYM2610 {
};
OpChannel opChan[4];
bool isOpMuted[4];
friend void putDispatchChan(void*,int,int);
public:
int dispatch(DivCommand c);
void* getChanState(int chan);
void reset();
void forceIns();
void tick();