From 0983a34bd42472f2cbb305244902bc611245ae03 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 8 Jan 2014 16:28:14 +0000 Subject: [PATCH] same for CLI --- desmume/src/cli/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/desmume/src/cli/main.cpp b/desmume/src/cli/main.cpp index e9841eeb3..1349222c0 100644 --- a/desmume/src/cli/main.cpp +++ b/desmume/src/cli/main.cpp @@ -547,7 +547,15 @@ int main(int argc, char ** argv) { slot2_device_type = NDS_SLOT2_CFLASH; if(my_config.gbaslot_rom != "") { - strncpy(GBAgameName, my_config.gbaslot_rom.c_str(), MAX_PATH); + + //set the GBA rom and sav paths + GBACartridge_RomPath = my_config->gbaslot_rom.c_str(); + if(toupper(strright(GBACartridge_RomPath,4)) == ".GBA") + GBACartridge_SRAMPath = strright(GBACartridge_RomPath,4) + ".sav"; + else + //what to do? lets just do the same thing for now + GBACartridge_SRAMPath = strright(GBACartridge_RomPath,4) + ".sav"; + // Check if the file exists and can be opened FILE * test = fopen(GBAgameName, "rb"); if (test) {