Allow loading .RAM files
This commit is contained in:
parent
ca567bee79
commit
9e99ce434e
@ -650,6 +650,8 @@ static void audioCallback(GB_gameboy_t *gb, GB_sample_t *sample)
|
|||||||
GB_debugger_clear_symbols(&gb);
|
GB_debugger_clear_symbols(&gb);
|
||||||
if ([[self.fileType pathExtension] isEqualToString:@"isx"]) {
|
if ([[self.fileType pathExtension] isEqualToString:@"isx"]) {
|
||||||
GB_load_isx(&gb, [self.fileName UTF8String]);
|
GB_load_isx(&gb, [self.fileName UTF8String]);
|
||||||
|
GB_load_battery(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"ram"] UTF8String]);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GB_load_rom(&gb, [self.fileName UTF8String]);
|
GB_load_rom(&gb, [self.fileName UTF8String]);
|
||||||
|
@ -540,6 +540,11 @@ restart:
|
|||||||
}
|
}
|
||||||
if (strcmp(extension, "isx") == 0) {
|
if (strcmp(extension, "isx") == 0) {
|
||||||
error = GB_load_isx(&gb, filename);
|
error = GB_load_isx(&gb, filename);
|
||||||
|
/* Try loading .ram file if available */
|
||||||
|
char battery_save_path[path_length + 5]; /* At the worst case, size is strlen(path) + 4 bytes for .sav + NULL */
|
||||||
|
replace_extension(filename, path_length, battery_save_path, ".ram");
|
||||||
|
battery_save_path_ptr = battery_save_path;
|
||||||
|
GB_load_battery(&gb, battery_save_path);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GB_load_rom(&gb, filename);
|
GB_load_rom(&gb, filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user