try to fix GTK port compilation after gbagame configuration changes. i havent tried compiling this yet

This commit is contained in:
zeromus 2014-01-08 16:20:28 +00:00
parent b93e53ac1a
commit c88a2071a7
1 changed files with 12 additions and 2 deletions

View File

@ -53,6 +53,8 @@
#include "slot2.h"
#include "utils/xstring.h"
#include "filter/videofilter.h"
#ifdef GDB_STUB
@ -2172,9 +2174,17 @@ common_gtk_main( class configured_features *my_config)
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");
FILE * test = fopen(GBACartridge_RomPath.c_str(), "rb");
if (test) {
slot2_device_type = NDS_SLOT2_GBACART;
fclose(test);