- add "jit block size" field in Emulation Settings dialog;
This commit is contained in:
mtabachenko 2013-04-15 19:49:36 +00:00
parent e5c8509ad1
commit 9bfbbb1441
3 changed files with 34 additions and 2 deletions

View File

@ -6173,7 +6173,12 @@ LRESULT CALLBACK EmulationSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
SetDlgItemText(hDlg, IDC_ARM9BIOS, CommonSettings.ARM9BIOS);
SetDlgItemText(hDlg, IDC_ARM7BIOS, CommonSettings.ARM7BIOS);
CheckDlgItem(hDlg, IDC_CHECKBOX_DYNAREC, CommonSettings.use_jit);
#ifndef HAVE_JIT
#ifdef HAVE_JIT
EnableWindow(GetDlgItem(hDlg, IDC_JIT_BLOCK_SIZE), CommonSettings.use_jit?true:false);
char buf[4] = {0};
itoa(CommonSettings.jit_max_block_size, &buf[0], 10);
SetDlgItemText(hDlg, IDC_JIT_BLOCK_SIZE, buf);
#else
EnableWindow(GetDlgItem(hDlg, IDC_CHECKBOX_DYNAREC), false);
#endif
@ -6219,12 +6224,29 @@ LRESULT CALLBACK EmulationSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
{
case IDOK:
{
HWND cur;
int val = 0;
#ifdef HAVE_JIT
u32 jit_size = 0;
if (IsDlgCheckboxChecked(hDlg, IDC_CHECKBOX_DYNAREC))
{
char jit_size_buf[4] = {0};
memset(&jit_size_buf[0], 0, sizeof(jit_size_buf));
cur = GetDlgItem(hDlg, IDC_JIT_BLOCK_SIZE);
GetWindowText(cur, jit_size_buf, sizeof(jit_size_buf));
jit_size = atoi(jit_size_buf);
if ((jit_size < 1) || (jit_size > 100))
{
MessageBox(hDlg, "JIT block size should be in range 1..100\nTry again", "DeSmuME", MB_OK | MB_ICONERROR);
return FALSE;
}
}
#endif
if(romloaded)
val = MessageBox(hDlg, "The current ROM needs to be reset to apply changes.\nReset now ?", "DeSmuME", (MB_YESNO | MB_ICONQUESTION));
HWND cur;
CommonSettings.UseExtBIOS = IsDlgCheckboxChecked(hDlg, IDC_USEEXTBIOS);
cur = GetDlgItem(hDlg, IDC_ARM9BIOS);
@ -6244,6 +6266,11 @@ LRESULT CALLBACK EmulationSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
CommonSettings.advanced_timing = IsDlgCheckboxChecked(hDlg, IDC_CHECBOX_ADVANCEDTIMING);
#ifdef HAVE_JIT
CommonSettings.use_jit = IsDlgCheckboxChecked(hDlg, IDC_CHECKBOX_DYNAREC);
if (CommonSettings.use_jit)
{
CommonSettings.jit_max_block_size = jit_size;
WritePrivateProfileInt("Emulation", "JitSize", CommonSettings.jit_max_block_size, IniName);
}
#endif
WritePrivateProfileInt("Emulation", "DebugConsole", ((CommonSettings.DebugConsole == true) ? 1 : 0), IniName);
@ -6347,6 +6374,10 @@ LRESULT CALLBACK EmulationSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
}
return TRUE;
}
case IDC_CHECKBOX_DYNAREC:
EnableWindow(GetDlgItem(hDlg, IDC_JIT_BLOCK_SIZE), IsDlgCheckboxChecked(hDlg, IDC_CHECKBOX_DYNAREC));
return TRUE;
}
return TRUE;
}

View File

@ -431,6 +431,7 @@
#define IDC_IMP_AUTO_FILE 1053
#define IDC_BUTTON1 1053
#define IDC_IMP_AUTO_ADVANSCENE 1054
#define IDC_JIT_BLOCK_SIZE 1054
#define IDC_IMP_MANUAL 1055
#define IDC_LIST1 1056
#define IDC_IMP_INFO_CURRENT 1056

Binary file not shown.