Commit Graph

31 Commits

Author SHA1 Message Date
d1eff4acf5 update copyright headers (about time) 2025-05-27 00:31:37 +02:00
99ce959913 Multiinstance jit (#2201)
* works on Linux x64
still needs to be fixed for everything else

* use lots of PROT_NONE memory to reliably reserve virtual address space

* multi instance fastmem on Linux

* Windows

* blarg

* disable fastmem if the page size is not 4kb

* fix fast mem dialog option

* make aarch64 work as well

* fastmem 16kb pages support
2024-11-18 20:43:05 +01:00
8fc403cdad update copyright headers 2024-06-15 17:01:19 +02:00
72d4eba477 Rearrange some #includes 2023-12-08 17:19:00 +01:00
53e5aa6298 Exclude JIT-related declarations more aggressively 2023-12-08 17:19:00 +01:00
090627b3c1 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
2023-12-05 16:47:16 +01:00
e973236203 Refactor NDS and DSi to be objects (#1893)
* 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`
2023-11-28 23:16:41 +01:00
346dd4006e Move all core types into namespaces (#1886)
* 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
2023-11-25 18:32:09 +01:00
544fefa27f Refactor the JIT to be object-oriented (#1879)
* 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
2023-11-18 16:40:54 +01:00
ac38faef14 update copyright years 2023-11-04 00:21:46 +01:00
32609bbc98 invalidate JIT blocks in ARM7 WVRAM when it's remapped 2022-08-22 00:39:08 +02:00
9394dde67a fix copyright headers 2022-03-07 21:08:54 +01:00
35cc79787d update copyright headers 2022-01-09 02:15:50 +01:00
c1dcd585be decouple JIT from Config. bahahahahah 2021-11-17 18:15:50 +01:00
8513900892 ARM64 macOS JIT - fix warnings + some cleanup 2021-07-23 14:07:23 +01:00
436b3c4c1d update copyright year and add missing GPL headers 2021-03-12 20:07:40 +01:00
c5381d2911 reconcile DSi and JIT, fastmem for x64 and Windows 2020-06-30 23:50:41 +02:00
e335a8ca76 first steps in bringing over the JIT refactor/fastmem 2020-06-16 12:11:19 +02:00
0f53a34551 rewrite JIT memory emulation 2020-05-09 00:45:05 +02:00
3787bab1f6 implement block linking + some refactoring
currently only supported for x64
2020-04-26 13:05:17 +02:00
386100c053 make literal optimisation more reliable
fixes spanish Pokemon HeartGold
2020-04-26 13:05:06 +02:00
a687be9879 new block cache and much more...
- 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
2020-04-26 13:05:03 +02:00
5338c28f40 load register only if needed
- do thumb bl long merge in the first step
- preparations for better branch jitting
2020-04-26 13:05:02 +02:00
5ea91b8a03 optimise away unneeded flag sets
- especially useful for thumb code and larger max block sizes
- can still be improved upon
2020-04-26 13:05:00 +02:00
9d180c7bbc jit: decrease blockcache AddrMapping size for ARM9 2020-04-26 13:03:09 +02:00
9d76d63af5 jit: make everything configurable 2020-04-26 13:03:03 +02:00
c58fdbd66b jit: branch instructions 2020-04-26 13:02:58 +02:00
2c44bf927c JIT: most mem instructions working
+ branching
2020-04-26 13:02:57 +02:00
5f932cdf48 JIT: compilation of word load and store 2020-04-26 13:02:56 +02:00
ebce9f035f JIT: implemented most ALU instructions 2020-04-26 13:02:55 +02:00
c5c342c009 JIT: base
all instructions are interpreted
2020-04-26 13:02:53 +02:00