- add select autodetect save method (internal or from database);

This commit is contained in:
mtabachenko 2011-08-29 16:03:13 +00:00
parent e43e603ff1
commit 3a41cfdf11
7 changed files with 25 additions and 0 deletions

View File

@ -591,6 +591,8 @@ int NDS_LoadROM(const char *filename, const char *logicalFilename)
else
{
printf("%s", save_names[sv]);
if (CommonSettings.autodetectBackupMethod == 1)
backup_setManualBackupType(sv);
}
printf("\n\t* ROM crc: %08X\n", advsc.getCRC32());
}

View File

@ -489,6 +489,7 @@ extern struct TCommonSettings {
, micMode(InternalNoise)
, spuInterpolationMode(SPUInterpolation_Linear)
, manualBackupType(0)
, autodetectBackupMethod(0)
, spu_captureMuted(false)
, spu_advanced(false)
, StylusPressure(50)
@ -563,6 +564,7 @@ extern struct TCommonSettings {
//this is a temporary hack until we straighten out the flushing logic and/or gxfifo
//int gfx3d_flushMode;
int autodetectBackupMethod;
//this is the user's choice of manual backup type, for cases when the autodetection can't be trusted
int manualBackupType;

View File

@ -56,6 +56,7 @@ CommandLine::CommandLine()
, arm9_gdb_port(0)
, arm7_gdb_port(0)
, start_paused(FALSE)
, autodetect_method(-1)
{
#ifndef _MSC_VER
disable_sound = 0;
@ -106,6 +107,7 @@ void CommandLine::loadCommonOptions()
{ "arm9gdb", 0, 0, G_OPTION_ARG_INT, &arm9_gdb_port, "Enable the ARM9 GDB stub on the given port", "PORT_NUM"},
{ "arm7gdb", 0, 0, G_OPTION_ARG_INT, &arm7_gdb_port, "Enable the ARM7 GDB stub on the given port", "PORT_NUM"},
#endif
{ "autodetect_method", 0, 0, G_OPTION_ARG_INT, &autodetect_method, "Autodetect backup method (0 - internal, 1 - from database)", "AUTODETECT_METHOD"},
{ NULL }
};
@ -140,6 +142,9 @@ bool CommandLine::parse(int argc,char **argv)
if(dsi_mode != -1)
CommonSettings.DSI = (dsi_mode==1);
if(autodetect_method != -1)
CommonSettings.autodetectBackupMethod = autodetect_method;
//TODO MAX PRIORITY! change ARM9BIOS etc to be a std::string
if(_bios_arm9) { CommonSettings.UseExtBIOS = true; strcpy(CommonSettings.ARM9BIOS,_bios_arm9); }
if(_bios_arm7) { CommonSettings.UseExtBIOS = true; strcpy(CommonSettings.ARM7BIOS,_bios_arm7); }
@ -196,6 +201,11 @@ bool CommandLine::validate()
if((_cflash_image && _gbaslot_rom) || (_cflash_path && _gbaslot_rom)) {
g_printerr("Cannot specify both cflash and gbaslot rom (both occupy SLOT-2)\n");
}
if ((autodetect_method < 0) || (autodetect_method > 1)) {
g_printerr("Invalid autodetect save method (0 - internal, 1 - from database)\n");
}
return true;
}

View File

@ -39,6 +39,7 @@ public:
int depth_threshold;
int debug_console;
int dsi_mode;
int autodetect_method;
std::string nds_file;
std::string play_movie_file;
std::string record_movie_file;

View File

@ -2579,6 +2579,7 @@ int _main()
path.ReadPathSettings();
CommonSettings.cheatsDisable = GetPrivateProfileBool("General", "cheatsDisable", false, IniName);
CommonSettings.autodetectBackupMethod = GetPrivateProfileInt("General", "autoDetectMethod", 0, IniName);
ColorCtrl_Register();
if (!RegWndClass("DeSmuME", WindowProcedure, CS_DBLCLKS, LoadIcon(hAppInst, MAKEINTRESOURCE(ICONDESMUME))))
@ -4109,6 +4110,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
MainWindow->checkMenu(IDC_SAVETYPE+i, false);
MainWindow->checkMenu(IDC_SAVETYPE+CommonSettings.manualBackupType, true);
MainWindow->checkMenu(IDM_AUTODETECTSAVETYPE_INTERNAL+CommonSettings.autodetectBackupMethod, true);
// recent/active scripts menu
PopulateLuaSubmenu();
@ -5601,6 +5603,12 @@ DOKEYDOWN:
}
return 0;
case IDM_AUTODETECTSAVETYPE_INTERNAL:
case IDM_AUTODETECTSAVETYPE_FROMDATABASE:
CommonSettings.autodetectBackupMethod = LOWORD(wParam) - IDM_AUTODETECTSAVETYPE_INTERNAL;
WritePrivateProfileInt("General", "autoDetectMethod", CommonSettings.autodetectBackupMethod, IniName);
return 0;
case IDC_SAVETYPE_FORCE: backup_forceManualBackupType(); return 0;
default:

View File

@ -884,6 +884,8 @@
#define ID_40093 40093
#define IDM_SLOT1 40097
#define IDM_FILE_IMPORT_DB 40103
#define IDM_AUTODETECTSAVETYPE_INTERNAL 40104
#define IDM_AUTODETECTSAVETYPE_FROMDATABASE 40105
#define IDC_LABEL_UP 50000
#define IDC_LABEL_RIGHT 50001
#define IDC_LABEL_LEFT 50002

Binary file not shown.