Open
Conversation
* select * select for windows * fixed windows only function * windows error converts * fixed up * fixed compile * another implementation for windows * draft rewrite for windows * implementation for windows * added some debugging info * more debugging * extensive log * Windows: Add device files to output fd_sets Cyberpunk 2077 breaks without this. Also added some formatting changes, to bring the implementation closer to our typical coding standards. * Clang * Formatting + cleanup Removed some excessive logging used for debugging, and did some cleanup on the non-Windows implementation. --------- Co-authored-by: georgemoralis <giorgosmrls@gmail.com> Co-authored-by: Stephen Miller <millerste004@gmail.com>
* video_core: Rework detiling * video_core: Support tiling and macrotile detiling * clang format * image_info: Cleanups * resource: Revert some changes * texture_cache: Fix small error * image_info: Set depth flag on depth promote * buffer_cache: Remove level check * tile_manager: Handle case of staging buffer causing flush * image_info: Add 2D thick array mode * image_info: Add slices to mip size * tile_manager: Set bank swizzle * buffer_cache: Support image copies from DmaData * vk_rasterizer: Accelerate trivial render target copies with compute Before tiling PR compute image copies were done with the following sequence vkCmdCopyImageToBuffer (in SynchronizeBufferFromImage) -> vkCmdDispatch (copy) -> vkCmdCopyBufferToImage (in RefreshImage) With the tiling PR it added extra tiling/detiling steps vkCmdCopyImageToBuffer -> vkCmdDispatch (tiling) -> vkCmdDispatch (copy) -> vkCmdDispatch (detiling) -> vkCmdCopyBufferToImage This is quite a bit of overhead for a simple image copy. This commit tries to detect trivial image copies i.e cs shaders that copy the full source image to all of the destination. So now all this sequence is just a vkCmdCopyImage. How much it triggers depends on the guest * texture_cache: Fix build * image: Copy all subresources with buffer too
Working on getting fix in for image copy issue.
* SystemGesture * only STUBBED
* New translations en_us.ts (Turkish) * New translations en_us.ts (Spanish) * New translations en_us.ts (Polish) * New translations en_us.ts (Albanian) * New translations en_us.ts (Ukrainian) * New translations en_us.ts (German) * New translations en_us.ts (Greek) * New translations en_us.ts (Vietnamese) * New translations en_us.ts (Indonesian) * New translations en_us.ts (Romanian) * New translations en_us.ts (French) * New translations en_us.ts (Arabic) * New translations en_us.ts (Catalan) * New translations en_us.ts (Danish) * New translations en_us.ts (Finnish) * New translations en_us.ts (Hungarian) * New translations en_us.ts (Italian) * New translations en_us.ts (Japanese) * New translations en_us.ts (Korean) * New translations en_us.ts (Lithuanian) * New translations en_us.ts (Dutch) * New translations en_us.ts (Portuguese) * New translations en_us.ts (Russian) * New translations en_us.ts (Slovenian) * New translations en_us.ts (Swedish) * New translations en_us.ts (Chinese Simplified) * New translations en_us.ts (Chinese Traditional) * New translations en_us.ts (Portuguese, Brazilian) * New translations en_us.ts (Persian) * New translations en_us.ts (Norwegian Bokmal) * New translations en_us.ts (Serbian (Latin)) * New translations en_us.ts (Italian) * New translations en_us.ts (Catalan) * New translations en_us.ts (Russian) * New translations en_us.ts (Portuguese, Brazilian) * New translations en_us.ts (Ukrainian) * New translations en_us.ts (Norwegian Bokmal) * New translations en_us.ts (Russian) * New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Chinese Simplified) * New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Swedish)
…t param.sfo (shadps4-emu#3405) * Update app_content.cpp * Use hyphenation to determine entitlement id from folder name The original approach I took had two limitations: it relied on entitlement ids being 16 characters long, and it relied on the end of the folder name containing the entitlement. If the former wasn't the case, my code would throw an exception, while the latter would cause the DLC to not detect. To resolve both issues, I've created a more robust algorithm based on observations from the most commonly used PS4 dumpers for modern firmware. * Use DLC param.sfo to determine entitlement id While the logic ends up slightly more complex, this makes the code more robust for other dumping methods/weird DLC folder names from people installing DLC manually. * Update sceAppContentAddcontMount to properly detect additional content folders Based on what I've done in sceAppContentInitialize, I've added code for detecting the correct folder to mount. I've also removed the redundant check for addcont_info status, since we're marking all additional content as installed during sceAppContentInitialize
The VoicePortInfo 'state' was changed from 3-RUNNING to 0-IDLE. This prevents it from getting into a loop.
From what I can tell, this is valid behavior since a user could choose not to enter a party. This fixes a potential crash on boot in Grand Theft Auto V.
* Stubbed library * Silence sceNpProfileDialogUpdateStatus * the loathsome clang-formatter
…3414) Grand Theft Auto V uses sceKernelGetdents in a loop to search through the contents of /download0, but will always check the first returned directory entry regardless of what value the function returns. As it turns out, this will never fail on real hardware because all directories have entries for . and .., while the game code throws an exception on shadPS4 because we don't emulate these entries.
* cpu info Update cpu_info.h Revert "Update cpu_info.h" This reverts commit 6db3814. Revert "cpu info" This reverts commit cfecdf6. hardware info * log OS * Round RAM, add space * switch temporarily to local fork * Update CMakeLists.txt * set shallow = true for submodule * Log logical cores as well * point submodule to shadps4 fork
* Various GetDents fixes Fixed return and parameter types, and made the function return all the entries that will fit in nbytes during one call. * Fstat dir stub changes Changes the returned statistics to match what my PS4 tests generally show. * Stat dir stub changes To match my fstat changes
* Properly align address and size in munmap Based on observations of FreeBSD source code, fixes a Windows-related memory issue in War Thunder (CUSA00224) * Format len and phys_addr in mmap This should make logs slightly easier to understand, since we format these parameters in other memory calls. * Update memory.cpp
* New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Arabic) * New translations en_us.ts (Spanish) * New translations en_us.ts (French)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
…u#3426) Previously a buffer load in a vertex shader could be treated like a ring access, dropping offen vgpr and possibly asserting during resource tracking because of mismatch between types (u32x2 vs U32), caused by inconsistencies in flags (index_enable and offset_enable)
…4-emu#3420) * ir: Perform degamma in shader when sampler sets force_degamma * specialization: Add srgb if image is sampled Might fix cases where sampler force_degamma is used with srgb image
* Improved libSceMove stubs These should more accurately represent how an actual PS4 behaves when a game calls libSceMove functions while no move controllers are connected. * Clang * Change sceMoveGetExtensionPortInfo stub Not entirely sure the ExtensionPortData struct is for this one, but the struct itself isn't exactly important for now anyway. * Fix sceMoveTerm * Update move.cpp
* Initial work on improved stubs Simulates library behaviors for when a camera is not connected. * Get* functions complete I ended up leaving some stubs behind, but most of what I didn't do seem to be internal functions called by other libraries we'd be running HLE anyway. * Finished stubs Everything I can reasonably confirm the behavior of should behave as expected, emulating the behavior of a PS4 with no camera attached. * sceCameraStart firmware check This check only applies to higher eboot firmwares, since my previous test eboots used firmware 1.00 I completely missed this. * sceCameraGetAutoExposureGain fix When option is provided and valid, size is also set to 0. * Track opened handles Extremely basic for now, if the library was ever properly implemented this could be swapped for a map of some kind instead. * Fix errors for sceCameraStart The firmware-related parameter checks come after the library opened check. * Promote sceCameraIsAttached log to info Since you don't need to initialize the library to call this function, some games will call sceCameraIsAttached before anything else.
* Implement V_CMP_GT_U64 * Add GroupAny * Use GroupAny * Add assert * clang
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
* New translations en_us.ts (Romanian) * New translations en_us.ts (French) * New translations en_us.ts (Spanish) * New translations en_us.ts (Arabic) * New translations en_us.ts (Catalan) * New translations en_us.ts (Danish) * New translations en_us.ts (German) * New translations en_us.ts (Greek) * New translations en_us.ts (Finnish) * New translations en_us.ts (Hungarian) * New translations en_us.ts (Italian) * New translations en_us.ts (Japanese) * New translations en_us.ts (Korean) * New translations en_us.ts (Lithuanian) * New translations en_us.ts (Dutch) * New translations en_us.ts (Polish) * New translations en_us.ts (Portuguese) * New translations en_us.ts (Russian) * New translations en_us.ts (Slovenian) * New translations en_us.ts (Albanian) * New translations en_us.ts (Swedish) * New translations en_us.ts (Turkish) * New translations en_us.ts (Ukrainian) * New translations en_us.ts (Chinese Simplified) * New translations en_us.ts (Chinese Traditional) * New translations en_us.ts (Urdu (Pakistan)) * New translations en_us.ts (Vietnamese) * New translations en_us.ts (Portuguese, Brazilian) * New translations en_us.ts (Indonesian) * New translations en_us.ts (Persian) * New translations en_us.ts (Norwegian Bokmal) * New translations en_us.ts (Serbian (Latin))
* Epoll * Change companion util stub to return NO_EVENT * Revert "Change companion util stub to return NO_EVENT" This reverts commit 8dd9913. * added wepoll * shallow.. * dist branch * updated wepoll * compiles on windows --------- Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
* Make UpdatePlayTime not depend on Qt * sir clang offnir, the all-formatting
…hadps4-emu#2456) * 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
* 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
* net: Register epolls in file descriptor table * fstat: stub epoll, resolver * Fake async hostname resolution * net: epoll fixes * epoll: actually close the file descriptor
…adps4-emu#3639) * 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
* 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.
* 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
Real hardware allows this, and it worked fine in the past, so allow it here.
* 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
* fixing missing trophy files extraction * implemented sceNpTrophyGetGameIcon * adjustments * improvements * argg * added assert * done * fixed compiling
…u#3655) * 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
* make sys_modules folder configurable * Update src/common/config.cpp Co-authored-by: squidbus <175574877+squidbus@users.noreply.github.com> --------- Co-authored-by: squidbus <175574877+squidbus@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You should probably not merge it as is, or the commit history is going to get fucked up, but here's a rebase of shader_cache if you want it.