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

Function ShowShortList

src/drivers/common/cheat.cpp:421–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421static int ShowShortList(const char *moe[], int n, int def)
422{
423 int x,c;
424 int baa; //mbg merge 7/17/06 made to normal int
425 char tmp[256];
426
427 red:
428 for(x=0;x<n;x++)
429 printf("%d) %s\n",x+1,moe[x]);
430 puts("D) Display List");
431 clo:
432
433 printf("\nSelection [%d]> ",def+1);
434 if ( fgets(tmp,ARRAY_SIZE(tmp),stdin) == nullptr )
435 {
436 return def;
437 }
438 if(tmp[0]=='\n')
439 return def;
440 c=tolower(tmp[0]);
441 baa=c-'1';
442
443 if(baa<n)
444 return baa;
445 else if(c=='d')
446 goto red;
447 else
448 {
449 puts("Invalid selection.");
450 goto clo;
451 }
452}
453
454#define ASK_NONE 0
455#define ASK_V1 1

Callers 1

DoSearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected