From 7efc84592bec21603733dfcd0cb9c597fe44f062 Mon Sep 17 00:00:00 2001 From: YohananDiamond Date: Mon, 3 Jul 2023 17:43:00 -0300 Subject: [PATCH 1/7] Exit with ESC --- extern/igfd/ImGuiFileDialogConfig.h | 4 ++-- src/gui/newSong.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extern/igfd/ImGuiFileDialogConfig.h b/extern/igfd/ImGuiFileDialogConfig.h index 4a212b600..8f06588a8 100644 --- a/extern/igfd/ImGuiFileDialogConfig.h +++ b/extern/igfd/ImGuiFileDialogConfig.h @@ -36,8 +36,8 @@ //#define IGFD_KEY_BACKSPACE GLFW_KEY_BACKSPACE // by ex you can quit the dialog by pressing the key excape -//#define USE_DIALOG_EXIT_WITH_KEY -//#define IGFD_EXIT_KEY GLFW_KEY_ESCAPE +#define USE_DIALOG_EXIT_WITH_KEY +#define IGFD_EXIT_KEY ImGuiKey_Escape // widget // filter combobox width diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 735f8bfb0..fd7eace75 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -140,7 +140,7 @@ void FurnaceGUI::drawNewSong() { ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } From f0e7be79d594a4aaa050ccdfe3436a2cca74f137 Mon Sep 17 00:00:00 2001 From: YohananDiamond Date: Tue, 11 Jul 2023 11:14:35 -0300 Subject: [PATCH 2/7] dialog nitpicks: more close-with-esc --- src/gui/gui.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 6eefb6913..4399c4606 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5252,7 +5252,7 @@ bool FurnaceGUI::loop() { quit=true; } ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } break; @@ -5276,7 +5276,7 @@ bool FurnaceGUI::loop() { displayNew=true; } ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } break; @@ -5300,7 +5300,7 @@ bool FurnaceGUI::loop() { openFileDialog(GUI_FILE_OPEN); } ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } break; @@ -5324,7 +5324,7 @@ bool FurnaceGUI::loop() { openFileDialog(GUI_FILE_OPEN_BACKUP); } ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } break; @@ -5355,7 +5355,7 @@ bool FurnaceGUI::loop() { nextFile=""; } ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); nextFile=""; } @@ -5409,7 +5409,7 @@ bool FurnaceGUI::loop() { syncSettings(); } ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } break; @@ -5496,7 +5496,7 @@ bool FurnaceGUI::loop() { ImGui::CloseCurrentPopup(); } - if (ImGui::Button("Wait! What am I doing? Cancel!")) { + if (ImGui::Button("Wait! What am I doing? Cancel!") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } break; @@ -5647,7 +5647,7 @@ bool FurnaceGUI::loop() { ImGui::EndDisabled(); ImGui::SameLine(); } - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { for (std::pair& i: pendingIns) { i.second=false; } @@ -5719,7 +5719,7 @@ bool FurnaceGUI::loop() { ImGui::CloseCurrentPopup(); } ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); From e8130caa5211389c263ba8cec0a6ef9a89446d17 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 11 Jul 2023 17:21:51 -0500 Subject: [PATCH 3/7] C64: fix dSID multi-chip --- src/engine/platform/c64.cpp | 18 ++++++++++++++++++ src/engine/platform/c64.h | 1 + src/engine/platform/sound/c64_d/dsid.c | 19 +++++++++++-------- src/engine/platform/sound/c64_d/dsid.h | 2 ++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index b41a52d5e..028bb94d3 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -613,6 +613,24 @@ void DivPlatformC64::setFlags(const DivConfig& flags) { keyPriority=flags.getBool("keyPriority",true); testAD=((flags.getInt("testAttack",0)&15)<<4)|(flags.getInt("testDecay",0)&15); testSR=((flags.getInt("testSustain",0)&15)<<4)|(flags.getInt("testRelease",0)&15); + + // init fake filter table + // taken from dSID + double cutRatio=-2.0*3.14*(sidIs6581?(((double)oscBuf[0]->rate/44100.0)*(20000.0/256.0)):(12500.0/256.0))/(double)oscBuf[0]->rate; + + for (int i=0; i<2048; i++) { + double c=(double)i/8.0+0.2; + if (sidIs6581) { + if (c<24) { + c=2.0*sin(771.78/(double)oscBuf[0]->rate); + } else { + c=(44100.0/(double)oscBuf[0]->rate)-1.263*(44100.0/(double)oscBuf[0]->rate)*exp(c*cutRatio); + } + } else { + c=1-exp(c*cutRatio); + } + fakeCutTable[i]=c; + } } int DivPlatformC64::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) { diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index 26b39c804..44db167d6 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -56,6 +56,7 @@ class DivPlatformC64: public DivDispatch { Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; bool isMuted[3]; + float fakeCutTable[2048]; struct QueuedWrite { unsigned char addr; unsigned char val; diff --git a/src/engine/platform/sound/c64_d/dsid.c b/src/engine/platform/sound/c64_d/dsid.c index d01dc7ad7..2ff2dacf8 100644 --- a/src/engine/platform/sound/c64_d/dsid.c +++ b/src/engine/platform/sound/c64_d/dsid.c @@ -115,11 +115,17 @@ void dSID_init(struct SID_chip* sid, double clockRate, double samplingRate, int double prd0 = sid->g.ckr > 9 ? sid->g.ckr : 9; sid->g.Aprd[0] = prd0; sid->g.Astp[0] = ceil(prd0 / 9); + + for (int i=0; i<3; i++) { + sid->fakeplp[i]=0; + sid->fakepbp[i]=0; + } } double dSID_render(struct SID_chip* sid) { double flin = 0, output = 0; double wfout = 0; + double step = 0; for (int chn = 0; chn < 3; chn++) { struct SIDVOICE *voic = &((struct SIDMEM *) (sid->M))->v[chn]; double pgt = (sid->SIDct->ch[chn].Ast & GAT); @@ -142,7 +148,6 @@ double dSID_render(struct SID_chip* sid) { if (sid->SIDct->ch[chn].rcnt >= 0x8000) sid->SIDct->ch[chn].rcnt -= 0x8000; - static double step; double prd; if (sid->SIDct->ch[chn].Ast & ATK) { @@ -291,8 +296,6 @@ double dSID_render(struct SID_chip* sid) { // mostly copypasted from below double fakeflin = chnout; double fakeflout = 0; - static double fakeplp[3] = {0}; - static double fakepbp[3] = {0}; double ctf = sid->g.ctf_table[((sid->M[0x15]&7)|(sid->M[0x16]<<3))&0x7ff]; double reso; if (sid->g.model == 8580) { @@ -300,15 +303,15 @@ double dSID_render(struct SID_chip* sid) { } else { reso = (sid->M[0x17] > 0x5F) ? 8.0 / (double) (sid->M[0x17] >> 4) : 1.41; } - double tmp = fakeflin + fakepbp[chn] * reso + fakeplp[chn]; + double tmp = fakeflin + sid->fakepbp[chn] * reso + sid->fakeplp[chn]; if (sid->M[0x18] & HP) fakeflout -= tmp; - tmp = fakepbp[chn] - tmp * ctf; - fakepbp[chn] = tmp; + tmp = sid->fakepbp[chn] - tmp * ctf; + sid->fakepbp[chn] = tmp; if (sid->M[0x18] & BP) fakeflout -= tmp; - tmp = fakeplp[chn] + tmp * ctf; - fakeplp[chn] = tmp; + tmp = sid->fakeplp[chn] + tmp * ctf; + sid->fakeplp[chn] = tmp; if (sid->M[0x18] & LP) fakeflout += tmp; diff --git a/src/engine/platform/sound/c64_d/dsid.h b/src/engine/platform/sound/c64_d/dsid.h index b02d1870e..b17a51f55 100644 --- a/src/engine/platform/sound/c64_d/dsid.h +++ b/src/engine/platform/sound/c64_d/dsid.h @@ -81,6 +81,8 @@ struct SID_chip { uint8_t M[MemLen]; int16_t lastOut[3]; int mute_mask; + double fakeplp[3]; + double fakepbp[3]; }; double dSID_render(struct SID_chip* sid); From 6ce45593cfbb51e554c147f0efa0f6776d51ab95 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 11 Jul 2023 18:11:48 -0500 Subject: [PATCH 4/7] C64: per-chan osc filters and volume --- src/engine/platform/c64.cpp | 49 ++++++++++++++++++++++++++++++++----- src/engine/platform/c64.h | 4 +++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 028bb94d3..5c1521aba 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -64,6 +64,41 @@ const char** DivPlatformC64::getRegisterSheet() { return regCheatSheetSID; } +short DivPlatformC64::runFakeFilter(unsigned char ch, int in) { + if (!(regPool[0x17]&(1<0x5F)?8.0/(float)(regPool[0x17]>>4):1.41): + (pow(2,((float)(4-(float)(regPool[0x17]>>4))/8))) + ); + float tmp=fin+fakeBand[ch]*reso+fakeLow[ch]; + if (regPool[0x18]&0x40) { + fout-=tmp; + } + tmp=fakeBand[ch]-tmp*ctf; + fakeBand[ch]=tmp; + if (regPool[0x18]&0x20) { + fout-=tmp; + } + tmp=fakeLow[ch]+tmp*ctf; + fakeLow[ch]=tmp; + if (regPool[0x18]&0x10) { + fout+=tmp; + } + + fout*=(float)(regPool[0x18]&15)/20.0f; + return CLAMP(fout,-32768,32767); +} + void DivPlatformC64::acquire(short** buf, size_t len) { int dcOff=(sidCore)?0:sid->get_dc(0); for (size_t i=0; iclock(4,&buf[0][i]); if (++writeOscBuf>=4) { writeOscBuf=0; - oscBuf[0]->data[oscBuf[0]->needle++]=(sid_fp->lastChanOut[0]-dcOff)>>5; - oscBuf[1]->data[oscBuf[1]->needle++]=(sid_fp->lastChanOut[1]-dcOff)>>5; - oscBuf[2]->data[oscBuf[2]->needle++]=(sid_fp->lastChanOut[2]-dcOff)>>5; + oscBuf[0]->data[oscBuf[0]->needle++]=runFakeFilter(0,(sid_fp->lastChanOut[0]-dcOff)>>5); + oscBuf[1]->data[oscBuf[1]->needle++]=runFakeFilter(1,(sid_fp->lastChanOut[1]-dcOff)>>5); + oscBuf[2]->data[oscBuf[2]->needle++]=runFakeFilter(2,(sid_fp->lastChanOut[2]-dcOff)>>5); } } else { sid->clock(); buf[0][i]=sid->output(); if (++writeOscBuf>=16) { writeOscBuf=0; - oscBuf[0]->data[oscBuf[0]->needle++]=(sid->last_chan_out[0]-dcOff)>>5; - oscBuf[1]->data[oscBuf[1]->needle++]=(sid->last_chan_out[1]-dcOff)>>5; - oscBuf[2]->data[oscBuf[2]->needle++]=(sid->last_chan_out[2]-dcOff)>>5; + oscBuf[0]->data[oscBuf[0]->needle++]=runFakeFilter(0,(sid->last_chan_out[0]-dcOff)>>5); + oscBuf[1]->data[oscBuf[1]->needle++]=runFakeFilter(1,(sid->last_chan_out[1]-dcOff)>>5); + oscBuf[2]->data[oscBuf[2]->needle++]=runFakeFilter(2,(sid->last_chan_out[2]-dcOff)>>5); } } } @@ -540,6 +575,8 @@ void DivPlatformC64::reset() { for (int i=0; i<3; i++) { chan[i]=DivPlatformC64::Channel(); chan[i].std.setEngine(parent); + fakeLow[i]=0; + fakeBand[i]=0; } if (sidCore==2) { diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index 44db167d6..5f67b956a 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -56,6 +56,8 @@ class DivPlatformC64: public DivDispatch { Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; bool isMuted[3]; + float fakeLow[3]; + float fakeBand[3]; float fakeCutTable[2048]; struct QueuedWrite { unsigned char addr; @@ -81,6 +83,8 @@ class DivPlatformC64: public DivDispatch { friend void putDispatchChip(void*,int); friend void putDispatchChan(void*,int,int); + inline short runFakeFilter(unsigned char ch, int in); + void acquire_classic(short* bufL, short* bufR, size_t start, size_t len); void acquire_fp(short* bufL, short* bufR, size_t start, size_t len); From 4bc2a28760070d25c76240779593ba06870d6ee9 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 11 Jul 2023 19:30:13 -0500 Subject: [PATCH 5/7] GUI: fix memory leak in backup task issue #1233 --- src/gui/gui.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 6eefb6913..1d3737f0a 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5849,13 +5849,12 @@ bool FurnaceGUI::loop() { if (outFile!=NULL) { if (fwrite(w->getFinalBuf(),1,w->size(),outFile)!=w->size()) { logW("did not write backup entirely: %s!",strerror(errno)); - w->finish(); } fclose(outFile); } else { logW("could not save backup: %s!",strerror(errno)); - w->finish(); } + w->finish(); // delete previous backup if there are too many delFirstBackup(backupBaseName); From 86739649d0d5abab2d80adef8946f57d24c1c7be Mon Sep 17 00:00:00 2001 From: NyaongI <100076733+kitt3n69420@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:00:13 +0900 Subject: [PATCH 6/7] New 2 Demo songs (#1235) * New T6W28 Demo song * Delete RunningOnThePlayground_2xT6W28.fur Not here * New T6W28 Demo song * New OPLL Demo song * Adding 18 New OPLL Instruments * New AY8930 Demo song * New SMS (SN7 only) Demo song --- demos/ay8930/AY8930Shuffle.fur | Bin 0 -> 3095 bytes demos/sms/FlowOfSN7.fur | Bin 0 -> 5252 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 demos/ay8930/AY8930Shuffle.fur create mode 100644 demos/sms/FlowOfSN7.fur diff --git a/demos/ay8930/AY8930Shuffle.fur b/demos/ay8930/AY8930Shuffle.fur new file mode 100644 index 0000000000000000000000000000000000000000..68931cf09d4377fe017a4ed69a689d29f67f1bd7 GIT binary patch literal 3095 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 literal 0 HcmV?d00001 From 90b76d20e3396823572646b18fa25a7a142e4f20 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 12 Jul 2023 06:04:37 -0500 Subject: [PATCH 7/7] C64: fix reSIDfp muting --- src/engine/platform/sound/c64_fp/SID.cpp | 6 +++--- src/engine/platform/sound/c64_fp/SID.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/engine/platform/sound/c64_fp/SID.cpp b/src/engine/platform/sound/c64_fp/SID.cpp index a996d2230..03c778c90 100644 --- a/src/engine/platform/sound/c64_fp/SID.cpp +++ b/src/engine/platform/sound/c64_fp/SID.cpp @@ -351,7 +351,7 @@ void SID::write(int offset, unsigned char value) break; case 0x04: // Voice #1 control register - voice[0]->writeCONTROL_REG(muted[0] ? 0 : value); + voice[0]->writeCONTROL_REG(value); break; case 0x05: // Voice #1 Attack and Decay length @@ -379,7 +379,7 @@ void SID::write(int offset, unsigned char value) break; case 0x0b: // Voice #2 control register - voice[1]->writeCONTROL_REG(muted[1] ? 0 : value); + voice[1]->writeCONTROL_REG(value); break; case 0x0c: // Voice #2 Attack and Decay length @@ -407,7 +407,7 @@ void SID::write(int offset, unsigned char value) break; case 0x12: // Voice #3 control register - voice[2]->writeCONTROL_REG(muted[2] ? 0 : value); + voice[2]->writeCONTROL_REG(value); break; case 0x13: // Voice #3 Attack and Decay length diff --git a/src/engine/platform/sound/c64_fp/SID.h b/src/engine/platform/sound/c64_fp/SID.h index 85b6a4e4d..77d7706d4 100644 --- a/src/engine/platform/sound/c64_fp/SID.h +++ b/src/engine/platform/sound/c64_fp/SID.h @@ -320,11 +320,11 @@ int SID::output() const int v2 = voice[1]->output(voice[0]->wave()); const int v3 = voice[2]->output(voice[1]->wave()); - lastChanOut[0]=v1; - lastChanOut[1]=v2; - lastChanOut[2]=v3; + lastChanOut[0]=muted[0]?0:v1; + lastChanOut[1]=muted[1]?0:v2; + lastChanOut[2]=muted[2]?0:v3; - return externalFilter->clock(filter->clock(v1, v2, v3)); + return externalFilter->clock(filter->clock(muted[0]?0:v1, muted[1]?0:v2, muted[2]?0:v3)); }