Commit Graph

2333 Commits

Author SHA1 Message Date
DesperateProgrammer a8306f2aa0 Removed some debug remains
Updated documenting comments for the DCacheClear* methods
2024-02-06 08:29:01 +01:00
DesperateProgrammer 129a3e0535 Added write-back ability in addition to write-through for the data cache 2024-02-06 08:19:05 +01:00
DesperateProgrammer 97aabe0f4f
Merge branch 'melonDS-emu:master' into mem9_timings 2024-02-05 12:41:41 +01:00
DesperateProgrammer 4b20c1bc0f Added more documenting comments
Replaced mogic values with named constants
Added const specifier to some argument and subsequent calls
2024-02-05 12:30:39 +01:00
DesperateProgrammer d5a351aefe Added more documenting comments 2024-02-04 13:56:03 +01:00
DesperateProgrammer b1637e25a4 Added more function documenting comments
Added const properties to the CP15Write/Read functions
2024-02-04 12:48:06 +01:00
DesperateProgrammer 2a385b5277 Cleaned up some more magic numbers
Fixed a bug causing overlapping protection regions priority not taken into account, when access permission or cachability bits were changed only on the least priority overlap
2024-02-04 12:31:57 +01:00
DesperateProgrammer f9a831e446 Removed Thumb Check on CP15 Access restriction as MCR/MRC are not present in thumb 2024-02-03 16:20:40 +01:00
DesperateProgrammer 02d6fbacf6 Added several doxygen-style comments for documentation 2024-02-02 14:43:23 +01:00
Jesse Talavera d48e5f2da0
Fix DSiWare detection (#1969)
- According to GBATek, all DSiWare games have a high title ID of 0x00030004
- Some homebrew apps set the Unitcode bits to DSi mode to enable support of DSi features
2024-02-01 14:36:35 +01:00
DesperateProgrammer c0075404fd Included the I/DCache Streaming disable bits in cache lookup 2024-02-01 13:25:07 +01:00
DesperateProgrammer 9fa814b68e Added check of op1 in MCR/MRC
Fixed Cache Debug registers were accessible, when op1 != 3 in MCR/MRC instructions
Added BIST Test Status register and its cache linefill disable bits
2024-02-01 13:15:03 +01:00
DesperateProgrammer 81c9434116 Added CP15 Trace Process ID 2024-02-01 12:01:16 +01:00
DesperateProgrammer 1a9179b8d0 Removed unneccessary wfcsettings file 2024-02-01 08:49:04 +01:00
DesperateProgrammer c8204a8c63 Further clean up, removal of magic numbers from CP15.cpp
Split the cp15 constants into CP15_Constants.h instead from MemConstants.
2024-02-01 08:36:52 +01:00
DesperateProgrammer 06ea3f68ec Cleaned up and fastened up 2024-01-31 12:20:41 +01:00
Nadia Holmquist Pedersen 7dd4152d67 Add MaxFPS setting 2024-01-26 13:06:32 +01:00
DesperateProgrammer 1dc15a0d07 Simplified set selection adjustment for the cache lock down 2024-01-26 10:09:10 +01:00
DesperateProgrammer caa90dd5ac Changed DCache Random Cache-Line selection to a double Galoise LFSR 2024-01-26 09:21:08 +01:00
DesperateProgrammer a0f4eb691b Fixed Typo and missing file on the cache type constants 2024-01-25 12:12:31 +01:00
DesperateProgrammer cd60c13ea1 Replaced Magic numbers in CP15 cache type register 2024-01-25 12:09:17 +01:00
DesperateProgrammer 6959d6f2b0 Added privilege checks for reading & writing CP15 cache registers 2024-01-25 11:52:37 +01:00
DesperateProgrammer 8a0ad8ac3f Added permission checks to CP15 Cache register write operations 2024-01-25 11:44:26 +01:00
DesperateProgrammer 3c94802704 Removed magic number from Cache Fill timings. 2024-01-25 11:05:58 +01:00
DesperateProgrammer bf0767b4f3 Added CP15 prefetch routine 2024-01-25 10:48:04 +01:00
DesperateProgrammer 028b674352
Merge branch 'melonDS-emu:master' into mem9_timings 2024-01-25 10:24:05 +01:00
Nadia Holmquist Pedersen 890035c688 readme: fix macOS build badge 2024-01-25 10:21:19 +01:00
DesperateProgrammer 9d2e515947 Implemented CacheLockDown 2024-01-25 10:08:57 +01:00
DesperateProgrammer 7b8327d3a4 Disabled Caches, when JIT is enabled 2024-01-25 09:05:51 +01:00
DesperateProgrammer 71b5c829aa Fixed unaligned access to data cache 2024-01-24 14:53:55 +01:00
DesperateProgrammer b23cb819bb Changed write to cached data from invalidating to updating the cached data to get nearer to hw timings 2024-01-24 11:57:57 +01:00
DesperateProgrammer f67e93918c Fixed data cache using only 1 cycle on miss. 2024-01-24 11:02:34 +01:00
DesperateProgrammer a46f972c21 Added Cache Data Write and Read via CP15 2024-01-24 10:37:17 +01:00
Steveice10 4b576d066e
Add support for using a portable directory without special build flags. (#1956) 2024-01-24 10:27:25 +01:00
Nadia Holmquist Pedersen 77274735d6 the readme for delete-artifact doesn't have this anymore so maybe it'll
stop failing if I remove it
2024-01-24 09:52:22 +01:00
DesperateProgrammer 0a07661b57 Implemented DCache and several CP15 registers 2024-01-24 09:51:56 +01:00
DesperateProgrammer b6b0197dd3 Implemented "weird" instruction cache invalidation by Set/Way 2024-01-19 10:38:07 +01:00
DesperateProgrammer d9fcc2ec2c Replaced more CP15 magic values with named constants 2024-01-19 10:24:02 +01:00
DesperateProgrammer 434c234098 Enable instruction cache routines. Fixed typos in constants. 2024-01-19 10:00:02 +01:00
DesperateProgrammer 1019afee92 Cleaned up magic numbers and simplified (not yet used) ICache functions
Marked reading CP15 Cache Dirty Bit as not present
2024-01-19 08:30:38 +01:00
DesperateProgrammer a4f8e6fe29 Updated savestate version 2024-01-18 14:39:08 +01:00
DesperateProgrammer 716b4af815 Added ICacheLockDown and DCacheLockDown to CP15 savestate 2024-01-18 14:35:03 +01:00
DesperateProgrammer 3b13cf755a
Merge branch 'melonDS-emu:master' into mem9_timings 2024-01-18 09:44:44 +01:00
DesperateProgrammer a2f711c048 Added CP15 Data and Instruction Cache Lockdown Register 2024-01-18 09:39:33 +01:00
Arisotura 7897bd387b also add writes while we're at it, we know Gericom's gonna abuse them someday :P 2024-01-17 18:54:48 +01:00
Arisotura f4c8202b1a add missing 8/16-bit reads to ROMCnt and ROM SPICnt 2024-01-17 18:50:08 +01:00
Jesse Talavera 740305cc25
Don't reset the VRAM cache if saving a state (#1944)
- This fixes a flickering bug in melonDS DS
2024-01-08 15:20:48 +01:00
Jesse Talavera 8143f54956
Protect savestates while the threaded software renderer is running (#1864)
* First crack at ensuring the render thread doesn't touch GPU state while it's being serialized

* Get rid of the semaphore wait

* Add some extra fields into GPU3D's serialization

* Oops, TempVertexBuffer is already serialized

* Move vertex serialization into its own method

* Lock the GPU3D state when rendering on the render thread or serializing it

* Revert "Lock the GPU3D state when rendering on the render thread or serializing it"

This reverts commit 2f49a551c1.

* Add comments that describe the synchronization within GPU3D_Soft

- I need to understand it before I can solve my actual problem
- Now I do

* Revert "Revert "Lock the GPU3D state when rendering on the render thread or serializing it""

This reverts commit 1977566a6d.

* Let's try locking the GPU3D state throughout NDS::RunFrame

- Just to see what happens

* Slim down the lock's scope

* Narrow the lock's scope some more

* Remove the lock entirely

* Try protecting the GPU3D state with just a mutex

- I'll clean this up once I know it works

* Remove a duplicate method definition

* Add a missing `noexcept` specifier

* Remove an unused function

* Cut some non-hardware state from `GPU3D`'s savestate

* Assume that the next frame after loading a savestate won't be identical

* Actually, it _is_ worth it

* Don't serialize the clip matrix

- It's recalculated anyway

* Serialize `RenderPolygonRAM` as an array of indexes

* Clean up some comments

- I liked the dialogue style, but oh well

* Try restarting the render thread instead of using the lock

- Let's see what happens

* Put the lock back

* Fix some polygon and vertex indexes being saved incorrectly

- Taking the difference between two pointers results in the number of elements, not the number of bytes

* Remove `SoftRenderer::StateBusy` since it turns out we don't need it

- The real synchronization was the friends we made along the way
2024-01-07 23:39:43 +01:00
Eric Warmenhoven f68f55d002
Reset the JIT when loading savestate (#1937)
The effect of this change is simply to call JitEnableWrite(), which is
necessary on apple silicon
2024-01-03 14:42:08 +01:00
Jesse Talavera d1cbc41115
Slight fixups with `FATStorage` (#1934)
* Reload the SD card for `CartSD` and all subclasses

* Make `ROMManager::LoadDLDISDCard` delegate to `GetDLDISDCardArgs`

* Add a method overload for `CartSD::SetSDCard`

* Initialize new SD card images with the correct size

* Sync the old card to the host (if applicable) when move-assigning a new one

* Only sync the old card to the host if it's not read-only

* Remove static state in `FATStorage`

- Replace `FF_ReadStorage` and `FF_WriteStorage` with lambda functions
- Keep open and use the single `File` handle throughout the `FATStorage`'s life
2024-01-03 13:32:17 +01:00