From e0172bb851cbf5650997c5b0370359ea75071a90 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 6 Sep 2023 22:18:44 -0500 Subject: [PATCH] GUI: fix cheat codes activation --- src/gui/gui.cpp | 15 +++++++++++++++ src/gui/songInfo.cpp | 14 -------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 972517f74..2dbe3f670 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -614,6 +614,21 @@ void FurnaceGUI::updateWindowTitle() { } if (sdlWin!=NULL) SDL_SetWindowTitle(sdlWin,title.c_str()); + + if (e->song.insLen==1) { + unsigned int checker=0x11111111; + unsigned int checker1=0; + DivInstrument* ins=e->getIns(0); + if (ins->name.size()==15 && e->curSubSong->ordersLen==8) { + for (int i=0; i<15; i++) { + checker^=ins->name[i]<name[i]; + checker=(checker>>1|(((checker)^(checker>>2)^(checker>>3)^(checker>>5))&1)<<31); + checker1<<=1; + } + if (checker==0x5ec4497d && checker1==0x6347ee) nonLatchNibble=true; + } + } } void FurnaceGUI::autoDetectSystem() { diff --git a/src/gui/songInfo.cpp b/src/gui/songInfo.cpp index b1c4895a0..8091fab1e 100644 --- a/src/gui/songInfo.cpp +++ b/src/gui/songInfo.cpp @@ -44,20 +44,6 @@ void FurnaceGUI::drawSongInfo(bool asChild) { if (ImGui::InputText("##Name",&e->song.name,ImGuiInputTextFlags_UndoRedo)) { MARK_MODIFIED updateWindowTitle(); } - if (e->song.insLen==1) { - unsigned int checker=0x11111111; - unsigned int checker1=0; - DivInstrument* ins=e->getIns(0); - if (ins->name.size()==15 && e->curSubSong->ordersLen==8) { - for (int i=0; i<15; i++) { - checker^=ins->name[i]<name[i]; - checker=(checker>>1|(((checker)^(checker>>2)^(checker>>3)^(checker>>5))&1)<<31); - checker1<<=1; - } - if (checker==0x5ec4497d && checker1==0x6347ee) nonLatchNibble=true; - } - } ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding();