aboutsummaryrefslogtreecommitdiff
path: root/src/ARMJIT.cpp
diff options
context:
space:
mode:
authorJesse Talavera <jesse@jesse.tg>2023-12-05 10:47:16 -0500
committerGitHub <noreply@github.com>2023-12-05 16:47:16 +0100
commit090627b3c19488e36677113e2f1ac16bdb4e2d05 (patch)
treed731b7b302801c9317c34584cdebb811b93739d0 /src/ARMJIT.cpp
parentae91d89f7c18f6b4153deeef7e3ebe14a1d849fe (diff)
Remove the last `ConfigEntry` state (#1902)
* Get rid of `ConfigEntry::ExternalBIOSEnable` - Now the BIOS files themselves are checked - The frontend's `Config::ExternalBIOSEnable` is not affected * Add `JITArgs` * Pass the JIT status to the `ARM` constructors * Encapsulate `NDS::EnableJIT` * Pass `JITArgs` to `ARMJIT`'s constructor * Remove the `JIT_*` `ConfigEntry`s in favor of members - Allow all the JIT args to be set with `NDS::SetJITArgs` - Encapsulate the JIT-related parameters in `ARMJIT` so they can reset the block cache if changed - Update the active (or newly-created) console in the frontend with adjusted JIT args * Make audio bit depth and interpolation configurable in `NDSArgs` - Define enums for both - Give those settings default values in `NDSArgs` - Remove `ConfigEntry::AudioBitDepth` - Initialize these settings in the relevant SPU constructors * Move the last DSi-specific logic in `Reset` to its own subclass * Remove `ConfigEntry::DSi_FullBIOSBoot` - Add members to `DSi` instead for getting and setting this - Update the frontend to accommodate these changes * Oops, missed a spot * Remove `ConfigEntry::Firm_MAC` and `Platform::GetConfigArray` - Also move the MAC parsing code to `ROMManager` * Remove the last `ConfigEntry` state - Make GDB support configurable via members * Add some `#ifdef`s that I'd almost forgotten
Diffstat (limited to 'src/ARMJIT.cpp')
-rw-r--r--src/ARMJIT.cpp60
1 files changed, 50 insertions, 10 deletions
diff --git a/src/ARMJIT.cpp b/src/ARMJIT.cpp
index b938dfb..5e0e207 100644
--- a/src/ARMJIT.cpp
+++ b/src/ARMJIT.cpp
@@ -237,16 +237,6 @@ ARMJIT::~ARMJIT() noexcept
void ARMJIT::Reset() noexcept
{
- MaxBlockSize = Platform::GetConfigInt(Platform::JIT_MaxBlockSize);
- LiteralOptimizations = Platform::GetConfigBool(Platform::JIT_LiteralOptimizations);
- BranchOptimizations = Platform::GetConfigBool(Platform::JIT_BranchOptimizations);
- FastMemory = Platform::GetConfigBool(Platform::JIT_FastMemory);
-
- if (MaxBlockSize < 1)
- MaxBlockSize = 1;
- if (MaxBlockSize > 32)
- MaxBlockSize = 32;
-
JitEnableWrite();
ResetBlockCache();
@@ -491,6 +481,56 @@ void ARMJIT::RetireJitBlock(JitBlock* block) noexcept
}
}
+void ARMJIT::SetJITArgs(JITArgs args) noexcept
+{
+ args.MaxBlockSize = std::clamp(args.MaxBlockSize, 1u, 32u);
+
+ if (MaxBlockSize != args.MaxBlockSize
+ || LiteralOptimizations != args.LiteralOptimizations
+ || BranchOptimizations != args.BranchOptimizations
+ || FastMemory != args.FastMemory)
+ ResetBlockCache();
+
+ MaxBlockSize = args.MaxBlockSize;
+ LiteralOptimizations = args.LiteralOptimizations;
+ BranchOptimizations = args.BranchOptimizations;
+ FastMemory = args.FastMemory;
+}
+
+void ARMJIT::SetMaxBlockSize(int size) noexcept
+{
+ size = std::clamp(size, 1, 32);
+
+ if (size != MaxBlockSize)
+ ResetBlockCache();
+
+ MaxBlockSize = size;
+}
+
+void ARMJIT::SetLiteralOptimizations(bool enabled) noexcept
+{
+ if (LiteralOptimizations != enabled)
+ ResetBlockCache();
+
+ LiteralOptimizations = enabled;
+}
+
+void ARMJIT::SetBranchOptimizations(bool enabled) noexcept
+{
+ if (BranchOptimizations != enabled)
+ ResetBlockCache();
+
+ BranchOptimizations = enabled;
+}
+
+void ARMJIT::SetFastMemory(bool enabled) noexcept
+{
+ if (FastMemory != enabled)
+ ResetBlockCache();
+
+ FastMemory = enabled;
+}
+
void ARMJIT::CompileBlock(ARM* cpu) noexcept
{
bool thumb = cpu->CPSR & 0x20;