diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index b5e865b03..98c723f16 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -627,6 +627,11 @@ void BackupDevice::close_rom() fpMC = NULL; } +//todo - this function is horrible. it's only needed due to our big disorganization between save types and sizes. +//the concept of a backup memory type "enum" (not actually an enum) was added after the original .dsv format +//the original .dsv format contains a 'type' which is kind of useless (flash vs eeprom) and then a memory size +//the memory size also happens to exactly identify a memory type. this function performs that mapping. +//we should fix this in a new revision of .dsv u8 BackupDevice::searchFileSaveType(u32 size) { for (u8 i = 1; i < MAX_SAVE_TYPES; i++) diff --git a/desmume/src/windows/importSave.cpp b/desmume/src/windows/importSave.cpp index a4b5f9c62..655a92dba 100644 --- a/desmume/src/windows/importSave.cpp +++ b/desmume/src/windows/importSave.cpp @@ -130,7 +130,7 @@ BOOL CALLBACK ImportSizeSelect_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l u32 res = 0; if (SendDlgItemMessage(hDlg, IDC_IMP_AUTO_CURRENT, BM_GETCHECK, 0, 0) == BST_CHECKED) - res = MMU_new.backupDevice.info.type; + res = MMU_new.backupDevice.searchFileSaveType(MMU_new.backupDevice.info.size); else if (SendDlgItemMessage(hDlg, IDC_IMP_AUTO_FILE, BM_GETCHECK, 0, 0) == BST_CHECKED) {