Commit 4700a2c1 authored by retro-wertz's avatar retro-wertz Committed by Rafael Kitover
Browse files

libretro: Enable mirroring for classic/famicom games for GBA and update

parent f2b34962
...@@ -745,7 +745,7 @@ static void load_image_preferences(void) ...@@ -745,7 +745,7 @@ static void load_image_preferences(void)
buffer[3] = rom[0xaf]; buffer[3] = rom[0xaf];
buffer[4] = 0; buffer[4] = 0;
cpuSaveType = 0; cpuSaveType = GBA_SAVE_AUTO;
flashSize = 0x10000; flashSize = 0x10000;
eepromSize = 512; eepromSize = 512;
rtcEnabled = false; rtcEnabled = false;
...@@ -768,25 +768,36 @@ static void load_image_preferences(void) ...@@ -768,25 +768,36 @@ static void load_image_preferences(void)
log("Found ROM in vba-over list.\n"); log("Found ROM in vba-over list.\n");
log("Name : %s\n", gbaover[found_no].romtitle); log("Name : %s\n", gbaover[found_no].romtitle);
cpuSaveType = gbaover[found_no].saveType;
if (gbaover[found_no].saveSize != 0) {
unsigned size = gbaover[found_no].saveSize;
if ((cpuSaveType == 3) && ((size == 65536) || (size == 131072)))
flashSize = size;
else if ((cpuSaveType == 1) && (size == 8192))
eepromSize = 0x2000;
}
rtcEnabled = gbaover[found_no].rtcEnabled; rtcEnabled = gbaover[found_no].rtcEnabled;
cpuSaveType = gbaover[found_no].saveType;
mirroringEnable = gbaover[found_no].mirroringEnabled; unsigned size = gbaover[found_no].saveSize;
if (cpuSaveType == GBA_SAVE_SRAM)
flashSize = 32768;
else if (cpuSaveType == GBA_SAVE_FLASH)
flashSize = size ? size : 65536;
else if ((cpuSaveType == GBA_SAVE_EEPROM) || (cpuSaveType == GBA_SAVE_EEPROM_SENSOR))
eepromSize = size ? size : 512;
} }
// gameID that starts with 'F' are classic/famicom games
mirroringEnable = (buffer[0] == 0x46) ? true : false;
if (!cpuSaveType) { if (!cpuSaveType) {
log("Scrapping ROM for save type.\n");
utilGBAFindSave(romSize); utilGBAFindSave(romSize);
} }
saveType = cpuSaveType;
if (flashSize == 0x10000 || flashSize == 0x20000)
flashSetSize(flashSize);
rtcEnable(rtcEnabled);
rtcEnableRumble(!rtcEnabled);
doMirroring(mirroringEnable);
log("romSize : %dKB\n", (romSize + 1023) / 1024); log("romSize : %dKB\n", (romSize + 1023) / 1024);
log("has RTC : %s.\n", rtcEnabled ? "Yes" : "No"); log("has RTC : %s.\n", rtcEnabled ? "Yes" : "No");
log("cpuSaveType : %s.\n", savetype[cpuSaveType]); log("cpuSaveType : %s.\n", savetype[cpuSaveType]);
...@@ -794,7 +805,7 @@ static void load_image_preferences(void) ...@@ -794,7 +805,7 @@ static void load_image_preferences(void)
log("flashSize : %d.\n", flashSize); log("flashSize : %d.\n", flashSize);
if (cpuSaveType == 1) if (cpuSaveType == 1)
log("eepromSize : %d.\n", eepromSize); log("eepromSize : %d.\n", eepromSize);
log("mirroringEnable : %d.\n", mirroringEnable); log("mirroringEnable : %s.\n", mirroringEnable ? "Yes" : "No");
} }
static void update_colormaps(void) static void update_colormaps(void)
...@@ -827,16 +838,6 @@ static void gba_init(void) ...@@ -827,16 +838,6 @@ static void gba_init(void)
log("Loading VBA-M Core (GBA)...\n"); log("Loading VBA-M Core (GBA)...\n");
load_image_preferences(); load_image_preferences();
saveType = cpuSaveType;
if (flashSize == 0x10000 || flashSize == 0x20000)
flashSetSize(flashSize);
rtcEnable(rtcEnabled);
rtcEnableRumble(!rtcEnabled);
doMirroring(mirroringEnable);
soundSetSampleRate(SampleRate); soundSetSampleRate(SampleRate);
if (usebios) { if (usebios) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment