From e11cde755cf0a14084fa74a1248256491be54a38 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 7 Nov 2025 05:02:59 -0500 Subject: [PATCH] GUI: fix a couple pattern refactor bugs effect description in status bar *still* being wrong randomize resulting in invalid notes --- src/gui/editing.cpp | 7 +++++-- src/gui/gui.cpp | 2 +- src/gui/settings.cpp | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index b05152b86..3999b4911 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -1582,8 +1582,11 @@ void FurnaceGUI::doRandomize(int bottom, int top, bool mode, bool eff, int effVa value=MIN(absoluteTop,bottom); value2=MIN(absoluteTop,bottom); } else { - value=MIN(absoluteTop,bottom+(rand()%(top-bottom+1))); - value2=MIN(absoluteTop,bottom+(rand()%(top-bottom+1))); + // HACK: MIN will call rand() twice.... + int randVal=rand(); + value=MIN(absoluteTop,bottom+(randVal%(top-bottom+1))); + randVal=rand(); + value2=MIN(absoluteTop,bottom+(randVal%(top-bottom+1))); } if (mode) { value&=15; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 6976eadb9..eee4b1c70 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5001,7 +5001,7 @@ bool FurnaceGUI::loop() { break; default: // effect if (cursor.xFinenewData[cursor.y][cursor.xFine]>-1) { + if (p->newData[cursor.y][(cursor.xFine-1)|1]>-1) { info=e->getEffectDesc(p->newData[cursor.y][(cursor.xFine-1)|1],cursor.xCoarse,true); hasInfo=true; } diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 6fedfbf23..136640a2a 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -4703,9 +4703,9 @@ void FurnaceGUI::drawSettings() { // "Debug" - toggles mobile UI // "Nice Amiga cover of the song!" - enables hidden systems (YMU759/Dummy) // "42 63" - enables all instrument types - // "4-bit FDS" - enables partial pitch linearity option // "Power of the Chip" - enables options for multi-threaded audio // "btcdbcb" - use modern UI padding + // "6-7" - OH PLEASE NO // "????" - enables stuff CONFIG_SECTION(_("Cheat Codes")) { // SUBSECTION ENTER CODE: @@ -4748,6 +4748,22 @@ void FurnaceGUI::drawSettings() { sty.ItemInnerSpacing=ImVec2(10.0f*dpiScale,10.0f*dpiScale); settingsOpen=false; } + if (checker==0x2222225c && checker1==0x2d2) { + mmlString[30]=_("Oh my god... Kill me now so I don't have to go through that again!"); + for (int i=0; igetTotalChannelCount(); i++) { + for (int j=0; jcurSubSong->pat[i].data[j]!=NULL) { + DivPattern* p=e->curSubSong->pat[i].data[j]; + for (int k=0; knewData[k][DIV_PAT_NOTE]>=0 && p->newData[k][DIV_PAT_NOTE]<180) { + int newNote=p->newData[k][DIV_PAT_NOTE]+(rand()%40)-18; + p->newData[k][DIV_PAT_NOTE]=CLAMP(newNote,60,179); + } + } + } + } + } + } mmlString[31]=""; }