Commit Graph

98 Commits

Author SHA1 Message Date
wheremyfoodat
6d1ef7cb4f Memory rework pt 2 (#801)
* Memory: Rework FCRAM management entirely

Disables a lot of functionality... but I didn't want to commit too much to this commit
Also reworks virtual memory management somewhat (but needs more work)

* Accurately handle MemoryState for virtual memory

Previously all non-free blocks were marked as Reserved

* Memory: Consolidate state and permission changes

Can now use a single function to change either state, permissions, or both
Also merge vmem blocks that have the same state and permissions

* Memory: Fix double reset for FCRAM manager

Fix minor bug with permission tracking

* Memory: Implement Protect operation in ControlMemory

* Memory: Implement Unmap in ControlMemory

Also do a sanity check to make sure the memory region is free for linear allocations

* Memory: Make TLS only 0x200 bytes for each thread

Also move TLS to Base region

* RO: Unmap CROs when unloaded

Thanks @noumidev

* Kernel: Return used app memory for Commit ResourceLimit

Not quite correct, but nothing to be done until process management is improved
Also remove the stack limit for CXIs (thanks amogus)

* Kernel: Report used app memory for GetProcessInfo 2

Not really correct, but it should be accurate for applications at least

* Formatting changes

* Initial fastmem support

* PCSX2 fastmem depression

* Move away from PCSX2 fastmem

* Add enum_flag_ops.hpp

* Finally building on Windows

* Almost got a PoC

* Fix arm64 builds

* This somehow works

* This also works...

* Properly fix fastmem

* Add free region manager

* Update boost

* Add ScopeExit

* Comment out asserts on Linux/Mac/Android

* Comment out ASSERT_MSG asserts too

* Fix derp

* Attempt to fix Android

* Disable fastmem on Android

* Fix Android again maybe pt 2

* android pls

* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

* Update host_memory.cpp

* Properly reset memory arena on reset

* Proper ashmem code for Android

* more

* Add temporary Android buildjet script for faster prototype builds

* Fix fastmem (again)

* Clean up shared memory

* Remove Android BuildJet runner

* a

* Revert "a"

This reverts commit 5443ad6f2a794c19c9b1a1567ca1c7f58eed78cd.

* Re-add ELF support

* Re-add 3DSX support

* GetSystemInfo, GetProcessInfo: Memory sizes should be in bytes

* Update Boost

* Update metal-cpp

* Fix metal renderer compilation

* Fix fastmem mapping

* Clean up fastmem code

* Fix oopsie again

* Emulator: Reorder struct

* Kernel types: Cleanup

* Cleanup

* More cleanup

* Make invalid mprotects warn instead of panicking

* Add setting for toggling fastmem

* More cleanup

* Properly initialize BSS to zeroes

* Remove unused code

* Formatting

* Cleanup

* Memory/CRO: Workaround for Pokemon XY

* NCSD loader: Fix BSS (again)

* NCSD loader: Fix BSS (again) (again)

* More memory fixes

* Memory: Remove unused code

* FS: Warn on unimplemented functions instead of panic

* Update software_keyboard.cpp

* Libretro: Add fastmem option

* FRD: Stub SaveLocalAccountData

---------

Co-authored-by: PSI-Rockin <PSI-Rockin@users.noreply.github.com>
2025-08-07 20:18:09 +03:00
wheremyfoodat
9932e58bf0 Add thread debugger 2025-07-03 16:58:56 +03:00
wheremyfoodat
228068901b Add system call intercepts to Lua 2025-07-03 13:02:10 +03:00
wheremyfoodat
86d1bde845 Temporarily give 80MB to all processes (#715) 2025-02-02 23:18:54 +02:00
wheremyfoodat
84c358660c Implement Luma icache SVCs 2025-01-03 19:21:45 +02:00
wheremyfoodat
33c3e67b31 CRO: Lighter icache flushes 2025-01-03 19:14:59 +02:00
wheremyfoodat
0f80d0af7a Rename Handle to HorizonHandle, add metal-cpp submodule, format 2024-07-23 15:22:15 +03:00
wheremyfoodat
1c9a3ac3d3 Add Y2R event delay 2024-07-02 15:30:38 +03:00
wheremyfoodat
f7c6ec3b57 Properly handle DSP interrupts in HLE 2024-02-19 18:50:41 +02:00
wheremyfoodat
f58354af06 Update DSP semaphore on semaphore event signal
Fixes Pokemon X and other DSP-needy games...
2024-02-18 03:54:00 +02:00
wheremyfoodat
99a1a0133d Initial idle skip implementation 2024-01-27 01:58:21 +02:00
wheremyfoodat
85a2ca1bf4 Stub svcUnmapMemoryBlock 2024-01-24 19:06:39 +02:00
wheremyfoodat
0be099d1ea Hook up KTimer to scheduler 2024-01-22 04:04:05 +02:00
wheremyfoodat
1430f1c4c2 Implement SVC 0x3B (GetThreadContext) 2024-01-02 17:18:47 +02:00
wheremyfoodat
1f7fc2274a Add vector of timer handles 2023-11-04 18:28:28 +02:00
wheremyfoodat
5930a3d843 Handle Amiibo tag events better 2023-09-09 01:56:39 +03:00
wheremyfoodat
7bf56c2413 [CPU] Add function for clearing JIT cache 2023-09-05 20:57:48 +03:00
wheremyfoodat
cb3f7fa134 Remove hacky timer hacks 2023-08-31 22:47:43 +03:00
wheremyfoodat
1d601e41ba Merge branch 'master' into timerz 2023-08-21 18:57:18 +03:00
wheremyfoodat
434827e11e Add svcGetThreadIdealProcessor 2023-08-20 03:43:26 +03:00
wheremyfoodat
6895a1d9d6 Implement svcGetCurrentProcessorNumber 2023-08-20 01:51:24 +03:00
wheremyfoodat
51b2b8eee5 Make battery stuff configurable 2023-08-18 22:17:33 +03:00
wheremyfoodat
8881467505 I hate timers 2023-08-14 17:24:53 +03:00
wheremyfoodat
1354b0f7fa Moar timer 2023-08-14 15:13:37 +03:00
wheremyfoodat
6552f2998c OS timers part 1 2023-08-13 03:35:41 +03:00
wheremyfoodat
01a7985324 [Kernel] ExitThread should release held mutexes 2023-08-10 15:11:54 +03:00
wheremyfoodat
fb8965942c [Kernel] Implement APIs for detecting Citra & Panda 2023-08-03 11:32:51 +03:00
wheremyfoodat
3d5f1ea517 [Kernel] Add evalReschedule function 2023-08-02 19:18:15 +03:00
wheremyfoodat
8dd5b990be Thread bonk part 1: Better rescheduling maybe 2023-07-28 19:49:11 +03:00
wheremyfoodat
69b5357eb3 Optimize logging for user builds 2023-07-27 17:16:45 +03:00
Wunkolo
fde93381a5 Use std::span for CPU register-state
Following the trend of #33: `std::span` provides some useful utility
functions like `size_bytes()` and `as_bytes()` and serves as a better
non-owning "chunk of data"-type over just passing around an
`std::array&`.
2023-06-16 07:24:37 -07:00
wheremyfoodat
0c0e7a4cb9 Clean up srv interface for HID 2023-06-05 15:28:44 +03:00
liuk7071
608bf88c5f Basic input 2023-06-05 13:25:06 +02:00
wheremyfoodat
7cc7dc09f4 [FS] Implement File::Flush and fix file function headers 2023-06-03 22:25:30 +03:00
wheremyfoodat
09ba66ae60 [Kernel] Fully implement semaphores 2023-05-07 18:02:51 +03:00
wheremyfoodat
6419098851 [HID] Implement events 2023-04-29 02:45:21 +03:00
wheremyfoodat
dac77cdc1d [Kernel Add WakeupOneThread 2023-04-29 01:45:30 +03:00
wheremyfoodat
7f32c3860c [DSP] Stubbing events (vol 1) 2023-04-24 23:42:49 +03:00
wheremyfoodat
33158c7908 [Kernel] Make WaitSyncN better 2023-04-21 01:08:13 +03:00
wheremyfoodat
7f2715d06c [Kernel] Fix release mutex 2023-04-20 22:24:36 +03:00
wheremyfoodat
134d63c515 [Kernel] Moar threads 2023-04-20 22:00:51 +03:00
wheremyfoodat
0b46b92bb7 [Kernel] Add idle thread 2023-04-18 20:42:17 +03:00
wheremyfoodat
075a244dd0 [FS] Implement SetSize 2023-04-11 01:11:20 +03:00
wheremyfoodat
4bef096f04 [FS] Add directory stuff, clean up 2023-03-29 00:23:55 +03:00
wheremyfoodat
2ab777fecd [Kernel] Implement File::SetPriority 2023-03-10 01:27:30 +02:00
wheremyfoodat
5966c02737 [Kernel] Implement File::OpenLinkFile 2023-03-10 01:04:04 +02:00
wheremyfoodat
980139e588 [Kernel] Implement CreateMemoryBlock 2023-01-29 16:29:45 +02:00
wheremyfoodat
ec7c0b86b7 Make some things panic for later 2023-01-29 02:39:17 +02:00
wheremyfoodat
4e64f722e5 [Kernel] ExitThread [FS] Start implement archive 0x2345678A 2023-01-26 17:49:17 +02:00
wheremyfoodat
e052c16a36 [FS] Implement GetFileSize [PTM] Stub step functions 2023-01-23 03:24:13 +02:00