aboutsummaryrefslogtreecommitdiff
path: root/source/nds/gui.c
diff options
context:
space:
mode:
authorNebuleon Fumika2012-12-23 20:51:14 -0500
committerNebuleon Fumika2012-12-23 20:51:14 -0500
commitbb39cc82364ea00324a054ba0970bdc07ecfdeec (patch)
treeb221c90bf1c23195f08b69de6dd8cdb3f1b9df75 /source/nds/gui.c
parenta194b850037c03f5fb3ac1ecc9f7a99f73b84104 (diff)
downloadsnes9x2005-bb39cc82364ea00324a054ba0970bdc07ecfdeec.tar.gz
snes9x2005-bb39cc82364ea00324a054ba0970bdc07ecfdeec.tar.bz2
snes9x2005-bb39cc82364ea00324a054ba0970bdc07ecfdeec.zip
Correctly handle multi-part codes, for all cheat types (GG, PAR, GF).
They are currently loaded as multiple codes, however.
Diffstat (limited to 'source/nds/gui.c')
-rw-r--r--source/nds/gui.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/nds/gui.c b/source/nds/gui.c
index 84f522f..1b265b6 100644
--- a/source/nds/gui.c
+++ b/source/nds/gui.c
@@ -2618,10 +2618,12 @@ u32 menu(u16 *screen)
if(load_file(file_ext, tmp_filename, DEFAULT_CHEAT_DIR) != -1)
{
- strcpy(line_buffer, DEFAULT_CHEAT_DIR);
- strcat(line_buffer, "/");
- strcat(line_buffer, tmp_filename);
+ sprintf(line_buffer, "%s/%s", DEFAULT_CHEAT_DIR, tmp_filename);
flag = NDSSFCLoadCheatFile(line_buffer);
+
+ strcpy(line_buffer, (char *) S9xGetFilename (".chb"));
+ S9xSaveCheatFile (line_buffer); // cheat binary
+
if(0 != flag)
{ //load cheat file failure
S9xDeleteCheats();
@@ -2630,12 +2632,9 @@ u32 menu(u16 *screen)
return;
}
- strcpy(line_buffer, (char *) S9xGetFilename (".chb"));
-
- S9xSaveCheatFile (line_buffer); // cheat binary
-
menu_cheat_page = 0;
cheat_menu_init();
+
}
}