Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/fceux.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeromus <zeromus@users.noreply.github.com>2022-08-21 03:18:45 +0300
committerzeromus <zeromus@users.noreply.github.com>2022-08-21 03:19:10 +0300
commitf7e7773b5ab7599eb30c10e4b90c356d4542d068 (patch)
tree14cab508b0f4fc1637c11c7798cd41584cc845c6
parentf3b33a628ff436f54028c7a905cb25893649ae99 (diff)
add a hotkey to disable active cheats (windows port only, but adding elsewhere would be easy now). fixes #504
-rw-r--r--src/drivers/win/cheat.cpp2
-rw-r--r--src/input.cpp13
-rw-r--r--src/input.h2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/drivers/win/cheat.cpp b/src/drivers/win/cheat.cpp
index ce6ee616..0153d281 100644
--- a/src/drivers/win/cheat.cpp
+++ b/src/drivers/win/cheat.cpp
@@ -1084,6 +1084,8 @@ void UpdateCheatListGroupBoxUI()
SetDlgItemText(hCheat, IDC_GROUPBOX_CHEATLIST, temp);
EnableWindow(GetDlgItem(hCheat, IDC_BTN_CHEAT_EXPORTTOFILE), cheats != 0);
+
+ CheckDlgButton(hCheat,IDC_CHEAT_GLOBAL_SWITCH,globalCheatDisabled?BST_UNCHECKED:BST_CHECKED);
}
//Used by cheats and external dialogs such as hex editor to update items in the cheat search dialog
diff --git a/src/input.cpp b/src/input.cpp
index 530f6948..c1dcd536 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -798,6 +798,7 @@ static void RamSearchOpLTE(void);
static void RamSearchOpGTE(void);
static void RamSearchOpEQ(void);
static void RamSearchOpNE(void);
+static void ToggleCheats(void);
static void DebuggerStepInto(void);
static void FA_SkipLag(void);
static void OpenRom(void);
@@ -945,6 +946,7 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
{ EMUCMD_TOOL_RAMSEARCHGTE, EMUCMDTYPE_TOOL, RamSearchOpGTE, 0, 0, "Ram Search - Greater Than or Equal", 0},
{ EMUCMD_TOOL_RAMSEARCHEQ, EMUCMDTYPE_TOOL, RamSearchOpEQ, 0, 0, "Ram Search - Equal", 0},
{ EMUCMD_TOOL_RAMSEARCHNE, EMUCMDTYPE_TOOL, RamSearchOpNE, 0, 0, "Ram Search - Not Equal", 0},
+ { EMUCMD_TOOL_TOGGLECHEATS, EMUCMDTYPE_TOOL, ToggleCheats, 0, 0, "Toggle Cheats", 0},
{ EMUCMD_RERECORD_DISPLAY_TOGGLE, EMUCMDTYPE_MISC, FCEUI_MovieToggleRerecordDisplay,0, 0, "Toggle Rerecord Display", EMUCMDFLAG_TASEDITOR },
{ EMUCMD_TASEDITOR_REWIND, EMUCMDTYPE_TASEDITOR, TaseditorRewindOn, TaseditorRewindOff, 0, "Frame Rewind", EMUCMDFLAG_TASEDITOR },
@@ -1268,6 +1270,17 @@ static void RamSearchOpNE(void) {
#endif
}
+extern int globalCheatDisabled;
+static void ToggleCheats()
+{
+ FCEUI_GlobalToggleCheat(globalCheatDisabled);
+ FCEU_DispMessage("%d cheats active", 0, FrozenAddressCount);
+ #ifdef __WIN_DRIVER__
+ UpdateCheatRelatedWindow();
+ UpdateCheatListGroupBoxUI();
+ #endif
+}
+
static void DebuggerStepInto()
{
#ifdef __WIN_DRIVER__
diff --git a/src/input.h b/src/input.h
index 0f89fca9..9928839f 100644
--- a/src/input.h
+++ b/src/input.h
@@ -259,6 +259,8 @@ enum EMUCMD
EMUCMD_MOVIE_RECORD_MODE_OVERWRITE,
EMUCMD_MOVIE_RECORD_MODE_INSERT,
+ EMUCMD_TOOL_TOGGLECHEATS,
+
EMUCMD_MAX
};