aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2019-10-18 13:29:17 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-04-26 13:05:05 +0200
commit81f38c14be0d9ba5a3da8f67d9719ed2c47279c5 (patch)
treec563e0d7116396aae2cc888a1e2e0b18f2013987 /src/libui_sdl
parentaa23f21b8df9780578adf6e6ea6bcfba3fee83bb (diff)
integrate changes from ARM64 backend and more
- better handle LDM/STM in reg alloc - unify Halted and IRQ in anticipation for branch inlining - literal optimisations can be disabled in gui - jit blocks follow simple returns - fix idle loop detection - break jit blocks on IRQ (fixes saving in Pokemon White)
Diffstat (limited to 'src/libui_sdl')
-rw-r--r--src/libui_sdl/DlgEmuSettings.cpp31
-rw-r--r--src/libui_sdl/main.cpp2
2 files changed, 27 insertions, 6 deletions
diff --git a/src/libui_sdl/DlgEmuSettings.cpp b/src/libui_sdl/DlgEmuSettings.cpp
index 45e8e0c..0df9c6c 100644
--- a/src/libui_sdl/DlgEmuSettings.cpp
+++ b/src/libui_sdl/DlgEmuSettings.cpp
@@ -43,6 +43,7 @@ uiCheckbox* cbDirectBoot;
uiCheckbox* cbJITEnabled;
uiEntry* enJITMaxBlockSize;
uiCheckbox* cbJITBranchOptimisations;
+uiCheckbox* cbJITLiteralOptimisations;
#endif
int OnCloseWindow(uiWindow* window, void* blarg)
@@ -66,14 +67,16 @@ void OnOk(uiButton* btn, void* blarg)
char* maxBlockSizeStr = uiEntryText(enJITMaxBlockSize);
long blockSize = strtol(maxBlockSizeStr, NULL, 10);
bool branchOptimisations = uiCheckboxChecked(cbJITBranchOptimisations);
+ bool literalOptimisations = uiCheckboxChecked(cbJITLiteralOptimisations);
uiFreeText(maxBlockSizeStr);
if (blockSize < 1)
blockSize = 1;
if (blockSize > 32)
blockSize = 32;
- if (enableJit != Config::JIT_Enable || blockSize != Config::JIT_MaxBlockSize ||
- branchOptimisations != Config::JIT_BrancheOptimisations)
+ if (enableJit != Config::JIT_Enable || blockSize != Config::JIT_MaxBlockSize
+ || branchOptimisations != Config::JIT_BrancheOptimisations
+ || literalOptimisations != Config::JIT_LiteralOptimisations)
{
if (RunningSomething &&
!uiMsgBoxConfirm(win, "Reset emulator",
@@ -82,7 +85,8 @@ void OnOk(uiButton* btn, void* blarg)
Config::JIT_Enable = enableJit;
Config::JIT_MaxBlockSize = blockSize;
- Config::JIT_BrancheOptimisations = uiCheckboxChecked(cbJITBranchOptimisations);
+ Config::JIT_BrancheOptimisations = branchOptimisations;
+ Config::JIT_LiteralOptimisations = literalOptimisations;
restart = true;
}
@@ -108,11 +112,13 @@ void OnJITStateChanged(uiCheckbox* cb, void* blarg)
{
uiControlEnable(uiControl(enJITMaxBlockSize));
uiControlEnable(uiControl(cbJITBranchOptimisations));
+ uiControlEnable(uiControl(cbJITLiteralOptimisations));
}
else
{
uiControlDisable(uiControl(enJITMaxBlockSize));
uiControlDisable(uiControl(cbJITBranchOptimisations));
+ uiControlDisable(uiControl(cbJITLiteralOptimisations));
}
}
#endif
@@ -174,9 +180,25 @@ void Open()
uiBox* row = uiNewHorizontalBox();
uiBoxAppend(in_ctrl, uiControl(row), 0);
- cbJITBranchOptimisations = uiNewCheckbox("Branch optimisations (breaks in rare cases games!)");
+ uiLabel* lbl = uiNewLabel("If you experience problems with a certain game, you can try disabling these options:");
+ uiBoxAppend(row, uiControl(lbl), 0);
+ }
+
+ {
+ uiBox* row = uiNewHorizontalBox();
+ uiBoxAppend(in_ctrl, uiControl(row), 0);
+
+ cbJITBranchOptimisations = uiNewCheckbox("Branch optimisations");
uiBoxAppend(row, uiControl(cbJITBranchOptimisations), 0);
}
+
+ {
+ uiBox* row = uiNewHorizontalBox();
+ uiBoxAppend(in_ctrl, uiControl(row), 0);
+
+ cbJITLiteralOptimisations = uiNewCheckbox("Literal optimisations");
+ uiBoxAppend(row, uiControl(cbJITLiteralOptimisations), 0);
+ }
}
#endif
@@ -214,6 +236,7 @@ void Open()
OnJITStateChanged(cbJITEnabled, NULL);
uiCheckboxSetChecked(cbJITBranchOptimisations, Config::JIT_BrancheOptimisations);
+ uiCheckboxSetChecked(cbJITLiteralOptimisations, Config::JIT_LiteralOptimisations);
#endif
uiControlShow(uiControl(win));
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index c3db88d..0066668 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -2675,8 +2675,6 @@ void RecreateMainWindow(bool opengl)
int main(int argc, char** argv)
{
- freopen("miauz.txt", "w", stdout);
-
srand(time(NULL));
printf("melonDS " MELONDS_VERSION "\n");