Display amount of loaded cheats in title.
This commit is contained in:
10
cheats.cpp
10
cheats.cpp
@@ -27,6 +27,7 @@ static CheatVector cheats;
|
||||
|
||||
static int iSelectedEntry = 0;
|
||||
static int iFirstEntry = 0;
|
||||
static int loaded = 0;
|
||||
|
||||
struct CheatComp
|
||||
{
|
||||
@@ -51,6 +52,7 @@ static char cheat_zip[1024] = {};
|
||||
void cheats_init(char *rom_path)
|
||||
{
|
||||
cheats.clear();
|
||||
loaded = 0;
|
||||
cheat_zip[0] = 0;
|
||||
|
||||
if (!strcasestr(rom_path, ".zip"))
|
||||
@@ -293,7 +295,8 @@ static void cheats_send()
|
||||
if (pos >= CHEAT_SIZE) break;
|
||||
}
|
||||
|
||||
printf("Cheat codes: %d\n", pos/16);
|
||||
loaded = pos / 16;
|
||||
printf("Cheat codes: %d\n", loaded);
|
||||
|
||||
user_io_set_index(255);
|
||||
|
||||
@@ -320,3 +323,8 @@ void cheats_toggle()
|
||||
cheats[iSelectedEntry].enabled = !cheats[iSelectedEntry].enabled;
|
||||
cheats_send();
|
||||
}
|
||||
|
||||
int cheats_loaded()
|
||||
{
|
||||
return loaded;
|
||||
}
|
||||
2
cheats.h
2
cheats.h
@@ -7,6 +7,6 @@ void cheats_scan(int mode);
|
||||
void cheats_scroll_name();
|
||||
void cheats_print();
|
||||
void cheats_toggle();
|
||||
|
||||
int cheats_loaded();
|
||||
|
||||
#endif
|
||||
|
||||
3
menu.cpp
3
menu.cpp
@@ -2936,7 +2936,8 @@ void HandleUI(void)
|
||||
/******************************************************************/
|
||||
case MENU_CHEATS1:
|
||||
helptext = helptexts[HELPTEXT_NONE];
|
||||
OsdSetTitle("Cheats", 0);
|
||||
sprintf(s, "Cheats (%d)", cheats_loaded());
|
||||
OsdSetTitle(s);
|
||||
cheats_print();
|
||||
menustate = MENU_CHEATS2;
|
||||
parentstate = menustate;
|
||||
|
||||
Reference in New Issue
Block a user