diff --git a/src/mc.cpp b/src/mc.cpp index f3b55c0b3..ecb14051d 100644 --- a/src/mc.cpp +++ b/src/mc.cpp @@ -78,6 +78,12 @@ static const int save_types[7][2] = { {MC_TYPE_FLASH,MC_SIZE_4MBITS} }; +//forces the current +void backup_forceManualBackupType() +{ + MMU_new.backupDevice.forceManualBackupType(); +} + void backup_setManualBackupType(int type) { CommonSettings.manualBackupType = type; @@ -818,3 +824,9 @@ bool BackupDevice::load_movie(std::istream* is) { return true; } + +void BackupDevice::forceManualBackupType() +{ + addr_size = addr_size_for_old_save_size(save_types[CommonSettings.manualBackupType][1]); + state = RUNNING; +} diff --git a/src/mc.h b/src/mc.h index 8cdc4f580..45c5a7cf4 100644 --- a/src/mc.h +++ b/src/mc.h @@ -75,6 +75,8 @@ public: void reset(); void close_rom(); + + void forceManualBackupType(); bool save_state(std::ostream* os); bool load_state(std::istream* is); @@ -142,6 +144,7 @@ void fw_reset_com(memory_chip_t *mc); /* reset communication with mc */ u8 fw_transfer(memory_chip_t *mc, u8 data); void backup_setManualBackupType(int type); +void backup_forceManualBackupType(); #endif /*__FW_H__*/ diff --git a/src/windows/main.cpp b/src/windows/main.cpp index a2071e287..bd2edb79d 100644 --- a/src/windows/main.cpp +++ b/src/windows/main.cpp @@ -3451,6 +3451,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM case IDC_SAVETYPE5: backup_setManualBackupType(4); return 0; case IDC_SAVETYPE6: backup_setManualBackupType(5); return 0; case IDC_SAVETYPE7: backup_setManualBackupType(6); return 0; + case IDC_SAVETYPE_FORCE: backup_forceManualBackupType(); return 0; case IDM_RESET: ResetGame(); diff --git a/src/windows/resource.h b/src/windows/resource.h index 6a8fbdae5..8345c447e 100644 --- a/src/windows/resource.h +++ b/src/windows/resource.h @@ -77,6 +77,7 @@ #define IDC_SAVETYPE4 185 #define IDC_SAVETYPE5 186 #define IDC_SAVETYPE6 187 +#define IDC_SAVETYPE_FORCE 188 #define IDC_FRAMESKIPAUTO 190 #define IDC_FRAMESKIP0 191 #define IDC_FRAMESKIP1 192 diff --git a/src/windows/resources.rc b/src/windows/resources.rc index 30896884a..8a45d4214 100644 Binary files a/src/windows/resources.rc and b/src/windows/resources.rc differ