Commit graph

268 commits

Author SHA1 Message Date
squidbus 015f6a8bc4 vulkan: Better support for directly linking a Vulkan support library. 2024-09-03 01:40:51 -07:00
DanielSvoboda 4595f1eb2e Update CMakeLists.txt 2024-09-02 20:18:36 -03:00
DanielSvoboda 0d2330f589 Update CMakeLists.txt 2024-09-02 15:30:50 -03:00
Random 256cafcc1f Force PIE usage on linux (#625)
* force PIE usage on linux

* get rid of explicit -pie linker flag

* change UNIX with UNIX AND NOT APPLE in CMakeLists.txt

* cmake: add proper check for PIE support at link time

---------

Co-authored-by: Mikhail Paulyshka <me@mixaill.net>
2024-09-01 21:48:34 +03:00
squidbus c436665fe5 macos: Remove need for TLS patch by storing TCB pointer in FS. 2024-09-01 02:22:42 -07:00
squidbus ea106a31ad core: Fix CPU patch stack issues 2024-08-30 20:47:07 -07:00
georgemoralis 266694ce9f Merge pull request #638 from squidbus/f16c
Add patches for F16C instructions under Rosetta 2.
2024-08-30 11:16:21 +03:00
squidbus 936d23696b Add patches for F16C instructions under Rosetta 2. 2024-08-29 17:31:25 -07:00
TheTurtle 7066ef4b58 video_core: Account of runtime state changes when compiling shaders (#575)
* video_core: Compile shader permutations

* spirv: Only specific storage image format for atomics

* ir: Avoid cube coord patching for storage image

* spirv: Fix default attributes

* data_share: Add more instructions

* video_core: Query storage flag with runtime state

* kernel: Use std::list for semaphore

* video_core: Use texture buffers for untyped format load/store

* buffer_cache: Limit view usage

* vk_pipeline_cache: Fix invalid iterator

* image_view: Reduce log spam when alpha=1 in storage swizzle

* video_core: More features and proper spirv feature detection

* video_core: Attempt no2 for specialization

* spirv: Remove conflict

* vk_shader_cache: Small cleanup
2024-08-29 19:29:54 +03:00
DanielSvoboda c1d46094a0 Cheats/Patches (#493)
* Cheats/Patches

Adds the possibility of applying cheats/patches according to the specific game serial+version

The logic for adding modifications has not yet been implemented!

Interface based on issues/372 https://github.com/shadps4-emu/shadPS4/issues/372

[X]Front-end
[]Back-end

Create a synchronized fork of the cheats/patches repository

* Clang Format

* separate files

The code has been separated into separate files as suggested by georgemoralis.
Added the Patch tab, which has not been implemented yet.
Added the 'applyCheat' area to apply the modification, not implemented yet...
And added LOG_INFO.

* reuse

* initial implementation of cheat functionality

* Update cheats_patches.cpp

sets all added buttons to the size of the largest button.
and fixes some aesthetic issues.

* move eboot_address to module.h

fixes the non-qt builds and makes more sense to be there anyway

* Patchs menu and fixes

adds the possibility to download Patches, it does not modify the memory yet.
and some other fixes

* MemoryPatcher namespace, activate cheats on start

* format

* initial patch implementation

* format

* format again...

* convertValueToHex

* Fixes

Choosing which cheat file to use.
And some other fixes

* fix bytes16, bytes32, bytes64 type patches

If a patch is any of these types we convert it from little endian to big endian

* format

* format again :(

* Implement pattern scanning for mask type patches

* add check to stop patches applying to wrong game

previously if you added a patch to a game, but closed the window and opened a different game it would still try to apply the patch, this is now fixed

* format

* Fix 'Hint' 0x400000 |  and Author

* Management |save checkbox | shadps4 repository

MENU - Cheats/Patches Management (implementing Patches)
save patches checkbox
add shadps4 repository

* Load saved patches, miscellaneous fixes

* Fix an issue with mask patches not being saved

* format + remove debug log

* multiple patches | TR translation for cheats/patches

* clang

* ENABLE_QT_GUI

* OK

* move memory_patcher to qt_gui

* clang

* add cheats hu_HU

* fix log

* Remove the item from the patchesListView if no patches were added (the game has patches, but not for the current version)

---------

Co-authored-by: CrazyBloo <CrazyBloo@users.noreply.github.com>
2024-08-29 07:18:50 +03:00
squidbus 3ea57ad81d kernel: Reimplement POSIX semaphores using std::counting_semaphore. (#600) 2024-08-28 13:13:33 +03:00
Lizardy 569abf3504 [Libs] Error Codes (#612)
* ngs2: all errors w/ official names

* ajm errors

* gnm errors

* random errors

* clang

* random error

* linux

---------

Co-authored-by: microsoftv <6063922+microsoftv@users.noreply.github.com>
2024-08-27 15:53:38 +03:00
Plínio Larrubia 34bd2492a1 fix typo in LOG_INFO (#559)
fix: file name typo constant_propogation_pass.cpp

fix typo from 'symbol_vitrual_addr' variable

fix typo in emit_spirv_context_get_set.cpp

fix typo from constant_propagation_pass.cpp in CMakeLists

fix typo in these some config.cpp functions
- setSliderPosition
- setSliderPositionGrid
- getSliderPosition
- getSliderPositionGrid

fix typo inside src\core\aerolib\stubs.cpp

fix typo in a comment from src\core\file_format\pkg.cpp

fix typo inside src\core\file_sys\fs.cpp + fs.h
- NeedsCaseInsensiveSearch -> NeedsCaseInsensitiveSearch

fix 2 function typos: sceAppContentAddcontEnqueueDownloadByEntitlemetId and sceAppContentAddcontMountByEntitlemetId

fix typo on comment inside src\core\libraries\kernel\file_system.cpp

fix typo on src\core\libraries\videoout\driver.cpp

fix typo in src\core\memory.cpp

fix typo from comment in src\qt_gui\game_list_utils.h

fix typo in src\video_core\amdgpu\liverpool.h
- window_offset_disble to window_offset_disable

fix typo from comments in src\video_core\host_shaders\detile_m32x1.comp + detile_m32x2.comp
- subotimal -> suboptimal

fix typo from comment in src\video_core\renderer_vulkan\renderer_vulkan.cpp
- dimentions -> dimensions

fix typo from enum in src\common\debug.h and other files
- MarkersPallete -> MarkersPalette

fix last typo in src\video_core\amdgpu\pm4_opcodes.h
- PremableCntl -> PreambleCntl
2024-08-26 15:22:11 +03:00
psucien 69b305bb40 GnmDriver: Clear context support (#567)
* gnmdriver: added support for gpu context reset

* shader_recompiler: minor validation fixes

* shader_recompiler: added `V_CMPX_GT_I32`

* shader_recompiler: fix for crash on inline sampler access

* compilation warnings and dead code elimination

* amdgpu: fix for registers addressing

* libraries: videoout: reduce logging pressure

* shader_recompiler: fix for devergence scope detection
2024-08-25 23:01:05 +03:00
Dzmitry Dubrova 2f16a02e69 gui: Implement gui translations 2024-08-25 12:17:54 +03:00
Alexandre Bouvier 0c6f5c5741 cmake: fix version constraints 2024-08-23 19:40:11 +02:00
Xphalnos bb2a417598 Lot of small fixes 2024-08-22 18:01:30 +02:00
georgemoralis 9f3aaee098 LLE libc removal 2024-08-22 11:24:31 +03:00
georgemoralis c53ee105eb Merge pull request #495 from jdpatdiscord/main
Allow builds on MSYS2 & improve Windows build steps documentation
2024-08-21 02:08:40 +03:00
Lizardy ace814f4f2 rtc errors (#485)
* rtc errors

* add system libs to cmakelists

* this.[func]

* fix errors

* declaration

* log handle addr

* missed

---------

Co-authored-by: microsoftv <6063922+microsoftv@users.noreply.github.com>
2024-08-21 00:47:17 +03:00
jdp_ b526c6f146 Allow builds on MSYS2 & improve Windows build steps documentation 2024-08-20 14:27:26 -04:00
Lizardy f197e05379 [WIP] libSceNgs2 (#439)
* init ngs2

* clang

* ngs2 HLE for missing LLE

* clang

* clang

* orbis ngs2 error codes

* resolve, error codes, ngs2_impl

* clang

* clang

* mac atomic

* clang

* mac

* clang

---------

Co-authored-by: microsoftv <6063922+microsoftv@users.noreply.github.com>
2024-08-19 10:03:05 +03:00
Xphalnos 2df1372a46 Misc changes 2024-08-18 17:56:29 +02:00
¥IGA fa7e7a9963 About Window (#458) 2024-08-17 19:13:37 +03:00
Alexandre Bouvier 53b3506a5a cmake: prefer system renderdoc library (#452) 2024-08-16 19:49:32 +03:00
Alexandre Bouvier 6eb355e15f cmake: prefer system ffmpeg library (#451) 2024-08-16 18:56:47 +03:00
georgemoralis 7f674155f1 Merge pull request #400 from vladmikhalin/basic-av-player
Basic AvPlayer implementation
2024-08-16 11:17:56 +03:00
squidbus 047a6b87df Enable -fexperimental-library when using clang libc++ 2024-08-15 23:22:38 -07:00
Vladislav Mikhalin b2146acda5 avplayer WIP 2024-08-15 22:00:51 +03:00
¥IGA ec805713a4 Ability to change username (#432) 2024-08-15 12:33:10 +03:00
TheTurtle d5e7180c54 spirv: Simplify shared memory handling (#427)
* spirv: Simplify shared memory handling

* spirv: Ignore clip plane

* spirv: Fix image offsets

* ir_pass: Implement shared memory lowering pass

* NVIDIA doesn't like using shared mem in fragment shader and softlocks driver

* spirv: Add log for ignoring pos1
2024-08-14 19:01:17 +03:00
Dzmitry Dubrova 31e539c575 gui: Implement settings dialog 2024-08-09 17:28:16 +03:00
TheTurtle 8809e1c226 video_core: Implement guest buffer manager (#373)
* video_core: Introduce buffer cache

* video_core: Use multi level page table for caches

* renderer_vulkan: Remove unused stream buffer

* fix build

* oops forgot optimize off
2024-08-08 15:02:10 +03:00
squidbus 82919e44f0 Add macOS icon. 2024-07-31 19:37:55 -07:00
georgemoralis 2e48be9c0c print git info in windows title 2024-08-01 00:56:10 +03:00
Dzmitry Dubrova 479e6a20dd core: Implement sceRandomGetRandomNumber (#350) 2024-07-31 14:01:22 +03:00
Xphalnos 8282120816 Don't download unnecessary DLLs (#341) 2024-07-30 22:41:31 +03:00
squidbus e2bdbeaf80 Add sem_timedwait polyfill for macOS. 2024-07-28 16:42:33 -07:00
TheTurtle 5363a226e1 Move presentation to separate thread/improve sync (#303)
* video_out: Move presentation to separate thread

* liverpool: Better sync for CPU flips

* driver: Make flip blocking

* videoout: Proper flip rate and vblank management

* config: Add vblank divider option

* clang format

* videoout: added `sceVideoOutWaitVblank`

* clang format

* vk_scheduler: Silly merge conflict

* externals: Add renderdoc API

* clang format

* reuse

* rdoc: manual capture trigger

* clang fmt

---------

Co-authored-by: psucien <168137814+psucien@users.noreply.github.com>
2024-07-28 15:54:09 +02:00
georgemoralis 7fe993f593 some fixup to playgo , makes Worms go further 2024-07-26 07:53:45 +03:00
squidbus 6783776990 Only use date library on macOS. 2024-07-21 22:36:12 +03:00
squidbus d5e45d001e Reduce system reserved space to 0x700000000 and map fixed on macOS. 2024-07-21 22:36:12 +03:00
squidbus bdca446c5e Make sure system managed memory is in correct location on macOS. 2024-07-21 22:36:12 +03:00
squidbus 6648589ef9 Set minimum macOS target to 11 and fix compile errors. 2024-07-21 22:36:12 +03:00
squidbus b5d0347c15 Migrate TLS patches to new patching system. 2024-07-21 22:36:12 +03:00
squidbus d42a32bbd8 Add initial macOS support. 2024-07-21 22:36:12 +03:00
psucien 2b31ab1e71 Surface management rework (1/3) (#307)
* amdgpu: proper CB and DB sizes calculation; minor refactoring

* texture_cache: separate file for image_info

* texture_cache: image guest address moved into image info

* texture_cache: surface size calculation

* shader_recompiler: fixed sin/cos

Thanks to red_pring and gandalfthewhite0173

* initial preparations for subresources upload

* review comments
2024-07-20 12:51:21 +03:00
georgemoralis e112a7c1e9 Merge pull request #282 from BigTreezZ/patch-3
Update CMakeLists.txt to fix compilation error
2024-07-11 16:07:03 +03:00
Daniel R 8a8c1f274b Misc implementations and fixes. (#250)
* Implement `sceKernelFtruncate` and `sceKernelUnlink`.

* Remove unused variable.

* Implement `sceKernelReserveVirtualRange`, misc fixes

* Fix `sceKernelReserveVirtualRange`.

* Add TODO on reserve

* Replace comment with assert.

* Add missing copyright header

* Add `UNREACHABLE` for `IOFile::Unlink`.

* Move NT API initialization out of the header

* Fix bug where files were always mapped as read only.

* `clang-format`
2024-07-11 15:35:58 +03:00
TreezZ eeb24d729a Update CMakeLists.txt to fix compilation error
Changed Boost version from 1.83.0 to 1.84.0 (thanks nullptr on Discord)
2024-07-11 13:33:42 +01:00
psucien 29913c7ee5 boost: submodule update 2024-07-11 13:14:42 +03:00
georgemoralis a186223d8e More HLE stuff and fixes (#273)
* sceKernelOpen truncate is not neccesary

* fixup scePthreadCondSignal

* dummy error , ime dialogs stubbed

* sceErrorDialog implemenation (no ui)

* small fix in sceSaveDataGetEventResult and sceAppContentTemporaryDataMount2.

* ime dialog structs and functions definations

* added stubbed avplayer

* Open folder should be first on context menu

---------

Co-authored-by: raziel1000 <ckraziel@gmail.com>
2024-07-10 19:20:19 +03:00
georgemoralis c231695ee8 Merge pull request #239 from shadps4-emu/miscFixes3
Misc fixes 3
2024-07-06 11:16:53 +03:00
georgemoralis 447a88cc26 removed hardware info seems make perfomance issues , will test something more lightweight 2024-07-06 10:27:57 +03:00
Xphalnos 7cf23b5efa CMakeLists.txt cleanup (#244)
* Update ci.yml

* Update CMakeLists.txt
2024-07-06 02:42:34 +03:00
Younes dbeaaa4f43 Merge branch 'main' into miscFixes2 2024-07-04 20:51:04 -06:00
TheTurtle d9873e30bc shader_recompiler: Implement most integer image atomics, workgroup barriers and shared memory load/store (#231)
* shader_recompiler: Add LDEXP

* shader_recompiler: Add most image integer atomic ops

* shader_recompiler: Implement shared memory load/store

* shader_recompiler: More image atomics

* externals: Update sirit

* clang format

* cmake: Add missing files

* shader_recompiler: Fix some atomic bugs

* shader_recompiler: Vs outputs

* shader_recompiler: Shared mem has side-effects, fix format component order

* shader_recompiler: Inline constant buffer impl

* video_core: Fix regressions

* Work

* Fixup a few things
2024-07-05 00:15:44 +03:00
georgemoralis 9afca173a2 added library to print system info to be able to debug user files better 2024-07-04 14:30:34 +03:00
Xphalnos be89a88e92 Update externals 2024-07-01 18:39:12 +02:00
georgemoralis 0845d8f250 Stabilization8 (#218)
* disable configured flexible memory size (caused issues in some games)

* fixed case S_OR_B64 for blazing chrome

* submodules updates and fixes for latest SDL

* stubbed _sigprocmask (not handled and spams too much)

* added ReplaceOp case in Stencilop

* dummy ajm module added
2024-06-27 16:37:17 +03:00
Alexandre Bouvier 20fa80cd13 cmake: prefer system libraries (#216) 2024-06-27 13:46:55 +03:00
Younes 825657ced1 - sceKernelUuidCreate, sceAppContentAppParamGetInt, sceAppContentTemporaryDataMount2 (#199)
- PlayGo
- stub libusbd
-added /temp0 and /data mounts at emu start.
(Ghost Files: Memory of a Crime, Abyss: The Wraiths of Eden)
- some posix functions
2024-06-15 17:51:51 +03:00
TheTurtle 556d88ecb4 core: Many things (#194)
* video_core: Add a few missed things

* libkernel: More proper memory mapped files

* memory: Fix tessellation buffer mapping

* Cuphead work

* sceKernelPollSema fix

* clang format

* fixed ngs2 lle loading and rtc lib

* draft pthreads keys implementation

* fixed return codes

* return error code if sceKernelLoadStartModule module is invalid

* re-enabled system modules and disable debug in libs.h

* Improve linux support

* fix windows build

* kernel: Rework keys

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2024-06-15 14:36:07 +03:00
Xphalnos 3779331f86 Merge branch 'main' of https://github.com/Xphalnos/shadPS4 2024-06-14 14:33:08 +02:00
Xphalnos 30fe6aa2dd More screenshots for README 2024-06-14 14:32:41 +02:00
raziel1000 0fce689830 Added LibPngDec
(tested with Metal Slug 3, Risk of Rain, Deadbolt and Nidhogg)
2024-06-14 01:37:26 -06:00
psucien 7ab17176d0 Added Tracy profiler 2024-06-11 11:17:46 +02:00
raziel1000 7ba9ad6cca - Added trophy decryption when extracting a fpkg. trp icons and xmls are dumped to game_data/<title> (can be restored if deleted by accident by opening the trophy viewer)
- Added a trophy viewer (right click on game ==> trophy viewer)
- Enabled Run button.
- Switched gui settings to toml.
- Added recent files (6 max)
- Applied @raphaelthegreat suggestions and corrections (Thanks a lot).
- Fixed several bugs and crashes.
- Full screen should disabled by default.
- Added region in list mode.
- Added a simple temp elf list widget.
- Added messages when extracting pkg (ex: installing a patch before the game...etc)
2024-06-10 20:42:21 -06:00
TheTurtle 769eb6a9ee video_core: Preliminary storage image support and more (#188)
* vk_rasterizer: Clear depth buffer when DB_RENDER_CONTROL says so

* video_core: Preliminary storage image support, more opcodes

* renderer_vulkan: a fix for vertex buffers merging

* renderer_vulkan: a heuristic for blend override when alpha out is masked

---------

Co-authored-by: psucien <bad_cast@protonmail.com>
2024-06-10 22:35:14 +03:00
georgemoralis 384a5030fd moved main code , to emulator,cpp , emulator.h class 2024-06-10 15:18:42 +03:00
georgemoralis 191d2d0b91 Merge pull request #175 from shadps4-emu/missing_gnm_calls
Additional GnmDriver functions
2024-06-09 00:58:45 +03:00
georgemoralis 50186055d3 added rtc and disc_map modules 2024-06-08 22:41:25 +03:00
psucien f3636b77b8 common: slot_vector moved into common 2024-06-08 01:19:51 +02:00
georgemoralis c09c2da147 RWLocks implementation (#171)
* added dummy rwlock

* implemented part of rwlock functions (WIP)

* implemented the most important functions for rwlocks
2024-06-07 21:30:26 +03:00
TheTurtle 718ade970f video_core: Add depth buffer support and fix some bugs (#172)
* memory: Avoid crash when alignment is zero

* Also remove unused file

* shader_recompiler: Add more instructions

* Also fix some minor issues with a few existing instructions

* control_flow: Don't emit discard for null exports

* renderer_vulkan: Add depth buffer support

* liverpool: Fix wrong color buffer number type and viewport zscale

* Also add some more formats
2024-06-07 16:26:43 +03:00
TheTurtle 4779381eec core: Properly implement TLS (#164)
* core: Split module code from linker

* linker: Properly implement thread local storage

* kernel: Fix a few memory functions

* kernel: Implement module loading

* Now it's easy to do anyway with new module rework
2024-06-05 22:08:18 +03:00
psucien a2eb813bee video_core: added shader header files generator from Citra 2024-06-05 14:31:50 +02:00
georgemoralis 088971f5b9 added app_content module 2024-05-31 15:03:05 +03:00
raphaelthegreat 99d20d4119 video_core: Implement basic compute shaders and more instructions 2024-05-30 01:39:24 +03:00
georgemoralis b8ced0db35 event flag implementation from previous pr 2024-05-28 14:29:53 +03:00
raphaelthegreat 8bd9bf1a7d video_core: Add image support 2024-05-27 18:25:45 +03:00
TheTurtle 0aa04c60cb video_core: Bringup some basic functionality (#145)
* video_core: Remove hack in rasterizer

* The hack was to skip the first draw as the display buffer had not been created yet and the texture cache couldn't create one itself. With this patch it now can, using the color buffer parameters from registers

* shader_recompiler: Implement attribute loads/stores

* video_core: Add basic vertex, index buffer handling and pipeline caching

* externals: Make xxhash lowercase
2024-05-25 15:33:15 +03:00
TheTurtle 4380066a90 video: Import new shader recompiler + display a triangle (#142) 2024-05-22 01:35:12 +03:00
Xphalnos 80a9e3865b Migrating from third-party to externals (#138)
* third-party migration to externals

* Fix

* Lower case for Linux
2024-05-18 20:05:18 +03:00
georgemoralis 521fc0401f show title splash while the game is loading 2024-05-16 16:58:14 +03:00
TheTurtle 94caa0336e core: Implement new memory manager (#133)
* core: Implement new memory manager

* ci: Attempt to fix linux build

* code: Fix a few build errors
2024-05-16 15:55:50 +03:00
georgemoralis 9ea9a9efec Initial LibcInternal 2024-05-13 16:13:33 +03:00
georgemoralis e55fbee0aa use winpthreads from mingw64 2024-05-09 23:45:09 +03:00
georgemoralis ccf81110b0 sceSaveDataMount2,sceSaveDataUmount some implementation 2024-05-04 22:08:04 +03:00
georgemoralis 45cbbec0b6 moved savedata to proper folder 2024-05-04 19:08:46 +03:00
georgemoralis 95a42f5b29 added dummy np* modules and screenshot module 2024-05-02 18:16:10 +03:00
georgemoralis 2b59361b7f added stubbed mostly version of flexible memory - it allows sonic mania to go further 2024-05-02 17:13:51 +03:00
georgemoralis e60cb3c745 better way for compiler option 2024-05-02 15:48:48 +03:00
georgemoralis b2ce6f274f fixed stack allocation issue 2024-05-02 10:57:24 +03:00
TheTurtle 49e65be25b core: Rewrite thread local storage implementation (#118) 2024-05-01 13:38:41 +03:00
TheTurtle 13fe78f0f5 video_core: Add basic command list processing (#117) 2024-04-30 01:23:28 +03:00
psucien 87f3724675 video_core: prefer discrete gpu if available (#116)
* video_core: prefer discrete gpu if available

* ci: Upgrade to clang format 17

* rewrite w\o std::zip usage

---------

Co-authored-by: raphaelthegreat <47210458+raphaelthegreat@users.noreply.github.com>
2024-04-30 00:19:12 +03:00
raphaelthegreat 733956c39b texture_cache: Fix linear image uploads
* Also fixed build for clang-cl with libc
2024-04-29 18:22:04 +03:00
georgemoralis c7115fc8fb trying to fix actions (again) 2024-04-15 20:35:49 +03:00
georgemoralis f4552c631e fixing qt builds 2024-04-15 20:20:00 +03:00