From 6051f454095bd7e6b09a364c8e902561a32d663b Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 10 Sep 2009 07:21:52 +0000 Subject: [PATCH] > -----Original Message----- > Sent: Wednesday, September 09, 2009 10:32 PM > To: submit@mamedev.org > Subject: cheat update > > Simple update for add "increase or equal" and "decrease or equal" in > cheatnext conditions [Sandro Ronco] --- src/emu/debug/debugcmd.c | 20 ++++++++++++++++++++ src/emu/debug/debughlp.c | 12 ++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 937f714dcdb..cb6e2bac232 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -1927,6 +1927,8 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con CHEAT_NOTEQUALTO, CHEAT_DECREASE, CHEAT_INCREASE, + CHEAT_DECREASE_OR_EQUAL, + CHEAT_INCREASE_OR_EQUAL, CHEAT_DECREASEOF, CHEAT_INCREASEOF, CHEAT_SMALLEROF, @@ -1957,6 +1959,10 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con condition = (params > 1) ? CHEAT_DECREASEOF : CHEAT_DECREASE; else if (!strcmp(param[0], "increase") || !strcmp(param[0], "in") || !strcmp(param[0], "+")) condition = (params > 1) ? CHEAT_INCREASEOF : CHEAT_INCREASE; + else if (!strcmp(param[0], "decreaseorequal") || !strcmp(param[0], "deeq")) + condition = CHEAT_DECREASE_OR_EQUAL; + else if (!strcmp(param[0], "increaseorequal") || !strcmp(param[0], "ineq")) + condition = CHEAT_INCREASE_OR_EQUAL; else if (!strcmp(param[0], "smallerof") || !strcmp(param[0], "lt") || !strcmp(param[0], "<")) condition = CHEAT_SMALLEROF; else if (!strcmp(param[0], "greaterof") || !strcmp(param[0], "gt") || !strcmp(param[0], ">")) @@ -2012,6 +2018,20 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con disable_byte = ((UINT64)cheat_value <= (UINT64)comp_byte); break; + case CHEAT_DECREASE_OR_EQUAL: + if (cheat.signed_cheat) + disable_byte = ((INT64)cheat_value > (INT64)comp_byte); + else + disable_byte = ((UINT64)cheat_value > (UINT64)comp_byte); + break; + + case CHEAT_INCREASE_OR_EQUAL: + if (cheat.signed_cheat) + disable_byte = ((INT64)cheat_value < (INT64)comp_byte); + else + disable_byte = ((UINT64)cheat_value < (UINT64)comp_byte); + break; + case CHEAT_DECREASEOF: disable_byte = (cheat_value != comp_byte - comp_value); break; diff --git a/src/emu/debug/debughlp.c b/src/emu/debug/debughlp.c index 05a3c0a2cfd..0ca41d7d241 100644 --- a/src/emu/debug/debughlp.c +++ b/src/emu/debug/debughlp.c @@ -1112,6 +1112,12 @@ static const help_item static_help_list[] = " increase [in, -]\n" " without search for all bytes that have increased since the last search.\n" " with search for all bytes that have increased by the since the last search.\n" + " decreaseorequal [deeq]\n" + " no needed.\n" + " search for all bytes that have decreased or have same value since the last search.\n" + " increaseorequal [ineq]\n" + " no needed.\n" + " search for all bytes that have decreased or have same value since the last search.\n" " smallerof [lt]\n" " without this condition is invalid\n" " with search for all bytes that are smaller than the .\n" @@ -1149,6 +1155,12 @@ static const help_item static_help_list[] = " increase [in, -]\n" " without search for all bytes that have increased since the initial search.\n" " with search for all bytes that have increased by the since the initial search.\n" + " decreaseorequal [deeq]\n" + " no needed.\n" + " search for all bytes that have decreased or have same value since the initial search.\n" + " increaseorequal [ineq]\n" + " no needed.\n" + " search for all bytes that have decreased or have same value since the initial search.\n" " smallerof [lt]\n" " without this condition is invalid.\n" " with search for all bytes that are smaller than the .\n"