Menu

#511 Bug in cheat search menu fo SDL version

closed
sdl (53)
5
2012-06-08
2012-05-03
Anonymous
No

The "Value decreased" does not work as expected, it returns only addresses with the current value 0.

This seems to happens because the menu in src/drivers/common/cheat.cpp does not correspond to the search filters defined in the function FCEUI_CheatSearchEnd in file src/cheat.cpp.

The following patch fixes the bug and adds the missing search method options in the menu.

--- cheat.cpp 2010-09-03 13:11:45.000000000 -0400
+++ cheat-fixed.cpp 2012-05-02 20:45:35.000000000 -0400
@@ -422,20 +422,42 @@
}
}

+#define ASK_NONE 0
+#define ASK_V1 1
+#define ASK_V2 2
+
static void DoSearch(void)
{
static int v1=0,v2=0;
static int method=0;

  • char *m[6]={"O==V1 && C==V2","O==V1 && |O-C|==V2","|O-C|==V2","O!=C","Value decreased","Value increased"};
  • char *m[9]={"O==V1 && C==V2",
  • "O==V1 && |O-C|==V2",
  • "|O-C|==V2",
  • "O!=C",
  • "C==V1",
  • "Value increased (O<C)",
  • "Value decreased (O>C)",
  • "Value increased by V2 (|C-O|==V2)",
  • "Value decreased by V2 (|O-C|==V2)"};
  • int av[9]={ASK_V1|ASK_V2,
  • ASK_V1|ASK_V2,
  • ASK_V2,
  • ASK_NONE,
  • ASK_V1,
  • ASK_NONE,
  • ASK_NONE,
  • ASK_V2,
  • ASK_V2};
    +
    printf("\nSearch Filter:\n");

  • method=ShowShortList(m,6,method);

  • if(method<=1)
  • method=ShowShortList(m,9,method);
  • if(av[method]&ASK_V1)
    {
    printf("V1 [%03d]: ",v1);
    v1=Get8(v1);
    }
  • if(method<=2)
  • if(av[method]&ASK_V2)
    {
    printf("V2 [%03d]: ",v2);
    v2=Get8(v2);

Discussion

  • Lukas Sabota

    Lukas Sabota - 2012-05-17

    Could you please attach a patch file for this patch? The tabbing is lost in the above post so the patch is malformed.

    I can reproduce that the menu options are missing but it would great to try this patch before hacking on it.

     
  • Lukas Sabota

    Lukas Sabota - 2012-05-17

    fixed in svn r2514. thank you for bringing this to our attention!

     

Log in to post a comment.

MongoDB Logo MongoDB