MCPcopy Create free account
hub / github.com/TASEmulators/fceux / DoSearch

Function DoSearch

src/drivers/common/cheat.cpp:458–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456#define ASK_V2 2
457
458static void DoSearch(void)
459{
460 static int v1=0,v2=0;
461 static int method=0;
462 const char *m[9]={"O==V1 && C==V2",
463 "O==V1 && |O-C|==V2",
464 "|O-C|==V2",
465 "O!=C",
466 "C==V1",
467 "Value increased (O<C)",
468 "Value decreased (O>C)",
469 "Value increased by V2 (|C-O|==V2)",
470 "Value decreased by V2 (|O-C|==V2)"};
471 int av[9]={ASK_V1|ASK_V2,
472 ASK_V1|ASK_V2,
473 ASK_V2,
474 ASK_NONE,
475 ASK_V1,
476 ASK_NONE,
477 ASK_NONE,
478 ASK_V2,
479 ASK_V2};
480
481 printf("\nSearch Filter:\n");
482
483 method=ShowShortList(m,9,method);
484 if(av[method]&ASK_V1)
485 {
486 printf("V1 [%03d]: ",v1);
487 v1=Get8(v1);
488 }
489 if(av[method]&ASK_V2)
490 {
491 printf("V2 [%03d]: ",v2);
492 v2=Get8(v2);
493 }
494 FCEUI_CheatSearchEnd(method,v1,v2);
495 puts("Search completed.\n");
496}
497
498
499static MENU NewCheatsMenu[]={

Callers

nothing calls this directly

Calls 3

ShowShortListFunction · 0.85
Get8Function · 0.85
FCEUI_CheatSearchEndFunction · 0.85

Tested by

no test coverage detected