summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug
diff options
context:
space:
mode:
author Phil Bennett <philipjbennett@users.noreply.github.com>2010-12-19 17:41:56 +0000
committer Phil Bennett <philipjbennett@users.noreply.github.com>2010-12-19 17:41:56 +0000
commit31d554dc17a3857d57013117f73f26db24a98b4a (patch)
tree5835de91139e69404629146daca0ac4154cebf28 /src/emu/debug
parent673f5bef0fd27548b84be5dc5214745b13693cc8 (diff)
Added a 'changed by' search to the cheat engine [Pugsy]
---------- Forwarded message ---------- From: Pugsy <pugsy@gmx.net> Date: Tue, Dec 14, 2010 at 3:13 PM Subject: Minor patch to improve cheat finding functionality To: submit@mamedev.org Cc: "stephh U.P." <upstephh_wip@yahoo.com> Hi Here is a simple patch that will add a "changed by" search - it's effectively a increased and decreased search rolled into one. It is useful when you are uncertain if the value has increased by x or decreased by x so it saves having to guess which search method to try first. -- Martin 'Pugsy' Pugh MAME Cheat File Maintainer http://mamecheat.co.uk Gamebase64 Team Member http://www.gamebase64.com
Diffstat (limited to 'src/emu/debug')
-rw-r--r--src/emu/debug/debugcmd.c11
-rw-r--r--src/emu/debug/debughlp.c6
2 files changed, 16 insertions, 1 deletions
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 0cb47062361..dbea2d50af8 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -1834,7 +1834,8 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con
CHEAT_DECREASEOF,
CHEAT_INCREASEOF,
CHEAT_SMALLEROF,
- CHEAT_GREATEROF
+ CHEAT_GREATEROF,
+ CHEAT_CHANGEDBY
};
if (cheat.cpu == 0)
@@ -1869,6 +1870,8 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con
condition = CHEAT_SMALLEROF;
else if (!strcmp(param[0], "greaterof") || !strcmp(param[0], "gt") || !strcmp(param[0], ">"))
condition = CHEAT_GREATEROF;
+ else if (!strcmp(param[0], "changedby") || !strcmp(param[0], "ch") || !strcmp(param[0], "~"))
+ condition = CHEAT_CHANGEDBY;
else
{
debug_console_printf(machine, "Invalid condition type\n");
@@ -1955,6 +1958,12 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con
else
disable_byte = ((UINT64)cheat_value <= (UINT64)comp_value);
break;
+ case CHEAT_CHANGEDBY:
+ if (cheat_value > comp_byte)
+ disable_byte = (cheat_value != comp_byte + comp_value);
+ else
+ disable_byte = (cheat_value != comp_byte - comp_value);
+ break;
}
if (disable_byte)
diff --git a/src/emu/debug/debughlp.c b/src/emu/debug/debughlp.c
index 1f7e1efd2f0..8ef20db442f 100644
--- a/src/emu/debug/debughlp.c
+++ b/src/emu/debug/debughlp.c
@@ -1113,6 +1113,9 @@ static const help_item static_help_list[] =
" greaterof [gt]\n"
" without <comparisonvalue> this condition is invalid\n"
" with <comparisonvalue> search for all bytes that are larger than the <comparisonvalue>.\n"
+ " changedby [ch, ~]\n"
+ " without <comparisonvalue> this condition is invalid\n"
+ " with <comparisonvalue> search for all bytes that have changed by the <comparisonvalue> since the last search.\n"
"\n"
"Examples:\n"
"\n"
@@ -1156,6 +1159,9 @@ static const help_item static_help_list[] =
" greaterof [gt]\n"
" without <comparisonvalue> this condition is invalid.\n"
" with <comparisonvalue> search for all bytes that are larger than the <comparisonvalue>.\n"
+ " changedby [ch, ~]\n"
+ " without <comparisonvalue> this condition is invalid\n"
+ " with <comparisonvalue> search for all bytes that have changed by the <comparisonvalue> since the initial search.\n"
"\n"
"Examples:\n"
"\n"