From 21c888de88051a86f0af30b043ee4f0a9f6e3e3c Mon Sep 17 00:00:00 2001 From: Swirly Date: Thu, 19 Dec 2024 12:50:39 -0600 Subject: [PATCH 1/7] fuck i cant rename files from here and im too lazy jkgfdskfgsdkfgsdf aaaaaaaaaaaaaaaaaaaaaaaaaaa --- instruments/OPN/guitar/distortion2.fui | Bin 0 -> 140 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 instruments/OPN/guitar/distortion2.fui diff --git a/instruments/OPN/guitar/distortion2.fui b/instruments/OPN/guitar/distortion2.fui new file mode 100644 index 0000000000000000000000000000000000000000..21380695728355354f2954156709e2f412d4549f GIT binary patch literal 140 zcmZ?s^b5Yvz{ud|=*|$3nVg-PqLEpgp{d}KSzMA|RFavW2jRPyW|kxtLD(9(iOEIz z#R`c0|1j4B*Xv! literal 0 HcmV?d00001 From 95f0f36ad00a5bb4fab07e08cfdf1f9354f38920 Mon Sep 17 00:00:00 2001 From: Swirly Date: Thu, 19 Dec 2024 18:56:14 -0600 Subject: [PATCH 2/7] sdgdfsdfsh dfhdffdh --- instruments/OPN/guitar/distortion2.fui | Bin 140 -> 140 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/instruments/OPN/guitar/distortion2.fui b/instruments/OPN/guitar/distortion2.fui index 21380695728355354f2954156709e2f412d4549f..c108bf2cc9dfcde64c2f6de52c1c47b96fc1385b 100644 GIT binary patch delta 56 zcmeBS>|vY`ZOFhN&*5dyz+k~I&jq3xx#hVWfOLY0JcFwx1B0(4F9QbyC)5A`42%qn HY^?tQ19J&o delta 56 zcmeBS>|vY`ZRp4#&*31zz>p#&&*f^*z`)2Y&*cE54TR(wTrC+Gd>wfiI2bsY{{LrS KWME`t{SN>K`3YSB From 674d3c6b1288c25ccafdb3c0043e9dd89275c23b Mon Sep 17 00:00:00 2001 From: yohannd1 Date: Thu, 19 Dec 2024 17:27:13 -0300 Subject: [PATCH 3/7] fix code style for FurnaceGUI::doPasteMPT --- src/gui/editing.cpp | 245 +++++++++++++++----------------------------- 1 file changed, 85 insertions(+), 160 deletions(-) diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index 19ecaede9..b7aa730ad 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -902,9 +902,7 @@ unsigned int convertEffectMPT_MPTM(unsigned char symbol, unsigned int val) { return convertEffectMPT_IT(symbol,val); } -// TODO: fix code style -void FurnaceGUI::doPasteMPT(PasteMode mode, int arg, bool readClipboard, String clipb, std::vector data, int mptFormat, UndoRegion ur) -{ +void FurnaceGUI::doPasteMPT(PasteMode mode, int arg, bool readClipboard, String clipb, std::vector data, int mptFormat, UndoRegion ur) { DETERMINE_LAST; int j=cursor.y; @@ -913,35 +911,27 @@ void FurnaceGUI::doPasteMPT(PasteMode mode, int arg, bool readClipboard, String memset(note,0,4); - for(size_t i=1; icurSubSong->patLen; i++) - { + for (size_t i=1; icurSubSong->patLen; i++) { size_t charPos=1; int iCoarse=cursor.xCoarse; int iFine=0; - String& line=data[i]; - - while (charPoscurPat[iCoarse].getPattern(e->curOrders->ord[iCoarse][curOrder],true); - if (line[charPos]=='|' && charPos != 0) // MPT format starts every pattern line with '|' - { + if (line[charPos]=='|' && charPos!=0) { // MPT format starts every pattern line with '|' iCoarse++; - - if (iCoarsecurSubSong->chanShow[iCoarse]) - { - iCoarse++; - if (iCoarse>=lastChannel) break; + if (iCoarsecurSubSong->chanShow[iCoarse]) { + iCoarse++; + if (iCoarse>=lastChannel) break; + } } - iFine=0; charPos++; continue; } - if (iFine==0) // note - { - if (charPos>=line.size()) - { + if (iFine==0) { // note + if (charPos>=line.size()) { invalidData=true; break; } @@ -963,228 +953,167 @@ void FurnaceGUI::doPasteMPT(PasteMode mode, int arg, bool readClipboard, String continue; } - if (strcmp(note,"...")==0 || strcmp(note," ")==0) - { + if (strcmp(note,"...")==0 || strcmp(note," ")==0) { // do nothing. - } - - else - { - if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_INS_BG) || (pat->data[j][0]==0 && pat->data[j][1]==0)) - { - if (!decodeNote(note,pat->data[j][0],pat->data[j][1])) - { - if(strcmp(note, "^^^") == 0) - { + } else { + if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_INS_BG) || (pat->data[j][0]==0 && pat->data[j][1]==0)) { + if (!decodeNote(note,pat->data[j][0],pat->data[j][1])) { + if (strcmp(note, "^^^")==0) { pat->data[j][0]=100; pat->data[j][1]=0; - } - else if(strcmp(note, "~~~") == 0 || strcmp(note, "===") == 0) - { + } else if (strcmp(note, "~~~")==0 || strcmp(note,"===")==0) { pat->data[j][0]=101; pat->data[j][1]=0; - } - else - { + } else { invalidData=true; } - break; - } - else - { + } else { pat->data[j][1]--; // MPT is one octave higher... } - if (mode==GUI_PASTE_MODE_INS_BG || mode==GUI_PASTE_MODE_INS_FG) pat->data[j][2]=arg; } } - } - else if (iFine==1) // instrument - { - if (charPos>=line.size()) - { + } else if (iFine==1) { // instrument + if (charPos>=line.size()) { invalidData=true; break; } note[0]=line[charPos++]; - if (charPos>=line.size()) - { + if (charPos>=line.size()) { invalidData=true; break; } note[1]=line[charPos++]; note[2]=0; - if (iFine==1) - { - if (!opMaskPaste.ins || mode==GUI_PASTE_MODE_INS_BG || mode==GUI_PASTE_MODE_INS_FG) - { + if (iFine==1) { + if (!opMaskPaste.ins || mode==GUI_PASTE_MODE_INS_BG || mode==GUI_PASTE_MODE_INS_FG) { iFine++; continue; } } - if (strcmp(note,"..")==0 || strcmp(note," ")==0) - { + if (strcmp(note,"..")==0 || strcmp(note," ")==0) { if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_MIX_FG || - mode==GUI_PASTE_MODE_INS_BG || mode==GUI_PASTE_MODE_INS_FG)) - { + mode==GUI_PASTE_MODE_INS_BG || mode==GUI_PASTE_MODE_INS_FG)) { pat->data[j][iFine+1]=-1; } - } - else - { + } else { unsigned int val=0; - if (sscanf(note,"%2d",&val)!=1) - { + if (sscanf(note,"%2d",&val)!=1) { invalidData=true; break; } - if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_INS_BG) || pat->data[j][iFine+1]==-1) - { - pat->data[j][iFine+1]=val - 1; + if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_INS_BG) || pat->data[j][iFine+1]==-1) { + pat->data[j][iFine+1]=val-1; } } - } - else - { // volume and effects - if (charPos>=line.size()) - { + } else { // volume and effects + if (charPos>=line.size()) { invalidData=true; break; } note[0]=line[charPos++]; - if (charPos>=line.size()) - { + if (charPos>=line.size()) { invalidData=true; break; } note[1]=line[charPos++]; - if (charPos>=line.size()) - { + if (charPos>=line.size()) { invalidData=true; break; } note[2]=line[charPos++]; note[3]=0; - if (iFine==2) - { - if (!opMaskPaste.vol) - { - iFine++; - continue; - } - } - - else if ((iFine&1)==0) - { - if (!opMaskPaste.effectVal) - { - iFine++; - continue; - } - } - else if ((iFine&1)==1) - { - if (!opMaskPaste.effect) - { + if (iFine==2) { + if (!opMaskPaste.vol) { iFine++; continue; } } - if (strcmp(note,"...")==0 || strcmp(note," ")==0) - { + else if ((iFine&1)==0) { + if (!opMaskPaste.effectVal) { + iFine++; + continue; + } + } else if ((iFine&1)==1) { + if (!opMaskPaste.effect) { + iFine++; + continue; + } + } + + if (strcmp(note,"...")==0 || strcmp(note," ")==0) { if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_MIX_FG || mode==GUI_PASTE_MODE_INS_BG || mode==GUI_PASTE_MODE_INS_FG)) { pat->data[j][iFine+1]=-1; } - } - else - { + } else { unsigned int val=0; - unsigned char symbol = '\0'; + unsigned char symbol='\0'; - symbol = note[0]; + symbol=note[0]; - if(iFine == 2) - { + if (iFine==2) { sscanf(¬e[1],"%2d",&val); - } - else - { + } else { sscanf(¬e[1],"%2X",&val); } - if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_INS_BG) || pat->data[j][iFine+1]==-1) - { + if (!(mode==GUI_PASTE_MODE_MIX_BG || mode==GUI_PASTE_MODE_INS_BG) || pat->data[j][iFine+1]==-1) { // if (iFine<(3+e->curPat[iCoarse].effectCols*2)) pat->data[j][iFine+1]=val; - if(iFine == 2) // volume - { - switch(symbol) - { + if (iFine==2) { // volume + switch(symbol) { case 'v': { pat->data[j][iFine+1]=val; break; } - default: break; } - } - else // effect - { - unsigned int eff = 0; - - if(mptFormat == 0) - { - eff = convertEffectMPT_MOD(symbol, val); // up to 4 effects stored in one variable - - if(((eff & 0x0f00) >> 8) == 0x0C) // set volume - { - pat->data[j][iFine]=eff & 0xff; + } else { // effect + unsigned int eff=0; + if (mptFormat==0) { + eff=convertEffectMPT_MOD(symbol, val); // up to 4 effects stored in one variable + if (((eff&0x0f00)>>8)==0x0C) { // set volume + pat->data[j][iFine]=eff&0xff; } } - if(mptFormat == 1) - { - eff = convertEffectMPT_S3M(symbol, val); + if (mptFormat==1) { + eff=convertEffectMPT_S3M(symbol, val); } - if(mptFormat == 2 || mptFormat == 3) // set volume - { - eff = convertEffectMPT_XM(symbol, val); - - if(((eff & 0x0f00) >> 8) == 0x0C) + if (mptFormat==2 || mptFormat==3) { // set volume + eff=convertEffectMPT_XM(symbol, val); + + if (((eff&0x0f00)>>8)==0x0C) { - pat->data[j][iFine]=eff & 0xff; + pat->data[j][iFine]=eff&0xff; } } - if(mptFormat == 4 || mptFormat == 5) - { - eff = convertEffectMPT_IT(symbol, val); + if (mptFormat==4|| mptFormat==5) { + eff=convertEffectMPT_IT(symbol, val); } - if(mptFormat == 6) - { - eff = convertEffectMPT_MPTM(symbol, val); + if (mptFormat==6) { + eff=convertEffectMPT_MPTM(symbol, val); } - pat->data[j][iFine+1]=((eff & 0xff00) >> 8); - pat->data[j][iFine+2]=(eff & 0xff); + pat->data[j][iFine+1]=((eff&0xff00)>>8); + pat->data[j][iFine+2]=(eff&0xff); - if(eff > 0xffff) - { - pat->data[j][iFine+3]=((eff & 0xff000000) >> 24); - pat->data[j][iFine+4]=((eff & 0xff0000) >> 16); + if (eff>0xffff) { + pat->data[j][iFine+3]=((eff&0xff000000)>>24); + pat->data[j][iFine+4]=((eff&0xff0000)>>16); } - } } } @@ -1192,29 +1121,25 @@ void FurnaceGUI::doPasteMPT(PasteMode mode, int arg, bool readClipboard, String iFine++; - if(charPos >= line.size() - 1) - { - invalidData = false; + if (charPos>=line.size()-1) { + invalidData=false; break; } } - - if (invalidData) - { + + if (invalidData) { logW(_("invalid clipboard data! failed at line %d char %d"),i,charPos); logW("%s",line.c_str()); break; } j++; - if (mode==GUI_PASTE_MODE_OVERFLOW && j>=e->curSubSong->patLen && curOrdercurSubSong->ordersLen-1) - { + if (mode==GUI_PASTE_MODE_OVERFLOW && j>=e->curSubSong->patLen && curOrdercurSubSong->ordersLen-1) { j=0; curOrder++; } - if (mode==GUI_PASTE_MODE_FLOOD && i==data.size()-1) - { + if (mode==GUI_PASTE_MODE_FLOOD && i==data.size()-1) { i=1; } } From 73c263c2b449bb3020d28991bb18105a70fb6c65 Mon Sep 17 00:00:00 2001 From: yohannd1 Date: Thu, 19 Dec 2024 18:23:56 -0300 Subject: [PATCH 4/7] closing more popups with esc --- src/gui/exportOptions.cpp | 3 +++ src/gui/sysManager.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/gui/exportOptions.cpp b/src/gui/exportOptions.cpp index 7b6e699dd..5240dde2a 100644 --- a/src/gui/exportOptions.cpp +++ b/src/gui/exportOptions.cpp @@ -512,4 +512,7 @@ void FurnaceGUI::drawExport() { } break; } + if (ImGui::IsKeyPressed(ImGuiKey_Escape)) { + ImGui::CloseCurrentPopup(); + } } diff --git a/src/gui/sysManager.cpp b/src/gui/sysManager.cpp index f4fe58c95..576307d1e 100644 --- a/src/gui/sysManager.cpp +++ b/src/gui/sysManager.cpp @@ -133,6 +133,9 @@ void FurnaceGUI::drawSysManager() { } ImGui::CloseCurrentPopup(); } + if (ImGui::IsKeyPressed(ImGuiKey_Escape)) { + ImGui::CloseCurrentPopup(); + } ImGui::EndPopup(); } ImGui::SameLine(); @@ -169,6 +172,9 @@ void FurnaceGUI::drawSysManager() { updateROMExportAvail(); ImGui::CloseCurrentPopup(); } + if (ImGui::IsKeyPressed(ImGuiKey_Escape)) { + ImGui::CloseCurrentPopup(); + } ImGui::EndPopup(); } } From 2e92318bd21e03ca81ace547397a7f105f76d812 Mon Sep 17 00:00:00 2001 From: yohannd1 Date: Thu, 19 Dec 2024 16:11:01 -0300 Subject: [PATCH 5/7] Add .editorconfig --- .editorconfig | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..e08fae5b4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*.{cpp,h}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = false From e3d87f166ec562d536698ef6d92748d8c93833fb Mon Sep 17 00:00:00 2001 From: yohannd1 Date: Fri, 20 Dec 2024 11:00:46 -0300 Subject: [PATCH 6/7] editorconfig: make insert_final_newline=true --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index e08fae5b4..97b47b393 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,4 +4,4 @@ root = true indent_style = space indent_size = 2 trim_trailing_whitespace = true -insert_final_newline = false +insert_final_newline = true From e4a137619f79148082388eded532b7e85d8f164e Mon Sep 17 00:00:00 2001 From: Dalia Date: Fri, 20 Dec 2024 12:37:15 -0700 Subject: [PATCH 7/7] document AY period macros --- doc/4-instrument/ay8910.md | 4 ++++ doc/4-instrument/ay8930.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/4-instrument/ay8910.md b/doc/4-instrument/ay8910.md index 730faff96..711e8d679 100644 --- a/doc/4-instrument/ay8910.md +++ b/doc/4-instrument/ay8910.md @@ -35,3 +35,7 @@ note that timer effects might not be supported by VGM players, and are rather CP - **AutoEnv Num**: sets the envelope to the channel's frequency multiplied by numerator. - **AutoEnv Den**: sets the envelope to the channel's frequency multiplied by denominator. - these two must be set in order for AutoEnv to work! +- **Force Period**: sets the tone period (wavelength). + - overrides Arpeggio and Pitch macros. +- **Env Period**: sets the envelope period. + - ignored if both AutoEnv macros are set. diff --git a/doc/4-instrument/ay8930.md b/doc/4-instrument/ay8930.md index 7bec40073..118f15665 100644 --- a/doc/4-instrument/ay8930.md +++ b/doc/4-instrument/ay8930.md @@ -29,5 +29,9 @@ note that using samples on AY is CPU expensive! - **AutoEnv Num**: sets the envelope to the channel's frequency multiplied by numerator. - **AutoEnv Den**: sets the envelope to the channel's frequency multiplied by denominator. - these two must be set in order for AutoEnv to work! +- **Force Period**: sets the tone period (wavelength). + - overrides Arpeggio and Pitch macros. +- **Env Period**: sets the envelope period. + - ignored if both AutoEnv macros are set. - **Noise AND Mask**: alters the shape/frequency of the noise generator, allowing to produce various interesting sound effects and even PWM phasing. - **Noise OR Mask**: see above.