aboutsummaryrefslogtreecommitdiff
path: root/src/ARMJIT.cpp
Commit message (Collapse)AuthorAge
* Fix detection of native NDS ARM BIOS images (#1910)Jesse Talavera2023-12-15
| | | | | | | | | | * Fix detection of native NDS ARM BIOS images - Instead of checking for built-in BIOS images, now the altered methods check for native ones - The CRC32 must match exactly; patched BIOS images will result in `false` * Encapsulate `NDS::ARM9BIOS` and `ARM7BIOS` - Also compute the checksum only when setting the BIOS
* Remove the last `ConfigEntry` state (#1902)Jesse Talavera2023-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Refactor `NDS` and `DSi` to be objects (#1893)Jesse Talavera-Greenberg2023-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First crack at refactoring NDS and DSi into objects - Remove all global/`static` variables in `NDS` and related classes - Rely more on virtual dispatch when we need to pick methods at runtime - Pass `NDS&` or `DSi&` to its constituent components where necessary - Introduce some headers or move some definitions to break `#include` cycles * Refactor the frontend to accommodate the core's changes * Move up `SchedList`'s declaration - Move it to before the components are initialized so the `map`s inside are initialized - Fields in C++ are initialized in the order they're declared * Fix a crash when allocating memory * Fix JIT-free builds * Fix GDB-free builds * Fix Linux builds - Explicitly qualify some member types in NDS, since they share the same name as their classes * Remove an unnecessary template argument - This was causing the build to fail on macOS * Fix ARM and Android builds * Rename `Constants.h` to `MemConstants.h` * Add `NDS::IsRunning()` * Use an `#include` guard instead of `#pragma once`
* Move all core types into namespaces (#1886)Jesse Talavera-Greenberg2023-11-25
| | | | | | | | * Reorganize namespaces - Most types are now moved into the `melonDS` namespace - Only good chance to do this for a while, since a big refactor is next * Fix the build
* Refactor the JIT to be object-oriented (#1879)Jesse Talavera-Greenberg2023-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move TinyVector to a new file - So it's less sensitive to #include ordering * Forgot to include assert.h * Refactor ARMJIT_Memory into an object * Oops, forgot a declaration * Refactor ARMJIT to be contained in an object * Remove an unused function declaration * Add a missing #include * Remove a now-unused global * Use ARMJIT_Memory's own memory access functions * Fix some omissions in the ARM JIT * Move libandroid to be a member of ARMJIT_Memory instead of a global * Default-initialize most fields in ARMJIT_Compiler.h * Define NOOP_IF_NO_JIT * Finish refactoring the JIT to be object-oriented
* update copyright yearsArisotura2023-11-04
|
* Make the NDS teardown more robust (#1798)Jesse Talavera-Greenberg2023-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make cleanup a little more robust to mitigate undefined behavior - Add some null checks before cleaning up the GPU3D renderer - Make sure that all deleted objects are null - Move cleanup logic out of an assert call - Note that deleting a null pointer is a no-op, so there's no need to check for null beforehand - Use RAII for GLCompositor instead of Init/DeInit methods * Replace a DeInit call that I missed * Make ARMJIT_Memory less likely to generate errors - Set FastMem7/9Start to nullptr at the end - Only close and unmap the file if it's initialized * Make Renderer3D manage its resources with RAII * Don't try to deallocate frontend resources that aren't loaded * Make ARMJIT_Memory::DeInit more robust on the Switch * Reset MemoryFile on Windows to INVALID_HANDLE_VALUE, not nullptr - There is a difference * Don't explicitly store a Valid state in GLCompositor or the 3D renderers - Instead, create them with static methods while making the actual constructors private * Make initialization of OpenGL resources fail if OpenGL isn't loaded * assert that OpenGL is loaded instead of returning failure
* fix JIT backjump detectionRSDuck2023-04-13
| | | | pretty embarrassing to loop variable mixup
* I'm stupidRSDuck2023-03-28
|
* comment out JIT debug codeRSDuck2023-03-28
|
* Introduce `Platform::Log` (#1640)Jesse Talavera-Greenberg2023-03-23
| | | | | | | | | | | | | * Add Platform::Log and Platform::LogLevel * Replace most printf calls with Platform::Log calls * Move a brace down * Move some log entries to one Log call - Some implementations of Log may assume a full line * Log the MAC address as LogLevel::Info
* invalidate JIT blocks in ARM7 WVRAM when it's remappedRSDuck2022-08-22
|
* fix copyright headersArisotura2022-03-07
|
* update copyright headersArisotura2022-01-09
|
* decouple JIT from Config. bahahahahahArisotura2021-11-17
|
* more accurate DTCM checkArisotura2021-10-28
|
* more fixes for literal invalidationRSDuck2021-08-31
|
* fix #1187RSDuck2021-08-31
| | | | how could this go on unnoticed for so long?
* JIT: don't lengthen blocks on a skipped SVCRSDuck2021-08-04
| | | | SVC would need special handling because of the bank switching
* ARM64 macOS JIT - fix warnings + some cleanupWaluigiWare642021-07-23
|
* support allocating more registers for aarch64 JITRSDuck2021-06-29
| | | | also some minor fixes for the x64 JIT as well
* Fix some compiler warningsWaluigiWare642021-05-03
|
* Disable JIT write-protect when de-initialising on ARM64 macOSWaluigiWare642021-03-22
|
* update copyright year and add missing GPL headersRSDuck2021-03-12
|
* Fix the JIT Code Memory on ARM64 Macs (#916)WaluigiWare642021-02-22
|
* Fix some compiler warningsWaluigiWare642021-01-25
|
* fix JIT block hash after a merged thumb BLRSDuck2021-01-05
| | | | fixes #928
* JIT fixesRSDuck2020-11-09
| | | | | | | | - fix fastmem problems on linux - small fix memory leak - SlowWrite functions always take in a 32-bit variable so that the C compiler knows that the values aren't necessary zero extended - a few other stylistic things - handle SIGBUS as well (for macos)
* Fix compilation issues on pedantic cpp compilers. (#783)Filippo Scognamiglio2020-10-31
| | | | | * Fix compilation issues on pedantic cpp compilers. * Avoid using fullblown static function.
* remove some UBRSDuck2020-09-04
| | | | | | | - savestates used to read a four bytes from a single byte value - a few unassigned variables - some other things - also make the ROR macro an inline function
* JIT: fix QDSUB/QSUB for interpreter runRSDuck2020-08-24
|
* use unordered map for JIT RestoreCandidatesRSDuck2020-08-14
| | | | also fix WifiRead32?
* reset JIT fastmem on JIT block cache reset as wellRSDuck2020-07-31
|
* check IRQ first then Idle loopRSDuck2020-07-28
| | | | apparently I put it this way for a reason
* for some reason tabs and spaces were mixedRSDuck2020-07-23
|
* make linux work and fix a few bugsRSDuck2020-07-04
|
* reconcile DSi and JIT, fastmem for x64 and WindowsRSDuck2020-06-30
|
* first steps in bringing over the JIT refactor/fastmemRSDuck2020-06-16
|
* use instr hash as key for restore candidatesRSDuck2020-05-09
| | | | makes Golden Sun burn a little slower through the JIT memory
* rewrite JIT memory emulationRSDuck2020-05-09
|
* implement msr and mrs for the x64 JITRSDuck2020-04-26
|
* implement block linking + some refactoringRSDuck2020-04-26
| | | | currently only supported for x64
* re add error for unsupported JIT platformsRSDuck2020-04-26
|
* move ARM64 JIT backend hereRSDuck2020-04-26
|
* improve nop handling and proper behaviour for LDM^RSDuck2020-04-26
| | | | fixes dslinux
* make literal optimisation more reliableRSDuck2020-04-26
| | | | fixes spanish Pokemon HeartGold
* integrate changes from ARM64 backend and moreRSDuck2020-04-26
| | | | | | | | | - 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)
* decrease jit block cache address granularityRSDuck2020-04-26
| | | | | | | fixes Dragon Quest IX move code with side effects out of assert, fixes release build (thanks to m4wx for this one) also remove some leftovers of jit pipelining
* new block cache and much more...RSDuck2020-04-26
| | | | | | | | | - more reliable code invalidation detection - blocks aren't stopped at any branch, but are being followed if possible to get larger blocks - idle loop recognition - optimised literal loads, load/store cycle counting and loads/stores from constant addresses
* load register only if neededRSDuck2020-04-26
| | | | | - do thumb bl long merge in the first step - preparations for better branch jitting