diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index d4ab9684b..9129c8740 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -1416,13 +1416,13 @@ const char* DivEngine::getEffectDesc(unsigned char effect, int chan) { case 0x03: return "03xx: Portamento"; case 0x04: - return "04xy: Vibrato"; + return "04xy: Vibrato (x: speed; y: depth)"; case 0x08: - return "08xy: Set panning"; + return "08xy: Set panning (x: left; y: right)"; case 0x09: return "09xx: Set speed 1"; case 0x0a: - return "0Axy: Volume slide"; + return "0Axy: Volume slide (0y: down; x0: up)"; case 0x0b: return "0Bxx: Jump to pattern"; case 0x0c: @@ -1431,18 +1431,20 @@ const char* DivEngine::getEffectDesc(unsigned char effect, int chan) { return "0Dxx: Jump to next pattern"; case 0x0f: return "0Fxx: Set speed 2"; + case 0xc0: case 0xc1: case 0xc2: case 0xc3: + return "Cxxx: Set tick rate"; case 0xe0: return "E0xx: Set arp speed"; case 0xe1: - return "E1xy: Note slide up"; + return "E1xy: Note slide up (x: speed; y: semitones)"; case 0xe2: - return "E2xy: Note slide down"; + return "E2xy: Note slide down (x: speed; y: semitones)"; case 0xe3: - return "E3xx: Set vibrato shape"; + return "E3xx: Set vibrato shape (0: up/down; 1: up only; 2: down only)"; case 0xe4: return "E4xx: Set vibrato range"; case 0xe5: - return "E5xx: Set pitch"; + return "E5xx: Set pitch (80: center)"; case 0xea: return "EAxx: Legato"; case 0xeb: @@ -1454,9 +1456,9 @@ const char* DivEngine::getEffectDesc(unsigned char effect, int chan) { case 0xee: return "EExx: Send external command"; case 0xef: - return "EFxx: Set global tuning"; + return "EFxx: Set global tuning (quirky!)"; case 0xff: - return "FFxx: Stop song"; + return "FFxx: Stop song (not implemented yet)"; default: if (chan>=0 && changetEffectName(effect); diff --git a/src/engine/platform/arcade.cpp b/src/engine/platform/arcade.cpp index b28dee1b6..3c5c68a1a 100644 --- a/src/engine/platform/arcade.cpp +++ b/src/engine/platform/arcade.cpp @@ -80,6 +80,63 @@ const char** DivPlatformArcade::getRegisterSheet() { return regCheatSheetOPM; } +const char* DivPlatformArcade::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xx: Set noise frequency (xx: value; 0 disables noise)"; + break; + case 0x11: + return "11xx: Set feedback (0 to 7)"; + break; + case 0x12: + return "12xx: Set level of operator 1 (0 highest, 7F lowest)"; + break; + case 0x13: + return "13xx: Set level of operator 2 (0 highest, 7F lowest)"; + break; + case 0x14: + return "14xx: Set level of operator 3 (0 highest, 7F lowest)"; + break; + case 0x15: + return "15xx: Set level of operator 4 (0 highest, 7F lowest)"; + break; + case 0x16: + return "16xy: Set operator multiplier (x: operator from 1 to 4; y: multiplier)"; + break; + case 0x17: + return "17xx: Set LFO speed"; + break; + case 0x18: + return "18xx: Set LFO waveform (0 saw, 1 square, 2 triangle, 3 noise)"; + break; + case 0x19: + return "19xx: Set attack of all operators (0 to 1F)"; + break; + case 0x1a: + return "1Axx: Set attack of operator 1 (0 to 1F)"; + break; + case 0x1b: + return "1Bxx: Set attack of operator 2 (0 to 1F)"; + break; + case 0x1c: + return "1Cxx: Set attack of operator 3 (0 to 1F)"; + break; + case 0x1d: + return "1Dxx: Set attack of operator 4 (0 to 1F)"; + break; + case 0x1e: + return "1Exx: Set AM depth (0 to 7F)"; + break; + case 0x1f: + return "1Fxx: Set PM depth (0 to 7F)"; + break; + case 0x20: + return "20xx: Set PCM frequency"; + break; + } + return NULL; +} + void DivPlatformArcade::acquire_nuked(short* bufL, short* bufR, size_t start, size_t len) { static int o[2]; diff --git a/src/engine/platform/arcade.h b/src/engine/platform/arcade.h index 3fa5bae45..19832b9f4 100644 --- a/src/engine/platform/arcade.h +++ b/src/engine/platform/arcade.h @@ -101,6 +101,7 @@ class DivPlatformArcade: public DivDispatch { void poke(unsigned int addr, unsigned short val); void poke(std::vector& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); ~DivPlatformArcade(); diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index 6c64fea30..b1fc04719 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -52,6 +52,36 @@ const char** DivPlatformAY8910::getRegisterSheet() { return regCheatSheetAY; } +const char* DivPlatformAY8910::getEffectName(unsigned char effect) { + switch (effect) { + case 0x20: + return "20xx: Set channel mode (bit 0: square; bit 1: noise; bit 2: envelope)"; + break; + case 0x21: + return "21xx: Set noise frequency (0 to 1F)"; + break; + case 0x22: + return "22xy: Set envelope mode (x: shape, y: enable for this channel)"; + break; + case 0x23: + return "23xx: Set envelope period low byte"; + break; + case 0x24: + return "24xx: Set envelope period high byte"; + break; + case 0x25: + return "25xx: Envelope slide up"; + break; + case 0x26: + return "26xx: Envelope slide down"; + break; + case 0x29: + return "29xy: Set auto-envelope (x: numerator; y: denominator)"; + break; + } + return NULL; +} + void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t len) { if (ayBufLen& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); }; diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index 4f531f4af..33347097e 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -64,6 +64,45 @@ const char** DivPlatformAY8930::getRegisterSheet() { return regCheatSheetAY8930; } +const char* DivPlatformAY8930::getEffectName(unsigned char effect) { + switch (effect) { + case 0x12: + return "12xx: Set duty cycle (0 to 8)"; + break; + case 0x20: + return "20xx: Set channel mode (bit 0: square; bit 1: noise; bit 2: envelope)"; + break; + case 0x21: + return "21xx: Set noise frequency (0 to 1F)"; + break; + case 0x22: + return "22xy: Set envelope mode (x: shape, y: enable for this channel)"; + break; + case 0x23: + return "23xx: Set envelope period low byte"; + break; + case 0x24: + return "24xx: Set envelope period high byte"; + break; + case 0x25: + return "25xx: Envelope slide up"; + break; + case 0x26: + return "26xx: Envelope slide down"; + break; + case 0x27: + return "27xx: Set noise AND mask"; + break; + case 0x28: + return "28xx: Set noise OR mask"; + break; + case 0x29: + return "29xy: Set auto-envelope (x: numerator; y: denominator)"; + break; + } + return NULL; +} + void DivPlatformAY8930::acquire(short* bufL, short* bufR, size_t start, size_t len) { if (ayBufLen& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); }; diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 30665fd0b..505f049a6 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -62,6 +62,52 @@ const char** DivPlatformC64::getRegisterSheet() { return regCheatSheetSID; } +const char* DivPlatformC64::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xx: Set waveform (bit 0: triangle; bit 1: saw; bit 2: pulse; bit 3: noise)"; + break; + case 0x11: + return "11xx: Set coarse cutoff (not recommended; use 4xxx instead)"; + break; + case 0x12: + return "12xx: Set coarse pulse width (not recommended; use 3xxx instead)"; + break; + case 0x13: + return "13xx: Set resonance (0 to F)"; + break; + case 0x14: + return "14xx: Set filter mode (bit 0: low pass; bit 1: band pass; bit 2: high pass)"; + break; + case 0x15: + return "15xx: Set envelope reset time"; + break; + case 0x1a: + return "1Axx: Disable envelope reset for this channel (1 disables; 0 enables)"; + break; + case 0x1b: + return "1Bxy: Reset cutoff (x: on new note; y: now)"; + break; + case 0x1c: + return "1Cxy: Reset pulse width (x: on new note; y: now)"; + break; + case 0x1e: + return "1Exy: Change additional parameters"; + break; + case 0x30: case 0x31: case 0x32: case 0x33: + case 0x34: case 0x35: case 0x36: case 0x37: + case 0x38: case 0x39: case 0x3a: case 0x3b: + case 0x3c: case 0x3d: case 0x3e: case 0x3f: + return "3xxx: Set pulse width (0 to FFF)"; + break; + case 0x40: case 0x41: case 0x42: case 0x43: + case 0x44: case 0x45: case 0x46: case 0x47: + return "4xxx: Set cutoff (0 to 7FF)"; + break; + } + return NULL; +} + void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len) { for (size_t i=start; i& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void setChipModel(bool is6581); void quit(); diff --git a/src/engine/platform/gb.cpp b/src/engine/platform/gb.cpp index 9d3ce1507..37905542c 100644 --- a/src/engine/platform/gb.cpp +++ b/src/engine/platform/gb.cpp @@ -61,6 +61,27 @@ const char** DivPlatformGB::getRegisterSheet() { return regCheatSheetGB; } +const char* DivPlatformGB::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xx: Change waveform"; + break; + case 0x11: + return "11xx: Set noise length (0: long; 1: short)"; + break; + case 0x12: + return "12xx: Set duty cycle (0 to 3)"; + break; + case 0x13: + return "13xy: Setup sweep (x: time; y: shift)"; + break; + case 0x14: + return "14xx: Set sweep direction (0: up; 1: down)"; + break; + } + return NULL; +} + void DivPlatformGB::acquire(short* bufL, short* bufR, size_t start, size_t len) { for (size_t i=start; i& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); ~DivPlatformGB(); diff --git a/src/engine/platform/genesis.cpp b/src/engine/platform/genesis.cpp index eb263c6d1..e580e2cc4 100644 --- a/src/engine/platform/genesis.cpp +++ b/src/engine/platform/genesis.cpp @@ -30,6 +30,57 @@ static unsigned char konOffs[6]={ #define CHIP_FREQBASE 9440540 +const char* DivPlatformGenesis::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xy: Setup LFO (x: enable; y: speed)"; + break; + case 0x11: + return "11xx: Set feedback (0 to 7)"; + break; + case 0x12: + return "12xx: Set level of operator 1 (0 highest, 7F lowest)"; + break; + case 0x13: + return "13xx: Set level of operator 2 (0 highest, 7F lowest)"; + break; + case 0x14: + return "14xx: Set level of operator 3 (0 highest, 7F lowest)"; + break; + case 0x15: + return "15xx: Set level of operator 4 (0 highest, 7F lowest)"; + break; + case 0x16: + return "16xy: Set operator multiplier (x: operator from 1 to 4; y: multiplier)"; + break; + case 0x17: + return "17xx: Enable channel 6 DAC"; + break; + case 0x18: + return "18xx: Toggle extended channel 3 mode"; + break; + case 0x19: + return "19xx: Set attack of all operators (0 to 1F)"; + break; + case 0x1a: + return "1Axx: Set attack of operator 1 (0 to 1F)"; + break; + case 0x1b: + return "1Bxx: Set attack of operator 2 (0 to 1F)"; + break; + case 0x1c: + return "1Cxx: Set attack of operator 3 (0 to 1F)"; + break; + case 0x1d: + return "1Dxx: Set attack of operator 4 (0 to 1F)"; + break; + case 0x20: + return "20xy: Set PSG noise mode (x: preset freq/ch3 freq; y: thin pulse/noise)"; + break; + } + return NULL; +} + void DivPlatformGenesis::acquire_nuked(short* bufL, short* bufR, size_t start, size_t len) { static short o[2]; static int os[2]; diff --git a/src/engine/platform/genesis.h b/src/engine/platform/genesis.h index f7f70da31..4ea6c41e5 100644 --- a/src/engine/platform/genesis.h +++ b/src/engine/platform/genesis.h @@ -121,6 +121,7 @@ class DivPlatformGenesis: public DivDispatch { int getPortaFloor(int ch); void poke(unsigned int addr, unsigned short val); void poke(std::vector& wlist); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); ~DivPlatformGenesis(); diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index 637342a6d..aeb817929 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -55,6 +55,21 @@ const char** DivPlatformNES::getRegisterSheet() { return regCheatSheetNES; } +const char* DivPlatformNES::getEffectName(unsigned char effect) { + switch (effect) { + case 0x12: + return "12xx: Set duty cycle/noise mode (pulse: 0 to 3; noise: 0 or 1)"; + break; + case 0x13: + return "13xy: Sweep up (x: time; y: shift)"; + break; + case 0x14: + return "14xy: Sweep down (x: time; y: shift)"; + break; + } + return NULL; +} + void DivPlatformNES::acquire(short* bufL, short* bufR, size_t start, size_t len) { for (size_t i=start; i& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); ~DivPlatformNES(); diff --git a/src/engine/platform/pce.cpp b/src/engine/platform/pce.cpp index f489e4e27..df11d6daf 100644 --- a/src/engine/platform/pce.cpp +++ b/src/engine/platform/pce.cpp @@ -52,6 +52,27 @@ const char** DivPlatformPCE::getRegisterSheet() { return regCheatSheetPCE; } +const char* DivPlatformPCE::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xx: Change waveform"; + break; + case 0x11: + return "11xx: Toggle noise mode"; + break; + case 0x12: + return "12xx: Setup LFO (0: disabled; 1: 1x depth; 2: 16x depth; 3: 256x depth)"; + break; + case 0x13: + return "13xx: Set LFO speed"; + break; + case 0x17: + return "17xx: Toggle PCM mode"; + break; + } + return NULL; +} + void DivPlatformPCE::acquire(short* bufL, short* bufR, size_t start, size_t len) { for (size_t h=start; h& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); ~DivPlatformPCE(); diff --git a/src/engine/platform/saa.cpp b/src/engine/platform/saa.cpp index 737167f98..f5d640b71 100644 --- a/src/engine/platform/saa.cpp +++ b/src/engine/platform/saa.cpp @@ -56,6 +56,21 @@ const char** DivPlatformSAA1099::getRegisterSheet() { return regCheatSheetSAA; } +const char* DivPlatformSAA1099::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xy: Set channel mode (x: noise; y: tone)"; + break; + case 0x11: + return "11xx: Set noise frequency"; + break; + case 0x12: + return "12xx: Setup envelope (refer to docs for more information)"; + break; + } + return NULL; +} + void DivPlatformSAA1099::acquire_mame(short* bufL, short* bufR, size_t start, size_t len) { if (saaBufLenSetClockRate(chipClock); saa_saaSound->SetSampleRate(rate); - - printf("rate: %ld bytes %d params %lx\n",saa_saaSound->GetCurrentSampleRate(),saa_saaSound->GetCurrentBytesPerSample(),saa_saaSound->GetCurrentSoundParameters()); break; case DIV_SAA_CORE_E: break; diff --git a/src/engine/platform/saa.h b/src/engine/platform/saa.h index 7db07d629..0ac8211aa 100644 --- a/src/engine/platform/saa.h +++ b/src/engine/platform/saa.h @@ -98,6 +98,7 @@ class DivPlatformSAA1099: public DivDispatch { void poke(unsigned int addr, unsigned short val); void poke(std::vector& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); }; diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 1e54c743a..325665003 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -34,6 +34,15 @@ const char** DivPlatformSMS::getRegisterSheet() { return regCheatSheetSN; } +const char* DivPlatformSMS::getEffectName(unsigned char effect) { + switch (effect) { + case 0x20: + return "20xy: Set noise mode (x: preset freq/ch3 freq; y: thin pulse/noise)"; + break; + } + return NULL; +} + void DivPlatformSMS::acquire(short* bufL, short* bufR, size_t start, size_t len) { sn->sound_stream_update(bufL+start,len); } diff --git a/src/engine/platform/sms.h b/src/engine/platform/sms.h index 0ea736efa..b49a5e276 100644 --- a/src/engine/platform/sms.h +++ b/src/engine/platform/sms.h @@ -73,6 +73,7 @@ class DivPlatformSMS: public DivDispatch { void poke(unsigned int addr, unsigned short val); void poke(std::vector& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); ~DivPlatformSMS(); diff --git a/src/engine/platform/tia.cpp b/src/engine/platform/tia.cpp index 3987845b9..9f97a7e5f 100644 --- a/src/engine/platform/tia.cpp +++ b/src/engine/platform/tia.cpp @@ -34,6 +34,15 @@ const char* regCheatSheetTIA[]={ NULL }; +const char* DivPlatformTIA::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xx: Select shape (0 to F)"; + break; + } + return NULL; +} + const char** DivPlatformTIA::getRegisterSheet() { return regCheatSheetTIA; } diff --git a/src/engine/platform/tia.h b/src/engine/platform/tia.h index d6f6e0a4d..91d5ab452 100644 --- a/src/engine/platform/tia.h +++ b/src/engine/platform/tia.h @@ -57,6 +57,7 @@ class DivPlatformTIA: public DivDispatch { void poke(unsigned int addr, unsigned short val); void poke(std::vector& wlist); const char** getRegisterSheet(); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); }; diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index e889563f4..a9d59f63c 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -32,6 +32,75 @@ static unsigned char konOffs[4]={ #define CHIP_DIVIDER 32 +const char* DivPlatformYM2610::getEffectName(unsigned char effect) { + switch (effect) { + case 0x10: + return "10xy: Setup LFO (x: enable; y: speed)"; + break; + case 0x11: + return "11xx: Set feedback (0 to 7)"; + break; + case 0x12: + return "12xx: Set level of operator 1 (0 highest, 7F lowest)"; + break; + case 0x13: + return "13xx: Set level of operator 2 (0 highest, 7F lowest)"; + break; + case 0x14: + return "14xx: Set level of operator 3 (0 highest, 7F lowest)"; + break; + case 0x15: + return "15xx: Set level of operator 4 (0 highest, 7F lowest)"; + break; + case 0x16: + return "16xy: Set operator multiplier (x: operator from 1 to 4; y: multiplier)"; + break; + case 0x18: + return "18xx: Toggle extended channel 3 mode"; + break; + case 0x19: + return "19xx: Set attack of all operators (0 to 1F)"; + break; + case 0x1a: + return "1Axx: Set attack of operator 1 (0 to 1F)"; + break; + case 0x1b: + return "1Bxx: Set attack of operator 2 (0 to 1F)"; + break; + case 0x1c: + return "1Cxx: Set attack of operator 3 (0 to 1F)"; + break; + case 0x1d: + return "1Dxx: Set attack of operator 4 (0 to 1F)"; + break; + case 0x20: + return "20xx: Set SSG channel mode (bit 0: square; bit 1: noise; bit 2: envelope)"; + break; + case 0x21: + return "21xx: Set SSG noise frequency (0 to 1F)"; + break; + case 0x22: + return "22xy: Set SSG envelope mode (x: shape, y: enable for this channel)"; + break; + case 0x23: + return "23xx: Set SSG envelope period low byte"; + break; + case 0x24: + return "24xx: Set SSG envelope period high byte"; + break; + case 0x25: + return "25xx: SSG envelope slide up"; + break; + case 0x26: + return "26xx: SSG envelope slide down"; + break; + case 0x29: + return "29xy: Set SSG auto-envelope (x: numerator; y: denominator)"; + break; + } + return NULL; +} + void DivPlatformYM2610::acquire(short* bufL, short* bufR, size_t start, size_t len) { static int os[2]; diff --git a/src/engine/platform/ym2610.h b/src/engine/platform/ym2610.h index aae34509a..0dea2ccf8 100644 --- a/src/engine/platform/ym2610.h +++ b/src/engine/platform/ym2610.h @@ -98,6 +98,7 @@ class DivPlatformYM2610: public DivDispatch { void notifyInsDeletion(void* ins); void poke(unsigned int addr, unsigned short val); void poke(std::vector& wlist); + const char* getEffectName(unsigned char effect); int init(DivEngine* parent, int channels, int sugRate, unsigned int flags); void quit(); ~DivPlatformYM2610(); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 32762de2f..73ebf41a8 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3921,6 +3921,20 @@ void FurnaceGUI::drawSettings() { ImGui::Separator(); + ImGui::Text("Status bar:"); + if (ImGui::RadioButton("Cursor details##sbar0",settings.statusDisplay==0)) { + settings.statusDisplay=0; + } + if (ImGui::RadioButton("File path##sbar1",settings.statusDisplay==1)) { + settings.statusDisplay=1; + } + if (ImGui::RadioButton("Cursor details or file path##sbar2",settings.statusDisplay==2)) { + settings.statusDisplay=2; + } + if (ImGui::RadioButton("Nothing##sbar3",settings.statusDisplay==3)) { + settings.statusDisplay=3; + } + ImGui::Text("Play/edit controls layout:"); if (ImGui::RadioButton("Classic##ecl0",settings.controlLayout==0)) { settings.controlLayout=0; @@ -4300,6 +4314,7 @@ void FurnaceGUI::syncSettings() { settings.forceMono=e->getConfInt("forceMono",0); settings.controlLayout=e->getConfInt("controlLayout",0); settings.restartOnFlagChange=e->getConfInt("restartOnFlagChange",1); + settings.statusDisplay=e->getConfInt("statusDisplay",0); // keybinds LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o); @@ -4489,6 +4504,7 @@ void FurnaceGUI::commitSettings() { e->setConf("forceMono",settings.forceMono); e->setConf("controlLayout",settings.controlLayout); e->setConf("restartOnFlagChange",settings.restartOnFlagChange); + e->setConf("statusDisplay",settings.statusDisplay); PUT_UI_COLOR(GUI_COLOR_BACKGROUND); PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND); @@ -7748,7 +7764,61 @@ bool FurnaceGUI::loop() { int totalSeconds=e->getTotalSeconds(); ImGui::Text("| Speed %d:%d @ %dHz | Order %d/%d | Row %d/%d | %d:%.2d:%.2d.%.2d",e->getSpeed1(),e->getSpeed2(),e->getCurHz(),e->getOrder(),e->song.ordersLen,e->getRow(),e->song.patLen,totalSeconds/3600,(totalSeconds/60)%60,totalSeconds%60,totalTicks/10000); } else { - if (curFileName!="") ImGui::Text("| %s",curFileName.c_str()); + bool hasInfo=false; + String info; + if (cursor.xCoarse>=0 && cursor.xCoarsegetTotalChannelCount()) { + DivPattern* p=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][e->getOrder()],false); + if (cursor.xFine>=0) switch (cursor.xFine) { + case 0: // note + if (p->data[cursor.y][0]>0) { + if (p->data[cursor.y][0]==100) { + info=fmt::sprintf("Note off (cut)"); + } else if (p->data[cursor.y][0]==101) { + info=fmt::sprintf("Note off (release)"); + } else if (p->data[cursor.y][0]==102) { + info=fmt::sprintf("Macro release only"); + } else { + info=fmt::sprintf("Note on: %s",noteName(p->data[cursor.y][0],p->data[cursor.y][1])); + } + hasInfo=true; + } + break; + case 1: // instrument + if (p->data[cursor.y][2]>-1) { + if (p->data[cursor.y][2]>=(int)e->song.ins.size()) { + info=fmt::sprintf("Ins %d: ",p->data[cursor.y][2]); + } else { + DivInstrument* ins=e->getIns(p->data[cursor.y][2]); + info=fmt::sprintf("Ins %d: %s",p->data[cursor.y][2],ins->name); + } + hasInfo=true; + } + break; + case 2: // volume + if (p->data[cursor.y][3]>-1) { + int maxVol=e->getMaxVolumeChan(cursor.xCoarse); + if (maxVol<1 || p->data[cursor.y][3]>maxVol) { + info=fmt::sprintf("Set volume: %d (%.2X, INVALID!)",p->data[cursor.y][3],p->data[cursor.y][3]); + } else { + info=fmt::sprintf("Set volume: %d (%.2X, %d%%)",p->data[cursor.y][3],p->data[cursor.y][3],(p->data[cursor.y][3]*100)/maxVol); + } + hasInfo=true; + } + break; + default: // effect + int actualCursor=((cursor.xFine+1)&(~1)); + if (p->data[cursor.y][actualCursor]>-1) { + info=e->getEffectDesc(p->data[cursor.y][actualCursor],cursor.xCoarse); + hasInfo=true; + } + break; + } + } + if (hasInfo && (settings.statusDisplay==0 || settings.statusDisplay==2)) { + ImGui::Text("| %s",info.c_str()); + } else if (settings.statusDisplay==1 || settings.statusDisplay==2) { + if (curFileName!="") ImGui::Text("| %s",curFileName.c_str()); + } } ImGui::PopStyleColor(); if (modified) { diff --git a/src/gui/gui.h b/src/gui/gui.h index cd5aacbb8..507959554 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -425,6 +425,7 @@ class FurnaceGUI { int forceMono; int controlLayout; int restartOnFlagChange; + int statusDisplay; unsigned int maxUndoSteps; String mainFontPath; String patFontPath; @@ -462,6 +463,7 @@ class FurnaceGUI { forceMono(0), controlLayout(0), restartOnFlagChange(1), + statusDisplay(0), maxUndoSteps(100), mainFontPath(""), patFontPath(""),