GUI: add a debug window
This commit is contained in:
parent
30b012cc5e
commit
0e633ea69b
|
@ -170,6 +170,7 @@ src/gui/font_ptMono.cpp
|
||||||
src/gui/font_unifont.cpp
|
src/gui/font_unifont.cpp
|
||||||
src/gui/font_icon.cpp
|
src/gui/font_icon.cpp
|
||||||
src/gui/fonts.cpp
|
src/gui/fonts.cpp
|
||||||
|
src/gui/debug.cpp
|
||||||
src/gui/gui.cpp)
|
src/gui/gui.cpp)
|
||||||
|
|
||||||
if (NOT WIN32 AND NOT APPLE)
|
if (NOT WIN32 AND NOT APPLE)
|
||||||
|
|
Binary file not shown.
|
@ -171,6 +171,12 @@ class DivDispatch {
|
||||||
*/
|
*/
|
||||||
virtual void tick();
|
virtual void tick();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the state of a channel.
|
||||||
|
* @return a pointer, or NULL.
|
||||||
|
*/
|
||||||
|
virtual void* getChanState(int chan);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get this dispatch's state.
|
* get this dispatch's state.
|
||||||
* @return a pointer to the dispatch's state. must be deallocated manually!
|
* @return a pointer to the dispatch's state. must be deallocated manually!
|
||||||
|
|
|
@ -3716,6 +3716,16 @@ void DivEngine::setLoops(int loops) {
|
||||||
remainingLoops=loops;
|
remainingLoops=loops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DivChannelState* DivEngine::getChanState(int ch) {
|
||||||
|
if (ch<0 || ch>=chans) return NULL;
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
|
void* DivEngine::getDispatchChanState(int ch) {
|
||||||
|
if (ch<0 || ch>=chans) return NULL;
|
||||||
|
return disCont[dispatchOfChan[ch]].dispatch->getChanState(dispatchChanOfChan[ch]);
|
||||||
|
}
|
||||||
|
|
||||||
void DivEngine::playSub(bool preserveDrift) {
|
void DivEngine::playSub(bool preserveDrift) {
|
||||||
reset();
|
reset();
|
||||||
if (preserveDrift && curOrder==0) return;
|
if (preserveDrift && curOrder==0) return;
|
||||||
|
|
|
@ -150,9 +150,6 @@ class DivEngine {
|
||||||
std::map<String,String> conf;
|
std::map<String,String> conf;
|
||||||
std::queue<DivNoteEvent> pendingNotes;
|
std::queue<DivNoteEvent> pendingNotes;
|
||||||
bool isMuted[DIV_MAX_CHANS];
|
bool isMuted[DIV_MAX_CHANS];
|
||||||
DivSystem sysOfChan[DIV_MAX_CHANS];
|
|
||||||
int dispatchOfChan[DIV_MAX_CHANS];
|
|
||||||
int dispatchChanOfChan[DIV_MAX_CHANS];
|
|
||||||
std::mutex isBusy;
|
std::mutex isBusy;
|
||||||
String configPath;
|
String configPath;
|
||||||
String configFile;
|
String configFile;
|
||||||
|
@ -206,6 +203,10 @@ class DivEngine {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DivSong song;
|
DivSong song;
|
||||||
|
DivSystem sysOfChan[DIV_MAX_CHANS];
|
||||||
|
int dispatchOfChan[DIV_MAX_CHANS];
|
||||||
|
int dispatchChanOfChan[DIV_MAX_CHANS];
|
||||||
|
|
||||||
void runExportThread();
|
void runExportThread();
|
||||||
void nextBuf(float** in, float** out, int inChans, int outChans, unsigned int size);
|
void nextBuf(float** in, float** out, int inChans, int outChans, unsigned int size);
|
||||||
DivInstrument* getIns(int index);
|
DivInstrument* getIns(int index);
|
||||||
|
@ -448,6 +449,12 @@ class DivEngine {
|
||||||
// set remaining loops. -1 means loop forever.
|
// set remaining loops. -1 means loop forever.
|
||||||
void setLoops(int loops);
|
void setLoops(int loops);
|
||||||
|
|
||||||
|
// get channel state
|
||||||
|
DivChannelState* getChanState(int chan);
|
||||||
|
|
||||||
|
// get dispatch channel state
|
||||||
|
void* getDispatchChanState(int chan);
|
||||||
|
|
||||||
// set the audio system.
|
// set the audio system.
|
||||||
void setAudio(DivAudioEngines which);
|
void setAudio(DivAudioEngines which);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
#ifndef _ORDERS_H
|
||||||
|
#define _ORDERS_H
|
||||||
|
|
||||||
struct DivOrders {
|
struct DivOrders {
|
||||||
unsigned char ord[DIV_MAX_CHANS][128];
|
unsigned char ord[DIV_MAX_CHANS][128];
|
||||||
|
|
||||||
|
@ -5,3 +8,5 @@ struct DivOrders {
|
||||||
memset(ord,0,DIV_MAX_CHANS*128);
|
memset(ord,0,DIV_MAX_CHANS*128);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -6,6 +6,10 @@ void DivDispatch::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||||
void DivDispatch::tick() {
|
void DivDispatch::tick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivDispatch::getChanState(int chan) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void* DivDispatch::getState() {
|
void* DivDispatch::getState() {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,6 +205,10 @@ void DivPlatformAmiga::forceIns() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformAmiga::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformAmiga::reset() {
|
void DivPlatformAmiga::reset() {
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
chan[i]=DivPlatformAmiga::Channel();
|
chan[i]=DivPlatformAmiga::Channel();
|
||||||
|
|
|
@ -45,9 +45,12 @@ class DivPlatformAmiga: public DivDispatch {
|
||||||
Channel chan[4];
|
Channel chan[4];
|
||||||
bool isMuted[4];
|
bool isMuted[4];
|
||||||
|
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -548,6 +548,10 @@ void DivPlatformArcade::notifyInsChange(int ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformArcade::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformArcade::reset() {
|
void DivPlatformArcade::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
if (useYMFM) {
|
if (useYMFM) {
|
||||||
|
|
|
@ -63,9 +63,12 @@ class DivPlatformArcade: public DivDispatch {
|
||||||
void acquire_nuked(short* bufL, short* bufR, size_t start, size_t len);
|
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);
|
void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
|
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -290,6 +290,10 @@ void DivPlatformAY8910::forceIns() {
|
||||||
immWrite(0x0d,ayEnvMode);
|
immWrite(0x0d,ayEnvMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformAY8910::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformAY8910::reset() {
|
void DivPlatformAY8910::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
ay->device_reset();
|
ay->device_reset();
|
||||||
|
|
|
@ -50,9 +50,12 @@ class DivPlatformAY8910: public DivDispatch {
|
||||||
short* ayBuf[3];
|
short* ayBuf[3];
|
||||||
size_t ayBufLen;
|
size_t ayBufLen;
|
||||||
|
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -328,6 +328,10 @@ void DivPlatformAY8930::forceIns() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformAY8930::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformAY8930::reset() {
|
void DivPlatformAY8930::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
ay->device_reset();
|
ay->device_reset();
|
||||||
|
|
|
@ -44,9 +44,12 @@ class DivPlatformAY8930: public DivDispatch {
|
||||||
short* ayBuf[3];
|
short* ayBuf[3];
|
||||||
size_t ayBufLen;
|
size_t ayBufLen;
|
||||||
|
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -327,6 +327,10 @@ void DivPlatformC64::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformC64::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformC64::reset() {
|
void DivPlatformC64::reset() {
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<3; i++) {
|
||||||
chan[i]=DivPlatformC64::Channel();
|
chan[i]=DivPlatformC64::Channel();
|
||||||
|
|
|
@ -52,10 +52,13 @@ class DivPlatformC64: public DivDispatch {
|
||||||
|
|
||||||
SID sid;
|
SID sid;
|
||||||
|
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
void updateFilter();
|
void updateFilter();
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -31,6 +31,10 @@ void DivPlatformDummy::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformDummy::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
int DivPlatformDummy::dispatch(DivCommand c) {
|
int DivPlatformDummy::dispatch(DivCommand c) {
|
||||||
switch (c.cmd) {
|
switch (c.cmd) {
|
||||||
case DIV_CMD_NOTE_ON:
|
case DIV_CMD_NOTE_ON:
|
||||||
|
|
|
@ -15,10 +15,12 @@ class DivPlatformDummy: public DivDispatch {
|
||||||
Channel chan[128];
|
Channel chan[128];
|
||||||
bool isMuted[128];
|
bool isMuted[128];
|
||||||
unsigned char chans;
|
unsigned char chans;
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void tick();
|
void tick();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, bool pal);
|
int init(DivEngine* parent, int channels, int sugRate, bool pal);
|
||||||
|
|
|
@ -301,6 +301,10 @@ void DivPlatformGB::forceIns() {
|
||||||
updateWave();
|
updateWave();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformGB::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformGB::reset() {
|
void DivPlatformGB::reset() {
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
chan[i]=DivPlatformGB::Channel();
|
chan[i]=DivPlatformGB::Channel();
|
||||||
|
|
|
@ -38,9 +38,11 @@ class DivPlatformGB: public DivDispatch {
|
||||||
GB_gameboy_t* gb;
|
GB_gameboy_t* gb;
|
||||||
unsigned char procMute();
|
unsigned char procMute();
|
||||||
void updateWave();
|
void updateWave();
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -567,6 +567,10 @@ void DivPlatformGenesis::toggleRegisterDump(bool enable) {
|
||||||
psg.toggleRegisterDump(enable);
|
psg.toggleRegisterDump(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformGenesis::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformGenesis::reset() {
|
void DivPlatformGenesis::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
OPN2_Reset(&fm);
|
OPN2_Reset(&fm);
|
||||||
|
|
|
@ -68,9 +68,12 @@ class DivPlatformGenesis: public DivDispatch {
|
||||||
int octave(int freq);
|
int octave(int freq);
|
||||||
int toFreq(int freq);
|
int toFreq(int freq);
|
||||||
|
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -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() {
|
void DivPlatformGenesisExt::reset() {
|
||||||
DivPlatformGenesis::reset();
|
DivPlatformGenesis::reset();
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,10 @@ class DivPlatformGenesisExt: public DivPlatformGenesis {
|
||||||
};
|
};
|
||||||
OpChannel opChan[4];
|
OpChannel opChan[4];
|
||||||
bool isOpMuted[4];
|
bool isOpMuted[4];
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
public:
|
public:
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -344,6 +344,10 @@ void DivPlatformNES::forceIns() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformNES::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformNES::reset() {
|
void DivPlatformNES::reset() {
|
||||||
for (int i=0; i<5; i++) {
|
for (int i=0; i<5; i++) {
|
||||||
chan[i]=DivPlatformNES::Channel();
|
chan[i]=DivPlatformNES::Channel();
|
||||||
|
|
|
@ -42,10 +42,12 @@ class DivPlatformNES: public DivDispatch {
|
||||||
struct NESAPU* nes;
|
struct NESAPU* nes;
|
||||||
|
|
||||||
float freqBase;
|
float freqBase;
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -340,6 +340,10 @@ void DivPlatformPCE::forceIns() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformPCE::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformPCE::reset() {
|
void DivPlatformPCE::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
|
|
|
@ -56,9 +56,11 @@ class DivPlatformPCE: public DivDispatch {
|
||||||
unsigned char sampleBank;
|
unsigned char sampleBank;
|
||||||
PCE_PSG* pce;
|
PCE_PSG* pce;
|
||||||
void updateWave(int ch);
|
void updateWave(int ch);
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -255,6 +255,10 @@ void DivPlatformSAA1099::forceIns() {
|
||||||
rWrite(0x16,saaNoise[0]|(saaNoise[1]<<4));
|
rWrite(0x16,saaNoise[0]|(saaNoise[1]<<4));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformSAA1099::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformSAA1099::reset() {
|
void DivPlatformSAA1099::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
saa=saa1099_device();
|
saa=saa1099_device();
|
||||||
|
|
|
@ -47,10 +47,12 @@ class DivPlatformSAA1099: public DivDispatch {
|
||||||
size_t saaBufLen;
|
size_t saaBufLen;
|
||||||
unsigned char saaEnv[2];
|
unsigned char saaEnv[2];
|
||||||
unsigned char saaNoise[2];
|
unsigned char saaNoise[2];
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -187,6 +187,10 @@ void DivPlatformSMS::forceIns() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformSMS::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformSMS::reset() {
|
void DivPlatformSMS::reset() {
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
chan[i]=DivPlatformSMS::Channel();
|
chan[i]=DivPlatformSMS::Channel();
|
||||||
|
|
|
@ -31,10 +31,12 @@ class DivPlatformSMS: public DivDispatch {
|
||||||
unsigned char snNoiseMode;
|
unsigned char snNoiseMode;
|
||||||
bool updateSNMode;
|
bool updateSNMode;
|
||||||
sn76496_device* sn;
|
sn76496_device* sn;
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
public:
|
public:
|
||||||
int acquireOne();
|
int acquireOne();
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -228,6 +228,10 @@ void DivPlatformTIA::forceIns() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformTIA::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformTIA::reset() {
|
void DivPlatformTIA::reset() {
|
||||||
tia.reset();
|
tia.reset();
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
|
|
|
@ -19,10 +19,12 @@ class DivPlatformTIA: public DivDispatch {
|
||||||
Channel chan[2];
|
Channel chan[2];
|
||||||
bool isMuted[2];
|
bool isMuted[2];
|
||||||
TIASound tia;
|
TIASound tia;
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -570,6 +570,10 @@ void DivPlatformYM2610::forceIns() {
|
||||||
immWrite(0x0d,ayEnvMode);
|
immWrite(0x0d,ayEnvMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* DivPlatformYM2610::getChanState(int ch) {
|
||||||
|
return &chan[ch];
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformYM2610::reset() {
|
void DivPlatformYM2610::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
|
|
|
@ -63,10 +63,12 @@ class DivPlatformYM2610: public DivDispatch {
|
||||||
|
|
||||||
int octave(int freq);
|
int octave(int freq);
|
||||||
int toFreq(int freq);
|
int toFreq(int freq);
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -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() {
|
void DivPlatformYM2610Ext::reset() {
|
||||||
DivPlatformYM2610::reset();
|
DivPlatformYM2610::reset();
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,10 @@ class DivPlatformYM2610Ext: public DivPlatformYM2610 {
|
||||||
};
|
};
|
||||||
OpChannel opChan[4];
|
OpChannel opChan[4];
|
||||||
bool isOpMuted[4];
|
bool isOpMuted[4];
|
||||||
|
friend void putDispatchChan(void*,int,int);
|
||||||
public:
|
public:
|
||||||
int dispatch(DivCommand c);
|
int dispatch(DivCommand c);
|
||||||
|
void* getChanState(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick();
|
void tick();
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#ifndef _SONG_H
|
||||||
|
#define _SONG_H
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -158,3 +160,5 @@ struct DivSong {
|
||||||
system[0]=DIV_SYSTEM_GENESIS;
|
system[0]=DIV_SYSTEM_GENESIS;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,202 @@
|
||||||
|
#include "debug.h"
|
||||||
|
#include "imgui.h"
|
||||||
|
#include "../engine/platform/genesis.h"
|
||||||
|
#include "../engine/platform/genesisext.h"
|
||||||
|
#include "../engine/platform/sms.h"
|
||||||
|
#include "../engine/platform/gb.h"
|
||||||
|
#include "../engine/platform/pce.h"
|
||||||
|
#include "../engine/platform/nes.h"
|
||||||
|
#include "../engine/platform/c64.h"
|
||||||
|
#include "../engine/platform/arcade.h"
|
||||||
|
#include "../engine/platform/ym2610.h"
|
||||||
|
#include "../engine/platform/ym2610ext.h"
|
||||||
|
#include "../engine/platform/ay.h"
|
||||||
|
#include "../engine/platform/ay8930.h"
|
||||||
|
#include "../engine/platform/tia.h"
|
||||||
|
#include "../engine/platform/saa.h"
|
||||||
|
#include "../engine/platform/amiga.h"
|
||||||
|
#include "../engine/platform/dummy.h"
|
||||||
|
|
||||||
|
void putDispatchChan(void* data, int chanNum, int type) {
|
||||||
|
ImVec4 colorOn=ImVec4(1.0f,1.0f,0.0f,1.0f);
|
||||||
|
ImVec4 colorOff=ImVec4(0.3f,0.3f,0.3f,1.0f);
|
||||||
|
switch (type) {
|
||||||
|
case DIV_SYSTEM_GENESIS: {
|
||||||
|
DivPlatformGenesis::Channel* ch=(DivPlatformGenesis::Channel*)data;
|
||||||
|
ImGui::Text("> Genesis");
|
||||||
|
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL);
|
||||||
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
|
ImGui::Text("- note: %d",ch->note);
|
||||||
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
|
ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
|
ImGui::Text("- pan: %x",ch->pan);
|
||||||
|
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
|
||||||
|
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
|
||||||
|
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
|
||||||
|
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
|
||||||
|
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
|
||||||
|
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause");
|
||||||
|
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC");
|
||||||
|
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DIV_SYSTEM_SMS: {
|
||||||
|
DivPlatformSMS::Channel* ch=(DivPlatformSMS::Channel*)data;
|
||||||
|
ImGui::Text("> SMS");
|
||||||
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
|
ImGui::Text("- note: %d",ch->note);
|
||||||
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
|
ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
|
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
|
||||||
|
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
|
||||||
|
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
|
||||||
|
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
|
||||||
|
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DIV_SYSTEM_GB: {
|
||||||
|
DivPlatformGB::Channel* ch=(DivPlatformGB::Channel*)data;
|
||||||
|
ImGui::Text("> GameBoy");
|
||||||
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
|
ImGui::Text("- note: %d",ch->note);
|
||||||
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
|
ImGui::Text("- duty: %d",ch->duty);
|
||||||
|
ImGui::Text("- sweep: %.2x",ch->sweep);
|
||||||
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
|
ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
|
ImGui::Text("- wave: %d",ch->wave);
|
||||||
|
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
|
||||||
|
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
|
||||||
|
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
|
||||||
|
ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged");
|
||||||
|
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
|
||||||
|
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
|
||||||
|
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DIV_SYSTEM_PCE: {
|
||||||
|
DivPlatformPCE::Channel* ch=(DivPlatformPCE::Channel*)data;
|
||||||
|
ImGui::Text("> PCEngine");
|
||||||
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
|
ImGui::Text("- note: %d",ch->note);
|
||||||
|
ImGui::Text("* DAC:");
|
||||||
|
ImGui::Text(" - period: %d",ch->dacPeriod);
|
||||||
|
ImGui::Text(" - rate: %d",ch->dacRate);
|
||||||
|
ImGui::Text(" - pos: %d",ch->dacPos);
|
||||||
|
ImGui::Text(" - sample: %d",ch->dacSample);
|
||||||
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
|
ImGui::Text("- pan: %.2x",ch->pan);
|
||||||
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
|
ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
|
ImGui::Text("- wave: %d",ch->wave);
|
||||||
|
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
|
||||||
|
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
|
||||||
|
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
|
||||||
|
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
|
||||||
|
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
|
||||||
|
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
|
||||||
|
ImGui::TextColored(ch->noise?colorOn:colorOff,">> Noise");
|
||||||
|
ImGui::TextColored(ch->pcm?colorOn:colorOff,">> DAC");
|
||||||
|
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DIV_SYSTEM_NES: {
|
||||||
|
DivPlatformNES::Channel* ch=(DivPlatformNES::Channel*)data;
|
||||||
|
ImGui::Text("> NES");
|
||||||
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
|
ImGui::Text(" - prev: %d",ch->prevFreq);
|
||||||
|
ImGui::Text("- note: %d",ch->note);
|
||||||
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
|
ImGui::Text("- duty: %d",ch->duty);
|
||||||
|
ImGui::Text("- sweep: %.2x",ch->sweep);
|
||||||
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
|
ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
|
ImGui::Text("- wave: %d",ch->wave);
|
||||||
|
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
|
||||||
|
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
|
||||||
|
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
|
||||||
|
ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged");
|
||||||
|
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
|
||||||
|
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
|
||||||
|
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
|
||||||
|
ImGui::TextColored(ch->furnaceDac?colorOn:colorOff,">> FurnaceDAC");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DIV_SYSTEM_C64_6581: case DIV_SYSTEM_C64_8580: {
|
||||||
|
DivPlatformC64::Channel* ch=(DivPlatformC64::Channel*)data;
|
||||||
|
ImGui::Text("> C64");
|
||||||
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
|
ImGui::Text(" - prev: %d",ch->prevFreq);
|
||||||
|
ImGui::Text("- testWhen: %d",ch->testWhen);
|
||||||
|
ImGui::Text("- note: %d",ch->note);
|
||||||
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
|
ImGui::Text("- duty: %d",ch->duty);
|
||||||
|
ImGui::Text("- sweep: %.2x",ch->sweep);
|
||||||
|
ImGui::Text("- wave: %.1x",ch->wave);
|
||||||
|
ImGui::Text("- ADSR: %.1x %.1x %.1x %.1x",ch->attack,ch->decay,ch->sustain,ch->release);
|
||||||
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
|
ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
|
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
|
||||||
|
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
|
||||||
|
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
|
||||||
|
ImGui::TextColored(ch->sweepChanged?colorOn:colorOff,">> SweepChanged");
|
||||||
|
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
|
||||||
|
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
|
||||||
|
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
|
||||||
|
ImGui::TextColored(ch->filter?colorOn:colorOff,">> Filter");
|
||||||
|
ImGui::TextColored(ch->resetMask?colorOn:colorOff,">> ResetMask");
|
||||||
|
ImGui::TextColored(ch->resetFilter?colorOn:colorOff,">> ResetFilter");
|
||||||
|
ImGui::TextColored(ch->resetDuty?colorOn:colorOff,">> ResetDuty");
|
||||||
|
ImGui::TextColored(ch->ring?colorOn:colorOff,">> Ring");
|
||||||
|
ImGui::TextColored(ch->sync?colorOn:colorOff,">> Sync");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DIV_SYSTEM_ARCADE: {
|
||||||
|
DivPlatformArcade::Channel* ch=(DivPlatformArcade::Channel*)data;
|
||||||
|
ImGui::Text("> Arcade");
|
||||||
|
ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL);
|
||||||
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
|
//ImGui::Text("- note: %d",ch->note);
|
||||||
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
|
ImGui::Text("- KOnCycles: %d",ch->konCycles);
|
||||||
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
|
//ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
|
ImGui::Text("- chVolL: %.2x",ch->chVolL);
|
||||||
|
ImGui::Text("- chVolR: %.2x",ch->chVolR);
|
||||||
|
ImGui::Text("* PCM:");
|
||||||
|
ImGui::Text(" - sample: %d",ch->pcm.sample);
|
||||||
|
ImGui::Text(" - pos: %d",ch->pcm.pos>>8);
|
||||||
|
ImGui::Text(" - subPos: %d",ch->pcm.pos&0xff);
|
||||||
|
ImGui::Text(" - len: %d",ch->pcm.len);
|
||||||
|
ImGui::Text(" - freq: %.2x",ch->pcm.freq);
|
||||||
|
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
|
||||||
|
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
|
||||||
|
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
|
||||||
|
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
|
||||||
|
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
|
||||||
|
ImGui::TextColored(ch->portaPause?colorOn:colorOff,">> PortaPause");
|
||||||
|
ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM");
|
||||||
|
//ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
ImGui::Text("Unknown system! Help!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef _GUI_DEBUG_H
|
||||||
|
#define _GUI_DEBUG_H
|
||||||
|
#include "../engine/song.h"
|
||||||
|
|
||||||
|
void putDispatchChan(void* data, int chanNum, int type);
|
||||||
|
#endif
|
132
src/gui/gui.cpp
132
src/gui/gui.cpp
|
@ -1,5 +1,6 @@
|
||||||
#define _USE_MATH_DEFINES
|
#define _USE_MATH_DEFINES
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
#include "debug.h"
|
||||||
#include "SDL_clipboard.h"
|
#include "SDL_clipboard.h"
|
||||||
#include "SDL_events.h"
|
#include "SDL_events.h"
|
||||||
#include "SDL_keycode.h"
|
#include "SDL_keycode.h"
|
||||||
|
@ -2780,6 +2781,131 @@ void FurnaceGUI::commitSettings() {
|
||||||
ImGui::GetIO().Fonts->Build();
|
ImGui::GetIO().Fonts->Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FurnaceGUI::drawDebug() {
|
||||||
|
static int bpOrder;
|
||||||
|
static int bpRow;
|
||||||
|
static int bpTick;
|
||||||
|
static bool bpOn;
|
||||||
|
if (!debugOpen) return;
|
||||||
|
if (ImGui::Begin("Debug",&debugOpen,ImGuiWindowFlags_NoDocking)) {
|
||||||
|
ImGui::Text("NOTE: use with caution.");
|
||||||
|
if (ImGui::TreeNode("Debug Controls")) {
|
||||||
|
ImGui::Button("Pause");
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Button("Frame Advance");
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Button("Row Advance");
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Button("Pattern Advance");
|
||||||
|
|
||||||
|
ImGui::Button("Panic");
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Abort")) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
if (ImGui::TreeNode("Breakpoint")) {
|
||||||
|
ImGui::InputInt("Order",&bpOrder);
|
||||||
|
ImGui::InputInt("Row",&bpRow);
|
||||||
|
ImGui::InputInt("Tick",&bpTick);
|
||||||
|
ImGui::Checkbox("Enable",&bpOn);
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
if (ImGui::TreeNode("Dispatch Status")) {
|
||||||
|
ImGui::Text("for best results set latency to minimum or use the Frame Advance button.");
|
||||||
|
ImGui::Columns(e->getTotalChannelCount());
|
||||||
|
for (int i=0; i<e->getTotalChannelCount(); i++) {
|
||||||
|
void* ch=e->getDispatchChanState(i);
|
||||||
|
ImGui::TextColored(uiColors[GUI_COLOR_ACCENT_PRIMARY],"Ch. %d: %d, %d",i,e->dispatchOfChan[i],e->dispatchChanOfChan[i]);
|
||||||
|
if (ch==NULL) {
|
||||||
|
ImGui::Text("NULL");
|
||||||
|
} else {
|
||||||
|
putDispatchChan(ch,e->dispatchChanOfChan[i],e->sysOfChan[i]);
|
||||||
|
}
|
||||||
|
ImGui::NextColumn();
|
||||||
|
}
|
||||||
|
ImGui::Columns();
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
if (ImGui::TreeNode("Playback Status")) {
|
||||||
|
ImGui::Text("for best results set latency to minimum or use the Frame Advance button.");
|
||||||
|
ImGui::Columns(e->getTotalChannelCount());
|
||||||
|
for (int i=0; i<e->getTotalChannelCount(); i++) {
|
||||||
|
DivChannelState* ch=e->getChanState(i);
|
||||||
|
ImGui::TextColored(uiColors[GUI_COLOR_ACCENT_PRIMARY],"Channel %d:",i);
|
||||||
|
if (ch==NULL) {
|
||||||
|
ImGui::Text("NULL");
|
||||||
|
} else {
|
||||||
|
ImGui::Text("* General:");
|
||||||
|
ImGui::Text("- note = %d",ch->note);
|
||||||
|
ImGui::Text("- oldNote = %d",ch->oldNote);
|
||||||
|
ImGui::Text("- pitch = %d",ch->pitch);
|
||||||
|
ImGui::Text("- portaSpeed = %d",ch->portaSpeed);
|
||||||
|
ImGui::Text("- portaNote = %d",ch->portaNote);
|
||||||
|
ImGui::Text("- volume = %.4x",ch->volume);
|
||||||
|
ImGui::Text("- volSpeed = %d",ch->volSpeed);
|
||||||
|
ImGui::Text("- cut = %d",ch->cut);
|
||||||
|
ImGui::Text("- rowDelay = %d",ch->rowDelay);
|
||||||
|
ImGui::Text("- volMax = %.4x",ch->volMax);
|
||||||
|
ImGui::Text("- delayOrder = %d",ch->delayOrder);
|
||||||
|
ImGui::Text("- delayRow = %d",ch->delayRow);
|
||||||
|
ImGui::Text("- retrigSpeed = %d",ch->retrigSpeed);
|
||||||
|
ImGui::Text("- retrigTick = %d",ch->retrigTick);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text,(ch->vibratoDepth>0)?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_TEXT]);
|
||||||
|
ImGui::Text("* Vibrato:");
|
||||||
|
ImGui::Text("- depth = %d",ch->vibratoDepth);
|
||||||
|
ImGui::Text("- rate = %d",ch->vibratoRate);
|
||||||
|
ImGui::Text("- pos = %d",ch->vibratoPos);
|
||||||
|
ImGui::Text("- dir = %d",ch->vibratoDir);
|
||||||
|
ImGui::Text("- fine = %d",ch->vibratoFine);
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text,(ch->tremoloDepth>0)?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_TEXT]);
|
||||||
|
ImGui::Text("* Tremolo:");
|
||||||
|
ImGui::Text("- depth = %d",ch->tremoloDepth);
|
||||||
|
ImGui::Text("- rate = %d",ch->tremoloRate);
|
||||||
|
ImGui::Text("- pos = %d",ch->tremoloPos);
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text,(ch->arp>0)?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_TEXT]);
|
||||||
|
ImGui::Text("* Arpeggio:");
|
||||||
|
ImGui::Text("- arp = %.2X",ch->arp);
|
||||||
|
ImGui::Text("- stage = %d",ch->arpStage);
|
||||||
|
ImGui::Text("- ticks = %d",ch->arpTicks);
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
ImGui::Text("* Miscellaneous:");
|
||||||
|
ImGui::TextColored(ch->doNote?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> Do Note");
|
||||||
|
ImGui::TextColored(ch->legato?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> Legato");
|
||||||
|
ImGui::TextColored(ch->portaStop?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> PortaStop");
|
||||||
|
ImGui::TextColored(ch->keyOn?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> Key On");
|
||||||
|
ImGui::TextColored(ch->keyOff?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> Key Off");
|
||||||
|
ImGui::TextColored(ch->nowYouCanStop?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> NowYouCanStop");
|
||||||
|
ImGui::TextColored(ch->stopOnOff?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> Stop on Off");
|
||||||
|
ImGui::TextColored(ch->arpYield?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> Arp Yield");
|
||||||
|
ImGui::TextColored(ch->delayLocked?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> DelayLocked");
|
||||||
|
ImGui::TextColored(ch->inPorta?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> InPorta");
|
||||||
|
ImGui::TextColored(ch->scheduledSlideReset?uiColors[GUI_COLOR_MACRO_VOLUME]:uiColors[GUI_COLOR_HEADER],">> SchedSlide");
|
||||||
|
}
|
||||||
|
ImGui::NextColumn();
|
||||||
|
}
|
||||||
|
ImGui::Columns();
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
if (ImGui::TreeNode("Settings")) {
|
||||||
|
if (ImGui::Button("Sync")) syncSettings();
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Commit")) commitSettings();
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Force Load")) e->loadConf();
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Force Save")) e->saveConf();
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
ImGui::Text("Song format version %d",e->song.version);
|
||||||
|
ImGui::Text("Furnace version " DIV_VERSION " (%d)",DIV_ENGINE_VERSION);
|
||||||
|
}
|
||||||
|
ImGui::End();
|
||||||
|
}
|
||||||
|
|
||||||
void FurnaceGUI::startSelection(int xCoarse, int xFine, int y) {
|
void FurnaceGUI::startSelection(int xCoarse, int xFine, int y) {
|
||||||
if (xCoarse!=selStart.xCoarse || xFine!=selStart.xFine || y!=selStart.y) {
|
if (xCoarse!=selStart.xCoarse || xFine!=selStart.xFine || y!=selStart.y) {
|
||||||
curNibble=false;
|
curNibble=false;
|
||||||
|
@ -4379,6 +4505,7 @@ bool FurnaceGUI::loop() {
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginMenu("help")) {
|
if (ImGui::BeginMenu("help")) {
|
||||||
|
if (ImGui::MenuItem("debug menu")) debugOpen=!debugOpen;
|
||||||
if (ImGui::MenuItem("about...")) {
|
if (ImGui::MenuItem("about...")) {
|
||||||
aboutOpen=true;
|
aboutOpen=true;
|
||||||
aboutScroll=0;
|
aboutScroll=0;
|
||||||
|
@ -4413,6 +4540,7 @@ bool FurnaceGUI::loop() {
|
||||||
drawMixer();
|
drawMixer();
|
||||||
drawPattern();
|
drawPattern();
|
||||||
drawSettings();
|
drawSettings();
|
||||||
|
drawDebug();
|
||||||
|
|
||||||
if (ImGuiFileDialog::Instance()->Display("FileDialog",ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_NoMove,ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale))) {
|
if (ImGuiFileDialog::Instance()->Display("FileDialog",ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_NoMove,ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale))) {
|
||||||
if (ImGuiFileDialog::Instance()->IsOk()) {
|
if (ImGuiFileDialog::Instance()->IsOk()) {
|
||||||
|
@ -4994,6 +5122,9 @@ FurnaceGUI::FurnaceGUI():
|
||||||
soloTimeout(0),
|
soloTimeout(0),
|
||||||
orderEditMode(0),
|
orderEditMode(0),
|
||||||
orderCursor(-1),
|
orderCursor(-1),
|
||||||
|
loopOrder(-1),
|
||||||
|
loopRow(-1),
|
||||||
|
loopEnd(-1),
|
||||||
editControlsOpen(true),
|
editControlsOpen(true),
|
||||||
ordersOpen(true),
|
ordersOpen(true),
|
||||||
insListOpen(true),
|
insListOpen(true),
|
||||||
|
@ -5007,6 +5138,7 @@ FurnaceGUI::FurnaceGUI():
|
||||||
aboutOpen(false),
|
aboutOpen(false),
|
||||||
settingsOpen(false),
|
settingsOpen(false),
|
||||||
mixerOpen(false),
|
mixerOpen(false),
|
||||||
|
debugOpen(false),
|
||||||
selecting(false),
|
selecting(false),
|
||||||
curNibble(false),
|
curNibble(false),
|
||||||
orderNibble(false),
|
orderNibble(false),
|
||||||
|
|
|
@ -230,9 +230,10 @@ class FurnaceGUI {
|
||||||
char finalLayoutPath[4096];
|
char finalLayoutPath[4096];
|
||||||
|
|
||||||
int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor;
|
int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor;
|
||||||
|
int loopOrder, loopRow, loopEnd;
|
||||||
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
|
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
|
||||||
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
|
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
|
||||||
bool mixerOpen;
|
bool mixerOpen, debugOpen;
|
||||||
SelectionPoint selStart, selEnd, cursor;
|
SelectionPoint selStart, selEnd, cursor;
|
||||||
bool selecting, curNibble, orderNibble, extraChannelButtons, followOrders, followPattern, changeAllOrders;
|
bool selecting, curNibble, orderNibble, extraChannelButtons, followOrders, followPattern, changeAllOrders;
|
||||||
FurnaceGUIWindows curWindow;
|
FurnaceGUIWindows curWindow;
|
||||||
|
@ -313,6 +314,7 @@ class FurnaceGUI {
|
||||||
void drawMixer();
|
void drawMixer();
|
||||||
void drawAbout();
|
void drawAbout();
|
||||||
void drawSettings();
|
void drawSettings();
|
||||||
|
void drawDebug();
|
||||||
|
|
||||||
void syncSettings();
|
void syncSettings();
|
||||||
void commitSettings();
|
void commitSettings();
|
||||||
|
|
Loading…
Reference in New Issue