* Remove mapped dmem type
Since physical addresses can be mapped multiple times, tracking mapped pages is not necessary.
This also allows me to significantly simplify the MapMemory physical address validation logic.
* Proper implementation for sceKernelMtypeprotect
I've rewritten SetDirectMemoryType to use virtual addresses instead of physical addresses, allowing it to be used in sceKernelMtypeprotect.
To accommodate this change, I've also moved address and size alignment out of MemoryManager::Protect
* Apply memory type in sceKernelMemoryPoolCommit
* Organization
Some potentially important missing mutexes, removed some unnecessary mutexes, moved some mutexes after early error returns, and updated copyright dates
* Iterator logic cleanup
Missing end check in ClampRangeSize, and adjusted VirtualQuery and DirectMemoryQuery.
* Clang
* Adjustments
* Properly account for behavior differences in MapDirectMemory2
Undid the changes to direct memory areas, added more robust logic for changing dma types, and fixed DirectMemoryQuery to return hardware-accurate direct memory information in cases where dmas split here, but not on real hardware.
I've also changed MapMemory's is_exec flag to a validate_dmem flag, used to handle alternate behavior in MapDirectMemory2. is_exec is now determined by the use of MemoryProt::CpuExec instead.
* Clang
* Add execute permissions to physical backing
Needed for executable mappings to work properly on Windows, fixes regression in RE2 with prior commit.
* Minor variable cleanup
* Update memory.h
* Prohibit direct memory mappings with exec protections
Did a quick hardware test to confirm, only seems to be prohibited for dmem mappings though.
* Update memory.cpp
* Add support for restarting the emulator with new configurations
- Implement `Restart` function in `Emulator` to enable process relaunch with updated parameters.
- Modify `sceSystemServiceLoadExec` to use the restart functionality.
* Add logging for emulator restart and system service load execution
* Add IPC emulator PID output command
Impl `PID` output command to return the emulator process ID
- required for launches supporting emulator restart
* Add log file append mode support (used after restarting to keep the same log file)
* Keep game root between restarts
* add --wait-for-debugger option flag
* add --wait-for-pid flag
used for sync between parent & child process during restart
* impl restart via ipc
* fix override game root
* add qt flags to allow restart
* Implement sceKernelMemoryPoolGetBlockStats
Not entirely sure on the logic behind the cached blocks work, but flushed blocks seems to just be based on committed direct memory.
* Fix comment
* Refactor direct memory areas
At this point, swapping the multiple booleans for an enum is cleaner, and makes it easier to track the state of a direct memory area.
I've also sped up the logic for mapping direct memory by checking for out-of-bounds physical addresses before looping, and made the logic more solid using my dma type logic.
* Fix PoolCommit assert
Windows devices will throw an access violation if we don't check for iterator reaching end.
* Fix isDevKit
Previously, isDevKit could increase the physical memory used above the length we reserve in the backing file.
* Physical backing for flexible allocations
I took the simple approach here, creating a separate map for flexible allocations and pretty much just copying over the logic used in the direct memory map.
* Various fixups
* Fix mistake #1
* Assert + clang
* Fix 2
* Clang
* Fix CanMergeWith
Validate physical base for flexible mappings
* Clang
* Physical backing for pooled memory
* Allow VMA splitting in NameVirtualRange
This should be safe, since with the changes in this PR, the only issues that come from discrepancies between address space and vma_map are issues related to vmas being larger than address space mappings. NameVirtualRange will only ever shrink VMAs by naming part of one.
* Fix
* Fix NameVirtualRange
* Revert NameVirtualRange changes
Seems like it doesn't play nice for Windows
* Clean up isDevKit logic
We already log both isNeo and isDevKit in Emulator::Run, so the additional logging in MemoryManager::SetupMemoryRegions isn't really necessary.
I've also added a separate constant for non-pro devkit memory, as suggested.
Finally I've changed a couple constants to use the ORBIS prefix we generally follow here, instead of the SCE prefix.
* Erase flexible memory contents from physical memory on unmap
Flexible memory should not be preserved on unmap, so erase flexible contents from the physical backing when unmapping.
* Expand flexible memory map
Some games will end up fragmenting the physical backing space used for flexible memory. To reduce the frequency of this happening under normal circumstances, allocate the entirety of the remaining physical backing to the flexible memory map.
This is effectively a workaround to the problem, but at the moment I think this should suffice.
* Clang
* ajm: handle ParseRiffheader flag
* small optimizations and cleanup
* allow uninitialized instances handle RIFF
* fixed audio cutoff and small refactoring
* small fix to the returned data
* fix gapless init, reset total samples on RIFF init
* warning reporting + consume input buffer on gapless loop
* avplayer: code improvements
* avplayer: implemented pause/resume
* avplayer: implemented sync modes
* avplayer: issue warning on loopback
* avplayer: sync on video ts in default mode when audio ts is not available
* avplayer: removed waits for the frame in Get*Data, replaced cv with sleep
* avplayer: removed all waits from GetVideoData
* avplayer: fix warning propagation + small fixes
* Using texture memory for video frames, dropped video frame cache, syncing audio to video
* do not sync to audio when audio is not enabled
* removed logs, fixed sync
* reverted the removal of pre-allocated buffers
* New Bloodborne image for README
* Replace P4G with Driveclub
So Atlus doesn't go ham on us just like RPCS3.
* Update README.md
I hope I got the Yakuza game correct
* Downscale Project DIVA image to 720p
So the table scale isn't weird
* Whoops
* Update README.md
* Yakuza image is actually 1280x720
Should fix the misaligning
* Logic update, no QT ui
* Fixing errors
* Gui boxes
* fixes
* prevent device list refreshing too fast when game not running
* Removed duplicate Socket declarations in kernel/file_system.cpp and fs.h
* Fixed clang-format and micDevice errors
* Ran clang-format and fixed rebase compiler issues
* Settings dialog fix
* Addressed squidbus' concerns
* Update config.cpp to adhere to clang-format
* Removed a space causing clang-format to complain
* Addressed squidbus' concerns and added fallbacks
Concerns:
- Changed dev_name construct to remove unnecessary cast
- Added an invalid AudioDeviceID macro to replace magic number
---------
Co-authored-by: rainmakerv2 <30595646+rainmakerv3@users.noreply.github.com>
* Fix: Add libbsd dependency for Linux builds
Adds conditional libbsd support to resolve strlcpy undefined reference
on Linux systems. Includes proper CMake detection and header includes.
* Fix: Use internal strlcpy implementation for Linux
- Extend existing Windows strlcpy implementation to Linux
- Remove libbsd dependency from CMakeLists.txt
- Resolves undefined reference to strlcpy on glibc systems
Uses the project's existing approach instead of adding external dependencies.
* Group game-specific and non-game-specific items in the same tabs
* Fix rebase
* Transfer default settings tab to general, rename some items
* Fix experimental tab contents not filling the tab
* prevent saving game specific value if no valid value provided
* Fix console language saving, add error message if trying to save nullopt
The DB_SHADER_CONTROL register has several enable flags which must be set before certain depth exports are enabled.
This commit adds logic to respect the values in this register when performing depth exports, which fixes the regression in earlier versions of KNACK.
I've also renamed DepthBufferControl to DepthShaderControl, since that's closer to the official name for the register.