Compare commits

...

1140 Commits

Author SHA1 Message Date
psucien 4182740384 Don't load `sync2` ext if `nv_checkpoints` isn't used 2024-08-31 00:10:47 +02:00
psucien ca1613258f
video_core: added support for indirect draws (#678)
* video_core: added support for indirect draws

* barriers simplified
2024-08-30 22:59:56 +02:00
georgemoralis 3d375a28eb
Merge pull request #671 from Xphalnos/main
Reorganization of includes (Part 2)
2024-08-30 22:10:49 +03:00
jnack 69d4fecdfe
Allow graphics/compute shader list for skipping (#674)
* Allow graphics/compute shader list for skipping

* nintendo ultra 64 + formatting

* indentation..

* allow empty array in ShouldSkipShader

* simpler check for skip hashes
2024-08-30 21:51:20 +03:00
Xphalnos 7886761476 Reorganization of includes (Part 2) 2024-08-30 15:48:21 +02:00
squidbus 6080066f75
vulkan: Few fixes for MoltenVK (#670)
* vulkan: Use SPIR-V 1.5 when Vulkan version is 1.2

* vulkan: Fix Format2_10_10_10 mismap
2024-08-30 16:40:39 +03:00
georgemoralis f1fe6b9f96
Merge pull request #668 from squidbus/fix-patch-stack
Initialize patch stack before thread TLS.
2024-08-30 14:58:34 +03:00
squidbus 6e552aac6a Initialize patch stack before thread TLS. 2024-08-30 04:43:11 -07:00
adjonesey 0f87d1e3d4 Remove from_compute check in texture cache invalidation (#665)
* Remove from_compute check in texture cache invalidation (hack)

* Remove from_compute parameter

---------

Co-authored-by: Adam Jones <a.c.jones@outlook.com>
2024-08-30 13:01:59 +03:00
georgemoralis 68fa5e292f
Merge pull request #666 from bigol83/patch-3
Update Italian translation
2024-08-30 12:39:30 +03:00
bigol83 bdfff5e8ea
Update it.ts 2024-08-30 11:01:48 +02:00
georgemoralis cdd193d5b1
Merge pull request #638 from squidbus/f16c
Add patches for F16C instructions under Rosetta 2.
2024-08-30 11:16:21 +03:00
georgemoralis 30ab2b7f71
Merge pull request #658 from DanielSvoboda/main
fix tr
2024-08-30 11:15:09 +03:00
DanielSvoboda f2b6843f9d fix tr 2024-08-29 23:11:20 -03:00
squidbus a17150960f Add patches for F16C instructions under Rosetta 2. 2024-08-29 17:31:25 -07:00
Grégoire Hage 1651db24fe
Implement S_XNOR_B64 (#654) 2024-08-30 02:43:12 +03:00
IndecisiveTurtle 6bf42aa985 vk_graphics_pipeline: Fix texel buffer offset 2024-08-30 01:09:39 +03:00
georgemoralis 8d41695e74
Merge pull request #651 from LeDragoX/pt-br-update-1
Update PT-BR localization
2024-08-30 01:08:07 +03:00
IndecisiveTurtle cb5190e31a vk_graphics_pipeline: Fix copy paste error 2024-08-30 00:59:12 +03:00
IndecisiveTurtle cf706f8cc7 buffer: Don't leak texel buffers, blacklist stream buffer with texel buffers 2024-08-30 00:26:08 +03:00
IndecisiveTurtle 6fbbe3d79b translator: Add missed flow instruction 2024-08-30 00:26:01 +03:00
IndecisiveTurtle fab390b860 spirv: More correct texel buffer usage 2024-08-30 00:25:56 +03:00
Plínio Larrubia 5a96ac1a4f
Update PT-BR translation
- Support DLC texts
- Fixed some errors on Cheats (Trapaças) translation
2024-08-29 18:22:36 -03:00
georgemoralis ac2fa103fa
Merge pull request #649 from f1amy/ru-translation-fixes
ru DLC translation and translation fixes
2024-08-29 23:47:47 +03:00
georgemoralis 7e7854346d
Merge pull request #650 from DanielSvoboda/main
Fix creation files.json in 'Download All Patches'
2024-08-29 23:47:25 +03:00
DanielSvoboda 751f6f9bab Fix creation files.json in 'Download ALL' 2024-08-29 17:26:06 -03:00
Flamy 1c835a1aa4
ru DLC translation and translation fixes 2024-08-29 23:59:52 +05:00
georgemoralis 07c8c28000
Merge pull request #647 from DanielSvoboda/main
fix tr cheats_patches.cpp
2024-08-29 19:44:04 +03:00
TheTurtle 66e96dd944
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 aef7498c49
fix tr cheats_patches.cpp
the 2 words were not being translated
2024-08-29 13:21:58 -03:00
georgemoralis 790d19e59b
Merge pull request #646 from kiwidoggie/patch-1
Add /hostapp support
2024-08-29 17:03:35 +03:00
georgemoralis 3ae18c9073
Merge pull request #645 from mavethee/dlc-polish-localization
DLCs - Polish localization
2024-08-29 17:02:55 +03:00
georgemoralis 83e343f77e
Merge pull request #637 from shadps4-emu/amdgpu/indirect_dispatch
video_core: added support for indirect dispatches (gfx only)
2024-08-29 17:02:37 +03:00
kiwipuppeh 81eb3a4d14
Add /hostapp support
In the case of certain games, such as Battlefield 4 (CUSA00110), the local pathing will resolve to /hostapp instead of /app0, which works fine on PS4, but was failing to resolve to any meaningful mount in shadPS4, this corrects this issue when running from eboot.bin directly.
2024-08-29 08:22:19 -04:00
Marcin Mitura 37786e06c2 DLCs - Polish localization
Translates strings introduced in #596.
2024-08-29 13:27:11 +02:00
psucien 9d349a1308 video_core: added support for indirect dispatches (gfx only) 2024-08-29 12:32:37 +02:00
bigol83 c997490645
DLC Italian translation (#644) 2024-08-29 13:31:48 +03:00
bigol83 600c5079ce
Cheats/patches Italian translation (#642)
* Update it.ts

* Update it.ts
2024-08-29 13:11:17 +03:00
Dzmitry Dubrova 8827c72a1c
Add DLC support (#596)
* fs/core: Add DLC support

* fs/core: Fix extraction paths

* Fix DLC mounting

* gui: Add translations
2024-08-29 12:55:40 +03:00
¥IGA e1382b43c8
Update French translation (#641) 2024-08-29 10:02:36 +03:00
DanielSvoboda 614a23b369
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
georgemoralis a6a9fff666
Merge pull request #636 from CyntexMore/main
Added HU translation
2024-08-29 00:08:51 +03:00
psucien 3fbb68048e
shader_recompiler: frontend: `SOPC` and `SOPK` handling separated; more cmp opcodes (#634) 2024-08-28 22:27:47 +02:00
CyntexMore 55be97bca3 feat(translation): hu_HU translated 2024-08-28 22:15:03 +02:00
georgemoralis d2e4a200fb
Merge pull request #631 from Emulator-Team-2/Fix
Misc fixes
2024-08-28 22:26:50 +03:00
georgemoralis a291800418
Merge pull request #632 from bigol83/patch-2
Update Italian translation
2024-08-28 21:13:47 +03:00
bigol83 365e17f64e
Update it.ts 2024-08-28 19:14:33 +02:00
Emulator-Team-2 af18728962
clang-format fix 2024-08-28 18:45:32 +02:00
Emulator-Team-2 6f938a10ce
added data_format=3 and num_format=4 2024-08-28 18:12:59 +02:00
Emulator-Team-2 08036d2b49
added data_format=36 and num_format=9 2024-08-28 18:10:23 +02:00
georgemoralis e57d55e6e9
Merge pull request #624 from Exhigh/savedata-fix-4
savedata: Add another missed case in saveDataMount
2024-08-28 18:07:50 +03:00
georgemoralis 163019e3dc
Merge pull request #629 from counter185/gamepad-tp-and-reconnect
Auto reconnect controllers + touchpad functionality
2024-08-28 18:03:13 +03:00
counter185 bc661039c5 get rid of one space 2024-08-28 14:25:07 +02:00
counter185 2e2f3bb2c6 clang format 2024-08-28 14:22:59 +02:00
counter185 89bdd3bba2 it's actually 1920x941 2024-08-28 14:15:01 +02:00
counter185 15fc267f0d Update controller.h 2024-08-28 13:58:37 +02:00
counter185 0b24ac6991 actually get rid of that comment 2024-08-28 13:56:49 +02:00
counter185 698dade864 * 2024-08-28 13:53:07 +02:00
counter185 4e6e90dfb9 add touchpad support, auto reconnect 2024-08-28 13:48:50 +02:00
georgemoralis be49871c68
Merge pull request #618 from vertver/main
video_core: Added copyGPUCmdBuffers option
2024-08-28 14:00:26 +03:00
squidbus 905d49fd96
memory: Fixes for direct memory allocation. (#615)
* memory: Size direct memory based on requested flexible memory.

* memory: Guard against OrbisProcParam without an OrbisKernelMemParam.

* memory: Account for alignment in direct memory suitability checks and add more debugging.
2024-08-28 13:42:53 +03:00
georgemoralis dcc4762c7e
Merge pull request #628 from squidbus/pkg-fix
crypto: Fix deallocation of key data while in use.
2024-08-28 13:42:01 +03:00
squidbus 4a6ce1e0d6 crypto: Fix deallocation of key data while in use. 2024-08-28 03:39:51 -07:00
georgemoralis 878fac7f94
Merge pull request #626 from InvoxiPlayGames/special-pad
pad: add support for configurable special pad class
2024-08-28 13:24:37 +03:00
squidbus da966bedfd
kernel: Reimplement POSIX semaphores using std::counting_semaphore. (#600) 2024-08-28 13:13:33 +03:00
Vinicius Rangel 8192eaa668
video_core: re-enable culling (#551) 2024-08-28 13:11:55 +03:00
0xsegf4ult 9f4e55a8e7
shader_recompiler: constant propagation bitwise operations + S_CMPK_EQ_U32 fix (#613)
* rebase on main branch impl of V_LSHL_B64

* remove V_LSHR_B64

* fix S_CMPK_EQ_u32

* fix conflicts

* fix broken merge

* remove duplicate cases

* remove duplicate declaration
2024-08-28 13:10:21 +03:00
InvoxiPlayGames 9d59ea06c7 clang-format fix: scePadOpenExt 2024-08-28 11:10:20 +01:00
tGecko 990da7edcc
DOCS: Correct and expand windows build instructions (#617)
* correct and expand windows build instructions

* fix numbering

* remove instructions to clone a different branch
2024-08-28 13:10:04 +03:00
InvoxiPlayGames 550cf0188d return proper error code for scePadOpen failure 2024-08-28 10:51:30 +01:00
InvoxiPlayGames 79e86a39fc add support for configurable special pad type 2024-08-28 10:27:51 +01:00
Anton Kovalev dfb30ea955 Use pair of spans instead of references in copy command buffers function 2024-08-28 11:24:15 +02:00
Random c37679154e
Handle PM4 type-2 packets (#556)
* video_core: handle PM4 type-2 packets

* video_core: rewrite pm4 comand type handling into a switch statement
2024-08-28 09:53:27 +02:00
Anton Kovalev 87ccfdfbbd Fixed type on function 2024-08-28 09:42:31 +02:00
Exhigh ed42db47af savedata: Add another missed case in saveDataMount
This should potentially fix Deadpool (CUSA03528) #554.
2024-08-28 08:52:20 +04:00
Anton Kovalev 1a02efbd15 clang-format style fix 2024-08-28 05:42:48 +02:00
georgemoralis e4254ebdaa
Merge pull request #605 from SolidStateDj/add-toggle-fullscreen
Add a toggle fullscreen button
2024-08-28 06:32:21 +03:00
georgemoralis e65bf19118
Merge pull request #620 from GermanAizek/fixes
crypto: added destructors and fixed direct memleaks
2024-08-28 06:31:07 +03:00
Semenov Herman 860b935054 crypto: added destructors fix memleak FakeKeyset, DebugRifKeyset, PkgDerivedKey3Keyset 2024-08-28 01:32:14 +03:00
Anton Kovalev 3842993a43 Use input dcb and ccb instead of copy 2024-08-28 00:21:12 +02:00
Anton Kovalev 3d46a5d492 Do not shrink buffer's size on submit 2024-08-27 23:33:24 +02:00
Anton Kovalev 595b845df0 clang-format fix 2024-08-27 23:31:04 +02:00
Anton Kovalev 659e7a4675 video_core: Added copyGPUCmdBuffers option 2024-08-27 23:16:14 +02:00
psucien 3eb47226d9 libraries: kernel: fix `scePthreadMutexattrSettype` error value return 2024-08-27 22:25:46 +02:00
psucien 371d1d009a Added missing headers and 2D MSAA image type 2024-08-27 19:17:23 +02:00
Lizardy 59b651be07
[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
Grégoire Hage 288db9a0cf
Implement V_LSHL_B64 (#608) 2024-08-27 14:15:32 +03:00
georgemoralis 62f165a7e4
Merge pull request #610 from vladmikhalin/avplayer-handle-init-errors
AvPlayer: Handle Initialization errors
2024-08-27 09:59:19 +03:00
Vladislav Mikhalin 2d354a095a AvPlayer: Handle Initialization errors 2024-08-27 09:32:42 +03:00
SolidStateDj 7ecc1d3be0 Add a toggle fullscreen button
Assigns F11 as the key for toggling fullscreen.
2024-08-26 18:27:31 -04:00
psucien af4356bfe1 shader_recompiler: fix for pattern detection in `TryDisableAnisoLod0`
Also fix for forgotten log message params.
2024-08-26 23:49:36 +02:00
psucien 3e94b533b6
libraries: kernel: skip for protection op; processing logic fixes (#602) 2024-08-26 23:14:22 +02:00
georgemoralis 287c3a4ab1
Merge pull request #599 from Exhigh/savedata-fix-3
savedata: Handle another missed case in saveDataMount
2024-08-27 00:02:41 +03:00
Exhigh 7c7d04133e savedata: Handle another missed case in saveDataMount
This should potentially fix (CUSA01019) - The Walking Dead: The Complete First Season.
2024-08-26 19:34:35 +04:00
Plínio Larrubia ad8373095a
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
Lizardy aae6e5be73
shader_recompiler: BUFFER_ATOMIC_SWAP Opcode (#566)
* shader_recompiler: BUFFER_ATOMIC_SWAP Opcode

* clang

* follow 32 convention

---------

Co-authored-by: microsoftv <6063922+microsoftv@users.noreply.github.com>
2024-08-26 15:21:20 +03:00
Batu cd6b5abccf
added tr language support (#587) 2024-08-26 13:20:53 +03:00
Plínio Larrubia 6520f3ca17
feat: add pt_BR translation (#584)
* feat: add pt_BR translation
- Made by @LeDragoX
- Revised by @gabsF

* fix: change translation string 'Mostrar Tela Inicial' to 'Mostrar Splash Inicial'
2024-08-26 13:20:40 +03:00
Cristóbal Martí Méndez d3b6b17c75
Add spanish translation (#583)
* Add spanish transalation

* Update es_ES.ts
2024-08-26 13:20:26 +03:00
Marcin Mitura 0b5616c493
Polish localization (#580)
Initial polish localization for shadPS4
2024-08-26 13:20:12 +03:00
georgemoralis 3627393707
Merge pull request #593 from shadps4-emu/fix/better_timings
libraries: kernel: fix for inaccurate `sceKernelGetProcessTime`
2024-08-26 10:56:54 +03:00
nishinji 6e340bcdc1
Fix ja_JP.ts (#594)
* Fix ja_JP.ts

* a
2024-08-26 10:56:11 +03:00
psucien 78e24852f8 libraries: kernel: fix for inaccurate `sceKernelGetProcessTime` 2024-08-26 08:54:38 +02:00
georgemoralis 7f6d08a3c8
Merge pull request #589 from greggameplayer/feature/TBUFFER_STORE_FORMAT_XY
Implement missing TBUFFER_STORE_FORMAT_XY
2024-08-26 09:40:40 +03:00
nishinji 7aa8cf992f
Add Japanese translation (#591) 2024-08-26 09:39:49 +03:00
¥IGA e16aa2a012
Update French tranlations (#592) 2024-08-26 09:39:24 +03:00
greggameplayer 86870e7c8d Implement TBUFFER_STORE_FORMAT_XY 2024-08-26 03:39:38 +02:00
Daniel R. fae0c0ae85
core/kernel: Miscellaneous memory fixes (#557)
* core/libraries/kernel: Fix inaccurate direct memory size

* core/memory: Fix available dmem query on non-free dmem areas

* core/kernel: return ENOMEM if memory area size is zero

* core/kernel: Fix returns on `sceKernelAvailableDirectMemorySize`

* core/memory: Remove unneeded size alignment
2024-08-26 04:14:21 +03:00
Yury 5d7407dc7d
Add ru translation (#579) 2024-08-26 03:22:30 +03:00
bigol83 bcc3a10557
Add Italian translation (#585)
* Update it.ts

* Update it.ts
2024-08-26 03:22:07 +03:00
psucien 6fd4264b5d video_core: vk_rasterizer: fix for crash on markers with nullGpu 2024-08-25 22:24:10 +02:00
DanielSvoboda 2a737d0800
V_NOP | PfpSyncMe | S_CMPK_EQ_U32 (#426)
* V_NOP

V_NOP = Do nothing

* PfpSyncMe

PfpSyncMe ensures that all previous commands are completed before continuing.
'break' should be enough for now

* S_CMPK_EQ_U32

S_CMPK_EQ_U32
SCC = (D.u == SIMM16)

* S_CMPK_EQ_U32

* OperandField::Undefined:

* Update translate.cpp

remove  OperandField::Undefined:

* Update image_view.cpp

[Render.Vulkan] <Error> image_view.cpp:ImageViewInfo:109: Storage image (num_comps = 4) requires swizzling [BGRA]
format 43 dst_sel 3886

* Update liverpool_to_vk.cpp

* S_CMPK_EQ_U32

* S_CMPK_EQ_U32
2024-08-25 22:07:46 +02:00
psucien b687ae5e34
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
georgemoralis c2ddfe51e1
Merge pull request #569 from CyntexMore/main
Added fancy formating to the README and made some texts "better"
2024-08-25 17:27:53 +03:00
georgemoralis abc7f55c06
Merge pull request #572 from dima-xd/qt_translations
gui: Implement gui translations
2024-08-25 17:24:55 +03:00
Dzmitry Dubrova 26b5661dea ci: Fix linux-qt CI 2024-08-25 16:03:25 +03:00
SaynedBread 6a87c37aeb
docs: Removed misinformation 2024-08-25 14:37:17 +02:00
SaynedBread 5664d45305
docs: Updated Status 2024-08-25 14:12:16 +02:00
Dzmitry Dubrova 21ce86003b Merge branch 'qt_translations' of https://github.com/dima-xd/shadPS4 into qt_translations 2024-08-25 13:59:51 +03:00
Dzmitry Dubrova 83b43363fa ci: Fix CI 2024-08-25 13:59:22 +03:00
¥IGA e603165e2b
Implement French translation 2024-08-25 13:31:45 +03:00
Dzmitry Dubrova 7766a653d5 ci: Add LinguistTools to CIs 2024-08-25 13:18:46 +03:00
Dzmitry Dubrova 3f445eca40 gui: Implement gui translations 2024-08-25 12:17:54 +03:00
SaynedBread 41a93dcae4
docs: Added some fancy Markdown formating to the README 2024-08-25 02:54:46 +02:00
SaynedBread 1e90f45941
docs: Added some fancy Markdown formating to the README 2024-08-25 02:53:13 +02:00
TheTurtle c79b10edc1
video_core: Bloodborne stabilization pt1 (#543)
* shader_recompiler: Writelane elimination pass + null image fix

* spirv: Implement image derivatives

* texture_cache: Reduce page bit size

* clang format

* slot_vector: Back to debug assert

* vk_graphics_pipeline: Handle null tsharp

* spirv: Revert some change

* vk_instance: Support primitive restart on list topology

* page_manager: Adjust windows exception handler

* clang format

* Remove subres tracking

* Will be done separately
2024-08-24 22:51:47 +03:00
Vinicius Rangel 9e4fc17e6c
shader_recompiler: handle fetch shader address offsets (#538)
* shader_recompiler: handle fetch shader address offsets

parse index & offset sgpr from fetch shader and propagate them to vkBindVertexBuffers

* shader_recompiler: fix fetch_shader when offset is not present

* video_core: propagate index/offset SGPRs to vkCmdDraw instead of offsetting the buffer address

* video_core: add vertex_offset to non-indexed draw calls

renamed fetch offset fields
2024-08-24 17:36:40 +02:00
georgemoralis 208575d392
Merge pull request #560 from vladmikhalin/avplayer-and-texture-cache-fixes
Fixed video dimensions alignment and image cache
2024-08-24 17:24:36 +03:00
georgemoralis 8b0fd59149
Merge pull request #558 from Exhigh/savedata-fix-2
savedata: Add another missing case to saveDataMount
2024-08-24 17:14:10 +03:00
Vladislav Mikhalin 41dec15869 Fixed video dimensions alignment and image cache 2024-08-24 16:59:30 +03:00
Exhigh 6a84f6e188 savedata: Add another missing case to saveDataMount
This helps Five Nights at Freddy's: Sister Location (CUSA17983) boot and is playable.
Fixes issue #554
2024-08-24 17:48:39 +04:00
Herman Semenov 243fd0be78
core,shader_recompiler: align structures for 64-bit platforms (#447)
Decreased sizes:
 * TextureDefinition 32 bytes -> 24 bytes
 * PortOut 72 bytes -> 64 bytes
 * Request 48 bytes -> 40 bytes
 * WindowSystemInfo 32 bytes -> 24 bytes
2024-08-24 16:18:12 +03:00
Random fc745ee767
Fix a few issues with the intel anv vulkan driver from mesa (#514)
* add fallback format for d16UnormS8Uint which is not supported by intel

* fix depth/stencil buffer creation issues causing asserts in intel driver
2024-08-24 14:50:46 +02:00
psucien 2c540fbecb
Merge pull request #497 from xezrunner/xezrunner/cfg-msb-fix
shader_recompiler: fix BranchTarget sign flip for sopp.simm
2024-08-24 11:39:10 +02:00
georgemoralis 0b3a88cf22
Merge pull request #550 from richarm4/patch-1
Fix typo in CONTRIBUTING.md comment
2024-08-24 10:06:09 +03:00
Matthew Wells 0ed4614464
Fix typo in CONTRIBUTING.md comment
"intitialize" -> "initialize"
2024-08-23 18:29:00 -07:00
georgemoralis 9852f95c58
Merge pull request #547 from GermanAizek/fix2
Fixed invalid set public exponent Crypto::DebugRifKeyset_init()
2024-08-23 22:41:15 +03:00
georgemoralis df03783948
Merge pull request #546 from abouvier/cmake-compat
cmake: fix version constraints
2024-08-23 22:40:12 +03:00
¥IGA 0c5b91e1fb
Warnings fixes (#541)
* Warnings fixes

* Warnings fixes
2024-08-23 22:38:55 +03:00
Herman Semenov a0774c0e87 Fixed invalid set public exponent Crypto::DebugRifKeyset_init() 2024-08-23 22:04:55 +03:00
Alexandre Bouvier a71d0d8dbb cmake: fix version constraints 2024-08-23 19:40:11 +02:00
georgemoralis fda2fdae69
Merge pull request #544 from Exhigh/Savedata-Fix
savedata: Handle missed case in saveDataMount
2024-08-23 20:05:52 +03:00
Exhigh 6545b09b74 savedata: Handle missed case in saveDataMount
This should help P5D get past the intro.

P.S:  The game requires Fiber and USBD modules to boot.
2024-08-23 16:27:03 +04:00
georgemoralis bce3a9c9e7
Merge pull request #530 from Xphalnos/main
Lot of small fixes
2024-08-22 21:54:20 +03:00
georgemoralis 3310fd9a1f
Merge pull request #531 from shadps4-emu/pad_fix
possible R2/L2 fix
2024-08-22 19:58:43 +03:00
georgemoralis 3e8d7c2040 possible R2/L2 fix 2024-08-22 19:43:45 +03:00
Xphalnos d4be3dbb31 Lot of small fixes 2024-08-22 18:01:30 +02:00
georgemoralis 83bcced16c
Merge pull request #502 from Borchev/ROMappedFileWorkaround
Workaround for readonly memory mapping of files issue
2024-08-22 13:49:19 +03:00
georgemoralis 746559658c
Merge pull request #525 from shadps4-emu/libc_removal
HLE libc removal
2024-08-22 11:59:56 +03:00
georgemoralis 12a65e3fb8 LLE libc removal 2024-08-22 11:24:31 +03:00
georgemoralis 834a25fa2b
Merge pull request #521 from GermanAizek/fix
Added const reference params if possible, removed less 16 size
2024-08-22 10:18:02 +03:00
Herman Semenov aed9a737d6 Added const reference params if possible, removed less 16 size 2024-08-22 02:56:01 +03:00
Aiden Turner ca4b520272
Added logging for debugging configs (#518)
* added logging for config file

* forgot a setting

* fixed bloated settings logging.

* fixed compile error
2024-08-22 01:52:08 +03:00
Vladislav Mikhalin 79680c50c0
Misc fixes (#517)
* Misc fixes

* Removed the skip for draw calls without RTs

* Remove Srgb image stores to rework later
2024-08-21 23:54:23 +03:00
georgemoralis dfd305ff77
Update Debugging.md
fixed reuse
2024-08-21 22:16:03 +03:00
Sebastian Kassai ba0a6ab038
Expand documentation on configuration and debugging (#513)
* documents: more info on config.toml

* documents: add Debugging

* documents: link to Debugging in README

* documents: link to main branch for Debugging

Once it's merged, it should link properly.
Quickstart already exists in main.

* documents: remove "troubleshooting" from Debugging

Not entirely relevant.

* documents: elaborate on a few points with stack traces

* documents: formatting, indentation fixup

* documents: remove unnecessary indent

* documents: fix some inline code blocks + misc

* documents: move the technical jargon out of Quickstart

* documents: improve configuration sections

Simplified the Quickstart config listing, added more technical info to the Debugging listing.

* documents: link quickstart config link to proper section

* documents: something ate my hash symbol

* documents: use *:Critical for log silencing example

* documents: add note about Start Without Debugging

* documents: use correct CUSA code in example
2024-08-21 22:13:06 +03:00
georgemoralis 132ca9c5a8
Merge pull request #506 from squidbus/macos-translocation
Untranslocate app bundle path if needed on macOS.
2024-08-21 18:13:08 +03:00
georgemoralis 3426ad8cc0
Merge pull request #511 from dima-xd/sample
avplayer: Fix data returned by sceAvPlayerGetAudioData
2024-08-21 16:53:01 +03:00
Dzmitry Dubrova 6d0d2eaa59 avplayer: Fix sceAvPlayerGetAudioData 2024-08-21 14:37:34 +03:00
squidbus 9275b0966e Untranslocate app bundle path if needed on macOS. 2024-08-21 03:06:10 -07:00
Borchev fc300b5265 Fix unmapping bug 2024-08-20 20:07:32 -07:00
Borchev 6596fe091c Workaround for readonly memory mapping of files issue 2024-08-20 16:10:38 -07:00
georgemoralis 958db559c6
Merge pull request #495 from jdpatdiscord/main
Allow builds on MSYS2 & improve Windows build steps documentation
2024-08-21 02:08:40 +03:00
TheTurtle 3f9c86ad33
vk_pipeline_cache: Avoid recompiling new shaders on each new PL (#480)
* cfg: Add one more divergence case

* Seen in RDR shaders

* renderer_vulkan: Reduce number of compiled shaders

* vk_pipeline_cache: Remove some unnecessary checks
2024-08-21 02:00:24 +03:00
Lizardy 32cb3649d3
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
xezrunner 42c4d8353a Fix control.sopp.simm flipping sign in CFG label generation
This used to cause a fatal crash that would prevent Amplitude [CUSA02480] from booting beyond initialization.

A conditional true label would get an address starting with 0xffff...., which wasn't realistic with the given shader.

The multiplication by 4 causes the value to have its MSB set due to the smaller type.
2024-08-20 22:48:28 +02:00
jdp_ 6080649b7c Merge branch 'main' of https://github.com/jdpatdiscord/shadPS4 2024-08-20 14:28:34 -04:00
jdp_ 34a1339a2b Allow builds on MSYS2 & improve Windows build steps documentation 2024-08-20 14:27:26 -04:00
jdp_ e070dab2f0 Allow builds on MSYS2 & improve Windows build steps documentation 2024-08-20 12:26:35 -04:00
kotn3l c60bfbe2a5
Set game window size based on the config (in windowed mode) (#481)
* Set windowed mode size based on config

* fix formatting oops

* emulator.cpp clang format fix (hopefully?)

* formatting fix for real
2024-08-20 15:39:56 +03:00
georgemoralis 95c89ca6a9
Merge pull request #375 from notgonnaleo/main
qt_gui: Added feature to toggle (show/hide) game list view
2024-08-20 11:47:00 +03:00
georgemoralis 8d90e6d997
Merge pull request #475 from bax-cz/main
PlayGo: basic implementation, credits to red-prig
2024-08-20 11:43:37 +03:00
bax-cz 0b3356bd1a linux build fix 2024-08-20 09:28:07 +02:00
bax-cz 8f7b3c2e8c clang: fixed formatting 2024-08-19 20:40:23 +02:00
Random 09da94b7b2
fix gcc compilation error in vk_graphics_pipeline.cpp (#477)
gcc fails to infer the type of the two parts of a ternary expression whose types are different but both contain an implicit cast operator to the same type
2024-08-19 18:45:42 +03:00
¥IGA 9d45b99171
Adding icons to categories (#479) 2024-08-19 18:42:23 +03:00
Dzmitry Dubrova 1f416134e7
Add messages to asserts (#476) 2024-08-19 15:29:13 +03:00
bax-cz 516a3e7104 PlayGo: basic implementation, credits to red-prig 2024-08-19 13:14:14 +02:00
Lizardy 138c9ce787
[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
georgemoralis 360b7e1d71
Merge pull request #471 from DanielSvoboda/Copy_submenu
Copy info - submenu
2024-08-19 09:45:44 +03:00
DanielSvoboda d5e978c6f2
Copy submenu 2024-08-19 01:25:15 -03:00
georgemoralis 09b71a9a3f
Merge pull request #466 from DanielSvoboda/alphabetical-order-console-language
Alphabetical order console language
2024-08-18 23:37:34 +03:00
DanielSvoboda c58ad6d3b5
alphabetical order console language 2024-08-18 17:24:41 -03:00
DanielSvoboda c9a502b31a
alphabetical order console language 2024-08-18 17:24:35 -03:00
georgemoralis 5551c61000
Merge pull request #463 from Xphalnos/main
Misc changes
2024-08-18 22:26:53 +03:00
DanielSvoboda ed96a9fb8e
alphabetical order console language 2024-08-18 16:15:06 -03:00
DanielSvoboda 5891900c6e
alphabetical order console language 2024-08-18 16:04:48 -03:00
Vladislav Mikhalin 1c898d0842
Fix stencil buffer not being used (#464) 2024-08-18 20:37:29 +03:00
Xphalnos 70576035b0 Misc changes 2024-08-18 17:56:29 +02:00
Lizardy 63938ba8dd
shader_recompiler: BUFFER_ATOMIC & DS_* Opcodes (#428)
* BUFFER_ATOMIC | DS_MINMAX_U32

- Emission of BufferAtomicU32
- Addition of Buffer opcodes to IR
- Translator for BUFFER_ATOMIC Opcode
- Translators for DS_MAXMIN_U32 Opcodes

* Clang Format & UNREACHABLE_MSG

* clang

* no crash on compile

* clang

* Shared Atomics

* reuse

* rm vscode

* resolve

* opcodes

* side effects

* attempt fix shader comp

* failed attempt to fix

* clang

* do correct vdata set (still fails)

* clang

* fixed BUFFER_ATOMIC_ADD, DS_ADD_U32 fails

* data share should work

* clang

* resource tracking for buffer atomic

* clang

* distinguish RTN opcodes

* clean IsBufferInstruction

---------

Co-authored-by: microsoftv <6063922+microsoftv@users.noreply.github.com>
2024-08-17 22:06:06 +03:00
¥IGA 3be2e4b2b8
About Window (#458) 2024-08-17 19:13:37 +03:00
georgemoralis ecf7f36763
Merge pull request #455 from Xphalnos/main
Qt-GUI: Improvements (Part 2)
2024-08-17 10:58:11 +03:00
georgemoralis 43e92bb987
Merge pull request #456 from StevenMiller123/sem_fix
Improve posix_sem functions
2024-08-17 10:57:19 +03:00
Xphalnos 73adc3ed1b Logger update 2024-08-17 08:22:31 +02:00
Stephen Miller 2935ca0fef clang-format fix 2024-08-16 17:22:06 -05:00
Stephen Miller 9fce6f7c01 Add SetPosixErrno function
I used a switch statement for future proofing, as some codes differ between Windows, Mac, Linux, or Orbis. Right now I've only added the codes that should be possible to encounter.
2024-08-16 17:20:21 -05:00
Stephen Miller 93f14e8ae9 Might fix clang-format? 2024-08-16 15:10:20 -05:00
Stephen Miller 6510af90be another clang-format fix 2024-08-16 15:07:19 -05:00
Stephen Miller f36440dc09 clang-format fix 2024-08-16 14:55:55 -05:00
Stephen Miller 786db80742 Improve posix_sem functions
Use ErrSceToPosix to update g_posix_errno appropriately after sem function calls.
2024-08-16 14:33:48 -05:00
Xphalnos 558fcf6597 Reduce window size 2024-08-16 19:48:18 +02:00
Dzmitry Dubrova dcb057dd7f
misc changes, part ?/? (#441)
* gui: add option to boot a game by choosing elf file

* core: some small implementations

* fs: implement open func

* add some validations

* spirv: add image format

* video_core: add eR16Uint to formats
2024-08-16 20:16:15 +03:00
Dzmitry Dubrova 9e810b7524
core: Some small pad stubs (#424)
* core: Some small pad stubs

* core: handle scePadSetLightBar wrong lightbar setting
2024-08-16 20:11:55 +03:00
TheTurtle 1d1c88ad31
control_flow_graph: Initial divergence handling (#434)
* control_flow_graph: Initial divergence handling

* cfg: Handle additional case

* spirv: Handle tgid enable bits

* clang format

* spirv: Use proper format

* translator: Add more instructions
2024-08-16 20:05:37 +03:00
Vinicius Rangel ff33b00c3a
gpu: primitive_restart bit check typo (#454) 2024-08-16 20:03:19 +03:00
Alexandre Bouvier 154771cca5
cmake: prefer system renderdoc library (#452) 2024-08-16 19:49:32 +03:00
Vinicius Rangel 444cdfbba5
gpu: check right register for primitive restart index (#453)
@red-prig suggestion

Not sure if it is possible to have trash in the register (maybe if primitive restart is toggled off), but just to make sure.
2024-08-16 19:49:15 +03:00
Alexandre Bouvier ad60ae1d40
cmake: prefer system ffmpeg library (#451) 2024-08-16 18:56:47 +03:00
Herman Semenov c1fb5d5bca
core,shader_recompiler: added const ref filesystem::path and removed if type size less 16 (#446) 2024-08-16 11:36:05 +03:00
georgemoralis 3197ad336e
Merge pull request #400 from vladmikhalin/basic-av-player
Basic AvPlayer implementation
2024-08-16 11:17:56 +03:00
Xphalnos 910e96c420 Qt-GUI: Improvements 2024-08-16 09:45:59 +02:00
Vladislav Mikhalin 23dddca1f0 last minute fixes 2024-08-16 10:30:48 +03:00
georgemoralis 5c70adc6ab
Merge pull request #449 from squidbus/libc++
Enable -fexperimental-library when using clang libc++
2024-08-16 10:28:03 +03:00
squidbus 62741434db Enable -fexperimental-library when using clang libc++ 2024-08-15 23:22:38 -07:00
Vladislav Mikhalin b3ef959b25 Fixed threading, migrated to CVs, added looping 2024-08-15 22:02:04 +03:00
Vladislav Mikhalin 5c4ac98d49 fixing build on linux and mac 2024-08-15 22:00:51 +03:00
Vladislav Mikhalin 0d6e8e227a Fixed some sound and threading issues.
Details:
* Switched SDL audio mutex to RW lock. This fixes games that continiously call SetVolume in a different thread (like Ghostbusters)
* Added contition to buffer audio packets independent of video packets. This fixes choppy audio across many games.
* Increased the number of audio frame buffers from 2 to 4. Just in case.
* Migrated to std::jthread and std::mutex from pthreads.
* Fixed a race condition with joins on avplayer close that caused a crash.
2024-08-15 22:00:51 +03:00
Vladislav Mikhalin e33ff10212 Added some logs, fixed some crashes, fixed align. 2024-08-15 22:00:51 +03:00
Vladislav Mikhalin b5c69189e5 avplayer WIP 2024-08-15 22:00:51 +03:00
georgemoralis e96e66eedd starting 0.2.1 2024-08-15 19:58:18 +03:00
georgemoralis da9b26fa1e tagged 0.2.0 release 2024-08-15 19:41:42 +03:00
psucien d32e584839 libraries: vide_out: redundant assert removed 2024-08-15 17:41:53 +02:00
¥IGA 0b1d7839a3
Qt-GUI: Cleaning the option menu (#443) 2024-08-15 17:49:13 +03:00
Vinicius Rangel d45563f92c
gpu: handle primitive restart index register (#438) 2024-08-15 15:43:27 +03:00
¥IGA a0fb47b0ab
Qt-GUI: Adding User Name selection (#440)
* Qt-GUI: Adding User Name selection

* fix

* fix 2

* fix 3 (thanks Poly)

* Change the username emplacement
2024-08-15 15:06:09 +03:00
¥IGA 8c77d4dde6
Ability to change username (#432) 2024-08-15 12:33:10 +03:00
psucien 9adc638220
shader_recompiler: basic implementation of `BUFFER_STORE_FORMAT_` (#431)
* shader_recompiler: basic implementation of buffer store w\ fmt conversion

* added `Format16` dfmt
2024-08-15 00:15:07 +02:00
Dzmitry Dubrova 6f4e1a47b9
core: misc changes (#430)
* core: misc changes

* video_core: add some formats for detiling

* clang format
2024-08-14 20:37:05 +02:00
Stephen Miller 5f963772a0
scePthreadAttrSetstack implementation (#391)
* scePthreadAttrSetstack implementation

Used by Final Fantasy XV

* Address Comments

Verify parameters before calling the pthread_attr_setstack function.
Swap uses of SCE prefix with ORBIS prefix.

* Quick fix

Addresses the newest review and appears to fix issues caused in games by my previous commit.
2024-08-14 18:43:00 +02:00
TheTurtle d332a5e611
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
georgemoralis 4b11dabd9e
Merge pull request #429 from polybiusproxy/memory-vq
core/memory: Fix error on virtual queries of reserved regions
2024-08-14 17:16:46 +03:00
Daniel R. 6cc4a682fd
core/memory: Fix error on virtual queries of reserved regions 2024-08-14 15:34:17 +02:00
psucien 27cb218584
video_core: CPU flip relay (#415)
* video_core: cpu flip is propagated via gpu thread now

* tentative fix for cpu flips racing

* libraries: videoout: better flip status handling
2024-08-14 11:36:11 +02:00
Samuel Fontes ad3b6c793c
qt-gui: Added GPU device selection functionality (#399)
* qt-gui: Added GPU device selection functionality

* Getting list of GPU only when application starts

* Fixed formatting

* Fixed formatting

* Fixed formatting

* Added warning when GPU doesn't support API version.

* Changed Unsupported Vulkan Version warning

* Removed unused size checking on GetPhysicalDevices

The method is only being called once so this doesn't make sense. It was some left over of me trying to get this done some other way.

* Fix formatting

* Fix formatting

* SettingsDialog: Passing physical devices as span

* Fixed formatting
2024-08-14 00:21:06 +03:00
TheTurtle d8b9d82ffa
video_core: Various fixes (#423)
* video_core: Various fixes

* clang format
2024-08-13 20:05:10 +03:00
counter185 bb159eafb9
Basic gamepad support through SDL (#407)
* Add basic gamepad support through SDL

* lightbar, vibration, code style changes

* okay fine

* one day clang format will finally pass
2024-08-13 12:54:08 +03:00
squidbus d1a033b6af
Fix some Vulkan validation errors on macOS. (#420) 2024-08-13 10:30:47 +03:00
TheTurtle 1fb0da9b89
video_core: Crucial buffer cache fixes + proper GPU clears (#414)
* translator: Use templates for stronger type guarantees

* spirv: Define buffer offsets upfront

* Saves a lot of shader instructions

* buffer_cache: Use dynamic vertex input when available

* Fixes issues when games like dark souls rebind vertex buffers with different stride

* externals: Update boost

* spirv: Use runtime array for ssbos

* ssbos can be large and typically their size will vary, especially in generic copy/clear cs shaders

* fs: Lock when doing case insensitive search

* Dark Souls does fs lookups from different threads

* texture_cache: More precise invalidation from compute

* Fixes unrelated render targets being cleared

* texture_cache: Use hashes for protect gpu modified images from reupload

* translator: Treat V_CNDMASK as float

* Sometimes it can have input modifiers. Worst this will cause is some extra calls to uintBitsToFloat and opposite. But most often this is used as float anyway

* translator: Small optimization for V_SAD_U32

* Fix review

* clang format
2024-08-13 09:21:48 +03:00
Vinicius Rangel dfcfd62d4f
spirv: fix image sample lod/clamp/offset translation (#402)
* spirv: fix image sample lod/clamp translation

* spirv: fix image sample offsets

* fix ImageSample opcodes & offset emission
2024-08-13 09:12:38 +03:00
Lizardy 5eecd089ab
thread_management.cpp: Various Mandatory Threading Fixes | Resolve #398 (#394)
* Handle empty mutex attribute

- scePthreadMutexInit did not return default when the mutex attributes were empty, now it does

* fix conditional unsafety

* Update thread_management.cpp

fix deref

* accurate heap api

- modified HeapAPI to a struct with preset function fields
- utilized the full array parameter passed to _sceKernelRtldSetApplicationHeapAPI

* fallback to std malloc

* clang format

* Declare all HeapAPI replacement functions

- calloc, realloc, memalign, reallocalign, malloc_stats, malloc_stats_fast, malloc_usable_size
- posix_memalign corrected parameters

* resolve suggestions

- `using` definition replacement for AppHeapAPI
- linux uses heap_malloc, windows uses std::malloc

---------

Co-authored-by: microsoftv <6063922+microsoftv@users.noreply.github.com>
2024-08-13 09:08:03 +03:00
Borchev 18f1799280
Add partial unmap support (#322)
* Add partial unmap support

* undo accidental whitespace removal

* Fix assertions

* Adjust Reserve and Free functions for partial unmapping
2024-08-13 09:05:30 +03:00
psucien a8b6a55559
Merge pull request #419 from squidbus/macos-fix
Enable VK_EXT_robustness2 nullDescriptor only if supported.
2024-08-13 00:15:48 +02:00
squidbus 284035d3e2 Enable VK_EXT_robustness2 nullDescriptor only if supported. 2024-08-12 14:52:46 -07:00
psucien a15a93997c unlink sync2 if not present (tentative fix for #418) 2024-08-12 22:52:21 +02:00
psucien 2ba3221fc9 fix for Linux compilation (#416) 2024-08-12 20:10:42 +02:00
psucien 3d0fdf11f0
Build stabilization (#413)
* shader_recompiler: fix for float convert and debug asserts

* libraries: kernel: correct return code on invalid semaphore

* amdgpu: additional case for cb extents retrieval heuristic

* removed redundant check in assert

* amdgpu: fix for linear tiling mode detection fin color buffers

* texture_cache: fix for unexpected scheduler flushes by detiler

* renderer_vulkan: missing depth barrier

* texture_cache: missed slices in rt view; + detiler format
2024-08-12 17:23:01 +03:00
psucien ace39957ef
Video Core: debug tools (#412)
* video_core: better use of rdoc markers

* renderer_vulkan: added gpu assisted validation

* renderer_vulkan: make nv_checkpoints operational

* video_core: unified Vulkan objects names
2024-08-12 13:46:45 +02:00
psucien 3e2d4d6b79
Gnmdriver: More functions (#410)
* libraries: gnmdriver: added `sceGnmGetGpuCoreClockFrequency`

* libraries: gnmdriver: `sceGnmSetVgtControl` added

* amdgpu: gpuclock64 in write eop packet
2024-08-12 13:29:57 +02:00
georgemoralis 834e3a500e added a fix for audio (seems that some games calls sceAudioOutInit twice) Thanks Roamic for tracing this! 2024-08-11 13:16:50 +03:00
georgemoralis 924e9de97a
Merge pull request #390 from dima-xd/qt_settings_dialog
gui: Implement settings dialog
2024-08-10 20:59:32 +03:00
Dzmitry Dubrova 3163cd135b gui: Add console language to settings 2024-08-09 18:28:50 +03:00
Dzmitry Dubrova 96fb00d411 gui: Implement settings dialog 2024-08-09 17:28:16 +03:00
Leonardo 14947232a7
Fixed coding style again on the if brackets 2024-08-09 09:24:14 -03:00
georgemoralis ea4ae56f4d
Merge pull request #368 from shadps4-emu/subupdatesAndFixes
Submodules updates + misc fixes
2024-08-09 13:31:57 +03:00
georgemoralis 54b20e2938 update submodules for some neccesary sdl addons 2024-08-09 13:04:00 +03:00
georgemoralis 61a6f633fd mount temp dir 2024-08-09 12:56:03 +03:00
georgemoralis d81dbc5b5b console language is better name 2024-08-09 12:24:42 +03:00
georgemoralis 425e5491a8 added setting for change language
(reference to https://github.com/shadps4-emu/shadPS4/wiki/PS4-Modules#supported-languages for values)
2024-08-09 11:58:42 +03:00
Leonardo 0d56be629b Removed else that duplicated while commiting the typo fixes 2024-08-08 18:33:06 -03:00
Leonardo 4375e6fa3a Fixed if else formatting 2024-08-08 18:30:58 -03:00
georgemoralis 250b2e4969 small playgo adjustments 2024-08-09 00:02:26 +03:00
georgemoralis 6a2e09a1df update submodules (possible mac fix?) 2024-08-09 00:02:25 +03:00
georgemoralis 3ef69cae5e some pad fixes (fixing metal slug 3 and risk of rain) 2024-08-09 00:02:25 +03:00
georgemoralis 7b7d1cb26f added missing NIDs in thread management 2024-08-09 00:02:25 +03:00
georgemoralis a83ac4c05e removed duplicate libSceJson2.sprx loading 2024-08-09 00:02:25 +03:00
georgemoralis 816700d34d fixed to scePadGetControllerInformation , (fixes CUSA04892 - power rangers multi user issue) 2024-08-09 00:02:25 +03:00
georgemoralis 4ffb812e94 more linux fix? 2024-08-09 00:02:25 +03:00
georgemoralis 13331cdda9 linux fix? 2024-08-09 00:02:25 +03:00
georgemoralis 5a68224a13 update submodules , fixed sdl update , rewrote config with new toml11 v4 2024-08-09 00:02:24 +03:00
SleepingSnakezzz ab56665d4b
Update latest build instructions.md (#385)
Expands on the existing instructions for more clarity.
2024-08-08 23:43:21 +03:00
Stephen Miller 48c58d5ce0
Kernel-Related Fixes (#386)
* Fix OrbisKernelBatchMapEntry struct

UE4 games and GTA V cause the BatchMap offset to overflow on Windows. Changing the type fixes this, and doesn't seem to cause any regressions on Windows or Linux.

* Implement posix_sem_trywait

Grand Theft Auto V needs this.

* Add missing scePthreadAttrGetdetachstate NID

Noticed this missing NID while testing games.
2024-08-08 23:42:51 +03:00
georgemoralis 3943d13871
Merge pull request #382 from shadps4-emu/smallrevert
revert some sdl switches
2024-08-08 22:55:00 +03:00
georgemoralis c96854f1f1
Merge pull request #381 from SamuelFontes/issues/361
361: Game directory window appears every time
2024-08-08 22:33:42 +03:00
georgemoralis e5087877ae revert some sdl switches 2024-08-08 22:31:14 +03:00
georgemoralis 14e56e267a
Merge pull request #380 from SamuelFontes/bugfix/refresh_game_list_after_path_change
qt_gui: Refreshing game list after install directory change
2024-08-08 22:25:14 +03:00
SamuelFontes 564b2f6310 361: Game directory window appears every time
qt_gui: When a command line argument is passed to the GUI version, it will always prompt to change the game directory. This happens because the "user" folder is created on the elf or eboot.bin location.
This change will ignore the game install directory configuration at startup when an command line argument is passed.
Since if a game was passed, it should start automatically as this is the expected behaviour.
2024-08-08 16:14:35 -03:00
SamuelFontes 7e5cc6162c qt_gui: Refreshing game list after install directory change
The game list wasn't being refreshed automaticly after a manual directory change on the QT GUI,  now the RefreshGameTable will be called after the GameInstallDialog is executed.
2024-08-08 15:57:43 -03:00
georgemoralis 81be8f270f
Merge pull request #379 from ElBread3/dbc-game
qt_gui: Added double-click game icon to start game
2024-08-08 21:51:17 +03:00
ElBread3 351f2e1073 double click to open games 2024-08-08 13:23:44 -05:00
Xphalnos 254b9ffb50
Workflows cleanup + misc fixes (#371)
* Workflows cleanup

* clang-format

* SDL3: Disabling unnecessary options

* Revert CMakeLists.txt changes
2024-08-08 18:19:44 +03:00
IndecisiveTurtle 3fd2abdd5b vk_graphics_pipeline: Fix regression 2024-08-08 17:01:03 +03:00
TheTurtle 341034fc30
filter: Add random library 2024-08-08 15:44:05 +03:00
TheTurtle 381ba8c7a5
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
Leonardo ddec111da6 qt_gui: Added feature to toggle (show/hide) game list view
"Show Game List" button originally didn't have any action assigned to it, so this PR is supposed to implement the change that would make sense to it (even though I don't think anyone would be using this too much.)
2024-08-08 00:23:54 -03:00
TheTurtle 159be2c7f4
video_core: Minor fixes (#366)
* data_share: Fix DS instruction

* vk_graphics_pipeline: Fix unnecessary invalidate

* spirv: Remove subgroup id

* vector_alu: Simplify mbcnt pattern

* shader_recompiler: More instructions

* clang format

* kernel: Fix cond memory leak and reduce spam

* liverpool: Print error on exception

* build fix
2024-08-05 13:45:28 +03:00
DanielSvoboda cdff4af38d
add-SurfaceFormat (#365)
[Debug] <Critical> liverpool_to_vk.cpp:SurfaceFormat:395: Unreachable code!

CUSA24620
Unknown data_format=7 and num_format=7

CUSA03082
Unknown data_format=2 and num_format=4

CUSA19345
Unknown data_format=34 and num_format=7

CUSA02411
Unknown data_format=1 and num_format=9

A duplicate was also removed.
2024-08-04 22:17:34 +02:00
DanielSvoboda 7308864537
SampleCountFlagBits::e16 - GetGpuClock64 (#360)
* SampleCountFlagBits::e16

* GpuClock64

* GpuClock64

* Update pm4_cmds.h

* Update pm4_cmds.h
2024-08-04 15:49:43 +02:00
Xphalnos 21462523de
Minor Qt GUI update (#363)
* Minor Qt GUI update

* Update gui_context_menus.h

* Update gui_context_menus.h

* Update game_info.cpp
2024-08-04 16:07:10 +03:00
Alexandre Bouvier 6d0a763145
reuse: fix license for externals (#358) 2024-08-02 15:57:16 +03:00
georgemoralis 9f2e73c1fd
Merge pull request #356 from squidbus/macos-icon
Add macOS icon.
2024-08-01 08:42:44 +03:00
georgemoralis 305224650a
Merge pull request #352 from Xphalnos/main
Better logo for shadPS4
2024-08-01 08:42:24 +03:00
squidbus be829389ea Add new icons file to reuse config. 2024-07-31 19:40:25 -07:00
squidbus 56b362bb24 Add macOS icon. 2024-07-31 19:37:55 -07:00
georgemoralis 54e831746d
Merge pull request #355 from shadps4-emu/git_version
Added Git version info
2024-08-01 02:16:34 +03:00
georgemoralis bd48e24c32 print git info to log as well 2024-08-01 01:11:58 +03:00
georgemoralis 62e501f31f print git info in windows title 2024-08-01 00:56:10 +03:00
Xphalnos a4e46c4362 Merge branch 'main' of https://github.com/Xphalnos/shadPS4 2024-07-31 18:15:09 +02:00
Xphalnos 9968d03b90 Better logo for shadPS4 2024-07-31 18:14:22 +02:00
georgemoralis 0ac9f8ffa4
Merge pull request #346 from shadps4-emu/savedata_1
SaveData Fixes
2024-07-31 17:34:44 +03:00
georgemoralis a121e8e76a
Merge pull request #351 from Xphalnos/main
Adding macOS to readme + minor changes
2024-07-31 14:52:22 +03:00
Xphalnos 205c0b961b Adding macOS to readme + minor changes 2024-07-31 13:43:30 +02:00
Dzmitry Dubrova 0fe766db6c
core: Implement sceRandomGetRandomNumber (#350) 2024-07-31 14:01:22 +03:00
Xphalnos a7f2f09a44
Reorganization of includes (#348)
* Reorganization of includes

* fix
2024-07-31 13:25:55 +03:00
raziel1000 413402600b missing eR8Srgb 2024-07-31 02:07:02 -06:00
raziel1000 ec1335911b added data_format=1 and num_format=9 2024-07-31 01:24:44 -06:00
raziel1000 51c89a9958 added data_format=10 and num_format=5 2024-07-31 00:32:50 -06:00
raziel1000 d017bab21e Kernel: added sceKernelConvertLocaltimeToUtc 2024-07-31 00:21:23 -06:00
raziel1000 d7acb93d6f - Implemented sceSaveDataSetParam and sceSaveDataGetParam
- Fixed sceSaveDataDirNameSearch
2024-07-30 22:55:58 -06:00
TheTurtle a7c9bfa5c5
shader_recompiler: Small instruction parsing refactor/bugfixes (#340)
* translator: Implemtn f32 to f16 convert

* shader_recompiler: Add bit instructions

* shader_recompiler: More data share instructions

* shader_recompiler: Remove exec contexts, fix S_MOV_B64

* shader_recompiler: Split instruction parsing into categories

* shader_recompiler: Better BFS search

* shader_recompiler: Constant propagation pass for cmp_class_f32

* shader_recompiler: Partial readfirstlane implementation

* shader_recompiler: Stub readlane/writelane only for non-compute

* hack: Fix swizzle on RDR

* Will properly fix this when merging this

* clang format

* address_space: Bump user area size to full

* shader_recompiler: V_INTERP_MOV_F32

* Should work the same as spirv will emit flat decoration on demand

* kernel: Add MAP_OP_MAP_FLEXIBLE

* image_view: Attempt to apply storage swizzle on format

* vk_scheduler: Barrier attachments on renderpass end

* clang format

* liverpool: cs state backup

* shader_recompiler: More instructions and formats

* vector_alu: Proper V_MBCNT_U32_B32

* shader_recompiler: Port some dark souls things

* file_system: Implement sceKernelRename

* more formats

* clang format

* resource_tracking_pass: Back to assert

* translate: Tracedata

* kernel: Remove tracy lock

* Solves random crashes in Dark Souls

* code: Review comments
2024-07-30 23:32:40 +02:00
georgemoralis ac6dc20c3b
Merge pull request #343 from Borchev/AddPthreadGetStackSizeThunk
Add pthread_attr_getstacksize thunk
2024-07-30 23:36:39 +03:00
Xphalnos b3525d7f79
Don't download unnecessary DLLs (#341) 2024-07-30 22:41:31 +03:00
Borchev 361271826e
Fix SearchFree function bug (#339) 2024-07-30 22:40:42 +03:00
Borchev 867f38fe13 Add pthread_attr_getstacksize thunk 2024-07-30 12:37:05 -07:00
georgemoralis c1d01709be
kernel: Implement sceKernelSetVirtualRangeName (#338)
* Fix in searchFree should fix #337

* clang format fix

* sceKernelSetVirtualRangeName implementation

* improved vaddr conversion

* updated VirtualQuery to include name too

* unmap also removed name thanks @red_prig

* fixed copy...
2024-07-29 19:08:06 +03:00
georgemoralis 9b1092c995
Merge pull request #336 from squidbus/sem-polyfill
Add sem_timedwait polyfill for macOS.
2024-07-29 07:56:18 +03:00
squidbus 43d60a8ac9 Add sem_timedwait polyfill for macOS. 2024-07-28 16:42:33 -07:00
psucien aa795f5c59
Merge pull request #335 from VasylBaran/apple_detiler_artifacts_fixup
Fixup for detiler artifacts on macOS
2024-07-28 21:42:05 +02:00
Vasyl Baran 3e6af54ea3 Fixup for detiler artifacts on macOS 2024-07-28 22:21:18 +03:00
Dzmitry Dubrova aa7c8ca2b6
Implement some pthread calls (#332) 2024-07-28 18:43:44 +03:00
DanielSvoboda fb145342ce
log improvement ThrowInvalidType (#330)
* log improvement ThrowInvalidType

* log improvement ThrowInvalidType
2024-07-28 18:42:54 +03:00
psucien 30198d5ffc
Surface management rework (2/3) (#329)
* texture_cache: interface refactoring

* a bit of fixes and improvements

* texture_cache: macro tile extents for bpp 128

* texture_cache: detiler: prefer host memory for large buffers upload
2024-07-28 17:20:42 +02:00
TheTurtle 0d6edaa0a0
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
Vinicius Rangel 361412031c
fix tls patch on windows (#328)
* fix tls patch on windows

based on TlsGetValue in kernel32.dll

* fix tls patch on windows for expansion slots
2024-07-27 20:16:21 +03:00
Vinicius Rangel 680192a0c4
64 bits OP, impl V_ADDC_U32 & V_MAD_U64_U32 (#310)
* impl V_ADDC_U32 & V_MAD_U64_U32

* shader recompiler: add 64 bits version to get register / GetSrc

* fix V_ADDC_U32 carry

* shader recompiler: removed automatic conversion to force_flt in GetSRc

* shader recompiler: auto cast between u32 and u64 during ssa pass

* shader recompiler: fix SetVectorReg64 & standardize switches-case

* shader translate: fix overflow detection in V_ADD_I32

use vcc lo instead of vcc thread bit

* shader recompiler: more 64-bit work

- removed bit_size parameter from Get[Scalar/Vector]Register
- add BitwiseOr64
- add SetDst64 as a replacement for SetScalarReg64 & SetVectorReg64
- add GetSrc64 for 64-bit value

* shader recompiler: add V_MAD_U64_U32 vcc output

- add V_MAD_U64_U32 vcc output
- ILessThan for 64-bits

* shader recompiler: removed unnecessary changes & missing consts

* shader_recompiler: Add s64 type in constant propagation
2024-07-27 17:23:59 +03:00
TheTurtle d84b4adc83
semaphore: Yet another race condition fix (#327) 2024-07-27 17:18:18 +03:00
georgemoralis b7c3ff932b
Merge pull request #325 from DanielSvoboda/BUFFER_STORE_DWORDX2
BUFFER_STORE_DWORDX2
2024-07-26 13:17:16 +03:00
georgemoralis 14e78591e8
Merge pull request #320 from shadps4-emu/miscFixes7
Misc Fixes 7
2024-07-26 13:14:04 +03:00
raziel1000 600a13c38f fs: added /download0 mount
fs: get rid of double slashes
2024-07-26 08:07:22 -06:00
georgemoralis 2841eba538 added /dev/urandom 2024-07-26 08:50:39 +03:00
georgemoralis a4912b8245 commented sem_timedwait for linux untill @squidbus fix it 2024-07-26 08:16:32 +03:00
georgemoralis 64d305faeb cleanup memory_management 2024-07-26 08:08:47 +03:00
raziel1000 a11ac5a687 ... 2024-07-26 07:59:55 +03:00
raziel1000 fa76a723ad Applied feedback from @raphaelthegreat 2024-07-26 07:59:35 +03:00
georgemoralis b62836d29f forgot a file 2024-07-26 07:53:46 +03:00
georgemoralis b4916ef2ca some fixup to playgo , makes Worms go further 2024-07-26 07:53:45 +03:00
raziel1000 a475b38e5f - fixed sceAppContentTemporaryDataMount2 2024-07-26 07:53:19 +03:00
raziel1000 f35518d527 sdl window: Added game title (serial, title and app_ver) 2024-07-26 07:53:18 +03:00
raziel1000 f29293c9fb thread_management: some pthread functions 2024-07-26 07:53:18 +03:00
raziel1000 02d4af27df save_data: fix/accuracy for saveDataMem functions 2024-07-26 07:53:18 +03:00
DanielSvoboda b2ba84aa11
BUFFER_STORE_DWORDX2 2024-07-26 00:25:29 -03:00
TheTurtle a2cd1669b6
memory: Cleanups and refactors (#324)
* memory: Various fixes

* Added (Partial) sceKernelBatchMap/sceKernelBatchMap2

* memory: Rename and implement batch unmap

* memory: Remove uneeded assert

* memory: Commonize free search routine

* memory: Contains check is inclusive

* memory: Address some alignment issues

* clang format

---------

Co-authored-by: raziel1000 <ckraziel@gmail.com>
2024-07-25 23:01:12 +03:00
georgemoralis bc28ed66e8
Merge pull request #323 from shadps4-emu/win-fix
address_space: Fix windows placeholder mapping
2024-07-25 12:15:25 +03:00
georgemoralis 8fa6a8c036 clang fix 2024-07-25 11:59:39 +03:00
IndecisiveTurtle 8bb6c0ddf0 address_space: Fix windows placeholder mapping 2024-07-24 22:59:56 +03:00
Younes 1d6a42c39a
Merge pull request #319 from DanielSvoboda/fixed--patch-version-is-older
Fixed the button- PKG patch version is older
2024-07-23 23:17:26 -06:00
DanielSvoboda de6f703d7d
I fixed the button, PKG patch version is older
I fixed the button, PKG patch version is older
2024-07-23 19:21:54 -03:00
squidbus de3864dba7
Install x86_64 MoltenVK from Homebrew. (#318) 2024-07-23 22:17:50 +03:00
georgemoralis 0691e316e0
Merge pull request #317 from VasylBaran/fix_macos_build_molten_vk
Fix macOS builds
2024-07-23 20:26:48 +03:00
VasylBaran 4e81d91f88 Install molten-vk using brew (vs getching it directly with url) to fix macOS build 2024-07-23 20:24:35 +03:00
Foxi f593204729
Update CONTRIBUTING.md (#316)
Syntax highlighting for the example code
2024-07-23 18:56:31 +03:00
georgemoralis 7f990ea90d
Merge pull request #314 from squidbus/game-data-path
Replace remaining uses of `QDir::currentPath() / "user"` with `GetUserPath(UserDir)`.
2024-07-22 18:27:34 +03:00
squidbus 54b5900498 Replace remaining uses of QDir::currentPath() / user with UserDir. 2024-07-21 14:01:10 -07:00
georgemoralis 062ee9e092 one more memory fix 2024-07-21 23:16:46 +03:00
georgemoralis fe9b07da54 memory fix 2024-07-21 23:14:40 +03:00
georgemoralis 36ec7a1a43
Merge pull request #312 from Borchev/main
Add sceKernelGetDirectMemoryType, update sceKernelReserveVirtualRange
2024-07-21 22:52:50 +03:00
squidbus 70708fc69b Allocate more system reserved space on macOS and document restrictions. 2024-07-21 22:36:12 +03:00
squidbus 615f4e770f Support RIP relative memory operands in patched instructions. 2024-07-21 22:36:12 +03:00
squidbus 088130863b Update MoltenVK to 1.2.10 2024-07-21 22:36:12 +03:00
squidbus 43c0f313f2 Fix user data path on macOS. 2024-07-21 22:36:12 +03:00
squidbus 225ca3ac5b Update format list for rebase and sort and remove duplicates. 2024-07-21 22:36:12 +03:00
squidbus cf03743631 Restore old keybindings for Windows and Linux. 2024-07-21 22:36:12 +03:00
squidbus 426d82d07b Only use date library on macOS. 2024-07-21 22:36:12 +03:00
squidbus b557de2c62 Make sure only system managed region can be moved on Windows. 2024-07-21 22:36:12 +03:00
squidbus 26e0fc6ad5 Only patch BMI1 instructions under Rosetta 2. 2024-07-21 22:36:12 +03:00
squidbus fadf03909c Add a few missing used formats from detiling. 2024-07-21 22:36:12 +03:00
squidbus 3e84d2b76c Define tessellation_factors_ring_addr relative to end of system reserved area. 2024-07-21 22:36:12 +03:00
squidbus e2adbd75c3 Reduce system reserved space to 0x700000000 and map fixed on macOS. 2024-07-21 22:36:12 +03:00
squidbus f943ce2710 Address review comments around memory and patches. 2024-07-21 22:36:12 +03:00
squidbus b3d97dcd89 Make sure system managed memory is in correct location on macOS. 2024-07-21 22:36:12 +03:00
squidbus 685b0bfd5e Fix missing logging on memory manager initalization. 2024-07-21 22:36:12 +03:00
squidbus 4fd3af995e Change format list from vector to array/span. 2024-07-21 22:36:12 +03:00
squidbus 68e1a6a596 Tidy up Vulkan extension list. 2024-07-21 22:36:12 +03:00
squidbus e06039d727 Set minimum macOS target to 11 and fix compile errors. 2024-07-21 22:36:12 +03:00
squidbus 35bbbb1bd9 Add GitHub Actions workflows for macOS. 2024-07-21 22:36:12 +03:00
squidbus a4fd0d6386 Remap SDL face buttons to be usable without a keypad. 2024-07-21 22:36:12 +03:00
squidbus 175ffe8ce3 Add fallback system for unsupported pixel formats. 2024-07-21 22:36:12 +03:00
squidbus 35d629a730 Downgrade Vulkan requirement to 1.2 with extensions. 2024-07-21 22:36:12 +03:00
squidbus d9231b239c Migrate TLS patches to new patching system. 2024-07-21 22:36:12 +03:00
squidbus 6a6d5bad42 Fix one-off bug with user data registers. 2024-07-21 22:36:12 +03:00
squidbus 66fa29059c Add initial macOS support. 2024-07-21 22:36:12 +03:00
Borchev 5419212088 Fix formatting 2024-07-21 12:35:01 -07:00
Borchev f556f85279 Add sceKernelGetDirectMemoryType and update sceKernelReserveVirtualRange to search for free region when virtual_addr==0 2024-07-21 11:29:24 -07:00
TheTurtle 36d528743a
vk_scheduler: Fix pending op check 2024-07-21 17:41:46 +03:00
TheTurtle 403a5a57b1
vk_scheduler: Add api for defering operations (#311) 2024-07-21 15:42:32 +03:00
psucien 64459f1a76
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
psucien 2b52a17845 externals: Tracy updated to 0.11 2024-07-20 11:30:55 +02:00
TheTurtle bfe3322977
spirv: Address some regressions in buffer loads (#304)
* spirv: Use correct index

* spirv: Fix indices during buffer load

* clang-format fix

* spirv: Index can be const

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2024-07-19 19:36:07 +03:00
georgemoralis 60b1aa62a3
Merge pull request #281 from shadps4-emu/miscFixes6
Misc Fixes (forgot the number)
2024-07-19 16:35:19 +03:00
georgemoralis fcc931956e submodules updated 2024-07-19 09:02:36 +03:00
georgemoralis d00a2465d5 update fixes for winpthreads 2024-07-19 08:50:55 +03:00
Vladislav Mikhalin d0d7ef06e8
Fixed buffer_store_* regression (#302) 2024-07-18 21:04:12 +03:00
georgemoralis c578ccc435 load every available prx from sce_module folder of game 2024-07-18 18:34:08 +03:00
georgemoralis 250bfbb494
Update liverpool_to_vk.cpp 2024-07-18 18:19:46 +03:00
georgemoralis 25e95c959a
Merge branch 'main' into miscFixes6 2024-07-18 18:18:10 +03:00
Dzmitry Dubrova 485d4fd0fb
kernel: Implement posix_pthread_once (#297)
* kernel: Implement posix_pthread_once

* Fix clang format
2024-07-17 23:34:22 +03:00
georgemoralis 384ea359ed
Merge pull request #300 from shadps4-emu/regression-fix
code: Fixup some regressions
2024-07-17 20:40:23 +03:00
georgemoralis 0ed9ea5b85 force imedialog to input "shadps4" as name . That way we can pass games that want username . temp solution till imgui dialog prepared 2024-07-17 20:32:14 +03:00
georgemoralis 439c0be9a6 clang format fix 2024-07-17 17:57:54 +03:00
IndecisiveTurtle 1208661d64 Remove bc6 2024-07-17 17:06:09 +03:00
IndecisiveTurtle cd009cfec6 shader_recompiler: Normal gathers 2024-07-17 16:49:45 +03:00
IndecisiveTurtle 53fb73e95f rasterizer: Bump staging to 1GB
* Less chances of crashing
2024-07-17 16:22:04 +03:00
IndecisiveTurtle fcbaec51df liverpool_to_vk: Add more surface formats 2024-07-17 16:19:08 +03:00
IndecisiveTurtle 01dc7f5bfc Add comments 2024-07-17 15:52:40 +03:00
IndecisiveTurtle b89941fbd9 emulator: Add libSceUlt too 2024-07-17 15:44:20 +03:00
IndecisiveTurtle 0408d8596d emulator: Add libSceFiber and simplify logic 2024-07-17 15:37:32 +03:00
IndecisiveTurtle b6f011c8f6 event_queue: Add clear flag to events and don't return error 2024-07-17 14:50:26 +03:00
IndecisiveTurtle c64694c673 gnmdriver: Fix incorrect trailing nop insertion in indirect draws 2024-07-17 14:48:30 +03:00
IndecisiveTurtle 815ce11d2b fs: Defeat games with double slashes 2024-07-17 14:46:37 +03:00
georgemoralis 7ad44317f8
Merge pull request #252 from qurious-pixel/patch-1
Move "game_data" to RW directory inside user folder for linux
2024-07-16 23:05:29 +03:00
Vladislav Mikhalin f9e96793cc
Implemented load_buffer_format_* conversions (#295)
* Implemented load_buffer_format_* conversions

* clang-format insists on ugly things
2024-07-16 15:03:07 +03:00
georgemoralis c6cdfcfb0b
Merge pull request #299 from squidbus/poll-ebusy
Return EBUSY from sceKernelPollEventFlag instead of ETIMEDOUT.
2024-07-16 15:00:38 +03:00
squidbus 3ff11818ab Return EBUSY from sceKernelPollEventFlag instead of ETIMEDOUT. 2024-07-16 04:53:37 -07:00
TheTurtle 0dda5eb6ef
fs: Fix nullptr check in GetFile 2024-07-15 16:52:24 +03:00
TheTurtle 3b0a5aed33
fs: Use proper append operator 2024-07-15 15:42:35 +03:00
georgemoralis 0de914995f
Merge pull request #293 from shadps4-emu/misc-fixes3
Various linux fixes
2024-07-15 15:25:20 +03:00
IndecisiveTurtle 3c8b3f9a29 fs: Remove some unnecessary string conversions 2024-07-15 15:14:04 +03:00
IndecisiveTurtle 10a7110c7d Merge branch 'misc-fixes3' of https://github.com/shadps4-emu/shadPS4 into misc-fixes3 2024-07-15 15:05:29 +03:00
IndecisiveTurtle 356b59b041 kernel: Remove linux hack
* Breaks many games, only benefits BB. Tbd
2024-07-15 14:51:45 +03:00
IndecisiveTurtle 0599f4e6a5 fs: Fix case of getting the mount itself 2024-07-15 14:50:28 +03:00
georgemoralis 0298889131 windows std::filesystem fixes 2024-07-15 14:50:23 +03:00
georgemoralis ba0be91c73 clang format fix 2024-07-15 14:18:28 +03:00
IndecisiveTurtle 58d1cbd9b7 ssa_rewrite_pass: Correct phi node type for thread bitmask 2024-07-15 13:34:34 +03:00
georgemoralis c49afb4c17
Merge pull request #287 from polybiusproxy/dev
gnmdriver: Implement shader functions
2024-07-15 07:47:33 +03:00
jas0n098 6ec4a3d1b9
Replace deprecated pthread functions (#290)
pthread_attr_(set,get)stackaddr are deprecated and don't exist anymore on musl libc
2024-07-15 03:55:58 +03:00
IndecisiveTurtle ce6a01bd41 clang format 2024-07-15 03:47:10 +03:00
IndecisiveTurtle dbeed80e3b fs: Actually functional linux case insensitive search 2024-07-15 03:37:30 +03:00
IndecisiveTurtle 26f8fbf628 tls: Use gs segment for linux 2024-07-15 01:48:57 +03:00
IndecisiveTurtle 432defd992 externals: Disable sdl pipewire
* Fixes audio problems in certain games
2024-07-15 01:29:16 +03:00
IndecisiveTurtle 73d4aafc09 liverpool: Num submits should be atomic 2024-07-15 01:28:36 +03:00
IndecisiveTurtle dd7d232ac3 event_queues: Use std placeholders 2024-07-15 01:28:08 +03:00
psucien ed37fb32a7 review comments applied 2024-07-14 23:25:41 +02:00
raziel1000 02cba0100d Some functions called by Stardew Valley 2024-07-14 23:23:11 +03:00
georgemoralis 056dcf52ca initial ime dialog handling 2024-07-14 23:23:10 +03:00
georgemoralis b07bbecab4 replace unreachable with default return in sceKernelClockGettime 2024-07-14 23:23:10 +03:00
georgemoralis 4de9d9cf0d dataformat used by DMC4 2024-07-14 23:23:10 +03:00
raziel1000 ecad6cd1a7 - sceSaveDataDirNameSearch wip, needs testing and more work. 2024-07-14 23:23:10 +03:00
georgemoralis b4df90d8e4
Merge pull request #292 from shadps4-emu/games/00144
Missing graphics features for flOw & Flower
2024-07-14 23:07:46 +03:00
psucien 034301de88 libraries: gnmdriver: added missing ASC PM4 dump 2024-07-14 18:27:28 +02:00
psucien 746792eda0 libraries: kernel: added `sceKernelGetEventId` 2024-07-14 18:20:31 +02:00
psucien dc50cc55fb
missing line fix 2024-07-14 17:11:54 +02:00
psucien b8916787b2 renderer: debug markers for ability to match cmdlists with rdoc captures 2024-07-14 11:37:52 +02:00
psucien 8144f835a9 amdgpu: additional heuristic for CB extents detection
Found in CUSA00144
2024-07-14 10:59:22 +02:00
Live session user a1fbab5de7 Move game_data to RW directory inside user folder for linux 2024-07-13 16:44:13 -07:00
psucien f041276b04 recompiler: added support for discard on export with masked EXEC 2024-07-13 14:57:01 +02:00
Daniel R 83c8204d23
shader_recompiler/frontend: Implement opcodes (#289)
`S_ASHR_I32` and `BUFFER_LOAD_DWORD`.
2024-07-13 12:37:25 +03:00
psucien 1b94f07a6a recompiler: proper VS inputs initialization 2024-07-13 01:00:24 +02:00
Daniel R. 379e3b7607
Merge branch 'dev' of https://github.com/polybiusproxy/shadPS4 into dev 2024-07-12 11:04:23 +02:00
Daniel R. 0649234fc2
`clang-format` 2024-07-12 11:03:55 +02:00
Daniel R 547490a664
Merge branch 'shadps4-emu:main' into dev 2024-07-12 11:00:58 +02:00
Daniel R. 88426e0399
gnmdriver: Implement shader functions 2024-07-12 11:00:11 +02:00
psucien a75851f7e2 hot fix: reduce geometry staging 3Gb -> 512Mb 2024-07-11 20:29:53 +02:00
georgemoralis f3baad7fc8
Merge pull request #284 from polybiusproxy/linux-fix
Fix Linux builds
2024-07-11 16:40:21 +03:00
Daniel R. 1421f82bf5
Another ifdef (sigh) 2024-07-11 15:29:36 +02:00
Daniel R. a049bd3135
Fix Linux builds 2024-07-11 15:16:50 +02:00
georgemoralis 5f26bfc70c
Merge pull request #283 from vladmikhalin/fix-shader-attribute-components
Fixed an issue with number of components of shader attributes
2024-07-11 16:11:56 +03:00
Vladislav Mikhalin 262bf3d337 Fixed an issue with number of components of shader attributes 2024-07-11 16:10:23 +03:00
georgemoralis 6a5855b645
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 914aa10875
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 090071bf16
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
Vladislav Mikhalin 989f88837d
Filesystem errors and Base Array Layers (#280)
* Filesystem errors and Base Array Layers

* Fixed build for POSIX

* forgot 1 file
2024-07-11 14:37:21 +03:00
georgemoralis 59be090c83
Merge pull request #277 from shadps4-emu/kernel/hr_timers
HR Timers support and event queue refactoring
2024-07-11 13:31:59 +03:00
georgemoralis 63795ddb3a fixed CMakeLists 2024-07-11 13:14:42 +03:00
georgemoralis 18f922b28b changed path to boost so it doesn't conflict with previous 2024-07-11 13:14:42 +03:00
psucien ba5fb78c5a fix for large delays precision + Linux build 2024-07-11 13:14:42 +03:00
psucien d3e8e95334 boost: submodule update 2024-07-11 13:14:42 +03:00
psucien bad51953ac boost: latest updates 2024-07-11 13:14:42 +03:00
psucien 034b76eb33 boost submodule added 2024-07-11 13:14:42 +03:00
psucien d6d2ed6e33 boost submodule removed 2024-07-11 13:14:42 +03:00
psucien 0bb5240202 kernel: added HR timers and asio service thread 2024-07-11 13:14:42 +03:00
psucien 465cb0413e kernel: equeue: minor refactoring 2024-07-11 13:14:42 +03:00
georgemoralis ea7465a82d
Merge pull request #278 from Xphalnos/main
Adding Bloodborne screenshot
2024-07-11 08:07:49 +03:00
Xphalnos 999733f172 Merge branch 'main' of https://github.com/Xphalnos/shadPS4 2024-07-10 19:49:38 +02:00
Xphalnos 820498c663 Adding Bloodborne screenshot 2024-07-10 19:49:22 +02:00
Xphalnos f3e188853d Adding Bloodborne screenshot 2024-07-10 19:01:59 +02:00
georgemoralis 5a078e3902 forgot to register avplayer module 2024-07-10 19:15:58 +03:00
georgemoralis 5beb607435
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
TreezZ d156dda7b6
Update building-linux.md with thread numbers (#275)
Final-ish (?)
2024-07-10 02:24:42 +03:00
Vinicius Rangel 94d1a6b0b9
impl V_CMP_CLASS_F32 common filter masks (#276) 2024-07-10 02:24:01 +03:00
georgemoralis f420e33592
Merge pull request #269 from DanielSvoboda/fix-shortcut-name-with-unaccepted-characters
fix shortcut name with unaccepted characters
2024-07-09 10:04:47 +03:00
DanielSvoboda aef6d2e488
fix shortcut name with unaccepted characters 2024-07-09 00:55:48 -03:00
DanielSvoboda 63b0465a33
add V_MAD_U32_U24 (#262)
* V_MAD_U32_U24

* adjust V_MAD_I32_I24 for bit extraction

* optional bit extraction parameter

* Update vector_alu.cpp

* clang-format

* Update src/shader_recompiler/frontend/translate/vector_alu.cpp

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>

* Update vector_alu.cpp

* Update translate.h

---------

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2024-07-09 01:35:01 +03:00
psucien ab6a1fb5f0
Merge pull request #247 from viniciuslrangel/device-selector
Improve physical device selection in Vulkan renderer
2024-07-08 22:04:51 +02:00
TreezZ 64e283c948
Update building-linux.md with full instructions (#260)
* Update building-linux.md with full instructions

* Update documents/building-linux.md

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>

* Update documents/building-linux.md

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>

* Update building-linux.md with build-essentials

* Update building-linux.md

---------

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2024-07-08 12:25:04 +03:00
Stolas 2620919f0b
Added Legacy Min/Max ops (#266)
* Forwarding V_MAX_LEGACY_F32 to V_MAX3_F32. Fixes Translation error in Geometry Wars 3.

* Forwarded to correct op

* Implemented Legacy Max/Min using NMax/NMin

* Added extra argument to Min/Max op codes

* Removed extra translator functions, replaced with bool

* Formatting
2024-07-08 12:24:12 +03:00
georgemoralis 550e05b3ca
Merge pull request #267 from viniciuslrangel/audio-param-fix
Fix sceAudioOutOpen not handling audio param attributes
2024-07-08 08:59:12 +03:00
Vinicius Rangel 574b8a458c
Fix sceAudioOutOpen not handling audio param attributes
and returning error incorrectly when some mask is applied
2024-07-08 01:29:58 -03:00
wheremyfoodat f8c2dc0a18
Merge pull request #264 from OFFTKP/thessaloniki
Eliminate compiler warning
2024-07-07 22:21:28 +00:00
offtkp 0619af24a7 Eliminate compiler warning 2024-07-08 01:17:42 +03:00
Vinicius Rangel 6cc8381d62
Improve physical device selection in Vulkan renderer
Fix when two discrete gpu are present & memory heap size is now considered while sorting physical devices
2024-07-07 17:02:35 -03:00
TheTurtle a9f482cdfc
config: Disable splash by default 2024-07-07 22:30:52 +03:00
georgemoralis 189033ae24
Merge pull request #253 from shadps4-emu/graphics/features_and_fixes
Graphics: missing features and fixes
2024-07-07 20:42:13 +03:00
psucien 6dbb842bec renderer: a bit more formats to support 2024-07-07 14:34:36 +02:00
psucien c7af8df2ad gnmdriver: added `sceGnmFindResourcesPublic` stub 2024-07-07 13:47:01 +02:00
psucien 19c85c78cf recompiler: switch instance data to storage buffers 2024-07-07 13:08:39 +02:00
psucien bf4bf4ccb2 recompiler: fix for gather4 components return 2024-07-07 13:00:52 +02:00
TheTurtle 379ec554a8
memory: Set virtual query offset 2024-07-07 01:26:17 +03:00
georgemoralis 575acc4bd9
Merge pull request #254 from DanielSvoboda/Create-Shortcut
fix linux again
2024-07-06 22:39:31 +03:00
psucien 1d608427ed renderer: don't let unbound color attachment affect pass's rendering area 2024-07-06 20:13:12 +02:00
DanielSvoboda 971d2f02ef
fix name file shortcut linux 2024-07-06 15:10:28 -03:00
DanielSvoboda d9c1456f28
fix linux again 2024-07-06 15:00:18 -03:00
georgemoralis 3f3acc5543
Merge pull request #246 from DanielSvoboda/Create-Shortcut
Create shortcut
2024-07-06 20:03:30 +03:00
DanielSvoboda 311ddbe2f9
fiz linux 2024-07-06 13:42:53 -03:00
DanielSvoboda f8e2b6d0cd
fix linux 2024-07-06 13:40:26 -03:00
psucien cfbe8b9e6d renderer: added support for instance step rates 2024-07-06 18:03:43 +02:00
psucien 986ed0662c gnmdriver, amdgpu: added gpu idle IRQ; submission lock logic improved 2024-07-06 18:03:34 +02:00
DanielSvoboda eff8a9e514
fix linux? 2024-07-06 12:55:24 -03:00
georgemoralis bf74888be4
Merge pull request #239 from shadps4-emu/miscFixes3
Misc fixes 3
2024-07-06 11:16:53 +03:00
georgemoralis d4d7e9f5f6 removed hardware info seems make perfomance issues , will test something more lightweight 2024-07-06 10:27:57 +03:00
DanielSvoboda c3bf56f3eb
add 'Create Shortcut' option
Added 'Create Shortcut' option to gui_context_menus

Implemented functionality to create shortcuts:
convertPngToIco: Converts PNG icons to ICO format.
createShortcutWin: Creates shortcuts on Windows using COM interfaces.
createShortcutLinux: Generates .desktop files for shortcut creation on Linux.
Note: Linux functionality has not been tested.
2024-07-05 20:57:54 -03:00
Xphalnos a0aac5985e
CMakeLists.txt cleanup (#244)
* Update ci.yml

* Update CMakeLists.txt
2024-07-06 02:42:34 +03:00
TheTurtle 38080b60af
shader_recompiler: Check usage before enabling capabilities (#245)
* vk_instance: Better feature check

* shader_recompiler: Make most features optional

* vk_instance: Bump extension vector size

* resource_tracking_pass: Perform BFS for sharp tracking

* The Witness triggered this
2024-07-06 02:42:16 +03:00
DanielSvoboda 56af77f1f4
add command line arguments GUI 2024-07-05 18:20:19 -03:00
georgemoralis 4ae879875e scePthreadMutexTimedlock added 2024-07-05 15:23:35 +03:00
georgemoralis 134541bdcd submodules updates 2024-07-05 15:08:33 +03:00
georgemoralis 67af53fd58
Merge pull request #233 from shadps4-emu/miscFixes2
Misc Fixes
2024-07-05 09:36:01 +03:00
raziel1000 7ea87f69ea forgot duplicate. 2024-07-04 21:02:59 -06:00
Younes 8ce6ed4b59
Merge branch 'main' into miscFixes2 2024-07-04 20:51:04 -06:00
TheTurtle 3f123bbce2
thread_management: Fix windows build 2024-07-05 00:20:55 +03:00
DanielSvoboda 1d58a0403e
Fix ShowSplash size (#235)
* Fix ShowSplash size

* enable isShowSplash
2024-07-05 00:16:06 +03:00
psucien dd97b517f7
Recompiler: sampler patching (#236)
* recompiler: restored bfs in image instruction producers search

* recompiler: added pattern check for s# anisotropy modification

* added check if s# comes from constant load (e.g. EUD)
2024-07-05 00:15:57 +03:00
TheTurtle 6ceab6dfac
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 724869e088 fixed submodule 2024-07-04 14:31:58 +03:00
georgemoralis a91c049754 added library to print system info to be able to debug user files better 2024-07-04 14:30:34 +03:00
georgemoralis fd39c50910 improved sceAppContentAppParamGetInt 2024-07-04 13:49:11 +03:00
georgemoralis 8d17f87a08 improved file not found return in sceKernelOpen 2024-07-04 11:38:23 +03:00
raziel1000 bdcadf63d2 scePthreadSetprio, scePthreadGetprio 2024-07-04 02:22:43 -06:00
raziel1000 e22ad65e70 .... 2024-07-04 01:57:03 -06:00
raziel1000 1968b2aa81 ... 2024-07-04 01:54:50 -06:00
raziel1000 c2c55fea87 mr clang format 2024-07-04 01:53:06 -06:00
raziel1000 0ecc54032c - Several SaveData functions. Dysmantle and we are doomed should save and load now. 2024-07-04 01:51:46 -06:00
georgemoralis 3875c00281 fixed linux compile? 2024-07-04 09:38:25 +03:00
georgemoralis 0228b5861c added scePthreadGetthreadid 2024-07-03 20:05:21 +03:00
georgemoralis 608301f86c dummy sceAppContentGetAddcontInfoList and fixed structs 2024-07-03 20:04:56 +03:00
georgemoralis af3bbc33e9 increase version 2024-07-02 00:39:10 +03:00
georgemoralis 94f83ad505 Updated version to 0.1.0 - Release 2024-07-02 00:35:54 +03:00
georgemoralis dc8d3b208c
Merge pull request #230 from shadps4-emu/stabilization12
reduced logging
2024-07-01 23:53:59 +03:00
georgemoralis 33683cfdd7
Merge pull request #229 from shadps4-emu/stabilization11
video_core: Address regressions from last few PRs
2024-07-01 23:50:10 +03:00
georgemoralis afba6dbd66 clang format fix 2024-07-01 23:48:30 +03:00
georgemoralis 3b87c3c128 moved elf logging to DebugDump fuction , which can be enabled in config . This reduces main log file a lot 2024-07-01 23:07:57 +03:00
IndecisiveTurtle fe5bfa9d61 texture_cache: Always validate for now 2024-07-01 22:53:01 +03:00
IndecisiveTurtle a603bc7d88 shader_recompiler: More instructions 2024-07-01 22:42:45 +03:00
georgemoralis b2508c502b
Merge pull request #228 from Xphalnos/main
Adding keyboard mapping
2024-07-01 21:09:34 +03:00
IndecisiveTurtle 2fe897eeda host_shaders: Fix R8G8 detiler 2024-07-01 20:25:43 +03:00
Xphalnos d424c65e8d Update externals 2024-07-01 18:39:12 +02:00
Xphalnos 937bfc8018
Adding keyboard mapping 2024-07-01 18:27:22 +02:00
IndecisiveTurtle 7d4f0da40e video_core: Fix some regressions 2024-07-01 18:26:22 +03:00
IndecisiveTurtle 20e83b4d53 clang format 2024-07-01 13:56:14 +03:00
IndecisiveTurtle 410ba37ec2 code: Add additional logging during init 2024-07-01 13:56:14 +03:00
IndecisiveTurtle 7c7e9427ba tls: Switch to trace logs 2024-07-01 13:56:14 +03:00
IndecisiveTurtle 6774216038 shader_recompiler: Apply buffer swizzle on vertex attribs 2024-07-01 13:56:14 +03:00
IndecisiveTurtle b4d24d8737 renderer_vulkan: Prefer depth stencil read-only layout when possible
* Persona reads a depth attachment while it is being attached with writes disabled. Now this works without spamming vk validation errors
2024-07-01 13:56:14 +03:00
IndecisiveTurtle 22b930ba5e video_core: Track renderpass scopes properly 2024-07-01 13:56:14 +03:00
IndecisiveTurtle ad10020836 video_core: Fix a few problems 2024-07-01 13:56:14 +03:00
IndecisiveTurtle 114f06d3f2 tls: Fix linux crash 2024-07-01 13:56:14 +03:00
IndecisiveTurtle 10ef357f1f image: Fix image type of 1D Array 2024-07-01 13:56:14 +03:00
IndecisiveTurtle 5da79d4798 spirv: Add fragdepth and implement image query 2024-07-01 13:56:14 +03:00
georgemoralis 1f83824a8a
Merge pull request #225 from shadps4-emu/stabilization/10
Various fixes and improvements
2024-07-01 13:09:11 +03:00
psucien f03262421e texture_cache: force storage usage bit to all images 2024-07-01 09:58:52 +02:00
georgemoralis d2c1e58313
Merge pull request #220 from shadps4-emu/stabilization9
HLE stuff
2024-07-01 01:18:41 +03:00
georgemoralis 90b27352f8 eventflag : changed an assert to log as error 2024-07-01 00:51:38 +03:00
georgemoralis 24f78fac20 fixed name style 2024-07-01 00:50:07 +03:00
psucien 1f55eff9d8 libraries: gnmdriver: added initialization preamble to every first submit in a frame 2024-06-30 18:22:39 +02:00
psucien 14377b39b5 texture_cache: detiler: added missing micro8x2 2024-06-30 15:54:59 +02:00
georgemoralis 1413a70a92 added posix error write to errno 2024-06-30 10:40:06 +03:00
georgemoralis 8e01a1b6d8 libSceJpegEnc,libSceJson2 can be loaded LLE 2024-06-30 10:12:36 +03:00
georgemoralis d0278715cb added case for savedata (needed by flow) 2024-06-30 10:12:07 +03:00
georgemoralis 084b2ab6d5 added sceKernelDeleteEventFlag 2024-06-30 10:11:44 +03:00
psucien 2386b46726 libraries: gnmdriver: `sceGnmDrawInitToDefaultContextState` and `sceGnmDrawInitToDefaultContextState400` implementation 2024-06-30 01:21:39 +03:00
psucien 9121ecf123 renderer_vulkan: more formats conversion 2024-06-30 01:21:39 +03:00
psucien 3663c60f3d libraries: gnmdriver: fix for incorrect offset in `sceGnmDrawInitDefaultHardwareState175` 2024-06-30 01:21:39 +03:00
psucien cc945fb92e shader_recompiler: a simple bfs in image arg producer search 2024-06-30 01:21:39 +03:00
psucien c4061c3b95 amdgpu: fix for wrong constant ram offset in `WriteConstRam` decoding 2024-06-30 01:21:39 +03:00
georgemoralis 0a33f8f799 updated sdl to fix keyboard issue 2024-06-30 00:32:42 +03:00
psucien 2cbbcbd371
Metadata support (#223)
* texture_cache: more image usage flags

* texture_cache: metadata registration

* renderer_vulkan: initial CMask support

* renderer_vulkan: skip redundant FCE and FMask decompression passes

* renderer_vulkan: redundant VO surface registration removed

* renderer_vulkan: initial HTile support

* renderer_vulkan: added support for MSAA attachments

* renderer_vulkan: skip unnecessary metadata updates
2024-06-29 16:49:59 +03:00
georgemoralis b3f15dfe2e fixed posix_open return code 2024-06-28 23:19:33 +03:00
georgemoralis 1e717ab046 sceKernelOpen handle directory doesn't exist case 2024-06-28 23:06:15 +03:00
georgemoralis a810e47876 few more sceNet work 2024-06-28 23:00:01 +03:00
georgemoralis e54d574241 implemented a part of sceNet calls 2024-06-27 18:42:36 +03:00
georgemoralis 059f54838a
Merge pull request #219 from shadps4-emu/gnmdriver/hw_init
Complete HW state init functions
2024-06-27 17:33:58 +03:00
psucien 7fd832b68c things prettified 2024-06-27 15:47:18 +02:00
georgemoralis 0ada442cbc
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
psucien 91940781b8 libraries: gnmdriver: complete HW stat init functions 2024-06-27 13:36:55 +02:00
Alexandre Bouvier f5541e3c3d
cmake: prefer system libraries (#216) 2024-06-27 13:46:55 +03:00
georgemoralis f522948df8
Merge pull request #217 from shadps4-emu/stabilization7
kernel/shader_recompiler: Fixes and cleanups to improve stability
2024-06-26 20:39:05 +03:00
georgemoralis 521ff4d14b clang format fixes 2024-06-26 20:32:08 +03:00
IndecisiveTurtle 550bfa1c88 liverpool: Fix assert for compute queues 2024-06-26 20:00:09 +03:00
IndecisiveTurtle c8ed338d5a kernel: Const correctness 2024-06-26 18:24:06 +03:00
IndecisiveTurtle c081663aac translator: Merge ANDN2 with AND and impl ORN2 2024-06-26 18:16:01 +03:00
IndecisiveTurtle e94149340e kernel: Fix pread and pwrite 2024-06-26 18:09:58 +03:00
IndecisiveTurtle 3a80df007e linker: More null check 2024-06-26 18:05:31 +03:00
IndecisiveTurtle 4846704832 shader_recompiler: More instructions and fix for swords of ditto 2024-06-26 18:03:09 +03:00
IndecisiveTurtle 9bd3898829 kernel: Rework semaphore implementation 2024-06-26 17:57:18 +03:00
IndecisiveTurtle a2394109ee kernel: Cleanup filesystem code 2024-06-26 17:54:36 +03:00
psucien 3532fd1c9c
Merge pull request #215 from shadps4-emu/miscFixAgain
Misc fixes (mostly LLE)
2024-06-26 14:15:07 +02:00
psucien 5ed0794c20
Merge pull request #211 from abouvier/fix-include
fix system include paths
2024-06-26 14:02:50 +02:00
georgemoralis 8a617be3b7 missed from previous commit 2024-06-26 14:57:18 +03:00
georgemoralis 7ef11a7bd8 added sceKernelGetFsSandboxRandomWord and dummy posix_connect 2024-06-26 14:56:41 +03:00
georgemoralis c511b1b0cf sceAudioOutGetPortState added 2024-06-26 14:48:32 +03:00
georgemoralis 84a39e2fb0 load existing lle modules from sys_module folder 2024-06-26 14:43:01 +03:00
Alexandre Bouvier a2224a9b6b fix system include paths 2024-06-25 18:17:16 +02:00
georgemoralis 8f45be7d44
Merge pull request #213 from shadps4-emu/hle/trophies
A better stub for trophies
2024-06-25 18:38:35 +03:00
psucien 9b3a89467e fix for Linux build 2024-06-25 17:14:12 +02:00
georgemoralis c8a149c983
Merge pull request #214 from shadps4-emu/miscFixes
Misc fixes
2024-06-25 17:55:57 +03:00
psucien 3b2a312f15 kernel: thread_management: silence compilation warning 2024-06-25 09:56:19 +02:00
psucien ff64dd74f6 libraries: trophy: a better stubs implementation 2024-06-25 09:43:26 +02:00
psucien acc4ef7b4c common: slot_vector: added `is_allocated` to check if the slot already exists 2024-06-25 09:43:25 +02:00
psucien 8475a62a46 common: `Common` namespace for the slot vector container 2024-06-25 09:31:32 +02:00
georgemoralis cee55355bf
Merge pull request #208 from Xphalnos/main
Adding Quickstart
2024-06-25 09:42:14 +03:00
georgemoralis 52ff825171
Merge pull request #212 from shadps4-emu/missing_gnm
More GnmDriver functions implementation
2024-06-25 08:36:11 +03:00
psucien c04fbb75d8 libraries: gnm_driver: added `sceGnmDrawIndexIndirect` and `sceGnmDrawIndirect` 2024-06-24 22:53:59 +02:00
Xphalnos 444e4d5336 Quickstart 2024-06-24 20:40:24 +02:00
Xphalnos 3f657b5f36 Quickstart 2024-06-24 20:34:06 +02:00
psucien 508d034263 libraries: gnm_driver: added `sceGnmSetEmbeddedPsShader` 2024-06-24 14:51:17 +02:00
georgemoralis 1b6cb32b34 re-fix 2024-06-24 13:46:45 +03:00
georgemoralis 640354667e insure we reset padData 2024-06-24 13:41:18 +03:00
georgemoralis ad4db71e00 missing touchpad reset in scePadReadState 2024-06-24 13:26:18 +03:00
georgemoralis 6d2b2779ea added sceKernelPwrite 2024-06-24 13:25:50 +03:00
Xphalnos c845b12990 Merge branch 'main' of https://github.com/Xphalnos/shadPS4 2024-06-23 09:04:30 +02:00
Xphalnos 7fe5f12f29 Screenshots fix 2024-06-23 09:04:16 +02:00
Xphalnos acd9b57c88 Corrections de captures d'écran 2024-06-23 08:57:32 +02:00
psucien cb6b21de1f
Initial instancing and asynchronous compute queues (#207)
* gnm_driver: added `sceGnmRegisterOwner` and `sceGnmRegisterResource`

* video_out: `sceVideoOutGetDeviceCapabilityInfo` for sdk runtime

* gnm_driver: correct vqid index range

* amdgpu: indirect buffer, release mem and some additional irq modes

* amdgpu: added ASC commands processor

* shader_recompiler: added support for fetch instance id

* amdgpu: classic bitfields for T# representation (debugging experience)

* renderer_vulkan: skip zero sized VBs from binding

* texture_cache: image upload logic moved into `Image` object

* gnm_driver: `sceGnmDingDong` implementation

* texture_cache: `Image` usage flags moved; correct VO buffer pitch
2024-06-22 19:50:20 +03:00
georgemoralis a9cbd8287c
Merge pull request #206 from shadps4-emu/shader-again
Add more shader instructions and some memory functions
2024-06-22 18:19:08 +03:00
georgemoralis 94b9992d99 more clang format fix (final) 2024-06-22 18:17:40 +03:00
georgemoralis 32225f4a8b more clang fix 2024-06-22 18:15:42 +03:00
georgemoralis 11a3906243 clang fix 2024-06-22 18:12:04 +03:00
IndecisiveTurtle 73d60b7e8d linker: Set rela bits for all symbol types 2024-06-22 18:09:04 +03:00
IndecisiveTurtle 11bfdf2348 kernel: Add noreturn 2024-06-22 18:09:04 +03:00
IndecisiveTurtle 741427040f shader_recompiler: Even more instructions 2024-06-22 18:09:04 +03:00
IndecisiveTurtle 30199fe701 kernel: Add scePthreadExit 2024-06-22 18:09:04 +03:00
IndecisiveTurtle 30351ad112 linker: Fix TLS for dynamic modules
* Technically not fully accurate but it works. TlsGetAddr should handle dynamic allocation of TLS blocks
2024-06-22 18:09:04 +03:00
IndecisiveTurtle 2506a285f4 kernel: Implement some functions 2024-06-22 18:09:03 +03:00
IndecisiveTurtle 7bdaeafdfd kernel: Make sceKernelUsleep interruptible 2024-06-22 18:09:03 +03:00
IndecisiveTurtle 8850c2f4be shader_recompiler: Add more instructions 2024-06-22 18:09:03 +03:00
georgemoralis ce31fad222
Merge pull request #200 from shadps4-emu/padrewrite
scePad library rewrite
2024-06-22 18:04:15 +03:00
georgemoralis 7519d4610c added missing buttons and analog buttons to keyboard 2024-06-21 14:37:49 +03:00
georgemoralis 19edb8155f fixed stupid directory iterator issue 2024-06-20 22:29:08 +03:00
georgemoralis 1b2c3ccc42 better dirents 2024-06-20 21:13:17 +03:00
georgemoralis 49601f58ed initial dents support 2024-06-20 18:09:40 +03:00
georgemoralis 0325e4795a posix_pthread_yield , scePadGetHandle 2024-06-20 17:10:14 +03:00
georgemoralis b17a57cb3d analog sticks works better now 2024-06-17 14:33:03 +03:00
georgemoralis 91e6d35e89 analog support via keyboard 2024-06-17 13:42:39 +03:00
georgemoralis 48d6ccd9bb partially added analog controls 2024-06-17 12:52:25 +03:00
georgemoralis 57c65cadb8 fixes to the old pad code 2024-06-17 09:02:06 +03:00
georgemoralis 9501bd77d4 clang fix 2024-06-17 09:02:06 +03:00
georgemoralis 0aa29428e1 new pad module structured using modulegenerator , added common pad structures and function signatures 2024-06-17 09:02:06 +03:00
georgemoralis d9f2758850
Merge pull request #203 from shadps4-emu/video_core/more_functionality
More instructions support and trivial additions
2024-06-17 08:59:36 +03:00
psucien 5595da0a24 final touch: assert instead of log crit to crash earlier 2024-06-17 00:42:26 +02:00
psucien abe2771c73 switch to the org's sirit submodule 2024-06-17 00:33:12 +02:00
psucien 0c32ea242b shader_recompiler: list all missing instructions during translation pass 2024-06-16 23:45:39 +02:00
psucien 396812bab6 shader_recompiler: added V_TRUNC VOP1/3 (496) 2024-06-16 23:39:45 +02:00
psucien d3ab612bdc shader_recompiler: pretty print for missing shader instructions 2024-06-16 23:11:36 +02:00
psucien ab4cc8b218 texture_cache: return back image view usage override 2024-06-16 22:30:18 +02:00
psucien 6e7fd21338 renderer_vulkan: simplified sRGB hack 2024-06-16 22:29:23 +02:00
psucien 3f92a68129 renderer_vulkan: BC3 formats conversion 2024-06-16 22:29:04 +02:00
psucien d054c3e0ad shader_recompiler: added V_MAX VOP2 (431, 433) 2024-06-16 21:34:23 +02:00
psucien be67fdc9c9 shader_recompiler: correct format for SSBO store op 2024-06-16 21:21:19 +02:00
psucien 37ceea2314 renderer_vulkan: added log entry for CS compiling 2024-06-16 20:51:35 +02:00
psucien 54f8616d6a shader_recompiler: added MUL_HI VOP2 (896) 2024-06-16 20:39:53 +02:00
psucien 1fc86a6c9d shader_recompiler: added SOPK MOVK (45) 2024-06-16 20:26:24 +02:00
raziel1000 52f3b74fdd Missing sceKernelUuidCreate nid 2024-06-15 17:01:20 -06:00
TheTurtle ca25333a1e
core: Address a few more regressions (#202)
* tls: Actaully fix TLS on linux

* emulator: Remove nptoolkit

* Not quite supported yet, makes games misbehave

* kernel: Back to SCHED_OTHER

* kernel: Remove unused signal function

* address_space: Fix Unmap call on linux

* clang format
2024-06-16 01:50:07 +03:00
georgemoralis 3552484b33
Merge pull request #201 from shadps4-emu/stabilization_4
Proper color buffers color handling and various fixes
2024-06-16 01:18:43 +03:00
psucien b02ec385b2 video_out: proper sRGB output workflow 2024-06-15 23:24:34 +02:00
psucien b2b45bf480 video_core: added support for alternate CB channels order 2024-06-15 23:24:33 +02:00
psucien b9602afc82 renderer_vulkan: sRGB swapchain 2024-06-15 23:24:33 +02:00
psucien e6f773f950 videoout: register buffers in texture cache at VO creation time 2024-06-15 23:24:33 +02:00
psucien bdb235716a texture_cache: don't set color attachment usage flag for packed images 2024-06-15 23:24:33 +02:00
psucien fd8ceacef7 video_core: shaders hash switched to one from binary header 2024-06-15 23:24:32 +02:00
psucien 37cbdad57b renderer_vulkan: static vector for vertex buffers ranges 2024-06-15 23:20:14 +02:00
psucien a0fe34b01f tracy: added PthreadMutex markup 2024-06-15 23:20:14 +02:00
psucien 142ad54876 gnmdriver: fix for pm4 dump name in some erroneous cases 2024-06-15 23:20:14 +02:00
psucien be6f523b6e renderer_vulkan: fixed buffers alignments 2024-06-15 23:20:13 +02:00
psucien 1e69f83d9e libraries: fix for Windows crash during LLE libc initialization 2024-06-15 20:04:36 +02:00
Younes 0fa7d5d02c
- 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 c5d1d579b1
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
georgemoralis 6a47f8ae50
Merge pull request #197 from Xphalnos/main
More screenshots for README
2024-06-14 17:28:56 +03:00
Xphalnos d1f409f373 Screenshots 2024-06-14 14:59:22 +02:00
Xphalnos edf6724e74 Merge branch 'main' of https://github.com/Xphalnos/shadPS4 2024-06-14 14:33:08 +02:00
Xphalnos eb22704771 More screenshots for README 2024-06-14 14:32:41 +02:00
georgemoralis 1a26983181
Merge pull request #196 from shadps4-emu/LibPngDec
Added LibPngDec
2024-06-14 11:02:19 +03:00
raziel1000 080ec3e23e Added LibPngDec
(tested with Metal Slug 3, Risk of Rain, Deadbolt and Nidhogg)
2024-06-14 01:37:26 -06:00
TheTurtle 31bd502764
core: Fixup linux support (#195)
* tls: Implement for linux

* core: Implement memory manager for linux
2024-06-14 00:58:57 +03:00
Xphalnos e62690759d
Fix missing SDL3.dll error message for Windows-Qt (#193) 2024-06-12 19:09:54 +03:00
georgemoralis 400d910743
Merge pull request #184 from shadps4-emu/externals/tracy
Tracy profiler
2024-06-12 17:19:44 +03:00
georgemoralis dfe2c345dc
Merge pull request #192 from Xphalnos/main
Minor fixes
2024-06-12 17:19:25 +03:00
psucien 64569ff737 tracy: guards for missing vk profiler context 2024-06-11 22:57:37 +02:00
georgemoralis 8362e2c497 fixed windows qt build 2024-06-11 23:26:13 +03:00
Xphalnos 7599ba1761
Merge branch 'shadps4-emu:main' into main 2024-06-11 22:10:04 +02:00
psucien 955752a24b tracy: submodule update 2024-06-11 21:58:35 +02:00
psucien d7565dec57 tracy: added Vulkan GPU profiling 2024-06-11 21:52:48 +02:00
georgemoralis 8612907831 really fixed typo 2024-06-11 22:41:35 +03:00
Xphalnos ac0d073050 Improve Building and Readme 2024-06-11 21:29:29 +02:00
georgemoralis 991d44bde6 fix typo 2024-06-11 19:36:17 +03:00
Xphalnos 7c7b617852 Minor fixes 2024-06-11 18:15:36 +02:00
georgemoralis e8fa9e0e89 added libScePosix nanosleep 2024-06-11 16:42:15 +03:00
psucien 04b1226e9c tracy: basic markup and project palette 2024-06-11 12:14:33 +02:00
psucien e89b2d1cdd Added Tracy profiler 2024-06-11 11:17:46 +02:00
georgemoralis bff2f006fb
Merge pull request #190 from shadps4-emu/stabilization_three
Stabilization three
2024-06-11 07:25:55 +03:00
georgemoralis e3fd089881
Merge pull request #189 from shadps4-emu/qt-again
Qt fixes and improvemments, trophy decryption/viewer.
2024-06-11 07:04:31 +03:00
raziel1000 1abccb29f9 clang format 2024-06-10 20:44:16 -06:00
raziel1000 0f27e0edf2 - 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
psucien cb2cf7d93c recompiler: trivial missing ops (VALU OR and SALU LE, GE) added 2024-06-10 23:49:23 +02:00
psucien 7fcb758da2 timer_management: `sceKernelUsleep` on <1ms delays 2024-06-10 23:48:06 +02:00
psucien c2dc7c3fd4 renderer_vulkan: another fix for vertex buffer offsets 2024-06-10 23:20:32 +02:00
Xphalnos 71dda8c776
Separation between release mode and RelWithDebInfo (#186) 2024-06-10 22:59:28 +03:00
TheTurtle 8ce58389ad
kernel: Implement gettimeofday + other misc fixes (#187)
* kernel: Add gettimeofday

* kernel: Move sceKernelReleaseDirectMemory where it belongs

* savedata: Stub sceSaveDataDialogUpdateStatus to return finished

* memory: Add lock to VirtualQuery and remove debug print

* clang format

* fixed linux build?

* special case for sceKernelWrite (stdin,stdout,stderr)

* special case for case savedata mount

* reduced mutex spamming

* added missing default rwlock attributes init

* kernel: Add more sleep functions

* file_system: Add some functions

* memory: Missed adding some functions

* kernel: Moved some functions to time

* kernel: Fix build error

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2024-06-10 22:59:12 +03:00
TheTurtle 7b1a317b09
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 23f11a3fda
Merge pull request #182 from shadps4-emu/miscfixes
Miscfixes
2024-06-10 18:42:49 +03:00
georgemoralis e84d2cf9cf wrong spdx 2024-06-10 18:36:18 +03:00
georgemoralis beb631607a review fixes 2024-06-10 18:26:37 +03:00
georgemoralis 6f8d99fbf2 fixed posix_stat error return 2024-06-10 18:09:22 +03:00
georgemoralis 3318f12639 fixed possible nullptr crash on rwlock create 2024-06-10 18:01:50 +03:00
georgemoralis 0c1ede1060
Merge pull request #183 from shadps4-emu/bc_detiler
Micro detiler for 2D BC textures
2024-06-10 15:33:55 +03:00
georgemoralis 81a1cbf6b1 more clang fix 2024-06-10 15:24:34 +03:00
georgemoralis deda3026d8 clang fix 2024-06-10 15:21:50 +03:00
georgemoralis d89e4463e7 moved main code , to emulator,cpp , emulator.h class 2024-06-10 15:18:42 +03:00
georgemoralis dfc4f1c35b don't make fullscreen default 2024-06-10 14:04:59 +03:00
georgemoralis 13cd22aea6 depedencies updates and fixes 2024-06-10 14:04:32 +03:00
georgemoralis 4287bfcb91
Merge pull request #181 from shadps4-emu/new_memory
core: Rework memory manager
2024-06-10 12:33:57 +03:00
raphaelthegreat 1092b1bcff Fix linux build 2024-06-10 12:13:24 +03:00
raphaelthegreat fc887bf3f5 core: Rework memory manager 2024-06-10 02:13:44 +03:00
psucien 01f09cfa63 texture_cache: detiler: added support for block coded 64bit images 2024-06-09 18:18:49 +02:00
Xphalnos 623b1d6837
Synchronization between Qt build title and version.h (#178) 2024-06-09 18:45:25 +03:00
psucien fa73812f32 texture_cache: detiler: added support for block coded 128bit images 2024-06-09 12:54:19 +02:00
Xphalnos 1563dffd46
Added Fullscreen mode (#173)
* Added Fullscreen mode

* fix for config.toml

* fix for config.toml

* Apply review comment
2024-06-09 13:25:00 +03:00
georgemoralis 1a66fa098f
Merge pull request #174 from shadps4-emu/kernel_stuff
- sceKernelOpen: added rdwr and append modes
2024-06-09 08:26:03 +03:00
raziel1000 a790c30c28 added sceKernelSleep and small fix on usleep 2024-06-08 18:43:08 -06:00
georgemoralis ac192134e8
Merge pull request #175 from shadps4-emu/missing_gnm_calls
Additional GnmDriver functions
2024-06-09 00:58:45 +03:00
psucien eef05cf1f8
Merge pull request #176 from shadps4-emu/bunnies
Bunny must die
2024-06-08 23:46:43 +02:00
psucien d902339867 gnmdriver: `sceGnmDrawInitDefaultHardwareState175` added 2024-06-08 23:42:09 +02:00
georgemoralis 908eaa102d clang format fix 2024-06-09 00:26:12 +03:00
georgemoralis 84dca0a5dd added sceKernelTriggerUserEvent,sceKernelDeleteUserEvent 2024-06-09 00:23:58 +03:00
georgemoralis 2e6c28c34c partial sceKernelFStat 2024-06-08 23:53:38 +03:00
georgemoralis 5be6777220 added sceKernelPread 2024-06-08 23:25:20 +03:00
georgemoralis a1efcd9832 added rtc and disc_map modules 2024-06-08 22:41:25 +03:00
raziel1000 d3adcf2e6c posix_pthread_mutex_trylock
posix_pthread_attr_setdetachstate
posix_pthread_attr_destroy
posix_pthread_create_name_np
posix_pthread_join
2024-06-08 11:13:02 -06:00
georgemoralis c16275fe16 posix_usleep,posix_pthread_equal 2024-06-08 20:01:28 +03:00
raphaelthegreat e9679f8309 address_space: Don't reserve space again 2024-06-08 19:10:32 +03:00
georgemoralis 05e4a4b4e1 hackish random/urandom support 2024-06-08 10:22:28 +03:00
georgemoralis 8115665a90 fixed sceKernelClose when decriptor is negative value 2024-06-08 09:56:57 +03:00
raziel1000 3b34aebe06 - sceKernelOpen: added rdwr and append modes
- saveDataMount: added mount mode 9, 28 and 34
- pthread: added a bunch of needed functions
- mem: added sceKernelMapNamedDirectMemory
2024-06-08 00:23:55 -06:00
psucien edaeee194d libs: gnmdriver: get tessellation ring factor address 2024-06-08 01:19:52 +02:00
psucien 9ca083ee06 libs: gnmdriver: map compute queue 2024-06-08 01:19:52 +02:00
psucien 9230d04a0a common: slot_vector moved into common 2024-06-08 01:19:51 +02:00
georgemoralis 5d24a961cb
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 998d046210
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
georgemoralis e5621759a2
Merge pull request #169 from shadps4-emu/stabilization_two
Stabilization & bugfixes
2024-06-07 12:53:16 +03:00
psucien fe3b546d93 renderer_vulkan, config: option to toggle VK validation layer 2024-06-07 11:21:02 +02:00
psucien dd5a25fda2 review iteration 2024-06-07 08:39:03 +02:00
psucien e790ec775f texture_cache: detiler: more verbosity in print 2024-06-07 00:12:16 +02:00
psucien cfc297622f texture_cache: fix for forgotten cb tiling info update 2024-06-07 00:12:16 +02:00
psucien b17b4ab787 texture_cache: detiler: redundant flag removed 2024-06-07 00:12:15 +02:00
psucien cb07778008 renderer_vulkan: proper barriers 2024-06-06 23:40:31 +02:00
psucien 729d02d699 renderer_vulkan: proper min uniform alignment 2024-06-06 22:24:20 +02:00
psucien 6814d5f108 renderer_vulkan: fix for vertex buffer mapping offset 2024-06-06 21:41:59 +02:00
georgemoralis 3faeba8f0c
Merge pull request #165 from shadps4-emu/bad-phi
shader_recompiler: Address some minor issues
2024-06-06 03:09:05 +03:00
raphaelthegreat 5aa3a4d4a0 shader: Fix block processing order in dead code elimination pass 2024-06-06 02:46:36 +03:00
raphaelthegreat 705d326a6d kernel: Fix stack corruption from OrbisTimesec 2024-06-05 22:27:28 +03:00
raphaelthegreat ae7e6dafd5 shader_recompiler: Add more instructions and fix a few thinhs 2024-06-05 22:22:34 +03:00
TheTurtle 728249f58d
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
georgemoralis 7d61b7ab9b
Merge pull request #163 from shadps4-emu/video_core/surface_works
Basic detiling
2024-06-05 20:13:31 +03:00
psucien f9e5c70414 texture_cache: detiler image view moved into image class 2024-06-05 18:37:06 +02:00
psucien b59e525408 texture_cache: detiler: change staging to faster stream buffer 2024-06-05 18:16:31 +02:00
psucien bee444b6da fix for re-use 2024-06-05 17:57:05 +02:00
psucien 3a5ba82eae final touch 2024-06-05 16:34:17 +02:00
psucien 0b63a76b51 amdgpu: render target size hint for old runtime 2024-06-05 16:34:04 +02:00
psucien 19994424c5 texture_cache: detiler: shader module release and debug name 2024-06-05 16:33:26 +02:00
psucien 440a60a43b texture_cache: detiler: m8x1 and m8x4 shaders 2024-06-05 16:14:22 +02:00
psucien 184b7b7fc2 video_core: added shader header files generator from Citra 2024-06-05 14:31:50 +02:00
psucien 2c87171b95 texture_cache: a support for m8x1 and m8x4 layouts added to the detiler 2024-06-05 13:10:48 +02:00
georgemoralis c936f8e2b9
Merge pull request #161 from Xphalnos/main
Creating a better Readme
2024-06-05 13:44:22 +03:00
Xphalnos 47323fa76d screenshot under logo 2024-06-05 07:25:07 +02:00
Xphalnos d52f8dbcad Adding screenshot 2024-06-04 23:05:03 +02:00
Xphalnos a48333bfac Small update of the readme (again) 2024-06-04 21:38:21 +02:00
psucien cd87005ded renderer_vulkan: unused extension removed 2024-06-04 12:43:23 +02:00
psucien d491bbf366 amdgpu: tiling mode introduced 2024-06-04 12:40:08 +02:00
psucien d7d324ac76 amdgpu: surface bits per element LUT 2024-06-02 22:46:40 +02:00
psucien 23cc60bf06 video_core: amdgpu: simply crash if an exception occured in coro 2024-06-02 19:16:05 +02:00
psucien 863d80c16c fix for name of the first dumped cmdb 2024-06-02 18:59:41 +02:00
georgemoralis 4087a73145
Merge pull request #160 from shadps4-emu/shader
shader_recompiler: Better branch detection + more opcodes
2024-06-02 09:00:28 +03:00
raphaelthegreat 02a50265f8 shader_recompiler: Better branch detection + more opcodes 2024-06-02 03:05:40 +03:00
psucien f624f7749c
Fixes and QoL (#159)
* to ensure that we're not unlocking submits too early

* a final touch

* video_core: texture_cache: fix for page table corruption

* core: linker: a name for the game main thread

* libraries: gnmdriver: an option to dump application command lists

* libraries: kernel: named guest threads

* video_core: added a heuristic for determination of CB/DB surface extents

* fix for rebase leftover
2024-06-01 23:50:03 +03:00
georgemoralis 8f9436080e
Merge pull request #157 from Xphalnos/main
Various changes
2024-06-01 09:22:28 +03:00
Xphalnos 309e90783e Various changes 2024-06-01 08:18:33 +02:00
georgemoralis 323e66f765 added app_content module 2024-05-31 15:03:05 +03:00
georgemoralis f292f551ae
Merge pull request #152 from shadps4-emu/gamefixes
Games fixes
2024-05-30 22:03:38 +03:00
georgemoralis 3320156a27 fixed a case in sceKernelCreateEventFlag (found in Super Meat boy) 2024-05-30 20:16:16 +03:00
georgemoralis e7e86c74ad
Merge pull request #154 from shadps4-emu/rand
video_core: Moar shader instruction
2024-05-30 19:16:13 +03:00
georgemoralis 3d749bc904 added sceSaveDataMount needed for Cursed Castilla 2024-05-30 19:14:06 +03:00
georgemoralis 4749782a68 scePthreadCondTimedwait needed for Hyper Light Drifter 2024-05-30 19:14:06 +03:00
georgemoralis dc3ab91a76 fixed sonic mania savedata 2024-05-30 19:14:06 +03:00
raphaelthegreat dd91456b48 video_core: Moar shader instruction 2024-05-30 18:17:54 +03:00
georgemoralis ff21750815
Merge pull request #153 from shadps4-emu/small_additions
video_core: multiple render targets binding
2024-05-30 18:06:40 +03:00
psucien 365df2a3ac video_core: renderer_vulkan: write mask fallback 2024-05-30 16:27:39 +02:00
psucien 8e6d492524 video_core: renderer_vulkan: added color mask support 2024-05-30 12:55:37 +02:00
psucien 767e13cccb Linux build fix 2024-05-30 12:09:33 +02:00
psucien 0212e68752 shader_recompiler: redundant IR opcode removed 2024-05-30 11:50:42 +02:00
psucien 9227a2b868 video_core: multiple color attachments support 2024-05-30 11:21:26 +02:00
psucien 3741f013a3 shader_recompiler: added `NOP` and `RSQ` instructions 2024-05-30 09:43:49 +02:00
psucien d05cbd88bb video_core: renderer_vulkan: support for passes w\o a fs 2024-05-30 09:42:44 +02:00
georgemoralis 674bd4a2ed
Merge pull request #151 from shadps4-emu/sonic
video_core: Implement basic compute shaders and more instructions
2024-05-30 06:31:26 +03:00
raphaelthegreat 58de7ff55a video_core: Implement basic compute shaders and more instructions 2024-05-30 01:39:24 +03:00
georgemoralis 10bceb1643
Merge pull request #150 from shadps4-emu/stabilization_one
video_core: various fixes
2024-05-29 23:58:52 +03:00
psucien 7fc273c6bc clang fmt 2024-05-29 20:31:34 +02:00
psucien 055dec1149 video_core: texture_cache: proper `UniqueImage` class movers 2024-05-29 17:17:24 +02:00
psucien a67b8f7a0b video_core: renderer_vulkan: proper inclusion of maintenance4 2024-05-29 17:06:46 +02:00
psucien 5f37a6be83 video_core: amdgpu: fix for a deadlock in wait on idle 2024-05-29 16:03:37 +02:00
psucien db113bbc7b videoout, platform: fix for ooo irqs 2024-05-29 16:02:51 +02:00
psucien e5486cc57f video_core: amdgpu: proper destruction of processing thread 2024-05-29 16:02:51 +02:00
psucien fb237bddad libraries: libc: fix for `FSin` implementation 2024-05-29 16:02:49 +02:00
georgemoralis efeb78f59c
Merge pull request #149 from shadps4-emu/event_flag
Event Flags
2024-05-28 18:44:13 +03:00
georgemoralis d30703b4eb improvements in definations 2024-05-28 18:24:42 +03:00
georgemoralis 4d5e9d1da4 set,poll event flag 2024-05-28 15:13:56 +03:00
georgemoralis 1dfa91b638 event flag implementation from previous pr 2024-05-28 14:29:53 +03:00
psucien 5f67b59180
Merge pull request #148 from shadps4-emu/images
video_core: Add linear image support
2024-05-27 21:40:00 +02:00
raphaelthegreat 4d728e943d video_core: Address some feedback 2024-05-27 22:13:55 +03:00
raphaelthegreat d59b102b6f video_core: Add image support 2024-05-27 18:25:45 +03:00
georgemoralis 729e166cd3
Merge pull request #146 from shadps4-emu/video_out/new_gpu_frontend
video_core: initial support for CE and ASC queues
2024-05-27 13:50:25 +03:00
psucien 09c7379fe0 fix for leaks of coroutine handle 2024-05-27 13:48:35 +03:00
TheTurtle 8dfa5782b2
video_core: Add constant buffer support (#147) 2024-05-26 15:51:35 +03:00
psucien 2963790e0d video_core: initial support for CE and ASC queues 2024-05-26 12:39:30 +02:00
TheTurtle 3c90b8ac00
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
georgemoralis e9f64bb76c
Merge pull request #143 from shadps4-emu/video_core/null_gpu
video core: null GPU
2024-05-23 07:52:27 +03:00
psucien 62fd72009b video_core: a fix for multi submits processing (temporary code) 2024-05-22 22:20:33 +02:00
psucien 66b695f5c7 platform: restored use of magic_enum 2024-05-22 20:20:13 +02:00
psucien d752aa5357 config, video_core: null gpu configuration added 2024-05-22 20:19:42 +02:00
georgemoralis b0243dd3e5 fixed a few compiler issues 2024-05-22 14:18:05 +03:00
TheTurtle 8730968385
video: Import new shader recompiler + display a triangle (#142) 2024-05-22 01:35:12 +03:00
Xphalnos 8cf64a33b2
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 b0978f4168
Merge pull request #136 from shadps4-emu/more_kernel_stuff_and_others
More kernel stuff and others
2024-05-18 10:04:46 +03:00
georgemoralis 0b8baedab7 improved sceKernelWaitEqueue 2024-05-18 10:02:40 +03:00
georgemoralis 67c1772771 added _read in libkernel 2024-05-18 09:51:47 +03:00
georgemoralis 42fb9f6473 fixed sceKernelGetCompiledSdkVersion thanks raziel1000 2024-05-18 09:51:47 +03:00
georgemoralis 4b5e2e80fc added sceKernelGetCompiledSdkVersion (which return games system version ) 2024-05-18 09:51:46 +03:00
georgemoralis cc98b11860 clang format 2024-05-18 09:51:46 +03:00
georgemoralis 43773d12d9 added scePthreadEqual 2024-05-18 09:51:46 +03:00
georgemoralis bb89b1c95a
Merge pull request #140 from shadps4-emu/additional_evq_func
A bunch of new functional and small improvements
2024-05-18 09:46:14 +03:00
psucien aa88458ad8
Merge pull request #139 from shadps4-emu/render_vk/img_state_trk
renderer_vulkan: state tracking for `Image` resources
2024-05-17 23:40:11 +02:00
psucien 45e73d324a kernel: event queue improvements 2024-05-17 23:32:15 +02:00
psucien 133acdc120 video_out: added vblank event 2024-05-17 23:31:55 +02:00
psucien 8455574615 gnmdriver: submission lock moved out from gpu 2024-05-17 23:31:19 +02:00
psucien 058e728e29 platform: multiple persistent irq handlers 2024-05-17 23:30:34 +02:00
psucien 9ad7495661 kernel: user event and data functions 2024-05-17 23:29:10 +02:00
psucien 85704e26a0 renderer_vulkan: state tracking for `Image` resources 2024-05-17 12:44:07 +02:00
georgemoralis 3f692a4d7d
Merge pull request #137 from shadps4-emu/video_core/multi_submits
amdgpu: multiple GFX submits
2024-05-17 13:13:46 +03:00
psucien 64b2e58285 a fair multi-submissions support 2024-05-17 08:47:38 +02:00
psucien dbdb3dc77e amdgpu: non-blocking submitDone 2024-05-17 08:22:47 +02:00
psucien 9df1a8d15b amdgpu: added support for several single GFX submits per frame 2024-05-17 00:01:47 +02:00
georgemoralis f881753944
Merge pull request #135 from shadps4-emu/video_core/splash
Show title splash while the game is loading
2024-05-16 17:13:56 +03:00
psucien 38061ae636 fix for crash in apps when splash is missing 2024-05-16 16:59:38 +03:00
georgemoralis 77cf875585 Update linux.yml
switched to ubuntu 24.04
2024-05-16 16:59:04 +03:00
psucien 8c4f72f404 review comments 2024-05-16 16:59:04 +03:00
psucien 3d5be23671 stb image moved to externals 2024-05-16 16:59:04 +03:00
georgemoralis c9b5b5e963 show title splash while the game is loading 2024-05-16 16:58:14 +03:00
TheTurtle 55855b4195
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 67f6d8b2e4
Merge pull request #131 from shadps4-emu/ngs2_work
Trying for ngs2 lle
2024-05-15 15:34:26 +03:00
georgemoralis 266fa57c43 clang format fix 2024-05-15 13:10:51 +03:00
georgemoralis 1431731503 even more linux fixes 2024-05-15 13:09:05 +03:00
georgemoralis 074f3d3f88 fixing linux compile 2024-05-15 12:57:58 +03:00
georgemoralis 055ffff463
Merge pull request #132 from shadps4-emu/gpu_flip
graphics: separate IRQ for GPU driven flips
2024-05-14 23:56:12 +03:00
psucien 45e354fd77
renderer_vk: missing barriers (#134) 2024-05-14 23:46:34 +03:00
psucien 8677972505 graphics: separate IRQ for GPU driven flips 2024-05-14 21:33:20 +02:00
georgemoralis 932f0435e8 scePthreadCondSignal added 2024-05-13 22:53:50 +03:00
georgemoralis 413b67f8ce scePthreadMutexTrylock and some more libcinternal functions 2024-05-13 20:09:32 +03:00
georgemoralis f1883870fd Initial LibcInternal 2024-05-13 16:13:33 +03:00
georgemoralis 99e4301dcc pthread_self , scePthreadCondSignal , scePthreadCondWait ,scePthreadCondattrDestroy 2024-05-13 15:08:15 +03:00
georgemoralis 882292f1ce added sys_modules folder and ability to load system modules (currently we try ngs2) 2024-05-13 15:01:45 +03:00
georgemoralis 98316575fb
Merge pull request #130 from shadps4-emu/kernel_stuff
Kernel stuff & others
2024-05-13 14:19:33 +03:00
georgemoralis 84de60a29a scePthreadDetach , scePthreadAttrSetstacksize , clock_gettime 2024-05-13 14:04:25 +03:00
georgemoralis d0d84221fd possible fix for linux(?) 2024-05-12 19:36:40 +03:00
georgemoralis d84752bfbb reuse fix (again) 2024-05-12 19:13:37 +03:00
georgemoralis c70736d6b7 reuse fix 2024-05-12 19:08:26 +03:00
georgemoralis 64cabdadf2 sceKernelConvertUtcToLocaltime implemented 2024-05-12 19:03:51 +03:00
georgemoralis 6196336533 updated aerolib 2024-05-12 17:51:20 +03:00
georgemoralis 2038d179fe Merge remote-tracking branch 'origin/main' into kernel_stuff 2024-05-11 10:20:32 +03:00
georgemoralis b326ce5f69
Merge pull request #128 from psucien/gnm_driver/basic_sync
gnm_driver: Gnm eventq and GPU flips
2024-05-11 01:22:17 +03:00
psucien d804a66aa2 review comments applied 2024-05-11 00:04:04 +02:00
psucien 37014394fd amdgpu: return perfcounter on EOP 2024-05-10 23:16:56 +02:00
psucien b849b07442 gnm_driver: fixed a typo and fields initialization 2024-05-10 22:58:53 +02:00
psucien 59e7bbdec4 kernel: `sceKernelDeleteEqueue` added 2024-05-10 22:04:41 +02:00
psucien 923baf0164 core: gpu interrupt dispatcher 2024-05-10 21:48:01 +02:00
psucien 581688c1ac amdgpu: EOS event packet handling 2024-05-10 11:55:04 +02:00
georgemoralis fc0288d1e5 submodules updated 2024-05-10 00:48:23 +03:00
georgemoralis a647f95ae5 fixed workflows 2024-05-10 00:05:54 +03:00
georgemoralis e239df73b4 removed old vulkan headers 2024-05-10 00:04:11 +03:00
psucien 8e0c67f12e amdgpu: `wait_reg_mem` and `write_data` implementation
Command list parsing is temporary moved to async task
2024-05-09 22:59:35 +02:00
georgemoralis b00b849d3f use winpthreads from mingw64 2024-05-09 23:45:09 +03:00
psucien bfb18135fb amdgpu: EOP irq and dummy PM4 handlers 2024-05-08 23:27:56 +02:00
psucien 498c5eb0cd gnm_driver: `sceGnmSubmitAndFlipCommandBuffers` implementation 2024-05-08 22:55:39 +02:00
psucien c7cfe2622d video_out: `sceVideoOutSubmitEopFlip` stub added 2024-05-08 22:54:34 +02:00
psucien 4746f514ff gnm_driver: various fixes 2024-05-08 22:53:55 +02:00
psucien 72ea0be9ff gnm_driver: `sceGnmSetEmbeddedVsShader` added 2024-05-08 21:00:01 +02:00
Xphalnos 93797af73f
Update Workflows (#127)
* Update Workflows

* Update clang-format.sh

* Revert "Update clang-format.sh"

This reverts commit 391bf7e639.

* Clang 17
2024-05-08 14:17:41 +03:00
psucien 5f83ad2ecb gnm_driver: `sceGnmInsertWaitFlipDone` added 2024-05-08 07:36:14 +02:00
psucien 50bcd13482 video_out: added display buffer labels 2024-05-08 07:35:10 +02:00
psucien 4206ec3c94 video_core, kernel: added gfx eop event handling 2024-05-07 22:46:54 +02:00
georgemoralis 96cf59efea
Merge pull request #125 from shadps4-emu/savedata
Savedata + filesystem implementations
2024-05-07 16:38:39 +03:00
georgemoralis 91dd175d6b added sceKernelGetTscFrequency 2024-05-07 16:28:42 +03:00
georgemoralis 9dff1975a3 libc hle : added ftell , powf , roundf 2024-05-07 16:25:58 +03:00
georgemoralis b32332956d
Merge pull request #126 from psucien/gnm_driver/basic_functionality2
core: libraries: gnmdriver: bit more of basic Gnm driver functions
2024-05-06 23:57:37 +03:00
psucien 1b811e08f1 core: libraries: gnmdriver: bit more of basic Gnm driver functions 2024-05-06 22:13:33 +02:00
georgemoralis 930f239556 clang format 2024-05-05 16:50:55 +03:00
georgemoralis 806781a110 dummy ksernelMunmap (allows we are doomed to progress further) 2024-05-05 12:59:26 +03:00
georgemoralis ad6724eeba improvements in sceKernelOpen, rewrote sceKernelLseek, added sceKernelWrite, added sceKernelMkdir , partial sceKernelStat 2024-05-05 12:43:01 +03:00
georgemoralis 277e16c7ba sceSaveDataMount2,sceSaveDataUmount some implementation 2024-05-04 22:08:04 +03:00
georgemoralis 2b9b3e76bf moved savedata to proper folder 2024-05-04 19:08:46 +03:00
Xphalnos 235b6e8781
Readme: improvements (#121)
* Update README.md

* Minor fixes

* Update building-windows.md

* Update linux_building.md

* Update readme.txt

* Build status

* Add psucien
2024-05-03 15:49:13 +03:00
georgemoralis ce4bdee0aa
Merge pull request #124 from shadps4-emu/npmodules
added dummy np* modules and screenshot module
2024-05-02 18:27:14 +03:00
georgemoralis e4d43f8e07 added dummy np* modules and screenshot module 2024-05-02 18:16:10 +03:00
georgemoralis 7d6a717599
Merge pull request #123 from shadps4-emu/sonicmania_work
Sonicmania work
2024-05-02 17:36:59 +03:00
georgemoralis 150854c583 added a login event in sceUserServiceGetEvent 2024-05-02 17:14:55 +03:00
georgemoralis d2cc256b28 create_thread : sometime thread name is null 2024-05-02 17:14:30 +03:00
georgemoralis 90e3e47c4d added stubbed mostly version of flexible memory - it allows sonic mania to go further 2024-05-02 17:13:51 +03:00
georgemoralis 2f9f4e1eeb
Merge pull request #122 from shadps4-emu/psf_info_+_stack_allocation
Psf info + stack allocation
2024-05-02 16:05:09 +03:00
georgemoralis 2308d7f1d6 better way for compiler option 2024-05-02 15:48:48 +03:00
georgemoralis b0b73f1283 print param.sfo info at startup 2024-05-02 10:57:45 +03:00
georgemoralis 6f1e488b37 fixed stack allocation issue 2024-05-02 10:57:24 +03:00
psucien 7e8d90d609
core: libraries: gnmdriver: basic functionality extension (#120)
Also a bit of refactoring in `video_core`
2024-05-01 19:29:06 +03:00
TheTurtle 1b9bf924ca
core: Rewrite thread local storage implementation (#118) 2024-05-01 13:38:41 +03:00
TheTurtle b94efcba5a
video_core: Add basic command list processing (#117) 2024-04-30 01:23:28 +03:00
psucien 2696733cad
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
georgemoralis d496fab492
Merge pull request #111 from raphaelthegreat/main
core: Rewrite videoout library and bringup new vulkan backend
2024-04-29 19:33:56 +03:00
georgemoralis 0727775c88 give texture cache exception handler priority over tls exception handler 2024-04-29 19:26:35 +03:00
raphaelthegreat 25c04ad42f texture_cache: Fix linear image uploads
* Also fixed build for clang-cl with libc
2024-04-29 18:22:04 +03:00
georgemoralis 7d96308759 fix config for gpu settings 2024-04-28 19:14:56 +03:00
psucien 35777a9fb3 clang format fix 2024-04-28 01:34:14 +02:00
psucien 453b24eb20 config: option to select gpu for vk device 2024-04-28 01:19:04 +02:00
psucien 249373bf0d texture_cache: protection flags re-worked
* actually I gave up on clang fmt
2024-04-28 01:00:24 +02:00
psucien d2c53d0fde clang format fix 2024-04-28 00:51:34 +02:00
psucien 1047293bf2 Merge branch 'main' of github.com:raphaelthegreat/shadps4 into raph-main 2024-04-28 00:29:15 +02:00
psucien e0a4c3f1a3 texture_cache: added memory protection for Windows 2024-04-28 00:21:04 +02:00
raphaelthegreat 40c86b7688 Address feedback 2024-04-28 01:09:03 +03:00
georgemoralis fec7f6cdc2 added sceVideoOutGetVblankStatus 2024-04-18 22:32:15 +03:00
georgemoralis 1275378e21 fixing qt buids once again 2024-04-15 22:51:36 +03:00
georgemoralis 7b5d8e5ff9 trying to fix actions (again) 2024-04-15 20:35:49 +03:00
georgemoralis 096316619a fixing qt builds 2024-04-15 20:20:00 +03:00
georgemoralis 4394191fae boost submodule was added wrong 2024-04-14 20:18:20 +03:00
georgemoralis de770bc668 define a linux only code 2024-04-14 19:57:58 +03:00
GPUCode c01b6f8397 video_core: Rewrite vulkan and videoout 2024-04-14 17:10:40 +03:00
georgemoralis 5979fa74c5
Merge pull request #113 from shadps4-emu/cleanup
src: Reorganize and cleanup libraries
2024-04-14 11:32:57 +03:00
GPUCode 0a94899c86 src: Move control to input directory 2024-04-14 01:18:25 +03:00
GPUCode 5e2ac6c72b src: Reorganize and cleanup libraries 2024-04-14 00:37:17 +03:00
georgemoralis e99129d72f
several fixes (#112)
* updated fmt

* submodules updated

* fixed _TIMESPEC_DEFINED for winpthreads under windows

* fixed sdl3 under qt

* virtual_memory: Ensure mapped addresses stay inside the user area

* Fixes LLE Libc crashing on linux

---------

Co-authored-by: GPUCode <geoster3d@gmail.com>
2024-04-13 22:37:21 +03:00
georgemoralis 5ed4891a1f
Merge pull request #110 from shadps4-emu/fixesagain
Fixesagain
2024-04-11 11:49:16 +03:00
georgemoralis 6ca53f8b99 update sdl3 to latest 2024-04-09 13:49:26 +03:00
georgemoralis 6f1c2d3060 clang format fix 2024-04-09 13:40:03 +03:00
georgemoralis 7b16e9af23 improved linker resolver 2024-04-09 13:39:35 +03:00
georgemoralis 3a7834b821
Merge pull request #109 from shadps4-emu/undertale-etc
undertale and other stuff
2024-04-09 11:25:52 +03:00
georgemoralis bb8a400b7b dummy libscesavedatadialog 2024-04-08 19:03:51 +03:00
georgemoralis b0cd6e5178 added sceVideoOutGetVblankStatus 2024-04-07 09:27:41 +03:00
georgemoralis 598a6a88e0
Merge pull request #107 from shadps4-emu/modules4
More module work focused on undertale
2024-04-05 20:41:26 +03:00
georgemoralis 5663da21c2 more linux fix 2024-04-05 19:53:54 +03:00
georgemoralis ea4bb4773e linux build fix 2024-04-05 19:33:38 +03:00
georgemoralis fc5e133c44 added sceAudioOutSetVolume 2024-04-05 09:59:28 +03:00
georgemoralis 81143b4a9e scePadRead,scePthreadYield implementations 2024-04-05 09:27:13 +03:00
georgemoralis 5409576197 posix nanosleep call 2024-04-04 20:20:50 +03:00
georgemoralis c29f514e63 just disable audioInOpen 2024-04-04 20:07:33 +03:00
georgemoralis 935842291d dummy sceAudioIn lib 2024-04-04 20:04:18 +03:00
georgemoralis a049d4c491 added clock_gettime 2024-04-04 19:47:59 +03:00
georgemoralis 121759d836 somehow working scePthreadCreate 2024-04-04 19:16:10 +03:00
georgemoralis 33209a77f1
Merge pull request #102 from shadps4-emu/gui-rewrite
Gui rewrite.
2024-04-02 23:51:13 +03:00
georgemoralis c832e3831a scePthreadAttrGet , and some mutex work 2024-04-02 18:07:24 +03:00
georgemoralis 2cc03e851e added some debug info to gnm 2024-04-02 17:21:04 +03:00
georgemoralis 0b8cc8eba9 added sceKernelClockGettime 2024-04-02 08:51:17 +03:00
georgemoralis 9d8fc61954 sceSaveDataMount2 just return save data not found for now 2024-04-01 22:31:25 +03:00
georgemoralis 6066c89607 scePadGetControllerInformation added , dummy scePadSetMotionSensorState 2024-04-01 14:45:27 +03:00
georgemoralis 92e4c6b798 scePthreadMutexDestroy implemented 2024-04-01 14:21:40 +03:00
georgemoralis 0d49214da3
Merge pull request #104 from shadps4-emu/modules3
More modules work
2024-04-01 08:45:03 +03:00
georgemoralis 06d6ad09ea log debug message to tty 2024-04-01 08:44:07 +03:00
Jonah 9af38c3309 - Removed unnecessary std::future from game_grid_frame(populate/resize) Thanks SachinVin! 2024-03-31 12:24:08 -06:00
georgemoralis 2382e77898 sceKernelClose,sceKernelRead,sceKernelLseek implementation 2024-03-31 18:04:47 +03:00
georgemoralis 03b3194c44 fixed (?) _write function 2024-03-31 18:04:11 +03:00
georgemoralis a21722a1db fixed linux issue with enums 2024-03-31 17:37:09 +03:00
georgemoralis 186fa35f13 added ps4_ prefix to libkernel to make sure it deosn't conflict with linux function names 2024-03-31 17:14:21 +03:00
georgemoralis 0525481a9b partial implementation of _write function , which is used as debug ouput from lle libc 2024-03-31 13:33:38 +03:00
georgemoralis 8fa5874fb1 dummy libkernel module 2024-03-31 11:30:43 +03:00
georgemoralis ad7e750fa7 scePthreadAttrDestroy,scePthreadAttrGetaffinity added 2024-03-30 22:19:42 +02:00
georgemoralis 30946e21dd more clang fixes 2024-03-30 15:41:12 +02:00
georgemoralis 5373d7367d clang format fix 2024-03-30 15:39:21 +02:00
georgemoralis 94cd3be814 dummy sysmodule module 2024-03-30 15:34:01 +02:00
georgemoralis 0719e9c46f
Merge pull request #105 from Xphalnos/main
URL migration for Build
2024-03-30 10:43:02 +02:00
georgemoralis 8e8a82a310 some dummy net functions 2024-03-30 09:35:00 +02:00
Xphalnos f54e1f39cb URL migration for Build
I forwarded the URL for Build ShadPS4 from georgemoralis to shadps4-emu. As the old link was archived, this will allow the document to be modified. I also updated the versions for Windows.
2024-03-30 08:34:44 +01:00
Jonah c5e68ab819 PKG Viewer:
- Fixed crash when other file extensions are present in the same folder as the packages.
- Fixed display: check patch using serial and not name. fixed display when some games contain a semicolon in the title(STEINS;GATE 0)
- Fixed column resize on first run.
- Added status bar showing the number of packages.
- Removed: saving every single pkg path in config file.
2024-03-30 00:03:15 -06:00
georgemoralis 37813c1f59 clang format fix 2024-03-29 23:28:06 +02:00
georgemoralis b36df1383a added more dummy modules 2024-03-29 23:25:52 +02:00
Jonah aaa75a7ce1 - fix grid mode not populating on first run(fresh run with no settings saved).
- refresh game list button.
2024-03-29 00:48:17 -06:00
Jonah 2007c0610e *facepalm* 2024-03-28 23:53:34 -06:00
Jonah 0d1a1fae07 Reuse.. 2024-03-28 23:51:38 -06:00
raziel1000 ca6f582ea8 - Gui rewrite.
- Gui: Bug fixes and cleanup.
- Gui: Performance improvement (loading, resizing...etc)
- Added a simple PKG Viewer(Settings-> Utils -> PKG Viewer), added pkg folders will be saved.
- PKG Viewer: Shows game info(name, id, region...etc)
- PKG Viewer: Right click -> Install PKG to install/extract a game. Patch installation is also possible.
- Added option to dump game list  (Settings -> Utils -> Dump Game List), will be dumped to emu folder GameList.txt
2024-03-28 23:43:46 -06:00
georgemoralis 2d0414c365
Update README.md 2024-03-28 16:38:14 +02:00
georgemoralis b1e18529ac
Merge pull request #101 from Xphalnos/main
Proposed new logo for ShadPS4
2024-03-28 16:37:12 +02:00
Xphalnos c78f3ad4c5 Change logo 2024-03-28 15:29:21 +01:00
georgemoralis c3d26e92c6
Merge pull request #100 from shadps4-emu/libc_part2
Libc LLE
2024-03-28 07:24:06 +02:00
georgemoralis b60a627d44 clang format 2024-03-27 15:02:21 +02:00
georgemoralis a1468c9d79 loading libSceFios2.prx as lle as well 2024-03-27 13:00:27 +02:00
whereismyfoodat e272b152ed small fixes , cleanups 2024-03-27 08:41:14 +02:00
georgemoralis 9d4149f006 clang format fix 2024-03-26 19:51:10 +02:00
georgemoralis 489dd2c8fc scePthreadMutexattrDestroy again 2024-03-26 19:20:55 +02:00
georgemoralis 377d962478 dummy sceLibcHeapGetTraceInfo and scePthreadMutexattrDestroy 2024-03-26 19:19:52 +02:00
georgemoralis da7b4df1c3 implemented sceKernelGetProcParam 2024-03-26 18:48:26 +02:00
georgemoralis 683a0d55bf we can now load libc.prx 2024-03-26 18:29:37 +02:00
georgemoralis 1a7f5f7b31 function to start modules 2024-03-26 18:13:27 +02:00
georgemoralis bc7228fcb2 relocate before execution 2024-03-26 17:33:48 +02:00
georgemoralis e5a224aa96 rewrote relocations 2024-03-26 17:17:59 +02:00
georgemoralis 7dbe258edc improved LoadSymbols for export support 2024-03-26 14:05:18 +02:00
georgemoralis f70fbcac19 linker : Resolve can now load exports as well 2024-03-26 12:57:18 +02:00
georgemoralis 354a9c3cdb clang format fix 2024-03-26 12:33:00 +02:00
georgemoralis 596831947e small improvements on linker Resolve method 2024-03-26 12:31:46 +02:00
georgemoralis 365ae2aac9 some elf improvements 2024-03-26 00:21:38 +02:00
georgemoralis f2f04142b0 improved symbols_resolver and output 2024-03-25 09:46:36 +02:00
georgemoralis 540c21d382 config option to enable libc lle 2024-03-25 09:26:59 +02:00
georgemoralis 63d8d4d833 started 0.0.4 2024-03-25 09:09:39 +02:00
georgemoralis 86911747bf
v0.0.3 - codename salad 2024-03-23 10:05:45 +02:00
georgemoralis 7799211100 removed module 2024-03-23 10:00:38 +02:00
georgemoralis 03e5cd2749 force gitmodule 2024-03-23 09:54:57 +02:00
georgemoralis 4980aa3fd5 pushed v.0.0.3 version - codename salad 2024-03-23 09:43:03 +02:00
georgemoralis 7a42b9df79 moved moduleGenerator to a new repo 2024-03-23 09:29:25 +02:00
georgemoralis 2e931c9f72
More modules (#99)
* added dummy sceAudio lib

* added lseek in file_system

* updated sdl3

* forgot sdl3 in cmake

* cmake is case sensitive in linux

* fixed SDL_CreateWindowWithPosition

* fixed vulkan issues with latest sdl3

* some progress in sceAudio

* improvements in audio

* more sound improvements

* first working sound output , from openorbis sound demo

* updated sdl3 , zlib-ng can now be build with msvc+clangci

* fixed cmake

* fix for audio buffering

* clang format fix

* format fix

* better error handling for sceAudioOutput
2024-03-22 18:12:37 +02:00
georgemoralis 2a03b4d03b
Autogen system,user,dialog modules (#98)
* some rework on system_service, user_service

* fixed clang format

* more clang fix

* more clang fix

* added error codes in system service

* some libc functions

* fixed fprintf

* small fix

* linux fix

* error handling in user service

* error codes reorganized
2024-03-14 14:18:16 +02:00
georgemoralis 8c4f386641 made an option for logging to be synced by default instead of async 2024-03-11 14:06:39 +02:00
georgemoralis 02dcf4d45c
LLE libc + other fixes part1 (#97)
* app0 folder is absolute

* some improvements on symbols types

* clang format

* missing libs.h

* improved symbols_resolver

* moved config to config folder

* functions to dump import functions

* improved logging output

* option for debugdump and improvements

* Apply suggestions from code review

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* clang format

---------

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>
2024-03-11 13:26:33 +02:00
Jonah 00d401e103 - gui: firmware version display text correction (fw >= 10) 2024-03-08 11:54:30 -07:00
Younes 8ba6d7add0
- pkg extraction: fix a rare issue when there is extra entries with uroot and flat_path_table (this is how it should be handled anyway!) (#96)
- gui:
      - fix crash when switching between List and Grid modes.
      - fix fw display text (it was showing wrong numbers in certain cases)
      - made sfo viewer show numbers in hex.
2024-03-08 14:38:19 +02:00
Jonah 12a8cf5ee9 - Fixed a bug where folders where not created in the correct location which led to missing folders and files (incomplete/wrong extraction) 2024-03-06 00:04:14 -07:00
raziel1000 7e54255d29 - Fixed pkg extraction. 2024-03-02 14:06:10 -07:00
qurious-pixel 58ae9c3ade
add window icons (#92) 2024-03-02 18:39:46 +02:00
Younes f2691d83b8
- Added Play, Pause, Stop and several other UI icons. (#91)
* - Added Play, Pause, Stop and several other UI icons.
- Added a screenshot :3

* update reuse

* reuse again

* screenshot
2024-03-01 10:47:28 +02:00
qurious-pixel 7425cb41a5
linux qt artifact name (#89) 2024-03-01 08:23:02 +02:00
georgemoralis ffb2a583f9 missing dll in windows-qt ci 2024-03-01 00:11:19 +02:00
georgemoralis 02cbebbf78
file formats and qt (#88)
* added psf file format

* clang format fix

* crypto functions for pkg decryption

* pkg decryption

* initial add of qt gui , not yet usable

* renamed ini for qt gui settings into shadps4qt.ini

* file detection and loader support

* option to build QT qui

* clang format fix

* fixed reuse

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/loader.h

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/loader.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* uppercase fix

* clang format fix

* small fixes

* let's try windows qt build ci

* some more fixes for ci

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/pkg.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update .github/workflows/windows-qt.yml

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/loader.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* Update src/core/file_format/psf.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* loader namespace

* Update src/core/loader.cpp

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* constexpr magic

* linux qt ci by qurious

* fix for linux qt

* Make script executable

* ci fix?

---------

Co-authored-by: raziel1000 <ckraziel@gmail.com>
Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>
Co-authored-by: GPUCode <geoster3d@gmail.com>
2024-03-01 00:00:35 +02:00
georgemoralis 99d013f612 initialaze submodules properly 2024-02-28 19:01:34 +02:00
georgemoralis 84b0aff35b added cryptoopp and zlib-ng modules 2024-02-28 18:45:51 +02:00
georgemoralis 47e2619b51 update discord submodule 2024-02-28 14:36:44 +02:00
GPUCode 79d6c8a377
common: Rewrite logging based on cut down citra logger (#86)
* common: Rewrite logging based on cut down Citra logger

* code: Misc fixes

* core: Bring back tls handler

* linker: Cleanup

* config: Remove log level

* logging: Enable console output by default

* core: Fix windows build
2024-02-28 00:10:34 +02:00
georgemoralis b3084646a8
submodules fixes (#87)
* update discord-rpc

* ignore gitmodules on reuse

* imgui not used atm removed
2024-02-27 20:24:47 +02:00
georgemoralis e40461b0c2
Update README.md
updated build badges , added linux
2024-02-25 20:48:17 +02:00
qurious-pixel 6e1f25d99f
Linux CI (#84)
* Linux CI

* misc formatting

* .reuse
2024-02-25 17:20:53 +02:00
georgemoralis 08aba86ca1
Modules generation tool (#81)
* Modules generation tool

* apply clang format to generator

* @whereismyfoodat suggestions

* added reuse headers

* reuse part2

* reuse part3

* reuse part3

* replace with hex_id the unknown functions to avoid compile errors with unknown characters from encode_id

* fixes in generation

* some sample module code from autogen tool

* clang format fix
2024-02-24 22:39:29 +02:00
georgemoralis d89653551e
Merge pull request #83 from GPUCode/main
chore: Make shadps4 REUSE compliant
2024-02-24 09:00:45 +02:00
GPUCode 584b7d2b15 chore: Make shadps4 REUSE compliant 2024-02-23 23:33:43 +02:00
GPUCode 6f4c6ae0bb
code: Add clang-format target and CI workflow (#82)
* code: Add clang format target, rules and CI workflow

* code: Run clang format on sources
2024-02-23 22:57:57 +02:00
georgemoralis 32a5ff15bb
Merge pull request #80 from shadps4-emu/linux
common: Rework timekeeping with native RDTSC and port to linux
2024-02-23 14:45:05 +02:00
georgemoralis 552d2da17a should work without lib 2024-02-23 14:33:01 +02:00
georgemoralis b62c44c914 ugly workaround :D 2024-02-23 14:10:44 +02:00
GPUCode fe43558779 common: Rework timekeeping with native RDTSC and port to linux 2024-02-23 11:30:06 +02:00
georgemoralis acfa56f6bc
Merge pull request #77 from georgemoralis/TLS_works
TLS branch WIP
2024-01-27 19:14:37 +02:00
Stefanos Kornilios Mitsis Poiitidis a58289a353 Merge branch 'TLS_works' of github.com:georgemoralis/shadPS4 into TLS_works 2024-01-27 17:00:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 6de4736e50 skip over 0x66 prefixes in TLS 2024-01-27 16:59:59 +02:00
georgemoralis ff43fec76a some fs work for openorbis (WIP) 2024-01-26 18:01:27 +02:00
georgemoralis 57ddf939d4 orbis weird sceVideoOut calls 2024-01-24 14:46:02 +02:00
Stefanos Kornilios Mitsis Poiitidis 724c56d8aa Basic TLS with patching + int 0x80 2024-01-20 14:29:23 +02:00
georgemoralis af18453950 initial PT_TLS support 2023-11-21 17:27:11 +02:00
georgemoralis b6d98d4b72 some cleanups 2023-11-21 16:54:10 +02:00
georgemoralis 4f6dc8fddb functions libkernel to get openrorbis working (without tls) 2023-11-19 12:55:07 +02:00
georgemoralis f57f668c92 small correction 2023-11-19 10:48:59 +02:00
georgemoralis a298ddb057
Merge pull request #76 from georgemoralis/threads_and_openorbis_stuff_part1
initial fs implementation (mounting /app0/)
2023-11-19 10:23:23 +02:00
georgemoralis 093ebb568c initial fs implementation (mounting /app0/) 2023-11-19 10:22:46 +02:00
georgemoralis 103de64bba
Merge pull request #75 from georgemoralis/threads_and_openorbis_stuff_part1
Threads and openorbis stuff part1
2023-11-18 10:51:36 +02:00
georgemoralis 3e8cd57986 scePthreadCond functions 2023-11-16 13:31:12 +02:00
georgemoralis 1316443c59 initial ScePthreadCond works 2023-11-16 09:14:10 +02:00
georgemoralis 776a680e85 prefix in libc functions to avoid messing with std ones 2023-11-16 09:13:50 +02:00
georgemoralis cad5ac34b0 some threadman fixes 2023-11-16 08:49:26 +02:00
georgemoralis dde91c1c4d
Merge pull request #71 from georgemoralis/undertale
Undertale-mutexes
2023-11-12 20:26:51 +02:00
georgemoralis f3c189feb3 cleanup createMutex 2023-11-12 20:23:42 +02:00
georgemoralis 8f8f0757af fixed issue in scePthreadAttrSetschedpolicy 2023-11-12 15:09:18 +02:00
georgemoralis ae12f351f8 better posix errors 2023-11-12 13:23:35 +02:00
wheremyfoodat e8c425850e some adjustments 2023-11-12 10:57:50 +02:00
georgemoralis 7e6c741ed7 added sceSystemServiceGetStatus 2023-11-11 16:25:53 +02:00
georgemoralis 420b917a0a
Merge pull request #72 from wheremyfoodat/libc_undertale
[Libc] Add getptolower/getptoupper/getpctype
2023-11-11 12:31:05 +02:00
wheremyfoodat 21c8150841
[Libc] Add getptolower/getptoupper/getpctype 2023-11-11 12:28:15 +02:00
georgemoralis 7f0cf8784b improved mutex creation 2023-11-11 12:13:43 +02:00
georgemoralis 402ee7d006 init mutex if it doesn't exist when trying to lock (found in openorbis) 2023-11-11 10:49:44 +02:00
georgemoralis dbaf38dc7d mutex debugging log 2023-11-11 10:01:16 +02:00
georgemoralis 5f825fc8a8 implemented posix error return codes 2023-11-11 09:45:47 +02:00
georgemoralis 7fcea3277d some mutexlock , mutexunlock implementations 2023-11-10 23:30:28 +02:00
georgemoralis 11edfecb75 some dummy mutexlock-unlock 2023-11-10 21:08:32 +02:00
georgemoralis a10af46153 some refactoring on thread class 2023-11-10 20:51:02 +02:00
georgemoralis 91885e8a41 added sceMutexInit functions 2023-11-10 19:52:41 +02:00
georgemoralis 86bc2d427f moved thread_management to proper package 2023-11-10 17:31:56 +02:00
georgemoralis a01e057632
Merge pull request #69 from GPUCode/main
core: Cleanup and reorganize
2023-11-06 06:55:36 +02:00
GPUCode 79c9d9ebd1 kernel: To snake case 2023-11-06 01:19:57 +02:00
GPUCode 099d01f96c common: Move timer to common 2023-11-06 01:17:28 +02:00
GPUCode 369d92fa56 core: Reorganize 2023-11-06 01:11:54 +02:00
georgemoralis 89cf4dbfcb
Merge pull request #68 from GPUCode/main
cmake: Refactor third party library management
2023-11-05 22:05:34 +02:00
GPUCode 7bccfeb8cc emulator: Use fmt::format instead of snprintf 2023-11-05 17:14:50 +02:00
GPUCode 1cf032eeb1 cmake: Add directory groups 2023-11-05 17:08:47 +02:00
GPUCode 303f086b14 common: Move classes to common namespace 2023-11-05 16:56:28 +02:00
GPUCode 996aa9d17a cmake: Add include directory to winpthread 2023-11-05 16:30:11 +02:00
GPUCode a0b80893db cmake: Update CMakeLists.txt 2023-11-05 14:21:20 +02:00
GPUCode 17aefc1aef src: Move certain headers in common 2023-11-05 13:41:26 +02:00
GPUCode 6e28ac711f cmake: Refactor library management 2023-11-05 13:22:32 +02:00
georgemoralis c126925dd9 libc fprintf implementation for stdout,stderr case (needed from undertale) 2023-11-01 13:02:39 +02:00
georgemoralis 7b276e0a08 some HLE implementation for undertale game to process further 2023-11-01 12:40:56 +02:00
georgemoralis 6fba3a4380 finished libc refactoring 2023-10-31 19:08:33 +02:00
georgemoralis fd535bae6b libc separate stdlib functions to libc_stdlib 2023-10-31 18:12:05 +02:00
georgemoralis f5526977d3 libc separated string functions to libc_string 2023-10-31 17:32:56 +02:00
georgemoralis bb578ae377 cleanup libc (wip) and separated it to several files 2023-10-31 15:53:46 +02:00
georgemoralis 28a5277e2b reorganized libc package 2023-10-31 15:37:24 +02:00
georgemoralis 53a8024e43 core renaming 2023-10-31 14:28:42 +02:00
georgemoralis aee25dcaf9
Merge pull request #65 from georgemoralis/timers_again
Timers and general refactoring
2023-10-31 14:10:36 +02:00
georgemoralis 11c0d79045 refactoring system service 2023-10-31 14:04:35 +02:00
georgemoralis 7391f7708a user service refactoring 2023-10-31 13:35:52 +02:00
georgemoralis bdd756a090 log scePadOpen 2023-10-31 09:04:08 +02:00
georgemoralis c488b7132d refactored libpad to new package 2023-10-31 09:01:20 +02:00
georgemoralis 93e75481c7 refactoring Core folder to core 2023-10-31 08:47:58 +02:00
georgemoralis cfdc45dfcb file_system reorganized (dummy) 2023-10-30 23:04:57 +02:00
georgemoralis 6f941c277a reimplemented sceKernelReadTsc in proper package and some abi fixes 2023-10-30 20:22:25 +02:00
georgemoralis 61e8919cf1 pause emu with p button 2023-10-30 14:52:01 +02:00
georgemoralis 0ad40cff1b implemented sceKernelGetProcessTimeCounter , sceKernelGetProcessTimeCounterFrequency 2023-10-30 12:53:52 +02:00
georgemoralis 51dda8e8a5 namespace update 2023-10-30 12:43:39 +02:00
georgemoralis 3602864523 added timestamp in buttons state 2023-10-30 08:57:43 +02:00
georgemoralis 758ef332f2 implemented sceKernelGetProcessTime 2023-10-30 08:48:52 +02:00
georgemoralis f732704b83 implemented fps counter 2023-10-29 23:46:34 +02:00
georgemoralis ce2c7a7d01 restored previous timer class 2023-10-29 23:46:18 +02:00
georgemoralis 1e755d3cfc fixed return in flip() function 2023-10-29 23:36:15 +02:00
georgemoralis adbe725d79 more debugging in elf loader 2023-10-28 09:12:43 +03:00
georgemoralis 4e6bfe1772 switched elf logging to fmt 2023-10-28 08:55:58 +03:00
georgemoralis bb49254fad
Merge pull request #64 from georgemoralis/logging_exception
log exceptions and flush log file
2023-10-28 00:10:19 +03:00
georgemoralis f1ddf028c2
Update src/Util/log.cpp
Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>
2023-10-28 00:09:47 +03:00
georgemoralis 4706b6b4e5
Update src/Util/log.cpp
Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>
2023-10-27 20:56:21 +03:00
georgemoralis ff2a9dd37a
Update src/Util/log.cpp
Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>
2023-10-27 20:55:18 +03:00
georgemoralis 2f0fec806a log exceptions and flush log file 2023-10-27 18:57:48 +03:00
georgemoralis af3710887c improved logging in elf loader 2023-10-27 18:28:05 +03:00
georgemoralis eb67c847a7 removed obsolute fs 2023-10-27 11:07:19 +03:00
georgemoralis 50a2f48427
Update README.md 2023-10-27 09:45:15 +03:00
georgemoralis b3cc2efdb2
Merge pull request #62 from GPUCode/new-elf
code: Rework elf loader and general cleanup
2023-10-27 09:44:30 +03:00
GPUCode 0021e68aab vulkan: Remove orphan new part 2 2023-10-26 23:46:05 +03:00
GPUCode e196e35669 vulkan: Remove orphan new part 1 2023-10-26 23:38:37 +03:00
GPUCode 28819dede1 code: Replace printf/scanf with type safe fmt 2023-10-26 23:29:19 +03:00
GPUCode 33729d634e main: Remove remnants of imgui example 2023-10-26 23:15:11 +03:00
GPUCode f3504b2d25 singleton: Use unique_ptr 2023-10-26 23:13:24 +03:00
GPUCode 7cbe7c762a linker: Eliminate orphan news
* Most of these can just be on the stack, with the rest being std::vectors
2023-10-26 23:07:15 +03:00
GPUCode ca564b928c core: Rework elf loader 2023-10-26 22:55:13 +03:00
georgemoralis fed14ad4ed
Merge pull request #61 from GPUCode/stl-threads
core: Switch threading primitives to STL types
2023-10-22 17:35:51 +03:00
GPUCode ba299c4c00 core: Remove Timer in favour of std::chrono 2023-10-22 17:17:43 +03:00
GPUCode e2b1b059ed core: Switch to std threading primitives 2023-10-22 17:10:25 +03:00
georgemoralis f39744cf62 started 0.0.3 WIP 2023-10-22 00:20:51 +03:00
georgemoralis f77fd1a342 updated changelog for v0.0.2 2023-10-21 21:45:49 +03:00
georgemoralis 1b483f1f03 updated version to v0.0.2 2023-10-21 21:37:17 +03:00
640 changed files with 566758 additions and 32466 deletions

40
.ci/clang-format.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash -ex
# SPDX-FileCopyrightText: 2023 Citra Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
dist/*.svg dist/*.xml; then
echo Trailing whitespace found, aborting
exit 1
fi
# Default clang-format points to default 3.5 version one
CLANG_FORMAT=clang-format-17
$CLANG_FORMAT --version
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
# Get list of every file modified in this pull request
files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)"
else
# Check everything for branch pushes
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
fi
# Turn off tracing for this because it's too verbose
set +x
for f in $files_to_lint; do
d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true)
if ! [ -z "$d" ]; then
echo "!!! $f not compliant to coding style, here is the fix:"
echo "$d"
fail=1
fi
done
set -x
if [ "$fail" = 1 ]; then
exit 1
fi

View File

@ -1,7 +0,0 @@
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 150
AccessModifierOffset: -2
TabWidth: 4
AllowShortEnumsOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true

View File

@ -1,50 +0,0 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Linux
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install dev packages
run: |
sudo apt install libxext-dev doxygen libgl-dev
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel `nproc`
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: shadps4-ubuntu64
# A file, directory or wildcard pattern that describes what to upload
path: |
${{github.workspace}}/build/shadps4
${{github.workspace}}/build/libSDL3.so.0.0.0

30
.github/linux-appimage-qt.sh vendored Executable file
View File

@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
#!/bin/bash
if [[ -z $GITHUB_WORKSPACE ]]; then
GITHUB_WORKSPACE="${PWD%/*}"
fi
export Qt6_DIR="/usr/lib/qt6"
export PATH="$Qt6_DIR/bin:$PATH"
# Prepare Tools for building the AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh
chmod a+x linuxdeploy-x86_64.AppImage
chmod a+x linuxdeploy-plugin-qt-x86_64.AppImage
chmod a+x linuxdeploy-plugin-checkrt-x86_64.sh
# Build AppImage
./linuxdeploy-x86_64.AppImage --appdir AppDir
./linuxdeploy-plugin-checkrt-x86_64.sh --appdir AppDir
cp -a "$GITHUB_WORKSPACE/build/translations" AppDir/usr/bin
./linuxdeploy-x86_64.AppImage --appdir AppDir -d "$GITHUB_WORKSPACE"/.github/shadps4.desktop -e "$GITHUB_WORKSPACE"/build/shadps4 -i "$GITHUB_WORKSPACE"/.github/shadps4.png --plugin qt --output appimage
mv Shadps4-x86_64.AppImage Shadps4-qt.AppImage

21
.github/linux-appimage-sdl.sh vendored Executable file
View File

@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
#!/bin/bash
if [[ -z $GITHUB_WORKSPACE ]]; then
GITHUB_WORKSPACE="${PWD%/*}"
fi
# Prepare Tools for building the AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh
chmod a+x linuxdeploy-x86_64.AppImage
chmod a+x linuxdeploy-plugin-checkrt-x86_64.sh
# Build AppImage
./linuxdeploy-x86_64.AppImage --appdir AppDir
./linuxdeploy-plugin-checkrt-x86_64.sh --appdir AppDir
./linuxdeploy-x86_64.AppImage --appdir AppDir -d "$GITHUB_WORKSPACE"/.github/shadps4.desktop -e "$GITHUB_WORKSPACE"/build/shadps4 -i "$GITHUB_WORKSPACE"/.github/shadps4.png --output appimage
mv Shadps4-x86_64.AppImage Shadps4-sdl.AppImage

9
.github/shadps4.desktop vendored Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Shadps4
Exec=shadps4
Terminal=false
Type=Application
Icon=shadps4
Comment=shadps4 emulator
Categories=Game;
StartupWMClass=shadps4;

BIN
.github/shadps4.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

17
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: 2021 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: Reuse
on:
push:
branches: [ main ]
tags: [ "*" ]
pull_request:
branches: [ main ]
jobs:
reuse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fsfe/reuse-action@v4

28
.github/workflows/format.yml vendored Normal file
View File

@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: Clang Format
on:
push:
branches: [ "*" ]
pull_request:
branches: [ main ]
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main'
sudo apt update
sudo apt install clang-format-17
- name: Build
env:
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
run: ./.ci/clang-format.sh

41
.github/workflows/linux-qt.yml vendored Normal file
View File

@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: Linux-Qt
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install misc packages
run: >
sudo apt-get update && sudo apt install libx11-dev libxext-dev libwayland-dev libfuse2 clang build-essential qt6-base-dev qt6-tools-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_QT_GUI=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Run AppImage packaging script
run: ./.github/linux-appimage-qt.sh
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-linux-qt
path: Shadps4-qt.AppImage

48
.github/workflows/linux.yml vendored Normal file
View File

@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: Linux
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install misc packages
run: >
sudo apt-get update && sudo apt install libx11-dev libxext-dev libwayland-dev libfuse2 clang build-essential
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-ubuntu64
path: |
${{github.workspace}}/build/shadps4
- name: Run AppImage packaging script
run: ./.github/linux-appimage-sdl.sh
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-sdl-appimage
path: Shadps4-sdl.AppImage

61
.github/workflows/macos-qt.yml vendored Normal file
View File

@ -0,0 +1,61 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: macOS-Qt
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Install MoltenVK
run: |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install molten-vk
- name: Setup Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.7.2
host: mac
target: desktop
arch: clang_64
archives: qtbase qttools
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_QT_GUI=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu)
- name: Package
run: |
mkdir upload
mv ${{github.workspace}}/build/shadps4.app upload
mv ${{github.workspace}}/build/translations upload
macdeployqt upload/shadps4.app
tar cf shadps4-macos-qt.tar.gz -C upload .
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-macos-qt
path: shadps4-macos-qt.tar.gz

52
.github/workflows/macos.yml vendored Normal file
View File

@ -0,0 +1,52 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: macOS
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Install MoltenVK
run: |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install molten-vk
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu)
- name: Package
run: |
mkdir upload
mv ${{github.workspace}}/build/shadps4 upload
cp $(arch -x86_64 /usr/local/bin/brew --prefix)/opt/molten-vk/lib/libMoltenVK.dylib upload
install_name_tool -add_rpath "@loader_path" upload/shadps4
tar cf shadps4-macos-sdl.tar.gz -C upload .
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-macos-sdl
path: shadps4-macos-sdl.tar.gz

50
.github/workflows/windows-qt.yml vendored Normal file
View File

@ -0,0 +1,50 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: Windows-Qt
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.7.2
host: windows
target: desktop
arch: win64_msvc2019_64
archives: qtbase qttools
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL -DENABLE_QT_GUI=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Deploy
run: |
mkdir upload
move build/Release/shadPS4.exe upload
move build/translations upload
windeployqt --dir upload upload/shadPS4.exe
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-win64-qt
path: upload

View File

@ -1,7 +1,5 @@
# This workflow uses actions that are not certified by GitHub. # SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# They are provided by a third-party and are governed by # SPDX-License-Identifier: GPL-2.0-or-later
# separate terms of service, privacy policy, and support
# documentation.
name: Windows name: Windows
@ -12,36 +10,25 @@ on:
branches: [ "main" ] branches: [ "main" ]
env: env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release BUILD_TYPE: Release
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Configure CMake - name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL
- name: Build - name: Build
# Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Upload a Build Artifact - name: Upload executable
uses: actions/upload-artifact@v3.1.2 uses: actions/upload-artifact@v4
with: with:
name: shadps4-win64 name: shadps4-win64-sdl
# A file, directory or wildcard pattern that describes what to upload
path: | path: |
${{github.workspace}}/build/Release/shadps4.exe ${{github.workspace}}/build/Release/shadPS4.exe
${{github.workspace}}/build/Release/SDL3.dll
${{github.workspace}}/build/Release/libwinpthread-1.dll

4
.gitignore vendored
View File

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
## ##
@ -405,3 +408,4 @@ FodyWeavers.xsd
/emulator/eboot.bin /emulator/eboot.bin
/out/* /out/*
/third-party/out/* /third-party/out/*
/src/common/scm_rev.cpp

112
.gitmodules vendored
View File

@ -1,43 +1,87 @@
[submodule "third-party/imgui"] [submodule "externals/cryptopp-cmake"]
path = third-party/imgui path = externals/cryptopp-cmake
url = https://github.com/ocornut/imgui url = https://github.com/shadps4-emu/ext-cryptopp-cmake.git
shallow = true shallow = true
[submodule "third-party/SDL"] [submodule "externals/cryptopp"]
path = third-party/SDL path = externals/cryptopp
url = https://github.com/libsdl-org/SDL url = https://github.com/shadps4-emu/ext-cryptopp.git
shallow = true shallow = true
[submodule "third-party/fmt"] [submodule "externals/cryptoppwin"]
path = third-party/fmt path = externals/cryptoppwin
url = https://github.com/fmtlib/fmt.git url = https://github.com/shadps4-emu/ext-cryptoppwin.git
shallow = true shallow = true
[submodule "third-party/spdlog"] [submodule "externals/zlib-ng"]
path = third-party/spdlog path = externals/zlib-ng
url = https://github.com/gabime/spdlog url = https://github.com/shadps4-emu/ext-zlib-ng.git
shallow = true shallow = true
[submodule "third-party/magic_enum"] [submodule "externals/sdl3"]
path = third-party/magic_enum path = externals/sdl3
url = https://github.com/shadps4-emu/ext-SDL.git
shallow = true
[submodule "externals/fmt"]
path = externals/fmt
url = https://github.com/shadps4-emu/ext-fmt.git
shallow = true
[submodule "externals/vulkan-headers"]
path = externals/vulkan-headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
shallow = true
[submodule "externals/vma"]
path = externals/vma
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
shallow = true
[submodule "externals/glslang"]
path = externals/glslang
url = https://github.com/KhronosGroup/glslang.git
shallow = true
[submodule "externals/robin-map"]
path = externals/robin-map
url = https://github.com/Tessil/robin-map.git
shallow = true
[submodule "externals/xbyak"]
path = externals/xbyak
url = https://github.com/herumi/xbyak.git
shallow = true
[submodule "externals/winpthreads"]
path = externals/winpthreads
url = https://github.com/shadps4-emu/winpthreads.git
shallow = true
[submodule "externals/magic_enum"]
path = externals/magic_enum
url = https://github.com/Neargye/magic_enum.git url = https://github.com/Neargye/magic_enum.git
shallow = true shallow = true
[submodule "third-party/zydis"] [submodule "externals/toml11"]
path = third-party/zydis path = externals/toml11
url = https://github.com/ToruNiina/toml11.git
shallow = true
[submodule "externals/zydis"]
path = externals/zydis
url = https://github.com/zyantific/zydis.git url = https://github.com/zyantific/zydis.git
shallow = true shallow = true
[submodule "third-party/winpthread"] [submodule "externals/sirit"]
path = third-party/winpthread path = externals/sirit
url = https://github.com/shadps4/winpthread.git url = https://github.com/shadps4-emu/sirit.git
branch = main shallow = true
[submodule "third-party/discord-rpc"] [submodule "externals/xxhash"]
path = third-party/discord-rpc path = externals/xxhash
url = https://github.com/discord/discord-rpc
[submodule "third-party/toml11"]
path = third-party/toml11
url = https://github.com/ToruNiina/toml11
branch = master
[submodule "third-party/vulkan"]
path = third-party/vulkan
url = https://github.com/shadps4/vulkan.git
branch = main
[submodule "third-party/xxHash"]
path = third-party/xxHash
url = https://github.com/Cyan4973/xxHash.git url = https://github.com/Cyan4973/xxHash.git
branch = dev shallow = true
[submodule "externals/tracy"]
path = externals/tracy
url = https://github.com/shadps4-emu/tracy.git
shallow = true
[submodule "externals/ext-boost"]
path = externals/ext-boost
url = https://github.com/shadps4-emu/ext-boost.git
shallow = true
[submodule "externals/date"]
path = externals/date
url = https://github.com/HowardHinnant/date.git
shallow = true
[submodule "externals/ffmpeg-core"]
path = externals/ffmpeg-core
url = https://github.com/shadps4-emu/ext-ffmpeg-core.git
shallow = true
[submodule "externals/half"]
path = externals/half
url = https://github.com/ROCm/half.git

60
.reuse/dep5 Normal file
View File

@ -0,0 +1,60 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Comment: It is best to use this file to record copyright information about
generated, binary and third party files
Files: CMakeSettings.json
.github/shadps4.desktop
.github/shadps4.png
.gitmodules
documents/changelog.txt
documents/readme.txt
documents/Quickstart/1.png
documents/Quickstart/2.png
documents/Screenshots/Bloodborne.png
documents/Screenshots/Sonic Mania.png
documents/Screenshots/Undertale.png
documents/Screenshots/We are DOOMED.png
scripts/ps4_names.txt
src/images/about_icon.png
src/images/controller_icon.png
src/images/exit_icon.png
src/images/file_icon.png
src/images/flag_china.png
src/images/flag_eu.png
src/images/flag_jp.png
src/images/flag_unk.png
src/images/flag_us.png
src/images/flag_world.png
src/images/folder_icon.png
src/images/grid_icon.png
src/images/iconsize_icon.png
src/images/list_icon.png
src/images/list_mode_icon.png
src/images/pause_icon.png
src/images/play_icon.png
src/images/refresh_icon.png
src/images/settings_icon.png
src/images/stop_icon.png
src/images/shadPS4.icns
src/images/shadps4.ico
src/images/themes_icon.png
src/shadps4.qrc
src/shadps4.rc
Copyright: shadPS4 Emulator Project
License: GPL-2.0-or-later
Files: externals/cmake-modules/*
Copyright: 2009-2010 Iowa State University
License: BSL-1.0
Files: externals/renderdoc/*
Copyright: 2019-2024 Baldur Karlsson
License: MIT
Files: externals/stb_image.h
Copyright: 2017 Sean Barrett
License: MIT
Files: externals/tracy/*
Copyright: 2017-2024 Bartosz Taudul <wolf@nereid.pl>
License: BSD-3-Clause

View File

@ -1,112 +1,727 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
cmake_minimum_required(VERSION 3.16.3) cmake_minimum_required(VERSION 3.16.3)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_STANDARD_REQUIRED True)
if(APPLE)
enable_language(OBJC)
set(CMAKE_OSX_DEPLOYMENT_TARGET 11)
endif()
if (NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
endif() endif()
project(shadps4) project(shadPS4)
include_directories(third-party/) option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
include_directories(third-party/discord-rpc/include)
include_directories(third-party/imgui/) # This function should be passed a list of all files in a target. It will automatically generate file groups
include_directories(third-party/imgui/backends) # following the directory hierarchy, so that the layout of the files in IDEs matches the one in the filesystem.
include_directories(third-party/sdl/) function(create_target_directory_groups target_name)
include_directories(third-party/fmt/include)
include_directories(third-party/magic_enum/include) # Place any files that aren't in the source list in a separate group so that they don't get in the way.
include_directories(third-party/zydis/include/Zydis) source_group("Other Files" REGULAR_EXPRESSION ".")
include_directories(third-party/winpthread/include)
include_directories(third-party/vulkan/include) get_target_property(target_sources "${target_name}" SOURCES)
include_directories(third-party/xxhash/include)
include_directories(third-party/result/include) foreach(file_name IN LISTS target_sources)
add_subdirectory("third-party") get_filename_component(dir_name "${file_name}" PATH)
#=================== EXAMPLE =================== # Group names use '\' as a separator even though the entire rest of CMake uses '/'...
string(REPLACE "/" "\\" group_name "${dir_name}")
source_group("${group_name}" FILES "${file_name}")
endforeach()
endfunction()
# Setup a custom clang-format target (if clang-format can be found) that will run
# against all the src files. This should be used before making a pull request.
if (CLANG_FORMAT)
set(SRCS ${PROJECT_SOURCE_DIR}/src)
set(CCOMMENT "Running clang format against all the .h and .cpp files in src/")
if (WIN32)
add_custom_target(clang-format
COMMAND powershell.exe -Command "Get-ChildItem '${SRCS}/*' -Include *.cpp,*.h,*.mm -Recurse | Foreach {&'${CLANG_FORMAT}' -i $_.fullname}"
COMMENT ${CCOMMENT})
else()
add_custom_target(clang-format
COMMAND find ${SRCS} -iname *.h -o -iname *.cpp -o -iname *.mm | xargs ${CLANG_FORMAT} -i
COMMENT ${CCOMMENT})
endif()
unset(SRCS)
unset(CCOMMENT)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# generate git revision information
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules/")
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REF_SPEC GIT_REV)
git_describe(GIT_DESC --always --long --dirty)
git_branch_name(GIT_BRANCH)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp" @ONLY)
find_package(Boost 1.84.0 CONFIG)
find_package(FFmpeg 5.1.2 MODULE)
find_package(fmt 10.2.0 CONFIG)
find_package(glslang 14.2.0 CONFIG)
find_package(magic_enum 0.9.6 CONFIG)
find_package(RenderDoc 1.6.0 MODULE)
find_package(SDL3 3.1.2 CONFIG)
find_package(toml11 4.2.0 CONFIG)
find_package(tsl-robin-map 1.3.0 CONFIG)
find_package(VulkanHeaders 1.3.289 CONFIG)
find_package(VulkanMemoryAllocator 3.1.0 CONFIG)
find_package(xbyak 7.07 CONFIG)
find_package(xxHash 0.8.2 MODULE)
find_package(zlib-ng 2.1.7 MODULE)
find_package(Zydis 5.0.0 CONFIG)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR NOT MSVC)
find_package(cryptopp 8.9.0 MODULE)
endif()
if (APPLE)
find_package(date 3.0.1 CONFIG)
endif()
# Note: Windows always has these functions through winpthreads
include(CheckSymbolExists)
check_symbol_exists(pthread_mutex_timedlock "pthread.h" HAVE_PTHREAD_MUTEX_TIMEDLOCK)
if(HAVE_PTHREAD_MUTEX_TIMEDLOCK OR WIN32)
add_compile_options(-DHAVE_PTHREAD_MUTEX_TIMEDLOCK)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
# libc++ requires -fexperimental-library to enable std::jthread and std::stop_token support.
include(CheckCXXSymbolExists)
check_cxx_symbol_exists(_LIBCPP_VERSION version LIBCPP)
if(LIBCPP)
add_compile_options(-fexperimental-library)
endif()
endif()
add_subdirectory(externals)
include_directories(src) include_directories(src)
set(LIBC_SOURCES src/Emulator/HLE/Libraries/LibC/Libc.cpp if(ENABLE_QT_GUI)
src/Emulator/HLE/Libraries/LibC/Libc.h find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent LinguistTools Network)
src/Emulator/HLE/Libraries/LibC/printf.h qt_standard_project_setup()
src/Emulator/HLE/Libraries/LibC/va_ctx.h set(CMAKE_AUTORCC ON)
src/Emulator/HLE/Libraries/LibC/libc_cxa.cpp set(CMAKE_AUTOMOC ON)
src/Emulator/HLE/Libraries/LibC/libc_cxa.h set(CMAKE_AUTOUIC ON)
)
set(USERSERVICE_SOURCES src/Emulator/HLE/Libraries/LibUserService/user_service.cpp set(QT_TRANSLATIONS "${PROJECT_SOURCE_DIR}/src/qt_gui/translations")
src/Emulator/HLE/Libraries/LibUserService/user_service.h file(GLOB_RECURSE TRANSLATIONS_TS ${QT_TRANSLATIONS}/*.ts)
set_source_files_properties(${TRANSLATIONS_TS} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/translations")
qt_add_translation(TRANSLATIONS_QM ${TRANSLATIONS_TS})
set(TRANSLATIONS_QRC ${CMAKE_CURRENT_BINARY_DIR}/translations/translations.qrc)
file(WRITE ${TRANSLATIONS_QRC} "<RCC><qresource prefix=\"translations\">\n")
foreach (QM ${TRANSLATIONS_QM})
get_filename_component(QM_FILE ${QM} NAME)
file(APPEND ${TRANSLATIONS_QRC} "<file>${QM_FILE}</file>\n")
endforeach (QM)
file(APPEND ${TRANSLATIONS_QRC} "</qresource></RCC>")
qt_add_resources(TRANSLATIONS ${TRANSLATIONS_QRC})
endif()
set(AUDIO_CORE src/audio_core/sdl_audio.cpp
src/audio_core/sdl_audio.h
) )
set(PAD_SOURCES src/Emulator/HLE/Libraries/LibPad/pad.cpp set(AUDIO_LIB src/core/libraries/audio/audioin.cpp
src/Emulator/HLE/Libraries/LibPad/pad.h src/core/libraries/audio/audioin.h
src/core/libraries/audio/audioout.cpp
src/core/libraries/audio/audioout.h
src/core/libraries/ajm/ajm.cpp
src/core/libraries/ajm/ajm.h
src/core/libraries/ngs2/ngs2.cpp
src/core/libraries/ngs2/ngs2.h
) )
set(SYSTEMSERVICE_SOURCES src/Emulator/HLE/Libraries/LibSystemService/system_service.cpp set(GNM_LIB src/core/libraries/gnmdriver/gnmdriver.cpp
src/Emulator/HLE/Libraries/LibSystemService/system_service.h src/core/libraries/gnmdriver/gnmdriver.h
src/core/libraries/gnmdriver/gnm_error.h
) )
set(FILESYSTEM_SOURCES src/Emulator/HLE/Libraries/LibKernel/FileSystem/file_system.cpp set(KERNEL_LIB
src/Emulator/HLE/Libraries/LibKernel/FileSystem/file_system.h src/core/libraries/kernel/event_flag/event_flag.cpp
src/Emulator/HLE/Libraries/LibKernel/FileSystem/posix_file_system.cpp src/core/libraries/kernel/event_flag/event_flag.h
src/Emulator/HLE/Libraries/LibKernel/FileSystem/posix_file_system.h src/core/libraries/kernel/event_flag/event_flag_obj.cpp
src/core/libraries/kernel/event_flag/event_flag_obj.h
src/core/libraries/kernel/threads/rwlock.cpp
src/core/libraries/kernel/threads/semaphore.cpp
src/core/libraries/kernel/threads/keys.cpp
src/core/libraries/kernel/threads/threads.h
src/core/libraries/kernel/cpu_management.cpp
src/core/libraries/kernel/cpu_management.h
src/core/libraries/kernel/event_queue.cpp
src/core/libraries/kernel/event_queue.h
src/core/libraries/kernel/event_queues.cpp
src/core/libraries/kernel/event_queues.h
src/core/libraries/kernel/file_system.cpp
src/core/libraries/kernel/file_system.h
src/core/libraries/kernel/libkernel.cpp
src/core/libraries/kernel/libkernel.h
src/core/libraries/kernel/memory_management.cpp
src/core/libraries/kernel/memory_management.h
src/core/libraries/kernel/thread_management.cpp
src/core/libraries/kernel/thread_management.h
src/core/libraries/kernel/time_management.cpp
src/core/libraries/kernel/time_management.h
) )
set(HOST_SOURCES src/Emulator/Host/controller.cpp set(NETWORK_LIBS src/core/libraries/network/http.cpp
src/Emulator/Host/controller.h src/core/libraries/network/http.h
src/core/libraries/network/net.cpp
src/core/libraries/network/netctl.cpp
src/core/libraries/network/netctl.h
src/core/libraries/network/net.h
src/core/libraries/network/ssl.cpp
src/core/libraries/network/ssl.h
) )
set(UTIL_SOURCES src/Emulator/Util/singleton.h set(SYSTEM_LIBS src/core/libraries/system/commondialog.cpp
src/core/libraries/system/commondialog.h
src/core/libraries/system/msgdialog.cpp
src/core/libraries/system/msgdialog.h
src/core/libraries/system/posix.cpp
src/core/libraries/system/posix.h
src/core/libraries/save_data/error_codes.h
src/core/libraries/save_data/savedata.cpp
src/core/libraries/save_data/savedata.h
src/core/libraries/system/savedatadialog.cpp
src/core/libraries/system/savedatadialog.h
src/core/libraries/system/sysmodule.cpp
src/core/libraries/system/sysmodule.h
src/core/libraries/system/systemservice.cpp
src/core/libraries/system/systemservice.h
src/core/libraries/system/userservice.cpp
src/core/libraries/system/userservice.h
src/core/libraries/app_content/app_content.cpp
src/core/libraries/app_content/app_content.h
src/core/libraries/rtc/rtc.cpp
src/core/libraries/rtc/rtc.h
src/core/libraries/rtc/rtc_error.h
src/core/libraries/disc_map/disc_map.cpp
src/core/libraries/disc_map/disc_map.h
src/core/libraries/disc_map/disc_map_codes.h
src/core/libraries/avplayer/avplayer_common.cpp
src/core/libraries/avplayer/avplayer_common.h
src/core/libraries/avplayer/avplayer_file_streamer.cpp
src/core/libraries/avplayer/avplayer_file_streamer.h
src/core/libraries/avplayer/avplayer_impl.cpp
src/core/libraries/avplayer/avplayer_impl.h
src/core/libraries/avplayer/avplayer_source.cpp
src/core/libraries/avplayer/avplayer_source.h
src/core/libraries/avplayer/avplayer_state.cpp
src/core/libraries/avplayer/avplayer_state.h
src/core/libraries/avplayer/avplayer.cpp
src/core/libraries/avplayer/avplayer.h
src/core/libraries/ngs2/ngs2.cpp
src/core/libraries/ngs2/ngs2.h
src/core/libraries/ngs2/ngs2_error.h
src/core/libraries/ngs2/ngs2_impl.cpp
src/core/libraries/ngs2/ngs2_impl.h
src/core/libraries/ajm/ajm_error.h
) )
add_executable(shadps4 set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h
src/core/libraries/videoout/driver.cpp
src/core/libraries/videoout/driver.h
src/core/libraries/videoout/video_out.cpp
src/core/libraries/videoout/video_out.h
)
set(LIBC_SOURCES src/core/libraries/libc_internal/libc_internal.cpp
src/core/libraries/libc_internal/libc_internal.h
)
set(DIALOGS_LIB src/core/libraries/dialogs/error_dialog.cpp
src/core/libraries/dialogs/error_dialog.h
src/core/libraries/dialogs/ime_dialog.cpp
src/core/libraries/dialogs/ime_dialog.h
src/core/libraries/dialogs/error_codes.h
)
set(PAD_LIB src/core/libraries/pad/pad.cpp
src/core/libraries/pad/pad.h
)
set(PNG_LIB src/core/libraries/libpng/pngdec.cpp
src/core/libraries/libpng/pngdec.h
)
set(PLAYGO_LIB src/core/libraries/playgo/playgo.cpp
src/core/libraries/playgo/playgo.h
src/core/libraries/playgo/playgo_types.h
)
set(RANDOM_LIB src/core/libraries/random/random.cpp
src/core/libraries/random/random.h
src/core/libraries/random/random_error.h
)
set(USBD_LIB src/core/libraries/usbd/usbd.cpp
src/core/libraries/usbd/usbd.h
)
set(NP_LIBS src/core/libraries/np_manager/np_manager.cpp
src/core/libraries/np_manager/np_manager.h
src/core/libraries/np_score/np_score.cpp
src/core/libraries/np_score/np_score.h
src/core/libraries/np_trophy/np_trophy.cpp
src/core/libraries/np_trophy/np_trophy.h
)
set(MISC_LIBS src/core/libraries/screenshot/screenshot.cpp
src/core/libraries/screenshot/screenshot.h
)
set(COMMON src/common/logging/backend.cpp
src/common/logging/backend.h
src/common/logging/filter.cpp
src/common/logging/filter.h
src/common/logging/formatter.h
src/common/logging/log_entry.h
src/common/logging/log.h
src/common/logging/text_formatter.cpp
src/common/logging/text_formatter.h
src/common/logging/types.h
src/common/alignment.h
src/common/assert.cpp
src/common/assert.h
src/common/bit_field.h
src/common/bounded_threadsafe_queue.h
src/common/concepts.h
src/common/config.cpp
src/common/config.h
src/common/debug.h
src/common/disassembler.cpp
src/common/disassembler.h
src/common/endian.h
src/common/enum.h
src/common/io_file.cpp
src/common/io_file.h
src/common/error.cpp
src/common/error.h
src/common/scope_exit.h
src/common/func_traits.h
src/common/native_clock.cpp
src/common/native_clock.h
src/common/path_util.cpp
src/common/path_util.h
src/common/object_pool.h
src/common/polyfill_thread.h
src/common/rdtsc.cpp
src/common/rdtsc.h
src/common/singleton.h
src/common/slot_vector.h
src/common/string_util.cpp
src/common/string_util.h
src/common/thread.cpp
src/common/thread.h
src/common/types.h
src/common/uint128.h
src/common/unique_function.h
src/common/version.h
src/common/ntapi.h
src/common/ntapi.cpp
src/common/scm_rev.cpp
src/common/scm_rev.h
)
set(CORE src/core/aerolib/stubs.cpp
src/core/aerolib/stubs.h
src/core/aerolib/aerolib.cpp
src/core/aerolib/aerolib.h
src/core/address_space.cpp
src/core/address_space.h
src/core/cpu_patches.cpp
src/core/cpu_patches.h
src/core/crypto/crypto.cpp
src/core/crypto/crypto.h
src/core/crypto/keys.h
src/core/file_format/pfs.h
src/core/file_format/pkg.cpp
src/core/file_format/pkg.h
src/core/file_format/pkg_type.cpp
src/core/file_format/pkg_type.h
src/core/file_format/psf.cpp
src/core/file_format/psf.h
src/core/file_format/playgo_chunk.cpp
src/core/file_format/playgo_chunk.h
src/core/file_format/trp.cpp
src/core/file_format/trp.h
src/core/file_format/splash.h
src/core/file_format/splash.cpp
src/core/file_sys/fs.cpp
src/core/file_sys/fs.h
src/core/loader.cpp
src/core/loader.h
src/core/loader/dwarf.cpp
src/core/loader/dwarf.h
src/core/loader/elf.cpp
src/core/loader/elf.h
src/core/loader/symbols_resolver.h
src/core/loader/symbols_resolver.cpp
src/core/libraries/error_codes.h
src/core/libraries/libs.h
src/core/libraries/libs.cpp
${AUDIO_LIB}
${GNM_LIB}
${KERNEL_LIB}
${NETWORK_LIBS}
${SYSTEM_LIBS}
${LIBC_SOURCES} ${LIBC_SOURCES}
${USERSERVICE_SOURCES} ${PAD_LIB}
${PAD_SOURCES} ${VIDEOOUT_LIB}
${SYSTEMSERVICE_SOURCES} ${NP_LIBS}
${FILESYSTEM_SOURCES} ${PNG_LIB}
${HOST_SOURCES} ${PLAYGO_LIB}
${UTIL_SOURCES} ${RANDOM_LIB}
${USBD_LIB}
${MISC_LIBS}
${DIALOGS_LIB}
src/core/linker.cpp
src/core/linker.h
src/core/memory.cpp
src/core/memory.h
src/core/module.cpp
src/core/module.h
src/core/platform.h
src/core/tls.cpp
src/core/tls.h
src/core/virtual_memory.cpp
src/core/virtual_memory.h
)
set(SHADER_RECOMPILER src/shader_recompiler/exception.h
src/shader_recompiler/profile.h
src/shader_recompiler/recompiler.cpp
src/shader_recompiler/recompiler.h
src/shader_recompiler/runtime_info.h
src/shader_recompiler/backend/spirv/emit_spirv.cpp
src/shader_recompiler/backend/spirv/emit_spirv.h
src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp
src/shader_recompiler/backend/spirv/emit_spirv_barriers.cpp
src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp
src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp
src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp
src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp
src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
src/shader_recompiler/backend/spirv/emit_spirv_instructions.h
src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp
src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp
src/shader_recompiler/backend/spirv/emit_spirv_select.cpp
src/shader_recompiler/backend/spirv/emit_spirv_shared_memory.cpp
src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp
src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
src/shader_recompiler/backend/spirv/spirv_emit_context.h
src/shader_recompiler/frontend/translate/data_share.cpp
src/shader_recompiler/frontend/translate/export.cpp
src/shader_recompiler/frontend/translate/scalar_alu.cpp
src/shader_recompiler/frontend/translate/scalar_memory.cpp
src/shader_recompiler/frontend/translate/translate.cpp
src/shader_recompiler/frontend/translate/translate.h
src/shader_recompiler/frontend/translate/vector_alu.cpp
src/shader_recompiler/frontend/translate/vector_interpolation.cpp
src/shader_recompiler/frontend/translate/vector_memory.cpp
src/shader_recompiler/frontend/control_flow_graph.cpp
src/shader_recompiler/frontend/control_flow_graph.h
src/shader_recompiler/frontend/decode.cpp
src/shader_recompiler/frontend/decode.h
src/shader_recompiler/frontend/fetch_shader.cpp
src/shader_recompiler/frontend/fetch_shader.h
src/shader_recompiler/frontend/format.cpp
src/shader_recompiler/frontend/instruction.cpp
src/shader_recompiler/frontend/instruction.h
src/shader_recompiler/frontend/opcodes.h
src/shader_recompiler/frontend/structured_control_flow.cpp
src/shader_recompiler/frontend/structured_control_flow.h
src/shader_recompiler/ir/passes/constant_propagation_pass.cpp
src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp
src/shader_recompiler/ir/passes/identity_removal_pass.cpp
src/shader_recompiler/ir/passes/ir_passes.h
src/shader_recompiler/ir/passes/lower_shared_mem_to_registers.cpp
src/shader_recompiler/ir/passes/resource_tracking_pass.cpp
src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp
src/shader_recompiler/ir/passes/ssa_rewrite_pass.cpp
src/shader_recompiler/ir/abstract_syntax_list.h
src/shader_recompiler/ir/attribute.cpp
src/shader_recompiler/ir/attribute.h
src/shader_recompiler/ir/basic_block.cpp
src/shader_recompiler/ir/basic_block.h
src/shader_recompiler/ir/condition.h
src/shader_recompiler/ir/ir_emitter.cpp
src/shader_recompiler/ir/ir_emitter.h
src/shader_recompiler/ir/microinstruction.cpp
src/shader_recompiler/ir/opcodes.cpp
src/shader_recompiler/ir/opcodes.h
src/shader_recompiler/ir/opcodes.inc
src/shader_recompiler/ir/post_order.cpp
src/shader_recompiler/ir/post_order.h
src/shader_recompiler/ir/program.cpp
src/shader_recompiler/ir/program.h
src/shader_recompiler/ir/reg.h
src/shader_recompiler/ir/type.cpp
src/shader_recompiler/ir/type.h
src/shader_recompiler/ir/value.cpp
src/shader_recompiler/ir/value.h
)
set(VIDEO_CORE src/video_core/amdgpu/liverpool.cpp
src/video_core/amdgpu/liverpool.h
src/video_core/amdgpu/pixel_format.cpp
src/video_core/amdgpu/pixel_format.h
src/video_core/amdgpu/pm4_cmds.h
src/video_core/amdgpu/pm4_opcodes.h
src/video_core/amdgpu/resource.h
src/video_core/amdgpu/default_context.cpp
src/video_core/buffer_cache/buffer.cpp
src/video_core/buffer_cache/buffer.h
src/video_core/buffer_cache/buffer_cache.cpp
src/video_core/buffer_cache/buffer_cache.h
src/video_core/buffer_cache/memory_tracker_base.h
src/video_core/buffer_cache/range_set.h
src/video_core/buffer_cache/word_manager.h
src/video_core/renderer_vulkan/liverpool_to_vk.cpp
src/video_core/renderer_vulkan/liverpool_to_vk.h
src/video_core/renderer_vulkan/renderer_vulkan.cpp
src/video_core/renderer_vulkan/renderer_vulkan.h
src/video_core/renderer_vulkan/vk_common.cpp
src/video_core/renderer_vulkan/vk_common.h
src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
src/video_core/renderer_vulkan/vk_compute_pipeline.h
src/video_core/renderer_vulkan/vk_descriptor_update_queue.cpp
src/video_core/renderer_vulkan/vk_descriptor_update_queue.h
src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
src/video_core/renderer_vulkan/vk_graphics_pipeline.h
src/video_core/renderer_vulkan/vk_instance.cpp
src/video_core/renderer_vulkan/vk_instance.h
src/video_core/renderer_vulkan/vk_master_semaphore.cpp
src/video_core/renderer_vulkan/vk_master_semaphore.h
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
src/video_core/renderer_vulkan/vk_pipeline_cache.h
src/video_core/renderer_vulkan/vk_platform.cpp
src/video_core/renderer_vulkan/vk_platform.h
src/video_core/renderer_vulkan/vk_rasterizer.cpp
src/video_core/renderer_vulkan/vk_rasterizer.h
src/video_core/renderer_vulkan/vk_resource_pool.cpp
src/video_core/renderer_vulkan/vk_resource_pool.h
src/video_core/renderer_vulkan/vk_scheduler.cpp
src/video_core/renderer_vulkan/vk_scheduler.h
src/video_core/renderer_vulkan/vk_shader_cache.cpp
src/video_core/renderer_vulkan/vk_shader_cache.h
src/video_core/renderer_vulkan/vk_shader_util.cpp
src/video_core/renderer_vulkan/vk_shader_util.h
src/video_core/renderer_vulkan/vk_swapchain.cpp
src/video_core/renderer_vulkan/vk_swapchain.h
src/video_core/texture_cache/image.cpp
src/video_core/texture_cache/image.h
src/video_core/texture_cache/image_info.cpp
src/video_core/texture_cache/image_info.h
src/video_core/texture_cache/image_view.cpp
src/video_core/texture_cache/image_view.h
src/video_core/texture_cache/sampler.cpp
src/video_core/texture_cache/sampler.h
src/video_core/texture_cache/texture_cache.cpp
src/video_core/texture_cache/texture_cache.h
src/video_core/texture_cache/tile_manager.cpp
src/video_core/texture_cache/tile_manager.h
src/video_core/texture_cache/types.h
src/video_core/page_manager.cpp
src/video_core/page_manager.h
src/video_core/multi_level_page_table.h
src/video_core/renderdoc.cpp
src/video_core/renderdoc.h
)
set(INPUT src/input/controller.cpp
src/input/controller.h
)
set(EMULATOR src/emulator.cpp
src/emulator.h
src/sdl_window.h
src/sdl_window.cpp
)
# The above is shared in SDL and Qt version (TODO share them all)
if(ENABLE_QT_GUI)
qt_add_resources(RESOURCE_FILES src/shadps4.qrc)
set(QT_GUI src/qt_gui/about_dialog.cpp
src/qt_gui/about_dialog.h
src/qt_gui/about_dialog.ui
src/qt_gui/cheats_patches.cpp
src/qt_gui/cheats_patches.h
src/qt_gui/memory_patcher.cpp
src/qt_gui/memory_patcher.h
src/qt_gui/main_window_ui.h
src/qt_gui/main_window.cpp
src/qt_gui/main_window.h
src/qt_gui/gui_context_menus.h
src/qt_gui/game_list_utils.h
src/qt_gui/game_info.cpp
src/qt_gui/game_info.h
src/qt_gui/game_list_frame.cpp
src/qt_gui/game_list_frame.h
src/qt_gui/game_grid_frame.cpp
src/qt_gui/game_grid_frame.h
src/qt_gui/game_install_dialog.cpp
src/qt_gui/game_install_dialog.h
src/qt_gui/pkg_viewer.cpp
src/qt_gui/pkg_viewer.h
src/qt_gui/trophy_viewer.cpp
src/qt_gui/trophy_viewer.h
src/qt_gui/elf_viewer.cpp
src/qt_gui/elf_viewer.h
src/qt_gui/main_window_themes.cpp
src/qt_gui/main_window_themes.h
src/qt_gui/settings_dialog.cpp
src/qt_gui/settings_dialog.h
src/qt_gui/settings_dialog.ui
src/qt_gui/main.cpp
${EMULATOR}
${RESOURCE_FILES}
${TRANSLATIONS}
)
endif()
if (ENABLE_QT_GUI)
qt_add_executable(shadps4
${AUDIO_CORE}
${INPUT}
${QT_GUI}
${COMMON}
${CORE}
${SHADER_RECOMPILER}
${VIDEO_CORE}
${EMULATOR}
src/images/shadPS4.icns
)
else()
add_executable(shadps4
${AUDIO_CORE}
${INPUT}
${COMMON}
${CORE}
${SHADER_RECOMPILER}
${VIDEO_CORE}
${EMULATOR}
src/main.cpp src/main.cpp
src/types.h src/emulator.cpp
src/Core/FsFile.cpp src/emulator.h
src/Core/FsFile.h src/sdl_window.h
src/Core/PS4/Loader/Elf.cpp src/sdl_window.cpp
src/Core/PS4/Loader/Elf.h )
src/GUI/ElfViewer.cpp endif()
src/GUI/ElfViewer.h
src/Util/log.h
src/Util/log.cpp
src/Util/config.cpp
src/Util/config.h
src/Core/virtual_memory.cpp
src/Core/virtual_memory.h
src/Core/PS4/Linker.cpp
src/Core/PS4/Linker.h
src/Core/PS4/Stubs.cpp
src/Core/PS4/Stubs.h
src/Core/PS4/Util/aerolib.cpp
src/Lib/Threads.cpp
src/Lib/Threads.h
src/Core/PS4/HLE/Kernel/Objects/physical_memory.h
src/Core/PS4/HLE/Kernel/Objects/physical_memory.cpp
src/Util/string_util.cpp
src/Util/string_util.cpp
src/Core/PS4/HLE/Graphics/video_out.cpp
src/Core/PS4/HLE/Graphics/video_out.h
src/discord.h
src/discord.cpp
src/Core/PS4/HLE/Kernel/event_queues.cpp
src/Core/PS4/HLE/Kernel/event_queues.h
src/Core/PS4/HLE/Kernel/cpu_management.cpp
src/Core/PS4/HLE/Kernel/cpu_management.h
"src/Util/Disassembler.cpp" "src/Util/Disassembler.h" "src/Core/PS4/Util/aerolib.h" "src/Core/PS4/Loader/SymbolsResolver.h" "src/Core/PS4/Loader/SymbolsResolver.cpp" "src/Core/PS4/HLE/Libs.cpp" "src/Core/PS4/HLE/Libs.h" "src/Core/PS4/HLE/LibC.cpp" "src/Core/PS4/HLE/LibC.h" "src/Lib/Timer.cpp" "src/Lib/Timer.h" "src/Core/PS4/HLE/LibKernel.cpp" "src/Core/PS4/HLE/LibKernel.h" "src/Core/PS4/HLE/LibSceGnmDriver.cpp" "src/Core/PS4/HLE/LibSceGnmDriver.h" "src/Core/PS4/HLE/Kernel/ThreadManagement.cpp" "src/Core/PS4/HLE/Kernel/ThreadManagement.h" "src/Core/PS4/HLE/ErrorCodes.h" "src/debug.h" "src/Core/PS4/HLE/Kernel/memory_management.cpp" "src/Core/PS4/HLE/Kernel/memory_management.h" "src/Core/PS4/GPU/gpu_memory.cpp" "src/Core/PS4/GPU/gpu_memory.h" "src/emulator.cpp" "src/emulator.h" "src/Core/PS4/HLE/Kernel/Objects/event_queue.h" "src/Core/PS4/HLE/Kernel/Objects/event_queue.cpp" "src/Core/PS4/HLE/Graphics/Objects/video_out_ctx.cpp" "src/Core/PS4/HLE/Graphics/Objects/video_out_ctx.h" "src/Core/PS4/HLE/Graphics/graphics_ctx.h" "src/vulkan_util.cpp" "src/vulkan_util.h" "src/Core/PS4/GPU/video_out_buffer.cpp" "src/Core/PS4/GPU/video_out_buffer.h" "src/Core/PS4/HLE/Graphics/graphics_render.cpp" "src/Core/PS4/HLE/Graphics/graphics_render.h" "src/Core/PS4/GPU/tile_manager.cpp" "src/Core/PS4/GPU/tile_manager.h" "src/version.h" "src/Emulator/HLE/Libraries/LibSystemService/system_service.cpp" "src/Emulator/HLE/Libraries/LibSystemService/system_service.h" "src/Emulator/HLE/Libraries/LibKernel/FileSystem/meta_file_system.h" "src/Emulator/HLE/Libraries/LibKernel/FileSystem/meta_file_system.cpp") create_target_directory_groups(shadps4)
find_package(OpenGL REQUIRED) target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient RenderDoc::API FFmpeg::ffmpeg)
target_link_libraries(shadps4 PUBLIC fmt mincore spdlog IMGUI SDL3-shared ${OPENGL_LIBRARY} vulkan-1 spirv-tools-opt spirv-tools) target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::SPIRV glslang::glslang SDL3::SDL3)
add_custom_command(TARGET shadps4 POST_BUILD if (APPLE)
COMMAND ${CMAKE_COMMAND} -E copy_if_different # Reserve system-managed memory space.
$<TARGET_FILE:SDL3-shared> target_link_options(shadps4 PRIVATE -Wl,-no_pie,-no_fixup_chains,-no_huge,-pagezero_size,0x400000,-segaddr,GUEST_SYSTEM,0x400000,-image_base,0x10000000000)
$<TARGET_FILE_DIR:shadps4>)
add_custom_command(TARGET shadps4 POST_BUILD # Link MoltenVK for Vulkan support
COMMAND ${CMAKE_COMMAND} -E copy_if_different find_library(MOLTENVK MoltenVK REQUIRED)
"${PROJECT_SOURCE_DIR}/third-party/winpthread/bin/libwinpthread-1.dll" $<TARGET_FILE_DIR:shadps4>) target_link_libraries(shadps4 PRIVATE ${MOLTENVK})
# Replacement for std::chrono::time_zone
target_link_libraries(shadps4 PRIVATE date::date-tz)
# Half float conversions for F16C patches
target_link_libraries(shadps4 PRIVATE half)
endif()
if (NOT ENABLE_QT_GUI)
target_link_libraries(shadps4 PRIVATE SDL3::SDL3)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND MSVC)
target_link_libraries(shadps4 PRIVATE cryptoppwin zlib-ng::zlib)
else()
target_link_libraries(shadps4 PRIVATE cryptopp::cryptopp zlib-ng::zlib)
endif()
if (ENABLE_QT_GUI)
target_link_libraries(shadps4 PRIVATE Qt6::Widgets Qt6::Concurrent Qt6::Network)
add_definitions(-DENABLE_QT_GUI)
endif()
if (WIN32)
target_link_libraries(shadps4 PRIVATE mincore winpthreads)
if (MSVC)
# MSVC likes putting opinions on what people can use, disable:
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
endif()
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
if (MSVC)
# Needed for conflicts with time.h of windows.h
add_definitions(-D_TIMESPEC_DEFINED)
endif()
# Target Windows 10 RS5
add_definitions(-DNTDDI_VERSION=0x0A000006 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00)
if (MSVC)
target_link_libraries(shadps4 PRIVATE clang_rt.builtins-x86_64.lib)
endif()
# Disable ASLR so we can reserve the user area
if (MSVC)
target_link_options(shadps4 PRIVATE /DYNAMICBASE:NO)
else()
target_link_options(shadps4 PRIVATE -Wl,--disable-dynamicbase)
endif()
# Increase stack commit area (Needed, otherwise there are crashes)
if (MSVC)
target_link_options(shadps4 PRIVATE /STACK:0x200000,0x200000)
else()
target_link_options(shadps4 PRIVATE -Wl,--stack,2097152)
endif()
endif()
if (WIN32)
target_sources(shadps4 PRIVATE src/shadps4.rc)
endif()
add_definitions(-DBOOST_ASIO_STANDALONE)
target_include_directories(shadps4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
# Shaders sources
set(HOST_SHADERS_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/src/video_core/host_shaders)
add_subdirectory(${HOST_SHADERS_INCLUDE})
add_dependencies(shadps4 host_shaders)
target_include_directories(shadps4 PRIVATE ${HOST_SHADERS_INCLUDE})
if (ENABLE_QT_GUI)
set_target_properties(shadps4 PROPERTIES
# WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
MACOSX_BUNDLE_ICON_FILE shadPS4.icns)
set_source_files_properties(src/images/shadPS4.icns PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
endif()

View File

@ -1,22 +1,33 @@
{ {
"configurations": [ "configurations": [
{ {
"name": "x64-Clang-Debug", "name": "x64-Clang-Release",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "Debug", "configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}", "buildRoot": "${projectDir}\\Build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}", "installRoot": "${projectDir}\\Install\\${name}",
"cmakeCommandArgs": "", "cmakeCommandArgs": "",
"buildCommandArgs": "", "buildCommandArgs": "",
"ctestCommandArgs": "", "ctestCommandArgs": "",
"inheritEnvironments": [ "clang_cl_x64_x64" ] "inheritEnvironments": [ "clang_cl_x64_x64" ]
}, },
{ {
"name": "x64-Clang-Release", "name": "x64-Clang-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\Build\\${name}",
"installRoot": "${projectDir}\\Install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "clang_cl_x64_x64" ]
},
{
"name": "x64-Clang-RelWithDebInfo",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "RelWithDebInfo", "configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}", "buildRoot": "${projectDir}\\Build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}", "installRoot": "${projectDir}\\Install\\${name}",
"cmakeCommandArgs": "", "cmakeCommandArgs": "",
"buildCommandArgs": "", "buildCommandArgs": "",
"ctestCommandArgs": "", "ctestCommandArgs": "",

128
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,128 @@
<!--
SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
# Style guidelines
## General Rules
* Line width is typically 100 characters. Please do not use 80-characters.
* Don't ever introduce new external dependencies into Core
* Don't use any platform specific code in Core
* Use namespaces often
* Avoid the use of C-style casts and instead prefer C++-style static_cast and reinterpret_cast. Try to avoid using dynamic_cast. Never use const_cast except for when dealing with external const-incorrect APIs.
## Naming Rules
* Functions: `PascalCase`
* Variables: `lower_case_underscored. Prefix with g_ if global.`
* Classes: `PascalCase`
* Files and Directories: `lower_case_underscored`
* Namespaces: `PascalCase`, `_` may also be used for clarity (e.g. `ARM_InitCore`)
# Indentation/Whitespace Style
Follow the indentation/whitespace style shown below. Do not use tabs, use 4-spaces instead.
# Comments
* For regular comments, use C++ style (//) comments, even for multi-line ones.
* For doc-comments (Doxygen comments), use /// if it's a single line, else use the /** */ style featured in the example. Start the text on the second line, not the first containing /**.
* For items that are both defined and declared in two separate files, put the doc-comment only next to the associated declaration. (In a header file, usually.) Otherwise, put it next to the implementation. Never duplicate doc-comments in both places.
```c++
// Includes should be sorted lexicographically
// STD includes first
#include <array>
#include <map>
#include <memory>
// then, library includes
#include <nihstro/shared_binary.h>
// finally, shadps4 includes
#include "common/math_util.h"
#include "common/vector_math.h"
// each major module is separated
#include "video_core/pica.h"
#include "video_core/video_core.h"
namespace Example {
// Namespace contents are not indented
// Declare globals at the top (better yet, don't use globals at all!)
int g_foo{}; // {} can be used to initialize types as 0, false, or nullptr
char* g_some_pointer{}; // Pointer * and reference & stick to the type name, and make sure to initialize as nullptr!
/// A colorful enum.
enum class SomeEnum {
Red, ///< The color of fire.
Green, ///< The color of grass.
Blue, ///< Not actually the color of water.
};
/**
* Very important struct that does a lot of stuff.
* Note that the asterisks are indented by one space to align to the first line.
*/
struct Position {
// Always initialize member variables!
int x{};
int y{};
};
// Use "typename" rather than "class" here
template <typename T>
void FooBar() {
const std::string some_string{"prefer uniform initialization"};
const std::array<int, 4> some_array{
5,
25,
7,
42,
};
if (note == the_space_after_the_if) {
CallAFunction();
} else {
// Use a space after the // when commenting
}
// Place a single space after the for loop semicolons, prefer pre-increment
for (int i = 0; i != 25; ++i) {
// This is how we write loops
}
DoStuff(this, function, call, takes, up, multiple,
lines, like, this);
if (this || condition_takes_up_multiple &&
lines && like && this || everything ||
alright || then) {
// Leave a blank space before the if block body if the condition was continued across
// several lines.
}
// No indentation for case labels
switch (var) {
case 1: {
const int case_var{var + 3};
DoSomething(case_var);
break;
}
case 3:
DoSomething(var);
return;
default:
// Yes, even break for the last case
break;
}
}
} // namespace Example
```

11
LICENSES/BSD-3-Clause.txt Normal file
View File

@ -0,0 +1,11 @@
Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

7
LICENSES/BSL-1.0.txt Normal file
View File

@ -0,0 +1,7 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:
The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

121
LICENSES/CC0-1.0.txt Normal file
View File

@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.

View File

@ -0,0 +1,117 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice

9
LICENSES/MIT.txt Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

173
README.md
View File

@ -1,66 +1,163 @@
# shadPS4 <!--
SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
An early PS4 emulator for Windows and Linux written in C++ <h1 align="center">
by shadow , skmp , wheremyfoodat <br>
<a href="https://shadps4.net/"><img src="https://github.com/shadps4-emu/shadPS4/blob/main/.github/shadps4.png" width="220"></a>
<br>
<b>shadPS4</b>
<br>
</h1>
[Check us on twitter](https://twitter.com/shadps4 "Check us on twitter") <h1 align="center">
<a href="https://discord.gg/MyZRaBngxA">
<img src="https://img.shields.io/discord/1080089157554155590?color=5865F2&label=shadPS4 Discord&logo=Discord&logoColor=white" width="240">
<a href="https://github.com/shadps4-emu/shadPS4/releases/latest">
<img src="https://img.shields.io/github/downloads/shadps4-emu/shadPS4/total.svg" width="140">
<a href="https://shadps4.net/">
<img src="https://img.shields.io/badge/shadPS4-website-8A2BE2" width="150">
<a href="https://x.com/shadps4">
<img src="https://img.shields.io/badge/-Join%20us-black?logo=X&logoColor=white" width="100">
<a href="https://github.com/shadps4-emu/shadPS4/stargazers">
<img src="https://img.shields.io/github/stars/shadps4-emu/shadPS4" width="120">
</h1>
<p align="center">
<a href="https://shadps4.net/">
<img src="https://github.com/shadps4-emu/shadPS4/blob/main/documents/Screenshots/Sonic Mania.png" width="400">
<img src="https://github.com/shadps4-emu/shadPS4/blob/main/documents/Screenshots/Bloodborne.png" width="400">
<img src="https://github.com/shadps4-emu/shadPS4/blob/main/documents/Screenshots/Undertale.png" width="400">
<img src="https://github.com/shadps4-emu/shadPS4/blob/main/documents/Screenshots/We are DOOMED.png" width="400">
</p>
# General information
shadPS4 is an early **PlayStation 4** emulator for **Windows**, **Linux** and **macOS** written in C++.
If you encounter problems or have doubts, do not hesitate to look at the [**Quickstart**](https://github.com/shadps4-emu/shadPS4/blob/main/documents/Quickstart/Quickstart.md).
To verify that a game works, you can look at [**shadPS4 Game Compatibility**](https://github.com/shadps4-emu/shadps4-game-compatibility).
To discuss shadPS4 development, suggest ideas or to ask for help, join our [**Discord server**](https://discord.gg/MyZRaBngxA).
To get the latest news, go to our [**X (Twitter)**](https://x.com/shadps4) or our [**website**](https://shadps4.net/).
# Status # Status
Early progress , a small amount of ps4 sdk demos and homebrew games working > [!IMPORTANT]
> shadPS4 is early in developement, don't expect a flawless experience.
![](https://geps.dev/progress/60) Elf Loader Currently, the emulator successfully runs small games like [**Sonic Mania**](https://www.youtube.com/watch?v=AAHoNzhHyCU), [**Undertale**](https://youtu.be/5zIvdy65Ro4) and it can even *somewhat* run [**Bloodborne**](https://www.youtube.com/watch?v=wC6s0avpQRE).
![](https://geps.dev/progress/80) Logging system # Why
![](https://geps.dev/progress/10) Everything else This project began as a fun project. Given our limited free time, it may take some time before shadPS4 can run more complex games, but we're committed to making small, regular updates.
# Why? # Building
The project started as a fun project. Due to short free time, it will probably take a while since it will be able to run something decent, but I am trying to do regular small commits.
# Build
## Windows ## Windows
Check building instructions in [windows build](https://github.com/georgemoralis/shadPS4/blob/main/documents/building-windows.md) Check the build instructions for [**Windows**](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-windows.md).
## Linux ## Linux
Check building instructions in [linux build](https://github.com/georgemoralis/shadPS4/blob/main/documents/linux_building.md) Check the build instructions for [**Linux**](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-linux.md).
## Build status ## Building status
|Platform|Build status| <details>
|--------|------------| <summary><b>Windows</b></summary>
|Windows build|[![Windows](https://github.com/georgemoralis/shadPS4/actions/workflows/windows.yml/badge.svg)](https://github.com/georgemoralis/shadPS4/actions/workflows/windows.yml)
To discuss the development of this emulator, please join our Discord server: [![Discord](https://img.shields.io/discord/1080089157554155590)](https://discord.gg/MyZRaBngxA) | Windows | Build status |
|--------|--------|
|Windows SDL Build|[![Windows-sdl](https://github.com/shadps4-emu/shadPS4/actions/workflows/windows.yml/badge.svg)](https://github.com/shadps4-emu/shadPS4/actions/workflows/windows.yml)
|Windows Qt Build|[![Windows-qt](https://github.com/shadps4-emu/shadPS4/actions/workflows/windows-qt.yml/badge.svg)](https://github.com/shadps4-emu/shadPS4/actions/workflows/windows-qt.yml)
</details>
# Who are you? <details>
<summary><b>Linux</b></summary>
Old emulator fans and devs can recognize me as "shadow". I was the founder and coder for a lot of emulation projects: | Linux | Build status |
* PCSX |--------|--------|
* PCSX2 |Linux SDL Build|[![Linux-sdl](https://github.com/shadps4-emu/shadPS4/actions/workflows/linux.yml/badge.svg)](https://github.com/shadps4-emu/shadPS4/actions/workflows/linux.yml)
* PCSP |Linux Qt Build|[![Linux-qt](https://github.com/shadps4-emu/shadPS4/actions/workflows/linux-qt.yml/badge.svg)](https://github.com/shadps4-emu/shadPS4/actions/workflows/linux-qt.yml)
* JPCSP </details>
* arcadeflex
* rpcs3 contributor
# Contribution <details>
<summary><b>macOS</b></summary>
I currently accept any contribution, here is a list of some items that may be useful: | macOS | Build status |
|--------|--------|
|macOS SDL Build|[![macOS-sdl](https://github.com/shadps4-emu/shadPS4/actions/workflows/macos.yml/badge.svg)](https://github.com/shadps4-emu/shadPS4/actions/workflows/macos.yml)
|macOS Qt Build|[![macOS-qt](https://github.com/shadps4-emu/shadPS4/actions/workflows/macos-qt.yml/badge.svg)](https://github.com/shadps4-emu/shadPS4/actions/workflows/macos-qt.yml)
</details>
* PKG extractor (there was initial work on this, search project history commits). # Debugging and reporting issues
* Initial GUI with imgui, SDL3 and Vulkan.
* to be filled...
# Documentation For more information on how to test, debug and report issues with the emulator or games, read the [Debugging documentation](https://github.com/shadps4-emu/shadPS4/blob/main/documents/Debugging/Debugging.md).
Wiki has some documentation for PS4 PKG format # Keyboard mapping
[PKG PS4 File Format](https://github.com/georgemoralis/shadPS4/wiki/PKG-Information "PKG PS4 File Format") > [!NOTE]
> Xbox and DualShock controllers work out of the box.
| Controller button | Keyboard equivelant |
|-------------|-------------|
LEFT AXIS UP | W |
LEFT AXIS DOWN | S |
LEFT AXIS LEFT | A |
LEFT AXIS RIGHT | D |
RIGHT AXIS UP | I |
RIGHT AXIS DOWN | K |
RIGHT AXIS LEFT | J |
RIGHT AXIS RIGHT | L |
TRIANGLE | Numpad 8 |
CIRCLE | Numpad 6 |
CROSS | Numpad 2 |
SQUARE | Numpad 4 |
PAD UP | UP |
PAD DOWN | DOWN |
PAD LEFT | LEFT |
PAD RIGHT | RIGHT |
OPTIONS | RETURN |
TOUCH PAD | SPACE |
L1 | Q |
R1 | U |
L2 | E |
R2 | O |
L3 | X |
R3 | M |
# Main team
- [**georgemoralis**](https://github.com/georgemoralis)
- [**raphaelthegreat**](https://github.com/raphaelthegreat)
- [**psucien**](https://github.com/psucien)
- [**skmp**](https://github.com/skmp)
- [**wheremyfoodat**](https://github.com/wheremyfoodat)
- [**raziel1000**](https://github.com/raziel1000)
Logo is done by [**Xphalnos**](https://github.com/Xphalnos)
# Contributing
If you want to contribute, please look the [**CONTRIBUTING.md**](https://github.com/shadps4-emu/shadPS4/blob/main/CONTRIBUTING.md) file.
Open a PR and we'll check it :)
# Contributors
<a href="https://github.com/shadps4-emu/shadPS4/graphs/contributors">
<img src="https://contrib.rocks/image?repo=shadps4-emu/shadPS4&max=15">
</a>
# Sister Projects # Sister Projects
- [Panda3DS](https://github.com/wheremyfoodat/Panda3DS): An multiplatform 3DS emulator from our co-author wheremyfoodat
- [hydra](https://github.com/hydra-emu/hydra): An multisystem , multiplatform emulator (chip-8,GB,NES,N64) from Paris - [**Panda3DS**](https://github.com/wheremyfoodat/Panda3DS): A multiplatform 3DS emulator from our co-author wheremyfoodat.
- [**hydra**](https://github.com/hydra-emu/hydra): A multisystem, multiplatform emulator (chip-8, GB, NES, N64) from Paris.
# License
- [**GPL-2.0 license**](https://github.com/shadps4-emu/shadPS4/blob/main/LICENSE)

23
cmake/FindFFmpeg.cmake Normal file
View File

@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
find_package(PkgConfig QUIET)
pkg_check_modules(FFMPEG QUIET IMPORTED_TARGET libavcodec libavfilter libavformat libavutil libswresample libswscale)
find_file(FFMPEG_VERSION_FILE libavutil/ffversion.h HINTS "${FFMPEG_libavutil_INCLUDEDIR}")
if (FFMPEG_VERSION_FILE)
file(STRINGS "${FFMPEG_VERSION_FILE}" FFMPEG_VERSION_LINE REGEX "FFMPEG_VERSION")
string(REGEX MATCH "[0-9.]+" FFMPEG_VERSION "${FFMPEG_VERSION_LINE}")
unset(FFMPEG_VERSION_LINE)
unset(FFMPEG_VERSION_FILE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFmpeg
REQUIRED_VARS FFMPEG_LINK_LIBRARIES
VERSION_VAR FFMPEG_VERSION
)
if (FFmpeg_FOUND AND NOT TARGET FFmpeg::ffmpeg)
add_library(FFmpeg::ffmpeg ALIAS PkgConfig::FFMPEG)
endif()

25
cmake/FindRenderDoc.cmake Normal file
View File

@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
find_path(RENDERDOC_INCLUDE_DIR renderdoc_app.h)
if (RENDERDOC_INCLUDE_DIR AND EXISTS "${RENDERDOC_INCLUDE_DIR}/renderdoc_app.h")
file(STRINGS "${RENDERDOC_INCLUDE_DIR}/renderdoc_app.h" RENDERDOC_VERSION_LINE REGEX "typedef struct RENDERDOC_API")
string(REGEX REPLACE ".*typedef struct RENDERDOC_API_([0-9]+)_([0-9]+)_([0-9]+).*" "\\1.\\2.\\3" RENDERDOC_VERSION "${RENDERDOC_VERSION_LINE}")
unset(RENDERDOC_VERSION_LINE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RenderDoc
REQUIRED_VARS RENDERDOC_INCLUDE_DIR
VERSION_VAR RENDERDOC_VERSION
)
if (RenderDoc_FOUND AND NOT TARGET RenderDoc::API)
add_library(RenderDoc::API INTERFACE IMPORTED)
set_target_properties(RenderDoc::API PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${RENDERDOC_INCLUDE_DIR}"
)
endif()
mark_as_advanced(RENDERDOC_INCLUDE_DIR)

15
cmake/Findcryptopp.cmake Normal file
View File

@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
find_package(PkgConfig QUIET)
pkg_search_module(CRYPTOPP QUIET IMPORTED_TARGET libcryptopp)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cryptopp
REQUIRED_VARS CRYPTOPP_LINK_LIBRARIES
VERSION_VAR CRYPTOPP_VERSION
)
if (cryptopp_FOUND AND NOT TARGET cryptopp::cryptopp)
add_library(cryptopp::cryptopp ALIAS PkgConfig::CRYPTOPP)
endif()

15
cmake/FindxxHash.cmake Normal file
View File

@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
find_package(PkgConfig QUIET)
pkg_search_module(XXHASH QUIET IMPORTED_TARGET libxxhash)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(xxHash
REQUIRED_VARS XXHASH_LINK_LIBRARIES
VERSION_VAR XXHASH_VERSION
)
if (xxHash_FOUND AND NOT TARGET xxHash::xxhash)
add_library(xxHash::xxhash ALIAS PkgConfig::XXHASH)
endif()

15
cmake/Findzlib-ng.cmake Normal file
View File

@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
find_package(PkgConfig QUIET)
pkg_search_module(ZLIB_NG QUIET IMPORTED_TARGET zlib-ng)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(zlib-ng
REQUIRED_VARS ZLIB_NG_LINK_LIBRARIES
VERSION_VAR ZLIB_NG_VERSION
)
if (zlib-ng_FOUND AND NOT TARGET zlib-ng::zlib)
add_library(zlib-ng::zlib ALIAS PkgConfig::ZLIB_NG)
endif()

View File

@ -0,0 +1,156 @@
<!--
SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
# Debugging and reporting issues about shadPS4 and games
This document covers information about debugging, troubleshooting and reporting developer-side issues related to shadPS4 and games.
## Setup
This section will guide you through setting up tools for debugging the emulator. This list will likely expand as more tools and platforms receive consistent setups.
<details>
<summary>Windows and Visual Studio</summary>
Make sure you have the project set up for building on Windows with Visual Studio and CMake: [Build shadPS4 for Windows
](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-windows.md)
1. Open the project folder in Visual Studio **as a folder**. _Do not run `cmake ..` or other commands that set up the project._
2. In the Solution Explorer, click the **Switch between solutions and available views** button.\
![image](https://github.com/user-attachments/assets/4e2be2b1-ba5a-4451-9ab2-f4ecf246213d)
3. Double-click on **CMake Targets View**.\
![image](https://github.com/user-attachments/assets/5ce7cf90-cd61-4cfa-bef5-645909827290)
4. Under **shadPS4 Project**, right-click on the **shadps4 (executable)** solution and click **Set as Startup Item**. This will let you start and debug shadPS4 using the VS debug buttons, as well as the default F5 shortcut.\
![image](https://github.com/user-attachments/assets/34c7c047-28a3-499f-be8f-df781134d104)
5. Right-click the **shadps4 (executable)** solution once more and click **Add debug configuration**.
6. Add an `"args: []"` section into the first `configurations` entry.\
List your game path as an argument, as if you were launching the non-GUI emulator from the command line.
![image](https://github.com/user-attachments/assets/8c7c3e69-f38f-4d6b-bdfd-4f1c41c50be7)
7. Set the appropriate CMake configuration for debugging or testing.
- For debugging the emulator and games within it, select `x64-Clang-Debug`.
- For testing the emulator with compiler optimizations as a release build, it is recommended to select `x64-Clang-RelWithDebInfo`,
as debug symbols will still be generated in case you encounter release configuration-exclusive bugs/errors.
![image](https://github.com/user-attachments/assets/0d975f7a-7bea-4f89-87ef-5d685bea4381)
Launch and debug the emulator through **Debug > Start Debugging** (F5 by default), or **Debug > Start Without Debugging** (Ctrl+F5 by default) when testing games for performance.
</details>
## Configuration
You can configure the emulator by editing the `config.toml` file found in the `user` folder created after starting the application.
<details>
<summary>Some configuration entries worth changing</summary>
- `[General]`
- `logType`: Configures logging synchronization (`sync`/`async`)
- By default, the emulator logs messages asynchronously for better performance. Some log messages may end up being received out-of-order.
- It can be beneficial to set this to `sync` in order for the log to accurately maintain message order, at the cost of performance.
- When communicating about issues with games and the log messages aren't clear due to potentially confusing order, set this to `sync` and send that log as well.
- `logFilter`: Sets the logging category for various logging classes.
- Format: `<class>:<level> ...`
- Multiple classes can be set by separating them with a space. (example: `Render:Warning Debug:Critical Lib.Pad:Error`)
- Sub-classes can be specified in the same format as seen in the console/log (such as `Core.Linker`).
- All classes and sub-classes can be set by specifying a `*` symbol. (example: `Kernel.*:Critical`)
- Valid log levels: `Trace, Debug, Info, Warning, Error, Critical` - in this order, setting a level silences all levels preceding it and logs every level after it.
- Examples:
- If the log is being spammed with messages coming from Lib.Pad, you can use `Lib.Pad:Critical` to only log critical-level messages.
- If you'd like to mute everything, but still want to receive messages from Vulkan rendering: `*:Critical Render.Vulkan:Info`
- `Fullscreen`: Display the game in a full screen borderless window.
- `[GPU]`
- `dumpShaders`: Dump shaders that are loaded by the emulator. Dump path: `../user/shader/dumps`
- `nullGpu`: Disables rendering.
- `screenWidth` and `screenHeight`: Configures the game window width and height.
- `[Vulkan]`
- `validation`-related settings: Use when debugging Vulkan.
- `rdocEnable`: Automatically hook RenderDoc when installed. Useful for debugging shaders and game rendering.
- `rdocMarkersEnable`: Enable automatic RenderDoc event annotation
- `[LLE]`
- `libc`: Use LLE with `libc`.
</details>
## Quick analysis
This section will provide some preliminary steps to take and tips on what to do when you encounter scenarios that require debugging.
<details open>
<summary>When a game crashes and breaks in the debugger</summary>
1. Analyze the log
- A console will open by default when you launch the emulator. It shows the same log messages that go into the log file found at `<emulator executable>/user/log/shad_log.txt`.
- It is recommended that you start analyzing the log bottom-up first:
- Are there any critical or error-level messages at the end of the log that would point to a reason for the game crashing?
- Do any of the last few messages contain information about the game loading files?
- Did the game window draw anything on-screen?
- Continue analyzing the log from the start to see other errors (such as with initialization, memory mapping, linker errors etc.)
2. Analyze the stack trace
- When the emulator is launched through a debugger, it will **break** when an exception or violation is encountered.\
_(**breaking** in this context means pausing execution of the program before it continues or stops altogether.
Breaks can be intentional as well - these are set with various kinds of **breakpoints**.)_
- Default setups of most debuggers include a **Stack trace** window/panel that lists the functions the program has called before breaking.
- The stack trace entries can be navigated to and will show the relevant function, as well as switch to the state that the program was in at the time of execution.\
Use the **Locals** and **Watch** windows to investigate variables and other code in these contexts.
3. Identify the reason for the crash
- **Logs aren't always accurate in determining the reason for a crash.**\
Some log entries are reported as errors but may not be fatal for the execution to stop. `Critical` entries are most likely to be the cause for crashes.
- Pinpoint the area of the emulator where the crash occured\
If the stack trace ends with functions that are relevant to rendering, it is safe to assume that the issue is with **rendering**.\
Similarly, if a crash is in a library responsible for playing videos, your issue can be narrowed down to the scope of video playback in the emulator.
- **⚠ Some crashes are intentional**
- If you identify **Access violations for writing operations** where the function is (or in cases of game libraries, _looks like_ it is) copying memory,
it most likely is an **intentional exception** meant to catch game data being written by the game.
This is used by the emulator developers to identify procedures that have to do with game data changing.
- Debugging tools usually include an option to not break on certain types of exceptions. **Exclude access violations and other intentional exceptions when debugging to skip these exceptions.**
- You can also identify such cases if the game works in Release builds of the emulator. These intentional exceptions are development-time only.
- Attempt to **Continue** and observe whether the stack trace and/or variables and registers change when you encounter exceptions.
</details>
## Reporting and communicating about issues
When communicating with the project about game-specific issues, specify an **uniquely identifable game name** along with its `CUSA-xxxxx` code that is specific to the region/variant of the game you're testing.\
The version number is also important to add at least in the description, especially if you can verify that the game behaves differently across versions.\
Accurately identifying games will help other developers that own that game recognize your issue by its title and jump in to help test and debug it.
- Examples of good naming schemes:
- Amplitude (2016) `CUSA02480`
- Rock Band 4 (`CUSA02084`) v1.0
- inFamous: Second Son \[`CUSA-00004`\]
- Examples of unideal naming schemes:
- _The Witness_
- _GTA 5_
- _Watch Dogs_
- If your issue is small or you aren't sure whether you have properly identified something, [join the Discord server](https://discord.gg/MyZRaBngxA) and use the #development channel
to concisely explain the issue, as well as any findings you currently have.
- It is recommended that you check the [game compatibility issue tracker](https://github.com/shadps4-emu/shadps4-game-compatibility/issues) and post very short summaries of progress changes there,
(such as the game now booting into the menu or getting in-game) for organizational and status update purposes.
- ⚠ **Do not post theoretical, unproven game-specific issues in the emulator issue tracker that you cannot verify and locate in the emulator source code as being a bug.**\
Do, however, add information about the game you experienced the issue in, so that it can be tested in a reproducible environment.
- Good example: "_Crash in `Shader::Gcn::CFG::EmitBlocks()`, out of bounds list access_" -> _issue description shares stack trace, points to code in the repository and provides relevant information_
- Bad example: "_Amplitude crashes on boot, access violation_" -> _issue description reiterates title, focuses on the game instead of the emulator and refuses to elaborate_

BIN
documents/Quickstart/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 KiB

View File

@ -0,0 +1,81 @@
<!--
SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
# shadPS4 Quickstart
## Summary
- [PC Requirements](#pc-requirements)
- [CPU](#cpu)
- [GPU](#gpu)
- [RAM](#ram)
- [OS](#os)
- [Have the latest WIP version](#have-the-latest-wip-version)
- [Install PKG files (Games and Updates)](#install-pkg-files)
- [Configure the emulator](#configure-the-emulator)
## PC Requirements
### CPU
- A processor with at least 4 cores and 6 threads
- Above 2.5 GHz frequency
### GPU
- A graphics card with at least 1GB of VRAM
- Keep your graphics drivers up to date
- Vulkan 1.3 support (required)
### RAM
- 8GB of RAM or more
### OS
- Windows 10 or Ubuntu 22.04
## How to run the latest Work-in-Progress builds of ShadPS4
1. Go to <https://github.com/shadps4-emu/shadPS4/actions> and make sure you are logged into your GitHub account (important!)
2. On the left side of the page, select your operating system of choice (the "**qt**" versions have a user interface, which is probably the one you want. The others are SDL versions, which can only be run via command line). ![image](https://github.com/user-attachments/assets/43f01bbf-236c-4d6d-98ac-f5a5badd4ce8)
3. In the workflow list, select the latest entry with a green :white_check_mark: icon in front of it. (or the latest entry for whatever pull request you wish to test). ![image](https://github.com/user-attachments/assets/6365f407-867c-44ae-bf00-944f8d84a349)
4. On the bottom of this page, select the name of the file, and it should start downloading. (If there is no file here, double check that you are indeed logged into a GitHub account, and that there is a green :white_check_mark: icon. ![image](https://github.com/user-attachments/assets/97924500-3911-4f90-ab63-ffae7e52700b)
5. Once downloaded, extract to its own folder, and run ShadPS4's executable from the extracted folder.
6. Upon first launch, ShadPS4 will prompt you to select a folder to store your installed games in. Select "Browse" and then select a folder that ShadPS4 can use to install your PKG files to.
## Install PKG files
To install PKG files (game and updates), you will need the Qt application (with UI). You will have to go to "File" then to "Install Packages (PKG)", a window will open then you will have to select the files. You can install multiple PKG files at once. Once finished, the game should appear in the application.
<img src="https://github.com/shadps4-emu/shadPS4/blob/main/documents/Quickstart/2.png" width="800"></a>
## Configure the emulator
You can configure the emulator by editing the `config.toml` file found in the `user` folder created after starting the application.\
Some settings may be related to more technical development and debugging. For more information on those, see [Debugging](https://github.com/shadps4-emu/shadPS4/blob/main/documents/Debugging/Debugging.md#configuration).
Here's a list of configuration entries that are worth changing:
- `[General]`
- `Fullscreen`: Display the game in a full screen borderless window.
- `logType`: Configures logging synchronization (`sync`/`async`)
- It can be beneficial to set this to `sync` in order for the log to accurately maintain message order, at the cost of performance.
- Use when sending logs to developers. See more about [reporting issues](https://github.com/shadps4-emu/shadPS4/blob/main/documents/Debugging/Debugging.md#reporting-and-communicating-about-issues).
- `logFilter`: Sets the logging category for various logging classes.
- Format: `<class>:<level> ...`, `<class.*>:<level> <*:level> ...`
- Valid log levels: `Trace, Debug, Info, Warning, Error, Critical` - in this order, setting a level silences all levels preceding it and logs every level after it.
- Examples:
- If the log is being spammed with messages coming from Lib.Pad, you can use `Lib.Pad:Critical` to only log critical-level messages.
- If you'd like to mute everything, but still want to receive messages from Vulkan rendering: `*:Error Render.Vulkan:Info`
- `[GPU]`
- `screenWidth` and `screenHeight`: Configures the game window width and height.

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

@ -0,0 +1,56 @@
<!--
SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
## Build shadPS4 for Linux
### Install the necessary tools to build shadPS4:
#### Debian & Ubuntu
```
sudo apt-get install build-essential libasound2-dev libpulse-dev libopenal-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git libevdev-dev libsdl2-2.0 libsdl2-dev libjack-dev libsndio-dev
```
#### Fedora
```
sudo dnf install alsa-lib-devel cmake libatomic libevdev-devel libudev-devel openal-devel qt6-qtbase-devel qt6-qtbase-private-devel vulkan-devel pipewire-jack-audio-connection-kit-devel qt6-qtmultimedia-devel qt6-qtsvg-devel
```
#### Arch Linux
```
sudo pacman -S openal cmake vulkan-validation-layers qt6-base qt6-declarative qt6-multimedia sdl2 sndio jack2 base-devel
```
#### OpenSUSE
```
sudo zypper install git cmake libasound2 libpulse-devel openal-soft-devel zlib-devel libedit-devel vulkan-devel libudev-devel libqt6-qtbase-devel libqt6-qtmultimedia-devel libqt6-qtsvg-devel libQt6Gui-private-headers-devel libevdev-devel libsndio7_1 libjack-devel
```
### Cloning and compiling:
Clone the repository recursively:
```
git clone --recursive https://github.com/shadps4-emu/shadPS4.git
cd shadPS4
```
Generate the build directory in the shadPS4 directory:
```
cmake -S . -B build/
```
Enter the directory:
```
cd build/
```
Use make to build the project:
```
cmake --build . --parallel$(nproc)
```
Now run the emulator:
```
./shadps4 /"PATH"/"TO"/"GAME"/"FOLDER"/eboot.bin
```

View File

@ -1,20 +1,100 @@
# How to build shadps4 in windows <!--
SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
## Download VStudio Community 2022 17.7.4 # Build shadPS4 for Windows
[VStudio 2022](https://visualstudio.microsoft.com/vs/) This tutorial reads as if you have none of the prerequisites already installed. If you do, just ignore the steps regarding installation.
If you are building to contribute to the project, please omit `--depth 1` from the git invokations.
## Requirements Note: **ARM64 is not supported!** As of writing, it will not build nor run. The instructions with respect to ARM64 are for developers only.
Install the following ## Option 1: Visual Studio 2022
- Desktop development with c++ ### (Prerequisite) Download the Community edition from [**Visual Studio 2022**](https://visualstudio.microsoft.com/vs/)
### From Individual components tab install Once you are within the installer:
1. Select `Desktop development with C++`
2. Go to "Individual Components" tab
3. Search and select `C++ Clang Compiler for Windows` and `MSBuild support for LLVM`
4. Continue the installation
- C++ Clang Compiler for Windows (16.0.5) ### (Prerequisite) Download [**Qt**](https://doc.qt.io/qt-6/get-and-install-qt.html)
- MSBuild support for LLVM (clang-cl) toolset
- ## Compiling Beware, this requires you to create a Qt account. If you do not want to do this, please follow the MSYS2/MinGW compilation method instead.
- Open vstudio and select the clang debug or clang release . It should compile just fine 1. Under the current, non beta version of Qt (at the time of writing 6.7.2), select the option `MSVC 2019 64-bit` or similar.
If you are on Windows on ARM / Qualcomm Snapdragon Elite X, select `MSVC 2019 ARM64` instead.
Go through the installation normally. If you know what you are doing, you may unselect individual components that eat up too much disk space.
2. Download and install [Qt Visual Studio Tools](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022)
Once you are finished, you will have to configure Qt within Visual Studio:
1. Tools -> Options -> Qt -> Versions
2. Add a new Qt version and navigate it to the correct folder. Should look like so: `C:\Qt\6.7.2\msvc2019_64`
3. Enable the default checkmark on the new version you just created.
### (Prerequisite) Download [**Git for Windows**](https://git-scm.com/download/win)
Go through the Git for Windows installation as normal
### Cloning the source code
1. Open Git for Windows, navigate to a place where you want to store the shadPS4 source code folder
2. Clone the repository by running
`git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4`
### Compiling with Visual Studio GUI
1. Open up Visual Studio, select `Open a local folder` and select the folder with the shadPS4 source code. The folder should contain `CMakeLists.txt`
2. Change x64-Clang-Debug to x64-Clang-Release if you want a regular, non-debug build.
3. If you want to build shadPS4 with the Qt Gui:
1. Click x64-Clang-Release and select "Manage Configurations"
2. Look for "CMake command arguments" and add to the text field
`-DENABLE_QT_GUI=ON -DCMAKE_PREFIX_PATH=C:\Qt\6.7.2\msvc2019_64`
(Change Qt path if you've installed it to non-default path)
3. Press CTRL+S to save and wait a moment for CMake generation
4. Change the project to build to shadps4.exe
5. Build -> Build All
Your shadps4.exe will be in `c:\path\to\source\Build\x64-Clang-Release\`
To automatically populate the necessary files to run shadPS4.exe, run in a command prompt or terminal:
`C:\Qt\6.7.2\msvc2019_64\bin\windeployqt.exe c:\path\to\shadps4.exe`
(Change Qt path if you've installed it to non-default path)
## Option 2: MSYS2/MinGW
### (Prerequisite) Download [**MSYS2**](https://www.msys2.org/)
Go through the MSYS2 installation as normal
If you are building to distribute, please omit `-DCMAKE_CXX_FLAGS="-O2 -march=native"` within the build configuration step.
Normal x86-based computers, follow:
1. Open "MSYS2 MINGW64" from your new applications
2. Run `pacman -Syu`, let it complete;
3. Run `pacman -S --needed git mingw-w64-x86_64-binutils mingw-w64-x86_64-clang mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-qt6-base`
4. Run `git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4`
5. Run `cd shadPS4`
6. Run `cmake -S . -B build -DCMAKE_CXX_COMPILER="clang++.exe" -DCMAKE_C_COMPILER="clang.exe" -DCMAKE_CXX_FLAGS="-O2 -march=native"`
7. Run `cmake --build build`
8. To run the finished product, run `./build/shadPS4.exe`
ARM64-based computers, follow:
1. Open "MSYS2 CLANGARM64" from your new applications
2. Run `pacman -Syu`, let it complete;
3. Run `pacman -S --needed git mingw-w64-clang-aarch64-binutils mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-cmake mingw-w64-clang-aarch64-ninja mingw-w64-clang-aarch64-qt6-base`
4. Run `git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4`
5. Run `cd shadPS4`
6. Run `cmake -S . -B build -DCMAKE_CXX_COMPILER="clang++.exe" -DCMAKE_C_COMPILER="clang.exe" -DCMAKE_CXX_FLAGS="-O2 -march=native"`
7. Run `cmake --build build`
8. To run the finished product, run `./build/shadPS4.exe`
## Note on MSYS2 builds
These builds may not be easily copyable to people who do not also have a MSYS2 installation.
If you want to distribute these builds, you need to copy over the correct DLLs into a distribution folder.
In order to run them, you must be within the MSYS2 shell environment.

View File

@ -1,9 +1,44 @@
v0.0.2 not yet released WIP v0.2.0 15/08/2024 - codename validptr
=========================== =================
-using cstdint header in variable types - Adding macOS support
- Big shader recompiler improvements
- Core improvements
- GUI improvements
v0.1.0 01/07/2024 - codename madturtle
=================
- Added a shader recompiler, with this we have a lot of games that starts to work
- Rewrote a big part of core
v0.0.3 23/03/2024 - codename salad
=================
- Switching to std::thread
- Use unique_ptr where possible
- Replace printf/scanf with type safe fmt
- Implemented sceKernelGetProcessTime
- Implemented sceKernelGetProcessTimeCounter, sceKernelGetProcessTimeCounterFrequency
- Pause emu with P button
- Timers rewrote with std::chrono
- Added sceSystemServiceGetStatus
- Initial FileSystem implementation
- Initial TLS work
- New logging implementation
- Some functions implemented for userService, systemService
- Added sceAudioOut module and output using SDL audio
v0.0.2 21/10/2023
=================
- Using cstdint header in variable types
- run_main_entry: Rewrite in asm for stack setup - run_main_entry: Rewrite in asm for stack setup
-printf libc implementation for work with sysv_abi - Printf libc implementation for work with sysv_abi
- Initial pad emulation (only digital pad atm)
- Implemented sceVideoOutIsFlipPending
- Added auto stubs, now unsupported hle function will resolve as empty stubs
- Rewrote libc_cxa functions
- Libc implementations ( _ZdlPv,_Znwm,rand,_Fsin,qsort,free,strncpy,memmove,atan2f,pow,_Sin)
- ET_SCE_DYNAMIC behaves as valid for execution now
- Initial FileSystem work (not yet usable)
v0.0.1 29/09/2023 v0.0.1 29/09/2023
================= =================
First public release . Everything is new First public release. Everything is new.

View File

@ -1,17 +0,0 @@
## Linux
Generate the build directory in the shadPS4 directory:
```
cmake -S . -B build/
```
Enter the directory:
```
cd build/
```
Use make to build the project:
```
make -j$(nproc)
```

View File

@ -1,38 +0,0 @@
shadps4 - An ps4 emulator
=========================
1. Intro
2. Current status
3. Contributors
4. Greetings
1.Intro
=======
shadPS4 is a ps4 emulator for windows. Although atm it can't run a lot of stuff , it can emulate perfectly videoout_basic demo from ps4 sdk. Since developing focused on that , don't expect to run anything else atm (ok maybe if you are extreme lucky , you might find something else that works)
2.Current status
================
shadps4 is a HLE emulator . Currently on a small amount of functions is emulated , which is one of the reasons compatibility is low.
3.Contributors
==============
Although atm project is mostly 1 man's work there are several commits from other devs (ironically there are all greeks)
- wheremyfoodat - (pcsx-redux dev and Panda3DS founder and dev)
- skmp - (nulldc , reincast and some many others emus founder and dev)
- OFFTKP - (paris... what to tell about paris , ok hydra is one of his best effords :) )
4.Greetings
===========
I would like to thank the following people for helping me so far , with coding or moral support.
- wheremyfoodat - or @rodakinos for believed me.
- paris - or OFFTKP for not believing me and that made me a better coder :D
- skmp - or kornilios for being good old friend
- PandaBad - our beloved stalker
- emufan4568 - for advices
- velocity - for talking 1-2 times per year on discord server . We miss you velocity
- probably more , will include in the next readme :D

170
externals/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,170 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
set(BUILD_SHARED_LIBS OFF)
set(BUILD_TESTING OFF)
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
if (MSVC)
# Silence "deprecation" warnings
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
endif()
# Boost
if (NOT TARGET Boost::headers)
set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/externals/ext-boost" CACHE STRING "")
set(Boost_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/ext-boost" CACHE STRING "")
set(Boost_NO_SYSTEM_PATHS ON CACHE BOOL "")
add_library(boost INTERFACE)
target_include_directories(boost SYSTEM INTERFACE ${Boost_INCLUDE_DIR})
add_library(Boost::headers ALIAS boost)
endif()
# fmtlib
if (NOT TARGET fmt::fmt)
add_subdirectory(fmt)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND MSVC)
# If it is clang and MSVC we will add a static lib
# CryptoPP
add_subdirectory(cryptoppwin)
target_include_directories(cryptoppwin INTERFACE cryptoppwin/include)
else()
# CryptoPP
if (NOT TARGET cryptopp::cryptopp)
set(CRYPTOPP_INSTALL OFF)
set(CRYPTOPP_BUILD_TESTING OFF)
set(CRYPTOPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/)
add_subdirectory(cryptopp-cmake)
file(COPY cryptopp DESTINATION cryptopp FILES_MATCHING PATTERN "*.h")
target_include_directories(cryptopp INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/cryptopp")
endif()
endif()
if (NOT TARGET FFmpeg::ffmpeg)
set(ARCHITECTURE "x86_64")
add_subdirectory(ffmpeg-core)
add_library(FFmpeg::ffmpeg ALIAS ffmpeg)
endif()
# Zlib-Ng
if (NOT TARGET zlib-ng::zlib)
set(ZLIB_ENABLE_TESTS OFF)
set(WITH_GTEST OFF)
set(WITH_NEW_STRATEGIES ON)
set(WITH_NATIVE_INSTRUCTIONS ON)
add_subdirectory(zlib-ng)
add_library(zlib-ng::zlib ALIAS zlib)
endif()
# SDL3
if (NOT TARGET SDL3::SDL3)
set(SDL_PIPEWIRE OFF)
add_subdirectory(sdl3)
endif()
# vulkan-headers
if (NOT TARGET Vulkan::Headers)
set(VULKAN_HEADERS_ENABLE_MODULE OFF)
add_subdirectory(vulkan-headers)
endif()
# VMA
if (NOT TARGET GPUOpen::VulkanMemoryAllocator)
add_subdirectory(vma)
endif()
# RenderDoc
if (NOT TARGET RenderDoc::API)
add_library(renderdoc INTERFACE)
target_include_directories(renderdoc SYSTEM INTERFACE ./renderdoc)
add_library(RenderDoc::API ALIAS renderdoc)
endif()
# glslang
if (NOT TARGET glslang::glslang)
set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "")
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "")
set(ENABLE_SPVREMAPPER OFF CACHE BOOL "")
set(ENABLE_CTEST OFF CACHE BOOL "")
set(ENABLE_HLSL OFF CACHE BOOL "")
set(BUILD_EXTERNAL OFF CACHE BOOL "")
set(ENABLE_OPT OFF CACHE BOOL "")
add_subdirectory(glslang)
file(COPY glslang/SPIRV DESTINATION glslang/glslang FILES_MATCHING PATTERN "*.h")
target_include_directories(SPIRV INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/glslang")
endif()
# Robin-map
if (NOT TARGET tsl::robin_map)
add_subdirectory(robin-map)
endif()
# Xbyak
if (NOT TARGET xbyak::xbyak)
add_subdirectory(xbyak)
endif()
# MagicEnum
if (NOT TARGET magic_enum::magic_enum)
add_subdirectory(magic_enum)
endif()
# Toml11
if (NOT TARGET toml11::toml11)
add_subdirectory(toml11)
endif()
# xxHash
if (NOT TARGET xxHash::xxhash)
add_library(xxhash xxhash/xxhash.h xxhash/xxhash.c)
target_include_directories(xxhash PUBLIC xxhash)
add_library(xxHash::xxhash ALIAS xxhash)
endif()
# Zydis
if (NOT TARGET Zydis::Zydis)
option(ZYDIS_BUILD_TOOLS "" OFF)
option(ZYDIS_BUILD_EXAMPLES "" OFF)
add_subdirectory(zydis)
endif()
# Winpthreads
if (WIN32)
add_subdirectory(winpthreads)
target_include_directories(winpthreads INTERFACE winpthreads/include)
endif()
# sirit
add_subdirectory(sirit)
if (WIN32)
target_compile_options(sirit PUBLIC "-Wno-error=unused-command-line-argument")
endif()
if (APPLE)
# half
add_library(half INTERFACE)
target_include_directories(half INTERFACE half/include)
# date
if (NOT TARGET date::date-tz)
option(BUILD_TZ_LIB "" ON)
option(USE_SYSTEM_TZ_DB "" ON)
add_subdirectory(date)
endif()
endif()
# Tracy
option(TRACY_ENABLE "" ON)
option(TRACY_NO_CRASH_HANDLER "" ON) # Otherwise texture cache exceptions will be treaten as a crash
option(TRACY_ON_DEMAND "" ON)
option(TRACY_NO_FRAME_IMAGE "" ON)
option(TRACY_FIBERS "" ON) # For AmdGpu frontend profiling
option(TRACY_NO_SYSTEM_TRACING "" ON)
option(TRACY_NO_CALLSTACK "" ON)
option(TRACY_NO_CODE_TRANSFER "" ON)
option(TRACY_NO_SAMPLING "" ON)
option(TRACY_ONLY_LOCALHOST "" ON)
option(TRACY_NO_CONTEXT_SWITCH "" ON)
add_subdirectory(tracy)

View File

@ -0,0 +1,158 @@
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
# We have reached the root directory, we are not in git
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
return()
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
endwhile()
# check if this is a submodule
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${GIT_DIR}/HEAD")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake"
@ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_branch_name _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
execute_process(COMMAND
"${GIT_EXECUTABLE}"
rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY
"${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
#get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
#if(NOT hash)
# set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
# return()
#endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND
"${GIT_EXECUTABLE}"
describe
${hash}
${ARGN}
WORKING_DIRECTORY
"${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,42 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(HEAD_HASH)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
set(HEAD_HASH "${HEAD_REF}")
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
if(EXISTS "@GIT_DATA@/head-ref")
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
else()
set(HEAD_HASH "Unknown")
endif()
endif()

1
externals/cryptopp vendored Submodule

@ -0,0 +1 @@
Subproject commit 60f81a77e0c9a0e7ffc1ca1bc438ddfa2e43b78e

1
externals/cryptopp-cmake vendored Submodule

@ -0,0 +1 @@
Subproject commit 2c384c28265a93358a2455e610e76393358794df

1
externals/cryptoppwin vendored Submodule

@ -0,0 +1 @@
Subproject commit bc3441dd2d6a9728e747dc0180bc8b9065a2923c

1
externals/date vendored Submodule

@ -0,0 +1 @@
Subproject commit 1ead6715dec030d340a316c927c877a3c4e5a00c

1
externals/ext-boost vendored Submodule

@ -0,0 +1 @@
Subproject commit a04136add1e469f46d8ae8d3e8307779240a5c53

1
externals/ffmpeg-core vendored Submodule

@ -0,0 +1 @@
Subproject commit e30b7d7fe228bfb3f6e41ce1040b44a15eb7d5e0

1
externals/fmt vendored Submodule

@ -0,0 +1 @@
Subproject commit c98518351efd5a46f5d448e947e0b7242d197d07

1
externals/glslang vendored Submodule

@ -0,0 +1 @@
Subproject commit 12cbda959b6df2af119a76a73ff906c2bed36884

1
externals/half vendored Submodule

@ -0,0 +1 @@
Subproject commit 1ddada225144cac0de8f6b5c0dd9acffd99a2e68

1
externals/magic_enum vendored Submodule

@ -0,0 +1 @@
Subproject commit dae6bbf16c363e9ead4e628a47fdb02956a634f3

741
externals/renderdoc/renderdoc_app.h vendored Normal file
View File

@ -0,0 +1,741 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2019-2024 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#pragma once
//////////////////////////////////////////////////////////////////////////////////////////////////
//
// Documentation for the API is available at https://renderdoc.org/docs/in_application_api.html
//
#if !defined(RENDERDOC_NO_STDINT)
#include <stdint.h>
#endif
#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
#define RENDERDOC_CC __cdecl
#elif defined(__linux__) || defined(__FreeBSD__)
#define RENDERDOC_CC
#elif defined(__APPLE__)
#define RENDERDOC_CC
#else
#error "Unknown platform"
#endif
#ifdef __cplusplus
extern "C" {
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////
// Constants not used directly in below API
// This is a GUID/magic value used for when applications pass a path where shader debug
// information can be found to match up with a stripped shader.
// the define can be used like so: const GUID RENDERDOC_ShaderDebugMagicValue =
// RENDERDOC_ShaderDebugMagicValue_value
#define RENDERDOC_ShaderDebugMagicValue_struct \
{ \
0xeab25520, 0x6670, 0x4865, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
}
// as an alternative when you want a byte array (assuming x86 endianness):
#define RENDERDOC_ShaderDebugMagicValue_bytearray \
{ \
0x20, 0x55, 0xb2, 0xea, 0x70, 0x66, 0x65, 0x48, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
}
// truncated version when only a uint64_t is available (e.g. Vulkan tags):
#define RENDERDOC_ShaderDebugMagicValue_truncated 0x48656670eab25520ULL
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc capture options
//
typedef enum RENDERDOC_CaptureOption
{
// Allow the application to enable vsync
//
// Default - enabled
//
// 1 - The application can enable or disable vsync at will
// 0 - vsync is force disabled
eRENDERDOC_Option_AllowVSync = 0,
// Allow the application to enable fullscreen
//
// Default - enabled
//
// 1 - The application can enable or disable fullscreen at will
// 0 - fullscreen is force disabled
eRENDERDOC_Option_AllowFullscreen = 1,
// Record API debugging events and messages
//
// Default - disabled
//
// 1 - Enable built-in API debugging features and records the results into
// the capture, which is matched up with events on replay
// 0 - no API debugging is forcibly enabled
eRENDERDOC_Option_APIValidation = 2,
eRENDERDOC_Option_DebugDeviceMode = 2, // deprecated name of this enum
// Capture CPU callstacks for API events
//
// Default - disabled
//
// 1 - Enables capturing of callstacks
// 0 - no callstacks are captured
eRENDERDOC_Option_CaptureCallstacks = 3,
// When capturing CPU callstacks, only capture them from actions.
// This option does nothing without the above option being enabled
//
// Default - disabled
//
// 1 - Only captures callstacks for actions.
// Ignored if CaptureCallstacks is disabled
// 0 - Callstacks, if enabled, are captured for every event.
eRENDERDOC_Option_CaptureCallstacksOnlyDraws = 4,
eRENDERDOC_Option_CaptureCallstacksOnlyActions = 4,
// Specify a delay in seconds to wait for a debugger to attach, after
// creating or injecting into a process, before continuing to allow it to run.
//
// 0 indicates no delay, and the process will run immediately after injection
//
// Default - 0 seconds
//
eRENDERDOC_Option_DelayForDebugger = 5,
// Verify buffer access. This includes checking the memory returned by a Map() call to
// detect any out-of-bounds modification, as well as initialising buffers with undefined contents
// to a marker value to catch use of uninitialised memory.
//
// NOTE: This option is only valid for OpenGL and D3D11. Explicit APIs such as D3D12 and Vulkan do
// not do the same kind of interception & checking and undefined contents are really undefined.
//
// Default - disabled
//
// 1 - Verify buffer access
// 0 - No verification is performed, and overwriting bounds may cause crashes or corruption in
// RenderDoc.
eRENDERDOC_Option_VerifyBufferAccess = 6,
// The old name for eRENDERDOC_Option_VerifyBufferAccess was eRENDERDOC_Option_VerifyMapWrites.
// This option now controls the filling of uninitialised buffers with 0xdddddddd which was
// previously always enabled
eRENDERDOC_Option_VerifyMapWrites = eRENDERDOC_Option_VerifyBufferAccess,
// Hooks any system API calls that create child processes, and injects
// RenderDoc into them recursively with the same options.
//
// Default - disabled
//
// 1 - Hooks into spawned child processes
// 0 - Child processes are not hooked by RenderDoc
eRENDERDOC_Option_HookIntoChildren = 7,
// By default RenderDoc only includes resources in the final capture necessary
// for that frame, this allows you to override that behaviour.
//
// Default - disabled
//
// 1 - all live resources at the time of capture are included in the capture
// and available for inspection
// 0 - only the resources referenced by the captured frame are included
eRENDERDOC_Option_RefAllResources = 8,
// **NOTE**: As of RenderDoc v1.1 this option has been deprecated. Setting or
// getting it will be ignored, to allow compatibility with older versions.
// In v1.1 the option acts as if it's always enabled.
//
// By default RenderDoc skips saving initial states for resources where the
// previous contents don't appear to be used, assuming that writes before
// reads indicate previous contents aren't used.
//
// Default - disabled
//
// 1 - initial contents at the start of each captured frame are saved, even if
// they are later overwritten or cleared before being used.
// 0 - unless a read is detected, initial contents will not be saved and will
// appear as black or empty data.
eRENDERDOC_Option_SaveAllInitials = 9,
// In APIs that allow for the recording of command lists to be replayed later,
// RenderDoc may choose to not capture command lists before a frame capture is
// triggered, to reduce overheads. This means any command lists recorded once
// and replayed many times will not be available and may cause a failure to
// capture.
//
// NOTE: This is only true for APIs where multithreading is difficult or
// discouraged. Newer APIs like Vulkan and D3D12 will ignore this option
// and always capture all command lists since the API is heavily oriented
// around it and the overheads have been reduced by API design.
//
// 1 - All command lists are captured from the start of the application
// 0 - Command lists are only captured if their recording begins during
// the period when a frame capture is in progress.
eRENDERDOC_Option_CaptureAllCmdLists = 10,
// Mute API debugging output when the API validation mode option is enabled
//
// Default - enabled
//
// 1 - Mute any API debug messages from being displayed or passed through
// 0 - API debugging is displayed as normal
eRENDERDOC_Option_DebugOutputMute = 11,
// Option to allow vendor extensions to be used even when they may be
// incompatible with RenderDoc and cause corrupted replays or crashes.
//
// Default - inactive
//
// No values are documented, this option should only be used when absolutely
// necessary as directed by a RenderDoc developer.
eRENDERDOC_Option_AllowUnsupportedVendorExtensions = 12,
// Define a soft memory limit which some APIs may aim to keep overhead under where
// possible. Anything above this limit will where possible be saved directly to disk during
// capture.
// This will cause increased disk space use (which may cause a capture to fail if disk space is
// exhausted) as well as slower capture times.
//
// Not all memory allocations may be deferred like this so it is not a guarantee of a memory
// limit.
//
// Units are in MBs, suggested values would range from 200MB to 1000MB.
//
// Default - 0 Megabytes
eRENDERDOC_Option_SoftMemoryLimit = 13,
} RENDERDOC_CaptureOption;
// Sets an option that controls how RenderDoc behaves on capture.
//
// Returns 1 if the option and value are valid
// Returns 0 if either is invalid and the option is unchanged
typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionU32)(RENDERDOC_CaptureOption opt, uint32_t val);
typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionF32)(RENDERDOC_CaptureOption opt, float val);
// Gets the current value of an option as a uint32_t
//
// If the option is invalid, 0xffffffff is returned
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionU32)(RENDERDOC_CaptureOption opt);
// Gets the current value of an option as a float
//
// If the option is invalid, -FLT_MAX is returned
typedef float(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionF32)(RENDERDOC_CaptureOption opt);
typedef enum RENDERDOC_InputButton
{
// '0' - '9' matches ASCII values
eRENDERDOC_Key_0 = 0x30,
eRENDERDOC_Key_1 = 0x31,
eRENDERDOC_Key_2 = 0x32,
eRENDERDOC_Key_3 = 0x33,
eRENDERDOC_Key_4 = 0x34,
eRENDERDOC_Key_5 = 0x35,
eRENDERDOC_Key_6 = 0x36,
eRENDERDOC_Key_7 = 0x37,
eRENDERDOC_Key_8 = 0x38,
eRENDERDOC_Key_9 = 0x39,
// 'A' - 'Z' matches ASCII values
eRENDERDOC_Key_A = 0x41,
eRENDERDOC_Key_B = 0x42,
eRENDERDOC_Key_C = 0x43,
eRENDERDOC_Key_D = 0x44,
eRENDERDOC_Key_E = 0x45,
eRENDERDOC_Key_F = 0x46,
eRENDERDOC_Key_G = 0x47,
eRENDERDOC_Key_H = 0x48,
eRENDERDOC_Key_I = 0x49,
eRENDERDOC_Key_J = 0x4A,
eRENDERDOC_Key_K = 0x4B,
eRENDERDOC_Key_L = 0x4C,
eRENDERDOC_Key_M = 0x4D,
eRENDERDOC_Key_N = 0x4E,
eRENDERDOC_Key_O = 0x4F,
eRENDERDOC_Key_P = 0x50,
eRENDERDOC_Key_Q = 0x51,
eRENDERDOC_Key_R = 0x52,
eRENDERDOC_Key_S = 0x53,
eRENDERDOC_Key_T = 0x54,
eRENDERDOC_Key_U = 0x55,
eRENDERDOC_Key_V = 0x56,
eRENDERDOC_Key_W = 0x57,
eRENDERDOC_Key_X = 0x58,
eRENDERDOC_Key_Y = 0x59,
eRENDERDOC_Key_Z = 0x5A,
// leave the rest of the ASCII range free
// in case we want to use it later
eRENDERDOC_Key_NonPrintable = 0x100,
eRENDERDOC_Key_Divide,
eRENDERDOC_Key_Multiply,
eRENDERDOC_Key_Subtract,
eRENDERDOC_Key_Plus,
eRENDERDOC_Key_F1,
eRENDERDOC_Key_F2,
eRENDERDOC_Key_F3,
eRENDERDOC_Key_F4,
eRENDERDOC_Key_F5,
eRENDERDOC_Key_F6,
eRENDERDOC_Key_F7,
eRENDERDOC_Key_F8,
eRENDERDOC_Key_F9,
eRENDERDOC_Key_F10,
eRENDERDOC_Key_F11,
eRENDERDOC_Key_F12,
eRENDERDOC_Key_Home,
eRENDERDOC_Key_End,
eRENDERDOC_Key_Insert,
eRENDERDOC_Key_Delete,
eRENDERDOC_Key_PageUp,
eRENDERDOC_Key_PageDn,
eRENDERDOC_Key_Backspace,
eRENDERDOC_Key_Tab,
eRENDERDOC_Key_PrtScrn,
eRENDERDOC_Key_Pause,
eRENDERDOC_Key_Max,
} RENDERDOC_InputButton;
// Sets which key or keys can be used to toggle focus between multiple windows
//
// If keys is NULL or num is 0, toggle keys will be disabled
typedef void(RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(RENDERDOC_InputButton *keys, int num);
// Sets which key or keys can be used to capture the next frame
//
// If keys is NULL or num is 0, captures keys will be disabled
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(RENDERDOC_InputButton *keys, int num);
typedef enum RENDERDOC_OverlayBits
{
// This single bit controls whether the overlay is enabled or disabled globally
eRENDERDOC_Overlay_Enabled = 0x1,
// Show the average framerate over several seconds as well as min/max
eRENDERDOC_Overlay_FrameRate = 0x2,
// Show the current frame number
eRENDERDOC_Overlay_FrameNumber = 0x4,
// Show a list of recent captures, and how many captures have been made
eRENDERDOC_Overlay_CaptureList = 0x8,
// Default values for the overlay mask
eRENDERDOC_Overlay_Default = (eRENDERDOC_Overlay_Enabled | eRENDERDOC_Overlay_FrameRate |
eRENDERDOC_Overlay_FrameNumber | eRENDERDOC_Overlay_CaptureList),
// Enable all bits
eRENDERDOC_Overlay_All = ~0U,
// Disable all bits
eRENDERDOC_Overlay_None = 0,
} RENDERDOC_OverlayBits;
// returns the overlay bits that have been set
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetOverlayBits)();
// sets the overlay bits with an and & or mask
typedef void(RENDERDOC_CC *pRENDERDOC_MaskOverlayBits)(uint32_t And, uint32_t Or);
// this function will attempt to remove RenderDoc's hooks in the application.
//
// Note: that this can only work correctly if done immediately after
// the module is loaded, before any API work happens. RenderDoc will remove its
// injected hooks and shut down. Behaviour is undefined if this is called
// after any API functions have been called, and there is still no guarantee of
// success.
typedef void(RENDERDOC_CC *pRENDERDOC_RemoveHooks)();
// DEPRECATED: compatibility for code compiled against pre-1.4.1 headers.
typedef pRENDERDOC_RemoveHooks pRENDERDOC_Shutdown;
// This function will unload RenderDoc's crash handler.
//
// If you use your own crash handler and don't want RenderDoc's handler to
// intercede, you can call this function to unload it and any unhandled
// exceptions will pass to the next handler.
typedef void(RENDERDOC_CC *pRENDERDOC_UnloadCrashHandler)();
// Sets the capture file path template
//
// pathtemplate is a UTF-8 string that gives a template for how captures will be named
// and where they will be saved.
//
// Any extension is stripped off the path, and captures are saved in the directory
// specified, and named with the filename and the frame number appended. If the
// directory does not exist it will be created, including any parent directories.
//
// If pathtemplate is NULL, the template will remain unchanged
//
// Example:
//
// SetCaptureFilePathTemplate("my_captures/example");
//
// Capture #1 -> my_captures/example_frame123.rdc
// Capture #2 -> my_captures/example_frame456.rdc
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureFilePathTemplate)(const char *pathtemplate);
// returns the current capture path template, see SetCaptureFileTemplate above, as a UTF-8 string
typedef const char *(RENDERDOC_CC *pRENDERDOC_GetCaptureFilePathTemplate)();
// DEPRECATED: compatibility for code compiled against pre-1.1.2 headers.
typedef pRENDERDOC_SetCaptureFilePathTemplate pRENDERDOC_SetLogFilePathTemplate;
typedef pRENDERDOC_GetCaptureFilePathTemplate pRENDERDOC_GetLogFilePathTemplate;
// returns the number of captures that have been made
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetNumCaptures)();
// This function returns the details of a capture, by index. New captures are added
// to the end of the list.
//
// filename will be filled with the absolute path to the capture file, as a UTF-8 string
// pathlength will be written with the length in bytes of the filename string
// timestamp will be written with the time of the capture, in seconds since the Unix epoch
//
// Any of the parameters can be NULL and they'll be skipped.
//
// The function will return 1 if the capture index is valid, or 0 if the index is invalid
// If the index is invalid, the values will be unchanged
//
// Note: when captures are deleted in the UI they will remain in this list, so the
// capture path may not exist anymore.
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCapture)(uint32_t idx, char *filename,
uint32_t *pathlength, uint64_t *timestamp);
// Sets the comments associated with a capture file. These comments are displayed in the
// UI program when opening.
//
// filePath should be a path to the capture file to add comments to. If set to NULL or ""
// the most recent capture file created made will be used instead.
// comments should be a NULL-terminated UTF-8 string to add as comments.
//
// Any existing comments will be overwritten.
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureFileComments)(const char *filePath,
const char *comments);
// returns 1 if the RenderDoc UI is connected to this application, 0 otherwise
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsTargetControlConnected)();
// DEPRECATED: compatibility for code compiled against pre-1.1.1 headers.
// This was renamed to IsTargetControlConnected in API 1.1.1, the old typedef is kept here for
// backwards compatibility with old code, it is castable either way since it's ABI compatible
// as the same function pointer type.
typedef pRENDERDOC_IsTargetControlConnected pRENDERDOC_IsRemoteAccessConnected;
// This function will launch the Replay UI associated with the RenderDoc library injected
// into the running application.
//
// if connectTargetControl is 1, the Replay UI will be launched with a command line parameter
// to connect to this application
// cmdline is the rest of the command line, as a UTF-8 string. E.g. a captures to open
// if cmdline is NULL, the command line will be empty.
//
// returns the PID of the replay UI if successful, 0 if not successful.
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_LaunchReplayUI)(uint32_t connectTargetControl,
const char *cmdline);
// RenderDoc can return a higher version than requested if it's backwards compatible,
// this function returns the actual version returned. If a parameter is NULL, it will be
// ignored and the others will be filled out.
typedef void(RENDERDOC_CC *pRENDERDOC_GetAPIVersion)(int *major, int *minor, int *patch);
// Requests that the replay UI show itself (if hidden or not the current top window). This can be
// used in conjunction with IsTargetControlConnected and LaunchReplayUI to intelligently handle
// showing the UI after making a capture.
//
// This will return 1 if the request was successfully passed on, though it's not guaranteed that
// the UI will be on top in all cases depending on OS rules. It will return 0 if there is no current
// target control connection to make such a request, or if there was another error
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_ShowReplayUI)();
//////////////////////////////////////////////////////////////////////////
// Capturing functions
//
// A device pointer is a pointer to the API's root handle.
//
// This would be an ID3D11Device, HGLRC/GLXContext, ID3D12Device, etc
typedef void *RENDERDOC_DevicePointer;
// A window handle is the OS's native window handle
//
// This would be an HWND, GLXDrawable, etc
typedef void *RENDERDOC_WindowHandle;
// A helper macro for Vulkan, where the device handle cannot be used directly.
//
// Passing the VkInstance to this macro will return the RENDERDOC_DevicePointer to use.
//
// Specifically, the value needed is the dispatch table pointer, which sits as the first
// pointer-sized object in the memory pointed to by the VkInstance. Thus we cast to a void** and
// indirect once.
#define RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(inst) (*((void **)(inst)))
// This sets the RenderDoc in-app overlay in the API/window pair as 'active' and it will
// respond to keypresses. Neither parameter can be NULL
typedef void(RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// capture the next frame on whichever window and API is currently considered active
typedef void(RENDERDOC_CC *pRENDERDOC_TriggerCapture)();
// capture the next N frames on whichever window and API is currently considered active
typedef void(RENDERDOC_CC *pRENDERDOC_TriggerMultiFrameCapture)(uint32_t numFrames);
// When choosing either a device pointer or a window handle to capture, you can pass NULL.
// Passing NULL specifies a 'wildcard' match against anything. This allows you to specify
// any API rendering to a specific window, or a specific API instance rendering to any window,
// or in the simplest case of one window and one API, you can just pass NULL for both.
//
// In either case, if there are two or more possible matching (device,window) pairs it
// is undefined which one will be captured.
//
// Note: for headless rendering you can pass NULL for the window handle and either specify
// a device pointer or leave it NULL as above.
// Immediately starts capturing API calls on the specified device pointer and window handle.
//
// If there is no matching thing to capture (e.g. no supported API has been initialised),
// this will do nothing.
//
// The results are undefined (including crashes) if two captures are started overlapping,
// even on separate devices and/oror windows.
typedef void(RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// Returns whether or not a frame capture is currently ongoing anywhere.
//
// This will return 1 if a capture is ongoing, and 0 if there is no capture running
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsFrameCapturing)();
// Ends capturing immediately.
//
// This will return 1 if the capture succeeded, and 0 if there was an error capturing.
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// Ends capturing immediately and discard any data stored without saving to disk.
//
// This will return 1 if the capture was discarded, and 0 if there was an error or no capture
// was in progress
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_DiscardFrameCapture)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// Only valid to be called between a call to StartFrameCapture and EndFrameCapture. Gives a custom
// title to the capture produced which will be displayed in the UI.
//
// If multiple captures are ongoing, this title will be applied to the first capture to end after
// this call. The second capture to end will have no title, unless this function is called again.
//
// Calling this function has no effect if no capture is currently running, and if it is called
// multiple times only the last title will be used.
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureTitle)(const char *title);
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API versions
//
// RenderDoc uses semantic versioning (http://semver.org/).
//
// MAJOR version is incremented when incompatible API changes happen.
// MINOR version is incremented when functionality is added in a backwards-compatible manner.
// PATCH version is incremented when backwards-compatible bug fixes happen.
//
// Note that this means the API returned can be higher than the one you might have requested.
// e.g. if you are running against a newer RenderDoc that supports 1.0.1, it will be returned
// instead of 1.0.0. You can check this with the GetAPIVersion entry point
typedef enum RENDERDOC_Version
{
eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00
eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01
eRENDERDOC_API_Version_1_0_2 = 10002, // RENDERDOC_API_1_0_2 = 1 00 02
eRENDERDOC_API_Version_1_1_0 = 10100, // RENDERDOC_API_1_1_0 = 1 01 00
eRENDERDOC_API_Version_1_1_1 = 10101, // RENDERDOC_API_1_1_1 = 1 01 01
eRENDERDOC_API_Version_1_1_2 = 10102, // RENDERDOC_API_1_1_2 = 1 01 02
eRENDERDOC_API_Version_1_2_0 = 10200, // RENDERDOC_API_1_2_0 = 1 02 00
eRENDERDOC_API_Version_1_3_0 = 10300, // RENDERDOC_API_1_3_0 = 1 03 00
eRENDERDOC_API_Version_1_4_0 = 10400, // RENDERDOC_API_1_4_0 = 1 04 00
eRENDERDOC_API_Version_1_4_1 = 10401, // RENDERDOC_API_1_4_1 = 1 04 01
eRENDERDOC_API_Version_1_4_2 = 10402, // RENDERDOC_API_1_4_2 = 1 04 02
eRENDERDOC_API_Version_1_5_0 = 10500, // RENDERDOC_API_1_5_0 = 1 05 00
eRENDERDOC_API_Version_1_6_0 = 10600, // RENDERDOC_API_1_6_0 = 1 06 00
} RENDERDOC_Version;
// API version changelog:
//
// 1.0.0 - initial release
// 1.0.1 - Bugfix: IsFrameCapturing() was returning false for captures that were triggered
// by keypress or TriggerCapture, instead of Start/EndFrameCapture.
// 1.0.2 - Refactor: Renamed eRENDERDOC_Option_DebugDeviceMode to eRENDERDOC_Option_APIValidation
// 1.1.0 - Add feature: TriggerMultiFrameCapture(). Backwards compatible with 1.0.x since the new
// function pointer is added to the end of the struct, the original layout is identical
// 1.1.1 - Refactor: Renamed remote access to target control (to better disambiguate from remote
// replay/remote server concept in replay UI)
// 1.1.2 - Refactor: Renamed "log file" in function names to just capture, to clarify that these
// are captures and not debug logging files. This is the first API version in the v1.0
// branch.
// 1.2.0 - Added feature: SetCaptureFileComments() to add comments to a capture file that will be
// displayed in the UI program on load.
// 1.3.0 - Added feature: New capture option eRENDERDOC_Option_AllowUnsupportedVendorExtensions
// which allows users to opt-in to allowing unsupported vendor extensions to function.
// Should be used at the user's own risk.
// Refactor: Renamed eRENDERDOC_Option_VerifyMapWrites to
// eRENDERDOC_Option_VerifyBufferAccess, which now also controls initialisation to
// 0xdddddddd of uninitialised buffer contents.
// 1.4.0 - Added feature: DiscardFrameCapture() to discard a frame capture in progress and stop
// capturing without saving anything to disk.
// 1.4.1 - Refactor: Renamed Shutdown to RemoveHooks to better clarify what is happening
// 1.4.2 - Refactor: Renamed 'draws' to 'actions' in callstack capture option.
// 1.5.0 - Added feature: ShowReplayUI() to request that the replay UI show itself if connected
// 1.6.0 - Added feature: SetCaptureTitle() which can be used to set a title for a
// capture made with StartFrameCapture() or EndFrameCapture()
typedef struct RENDERDOC_API_1_6_0
{
pRENDERDOC_GetAPIVersion GetAPIVersion;
pRENDERDOC_SetCaptureOptionU32 SetCaptureOptionU32;
pRENDERDOC_SetCaptureOptionF32 SetCaptureOptionF32;
pRENDERDOC_GetCaptureOptionU32 GetCaptureOptionU32;
pRENDERDOC_GetCaptureOptionF32 GetCaptureOptionF32;
pRENDERDOC_SetFocusToggleKeys SetFocusToggleKeys;
pRENDERDOC_SetCaptureKeys SetCaptureKeys;
pRENDERDOC_GetOverlayBits GetOverlayBits;
pRENDERDOC_MaskOverlayBits MaskOverlayBits;
// Shutdown was renamed to RemoveHooks in 1.4.1.
// These unions allow old code to continue compiling without changes
union
{
pRENDERDOC_Shutdown Shutdown;
pRENDERDOC_RemoveHooks RemoveHooks;
};
pRENDERDOC_UnloadCrashHandler UnloadCrashHandler;
// Get/SetLogFilePathTemplate was renamed to Get/SetCaptureFilePathTemplate in 1.1.2.
// These unions allow old code to continue compiling without changes
union
{
// deprecated name
pRENDERDOC_SetLogFilePathTemplate SetLogFilePathTemplate;
// current name
pRENDERDOC_SetCaptureFilePathTemplate SetCaptureFilePathTemplate;
};
union
{
// deprecated name
pRENDERDOC_GetLogFilePathTemplate GetLogFilePathTemplate;
// current name
pRENDERDOC_GetCaptureFilePathTemplate GetCaptureFilePathTemplate;
};
pRENDERDOC_GetNumCaptures GetNumCaptures;
pRENDERDOC_GetCapture GetCapture;
pRENDERDOC_TriggerCapture TriggerCapture;
// IsRemoteAccessConnected was renamed to IsTargetControlConnected in 1.1.1.
// This union allows old code to continue compiling without changes
union
{
// deprecated name
pRENDERDOC_IsRemoteAccessConnected IsRemoteAccessConnected;
// current name
pRENDERDOC_IsTargetControlConnected IsTargetControlConnected;
};
pRENDERDOC_LaunchReplayUI LaunchReplayUI;
pRENDERDOC_SetActiveWindow SetActiveWindow;
pRENDERDOC_StartFrameCapture StartFrameCapture;
pRENDERDOC_IsFrameCapturing IsFrameCapturing;
pRENDERDOC_EndFrameCapture EndFrameCapture;
// new function in 1.1.0
pRENDERDOC_TriggerMultiFrameCapture TriggerMultiFrameCapture;
// new function in 1.2.0
pRENDERDOC_SetCaptureFileComments SetCaptureFileComments;
// new function in 1.4.0
pRENDERDOC_DiscardFrameCapture DiscardFrameCapture;
// new function in 1.5.0
pRENDERDOC_ShowReplayUI ShowReplayUI;
// new function in 1.6.0
pRENDERDOC_SetCaptureTitle SetCaptureTitle;
} RENDERDOC_API_1_6_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_2_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_3_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_5_0;
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API entry point
//
// This entry point can be obtained via GetProcAddress/dlsym if RenderDoc is available.
//
// The name is the same as the typedef - "RENDERDOC_GetAPI"
//
// This function is not thread safe, and should not be called on multiple threads at once.
// Ideally, call this once as early as possible in your application's startup, before doing
// any API work, since some configuration functionality etc has to be done also before
// initialising any APIs.
//
// Parameters:
// version is a single value from the RENDERDOC_Version above.
//
// outAPIPointers will be filled out with a pointer to the corresponding struct of function
// pointers.
//
// Returns:
// 1 - if the outAPIPointers has been filled with a pointer to the API struct requested
// 0 - if the requested version is not supported or the arguments are invalid.
//
typedef int(RENDERDOC_CC *pRENDERDOC_GetAPI)(RENDERDOC_Version version, void **outAPIPointers);
#ifdef __cplusplus
} // extern "C"
#endif

1
externals/robin-map vendored Submodule

@ -0,0 +1 @@
Subproject commit 2c48a1a50203bbaf1e3d0d64c5d726d56f8d3bb3

1
externals/sdl3 vendored Submodule

@ -0,0 +1 @@
Subproject commit 4cc3410dce50cefce98d3cf3cf1bc8eca83b862a

1
externals/sirit vendored Submodule

@ -0,0 +1 @@
Subproject commit 37090c74cc6e680f2bc334cac8fd182f7634a1f6

7988
externals/stb_image.h vendored Normal file

File diff suppressed because it is too large Load Diff

1
externals/toml11 vendored Submodule

@ -0,0 +1 @@
Subproject commit 4b740127230472779c4a4d71e1a75aaa3a367a2d

1
externals/tracy vendored Submodule

@ -0,0 +1 @@
Subproject commit b8061982cad0210b649541016c88ff5faa90733c

1
externals/vma vendored Submodule

@ -0,0 +1 @@
Subproject commit e1bdbca9baf4d682fb6066b380f4aa4a7bdbb58a

1
externals/vulkan-headers vendored Submodule

@ -0,0 +1 @@
Subproject commit d205aff40b4e15d4c568523ee6a26f85138126d9

1
externals/winpthreads vendored Submodule

@ -0,0 +1 @@
Subproject commit f00c973a6ab2a23573708568b8ef4acc20a9d36b

1
externals/xbyak vendored Submodule

@ -0,0 +1 @@
Subproject commit ccdf68421bc8eb85693f573080fc0a5faad862db

1
externals/xxhash vendored Submodule

@ -0,0 +1 @@
Subproject commit dbea33e47e7c0fe0b7c8592cd931c7430c1f130d

1
externals/zlib-ng vendored Submodule

@ -0,0 +1 @@
Subproject commit d54e3769be0c522015b784eca2af258b1c026107

1
externals/zydis vendored Submodule

@ -0,0 +1 @@
Subproject commit bd73bc03b0aacaa89c9c203b9b43cd08f1b1843b

171520
scripts/aerolib.inl Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
# Helper script that generates stub implementation of all known nids + lookup tables # Helper script that generates stub implementation of all known nids + lookup tables
# for shadps4 # for shadps4

259
src/.clang-format Normal file
View File

@ -0,0 +1,259 @@
# SPDX-FileCopyrightText: 2016 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
# SPDX-License-Identifier: GPL-2.0-or-later
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^\<[^Q][^/.>]*\>'
Priority: -2
- Regex: '^\<'
Priority: -1
- Regex: '^\"'
Priority: 0
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 150
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
---
Language: Java
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
IncludeCategories:
- Regex: '^\<[^Q][^/.>]*\>'
Priority: -2
- Regex: '^\<'
Priority: -1
- Regex: '^\"'
Priority: 0
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 150
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
---
Language: ObjC
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
IncludeCategories:
- Regex: '^\<[^Q][^/.>]*\>'
Priority: -2
- Regex: '^\<'
Priority: -1
- Regex: '^\"'
Priority: 0
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 150
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
...

View File

@ -1,122 +0,0 @@
#include "FsFile.h"
FsFile::FsFile()
{
m_file = nullptr;
}
FsFile::FsFile(const std::string& path, fsOpenMode mode)
{
Open(path, mode);
}
bool FsFile::Open(const std::string& path, fsOpenMode mode)
{
Close();
#ifdef _WIN64
fopen_s(&m_file, path.c_str(), getOpenMode(mode));
#else
m_file = std::fopen(path.c_str(), getOpenMode(mode));
#endif
return IsOpen();
}
bool FsFile::Close()
{
if (!IsOpen() || std::fclose(m_file) != 0) {
m_file = nullptr;
return false;
}
m_file = nullptr;
return true;
}
FsFile::~FsFile()
{
Close();
}
bool FsFile::Write(const void* src, u64 size)
{
if (!IsOpen() || std::fwrite(src, 1, size, m_file) != size) {
return false;
}
return true;
}
bool FsFile::Read(void* dst, u64 size)
{
if (!IsOpen() || std::fread(dst, 1, size, m_file) != size) {
return false;
}
return true;
}
u32 FsFile::ReadBytes(void* dst, u64 size)
{
return std::fread(dst, 1, size, m_file);
}
bool FsFile::Seek(s64 offset, fsSeekMode mode)
{
#ifdef _WIN64
if (!IsOpen() || _fseeki64(m_file, offset, getSeekMode(mode)) != 0) {
return false;
}
#else
if (!IsOpen() || fseeko64(m_file, offset, getSeekMode(mode)) != 0) {
return false;
}
#endif
return true;
}
u64 FsFile::Tell() const
{
if (IsOpen()) {
#ifdef _WIN64
return _ftelli64(m_file);
#else
return ftello64(m_file);
#endif
}
else {
return -1;
}
}
u64 FsFile::getFileSize()
{
#ifdef _WIN64
u64 pos = _ftelli64(m_file);
if (_fseeki64(m_file, 0, SEEK_END) != 0) {
return 0;
}
u64 size = _ftelli64(m_file);
if (_fseeki64(m_file, pos, SEEK_SET) != 0) {
return 0;
}
#else
u64 pos = ftello64(m_file);
if (fseeko64(m_file, 0, SEEK_END) != 0) {
return 0;
}
u64 size = ftello64(m_file);
if (fseeko64(m_file, pos, SEEK_SET) != 0) {
return 0;
}
#endif
return size;
}
bool FsFile::IsOpen() const
{
return m_file != nullptr;
}

View File

@ -1,62 +0,0 @@
#pragma once
#include <cstdio>
#include <string>
#include "../types.h"
enum fsOpenMode
{
fsRead = 0x1,
fsWrite = 0x2,
fsReadWrite = fsRead | fsWrite
};
enum fsSeekMode
{
fsSeekSet,
fsSeekCur,
fsSeekEnd,
};
class FsFile
{
std::FILE* m_file;
public:
FsFile();
FsFile(const std::string& path, fsOpenMode mode = fsRead);
bool Open(const std::string& path, fsOpenMode mode = fsRead);
bool IsOpen() const;
bool Close();
bool Read(void* dst, u64 size);
u32 ReadBytes(void* dst, u64 size);
bool Write(const void* src, u64 size);
bool Seek(s64 offset, fsSeekMode mode);
u64 getFileSize();
u64 Tell() const;
~FsFile();
const char* getOpenMode(fsOpenMode mode)
{
switch (mode) {
case fsRead: return "rb";
case fsWrite: return "wb";
case fsReadWrite: return "r+b";
}
return "r";
}
const int getSeekMode(fsSeekMode mode)
{
switch (mode) {
case fsSeekSet: return SEEK_SET;
case fsSeekCur: return SEEK_CUR;
case fsSeekEnd: return SEEK_END;
}
return SEEK_SET;
}
std::FILE* fileDescr()
{
return m_file;
}
};

View File

@ -1,188 +0,0 @@
#include "gpu_memory.h"
#include <xxhash/xxh3.h>
#include "Emulator/Util/singleton.h"
void* GPU::memoryCreateObj(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx, void* todo /*CommandBuffer?*/, u64 virtual_addr, u64 size,
const GPUObject& info) {
auto* gpumemory = singleton<GPUMemory>::instance();
return gpumemory->memoryCreateObj(submit_id, ctx, nullptr, &virtual_addr, &size, 1, info);
}
void GPU::memorySetAllocArea(u64 virtual_addr, u64 size) {
auto* gpumemory = singleton<GPUMemory>::instance();
Lib::LockMutexGuard lock(gpumemory->m_mutex);
MemoryHeap h;
h.allocated_virtual_addr = virtual_addr;
h.allocated_size = size;
gpumemory->m_heaps.push_back(h);
}
u64 GPU::calculate_hash(const u08* buf, u64 size) { return (size > 0 && buf != nullptr ? XXH3_64bits(buf, size) : 0); }
bool GPU::vulkanAllocateMemory(HLE::Libs::Graphics::GraphicCtx* ctx, HLE::Libs::Graphics::VulkanMemory* mem) {
static std::atomic_uint64_t unique_id = 0;
VkPhysicalDeviceMemoryProperties memory_properties{};
vkGetPhysicalDeviceMemoryProperties(ctx->m_physical_device, &memory_properties);
u32 index = 0;
for (; index < memory_properties.memoryTypeCount; index++) {
if ((mem->requirements.memoryTypeBits & (static_cast<uint32_t>(1) << index)) != 0 &&
(memory_properties.memoryTypes[index].propertyFlags & mem->property) == mem->property) {
break;
}
}
mem->type = index;
mem->offset = 0;
VkMemoryAllocateInfo alloc_info{};
alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
alloc_info.pNext = nullptr;
alloc_info.allocationSize = mem->requirements.size;
alloc_info.memoryTypeIndex = index;
mem->unique_id = ++unique_id;
auto result = vkAllocateMemory(ctx->m_device, &alloc_info, nullptr, &mem->memory);
if (result == VK_SUCCESS) {
return true;
}
return false;
}
void GPU::flushGarlic(HLE::Libs::Graphics::GraphicCtx* ctx) {
auto* gpumemory = singleton<GPUMemory>::instance();
gpumemory->flushAllHeaps(ctx);
}
int GPU::GPUMemory::getHeapId(u64 virtual_addr, u64 size) {
int index = 0;
for (const auto& heap : m_heaps) {
if ((virtual_addr >= heap.allocated_virtual_addr && virtual_addr < heap.allocated_virtual_addr + heap.allocated_size) ||
((virtual_addr + size - 1) >= heap.allocated_virtual_addr &&
(virtual_addr + size - 1) < heap.allocated_virtual_addr + heap.allocated_size)) {
return index;
}
index++;
}
return -1;
}
void* GPU::GPUMemory::memoryCreateObj(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx, void* todo, const u64* virtual_addr, const u64* size,
int virtual_addr_num, const GPUObject& info) {
auto* gpumemory = singleton<GPUMemory>::instance();
Lib::LockMutexGuard lock(gpumemory->m_mutex);
int heap_id = gpumemory->getHeapId(virtual_addr[0], size[0]);
if (heap_id < 0) {
return nullptr;
}
auto& heap = m_heaps[heap_id];
ObjInfo objInfo = {};
// copy parameters from info to obj
for (int i = 0; i < 8; i++) {
objInfo.obj_params[i] = info.obj_params[i];
}
objInfo.gpu_object.objectType = info.objectType;
objInfo.gpu_object.obj = nullptr;
for (int h = 0; h < virtual_addr_num; h++) {
if (info.check_hash) {
objInfo.hash[h] = GPU::calculate_hash(reinterpret_cast<const u08*>(virtual_addr[h]), size[h]);
} else {
objInfo.hash[h] = 0;
}
}
objInfo.submit_id = submit_id;
objInfo.check_hash = info.check_hash;
objInfo.gpu_object.obj = info.getCreateFunc()(ctx, objInfo.obj_params, virtual_addr, size, virtual_addr_num, &objInfo.mem);
objInfo.update_func = info.getUpdateFunc();
int index = static_cast<int>(heap.objects.size());
HeapObject hobj{};
hobj.block = createHeapBlock(virtual_addr, size, virtual_addr_num, heap_id, index);
hobj.info = objInfo;
hobj.free = false;
heap.objects.push_back(hobj);
return objInfo.gpu_object.obj;
}
GPU::HeapBlock GPU::GPUMemory::createHeapBlock(const u64* virtual_addr, const u64* size, int virtual_addr_num, int heap_id, int obj_id) {
auto& heap = m_heaps[heap_id];
GPU::HeapBlock heapBlock{};
heapBlock.virtual_addr_num = virtual_addr_num;
for (int vi = 0; vi < virtual_addr_num; vi++) {
heapBlock.virtual_addr[vi] = virtual_addr[vi];
heapBlock.size[vi] = size[vi];
}
return heapBlock;
}
void GPU::GPUMemory::update(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx, int heap_id, int obj_id) {
auto& heap = m_heaps[heap_id];
auto& heapObj = heap.objects[obj_id];
auto& objInfo = heapObj.info;
bool need_update = false;
if (submit_id > objInfo.submit_id) {
uint64_t hash[3] = {};
for (int i = 0; i < heapObj.block.virtual_addr_num; i++) {
if (objInfo.check_hash) {
hash[i] = GPU::calculate_hash(reinterpret_cast<const uint8_t*>(heapObj.block.virtual_addr[i]), heapObj.block.size[i]);
} else {
hash[i] = 0;
}
}
for (int i = 0; i < heapObj.block.virtual_addr_num; i++) {
if (objInfo.hash[i] != hash[i]) {
need_update = true;
objInfo.hash[i] = hash[i];
}
}
if (submit_id != UINT64_MAX) {
objInfo.submit_id = submit_id;
}
}
if (need_update) {
objInfo.update_func(ctx, objInfo.obj_params, objInfo.gpu_object.obj, heapObj.block.virtual_addr, heapObj.block.size,
heapObj.block.virtual_addr_num);
}
}
void GPU::GPUMemory::flushAllHeaps(HLE::Libs::Graphics::GraphicCtx* ctx) {
Lib::LockMutexGuard lock(m_mutex);
int heap_id = 0;
for (auto& heap : m_heaps) {
int index = 0;
for (auto& heapObj : heap.objects) {
if (!heapObj.free) {
update(UINT64_MAX, ctx, heap_id, index);
}
index++;
}
heap_id++;
}
}

View File

@ -1,84 +0,0 @@
#pragma once
#include <Core/PS4/HLE/Graphics/graphics_ctx.h>
#include <types.h>
#include <vector>
namespace GPU {
class GPUObject;
enum class MemoryMode : u32 { NoAccess = 0, Read = 1, Write = 2, ReadWrite = 3 };
enum class MemoryObjectType : u64 { InvalidObj, VideoOutBufferObj };
struct GpuMemoryObject {
MemoryObjectType objectType = MemoryObjectType::InvalidObj;
void* obj = nullptr;
};
struct HeapBlock {
u64 virtual_addr[3] = {};
u64 size[3] = {};
int virtual_addr_num = 0;
};
class GPUObject {
public:
GPUObject() = default;
virtual ~GPUObject() = default;
u64 obj_params[8] = {};
bool check_hash = false;
bool isReadOnly = false;
MemoryObjectType objectType = MemoryObjectType::InvalidObj;
using create_func_t = void* (*)(HLE::Libs::Graphics::GraphicCtx* ctx, const u64* params, const u64* virtual_addr, const u64* size, int virtual_addr_num,
HLE::Libs::Graphics::VulkanMemory* mem);
using update_func_t = void (*)(HLE::Libs::Graphics::GraphicCtx* ctx, const u64* params, void* obj, const u64* virtual_addr, const u64* size,
int virtual_addr_num);
virtual create_func_t getCreateFunc() const = 0;
virtual update_func_t getUpdateFunc() const = 0;
};
struct ObjInfo {
u64 obj_params[8] = {};
GpuMemoryObject gpu_object;
u64 hash[3] = {};
u64 submit_id = 0;
bool check_hash = false;
HLE::Libs::Graphics::VulkanMemory mem;
GPU::GPUObject::update_func_t update_func = nullptr;
};
struct HeapObject {
HeapBlock block;
ObjInfo info;
bool free = true;
};
struct MemoryHeap {
u64 allocated_virtual_addr = 0;
u64 allocated_size = 0;
std::vector<HeapObject> objects;
};
class GPUMemory {
public:
GPUMemory() {}
virtual ~GPUMemory() {}
int getHeapId(u64 vaddr, u64 size);
Lib::Mutex m_mutex;
std::vector<MemoryHeap> m_heaps;
void* memoryCreateObj(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx, /*CommandBuffer* buffer*/ void* todo, const u64* virtual_addr,
const u64* size, int virtual_addr_num, const GPUObject& info);
HeapBlock createHeapBlock(const u64* virtual_addr, const u64* size, int virtual_addr_num, int heap_id, int obj_id);
void update(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx, int heap_id, int obj_id);
void flushAllHeaps(HLE::Libs::Graphics::GraphicCtx* ctx);
};
void memorySetAllocArea(u64 virtual_addr, u64 size);
void* memoryCreateObj(u64 submit_id, HLE::Libs::Graphics::GraphicCtx* ctx, /*CommandBuffer* buffer*/ void* todo, u64 virtual_addr, u64 size,
const GPUObject& info);
u64 calculate_hash(const u08* buf, u64 size);
bool vulkanAllocateMemory(HLE::Libs::Graphics::GraphicCtx* ctx, HLE::Libs::Graphics::VulkanMemory* mem);
void flushGarlic(HLE::Libs::Graphics::GraphicCtx* ctx);
} // namespace GPU

View File

@ -1,169 +0,0 @@
#include "tile_manager.h"
#include "Lib/Threads.h"
#include "Emulator/Util/singleton.h"
namespace GPU {
static u32 IntLog2(u32 i) { return 31 - __builtin_clz(i | 1u); }
class TileManager {
public:
TileManager(){}
virtual ~TileManager() { }
Lib::Mutex m_mutex;
};
class TileManager32 {
public:
u32 m_macro_tile_height = 0;
u32 m_bank_height = 0;
u32 m_num_banks = 0;
u32 m_num_pipes = 0;
u32 m_padded_width = 0;
u32 m_padded_height = 0;
u32 m_pipe_bits = 0;
u32 m_bank_bits = 0;
void Init(u32 width, u32 height, bool is_neo) {
m_macro_tile_height = (is_neo ? 128 : 64);
m_bank_height = is_neo ? 2 : 1;
m_num_banks = is_neo ? 8 : 16;
m_num_pipes = is_neo ? 16 : 8;
m_padded_width = width;
if (height == 1080) {
m_padded_height = is_neo ? 1152 : 1088;
}
if (height == 720) {
m_padded_height = 768;
}
m_pipe_bits = is_neo ? 4 : 3;
m_bank_bits = is_neo ? 3 : 4;
}
static u32 getElementIdx(u32 x, u32 y) {
u32 elem = 0;
elem |= ((x >> 0u) & 0x1u) << 0u;
elem |= ((x >> 1u) & 0x1u) << 1u;
elem |= ((y >> 0u) & 0x1u) << 2u;
elem |= ((x >> 2u) & 0x1u) << 3u;
elem |= ((y >> 1u) & 0x1u) << 4u;
elem |= ((y >> 2u) & 0x1u) << 5u;
return elem;
}
static u32 getPipeIdx(u32 x, u32 y, bool is_neo) {
u32 pipe = 0;
if (!is_neo) {
pipe |= (((x >> 3u) ^ (y >> 3u) ^ (x >> 4u)) & 0x1u) << 0u;
pipe |= (((x >> 4u) ^ (y >> 4u)) & 0x1u) << 1u;
pipe |= (((x >> 5u) ^ (y >> 5u)) & 0x1u) << 2u;
} else {
pipe |= (((x >> 3u) ^ (y >> 3u) ^ (x >> 4u)) & 0x1u) << 0u;
pipe |= (((x >> 4u) ^ (y >> 4u)) & 0x1u) << 1u;
pipe |= (((x >> 5u) ^ (y >> 5u)) & 0x1u) << 2u;
pipe |= (((x >> 6u) ^ (y >> 5u)) & 0x1u) << 3u;
}
return pipe;
}
static u32 getBankIdx(u32 x, u32 y, u32 bank_width, u32 bank_height, u32 num_banks, u32 num_pipes) {
const u32 x_shift_offset = IntLog2(bank_width * num_pipes);
const u32 y_shift_offset = IntLog2(bank_height);
const u32 xs = x >> x_shift_offset;
const u32 ys = y >> y_shift_offset;
u32 bank = 0;
switch (num_banks) {
case 8:
bank |= (((xs >> 3u) ^ (ys >> 5u)) & 0x1u) << 0u;
bank |= (((xs >> 4u) ^ (ys >> 4u) ^ (ys >> 5u)) & 0x1u) << 1u;
bank |= (((xs >> 5u) ^ (ys >> 3u)) & 0x1u) << 2u;
break;
case 16:
bank |= (((xs >> 3u) ^ (ys >> 6u)) & 0x1u) << 0u;
bank |= (((xs >> 4u) ^ (ys >> 5u) ^ (ys >> 6u)) & 0x1u) << 1u;
bank |= (((xs >> 5u) ^ (ys >> 4u)) & 0x1u) << 2u;
bank |= (((xs >> 6u) ^ (ys >> 3u)) & 0x1u) << 3u;
break;
default:;
}
return bank;
}
u64 getTiledOffs(u32 x, u32 y, bool is_neo) const {
u64 element_index = getElementIdx(x, y);
u32 xh = x;
u32 yh = y;
u64 pipe = getPipeIdx(xh, yh, is_neo);
u64 bank = getBankIdx(xh, yh, 1, m_bank_height, m_num_banks, m_num_pipes);
u32 tile_bytes = (8 * 8 * 32 + 7) / 8;
u64 element_offset = (element_index * 32);
u64 tile_split_slice = 0;
if (tile_bytes > 512) {
tile_split_slice = element_offset / (static_cast<u64>(512) * 8);
element_offset %= (static_cast<u64>(512) * 8);
tile_bytes = 512;
}
u64 macro_tile_bytes = (128 / 8) * (m_macro_tile_height / 8) * tile_bytes / (m_num_pipes * m_num_banks);
u64 macro_tiles_per_row = m_padded_width / 128;
u64 macro_tile_row_index = y / m_macro_tile_height;
u64 macro_tile_column_index = x / 128;
u64 macro_tile_index = (macro_tile_row_index * macro_tiles_per_row) + macro_tile_column_index;
u64 macro_tile_offset = macro_tile_index * macro_tile_bytes;
u64 macro_tiles_per_slice = macro_tiles_per_row * (m_padded_height / m_macro_tile_height);
u64 slice_bytes = macro_tiles_per_slice * macro_tile_bytes;
u64 slice_offset = tile_split_slice * slice_bytes;
u64 tile_row_index = (y / 8) % m_bank_height;
u64 tile_index = tile_row_index;
u64 tile_offset = tile_index * tile_bytes;
u64 tile_split_slice_rotation = ((m_num_banks / 2) + 1) * tile_split_slice;
bank ^= tile_split_slice_rotation;
bank &= (m_num_banks - 1);
u64 total_offset = (slice_offset + macro_tile_offset + tile_offset) * 8 + element_offset;
u64 bit_offset = total_offset & 0x7u;
total_offset /= 8;
u64 pipe_interleave_offset = total_offset & 0xffu;
u64 offset = total_offset >> 8u;
u64 byte_offset = pipe_interleave_offset | (pipe << (8u)) | (bank << (8u + m_pipe_bits)) | (offset << (8u + m_pipe_bits + m_bank_bits));
return ((byte_offset << 3u) | bit_offset) / 8;
}
};
void convertTileToLinear(void* dst, const void* src,u32 width, u32 height, bool is_neo) {
TileManager32 t;
t.Init(width, height, is_neo);
auto* g_TileManager = singleton<TileManager>::instance();
Lib::LockMutexGuard lock(g_TileManager->m_mutex);
for (u32 y = 0; y < height; y++) {
u32 x = 0;
u64 linear_offset = y * width * 4;
for (; x + 1 < width; x += 2) {
auto tiled_offset = t.getTiledOffs(x, y, is_neo);
*reinterpret_cast<u64*>(static_cast<u08*>(dst) + linear_offset) =
*reinterpret_cast<const u64*>(static_cast<const u08*>(src) + tiled_offset);
linear_offset += 8;
}
if (x < width) {
auto tiled_offset = t.getTiledOffs(x, y, is_neo);
*reinterpret_cast<u32*>(static_cast<u08*>(dst) + linear_offset) =
*reinterpret_cast<const u32*>(static_cast<const u08*>(src) + tiled_offset);
}
}
}
} // namespace GPU

View File

@ -1,8 +0,0 @@
#pragma once
#include "types.h"
namespace GPU {
void convertTileToLinear(void* dst, const void* src, u32 width, u32 height, bool neo);
}

View File

@ -1,140 +0,0 @@
#include "video_out_buffer.h"
#include <Util/log.h>
#include "debug.h"
#include <vulkan_util.h>
#include "tile_manager.h"
constexpr bool log_file_videoOutBuffer = true; // disable it to disable logging
static void update_func(HLE::Libs::Graphics::GraphicCtx* ctx, const u64* params, void* obj, const u64* virtual_addr, const u64* size,
int virtual_addr_num) {
auto pitch = params[GPU::VideoOutBufferObj::PITCH_PARAM];
bool tiled = (params[GPU::VideoOutBufferObj::IS_TILE_PARAM] != 0);
bool neo = (params[GPU::VideoOutBufferObj::IS_NEO_PARAM] != 0);
auto width = params[GPU::VideoOutBufferObj::WIDTH_PARAM];
auto height = params[GPU::VideoOutBufferObj::HEIGHT_PARAM];
auto* vk_obj = static_cast<HLE::Libs::Graphics::VideoOutVulkanImage*>(obj);
vk_obj->layout = VK_IMAGE_LAYOUT_UNDEFINED;
if (tiled)
{
auto* tempbuff = new u08[*size];
GPU::convertTileToLinear(tempbuff, reinterpret_cast<void*>(*virtual_addr), width, height, neo);
Graphics::Vulkan::vulkanFillImage(ctx, vk_obj, tempbuff, *size, pitch, static_cast<uint64_t>(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL));
delete[] tempbuff;
} else {
Graphics::Vulkan::vulkanFillImage(ctx, vk_obj, reinterpret_cast<void*>(*virtual_addr), *size, pitch,
static_cast<uint64_t>(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL));
}
}
static void* create_func(HLE::Libs::Graphics::GraphicCtx* ctx, const u64* params, const u64* virtual_addr, const u64* size, int virtual_addr_num,
HLE::Libs::Graphics::VulkanMemory* mem) {
auto pixel_format = params[GPU::VideoOutBufferObj::PIXEL_FORMAT_PARAM];
auto width = params[GPU::VideoOutBufferObj::WIDTH_PARAM];
auto height = params[GPU::VideoOutBufferObj::HEIGHT_PARAM];
auto* vk_obj = new HLE::Libs::Graphics::VideoOutVulkanImage;
VkFormat vk_format = VK_FORMAT_UNDEFINED;
switch (pixel_format) {
case static_cast<uint64_t>(GPU::VideoOutBufferFormat::R8G8B8A8Srgb): vk_format = VK_FORMAT_R8G8B8A8_SRGB; break;
case static_cast<uint64_t>(GPU::VideoOutBufferFormat::B8G8R8A8Srgb): vk_format = VK_FORMAT_B8G8R8A8_SRGB; break;
default: LOG_CRITICAL_IF(log_file_videoOutBuffer, "unknown pixelFormat = {}\n", pixel_format); std::exit(0);
}
vk_obj->extent.width = width;
vk_obj->extent.height = height;
vk_obj->format = vk_format;
vk_obj->image = nullptr;
vk_obj->layout = VK_IMAGE_LAYOUT_UNDEFINED;
for (auto& view : vk_obj->image_view) {
view = nullptr;
}
VkImageCreateInfo image_info{};
image_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
image_info.pNext = nullptr;
image_info.flags = 0;
image_info.imageType = VK_IMAGE_TYPE_2D;
image_info.extent.width = vk_obj->extent.width;
image_info.extent.height = vk_obj->extent.height;
image_info.extent.depth = 1;
image_info.mipLevels = 1;
image_info.arrayLayers = 1;
image_info.format = vk_obj->format;
image_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_info.initialLayout = vk_obj->layout;
image_info.usage =
static_cast<VkImageUsageFlags>(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT) | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
image_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
image_info.samples = VK_SAMPLE_COUNT_1_BIT;
vkCreateImage(ctx->m_device, &image_info, nullptr, &vk_obj->image);
if (vk_obj->image == nullptr) {
LOG_CRITICAL_IF(log_file_videoOutBuffer, "vk_obj->image is null\n");
std::exit(0);
}
vkGetImageMemoryRequirements(ctx->m_device, vk_obj->image, &mem->requirements);
mem->property = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
bool allocated = GPU::vulkanAllocateMemory(ctx, mem);
if (!allocated) {
LOG_CRITICAL_IF(log_file_videoOutBuffer, "can't allocate vulkan memory\n");
std::exit(0);
}
vkBindImageMemory(ctx->m_device, vk_obj->image, mem->memory, mem->offset);
vk_obj->memory = *mem;
LOG_INFO_IF(log_file_videoOutBuffer, "videoOutBuffer create object\n");
LOG_INFO_IF(log_file_videoOutBuffer, "mem requirements.size = {}\n", mem->requirements.size);
LOG_INFO_IF(log_file_videoOutBuffer, "width = {}\n", width);
LOG_INFO_IF(log_file_videoOutBuffer, "height = {}\n", height);
LOG_INFO_IF(log_file_videoOutBuffer, "size = {}\n", *size);
update_func(ctx, params, vk_obj, virtual_addr, size, virtual_addr_num);
VkImageViewCreateInfo create_info{};
create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
create_info.pNext = nullptr;
create_info.flags = 0;
create_info.image = vk_obj->image;
create_info.viewType = VK_IMAGE_VIEW_TYPE_2D;
create_info.format = vk_obj->format;
create_info.components.r = VK_COMPONENT_SWIZZLE_IDENTITY;
create_info.components.g = VK_COMPONENT_SWIZZLE_IDENTITY;
create_info.components.b = VK_COMPONENT_SWIZZLE_IDENTITY;
create_info.components.a = VK_COMPONENT_SWIZZLE_IDENTITY;
create_info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
create_info.subresourceRange.baseArrayLayer = 0;
create_info.subresourceRange.baseMipLevel = 0;
create_info.subresourceRange.layerCount = 1;
create_info.subresourceRange.levelCount = 1;
vkCreateImageView(ctx->m_device, &create_info, nullptr, &vk_obj->image_view[HLE::Libs::Graphics::VulkanImage::VIEW_DEFAULT]);
if (vk_obj->image_view[HLE::Libs::Graphics::VulkanImage::VIEW_DEFAULT] == nullptr) {
LOG_CRITICAL_IF(log_file_videoOutBuffer, "vk_obj->image_view is null\n");
std::exit(0);
}
return vk_obj;
}
GPU::GPUObject::create_func_t GPU::VideoOutBufferObj::getCreateFunc() const { return create_func; }
GPU::GPUObject::update_func_t GPU::VideoOutBufferObj::getUpdateFunc() const { return update_func; }

View File

@ -1,38 +0,0 @@
#pragma once
#include <types.h>
#include "gpu_memory.h"
namespace GPU {
enum class VideoOutBufferFormat : u64 {
Unknown,
R8G8B8A8Srgb,
B8G8R8A8Srgb,
};
class VideoOutBufferObj : public GPUObject {
public:
static constexpr int PIXEL_FORMAT_PARAM = 0;
static constexpr int WIDTH_PARAM = 1;
static constexpr int HEIGHT_PARAM = 2;
static constexpr int IS_TILE_PARAM = 3;
static constexpr int IS_NEO_PARAM = 4;
static constexpr int PITCH_PARAM = 5;
explicit VideoOutBufferObj(VideoOutBufferFormat pixel_format, u32 width, u32 height, bool is_tiled, bool is_neo, u32 pitch) {
obj_params[PIXEL_FORMAT_PARAM] = static_cast<uint64_t>(pixel_format);
obj_params[WIDTH_PARAM] = width;
obj_params[HEIGHT_PARAM] = height;
obj_params[IS_TILE_PARAM] = is_tiled ? 1 : 0;
obj_params[IS_NEO_PARAM] = is_neo ? 1 : 0;
obj_params[PITCH_PARAM] = pitch;
check_hash = true;
objectType = GPU::MemoryObjectType::VideoOutBufferObj;
}
create_func_t getCreateFunc() const override;
update_func_t getUpdateFunc() const override;
};
} // namespace GPU

View File

@ -1,22 +0,0 @@
#pragma once
constexpr int SCE_OK = 0;
constexpr int SCE_KERNEL_ERROR_EBADF = 0x80020009;
constexpr int SCE_KERNEL_ERROR_ENOMEM = 0x8002000c; // Insufficient memory
constexpr int SCE_KERNEL_ERROR_EFAULT = 0x8002000e; // Invalid address pointer
constexpr int SCE_KERNEL_ERROR_EINVAL = 0x80020016; // null or invalid states
constexpr int SCE_KERNEL_ERROR_EAGAIN = 0x80020023; // Memory cannot be allocated
constexpr int SCE_KERNEL_ERROR_ENAMETOOLONG = 0x8002003f; // character strings exceeds valid size
// videoOut
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_VALUE = 0x80290001; // invalid argument
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_ADDRESS = 0x80290002; // invalid addresses
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_TILING_MODE = 0x80290007; // invalid tiling mode
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_ASPECT_RATIO = 0x80290008; // invalid aspect ration
constexpr int SCE_VIDEO_OUT_ERROR_RESOURCE_BUSY = 0x80290009; // already opened
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_INDEX = 0x8029000A; // invalid buffer index
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_HANDLE = 0x8029000B; // invalid handle
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_EVENT_QUEUE = 0x8029000C; // Invalid event queue
constexpr int SCE_VIDEO_OUT_ERROR_SLOT_OCCUPIED = 0x80290010; // slot already used
constexpr int SCE_VIDEO_OUT_ERROR_FLIP_QUEUE_FULL = 0x80290012; // flip queue is full
constexpr int SCE_VIDEO_OUT_ERROR_INVALID_OPTION = 0x8029001A; // Invalid buffer attribute option

View File

@ -1,134 +0,0 @@
#include "video_out_ctx.h"
#include <Core/PS4/HLE/LibKernel.h>
#include <debug.h>
namespace HLE::Graphics::Objects {
void VideoOutCtx::Init(u32 width, u32 height) {
m_video_out_ctx.m_resolution.fullWidth = width;
m_video_out_ctx.m_resolution.fullHeight = height;
m_video_out_ctx.m_resolution.paneWidth = width;
m_video_out_ctx.m_resolution.paneHeight = height;
}
int VideoOutCtx::Open() {
Lib::LockMutexGuard lock(m_mutex);
int handle = -1;
if (!m_video_out_ctx.isOpened) {
handle = 1; // positive return , should be more than 1 ?
}
m_video_out_ctx.isOpened = true;
m_video_out_ctx.m_flip_status = SceVideoOutFlipStatus();
m_video_out_ctx.m_flip_status.flipArg = -1;
m_video_out_ctx.m_flip_status.currentBuffer = -1;
m_video_out_ctx.m_flip_status.count = 0;
m_video_out_ctx.m_vblank_status = SceVideoOutVblankStatus();
return handle;
}
void VideoOutCtx::Close(s32 handle) {
Lib::LockMutexGuard lock(m_mutex);
m_video_out_ctx.isOpened = false;
if (m_video_out_ctx.m_flip_evtEq.size() > 0)
{
BREAKPOINT(); //we need to clear all events if they have been created
}
m_video_out_ctx.m_flip_rate = 0;
// clear buffers
for (auto& buffer : m_video_out_ctx.buffers) {
buffer.buffer = nullptr;
buffer.buffer_render = nullptr;
buffer.buffer_size = 0;
buffer.set_id = 0;
}
m_video_out_ctx.buffers_sets.clear();
m_video_out_ctx.buffers_registration_index = 0;
}
VideoConfigInternal* VideoOutCtx::getCtx(int handle) {
if (handle != 1) return nullptr;
return &m_video_out_ctx; // assuming that it's the only ctx TODO check if we need more
}
void FlipQueue::getFlipStatus(VideoConfigInternal* cfg, SceVideoOutFlipStatus* out) {
Lib::LockMutexGuard lock(m_mutex);
*out = cfg->m_flip_status;
}
bool FlipQueue::submitFlip(VideoConfigInternal* cfg, s32 index, s64 flip_arg) {
Lib::LockMutexGuard lock(m_mutex);
if (m_requests.size() >= 2) {
return false;
}
Request r{};
r.cfg = cfg;
r.index = index;
r.flip_arg = flip_arg;
r.submit_tsc = HLE::Libs::LibKernel::sceKernelReadTsc();
m_requests.push_back(r);
cfg->m_flip_status.flipPendingNum = static_cast<int>(m_requests.size());
cfg->m_flip_status.gcQueueNum = 0;
m_submit_cond.SignalCondVar();
return true;
}
bool FlipQueue::flip(u32 micros) {
m_mutex.LockMutex();
if (m_requests.size() == 0) {
m_submit_cond.WaitCondVarFor(&m_mutex, micros);
if (m_requests.size() == 0) {
m_mutex.UnlockMutex();
return false;
}
}
auto request = m_requests.at(0); // proceed first request
m_mutex.UnlockMutex();
auto* buffer = request.cfg->buffers[request.index].buffer_render;
Emu::DrawBuffer(buffer);
m_mutex.LockMutex();
request.cfg->m_mutex.LockMutex();
for (auto& flip_eq : request.cfg->m_flip_evtEq) {
if (flip_eq != nullptr) {
flip_eq->triggerEvent(SCE_VIDEO_OUT_EVENT_FLIP, HLE::Kernel::Objects::EVFILT_VIDEO_OUT, reinterpret_cast<void*>(request.flip_arg));
}
}
request.cfg->m_mutex.UnlockMutex();
m_requests.erase(m_requests.begin());
m_done_cond.SignalCondVar();
request.cfg->m_flip_status.count++;
//TODO request.cfg->m_flip_status.processTime = LibKernel::KernelGetProcessTime();
request.cfg->m_flip_status.tsc = HLE::Libs::LibKernel::sceKernelReadTsc();
request.cfg->m_flip_status.submitTsc = request.submit_tsc;
request.cfg->m_flip_status.flipArg = request.flip_arg;
request.cfg->m_flip_status.currentBuffer = request.index;
request.cfg->m_flip_status.flipPendingNum = static_cast<int>(m_requests.size());
m_mutex.UnlockMutex();
return false;
}
}; // namespace HLE::Graphics::Objects

View File

@ -1,79 +0,0 @@
#pragma once
#include <Core/PS4/HLE/Graphics/video_out.h>
#include <Lib/Threads.h>
#include <Core/PS4/HLE/Graphics/graphics_ctx.h>
#include <emulator.h>
using namespace HLE::Libs::Graphics::VideoOut;
namespace HLE::Graphics::Objects {
struct VideoOutBufferInfo {
const void* buffer = nullptr;
HLE::Libs::Graphics::VideoOutVulkanImage* buffer_render = nullptr;
u64 buffer_size = 0;
u64 buffer_pitch = 0;
int set_id = 0;
};
struct VideoConfigInternal {
Lib::Mutex m_mutex;
SceVideoOutResolutionStatus m_resolution;
bool isOpened = false;
SceVideoOutFlipStatus m_flip_status;
SceVideoOutVblankStatus m_vblank_status;
std::vector<HLE::Libs::LibKernel::EventQueues::SceKernelEqueue> m_flip_evtEq;
int m_flip_rate = 0;
VideoOutBufferInfo buffers[16];
std::vector<VideoOutBufferSetInternal> buffers_sets;
int buffers_registration_index = 0;
};
class FlipQueue {
public:
FlipQueue() {}
virtual ~FlipQueue() {}
void getFlipStatus(VideoConfigInternal* cfg, SceVideoOutFlipStatus* out);
bool submitFlip(VideoConfigInternal* cfg, s32 index, s64 flip_arg);
bool flip(u32 micros);
private:
struct Request {
VideoConfigInternal* cfg;
int index;
int64_t flip_arg;
uint64_t submit_tsc;
};
Lib::Mutex m_mutex;
Lib::ConditionVariable m_submit_cond;
Lib::ConditionVariable m_done_cond;
std::vector<Request> m_requests;
};
class VideoOutCtx {
public:
VideoOutCtx() {}
virtual ~VideoOutCtx() {}
void Init(u32 width, u32 height);
int Open();
void Close(s32 handle);
VideoConfigInternal* getCtx(int handle);
FlipQueue& getFlipQueue() { return m_flip_queue; }
HLE::Libs::Graphics::GraphicCtx* getGraphicCtx() {
Lib::LockMutexGuard lock(m_mutex);
if (m_graphic_ctx == nullptr) {
m_graphic_ctx = Emu::getGraphicCtx();
}
return m_graphic_ctx;
}
private:
Lib::Mutex m_mutex;
VideoConfigInternal m_video_out_ctx;
FlipQueue m_flip_queue;
HLE::Libs::Graphics::GraphicCtx* m_graphic_ctx = nullptr;
};
}; // namespace HLE::Graphics::Objects

View File

@ -1,73 +0,0 @@
#pragma once
#include <types.h>
#include <vulkan/vulkan_core.h>
#include "Lib/Threads.h"
namespace HLE::Libs::Graphics {
struct VulkanCommandPool {
Lib::Mutex mutex;
VkCommandPool pool = nullptr;
VkCommandBuffer* buffers = nullptr;
VkFence* fences = nullptr;
VkSemaphore* semaphores = nullptr;
bool* busy = nullptr;
u32 buffers_count = 0;
};
struct VulkanQueueInfo {
Lib::Mutex* mutex = nullptr;
u32 family = static_cast<u32>(-1);
u32 index = static_cast<u32>(-1);
VkQueue vk_queue = nullptr;
};
struct GraphicCtx {
u32 screen_width = 0;
u32 screen_height = 0;
VkInstance m_instance = nullptr;
VkPhysicalDevice m_physical_device = nullptr;
VkDevice m_device = nullptr;
VulkanQueueInfo queues[11]; // VULKAN_QUEUES_NUM
};
enum class VulkanImageType { Unknown, VideoOut };
struct VulkanMemory {
VkMemoryRequirements requirements = {};
VkMemoryPropertyFlags property = 0;
VkDeviceMemory memory = nullptr;
VkDeviceSize offset = 0;
u32 type = 0;
u64 unique_id = 0;
};
struct VulkanBuffer {
VkBuffer buffer = nullptr;
VulkanMemory memory;
VkBufferUsageFlags usage = 0;
};
struct VulkanImage {
static constexpr int VIEW_MAX = 4;
static constexpr int VIEW_DEFAULT = 0;
static constexpr int VIEW_BGRA = 1;
static constexpr int VIEW_DEPTH_TEXTURE = 2;
explicit VulkanImage(VulkanImageType type) : type(type) {}
VulkanImageType type = VulkanImageType::Unknown;
VkFormat format = VK_FORMAT_UNDEFINED;
VkExtent2D extent = {};
VkImage image = nullptr;
VkImageView image_view[VIEW_MAX] = {};
VkImageLayout layout = VK_IMAGE_LAYOUT_UNDEFINED;
VulkanMemory memory;
};
struct VideoOutVulkanImage : public VulkanImage {
VideoOutVulkanImage() : VulkanImage(VulkanImageType::VideoOut) {}
};
} // namespace HLE::Libs::Graphics

View File

@ -1,232 +0,0 @@
#include "graphics_render.h"
#include "Emulator/Util/singleton.h"
#include "emulator.h"
static thread_local GPU::CommandPool g_command_pool;
void GPU::renderCreateCtx() {
auto* render_ctx = singleton<RenderCtx>::instance();
render_ctx->setGraphicCtx(Emu::getGraphicCtx());
}
void GPU::CommandBuffer::allocateBuffer() {
m_pool = g_command_pool.getPool(m_queue);
Lib::LockMutexGuard lock(m_pool->mutex);
for (uint32_t i = 0; i < m_pool->buffers_count; i++) {
if (!m_pool->busy[i]) {
m_pool->busy[i] = true;
vkResetCommandBuffer(m_pool->buffers[i], VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT);
m_index = i;
break;
}
}
}
void GPU::CommandBuffer::freeBuffer() {
Lib::LockMutexGuard lock(m_pool->mutex);
waitForFence();
m_pool->busy[m_index] = false;
vkResetCommandBuffer(m_pool->buffers[m_index], VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT);
m_index = static_cast<uint32_t>(-1);
}
void GPU::CommandBuffer::waitForFence() {
auto* render_ctx = singleton<RenderCtx>::instance();
if (m_execute) {
auto* device = render_ctx->getGraphicCtx()->m_device;
vkWaitForFences(device, 1, &m_pool->fences[m_index], VK_TRUE, UINT64_MAX);
vkResetFences(device, 1, &m_pool->fences[m_index]);
m_execute = false;
}
}
void GPU::CommandBuffer::begin() const {
auto* buffer = m_pool->buffers[m_index];
VkCommandBufferBeginInfo begin_info{};
begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
begin_info.pNext = nullptr;
begin_info.flags = 0;
begin_info.pInheritanceInfo = nullptr;
auto result = vkBeginCommandBuffer(buffer, &begin_info);
if (result != VK_SUCCESS) {
printf("vkBeginCommandBuffer failed\n");
std::exit(0);
}
}
void GPU::CommandBuffer::end() const {
auto* buffer = m_pool->buffers[m_index];
auto result = vkEndCommandBuffer(buffer);
if (result != VK_SUCCESS) {
printf("vkEndCommandBuffer failed\n");
std::exit(0);
}
}
void GPU::CommandBuffer::executeWithSemaphore() {
auto* buffer = m_pool->buffers[m_index];
auto* fence = m_pool->fences[m_index];
VkSubmitInfo submit_info{};
submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
submit_info.pNext = nullptr;
submit_info.waitSemaphoreCount = 0;
submit_info.pWaitSemaphores = nullptr;
submit_info.pWaitDstStageMask = nullptr;
submit_info.commandBufferCount = 1;
submit_info.pCommandBuffers = &buffer;
submit_info.signalSemaphoreCount = 1;
submit_info.pSignalSemaphores = &m_pool->semaphores[m_index];
auto* render_ctx = singleton<RenderCtx>::instance();
const auto& queue = render_ctx->getGraphicCtx()->queues[m_queue];
if (queue.mutex != nullptr) {
queue.mutex->LockMutex();
}
auto result = vkQueueSubmit(queue.vk_queue, 1, &submit_info, fence);
if (queue.mutex != nullptr) {
queue.mutex->LockMutex();
}
m_execute = true;
if (result != VK_SUCCESS) {
printf("vkQueueSubmit failed\n");
std::exit(0);
}
}
void GPU::CommandBuffer::execute() {
auto* buffer = m_pool->buffers[m_index];
auto* fence = m_pool->fences[m_index];
VkSubmitInfo submit_info{};
submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
submit_info.pNext = nullptr;
submit_info.waitSemaphoreCount = 0;
submit_info.pWaitSemaphores = nullptr;
submit_info.pWaitDstStageMask = nullptr;
submit_info.commandBufferCount = 1;
submit_info.pCommandBuffers = &buffer;
submit_info.signalSemaphoreCount = 0;
submit_info.pSignalSemaphores = nullptr;
auto* render_ctx = singleton<RenderCtx>::instance();
const auto& queue = render_ctx->getGraphicCtx()->queues[m_queue];
if (queue.mutex != nullptr) {
queue.mutex->LockMutex();
}
auto result = vkQueueSubmit(queue.vk_queue, 1, &submit_info, fence);
if (queue.mutex != nullptr) {
queue.mutex->UnlockMutex();
}
m_execute = true;
if (result != VK_SUCCESS) {
printf("vkQueueSubmit failed\n");
std::exit(0);
}
}
void GPU::CommandPool::createPool(int id) {
auto* render_ctx = singleton<RenderCtx>::instance();
auto* ctx = render_ctx->getGraphicCtx();
m_pool[id] = new HLE::Libs::Graphics::VulkanCommandPool;
VkCommandPoolCreateInfo pool_info{};
pool_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
pool_info.pNext = nullptr;
pool_info.queueFamilyIndex = ctx->queues[id].family;
pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
vkCreateCommandPool(ctx->m_device, &pool_info, nullptr, &m_pool[id]->pool);
if (m_pool[id]->pool == nullptr) {
printf("pool is nullptr");
std::exit(0);
}
m_pool[id]->buffers_count = 4;
m_pool[id]->buffers = new VkCommandBuffer[m_pool[id]->buffers_count];
m_pool[id]->fences = new VkFence[m_pool[id]->buffers_count];
m_pool[id]->semaphores = new VkSemaphore[m_pool[id]->buffers_count];
m_pool[id]->busy = new bool[m_pool[id]->buffers_count];
VkCommandBufferAllocateInfo alloc_info{};
alloc_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
alloc_info.commandPool = m_pool[id]->pool;
alloc_info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
alloc_info.commandBufferCount = m_pool[id]->buffers_count;
if (vkAllocateCommandBuffers(ctx->m_device, &alloc_info, m_pool[id]->buffers) != VK_SUCCESS) {
printf("Can't allocate command buffers\n");
std::exit(0);
}
for (uint32_t i = 0; i < m_pool[id]->buffers_count; i++) {
m_pool[id]->busy[i] = false;
VkFenceCreateInfo fence_info{};
fence_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
fence_info.pNext = nullptr;
fence_info.flags = 0;
if (vkCreateFence(ctx->m_device, &fence_info, nullptr, &m_pool[id]->fences[i]) != VK_SUCCESS) {
printf("Can't create fence\n");
std::exit(0);
}
VkSemaphoreCreateInfo semaphore_info{};
semaphore_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
semaphore_info.pNext = nullptr;
semaphore_info.flags = 0;
if (vkCreateSemaphore(ctx->m_device, &semaphore_info, nullptr, &m_pool[id]->semaphores[i]) != VK_SUCCESS) {
printf("Can't create semas\n");
std::exit(0);
}
}
}
void GPU::CommandPool::deleteAllPool() {
auto* render_ctx = singleton<RenderCtx>::instance();
auto* ctx = render_ctx->getGraphicCtx();
for (auto& pool : m_pool) {
if (pool != nullptr) {
for (uint32_t i = 0; i < pool->buffers_count; i++) {
vkDestroySemaphore(ctx->m_device, pool->semaphores[i], nullptr);
vkDestroyFence(ctx->m_device, pool->fences[i], nullptr);
}
vkFreeCommandBuffers(ctx->m_device, pool->pool, pool->buffers_count, pool->buffers);
vkDestroyCommandPool(ctx->m_device, pool->pool, nullptr);
delete[] pool->semaphores;
delete[] pool->fences;
delete[] pool->buffers;
delete[] pool->busy;
delete pool;
pool = nullptr;
}
}
}

View File

@ -1,63 +0,0 @@
#pragma once
#include "graphics_ctx.h"
namespace GPU {
class CommandPool {
public:
CommandPool() = default;
~CommandPool() {}
HLE::Libs::Graphics::VulkanCommandPool* getPool(int id) {
if (m_pool[id] == nullptr) {
createPool(id);
}
return m_pool[id];
}
private:
void createPool(int id);
void deleteAllPool();
HLE::Libs::Graphics::VulkanCommandPool* m_pool[11] = {};
};
class CommandBuffer {
public:
explicit CommandBuffer(int queue) : m_queue(queue) { allocateBuffer(); }
virtual ~CommandBuffer() { freeBuffer(); }
void allocateBuffer();
void freeBuffer();
void waitForFence();
void begin() const;
void end() const;
void executeWithSemaphore();
void execute();
u32 getIndex() const { return m_index; }
HLE::Libs::Graphics::VulkanCommandPool* getPool() { return m_pool; }
private:
int m_queue = -1;
u32 m_index = static_cast<u32>(-1);
HLE::Libs::Graphics::VulkanCommandPool* m_pool = nullptr;
bool m_execute = false;
};
class Framebuffer {
public:
Framebuffer() {}
virtual ~Framebuffer() {}
};
class RenderCtx {
public:
RenderCtx() : m_framebuffer(new Framebuffer) {}
virtual ~RenderCtx() {}
void setGraphicCtx(HLE::Libs::Graphics::GraphicCtx* ctx) { m_graphic_ctx = ctx; }
HLE::Libs::Graphics::GraphicCtx* getGraphicCtx() { return m_graphic_ctx; }
private:
Framebuffer* m_framebuffer = nullptr;
HLE::Libs::Graphics::GraphicCtx* m_graphic_ctx = nullptr;
};
void renderCreateCtx();
}; // namespace GPU

View File

@ -1,322 +0,0 @@
#include "video_out.h"
#include <Core/PS4/GPU/gpu_memory.h>
#include <Core/PS4/GPU/video_out_buffer.h>
#include <Core/PS4/HLE/ErrorCodes.h>
#include <Core/PS4/HLE/LibSceGnmDriver.h>
#include <Core/PS4/HLE/Libs.h>
#include <Core/PS4/HLE/UserManagement/UsrMngCodes.h>
#include <Util/config.h>
#include <Util/log.h>
#include <debug.h>
#include <stdio.h>
#include <magic_enum.hpp>
#include <string>
#include "Objects/video_out_ctx.h"
#include "Emulator/Util/singleton.h"
#include "emulator.h"
#include "graphics_render.h"
namespace HLE::Libs::Graphics::VideoOut {
constexpr bool log_file_videoout = true; // disable it to disable logging
void videoOutInit(u32 width, u32 height) {
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
videoOut->Init(width, height);
}
bool videoOutFlip(u32 micros) {
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
return videoOut->getFlipQueue().flip(micros);
}
std::string getPixelFormatString(s32 format) {
switch (format) {
case SCE_VIDEO_OUT_PIXEL_FORMAT_A8R8G8B8_SRGB: return "PIXEL_FORMAT_A8R8G8B8_SRGB";
case SCE_VIDEO_OUT_PIXEL_FORMAT_A8B8G8R8_SRGB: return "PIXEL_FORMAT_A8B8G8R8_SRGB";
case SCE_VIDEO_OUT_PIXEL_FORMAT_A2R10G10B10: return "PIXEL_FORMAT_A2R10G10B10";
case SCE_VIDEO_OUT_PIXEL_FORMAT_A2R10G10B10_SRGB: return "PIXEL_FORMAT_A2R10G10B10_SRGB";
case SCE_VIDEO_OUT_PIXEL_FORMAT_A2R10G10B10_BT2020_PQ: return "PIXEL_FORMAT_A2R10G10B10_BT2020_PQ";
case SCE_VIDEO_OUT_PIXEL_FORMAT_A16R16G16B16_FLOAT: return "PIXEL_FORMAT_A16R16G16B16_FLOAT";
case SCE_VIDEO_OUT_PIXEL_FORMAT_YCBCR420_BT709: return "PIXEL_FORMAT_YCBCR420_BT709";
default: return "Unknown pixel format";
}
}
void PS4_SYSV_ABI sceVideoOutSetBufferAttribute(SceVideoOutBufferAttribute* attribute, u32 pixelFormat, u32 tilingMode, u32 aspectRatio, u32 width,
u32 height, u32 pitchInPixel) {
PRINT_FUNCTION_NAME();
auto tileMode = magic_enum::enum_cast<SceVideoOutTilingMode>(tilingMode);
auto aspectR = magic_enum::enum_cast<AspectRatioMode>(aspectRatio);
LOG_INFO_IF(log_file_videoout, "pixelFormat = {}\n", getPixelFormatString(pixelFormat));
LOG_INFO_IF(log_file_videoout, "tilingMode = {}\n", magic_enum::enum_name(tileMode.value()));
LOG_INFO_IF(log_file_videoout, "aspectRatio = {}\n", magic_enum::enum_name(aspectR.value()));
LOG_INFO_IF(log_file_videoout, "width = {}\n", width);
LOG_INFO_IF(log_file_videoout, "height = {}\n", height);
LOG_INFO_IF(log_file_videoout, "pitchInPixel = {}\n", pitchInPixel);
memset(attribute, 0, sizeof(SceVideoOutBufferAttribute));
attribute->pixelFormat = pixelFormat;
attribute->tilingMode = tilingMode;
attribute->aspectRatio = aspectRatio;
attribute->width = width;
attribute->height = height;
attribute->pitchInPixel = pitchInPixel;
attribute->option = SCE_VIDEO_OUT_BUFFER_ATTRIBUTE_OPTION_NONE;
}
static void flip_reset_event_func(HLE::Kernel::Objects::EqueueEvent* event) {
event->isTriggered = false;
event->event.fflags = 0;
event->event.data = 0;
}
static void flip_trigger_event_func(HLE::Kernel::Objects::EqueueEvent* event, void* trigger_data) {
event->isTriggered = true;
event->event.fflags++;
event->event.data = reinterpret_cast<intptr_t>(trigger_data);
}
static void flip_delete_event_func(LibKernel::EventQueues::SceKernelEqueue eq, HLE::Kernel::Objects::EqueueEvent* event) {
BREAKPOINT(); // TODO
}
s32 PS4_SYSV_ABI sceVideoOutAddFlipEvent(LibKernel::EventQueues::SceKernelEqueue eq, s32 handle, void* udata) {
PRINT_FUNCTION_NAME();
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
auto* ctx = videoOut->getCtx(handle);
if (ctx == nullptr) {
return SCE_VIDEO_OUT_ERROR_INVALID_HANDLE;
}
Lib::LockMutexGuard lock(ctx->m_mutex);
if (eq == nullptr) {
return SCE_VIDEO_OUT_ERROR_INVALID_EVENT_QUEUE;
}
HLE::Kernel::Objects::EqueueEvent event;
event.isTriggered = false;
event.event.ident = SCE_VIDEO_OUT_EVENT_FLIP;
event.event.filter = HLE::Kernel::Objects::EVFILT_VIDEO_OUT;
event.event.udata = udata;
event.event.fflags = 0;
event.event.data = 0;
event.filter.delete_event_func = flip_delete_event_func;
event.filter.reset_event_func = flip_reset_event_func;
event.filter.trigger_event_func = flip_trigger_event_func;
event.filter.data = ctx;
int result = eq->addEvent(event);
ctx->m_flip_evtEq.push_back(eq);
return result;
}
s32 PS4_SYSV_ABI sceVideoOutRegisterBuffers(s32 handle, s32 startIndex, void* const* addresses, s32 bufferNum,
const SceVideoOutBufferAttribute* attribute) {
PRINT_FUNCTION_NAME();
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
auto* ctx = videoOut->getCtx(handle);
if (handle == 1) { // main port
if (startIndex < 0 || startIndex > 15) {
LOG_TRACE_IF(log_file_videoout, "invalid startIndex = {}\n", startIndex);
return SCE_VIDEO_OUT_ERROR_INVALID_VALUE;
}
if (bufferNum < 1 || bufferNum > 16) {
LOG_TRACE_IF(log_file_videoout, "invalid bufferNum = {}\n", bufferNum);
return SCE_VIDEO_OUT_ERROR_INVALID_VALUE;
}
}
if (addresses == nullptr) {
LOG_TRACE_IF(log_file_videoout, "addresses are null\n");
return SCE_VIDEO_OUT_ERROR_INVALID_ADDRESS;
}
if (attribute == nullptr) {
LOG_TRACE_IF(log_file_videoout, "attribute is null\n");
return SCE_VIDEO_OUT_ERROR_INVALID_OPTION;
}
if (attribute->aspectRatio != 0) {
LOG_TRACE_IF(log_file_videoout, "invalid aspect ratio = {}\n", attribute->aspectRatio);
return SCE_VIDEO_OUT_ERROR_INVALID_ASPECT_RATIO;
}
if (attribute->tilingMode < 0 || attribute->tilingMode > 1) {
LOG_TRACE_IF(log_file_videoout, "invalid tilingMode = {}\n", attribute->tilingMode);
return SCE_VIDEO_OUT_ERROR_INVALID_TILING_MODE;
}
LOG_INFO_IF(log_file_videoout, "startIndex = {}\n", startIndex);
LOG_INFO_IF(log_file_videoout, "bufferNum = {}\n", bufferNum);
LOG_INFO_IF(log_file_videoout, "pixelFormat = {}\n", log_hex_full(attribute->pixelFormat));
LOG_INFO_IF(log_file_videoout, "tilingMode = {}\n", attribute->tilingMode);
LOG_INFO_IF(log_file_videoout, "aspectRatio = {}\n", attribute->aspectRatio);
LOG_INFO_IF(log_file_videoout, "width = {}\n", attribute->width);
LOG_INFO_IF(log_file_videoout, "height = {}\n", attribute->height);
LOG_INFO_IF(log_file_videoout, "pitchInPixel = {}\n", attribute->pitchInPixel);
LOG_INFO_IF(log_file_videoout, "option = {}\n", attribute->option);
int registration_index = ctx->buffers_registration_index++;
Emu::checkAndWaitForGraphicsInit();
GPU::renderCreateCtx();
// try to calculate buffer size
u64 buffer_size = 0; // still calculation is probably partial or wrong :D
if (attribute->tilingMode == 0) {
buffer_size = 1920 * 1088 * 4;
} else {
buffer_size = 1920 * 1080 * 4;
}
u64 buffer_pitch = attribute->pitchInPixel;
VideoOutBufferSetInternal buf{};
buf.start_index = startIndex;
buf.num = bufferNum;
buf.set_id = registration_index;
buf.attr = *attribute;
ctx->buffers_sets.push_back(buf);
GPU::VideoOutBufferFormat format = GPU::VideoOutBufferFormat::Unknown;
if (attribute->pixelFormat == 0x80000000) {
format = GPU::VideoOutBufferFormat::B8G8R8A8Srgb;
} else if (attribute->pixelFormat == 0x80002200) {
format = GPU::VideoOutBufferFormat::R8G8B8A8Srgb;
}
GPU::VideoOutBufferObj buffer_info(format, attribute->width, attribute->height, attribute->tilingMode == 0, Config::isNeoMode(), buffer_pitch);
for (int i = 0; i < bufferNum; i++) {
if (ctx->buffers[i + startIndex].buffer != nullptr) {
LOG_TRACE_IF(log_file_videoout, "buffer slot {} is occupied!\n", i + startIndex);
return SCE_VIDEO_OUT_ERROR_SLOT_OCCUPIED;
}
ctx->buffers[i + startIndex].set_id = registration_index;
ctx->buffers[i + startIndex].buffer = addresses[i];
ctx->buffers[i + startIndex].buffer_size = buffer_size;
ctx->buffers[i + startIndex].buffer_pitch = buffer_pitch;
ctx->buffers[i + startIndex].buffer_render = static_cast<Graphics::VideoOutVulkanImage*>(
GPU::memoryCreateObj(0, videoOut->getGraphicCtx(), nullptr, reinterpret_cast<uint64_t>(addresses[i]), buffer_size, buffer_info));
LOG_INFO_IF(log_file_videoout, "buffers[{}] = {}\n", i + startIndex, log_hex_full(reinterpret_cast<uint64_t>(addresses[i])));
}
return registration_index;
}
s32 PS4_SYSV_ABI sceVideoOutSetFlipRate(s32 handle, s32 rate) {
PRINT_FUNCTION_NAME();
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
videoOut->getCtx(handle)->m_flip_rate = rate;
return SCE_OK;
}
s32 PS4_SYSV_ABI sceVideoOutIsFlipPending(s32 handle) {
PRINT_FUNCTION_NAME();
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
s32 pending = videoOut->getCtx(handle)->m_flip_status.flipPendingNum;
return pending;
}
s32 PS4_SYSV_ABI sceVideoOutSubmitFlip(s32 handle, s32 bufferIndex, s32 flipMode, s64 flipArg) {
PRINT_FUNCTION_NAME();
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
auto* ctx = videoOut->getCtx(handle);
if (flipMode != 1) {
// BREAKPOINT(); // only flipmode==1 is supported
LOG_TRACE_IF(log_file_videoout, "sceVideoOutSubmitFlip flipmode {}\n", bufferIndex);//openBOR needs 2 but seems to work
}
if (bufferIndex == -1) {
BREAKPOINT(); // blank output not supported
}
if (bufferIndex < -1 || bufferIndex > 15) {
LOG_TRACE_IF(log_file_videoout, "sceVideoOutSubmitFlip invalid bufferIndex {}\n", bufferIndex);
return SCE_VIDEO_OUT_ERROR_INVALID_INDEX;
}
LOG_INFO_IF(log_file_videoout, "bufferIndex = {}\n", bufferIndex);
LOG_INFO_IF(log_file_videoout, "flipMode = {}\n", flipMode);
LOG_INFO_IF(log_file_videoout, "flipArg = {}\n", flipArg);
if (!videoOut->getFlipQueue().submitFlip(ctx, bufferIndex, flipArg)) {
LOG_TRACE_IF(log_file_videoout, "sceVideoOutSubmitFlip flip queue is full\n");
return SCE_VIDEO_OUT_ERROR_FLIP_QUEUE_FULL;
}
HLE::Libs::LibSceGnmDriver::sceGnmFlushGarlic(); // hackish should be done that neccesary for niko's homebrew
return SCE_OK;
}
s32 PS4_SYSV_ABI sceVideoOutGetFlipStatus(s32 handle, SceVideoOutFlipStatus* status) {
PRINT_FUNCTION_NAME();
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
auto* ctx = videoOut->getCtx(handle);
videoOut->getFlipQueue().getFlipStatus(ctx, status);
LOG_INFO_IF(log_file_videoout, "count = {}\n", status->count);
LOG_INFO_IF(log_file_videoout, "processTime = {}\n", status->processTime);
LOG_INFO_IF(log_file_videoout, "tsc = {}\n", status->tsc);
LOG_INFO_IF(log_file_videoout, "submitTsc = {}\n", status->submitTsc);
LOG_INFO_IF(log_file_videoout, "flipArg = {}\n", status->flipArg);
LOG_INFO_IF(log_file_videoout, "gcQueueNum = {}\n", status->gcQueueNum);
LOG_INFO_IF(log_file_videoout, "flipPendingNum = {}\n", status->flipPendingNum);
LOG_INFO_IF(log_file_videoout, "currentBuffer = {}\n", status->currentBuffer);
return 0;
}
s32 PS4_SYSV_ABI sceVideoOutGetResolutionStatus(s32 handle, SceVideoOutResolutionStatus* status) {
PRINT_FUNCTION_NAME();
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
*status = videoOut->getCtx(handle)->m_resolution;
return SCE_OK;
}
s32 PS4_SYSV_ABI sceVideoOutOpen(SceUserServiceUserId userId, s32 busType, s32 index, const void* param) {
PRINT_FUNCTION_NAME();
if (userId != SCE_USER_SERVICE_USER_ID_SYSTEM && userId != 0) {
BREAKPOINT();
}
if (busType != SCE_VIDEO_OUT_BUS_TYPE_MAIN) {
BREAKPOINT();
}
if (index != 0) {
LOG_TRACE_IF(log_file_videoout, "sceVideoOutOpen index!=0\n");
return SCE_VIDEO_OUT_ERROR_INVALID_VALUE;
}
if (param != nullptr) {
BREAKPOINT();
}
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
int handle = videoOut->Open();
if (handle < 0) {
LOG_TRACE_IF(log_file_videoout, "sceVideoOutOpen all available handles are open\n");
return SCE_VIDEO_OUT_ERROR_RESOURCE_BUSY; // it is alreadyOpened
}
return handle;
}
s32 PS4_SYSV_ABI sceVideoOutClose(s32 handle) {
auto* videoOut = singleton<HLE::Graphics::Objects::VideoOutCtx>::instance();
videoOut->Close(handle);
return SCE_OK;
}
s32 PS4_SYSV_ABI sceVideoOutUnregisterBuffers(s32 handle, s32 attributeIndex) { BREAKPOINT(); }
void videoOutRegisterLib(SymbolsResolver* sym) {
LIB_FUNCTION("SbU3dwp80lQ", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutGetFlipStatus);
LIB_FUNCTION("U46NwOiJpys", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutSubmitFlip);
LIB_FUNCTION("w3BY+tAEiQY", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutRegisterBuffers);
LIB_FUNCTION("HXzjK9yI30k", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutAddFlipEvent);
LIB_FUNCTION("CBiu4mCE1DA", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutSetFlipRate);
LIB_FUNCTION("i6-sR91Wt-4", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutSetBufferAttribute);
LIB_FUNCTION("6kPnj51T62Y", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutGetResolutionStatus);
LIB_FUNCTION("Up36PTk687E", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutOpen);
LIB_FUNCTION("zgXifHT9ErY", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutIsFlipPending);
LIB_FUNCTION("N5KDtkIjjJ4", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutUnregisterBuffers);
LIB_FUNCTION("uquVH4-Du78", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutClose);
}
} // namespace HLE::Libs::Graphics::VideoOut

View File

@ -1,92 +0,0 @@
#include "event_queue.h"
#include <Lib/Timer.h>
#include "debug.h"
namespace HLE::Kernel::Objects {
EqueueInternal::~EqueueInternal() {}
int EqueueInternal::addEvent(const EqueueEvent& event) {
Lib::LockMutexGuard lock(m_mutex);
if (m_events.size() > 0) {
BREAKPOINT();
}
// TODO check if event is already exists and return it. Currently we just add in m_events array
m_events.push_back(event);
if (event.isTriggered) {
BREAKPOINT(); // we don't support that either yet
}
return 0;
}
int EqueueInternal::waitForEvents(SceKernelEvent* ev, int num, u32 micros) {
Lib::LockMutexGuard lock(m_mutex);
u32 timeElapsed = 0;
Lib::Timer t;
t.Start();
for (;;) {
int ret = getTriggeredEvents(ev, num);
if (ret > 0 || (timeElapsed >= micros && micros != 0)) {
return ret;
}
if (micros == 0) {
m_cond.WaitCondVar(&m_mutex);
} else {
m_cond.WaitCondVarFor(&m_mutex, micros - timeElapsed);
}
timeElapsed = static_cast<uint32_t>(t.GetTimeSec() * 1000000.0);
}
return 0;
}
bool EqueueInternal::triggerEvent(u64 ident, s16 filter, void* trigger_data) {
Lib::LockMutexGuard lock(m_mutex);
if (m_events.size() > 1) {
BREAKPOINT(); // we currently support one event
}
auto& event = m_events[0];
if (event.filter.trigger_event_func != nullptr) {
event.filter.trigger_event_func(&event, trigger_data);
} else {
event.isTriggered = true;
}
m_cond.SignalCondVar();
return true;
}
int EqueueInternal::getTriggeredEvents(SceKernelEvent* ev, int num) {
Lib::LockMutexGuard lock(m_mutex);
int ret = 0;
if (m_events.size() > 1) {
BREAKPOINT(); // we currently support one event
}
auto& event = m_events[0];
if (event.isTriggered) {
ev[ret++] = event.event;
if (event.filter.reset_event_func != nullptr) {
event.filter.reset_event_func(&event);
}
}
return ret;
}
}; // namespace HLE::Kernel::Objects

View File

@ -1,78 +0,0 @@
#pragma once
#include <types.h>
#include <Lib/Threads.h>
#include <string>
#include <vector>
namespace HLE::Kernel::Objects {
constexpr s16 EVFILT_READ = -1;
constexpr s16 EVFILT_WRITE = -2;
constexpr s16 EVFILT_AIO = -3; // attached to aio requests
constexpr s16 EVFILT_VNODE = -4; // attached to vnodes
constexpr s16 EVFILT_PROC = -5; // attached to struct proc
constexpr s16 EVFILT_SIGNAL = -6; // attached to struct proc
constexpr s16 EVFILT_TIMER = -7; // timers
constexpr s16 EVFILT_FS = -9; // filesystem events
constexpr s16 EVFILT_LIO = -10; // attached to lio requests
constexpr s16 EVFILT_USER = -11; // User events
constexpr s16 EVFILT_POLLING = -12;
constexpr s16 EVFILT_VIDEO_OUT = -13;
constexpr s16 EVFILT_GRAPHICS_CORE = -14;
constexpr s16 EVFILT_HRTIMER = -15;
constexpr s16 EVFILT_UVD_TRAP = -16;
constexpr s16 EVFILT_VCE_TRAP = -17;
constexpr s16 EVFILT_SDMA_TRAP = -18;
constexpr s16 EVFILT_REG_EV = -19;
constexpr s16 EVFILT_GPU_EXCEPTION = -20;
constexpr s16 EVFILT_GPU_SYSTEM_EXCEPTION = -21;
constexpr s16 EVFILT_GPU_DBGGC_EV = -22;
constexpr s16 EVFILT_SYSCOUNT = 22;
class EqueueInternal;
struct EqueueEvent;
using SceKernelEqueue = Kernel::Objects::EqueueInternal*;
using TriggerFunc = void (*)(EqueueEvent* event, void* trigger_data);
using ResetFunc = void (*)(EqueueEvent* event);
using DeleteFunc = void (*)(SceKernelEqueue eq, EqueueEvent* event);
struct SceKernelEvent {
u64 ident = 0; /* identifier for this event */
s16 filter = 0; /* filter for event */
u16 flags = 0;
u32 fflags = 0;
s64 data = 0;
void* udata = nullptr; /* opaque user data identifier */
};
struct Filter {
void* data = nullptr;
TriggerFunc trigger_event_func = nullptr;
ResetFunc reset_event_func = nullptr;
DeleteFunc delete_event_func = nullptr;
};
struct EqueueEvent {
bool isTriggered = false;
SceKernelEvent event;
Filter filter;
};
class EqueueInternal {
public:
EqueueInternal() = default;
virtual ~EqueueInternal();
void setName(const std::string& m_name) { this->m_name = m_name; }
int addEvent(const EqueueEvent& event);
int waitForEvents(SceKernelEvent* ev, int num, u32 micros);
bool triggerEvent(u64 ident, s16 filter, void* trigger_data);
int getTriggeredEvents(SceKernelEvent* ev, int num);
private:
std::string m_name;
Lib::Mutex m_mutex;
std::vector<EqueueEvent> m_events;
Lib::ConditionVariable m_cond;
};
}; // namespace HLE::Kernel::Objects

View File

@ -1,62 +0,0 @@
#include "physical_memory.h"
namespace HLE::Kernel::Objects {
static u64 AlignUp(u64 pos, u64 align) { return (align != 0 ? (pos + (align - 1)) & ~(align - 1) : pos); }
bool PhysicalMemory::Alloc(u64 searchStart, u64 searchEnd, u64 len, u64 alignment, u64* physAddrOut, int memoryType) {
Lib::LockMutexGuard lock(m_mutex);
u64 find_free_pos = 0;
// iterate through allocated blocked and find the next free position
for (const auto& block : m_allocatedBlocks) {
u64 n = block.start_addr + block.size;
if (n > find_free_pos) {
find_free_pos = n;
}
}
// align free position
find_free_pos = AlignUp(find_free_pos, alignment);
// if the new position is between searchStart - searchEnd , allocate a new block
if (find_free_pos >= searchStart && find_free_pos + len <= searchEnd) {
AllocatedBlock block{};
block.size = len;
block.start_addr = find_free_pos;
block.memoryType = memoryType;
block.gpu_mode = GPU::MemoryMode::NoAccess;
block.map_size = 0;
block.map_virtual_addr = 0;
block.prot = 0;
block.cpu_mode = VirtualMemory::MemoryMode::NoAccess;
m_allocatedBlocks.push_back(block);
*physAddrOut = find_free_pos;
return true;
}
return false;
}
bool PhysicalMemory::Map(u64 virtual_addr, u64 phys_addr, u64 len, int prot, VirtualMemory::MemoryMode cpu_mode, GPU::MemoryMode gpu_mode) {
Lib::LockMutexGuard lock(m_mutex);
for (auto& b : m_allocatedBlocks) {
if (phys_addr >= b.start_addr && phys_addr < b.start_addr + b.size) {
if (b.map_virtual_addr != 0 || b.map_size != 0) {
return false;
}
b.map_virtual_addr = virtual_addr;
b.map_size = len;
b.prot = prot;
b.cpu_mode = cpu_mode;
b.gpu_mode = gpu_mode;
return true;
}
}
return false;
}
} // namespace HLE::Kernel::Objects

View File

@ -1,34 +0,0 @@
#pragma once
#include <types.h>
#include <Core/virtual_memory.h>
#include <Core/PS4/GPU/gpu_memory.h>
#include <vector>
#include "Lib/Threads.h"
namespace HLE::Kernel::Objects {
class PhysicalMemory {
public:
struct AllocatedBlock {
u64 start_addr;
u64 size;
int memoryType;
u64 map_virtual_addr;
u64 map_size;
int prot;
VirtualMemory::MemoryMode cpu_mode;
GPU::MemoryMode gpu_mode;
};
PhysicalMemory() {}
virtual ~PhysicalMemory() {}
public:
bool Alloc(u64 searchStart, u64 searchEnd, u64 len, u64 alignment, u64* physAddrOut, int memoryType);
bool Map(u64 virtual_addr, u64 phys_addr, u64 len, int prot, VirtualMemory::MemoryMode cpu_mode, GPU::MemoryMode gpu_mode);
private:
std::vector<AllocatedBlock> m_allocatedBlocks;
Lib::Mutex m_mutex;
};
} // namespace HLE::Kernel::Objects

View File

@ -1,125 +0,0 @@
#include "ThreadManagement.h"
#include <debug.h>
#include "../ErrorCodes.h"
namespace HLE::Libs::LibKernel::ThreadManagement {
thread_local PthreadInternal* g_pthread_self = nullptr;
PThreadCxt* g_pthread_cxt = nullptr;
void Pthread_Init_Self_MainThread() {
g_pthread_self = new PthreadInternal{};
scePthreadAttrInit(&g_pthread_self->attr);
g_pthread_self->pth = pthread_self();
g_pthread_self->name = "Main_Thread";
}
int scePthreadAttrInit(ScePthreadAttr* attr) {
*attr = new PthreadAttrInternal{};
int result = pthread_attr_init(&(*attr)->pth_attr);
(*attr)->affinity = 0x7f;
(*attr)->guard_size = 0x1000;
SceKernelSchedParam param{};
param.sched_priority = 700;
result = (result == 0 ? scePthreadAttrSetinheritsched(attr, 4) : result);
result = (result == 0 ? scePthreadAttrSetschedparam(attr, &param) : result);
result = (result == 0 ? scePthreadAttrSetschedpolicy(attr, SCHED_OTHER) : result);
result = (result == 0 ? scePthreadAttrSetdetachstate(attr, PTHREAD_CREATE_JOINABLE) : result);
switch (result) {
case 0: return SCE_OK;
case ENOMEM: return SCE_KERNEL_ERROR_ENOMEM;
default: return SCE_KERNEL_ERROR_EINVAL;
}
}
int scePthreadAttrSetdetachstate(ScePthreadAttr* attr, int detachstate) {
if (attr == nullptr || *attr == nullptr) {
return SCE_KERNEL_ERROR_EINVAL;
}
int pstate = PTHREAD_CREATE_JOINABLE;
switch (detachstate) {
case 0: pstate = PTHREAD_CREATE_JOINABLE; break;
case 1: pstate = PTHREAD_CREATE_DETACHED; break;
default: BREAKPOINT(); // unknown state
}
int result = pthread_attr_setdetachstate(&(*attr)->pth_attr, pstate);
(*attr)->detached = (pstate == PTHREAD_CREATE_DETACHED);
if (result == 0) {
return SCE_OK;
}
return SCE_KERNEL_ERROR_EINVAL;
}
int scePthreadAttrSetinheritsched(ScePthreadAttr* attr, int inheritSched) {
if (attr == nullptr || *attr == nullptr) {
return SCE_KERNEL_ERROR_EINVAL;
}
int pinherit_sched = PTHREAD_INHERIT_SCHED;
switch (inheritSched) {
case 0: pinherit_sched = PTHREAD_EXPLICIT_SCHED; break;
case 4: pinherit_sched = PTHREAD_INHERIT_SCHED; break;
default: BREAKPOINT(); // unknown inheritSched
}
int result = pthread_attr_setinheritsched(&(*attr)->pth_attr, pinherit_sched);
if (result == 0) {
return SCE_OK;
}
return SCE_KERNEL_ERROR_EINVAL;
}
int scePthreadAttrSetschedparam(ScePthreadAttr* attr, const SceKernelSchedParam* param) {
if (param == nullptr || attr == nullptr || *attr == nullptr) {
return SCE_KERNEL_ERROR_EINVAL;
}
SceKernelSchedParam pparam{};
if (param->sched_priority <= 478) {
pparam.sched_priority = +2;
} else if (param->sched_priority >= 733) {
pparam.sched_priority = -2;
} else {
pparam.sched_priority = 0;
}
int result = pthread_attr_setschedparam(&(*attr)->pth_attr, &pparam);
if (result == 0) {
return SCE_OK;
}
return SCE_KERNEL_ERROR_EINVAL;
}
int scePthreadAttrSetschedpolicy(ScePthreadAttr* attr, int policy) {
if (attr == nullptr || *attr == nullptr) {
return SCE_KERNEL_ERROR_EINVAL;
}
if (policy != SCHED_OTHER) {
BREAKPOINT(); // invest if policy is other and if winpthreadlibrary support it
}
(*attr)->policy = policy;
int result = pthread_attr_setschedpolicy(&(*attr)->pth_attr, policy);
if (result == 0) {
return SCE_OK;
}
return SCE_KERNEL_ERROR_EINVAL;
}
}; // namespace HLE::Libs::LibKernel::ThreadManagement

View File

@ -1,42 +0,0 @@
#pragma once
#define _TIMESPEC_DEFINED
#include <pthread.h>
#include <sched.h>
#include "../../../../types.h"
#include <string>
namespace HLE::Libs::LibKernel::ThreadManagement {
struct PthreadAttrInternal;
using SceKernelSchedParam = ::sched_param;
using ScePthreadAttr = PthreadAttrInternal*;
struct PthreadInternal {
u08 reserved[4096];
std::string name;
pthread_t pth;
ScePthreadAttr attr;
};
struct PthreadAttrInternal {
u08 reserved[64];
u64 affinity;
size_t guard_size;
int policy;
bool detached;
pthread_attr_t pth_attr;
};
class PThreadCxt {};
void Pthread_Init_Self_MainThread();
//HLE FUNCTIONS
int scePthreadAttrInit(ScePthreadAttr* attr);
int scePthreadAttrSetdetachstate(ScePthreadAttr* attr, int detachstate);
int scePthreadAttrSetinheritsched(ScePthreadAttr* attr, int inheritSched);
int scePthreadAttrSetschedparam(ScePthreadAttr* attr, const SceKernelSchedParam* param);
int scePthreadAttrSetschedpolicy(ScePthreadAttr* attr, int policy);
} // namespace HLE::Libs::LibKernel::ThreadManagement

View File

@ -1,13 +0,0 @@
#include "cpu_management.h"
#include "Util/config.h"
#include <Util/log.h>
#include <Core/PS4/HLE/Libs.h>
namespace HLE::Libs::LibKernel::CPUManagement {
int PS4_SYSV_ABI sceKernelIsNeoMode() {
PRINT_FUNCTION_NAME();
bool isNeo = Config::isNeoMode();
return isNeo ? 1 : 0;
}
}; // namespace HLE::Libs::LibKernel::CPUManagement

View File

@ -1,6 +0,0 @@
#pragma once
#include <types.h>
namespace HLE::Libs::LibKernel::CPUManagement {
int PS4_SYSV_ABI sceKernelIsNeoMode();
};

View File

@ -1,66 +0,0 @@
#include "event_queues.h"
#include <Core/PS4/HLE/ErrorCodes.h>
#include <Core/PS4/HLE/Libs.h>
#include <Util/log.h>
#include <debug.h>
namespace HLE::Libs::LibKernel::EventQueues {
constexpr bool log_file_equeues = true; // disable it to disable logging
int PS4_SYSV_ABI sceKernelCreateEqueue(SceKernelEqueue* eq, const char* name) {
PRINT_FUNCTION_NAME();
if (eq == nullptr) {
LOG_TRACE_IF(log_file_equeues, "sceKernelCreateEqueue returned SCE_KERNEL_ERROR_EINVAL eq invalid\n");
return SCE_KERNEL_ERROR_EINVAL;
}
if (name == nullptr) {
LOG_TRACE_IF(log_file_equeues, "sceKernelCreateEqueue returned SCE_KERNEL_ERROR_EFAULT name invalid\n");
return SCE_KERNEL_ERROR_EFAULT;
}
if (name == NULL) {
LOG_TRACE_IF(log_file_equeues, "sceKernelCreateEqueue returned SCE_KERNEL_ERROR_EINVAL name is null\n");
return SCE_KERNEL_ERROR_EINVAL;
}
if (strlen(name) > 31) { // max is 32 including null terminator
LOG_TRACE_IF(log_file_equeues, "sceKernelCreateEqueue returned SCE_KERNEL_ERROR_ENAMETOOLONG name size exceeds 32 bytes\n");
return SCE_KERNEL_ERROR_ENAMETOOLONG;
}
*eq = new Kernel::Objects::EqueueInternal;
(*eq)->setName(std::string(name));
LOG_INFO_IF(log_file_equeues, "sceKernelCreateEqueue created with name \"{}\"\n", name);
return SCE_OK;
}
int PS4_SYSV_ABI sceKernelWaitEqueue(SceKernelEqueue eq, HLE::Kernel::Objects::SceKernelEvent* ev, int num, int* out, SceKernelUseconds* timo) {
PRINT_FUNCTION_NAME();
if (eq == nullptr) {
return SCE_KERNEL_ERROR_EBADF;
}
if (ev == nullptr) {
return SCE_KERNEL_ERROR_EFAULT;
}
if (num < 1) {
return SCE_KERNEL_ERROR_EINVAL;
}
if (timo == nullptr) { // wait until an event arrives without timing out
*out = eq->waitForEvents(ev, num, 0);
}
if (timo != nullptr) {
if (*timo == 0) {//only events that have already arrived at the time of this function call can be received
BREAKPOINT();
} else { // wait until an event arrives with timing out
BREAKPOINT();
}
}
return SCE_OK;
}
}; // namespace HLE::Libs::LibKernel::EventQueues

View File

@ -1,14 +0,0 @@
#pragma once
#include <types.h>
#include "Objects/event_queue.h"
namespace HLE::Libs::LibKernel::EventQueues {
using SceKernelUseconds = u32;
using SceKernelEqueue = Kernel::Objects::EqueueInternal*;
int PS4_SYSV_ABI sceKernelCreateEqueue(SceKernelEqueue* eq, const char* name);
int PS4_SYSV_ABI sceKernelWaitEqueue(SceKernelEqueue eq, HLE::Kernel::Objects::SceKernelEvent* ev, int num, int* out, SceKernelUseconds *timo);
}; // namespace HLE::Libs::LibKernel::EventQueues

Some files were not shown because too many files have changed in this diff Show More