├── .gitmodules ├── misc ├── testRunner │ ├── summary │ │ ├── .gitkeep │ │ └── .gitignore │ └── package.json └── discordNotify │ ├── .gitignore │ └── package.json ├── .clang-format-ignore ├── tests ├── core │ ├── CMakeLists.txt │ └── semaphore │ │ └── CMakeLists.txt └── CMakeLists.txt ├── core ├── tests │ ├── core │ │ ├── CMakeLists.txt │ │ └── semaphore │ │ │ └── CMakeLists.txt │ └── CMakeLists.txt ├── imports │ └── exports │ │ ├── readme.md │ │ └── pm4_custom.h ├── fileManager │ ├── types │ │ ├── type_in.h │ │ ├── type_rng.h │ │ ├── type_null.h │ │ ├── type_zero.h │ │ ├── type_lib.h │ │ ├── type_random.h │ │ ├── type_file.h │ │ ├── type_out.h │ │ ├── type_null.cpp │ │ ├── type_zero.cpp │ │ ├── type_in.cpp │ │ └── type_random.cpp │ ├── readme.md │ └── CMakeLists.txt ├── timer │ └── CMakeLists.txt ├── unwinding │ ├── CMakeLists.txt │ └── unwind.h ├── memory │ └── CMakeLists.txt ├── trophies │ └── CMakeLists.txt ├── initParams │ ├── CMakeLists.txt │ └── initParams.h ├── runtime │ ├── util │ │ ├── virtualmemory.h │ │ ├── exceptionHandler.h │ │ ├── moduleLoader.h │ │ └── virtualmemory.cpp │ ├── memoryLayout.h │ ├── exports │ │ └── intern.h │ └── CMakeLists.txt ├── systemContent │ ├── CMakeLists.txt │ └── systemContent.h ├── dmem │ ├── types │ │ └── memory.h │ └── CMakeLists.txt ├── hotkeys │ └── CMakeLists.txt ├── kernel │ ├── errors.cpp │ ├── CMakeLists.txt │ ├── errors.h │ ├── semaphore.h │ ├── pthread_types.h │ ├── eventqueue.h │ └── eventflag.h ├── videoout │ ├── vulkan │ │ ├── vulkanTypes.h │ │ └── vulkanHelper.h │ ├── readme.md │ ├── CMakeLists.txt │ └── overlay │ │ ├── overlay.h │ │ ├── overtrophy │ │ └── overtrophy.h │ │ ├── imhelper.h │ │ └── gamemenu │ │ └── gamemenu.h ├── readme.md └── networking │ └── CMakeLists.txt ├── docs ├── wiki │ ├── markdown │ │ └── Home.md │ └── images │ │ └── vsbuild │ │ ├── cmake_pins.png │ │ ├── cmake_build.png │ │ ├── cmake_configure.png │ │ ├── debug_warning.png │ │ ├── optimizations.png │ │ ├── recomends_btn.png │ │ ├── recomends_help.png │ │ ├── default_compiler.png │ │ ├── recomends_install.png │ │ ├── default_compiler_popup.png │ │ └── default_compiler_sure.png ├── resource │ ├── R6xx_R7xx_3D.pdf │ ├── GLSLangSpec.4.60.pdf │ ├── si_programming_guide_v2.pdf │ ├── Vega_Shader_ISA_28July2017.pdf │ └── AMD_Southern_Islands_Instruction_Set_Architecture.pdf ├── uml │ └── modules │ │ ├── coreDeps.puml │ │ ├── videout_swapchain.puml │ │ └── videoout_class.puml └── json │ ├── logging.json │ ├── audio.json │ └── graphics.json ├── modules ├── libSceCes │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceHttp2 │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceNpAuth │ ├── types.h │ ├── codes.h │ └── CMakeLists.txt ├── libSceNpTus │ ├── types.h │ ├── codes.h │ └── CMakeLists.txt ├── libSceRandom │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceZlib │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── template │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceDiscMap │ ├── types.h │ ├── CMakeLists.txt │ ├── codes.h │ └── entry.cpp ├── libSceNpMatching2 │ ├── types.h │ ├── codes.h │ └── CMakeLists.txt ├── libSceNpParty │ ├── types.h │ ├── codes.h │ └── CMakeLists.txt ├── libSceNpWebApi2 │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceSysmodule │ ├── types.h │ └── CMakeLists.txt ├── libkernel_ps2emu │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceLibcInternal │ ├── types.h │ ├── codes.h │ └── CMakeLists.txt ├── libSceLibcInternalExt │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceSocialScreen │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceVideoRecording │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceNetCtlForNpToolkit │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceNpManagerForToolkit │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceSystemServicePs2Emu │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libkernel_cpumode_platform │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceUserServiceForNpToolkit │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceNpToolkit2 │ ├── codes.h │ └── CMakeLists.txt ├── libSceNpGameIntent │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceSystemGesture │ ├── codes.h │ └── CMakeLists.txt ├── libSceUsbd │ ├── types.h │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceDepth │ ├── codes.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceRudp │ ├── codes.h │ └── CMakeLists.txt ├── libSceAudiodecCpu │ ├── codes.h │ ├── CMakeLists.txt │ ├── types.h │ └── entry.cpp ├── libSceCoredump │ ├── codes.h │ ├── CMakeLists.txt │ └── types.h ├── libSceRemoteplay │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceScreenShot │ ├── codes.h │ ├── CMakeLists.txt │ ├── types.h │ └── entry.cpp ├── libSceVoice │ ├── codes.h │ └── CMakeLists.txt ├── libkernel_unity │ ├── codes.h │ └── CMakeLists.txt ├── libSceErrorDialog │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceImeDialog │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceMsgDialog │ ├── codes.h │ └── CMakeLists.txt ├── libSceNpCommerce │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceNpCommon │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceSigninDialog │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceVrTracker │ ├── codes.h │ └── CMakeLists.txt ├── libSceGameLiveStreaming │ ├── codes.h │ └── CMakeLists.txt ├── libSceInvitationDialog │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceNet │ ├── README.md │ ├── CMakeLists.txt │ ├── resolverTypes.h │ └── epoll.cpp ├── libSceNpProfileDialog │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceNpSnsFacebookDialog │ ├── codes.h │ ├── types.h │ ├── CMakeLists.txt │ └── entry.cpp ├── libSceShareUtility │ ├── types.h │ ├── CMakeLists.txt │ └── codes.h ├── libSceFaceTracker │ ├── codes.h │ └── CMakeLists.txt ├── libSceAudio3d │ ├── types.h │ ├── codes.h │ └── CMakeLists.txt ├── libSceNpSignaling │ ├── codes.h │ ├── CMakeLists.txt │ ├── types.h │ └── entry.cpp ├── libSceAjm │ ├── codes.h │ ├── CMakeLists.txt │ └── types.h ├── libSceHmd │ ├── codes.h │ ├── CMakeLists.txt │ └── types.h ├── libScePad │ ├── interfaces │ │ ├── isdl.h │ │ ├── ikbd.h │ │ └── ixip.h │ ├── CMakeLists.txt │ └── codes.h ├── libSceMoveTracker │ ├── codes.h │ ├── CMakeLists.txt │ ├── types.h │ └── entry.cpp ├── libScePadTracker │ ├── codes.h │ ├── CMakeLists.txt │ ├── types.h │ └── entry.cpp ├── libSceCamera │ ├── CMakeLists.txt │ └── codes.h ├── libSceContentExport │ ├── codes.h │ ├── CMakeLists.txt │ ├── entry.cpp │ └── types.h ├── libSceVoiceQoS │ ├── CMakeLists.txt │ ├── types.h │ └── codes.h ├── libSceFace │ ├── CMakeLists.txt │ └── codes.h ├── libSceIme │ └── CMakeLists.txt ├── libSceMove │ ├── CMakeLists.txt │ └── codes.h ├── libSceSsl │ ├── CMakeLists.txt │ └── types.h ├── libSceMouse │ ├── CMakeLists.txt │ ├── entry.cpp │ ├── codes.h │ └── types.h ├── libScePlayGo │ ├── CMakeLists.txt │ └── types.h ├── libSceAudioIn │ ├── CMakeLists.txt │ ├── types.h │ ├── entry.cpp │ └── codes.h ├── libSceAudiodec │ ├── CMakeLists.txt │ ├── codes.h │ ├── types.h │ └── entry.cpp ├── libSceNpManager │ ├── CMakeLists.txt │ └── onlineId.h ├── libSceNpScore │ ├── CMakeLists.txt │ └── codes.h ├── libSceNpWebApi │ ├── CMakeLists.txt │ └── codes.h ├── libSceSharePlay │ ├── CMakeLists.txt │ ├── codes.h │ ├── types.h │ └── entry.cpp ├── libSceCommonDialog │ ├── CMakeLists.txt │ ├── types.h │ ├── entry.cpp │ └── codes.h ├── libSceJson2 │ ├── CMakeLists.txt │ └── codes.h ├── libSceSaveDataDialog │ └── CMakeLists.txt ├── libScePosix │ ├── types.h │ ├── codes.h │ └── CMakeLists.txt ├── libSceVideoOut │ └── CMakeLists.txt ├── libSceGraphicsDriver │ ├── codes.h │ ├── CMakeLists.txt │ └── types.h ├── libSceHttp │ ├── CMakeLists.txt │ └── httpsTypes.h ├── libScePngDec │ ├── CMakeLists.txt │ ├── codes.h │ └── types.h ├── libScePngEnc │ ├── CMakeLists.txt │ ├── codes.h │ └── types.h ├── libSceUlt │ ├── CMakeLists.txt │ └── codes.h ├── libSceAppContent │ └── CMakeLists.txt ├── libSceNetCtl │ ├── CMakeLists.txt │ ├── types.h │ ├── codes.h │ └── entry.cpp ├── libSceNpTrophy │ └── CMakeLists.txt ├── setupModule.cmake ├── libSceSaveData │ └── CMakeLists.txt ├── libSceUserService │ ├── CMakeLists.txt │ └── codes.h ├── libSceRtc │ ├── CMakeLists.txt │ ├── types.h │ └── codes.h ├── libSceSystemService │ └── CMakeLists.txt ├── libSceAudioOut │ ├── CMakeLists.txt │ └── mastering.h ├── libSceNgs2 │ ├── CMakeLists.txt │ ├── riffTypes.h │ ├── reader.h │ └── readFuncs.h ├── libSceAvPlayer │ ├── CMakeLists.txt │ ├── entryEx.cpp │ ├── avplayer.h │ └── codes.h ├── libkernel │ ├── CMakeLists.txt │ └── codes.h └── CMakeLists.txt ├── .gitignore ├── asm ├── CMakeLists.txt ├── helper.h └── entry.asm ├── modules_include └── sceTypes.h ├── utility ├── CMakeLists.txt └── progloc.h ├── .vscode ├── extensions.json └── launch.json ├── readme.md ├── tools ├── dll2nids │ └── CMakeLists.txt ├── logging │ ├── logging_dummy.cpp │ ├── logging_stub.cpp │ ├── CMakeLists.txt │ └── logging_dummy.h ├── matchers │ ├── cmake.json │ └── compilers.json ├── config_emu │ ├── CmakeLists.txt │ └── config_emu.h └── gamereport │ ├── git_ver.cpp.in │ ├── CMakeLists.txt │ └── gamereport.h └── .github └── workflows ├── remArtifacst.yml ├── release_notify.yml └── upwiki.yml /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /misc/testRunner/summary/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.clang-format-ignore: -------------------------------------------------------------------------------- 1 | **/wepoll.* 2 | -------------------------------------------------------------------------------- /misc/testRunner/summary/.gitignore: -------------------------------------------------------------------------------- 1 | *.json 2 | -------------------------------------------------------------------------------- /tests/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(semaphore) -------------------------------------------------------------------------------- /core/tests/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(semaphore) -------------------------------------------------------------------------------- /docs/wiki/markdown/Home.md: -------------------------------------------------------------------------------- 1 | Welcome to the psOff_public wiki! 2 | -------------------------------------------------------------------------------- /misc/discordNotify/.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | node_modules 3 | -------------------------------------------------------------------------------- /modules/libSceCes/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceHttp2/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNpAuth/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNpTus/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceRandom/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceZlib/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/template/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceDiscMap/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNpMatching2/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNpParty/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNpWebApi2/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceSysmodule/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libkernel_ps2emu/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceLibcInternal/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceLibcInternalExt/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceSocialScreen/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceVideoRecording/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNetCtlForNpToolkit/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNpManagerForToolkit/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceSystemServicePs2Emu/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libkernel_cpumode_platform/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /misc/testRunner/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /modules/libSceUserServiceForNpToolkit/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | -------------------------------------------------------------------------------- /modules/libSceNpToolkit2/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Err {} // namespace Err 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _*/ 2 | .*/ 3 | !.vscode 4 | !.github 5 | .vscode/c_cpp_properties.json 6 | core/private -------------------------------------------------------------------------------- /modules/libSceNpGameIntent/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Err {} // namespace Err 4 | -------------------------------------------------------------------------------- /modules/libSceSystemGesture/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Err {} // namespace Err 4 | -------------------------------------------------------------------------------- /modules/libSceUsbd/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | struct SceUsbdDevice {}; -------------------------------------------------------------------------------- /asm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_language(C ASM_MASM) 2 | add_library(asmHelper OBJECT 3 | entry.asm 4 | ) -------------------------------------------------------------------------------- /core/imports/exports/readme.md: -------------------------------------------------------------------------------- 1 | ## Exports 2 | 3 | Exports currently provided by the emulator itself. -------------------------------------------------------------------------------- /modules/template/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceDepth/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceRudp/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceUsbd/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceZlib/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceAudiodecCpu/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceCes/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceCoredump/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceHttp2/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceLibcInternal/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceNpAuth/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpParty/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpTus/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceRemoteplay/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceScreenShot/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceSocialScreen/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceVoice/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libkernel_ps2emu/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libkernel_unity/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /docs/resource/R6xx_R7xx_3D.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/resource/R6xx_R7xx_3D.pdf -------------------------------------------------------------------------------- /modules/libSceErrorDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceErrorDialog/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceImeDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceImeDialog/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceLibcInternalExt/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceMsgDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpCommerce/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpCommerce/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceNpCommon/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpCommon/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceNpMatching2/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpWebApi2/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceSigninDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceVrTracker/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /docs/resource/GLSLangSpec.4.60.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/resource/GLSLangSpec.4.60.pdf -------------------------------------------------------------------------------- /modules/libSceGameLiveStreaming/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceInvitationDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceInvitationDialog/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceNet/README.md: -------------------------------------------------------------------------------- 1 | # libSceNet todo 2 | 3 | All these net interactions should be moved to `core/networking`. 4 | -------------------------------------------------------------------------------- /modules/libSceNetCtlForNpToolkit/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceNpManagerForToolkit/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceNpProfileDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpProfileDialog/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceSigninDialog/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceSystemServicePs2Emu/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceVideoRecording/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libkernel_cpumode_platform/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /modules/libSceNpSnsFacebookDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | -------------------------------------------------------------------------------- /modules/libSceNpSnsFacebookDialog/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\libSceCommonDialog\types.h" 3 | #include "codes.h" 4 | -------------------------------------------------------------------------------- /modules/libSceShareUtility/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | typedef int64_t SceContentSearchContentId; 5 | -------------------------------------------------------------------------------- /modules/libSceUserServiceForNpToolkit/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/cmake_pins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/cmake_pins.png -------------------------------------------------------------------------------- /docs/resource/si_programming_guide_v2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/resource/si_programming_guide_v2.pdf -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/cmake_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/cmake_build.png -------------------------------------------------------------------------------- /docs/resource/Vega_Shader_ISA_28July2017.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/resource/Vega_Shader_ISA_28July2017.pdf -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/cmake_configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/cmake_configure.png -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/debug_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/debug_warning.png -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/optimizations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/optimizations.png -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/recomends_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/recomends_btn.png -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/recomends_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/recomends_help.png -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/default_compiler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/default_compiler.png -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/recomends_install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/recomends_install.png -------------------------------------------------------------------------------- /core/fileManager/types/type_in.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createType_in(); 8 | -------------------------------------------------------------------------------- /core/fileManager/types/type_rng.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createType_rng(); 8 | -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/default_compiler_popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/default_compiler_popup.png -------------------------------------------------------------------------------- /docs/wiki/images/vsbuild/default_compiler_sure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/wiki/images/vsbuild/default_compiler_sure.png -------------------------------------------------------------------------------- /modules/libSceFaceTracker/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr int PARTS_NUM_MAX = 4; -------------------------------------------------------------------------------- /modules/libSceRandom/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t RANDOM_MAX_SIZE = 64; 6 | } // namespace Err -------------------------------------------------------------------------------- /core/fileManager/types/type_null.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createType_null(); 8 | -------------------------------------------------------------------------------- /core/fileManager/types/type_zero.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createType_zero(); 8 | -------------------------------------------------------------------------------- /modules/libSceAudio3d/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | typedef unsigned int SceAudio3dPortId; 5 | 6 | struct SceAudio3dOpenParameters {}; 7 | -------------------------------------------------------------------------------- /modules_include/sceTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct SceFQuaternion { 4 | float x, y, z, w; 5 | }; 6 | 7 | struct SceFVector3 { 8 | float x, y, z; 9 | }; -------------------------------------------------------------------------------- /core/fileManager/types/type_lib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | 5 | struct Program; 6 | std::unique_ptr createType_lib(Program* prog); 7 | -------------------------------------------------------------------------------- /core/fileManager/types/type_random.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createType_random(); 8 | -------------------------------------------------------------------------------- /modules/libSceAudio3d/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t OUT_OF_RESOURCES = -2132148218; 6 | } // namespace Err 7 | -------------------------------------------------------------------------------- /modules/libSceNpSignaling/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr uint32_t SCE_NP_ONLINEID_MAX_LENGTH = 16; -------------------------------------------------------------------------------- /asm/helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utility/utility.h" 3 | 4 | extern "C" { 5 | SYSV_ABI void jmpEntry(uint64_t addr, void const* entryParams, void* exitHandler); 6 | } 7 | -------------------------------------------------------------------------------- /modules/libSceAjm/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr uint64_t SCE_AJM_FLAG_SIDEBAND_STREAM = (1ULL << 47); -------------------------------------------------------------------------------- /utility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_library(psOff_utility STATIC utility.cpp) 3 | add_dependencies(psOff_utility logging) 4 | target_link_libraries(psOff_utility PRIVATE logging.lib) -------------------------------------------------------------------------------- /core/timer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(timer OBJECT 2 | timer.cpp 3 | ) 4 | 5 | add_dependencies(timer third_party) 6 | 7 | file(COPY timer.h DESTINATION ${DST_INCLUDE_DIR}/timer) -------------------------------------------------------------------------------- /modules/libSceHmd/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t ERROR_PARAMETER_NULL = -2129592312; /* 0x81110008 */ 6 | } // namespace Err -------------------------------------------------------------------------------- /modules/libScePad/interfaces/isdl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../icontroller.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createController_sdl(uint32_t); 8 | -------------------------------------------------------------------------------- /core/unwinding/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_language(C ASM_MASM) 2 | add_library(unwinding OBJECT 3 | unwind.asm 4 | ) 5 | 6 | file(COPY unwind.h DESTINATION ${DST_INCLUDE_DIR}/imports/unwinding) -------------------------------------------------------------------------------- /docs/resource/AMD_Southern_Islands_Instruction_Set_Architecture.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SysRay/psOff_public/HEAD/docs/resource/AMD_Southern_Islands_Instruction_Set_Architecture.pdf -------------------------------------------------------------------------------- /misc/discordNotify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "main": "main.js", 4 | "dependencies": { 5 | "@octokit/rest": "^20.1.0", 6 | "node-fetch": "^3.3.2" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/libSceMoveTracker/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t ERROR_INVALID_ARG = -2131820541; /* 0x80EF0003 */ 6 | } // namespace Err -------------------------------------------------------------------------------- /modules/libScePad/interfaces/ikbd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../icontroller.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createController_keyboard(uint32_t); 8 | -------------------------------------------------------------------------------- /modules/libScePad/interfaces/ixip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../icontroller.h" 4 | 5 | #include 6 | 7 | std::unique_ptr createController_xinput(uint32_t); 8 | -------------------------------------------------------------------------------- /core/memory/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(memory OBJECT 2 | memory.cpp 3 | ) 4 | 5 | add_dependencies(memory third_party psOff_utility) 6 | 7 | file(COPY memory.h DESTINATION ${DST_INCLUDE_DIR}/memory) -------------------------------------------------------------------------------- /core/trophies/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(trophies OBJECT 2 | trophies.cpp 3 | ) 4 | 5 | add_dependencies(trophies third_party) 6 | 7 | file(COPY trophies.h DESTINATION ${DST_INCLUDE_DIR}/trophies) -------------------------------------------------------------------------------- /modules/libScePadTracker/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr int TRACKER_CONTROLLER_MAX = 4; 7 | constexpr int TRACKER_IMAGE_MAX = 2; -------------------------------------------------------------------------------- /modules/libSceZlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceZlib) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | setupModule(${libName}) 9 | -------------------------------------------------------------------------------- /core/initParams/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(initParams OBJECT 2 | initParams.cpp 3 | ) 4 | 5 | add_dependencies(initParams third_party) 6 | 7 | file(COPY initParams.h DESTINATION ${DST_INCLUDE_DIR}/initParams) -------------------------------------------------------------------------------- /core/runtime/util/virtualmemory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | bool flushInstructionCache(uint64_t address, uint64_t size); 6 | bool patchReplace(uint64_t vaddr, uint64_t const value); 7 | -------------------------------------------------------------------------------- /modules/libSceCamera/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceCamera) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | setupModule(${libName}) 9 | -------------------------------------------------------------------------------- /modules/libSceContentExport/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace ContentExport { 6 | constexpr int32_t NOT_IMPLEMENTED = -2137178113; 7 | } 8 | } // namespace Err 9 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.cpptools", 4 | "ms-vscode.cpptools-extension-pack", 5 | "ms-vscode.cmake-tools", 6 | "jeff-hykin.better-cpp-syntax" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/libSceVoiceQoS/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceVoiceQoS) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | setupModule(${libName}) 9 | -------------------------------------------------------------------------------- /modules/libSceVrTracker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceVrTracker) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | setupModule(${libName}) 9 | -------------------------------------------------------------------------------- /modules/libSceNpGameIntent/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceNpGameIntent) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | setupModule(${libName}) 9 | -------------------------------------------------------------------------------- /modules/libSceNpToolkit2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceNpToolkit2) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | setupModule(${libName}) 9 | -------------------------------------------------------------------------------- /modules/libSceSystemGesture/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceSystemGesture) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | setupModule(${libName}) 9 | -------------------------------------------------------------------------------- /modules/libSceCamera/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr uint32_t SCE_CAMERA_MAX_DEVICE_NUM = 2; 7 | constexpr uint32_t SCE_CAMERA_MAX_FORMAT_LEVEL_NUM = 4; 8 | -------------------------------------------------------------------------------- /core/systemContent/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(systemContent OBJECT 2 | systemContent.cpp 3 | ) 4 | 5 | add_dependencies(systemContent third_party psOff_utility) 6 | 7 | file(COPY systemContent.h DESTINATION ${DST_INCLUDE_DIR}/systemContent) -------------------------------------------------------------------------------- /modules/libSceAjm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAjm) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceFace/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceFace) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceHmd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceHmd) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceIme/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceIme) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceMove/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceMove) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceRudp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceRudp) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceSsl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSsl) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceUsbd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceUsbd) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/template/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName template) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceDepth/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceDepth) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceMouse/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceMouse) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libScePlayGo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libScePlayGo) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceRandom/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceRandom) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceAudioIn/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAudioIn) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceAudiodec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAudiodec) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceNpManager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpManager) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceNpScore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpScore) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceNpWebApi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpWebApi) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceRemoteplay/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class SceRemoteplayStreamingProhibition : int { PROHIBITION_OFF = 0, PROHIBITION_ON }; 5 | 6 | enum class SceRemoteplayConnectionStatus : int { Disconnect, Connect }; -------------------------------------------------------------------------------- /modules/libSceSharePlay/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSharePlay) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceSysmodule/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSysmodule) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /core/dmem/types/memory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../imemory.h" 4 | 5 | class IMemoryManager; 6 | std::unique_ptr createDirectMemory(IMemoryManager* parent); 7 | std::unique_ptr createFlexibleMemory(IMemoryManager* parent); -------------------------------------------------------------------------------- /core/fileManager/readme.md: -------------------------------------------------------------------------------- 1 | ## FileManager 2 | 3 | Manages all Linux files (mounts etc.), converts paths to Host paths and is the owner of opened files. 4 | 5 |
6 | 7 | ![](../../out/docs/uml/modules/fileManager.svg) 8 |
9 | -------------------------------------------------------------------------------- /modules/libSceAudiodecCpu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAudiodecCpu) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceCes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceCes) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceFaceTracker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceFaceTracker) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceMoveTracker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceMoveTracker) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libScePadTracker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libScePadTracker) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceRemoteplay/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceRemoteplay) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceScreenShot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceScreenShot) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/template/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSce); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSce"; 12 | } -------------------------------------------------------------------------------- /modules/libSceCommonDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceCommonDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceHttp2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceHttp2) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceJson2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceJson2) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpAuth/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpAuth) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpTus/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpTus) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceSaveDataDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSaveDataDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceSocialScreen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSocialScreen) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceVoice/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceVoice) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceAudio3d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAudio3d) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceImeDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceImeDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceLibcInternalExt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceLibcInternalExt) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceMsgDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceMsgDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpCommon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpCommon) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpParty/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpParty) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpWebApi2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpWebApi2) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /core/fileManager/types/type_file.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | #include "core/kernel/filesystem.h" 5 | 6 | #include 7 | #include 8 | 9 | std::unique_ptr createType_file(std::filesystem::path path, filesystem::SceOpen mode); -------------------------------------------------------------------------------- /modules/libSceErrorDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceErrorDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpCommerce/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpCommerce) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpManagerForToolkit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpManagerForToolkit) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceNpMatching2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpMatching2) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpSignaling/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpSignaling) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libkernel_ps2emu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libkernel_ps2emu) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /core/hotkeys/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(hotkeys OBJECT 2 | hotkeys.cpp 3 | ) 4 | 5 | add_dependencies(hotkeys third_party config_emu) 6 | 7 | target_compile_definitions(hotkeys PUBLIC WIN32_LEAN_AND_MEAN) 8 | 9 | file(COPY hotkeys.h DESTINATION ${DST_INCLUDE_DIR}/hotkeys) -------------------------------------------------------------------------------- /modules/libSceContentExport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceContentExport) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceShareUtility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceShareUtility) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceSigninDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSigninDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceVideoRecording/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceVideoRecording) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /core/fileManager/types/type_out.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../ifile.h" 4 | 5 | #include 6 | 7 | enum SceFileOutChannel { 8 | SCE_TYPEOUT_ERROR, 9 | SCE_TYPEOUT_DEBUG, 10 | }; 11 | 12 | std::unique_ptr createType_out(SceFileOutChannel ch); 13 | -------------------------------------------------------------------------------- /modules/libSceInvitationDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceInvitationDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpProfileDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpProfileDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceGameLiveStreaming/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceGameLiveStreaming) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNetCtlForNpToolkit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNetCtlForNpToolkit) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceNpSnsFacebookDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpSnsFacebookDialog) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceSystemServicePs2Emu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSystemServicePs2Emu) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libkernel_cpumode_platform/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libkernel_cpumode_platform) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceUserServiceForNpToolkit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceUserServiceForNpToolkit) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | setupModule(${libName}) 10 | -------------------------------------------------------------------------------- /modules/libSceAudiodec/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t SCE_AUDIODEC_TYPE_AT9 = 0; 6 | constexpr int32_t SCE_AUDIODEC_TYPE_M4AAC = 2; 7 | constexpr int32_t SCE_AUDIODEC_ERROR_INVALID_TYPE = 0x807F0001; 8 | } // namespace Err -------------------------------------------------------------------------------- /core/runtime/util/exceptionHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ExceptionHandler { 6 | 7 | uint64_t getAllocSize(); 8 | void install(uint64_t imageAddr, uint64_t handlerDstAddr, uint64_t imageSize); 9 | 10 | } // namespace ExceptionHandler -------------------------------------------------------------------------------- /modules/libScePosix/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | struct SceNetId {}; 5 | 6 | struct SceNetSaFamily_t {}; 7 | 8 | struct SceNetSockaddr { 9 | uint8_t sa_len; 10 | SceNetSaFamily_t sa_family; 11 | char sa_data[14]; 12 | }; 13 | 14 | struct SceNetSocklen_t {}; 15 | -------------------------------------------------------------------------------- /modules/libSceVideoOut/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceVideoOut) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | add_dependencies(${libName} core) 9 | target_link_libraries(${libName} PRIVATE core.lib) 10 | 11 | setupModule(${libName}) 12 | -------------------------------------------------------------------------------- /core/runtime/memoryLayout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | constexpr uint64_t SYSTEM_RESERVED = 0x800000000u; 6 | constexpr uint64_t INVALID_OFFSET = 0x040000000u; 7 | 8 | constexpr uint64_t INVALID_MEMORY = SYSTEM_RESERVED + INVALID_OFFSET; 9 | 10 | constexpr size_t XSAVE_BUFFER_SIZE = 2688; 11 | -------------------------------------------------------------------------------- /docs/uml/modules/coreDeps.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | skinparam classAttributeIconSize 0 3 | 4 | package Modules {} 5 | 6 | package core { 7 | } 8 | 9 | package "psOff Emulator" { 10 | 11 | } 12 | 13 | Modules -> core 14 | 15 | core <-- "psOff Emulator" 16 | core --> "psOff Emulator" : callbacks "imports" 17 | 18 | @enduml -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # psOff - PlayStation 4 Emulation (Windows) 2 | 3 | Archived. A big thank you to all contributors and testers! It was a fun ride. 4 | 5 | Sadly, we had to go closed source and instead of just porting, we worked on a completely new emulator 6 | 7 | [psOff_premium](https://github.com/SysRay/psOff_compatibility) 8 | 9 | -------------------------------------------------------------------------------- /core/kernel/errors.cpp: -------------------------------------------------------------------------------- 1 | #define __APICALL_EXTERN 2 | #include "errors.h" 3 | #undef __APICALL_EXTERN 4 | 5 | int* getError_pthread() { 6 | thread_local int g_errno = 0; 7 | return &g_errno; 8 | } 9 | 10 | void setError_pthread(int error) { 11 | // todo tracing stacktrace? 12 | *getError_pthread() = error; 13 | } 14 | -------------------------------------------------------------------------------- /modules/libSceGraphicsDriver/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace Gnm { 6 | constexpr int VALIDATION_NOT_ENABLED = -2133770241; 7 | constexpr int FAILURE = -2146504961; 8 | constexpr int RAZOR_NOT_LOADED = -2133766143; 9 | } // namespace Gnm 10 | } // namespace Err 11 | -------------------------------------------------------------------------------- /tools/dll2nids/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(dll2Nids VERSION 0.0.1) 2 | 3 | set(SRC 4 | main.cpp 5 | ) 6 | 7 | add_executable(dll2Nids ${SRC}) 8 | 9 | target_include_directories(dll2Nids PRIVATE 10 | ${CMAKE_SOURCE_DIR} 11 | ) 12 | 13 | add_dependencies(dll2Nids third_party) 14 | 15 | target_link_libraries(dll2Nids libboost_container) -------------------------------------------------------------------------------- /modules/libSceHttp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceHttp) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | add_dependencies(${libName} core) 9 | target_link_libraries(${libName} PUBLIC core.lib) 10 | 11 | setupModule(${libName}) 12 | -------------------------------------------------------------------------------- /tools/logging/logging_dummy.cpp: -------------------------------------------------------------------------------- 1 | #include "logging_dummy.h" 2 | 3 | #include 4 | 5 | void __Log::__log(bool doExit, const wchar_t* i_pFormat, ...) { 6 | va_list args = nullptr; 7 | va_start(args, i_pFormat); 8 | 9 | vwprintf(i_pFormat, args); 10 | printf("\n"); 11 | 12 | va_end(args); 13 | 14 | if (doExit) exit(1); 15 | } -------------------------------------------------------------------------------- /modules/libSceDiscMap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceDiscMap) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core) 10 | target_link_libraries(${libName} PRIVATE core.lib) 11 | 12 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libScePngDec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libScePngDec) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} third_party) 10 | target_link_libraries(${libName} libpng16) 11 | 12 | setupModule(${libName}) 13 | -------------------------------------------------------------------------------- /modules/libScePngEnc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libScePngEnc) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} third_party) 10 | target_link_libraries(${libName} libpng16) 11 | 12 | setupModule(${libName}) 13 | -------------------------------------------------------------------------------- /modules/libSceUlt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceUlt) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core) 10 | 11 | target_link_libraries(${libName} PRIVATE core.lib) 12 | 13 | setupModule(${libName}) 14 | -------------------------------------------------------------------------------- /modules/libSceAppContent/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAppContent) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core) 10 | target_link_libraries(${libName} PRIVATE core.lib) 11 | 12 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceNetCtl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNetCtl) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core) 10 | 11 | target_link_libraries(${libName} PUBLIC core.lib) 12 | 13 | setupModule(${libName}) 14 | -------------------------------------------------------------------------------- /modules/libSceNpTrophy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNpTrophy) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core) 10 | target_link_libraries(${libName} PRIVATE core.lib) 11 | 12 | setupModule(${libName}) 13 | -------------------------------------------------------------------------------- /core/runtime/util/moduleLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../formats/ISymbols.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | std::pair> loadModule(const char* name, const wchar_t* filepath, int libVersion); 10 | 11 | void unloadModule(void* handle); 12 | -------------------------------------------------------------------------------- /core/dmem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(dmem OBJECT 2 | memoryManager.cpp 3 | 4 | types/directmem.cpp 5 | types/flexiblemem.cpp 6 | ) 7 | 8 | add_dependencies(dmem third_party psOff_utility) 9 | 10 | target_include_directories(dmem PRIVATE 11 | ${Vulkan_INCLUDE_DIRS} 12 | ) 13 | 14 | file(COPY memoryManager.h imemory.h DESTINATION ${DST_INCLUDE_DIR}/dmem) -------------------------------------------------------------------------------- /modules/setupModule.cmake: -------------------------------------------------------------------------------- 1 | function(setupModule _Target) 2 | add_custom_command(TARGET ${_Target} POST_BUILD 3 | COMMAND $ ${CMAKE_CURRENT_BINARY_DIR}/${_Target}.dll "${CMAKE_BINARY_DIR}/symbols" 4 | ) 5 | add_dependencies(${_Target} logging dll2Nids) 6 | install(FILES $ DESTINATION debug OPTIONAL) 7 | endfunction() -------------------------------------------------------------------------------- /core/videoout/vulkan/vulkanTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace vulkan { 5 | 6 | struct DeviceInfo { 7 | VkInstance instance = nullptr; 8 | VkPhysicalDevice physicalDevice = nullptr; 9 | VkDevice device = nullptr; 10 | 11 | VkPhysicalDeviceProperties devProperties; 12 | }; 13 | } // namespace vulkan -------------------------------------------------------------------------------- /modules/libkernel_cpumode_platform/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libkernel_cpumode_platform); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libkernel"; 12 | 13 | EXPORT SYSV_ABI int32_t sceKernelIsProspero() { 14 | return 0; // PS5 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modules/libSceSaveData/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSaveData) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core third_party) 10 | target_link_libraries(${libName} PRIVATE core.lib zip.lib zlib.lib) 11 | 12 | setupModule(${libName}) 13 | -------------------------------------------------------------------------------- /core/runtime/exports/intern.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__APICALL_EXTERN) 4 | #define __APICALL __declspec(dllexport) 5 | #elif defined(__APICALL_IMPORT) 6 | #define __APICALL __declspec(dllimport) 7 | #else 8 | #define __APICALL 9 | #endif 10 | 11 | namespace intern { 12 | __APICALL void init(); 13 | __APICALL void post(); 14 | } // namespace intern 15 | 16 | #undef __APICALL 17 | -------------------------------------------------------------------------------- /modules/libkernel_ps2emu/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libkernel_ps2emu); 6 | 7 | extern "C" { 8 | 9 | EXPORT const char* MODULE_NAME = "libkernel"; 10 | 11 | EXPORT SYSV_ABI int __NID(socketpair)() { 12 | LOG_USE_MODULE(libkernel_ps2emu); 13 | LOG_ERR(L"todo %S", __FUNCTION__); 14 | return Ok; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/kernel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(kernel OBJECT 2 | eventqueue.cpp 3 | eventflag.cpp 4 | errors.cpp 5 | filesystem.cpp 6 | pthread.cpp 7 | semaphore_fifo.cpp 8 | ) 9 | 10 | add_dependencies(kernel third_party) 11 | 12 | file(COPY errors.h eventflag.h eventqueue_types.h eventqueue.h filesystem.h pthread.h pthread_types.h eventqueue.h semaphore.h DESTINATION ${DST_INCLUDE_DIR}/kernel) -------------------------------------------------------------------------------- /modules/libSceUserServiceForNpToolkit/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceUserServiceForNpToolkit); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceUserService"; 12 | 13 | EXPORT SYSV_ABI int sceUserServiceRegisterEventCallback() { 14 | return Ok; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modules/libSceUlt/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace Ult { 6 | constexpr int32_t ERROR_NULL = -2139029503; 7 | constexpr int32_t ERROR_INVALID = -2139029500; 8 | constexpr int32_t ERROR_BUSY = -2139029497; 9 | constexpr int32_t ERROR_RANGE = -2139029501; 10 | } // namespace Ult 11 | } // namespace Err 12 | 13 | #define SCE_ULT_MAX_NAME_LENGTH 32 14 | -------------------------------------------------------------------------------- /core/readme.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 |
4 | 5 | ![](../out/docs/uml/modules/coreDeps.svg) 6 |
7 | 8 | All communication goes through the core library. The callbacks to the emulator are set during startup, before loading and setting up the target library. 9 | 10 | Modules should only communicate unidirectional with the core library. Everything that can't be done locally inside modules, goes here. -------------------------------------------------------------------------------- /modules/libSceFace/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr int AGE_BIN_SIZE = 81; 7 | constexpr int IDENTIFY_FEATURE_SIZE = 4096; 8 | constexpr int IDENTIFY_LITE_FEATURE_SIZE = 256; 9 | constexpr int IDENTIFY_EX_FEATURE_SIZE = 1024; 10 | constexpr int SHAPE_POINT_NUM_MAX = 46; 11 | constexpr int PARTS_NUM_MAX = 4; -------------------------------------------------------------------------------- /modules/libSceNpGameIntent/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | 5 | LOG_DEFINE_MODULE(libSceNpGameIntent); 6 | 7 | extern "C" { 8 | 9 | EXPORT const char* MODULE_NAME = "libSceNpGameIntent"; 10 | 11 | EXPORT SYSV_ABI int sceNpGameIntentInitialize() { 12 | LOG_USE_MODULE(libSceNpGameIntent); 13 | LOG_ERR(L"todo %S", __FUNCTION__); 14 | return Ok; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/workflows/remArtifacst.yml: -------------------------------------------------------------------------------- 1 | name: Remove old artifacts 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | remove-old-artifacts: 8 | runs-on: ubuntu-latest 9 | timeout-minutes: 10 10 | 11 | steps: 12 | - name: Remove old artifacts 13 | uses: c-hive/gha-remove-artifacts@v1 14 | with: 15 | age: '30 days' # ' ', e.g. 5 days, 2 years, 90 seconds, parsed by Moment.js 16 | -------------------------------------------------------------------------------- /core/unwinding/unwind.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "utility/utility.h" 4 | 5 | #include 6 | #include 7 | 8 | constexpr int _JBLEN_AMD = 20; /* Size of the jmp_buf on AMD64. */ 9 | 10 | struct unwinding_jmp_buf { 11 | uint64_t _jb[_JBLEN_AMD]; 12 | }; 13 | 14 | extern "C" { 15 | SYSV_ABI bool unwinding_setjmp(unwinding_jmp_buf* data); 16 | 17 | SYSV_ABI void unwinding_longjmp(unwinding_jmp_buf* data); 18 | } -------------------------------------------------------------------------------- /modules/libSceShareUtility/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | namespace ShareUtility { 7 | constexpr int32_t HEAP_SIZE = 131072; 8 | constexpr int32_t UPLOAD_CONTENT_MAX = 8192; 9 | } // namespace ShareUtility 10 | 11 | enum class SceContentSearchMimeType { 12 | UNKNOWN = 0, 13 | JPEG = 1, 14 | MP4 = 2, 15 | PNG = 3, 16 | GIF = 4, 17 | }; 18 | -------------------------------------------------------------------------------- /modules/libSceUserService/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(libName libSceUserService) 2 | include(../setupModule.cmake) 3 | 4 | project(${libName}) 5 | 6 | add_library(${libName} SHARED entry.cpp) 7 | 8 | add_dependencies(${libName} third_party config_emu) 9 | 10 | target_compile_definitions(${libName} PUBLIC BOOST_ALL_NO_LIB) 11 | 12 | target_link_libraries(${libName} PUBLIC libboost_thread config_emu.lib) 13 | 14 | setupModule(${libName}) 15 | -------------------------------------------------------------------------------- /tools/matchers/cmake.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "cmake", 5 | "pattern": [ 6 | { 7 | "regexp": "^\\s*CMake (Error|Warning) at (.+):(\\d+)\\s*(.*)?:", 8 | "severity": 1, 9 | "file": 2, 10 | "line": 3 11 | }, 12 | { 13 | "regexp": "^\\s+(.*)$", 14 | "message": 1 15 | } 16 | ] 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /modules/libSceAudioIn/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class SceAudioInParamFormat : unsigned int { 5 | S16_MONO = 0, // monaural 6 | S16_STEREO = 2 // stereo 7 | 8 | }; 9 | 10 | enum class SceAudioInSilentState { DEVICE_NONE = 0x00000001, PRIORITY_LOW = 0x00000002, USER_SETTING = 0x00000004, UNABLE_FORMAT = 0x00000008 }; 11 | 12 | enum class SceAudioInType { VOICE_CHAT = 0, GENERAL = 1, VOICE_RECOGNITION = 5 }; -------------------------------------------------------------------------------- /modules/libSceZlib/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceZlib); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceZlib"; 12 | 13 | EXPORT SYSV_ABI int32_t sceZlibInitialize(const void* buffer, size_t length) { 14 | LOG_USE_MODULE(libSceZlib); 15 | LOG_ERR(L"todo %S", __FUNCTION__); 16 | return Ok; 17 | } 18 | } -------------------------------------------------------------------------------- /tests/core/semaphore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_testing() 2 | 3 | add_executable(semaphore_test 4 | entry.cpp 5 | 6 | ${PRJ_SRC_DIR}/core/kernel/semaphore_fifo.cpp 7 | ) 8 | 9 | add_test(NAME semaphore_test COMMAND semaphore_test) 10 | 11 | add_dependencies(semaphore_test third_party psOff_utility logging_stub) 12 | 13 | target_link_libraries(semaphore_test PRIVATE 14 | logging_stub.lib 15 | libboost_thread 16 | libboost_chrono 17 | ) -------------------------------------------------------------------------------- /core/fileManager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(fileManager OBJECT 2 | fileManager.cpp 3 | types/type_in.cpp 4 | types/type_out.cpp 5 | types/type_zero.cpp 6 | types/type_null.cpp 7 | types/type_file.cpp 8 | types/type_random.cpp 9 | types/type_rng.cpp 10 | types/type_lib.cpp 11 | ) 12 | 13 | add_dependencies(fileManager third_party psOff_utility) 14 | 15 | file(COPY fileManager.h ifile.h DESTINATION ${DST_INCLUDE_DIR}/fileManager) -------------------------------------------------------------------------------- /core/tests/core/semaphore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_testing() 2 | 3 | add_executable(semaphore_test 4 | entry.cpp 5 | 6 | ${PRJ_SRC_DIR}/core/kernel/semaphore_fifo.cpp 7 | ) 8 | 9 | add_test(NAME semaphore_test COMMAND semaphore_test) 10 | 11 | add_dependencies(semaphore_test third_party psOff_utility logging_stub) 12 | 13 | target_link_libraries(semaphore_test PRIVATE 14 | logging_stub.lib 15 | libboost_thread 16 | libboost_chrono 17 | ) -------------------------------------------------------------------------------- /modules/libSceCes/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceCes); 7 | 8 | namespace {} // namespace 9 | 10 | extern "C" { 11 | 12 | EXPORT const char* MODULE_NAME = "libSceCes"; 13 | 14 | EXPORT SYSV_ABI int32_t sceCesUcsProfileInitSJis1997Cp932() { 15 | LOG_USE_MODULE(libSceCes); 16 | LOG_ERR(L"todo %S", __FUNCTION__); 17 | return Ok; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /modules/libSceHttp2/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceHttp2); 7 | 8 | extern "C" { 9 | 10 | EXPORT const char* MODULE_NAME = "libSceHttp2"; 11 | 12 | EXPORT SYSV_ABI int32_t sceHttp2Init() { 13 | return Ok; 14 | } 15 | 16 | // can be removed with more functions 17 | EXPORT SYSV_ABI int32_t __DUMMY(FUNCTION_1)() { 18 | return Ok; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /modules/libScePosix/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr uint16_t SCE_KERNEL_MS_SYNC = 0; 7 | constexpr uint16_t SCE_KERNEL_MS_ASYNC = 1; 8 | constexpr uint16_t SCE_KERNEL_MS_INVALIDATE = 2; 9 | 10 | constexpr uint16_t SCE_KERNEL_PRIO_FIFO_DEFAULT = 700; 11 | constexpr uint16_t SCE_KERNEL_PRIO_FIFO_HIGHEST = 256; 12 | constexpr uint16_t SCE_KERNEL_PRIO_FIFO_LOWEST = 767; -------------------------------------------------------------------------------- /modules/libSceRtc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceRtc) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} third_party) 10 | target_link_libraries(${libName} PRIVATE 11 | libboost_chrono 12 | ) 13 | 14 | target_compile_definitions(${libName} PRIVATE 15 | BOOST_ALL_NO_LIB 16 | ) 17 | 18 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceRtc/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class SceRTCDay { 5 | SUNDAY = 0, 6 | MONDAY = 1, 7 | TUESDAY = 2, 8 | WEDNESDAY = 3, 9 | THURSDAY = 4, 10 | FRIDAY = 5, 11 | SATURDAY = 6, 12 | }; 13 | 14 | struct SceRtcDateTime { 15 | uint16_t year; 16 | uint16_t month; 17 | uint16_t day; 18 | uint16_t hour; 19 | uint16_t minute; 20 | uint16_t second; 21 | uint32_t microsecond; 22 | }; -------------------------------------------------------------------------------- /modules/libSceSystemServicePs2Emu/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceSystemServicePs2Emu); 6 | 7 | extern "C" { 8 | 9 | EXPORT const char* MODULE_NAME = "libSceSystemService"; 10 | 11 | EXPORT SYSV_ABI int sceSystemServiceAddLocalProcessForPs2Emu() { 12 | LOG_USE_MODULE(libSceSystemServicePs2Emu); 13 | LOG_ERR(L"todo %S", __FUNCTION__); 14 | return Ok; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modules/libSceVideoRecording/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceVideoRecording); 7 | 8 | extern "C" { 9 | 10 | EXPORT const char* MODULE_NAME = "libSceVideoRecording"; 11 | 12 | EXPORT SYSV_ABI int32_t sceVideoRecordingSetInfo() { 13 | LOG_USE_MODULE(libSceVideoRecording); 14 | LOG_ERR(L"todo %S", __FUNCTION__); 15 | return Ok; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /modules/libSceCoredump/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceCoredump) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED 8 | entry.cpp 9 | ) 10 | 11 | add_dependencies(${libName} third_party) 12 | 13 | target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB) 14 | target_link_libraries(${libName} PRIVATE libboost_thread psOff_utility) 15 | 16 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceNet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceNet) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp epoll.cpp socket.cpp resolver.cpp) 8 | 9 | add_dependencies(${libName} third_party core) 10 | 11 | target_compile_definitions(${libName} PUBLIC WIN32_LEAN_AND_MEAN) 12 | 13 | target_link_libraries(${libName} ws2_32 core.lib) 14 | 15 | setupModule(${libName}) 16 | -------------------------------------------------------------------------------- /modules/libSceNpManager/onlineId.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | constexpr uint32_t SCE_NP_ONLINEID_MIN_LENGTH = 3; 5 | constexpr uint32_t SCE_NP_ONLINEID_MAX_LENGTH = 16; 6 | 7 | /* Online ID */ 8 | struct SceNpOnlineId { 9 | char data[SCE_NP_ONLINEID_MAX_LENGTH]; 10 | char term; 11 | char dummy[3]; 12 | }; 13 | 14 | /* NP ID */ 15 | struct SceNpId { 16 | SceNpOnlineId handle; 17 | uint8_t opt[8]; 18 | uint8_t reserved[8]; 19 | }; 20 | -------------------------------------------------------------------------------- /modules/libScePngEnc/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace PngEnc { 6 | constexpr int32_t INVALID_ADDR = -2140602111; 7 | constexpr int32_t INVALID_SIZE = -2140602110; 8 | constexpr int32_t INVALID_PARAM = -2140602109; 9 | constexpr int32_t INVALID_HANDLE = -2140602108; 10 | constexpr int32_t DATA_OVERFLOW = -2140602096; 11 | constexpr int32_t FATAL = -2140602080; 12 | } // namespace PngEnc 13 | } // namespace Err 14 | -------------------------------------------------------------------------------- /modules/libSceCommonDialog/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | enum class SceCommonDialogStatus { NONE = 0, INITIALIZED = 1, RUNNING = 2, FINISHED = 3 }; 5 | 6 | enum class SceCommonDialogResult { 7 | OK = 0, 8 | USER_CANCELED = 1, 9 | }; 10 | 11 | struct alignas(8) SceCommonDialogBaseParam { 12 | size_t size; 13 | uint8_t reserved[36]; 14 | uint32_t magic; 15 | }; 16 | 17 | constexpr uint32_t SCE_COMMON_DIALOG_MAGIC_NUMBER = 0xC0D1A109; -------------------------------------------------------------------------------- /modules/libSceNetCtlForNpToolkit/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceNetCtlForNpToolkit); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceNetCtl"; 12 | 13 | EXPORT SYSV_ABI int sceNetCtlRegisterCallbackForNpToolkit() { 14 | return Ok; 15 | } 16 | 17 | EXPORT SYSV_ABI int sceNetCtlCheckCallbackForNpToolkit() { 18 | return Ok; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /modules/libkernel_unity/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libkernel_unity) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core third_party) 10 | 11 | target_link_libraries(${libName} PRIVATE 12 | core.lib 13 | libboost_thread 14 | ) 15 | 16 | target_compile_definitions(${libName} PRIVATE 17 | BOOST_ALL_NO_LIB 18 | ) 19 | setupModule(${libName}) -------------------------------------------------------------------------------- /docs/uml/modules/videout_swapchain.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | skinparam classAttributeIconSize 0 3 | 4 | interface IImageHandler{ 5 | + {abstract} ImageData getImage_blocking() 6 | + {abstract} void notify_done(ImageData) 7 | } 8 | 9 | class ImageHandler{ 10 | 11 | } 12 | 13 | class ImageData 14 | 15 | IImageHandler <|-- ImageHandler 16 | IImageHandler - ImageData 17 | 18 | class VideoOut << (S,#FF7700) Singleton >> {} 19 | VideoOut *-ImageHandler 20 | 21 | user ()- IImageHandler 22 | @enduml -------------------------------------------------------------------------------- /modules/libSceLibcInternal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceLibcInternal) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp mspace.cpp) 8 | target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB _CRT_SECURE_NO_WARNINGS) 9 | 10 | add_dependencies(${libName} core third_party) 11 | target_link_libraries(${libName} PRIVATE core.lib libboost_thread) 12 | 13 | setupModule(${libName}) 14 | -------------------------------------------------------------------------------- /.github/workflows/release_notify.yml: -------------------------------------------------------------------------------- 1 | name: Discord release notify 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | notifier: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Clone repo 12 | uses: actions/checkout@v4 13 | 14 | - name: Run things 15 | working-directory: misc/discordNotify 16 | env: 17 | DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} 18 | run: | 19 | npm i 20 | node . 21 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_testing() 2 | 3 | add_compile_definitions( 4 | BOOST_ALL_NO_LIB 5 | ) 6 | 7 | link_libraries(gtest_main gmock gmock_main) 8 | add_link_options(/DEBUG) 9 | link_directories( 10 | ${CMAKE_BINARY_DIR} 11 | ${CMAKE_BINARY_DIR}/lib 12 | ) 13 | 14 | include_directories( 15 | ${PRJ_SRC_DIR} 16 | 17 | ${Vulkan_INCLUDE_DIRS} 18 | ${PRJ_SRC_DIR}/tools/logging 19 | ) 20 | 21 | add_subdirectory(core) 22 | 23 | install(TARGETS semaphore_test RUNTIME DESTINATION .) -------------------------------------------------------------------------------- /core/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_testing() 2 | 3 | add_compile_definitions( 4 | BOOST_ALL_NO_LIB 5 | ) 6 | 7 | link_libraries(gtest_main gmock gmock_main) 8 | add_link_options(/DEBUG) 9 | link_directories( 10 | ${CMAKE_BINARY_DIR} 11 | ${CMAKE_BINARY_DIR}/lib 12 | ) 13 | 14 | include_directories( 15 | ${PRJ_SRC_DIR} 16 | 17 | ${Vulkan_INCLUDE_DIRS} 18 | ${PRJ_SRC_DIR}/tools/logging 19 | ) 20 | 21 | add_subdirectory(core) 22 | 23 | install(TARGETS semaphore_test RUNTIME DESTINATION .) -------------------------------------------------------------------------------- /modules/libSceSystemService/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceSystemService) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} core config_emu) 10 | target_link_libraries(${libName} PRIVATE core.lib SDL2 ${Vulkan_LIBRARIES} config_emu.lib) 11 | target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB WIN32_LEAN_AND_MEAN) 12 | 13 | setupModule(${libName}) 14 | -------------------------------------------------------------------------------- /modules/libSceNpCommon/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceNpCommon); 7 | 8 | namespace {} // namespace 9 | 10 | extern "C" { 11 | 12 | EXPORT const char* MODULE_NAME = "libSceNpCommon"; 13 | 14 | EXPORT SYSV_ABI void __DUMMY(FUNCTION_1)() {} 15 | 16 | EXPORT SYSV_ABI int32_t sceNpCmpNpId() { 17 | return Ok; 18 | } 19 | 20 | EXPORT SYSV_ABI int32_t sceNpMutexInit() { 21 | return Ok; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /modules/libSceAudioOut/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAudioOut) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp) 8 | 9 | add_dependencies(${libName} third_party config_emu core) 10 | 11 | target_link_libraries(${libName} PRIVATE core.lib config_emu.lib SDL2 libboost_thread) 12 | 13 | target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB WIN32_LEAN_AND_MEAN) 14 | 15 | setupModule(${libName}) 16 | -------------------------------------------------------------------------------- /asm/entry.asm: -------------------------------------------------------------------------------- 1 | .CODE 2 | 3 | PUBLIC jmpEntry 4 | jmpEntry PROC 5 | 6 | ; Input 7 | ; RDI addr 8 | ; RSI EntryParams 9 | ; RDX exitHandler 10 | 11 | mov RAX, RDI 12 | 13 | ; align stack 14 | SUB RSP, 32 15 | AND RSP, -10h 16 | 17 | ; copy entry param to stack 18 | ADD RSP, 40 19 | push [RSI+24] 20 | push [RSI+16] 21 | push [RSI+8] 22 | push [RSI] 23 | ; - 24 | 25 | lea rdi, [RSP] ; param 1 (EntryParam) is @ rsp 26 | mov rsi, RDX ; param2 (atexit) 27 | jmp RAX 28 | 29 | jmpEntry ENDP 30 | End -------------------------------------------------------------------------------- /core/networking/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(networking OBJECT 2 | states/offline.cpp 3 | 4 | states/online/netctl.cpp 5 | states/online/resolver.cpp 6 | states/online/socket.cpp 7 | states/online/epoll.cpp 8 | states/online/http.cpp 9 | 10 | networking.cpp 11 | ) 12 | 13 | add_dependencies(networking third_party psOff_utility config_emu) 14 | 15 | target_compile_definitions(networking PUBLIC WIN32_LEAN_AND_MEAN _WINSOCK_DEPRECATED_NO_WARNINGS) 16 | 17 | file(COPY networking.h DESTINATION ${DST_INCLUDE_DIR}/networking) -------------------------------------------------------------------------------- /modules/libSceScreenShot/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class SceScreenShotOrigin { 5 | kLeftTop = 1, 6 | kLeftCenter = 2, 7 | kLeftBottom = 3, 8 | kCenterTop = 4, 9 | kCenterCenter = 5, 10 | kCenterBottom = 6, 11 | kRightTop = 7, 12 | kRightCenter = 8, 13 | kRightBottom = 9 14 | }; 15 | 16 | struct SceScreenShotParam { 17 | uint32_t thisSize; 18 | const char* photoTitle; 19 | const char* gameTitle; 20 | const char* gameComment; 21 | void* reserved; 22 | }; -------------------------------------------------------------------------------- /modules/libSceGraphicsDriver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceGraphicsDriver) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED 8 | entry.cpp 9 | ) 10 | 11 | target_include_directories(${libName} PRIVATE 12 | ${Vulkan_INCLUDE_DIRS} 13 | ${PRJ_SRC_DIR}/tools/sb2spirv/lib/include 14 | ) 15 | 16 | add_dependencies(${libName} core psoff_render) 17 | target_link_libraries(${libName} PRIVATE core.lib psoff_render.lib) 18 | 19 | setupModule(${libName}) -------------------------------------------------------------------------------- /utility/progloc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef BOOST_ALL_NO_LIB 4 | #define BOOST_ALL_NO_LIB 5 | #endif 6 | 7 | #include 8 | 9 | namespace util { 10 | inline std::wstring getProgramLoc() { 11 | boost::system::error_code ec; 12 | 13 | auto path = boost::dll::program_location(ec); 14 | if (ec.failed()) { 15 | printf("Failed to getProgramLoc(): %s", ec.message().c_str()); 16 | exit(1); 17 | } 18 | 19 | path.remove_filename(); 20 | return path.c_str(); 21 | } 22 | } // namespace util 23 | -------------------------------------------------------------------------------- /modules/libSceNet/resolverTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "modules/libSceNet/types.h" 4 | #include "types.h" 5 | 6 | union SceNetResolverAddrUn { 7 | SceNetInAddr_t addr; 8 | 9 | char reserved[16]; 10 | }; 11 | 12 | struct SceNetResolverAddr { 13 | SceNetResolverAddrUn un; 14 | 15 | int af; 16 | int reserved[3]; 17 | }; 18 | 19 | struct SceNetResolverInfo { 20 | SceNetResolverAddr addrs[SCE_NET_RESOLVER_MULTIPLE_RECORDS_MAX]; 21 | 22 | int records; 23 | int dns4records; 24 | int reserved1; 25 | int reserved[13]; 26 | }; -------------------------------------------------------------------------------- /modules/libScePosix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libScePosix) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED 8 | entry.cpp 9 | fs.cpp 10 | mman.cpp 11 | pthread.cpp 12 | ) 13 | 14 | add_dependencies(${libName} core third_party) 15 | target_link_libraries(${libName} PRIVATE 16 | core.lib 17 | libboost_thread 18 | libboost_chrono 19 | ) 20 | 21 | target_compile_definitions(${libName} PRIVATE 22 | BOOST_ALL_NO_LIB 23 | ) 24 | 25 | setupModule(${libName}) -------------------------------------------------------------------------------- /modules/libSceVoiceQoS/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | typedef int SceVoiceQoSLocalId; 5 | typedef int SceVoiceQoSRemoteId; 6 | typedef int SceVoiceQoSConnectionId; 7 | 8 | enum class SceVoiceQoSAttributeId { 9 | MIC_VOLUME, 10 | MIC_MUTE, 11 | SPEAKER_VOLUME, 12 | SPEAKER_MUTE, 13 | DESIRED_OUT_BIT_RATE, 14 | MIC_USABLE, 15 | SILENT_STATE, 16 | REMOTE_MUTE, 17 | SPEAKER_DESTINATION, 18 | 19 | }; 20 | 21 | enum class SceVoiceQoSStatusId { IN_BITRATE, OUT_BITRATE, OUT_READ_BITRATE, IN_FRAME_RECEIVED_RATIO, HEARTBEAT_FLAG }; -------------------------------------------------------------------------------- /modules/libSceSharePlay/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int SCE_SHARE_PLAY_ERROR_INVALID_ARGS = -2129788927; /* 0x810E0001 */ 6 | constexpr int SCE_SHARE_PLAY_ERROR_OUT_OF_MEMORY = -2129788926; /* 0x810E0002 */ 7 | constexpr int SCE_SHARE_PLAY_ERROR_ALREADY_INITIALIZED = -2129788925; /* 0x810E0003 */ 8 | constexpr int SCE_SHARE_PLAY_ERROR_NOT_INITIALIZED = -2129788924; /* 0x810E0004 */ 9 | constexpr int SCE_SHARE_PLAY_ERROR_FATAL = -2129788923; /* 0x810E0005 */ 10 | } // namespace Err -------------------------------------------------------------------------------- /modules/libSceContentExport/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceContentExport); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceContentExport"; 12 | 13 | EXPORT SYSV_ABI int32_t sceContentExportInit(SceContentExportParam* param) { 14 | return Err::ContentExport::NOT_IMPLEMENTED; 15 | } 16 | 17 | EXPORT SYSV_ABI int32_t sceContentExportInit2(SceContentExportParam* param) { 18 | return Err::ContentExport::NOT_IMPLEMENTED; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /modules/libSceRandom/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceRandom); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceRandom"; 12 | 13 | EXPORT SYSV_ABI int32_t sceRandomGetRandomNumber(void* buf, uint32_t size) { 14 | LOG_USE_MODULE(libSceRandom); 15 | if (size > Err::RANDOM_MAX_SIZE) { 16 | return EINVAL; 17 | } 18 | for (uint32_t i = 0; i < size; ++i) { 19 | ((uint8_t*)buf)[i] = std::rand() & 0xFF; 20 | } 21 | return 0; 22 | } 23 | } -------------------------------------------------------------------------------- /modules/libSceNgs2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | add_compile_definitions( 5 | BOOST_ALL_NO_LIB 6 | ) 7 | 8 | set(libName libSceNgs2) 9 | project(${libName}) 10 | 11 | add_library(${libName} SHARED entry.cpp readFuncs.cpp reader.cpp) 12 | 13 | set(FFMPEG_LIBS 14 | avformat 15 | avcodec 16 | avutil 17 | swscale 18 | swresample 19 | ) 20 | 21 | add_dependencies(${libName} core) 22 | target_link_libraries(${libName} PRIVATE core.lib ${FFMPEG_LIBS} libboost_thread libboost_chrono) 23 | 24 | setupModule(${libName}) 25 | -------------------------------------------------------------------------------- /modules/libScePad/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libScePad) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED entry.cpp 8 | interfaces/isdl.cpp 9 | interfaces/ixip.cpp 10 | interfaces/ikbd.cpp 11 | ) 12 | 13 | add_dependencies(${libName} core config_emu) 14 | 15 | target_link_libraries(${libName} PRIVATE SDL2 ${Vulkan_LIBRARIES} core.lib config_emu.lib libboost_thread) 16 | 17 | target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB WIN32_LEAN_AND_MEAN) 18 | 19 | setupModule(${libName}) 20 | -------------------------------------------------------------------------------- /core/runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(runtime OBJECT 2 | util/exceptionHandler.cpp 3 | util/moduleLoader.cpp 4 | util/virtualmemory.cpp 5 | 6 | formats/elf64.cpp 7 | exports/intern.cpp 8 | 9 | runtimeLinker.cpp 10 | ) 11 | 12 | add_dependencies(runtime third_party psOff_utility) 13 | 14 | file(COPY runtimeLinker.h runtimeExport.h program.h procParam.h DESTINATION ${DST_INCLUDE_DIR}/runtime) 15 | file(COPY exports/intern.h exports/macro.h DESTINATION ${DST_INCLUDE_DIR}/runtime/exports) 16 | file(COPY formats/ISymbols.h formats/IFormat.h DESTINATION ${DST_INCLUDE_DIR}/runtime/formats) -------------------------------------------------------------------------------- /tools/logging/logging_stub.cpp: -------------------------------------------------------------------------------- 1 | #define __APICALL_EXTERN 2 | #include "logging.h" 3 | #undef __APICALL_EXTERN 4 | 5 | #include 6 | #include 7 | 8 | namespace __Log { 9 | void* __registerLoggingModule(std::wstring_view name) { 10 | return nullptr; 11 | } 12 | 13 | void __log(eTrace_Level level, void* hmodule, unsigned short i_wLine, const char* i_pFile, const char* i_pFunction, const wchar_t* i_pFormat, ...) {} 14 | 15 | void flush() {} 16 | 17 | void flushExceptional() {} 18 | 19 | uint8_t isIgnored(void* module, eTrace_Level level) { 20 | return 0; 21 | } 22 | } // namespace __Log -------------------------------------------------------------------------------- /modules/libSceDiscMap/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace DiscMap { 6 | constexpr int32_t INVALID_ARGUMENT = -2129657855; // 0x81100001 7 | constexpr int32_t LOCATION_NOT_MAPPED = -2129657854; // 0x81100002 8 | constexpr int32_t FILE_NOT_FOUND = -2129657853; // 0x81100003 9 | constexpr int32_t NO_BITMAP_INFO = -2129657852; // 0x81100004 10 | constexpr int32_t FATAL = -2129657601; // 0x811000FF 11 | } // namespace DiscMap 12 | } // namespace Err 13 | 14 | constexpr int32_t DM_PATCH_FLAG = 1; 15 | constexpr int32_t DM_APP1_FLAG = 0x100; 16 | -------------------------------------------------------------------------------- /modules/libSceAudiodec/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | struct SceAudiodecAuInfo { 5 | uint32_t uiSize; 6 | void* pAuAddr; 7 | uint32_t uiAuSize; 8 | }; 9 | 10 | struct SceAudiodecPcmItem { 11 | uint32_t uiSize; 12 | void* pPcmAddr; 13 | uint32_t uiPcmSize; 14 | }; 15 | 16 | struct SceAudiodecCtrl { 17 | void* pParam; 18 | void* pBsiInfo; 19 | SceAudiodecAuInfo* pAuInfo; 20 | SceAudiodecPcmItem* pPcmItem; 21 | }; 22 | 23 | struct SceAudiodecCpuResource { 24 | uint32_t uiSize; 25 | void* pWorkMemAddr; 26 | uint32_t uiWorkMemSize; 27 | }; -------------------------------------------------------------------------------- /modules/libSceAjm/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | typedef unsigned int SceAjmContextId; 5 | typedef unsigned int SceAjmCodecType; 6 | typedef unsigned int SceAjmInstanceId; 7 | typedef unsigned int SceAjmBatchId; 8 | 9 | struct SceAjmSidebandStreamResult { 10 | struct { 11 | int iSizeConsumed; 12 | int iSizeProduced; 13 | unsigned int uiTotalDecodedSamples; 14 | } sStream; 15 | }; 16 | 17 | struct SceAjmBatchError { 18 | int iErrorCode; 19 | int align1; 20 | void* pJobAddress; 21 | int uiCommandOffset; 22 | int align2; 23 | void* pJobOriginRa; 24 | }; -------------------------------------------------------------------------------- /modules/libSceSocialScreen/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceSocialScreen); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceSocialScreen"; 12 | 13 | EXPORT SYSV_ABI int32_t sceSocialScreenInitialize() { 14 | LOG_USE_MODULE(libSceSocialScreen); 15 | LOG_ERR(L"todo %S", __FUNCTION__); 16 | return Ok; 17 | } 18 | 19 | EXPORT SYSV_ABI int32_t sceSocialScreenTerminate() { 20 | LOG_USE_MODULE(libSceSocialScreen); 21 | LOG_ERR(L"todo %S", __FUNCTION__); 22 | return Ok; 23 | } 24 | } -------------------------------------------------------------------------------- /modules/libSceCommonDialog/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | 5 | LOG_DEFINE_MODULE(libSceCommonDialog); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceCommonDialog"; 12 | 13 | EXPORT SYSV_ABI int32_t sceCommonDialogInitialize() { 14 | LOG_USE_MODULE(libSceCommonDialog); 15 | LOG_TRACE(L"%S", __FUNCTION__); 16 | 17 | return Ok; 18 | } 19 | 20 | EXPORT SYSV_ABI bool sceCommonDialogIsUsed() { 21 | LOG_USE_MODULE(libSceCommonDialog); 22 | LOG_TRACE(L"%S", __FUNCTION__); 23 | 24 | return false; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /modules/libSceNpManagerForToolkit/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceNpManagerForToolkit); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceNpManager"; 12 | 13 | EXPORT SYSV_ABI int sceNpCheckCallbackForLib() { 14 | return Ok; 15 | } 16 | 17 | EXPORT SYSV_ABI int sceNpRegisterStateCallbackForToolkit(void* /*callback*/, void* /*userdata*/) { 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int sceNpUnregisterStateCallbackForToolkit(void* /*callback*/, void* /*userdata*/) { 22 | return Ok; 23 | } 24 | } -------------------------------------------------------------------------------- /modules/libSceAudiodecCpu/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | struct SceAudiodecCpuAuInfo { 5 | uint32_t uiSize; 6 | void* pAuAddr; 7 | uint32_t uiAuSize; 8 | }; 9 | 10 | struct SceAudiodecCpuPcmItem { 11 | uint32_t uiSize; 12 | void* pPcmAddr; 13 | uint32_t uiPcmSize; 14 | }; 15 | 16 | struct SceAudiodecCpuCtrl { 17 | void* pParam; 18 | void* pBsiInfo; 19 | SceAudiodecCpuAuInfo* pAuInfo; 20 | SceAudiodecCpuPcmItem* pPcmItem; 21 | }; 22 | 23 | struct SceAudiodecCpuResource { 24 | uint32_t uiSize; 25 | void* pWorkMemAddr; 26 | uint32_t uiWorkMemSize; 27 | }; -------------------------------------------------------------------------------- /modules/libSceAvPlayer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libSceAvPlayer) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED 8 | entry.cpp entryEx.cpp avplayer.cpp 9 | ) 10 | 11 | target_include_directories(${libName} PRIVATE 12 | ${Vulkan_INCLUDE_DIRS} 13 | ) 14 | 15 | set(FFMPEG_LIBS 16 | avformat 17 | avcodec 18 | avutil 19 | swscale 20 | swresample 21 | ) 22 | 23 | add_dependencies(${libName} core psoff_render) 24 | target_link_libraries(${libName} PUBLIC core.lib psOff_utility ${FFMPEG_LIBS} psoff_render.lib) 25 | 26 | setupModule(${libName}) -------------------------------------------------------------------------------- /tools/config_emu/CmakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | 3 | add_library(config_emu SHARED config_emu.cpp) 4 | 5 | add_dependencies(config_emu third_party) 6 | 7 | target_link_libraries(config_emu PUBLIC libboost_thread libboost_filesystem) 8 | target_compile_definitions(config_emu PUBLIC BOOST_ALL_NO_LIB WIN32_LEAN_AND_MEAN) 9 | target_compile_options(config_emu PRIVATE "/Zi") 10 | 11 | set_target_properties(config_emu 12 | PROPERTIES 13 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 14 | ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 15 | ) 16 | 17 | install(TARGETS config_emu LIBRARY DESTINATION .) 18 | -------------------------------------------------------------------------------- /modules/libkernel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | include(../setupModule.cmake) 3 | 4 | set(libName libkernel) 5 | project(${libName}) 6 | 7 | add_library(${libName} SHARED 8 | entry.cpp 9 | equeue.cpp 10 | eventflag.cpp 11 | semaphore.cpp 12 | dmem.cpp 13 | aio.cpp 14 | fs.cpp 15 | pthread.cpp 16 | ) 17 | 18 | add_dependencies(${libName} core third_party) 19 | target_link_libraries(${libName} PRIVATE 20 | core.lib 21 | libboost_thread 22 | libboost_chrono 23 | bcrypt.lib 24 | ) 25 | 26 | target_compile_definitions(${libName} PRIVATE 27 | BOOST_ALL_NO_LIB 28 | ) 29 | 30 | setupModule(${libName}) -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "(Windows) Launch", 6 | "type": "cppvsdbg", 7 | "request": "launch", 8 | "program": "${workspaceRoot}/_build/_Install/psoff.exe", 9 | "args": [ 10 | "--d", 11 | "${config:psoff.add-arg}", 12 | "--file=${config:psoff.game-path}/eboot.bin", 13 | ], 14 | "stopAtEntry": false, 15 | "cwd": "${workspaceRoot}/_build/_Install", 16 | "environment": [], 17 | "console": "integratedTerminal", 18 | "symbolSearchPath": "${workspaceRoot}/_build/_Install/debug" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /core/videoout/readme.md: -------------------------------------------------------------------------------- 1 | ## Video out 2 | 3 | * Manages the display buffers used in Linux/PlayStation. 4 | * Setup of Vulkan (GPU detection etc.) 5 | * Emits Kernel events: flip, vblank 6 | 7 |
8 | 9 | ![](../../out/docs/uml/modules/videoout_class.svg) 10 |
11 | 12 | ### Swapchain image handling 13 | 14 | User calls getImage_blocking() to retrieve the display image. After present notify_done() is called. 15 | 16 | getImage_blocking() releases users FIFO. The whole swapchain images are handled by ImageHandler 17 | 18 | 19 |
20 | 21 | ![](../../out/docs/uml/modules/videout_swapchain.svg) 22 | 23 |
-------------------------------------------------------------------------------- /modules/libSceNpSignaling/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../libSceNet/types.h" 3 | #include "codes.h" 4 | 5 | struct SceNpOnlineId { 6 | char data[SCE_NP_ONLINEID_MAX_LENGTH]; 7 | char term; 8 | char dummy[3]; 9 | }; 10 | 11 | struct SceNpId { 12 | SceNpOnlineId handle; 13 | unsigned char opt[8]; 14 | unsigned char reserved[8]; 15 | }; 16 | 17 | typedef void SYSV_ABI (*SceNpSignalingHandler)(uint32_t ctxId, uint32_t subjectId, int event, int errorCode, void* arg); 18 | 19 | struct SceNpSignalingNetInfo { 20 | size_t size; 21 | SceNetInAddr local_addr; 22 | SceNetInAddr mapped_addr; 23 | int nat_status; 24 | }; 25 | -------------------------------------------------------------------------------- /modules/libSceNpWebApi/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Err {} // namespace Err 6 | 7 | constexpr std::string_view SCE_NP_WEBAPI_CONTENT_TYPE_APPLICATION_JSON_UTF8 = "application/json; charset=utf-8"; 8 | 9 | constexpr uint32_t SCE_NP_WEBAPI_DEFAULT_CONNECTION_NUM = 1; 10 | constexpr uint32_t SCE_NP_WEBAPI_MAX_CONNECTION_NUM = 16; 11 | constexpr uint32_t SCE_NP_WEBAPI_PUSH_EVENT_DATA_TYPE_LEN_MAX = 64; 12 | constexpr uint32_t SCE_NP_WEBAPI_EXTD_PUSH_EVENT_EXTD_DATA_KEY_LEN_MAX = 32; 13 | constexpr uint32_t SCE_NP_WEBAPI_NP_SERVICE_NAME_NONE = NULL; -------------------------------------------------------------------------------- /modules/libSceCoredump/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | struct SceCoredumpStopInfoCpu { 5 | void* thread; 6 | int reason_code; 7 | }; 8 | 9 | struct SceCoredumpStopInfoGpu { 10 | uint64_t timestamp; 11 | }; 12 | 13 | struct SceCoredumpThreadContextInfo { 14 | uint64_t rdi; 15 | uint64_t rsi; 16 | uint64_t rdx; 17 | uint64_t rcx; 18 | uint64_t r8; 19 | uint64_t r9; 20 | uint64_t rax; 21 | uint64_t rbx; 22 | uint64_t rbp; 23 | uint64_t r10; 24 | uint64_t r11; 25 | uint64_t r12; 26 | uint64_t r13; 27 | uint64_t r14; 28 | uint64_t r15; 29 | uint64_t rip; 30 | uint64_t rflags; 31 | uint64_t rsp; 32 | }; -------------------------------------------------------------------------------- /modules/libSceMoveTracker/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | struct SceMoveButtonData { 5 | uint16_t digitalButtons; 6 | uint16_t analogT; 7 | }; 8 | 9 | struct SceMoveExtensionPortData {}; 10 | 11 | struct SceMoveData { 12 | float accelerometer[3]; 13 | float gyro[3]; 14 | SceMoveButtonData pad; 15 | SceMoveExtensionPortData ext; 16 | int64_t timestamp; 17 | int counter; 18 | float temperature; 19 | }; 20 | 21 | struct SceMoveTrackerControllerInput { 22 | int32_t handle; 23 | SceMoveData* data; 24 | int32_t num; 25 | }; 26 | -------------------------------------------------------------------------------- /core/videoout/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(videoout OBJECT 2 | videoout.cpp 3 | imageHandler.cpp 4 | 5 | vulkan/vulkanSetup.cpp 6 | vulkan/vulkanHelper.cpp 7 | 8 | overlay/overlay.cpp 9 | overlay/overtrophy/overtrophy.cpp 10 | 11 | # overlay/gamemenu/gamemenu.cpp 12 | ) 13 | 14 | add_dependencies(videoout third_party psOff_utility initParams config_emu psoff_render) 15 | 16 | target_include_directories(videoout PRIVATE 17 | ${Vulkan_INCLUDE_DIRS} 18 | ${CMAKE_BINARY_DIR}/third_party/src/third_party/include 19 | ) 20 | 21 | file(COPY videoout.h DESTINATION ${DST_INCLUDE_DIR}/videoout) 22 | file(COPY vulkan/vulkanTypes.h DESTINATION ${DST_INCLUDE_DIR}/videoout/vulkan) -------------------------------------------------------------------------------- /modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | MACRO(SUBDIRLIST result curdir) 2 | FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) 3 | SET(dirlist "") 4 | 5 | FOREACH(child ${children}) 6 | IF(IS_DIRECTORY ${curdir}/${child} AND NOT child STREQUAL "template") 7 | LIST(APPEND dirlist ${child}) 8 | ENDIF() 9 | ENDFOREACH() 10 | 11 | SET(${result} ${dirlist}) 12 | ENDMACRO() 13 | 14 | SUBDIRLIST(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR}) 15 | 16 | add_compile_definitions(__APICALL_IMPORT) 17 | 18 | FOREACH(subdir ${SUBDIRS}) 19 | ADD_SUBDIRECTORY(${subdir}) 20 | add_dependencies(${subdir} dll2Nids) 21 | ENDFOREACH() 22 | 23 | install(TARGETS ${SUBDIRS} 24 | LIBRARY DESTINATION modules) -------------------------------------------------------------------------------- /modules/libSceContentExport/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | #include "common.h" 4 | 5 | typedef void* SYSV_ABI (*SceContentExportMalloc)(size_t size, void* userData); 6 | typedef void SYSV_ABI (*SceContentExportFree)(void* ptr, void* userData); 7 | 8 | struct SceContentExportParam { 9 | SceContentExportMalloc mallocFunc; 10 | SceContentExportFree freeFunc; 11 | void* userData; 12 | }; 13 | 14 | struct SceContentExportInitParam2 { 15 | SceContentExportMalloc mallocfunc; 16 | SceContentExportFree freefunc; 17 | void* userdata; 18 | size_t bufsize; 19 | int64_t reserved[2]; 20 | }; 21 | -------------------------------------------------------------------------------- /modules/libSceNpWebApi2/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceNpWebApi2); 7 | 8 | extern "C" { 9 | 10 | EXPORT const char* MODULE_NAME = "libSceNpWebApi2"; 11 | 12 | EXPORT SYSV_ABI int32_t sceNpWebApi2Initialize() { 13 | return Ok; 14 | } 15 | 16 | EXPORT SYSV_ABI int32_t sceNpWebApi2CreateRequest() { 17 | return Ok; 18 | } 19 | 20 | EXPORT SYSV_ABI int32_t sceNpWebApi2AddHttpRequestHeader() { 21 | return Ok; 22 | } 23 | 24 | EXPORT SYSV_ABI int32_t sceNpWebApi2SendRequest() { 25 | return Ok; 26 | } 27 | 28 | EXPORT SYSV_ABI int32_t sceNpWebApi2CreateUserContext() { 29 | return Ok; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /modules/libSceMouse/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceMouse); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceMouse"; 12 | 13 | EXPORT SYSV_ABI int sceMouseInit(void) { 14 | return Ok; 15 | } 16 | 17 | EXPORT SYSV_ABI int sceMouseOpen(SceUserServiceUserId userId, int32_t type, int32_t index, const SceMouseOpenParam* pParam) { 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int sceMouseClose(int32_t handle) { 22 | return Ok; 23 | } 24 | 25 | EXPORT SYSV_ABI int sceMouseRead(int32_t handle, SceMouseData* pData, int32_t num) { 26 | pData[0] = SceMouseData(); 27 | return 1; 28 | } 29 | } -------------------------------------------------------------------------------- /modules/libSceMouse/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t ERROR_INVALID_ARG = -2132869119; 6 | constexpr int32_t ERROR_INVALID_PORT = -2132869118; 7 | constexpr int32_t ERROR_INVALID_HANDLE = -2132869117; 8 | constexpr int32_t ERROR_ALREADY_OPENED = -2132869116; 9 | constexpr int32_t ERROR_NOT_INITIALIZED = -2132869115; 10 | constexpr int32_t ERROR_DEVICE_NOT_CONNECTED = -2132869113; 11 | constexpr int32_t ERROR_FATAL = -2132868865; 12 | } // namespace Err 13 | 14 | constexpr uint8_t SCE_MOUSE_PORT_TYPE_STANDARD = 0; /* standard mouse */ 15 | constexpr uint8_t SCE_MOUSE_MAX_STANDARD_PORT_INDEX = 2; /* max index of standard mouse */ -------------------------------------------------------------------------------- /tools/matchers/compilers.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "clang-cl", 5 | "pattern": [ 6 | { 7 | "regexp": "^(.*)\\((\\d+),(\\d+)\\):\\s+(warning|error):\\s+(.*)", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3, 11 | "severity": 4, 12 | "message": 5 13 | } 14 | ] 15 | }, 16 | { 17 | "owner": "msvc", 18 | "pattern": [ 19 | { 20 | "regexp": "^(.*)\\((\\d+)\\)\\s*:\\s*(?:fatal\\s*)?(error|warning)\\s+(?:.*)?([\\d]{4}):(\\s+.*)$", 21 | "file": 1, 22 | "line": 2, 23 | "code": 4, 24 | "severity": 3, 25 | "message": 5 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /modules/libSceNgs2/riffTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct RiffHeader { 5 | unsigned char chunkID[4]; // RIFF 6 | uint32_t chunkSize; 7 | } __attribute__((packed)); 8 | 9 | struct RiffWaveHeader { 10 | unsigned char chunkID[4]; // RIFF 11 | uint32_t chunkSize; 12 | unsigned char riffType[4]; // WAVE 13 | } __attribute__((packed)); 14 | 15 | struct RiffFormatHeader { 16 | unsigned char chunkID[4]; // RIFF 17 | uint32_t chunkSize; 18 | uint16_t audioFormat; 19 | uint16_t numChannels; 20 | uint32_t sampleRate; // Sampling Frequency in Hz 21 | uint32_t avgByteRate; // ~bytes per second 22 | uint16_t frameSize; // BlockAlign 23 | uint16_t bitsPerSample; 24 | } __attribute__((packed)); -------------------------------------------------------------------------------- /modules/libScePngDec/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace PngDec { 6 | constexpr int32_t INVALID_ADDR = -2140602367; 7 | constexpr int32_t INVALID_SIZE = -2140602366; 8 | constexpr int32_t INVALID_PARAM = -2140602365; 9 | constexpr int32_t INVALID_HANDLE = -2140602364; 10 | constexpr int32_t INVALID_DATA = -2140602352; 11 | constexpr int32_t UNSUPPORT_DATA = -2140602351; 12 | constexpr int32_t DECODE_ERROR = -2140602350; 13 | constexpr int32_t FATAL = -2140602336; 14 | } // namespace PngDec 15 | } // namespace Err 16 | 17 | namespace PngDec { 18 | namespace ImageFlag { 19 | constexpr uint8_t ADAM7_INTERLACE = 1; 20 | constexpr uint8_t TRNS_CHUNK_EXIST = 2; 21 | } // namespace ImageFlag 22 | }; // namespace PngDec 23 | -------------------------------------------------------------------------------- /modules/libScePadTracker/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class ScePadTrackerStatus { 5 | TRACKER_TRACKING = 0, 6 | TRACKER_NOT_TRACKING = 1, 7 | TRACKER_ROOM_CONFLICT = 2, 8 | TRACKER_CALIBRATING = 3, 9 | }; 10 | 11 | struct ScePadTrackerImageCoordinates { 12 | ScePadTrackerStatus status; 13 | float x; 14 | float y; 15 | }; 16 | 17 | struct ScePadTrackerImage { 18 | int exposure; 19 | int gain; 20 | int width; 21 | int height; 22 | void* data; 23 | }; 24 | 25 | struct ScePadTrackerInput { 26 | int32_t handles[TRACKER_CONTROLLER_MAX]; 27 | ScePadTrackerImage images[TRACKER_IMAGE_MAX]; 28 | }; 29 | 30 | struct ScePadTrackerData { 31 | ScePadTrackerImageCoordinates imageCoordinates[TRACKER_IMAGE_MAX]; 32 | }; -------------------------------------------------------------------------------- /tools/logging/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.24) 2 | 3 | add_library(logging SHARED logging.cpp) 4 | 5 | add_dependencies(logging third_party config_emu) 6 | 7 | target_link_libraries(logging PRIVATE ws2_32 p7 config_emu.lib) 8 | 9 | target_compile_definitions(logging PRIVATE BOOST_ALL_NO_LIB WIN32_LEAN_AND_MEAN) 10 | 11 | target_compile_options(logging PRIVATE "/Zi") 12 | 13 | set_target_properties(logging 14 | PROPERTIES 15 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 16 | ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 17 | ) 18 | 19 | # Stub 20 | add_library(logging_stub SHARED logging_stub.cpp) 21 | 22 | set_target_properties(logging_stub 23 | PROPERTIES 24 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 25 | ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 26 | ) -------------------------------------------------------------------------------- /core/imports/exports/pm4_custom.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Pm4 { 6 | 7 | #define PM4_GET(u, r, f) (((u) >> Pm4::r##_##f##_SHIFT) & Pm4::r##_##f##_MASK) 8 | 9 | enum class Custom : uint8_t { 10 | R_VS, 11 | R_PS, 12 | R_DRAW_INDEX, 13 | R_DRAW_INDEX_AUTO, 14 | R_DRAW_INDEX_OFFSET, 15 | R_DRAW_RESET, 16 | R_WAIT_FLIP_DONE, 17 | R_CS, 18 | R_DISPATCH_DIRECT, 19 | R_DISPATCH_RESET, 20 | R_DISPATCH_WAIT_MEM, 21 | R_PUSH_MARKER, 22 | R_POP_MARKER, 23 | R_VS_EMBEDDED, 24 | R_PS_EMBEDDED, 25 | R_VS_UPDATE, 26 | R_PS_UPDATE, 27 | R_VGT_CONTROL, 28 | R_NUM_COMMANDS, // used for array size 29 | }; 30 | 31 | constexpr uint32_t create(uint16_t len, Custom baseIndex) { 32 | return 0x60000000u | (((len - 2u) & 0x3fffu) << 8u) | (uint8_t)baseIndex; 33 | } 34 | 35 | } // namespace Pm4 -------------------------------------------------------------------------------- /modules/libSceLibcInternalExt/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceLibcInternalExt); 6 | 7 | namespace { 8 | struct HeapInfoInfo { 9 | uint64_t size = sizeof(HeapInfoInfo); 10 | uint32_t flag; 11 | uint32_t getSegmentInfo; 12 | uint64_t* mspace_atomic_id_mask; 13 | uint64_t* mstate_table; 14 | }; 15 | 16 | } // namespace 17 | 18 | extern "C" { 19 | 20 | EXPORT const char* MODULE_NAME = "libSceLibcInternal"; 21 | 22 | EXPORT SYSV_ABI void sceLibcHeapGetTraceInfo(HeapInfoInfo* info) { 23 | static uint64_t g_mspace_atomic_id_mask = 0; 24 | static uint64_t g_mstate_table[64] = {0}; 25 | 26 | info->mspace_atomic_id_mask = &g_mspace_atomic_id_mask; 27 | info->mstate_table = g_mstate_table; 28 | info->getSegmentInfo = 0; 29 | } 30 | } -------------------------------------------------------------------------------- /core/kernel/errors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "modules_include/common.h" 3 | #if defined(__APICALL_EXTERN) 4 | #define __APICALL __declspec(dllexport) 5 | #elif defined(__APICALL_IMPORT) 6 | #define __APICALL __declspec(dllimport) 7 | #else 8 | #define __APICALL 9 | #endif 10 | 11 | __APICALL int* getError_pthread(); 12 | __APICALL void setError_pthread(int); 13 | 14 | /** 15 | * @brief Takes Kernel errors from gerErr(), converts and saves it 16 | * 17 | * @param result from gerErr() 18 | * @return int32_t 19 | */ 20 | static int32_t POSIX_CALL(int32_t result) { 21 | if (result >= 0) return result; 22 | 23 | int res = result - (int32_t)0x80020000; 24 | setError_pthread(res); 25 | return res; 26 | } 27 | 28 | static int32_t POSIX_SET(ErrCode error) { 29 | setError_pthread((int32_t)error); 30 | return -1; 31 | } 32 | 33 | #undef __APICALL 34 | -------------------------------------------------------------------------------- /modules/libSceGraphicsDriver/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class SceWorkloadStatus : uint32_t { 5 | StatusOk = 0, ///< The operation was performed successfully. 6 | StatusInvalidStream = 1, ///< The stream parameter was invalid. 7 | StatusInvalidWorkload = 2, ///< The workload parameter was invalid. 8 | StatusInvalidPointer = 3, ///< The required pointer argument was not set. 9 | StatusTooManyStreams = 4, ///< The maximum number of streams has already been allocated. 10 | StatusTooManyWorkloads = 5, ///< The maximum number of active workloads for a stream has been reached. 11 | StatusStreamNotAllocated = 6, ///< The stream to be destroyed was not created. 12 | StatusInternalError = 7, ///< The system was unable to perform the work. 13 | }; 14 | 15 | typedef uint32_t SceWorkloadStream; -------------------------------------------------------------------------------- /modules/libSceHttp/httpsTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../libSceSsl/types.h" 4 | #include "modules_include/common.h" 5 | 6 | enum class SceHttpsFlags : unsigned int { 7 | SERVER_VERIFY = 0x01U, // Server Certificate Verify 8 | CLIENT_VERIFY = 0x02U, // Client Certificate Verify 9 | CN_CHECK = 0x04U, // Common Name Check 10 | NOT_AFTER_CHECK = 0x08U, // Not Valid After Check 11 | NOT_BEFORE_CHECK = 0x10U, // Not Valid Before Check 12 | KNOWN_CA_CHECK = 0x20U, // Known CA Check 13 | SESSION_REUSE = 0x40U, // Session Reuse 14 | SNI = 0x80U // Server Name Indication (SNI) 15 | 16 | }; 17 | 18 | enum class SceHttpSslVersion { SSLV23, SSLV2, SSLV3, TLSV1 }; 19 | 20 | using SceHttpsCallback = SYSV_ABI int (*)(int libsslCtxId, unsigned int verifyErr, SceSslCert* const sslCert[], int certNum, void* userArg); 21 | -------------------------------------------------------------------------------- /modules/libSceAvPlayer/entryEx.cpp: -------------------------------------------------------------------------------- 1 | #include "avplayer.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "typesEx.h" 5 | 6 | namespace {} // namespace 7 | 8 | extern "C" { 9 | EXPORT SYSV_ABI int32_t sceAvPlayerInitEx(const SceAvPlayerInitDataEx* initDataEx, IAvplayer** avPlayer) { 10 | auto inst = createAvPlayer(initDataEx->memoryReplacement); 11 | *avPlayer = inst.release(); 12 | 13 | return Ok; 14 | } 15 | 16 | EXPORT SYSV_ABI bool sceAvPlayerGetVideoDataEx(IAvplayer* avPlayer, SceAvPlayerFrameInfoEx* videoInfo) { 17 | return avPlayer->getVideoData(videoInfo, true); 18 | } 19 | 20 | EXPORT SYSV_ABI int32_t sceAvPlayerAddSourceEx(IAvplayer* avPlayer, SceAvPlayerUriType uriType, SceAvPlayerSourceDetails* sourceDetails) { 21 | if (avPlayer->setFile(sourceDetails->uri.name)) return Ok; 22 | return Err::AvPlayer::INVALID_PARAMS; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tools/gamereport/git_ver.cpp.in: -------------------------------------------------------------------------------- 1 | #include "git_ver.h" 2 | 3 | bool git_IsPopulated() { 4 | return "@GIT_RETRIEVED_STATE@"; 5 | } 6 | 7 | bool git_AnyUncommittedChanges() { 8 | return "@GIT_IS_DIRTY@"; 9 | } 10 | 11 | const char* git_AuthorName() { 12 | return "@GIT_AUTHOR_NAME@"; 13 | } 14 | 15 | const char* git_AuthorEmail() { 16 | return "@GIT_AUTHOR_EMAIL@"; 17 | } 18 | 19 | const char* git_CommitSHA1() { 20 | return "@GIT_HEAD_SHA1@"; 21 | } 22 | 23 | const char* git_CommitDate() { 24 | return "@GIT_COMMIT_DATE_ISO8601@"; 25 | } 26 | 27 | const char* git_CommitSubject() { 28 | return "@GIT_COMMIT_SUBJECT@"; 29 | } 30 | 31 | const char* git_CommitBody() { 32 | return "@GIT_COMMIT_BODY@"; 33 | } 34 | 35 | const char* git_Describe() { 36 | return "@GIT_DESCRIBE@"; 37 | } 38 | 39 | const char* git_Branch() { 40 | return "@GIT_BRANCH@"; 41 | } 42 | -------------------------------------------------------------------------------- /modules/libSceDiscMap/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | namespace {} // namespace 6 | 7 | extern "C" { 8 | EXPORT const char* MODULE_NAME = "libSceDiscMap"; 9 | 10 | EXPORT SYSV_ABI int sceDiscMapIsRequestOnHDD(const char* file, uint64_t a2, uint64_t a3, int* retVal) { 11 | return Err::DiscMap::NO_BITMAP_INFO; 12 | } 13 | 14 | EXPORT SYSV_ABI int __NID_HEX(7C980FFB0AA27E7A)() { 15 | return Ok; 16 | } 17 | 18 | EXPORT SYSV_ABI int sceDiscMapGetPackageSize(int64_t fflags, void* p1, void* p2) { 19 | return Err::DiscMap::NO_BITMAP_INFO; 20 | } 21 | 22 | EXPORT SYSV_ABI int __NID_HEX(8A828CAEE7EDD5E9)(const char* file, void* p1, void* p2, int64_t* pFlags, int64_t* p3, int64_t* p4) { 23 | return Err::DiscMap::NO_BITMAP_INFO; 24 | } 25 | 26 | EXPORT SYSV_ABI int __NID_HEX(E7EBCE96E92F91F8)() { 27 | return Ok; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /modules/libSceScreenShot/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceScreenShot); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceScreenShot"; 12 | 13 | EXPORT SYSV_ABI int32_t sceScreenShotSetParam(const SceScreenShotParam* param) { 14 | return Ok; 15 | } 16 | 17 | EXPORT SYSV_ABI int32_t sceScreenShotSetOverlayImage(const char* filePath, int32_t offsetX, int32_t offsetY) { 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceScreenShotSetOverlayImageWithOrigin(const char* filePath, int32_t marginX, int32_t marginY, SceScreenShotOrigin origin) { 22 | return Ok; 23 | } 24 | 25 | EXPORT SYSV_ABI int32_t sceScreenShotDisable(void) { 26 | return Ok; 27 | } 28 | 29 | EXPORT SYSV_ABI int32_t sceScreenShotEnable(void) { 30 | return Ok; 31 | } 32 | } -------------------------------------------------------------------------------- /modules/libSceAudioIn/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceAudioIn); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceAudioIn"; 12 | 13 | EXPORT SYSV_ABI int32_t sceAudioInOpen(int32_t userId, int32_t type, int32_t index, uint32_t len, uint32_t freq, uint32_t param) { 14 | return Err::PORT_FULL; 15 | } 16 | 17 | EXPORT SYSV_ABI int32_t sceAudioInClose(int32_t handle) { 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceAudioInInput(int32_t handle, void* dest) { 22 | return Ok; 23 | } 24 | 25 | EXPORT SYSV_ABI int32_t sceAudioInGetSilentState(int32_t handle) { 26 | return Ok; 27 | } 28 | 29 | EXPORT SYSV_ABI int32_t sceAudioInHqOpen(int32_t userId, int32_t type, int32_t index, uint32_t timeLen, uint32_t freq, uint32_t param) { 30 | return Ok; 31 | } 32 | } -------------------------------------------------------------------------------- /modules/libScePlayGo/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class ScePlayGoLocusValue : uint32_t { 5 | NotDownloaded = 0, 6 | LocalSlow = 2, 7 | LocalFast = 3 8 | 9 | }; 10 | 11 | enum class ScePlayGoInstallSpeedValue : uint32_t { Suspended = 0, Trickle = 1, Full = 2 }; 12 | 13 | typedef int32_t ScePlayGoHandle; 14 | typedef uint16_t ScePlayGoChunkId; 15 | typedef int8_t ScePlayGoLocus; 16 | typedef int32_t ScePlayGoInstallSpeed; 17 | typedef int64_t ScePlayGoEta; 18 | typedef uint64_t ScePlayGoLanguageMask; 19 | 20 | struct ScePlayGoInitParams { 21 | const void* bufAddr; 22 | uint32_t bufSize; 23 | uint32_t reserved; 24 | }; 25 | 26 | struct ScePlayGoToDo { 27 | ScePlayGoChunkId chunkId; 28 | ScePlayGoLocus locus; 29 | int8_t reserved; 30 | }; 31 | 32 | struct ScePlayGoProgress { 33 | uint64_t progressSize; 34 | uint64_t totalSize; 35 | }; -------------------------------------------------------------------------------- /modules/libSceNgs2/reader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.h" 4 | 5 | class Reader { 6 | void* m_pimpl; 7 | bool m_isInit = false; 8 | bool m_isCompressed = false; 9 | 10 | SceNgs2Handle_voice* voice; 11 | 12 | SceNgs2SamplerVoiceState m_state; 13 | 14 | bool getAudioUncompressed(SceNgs2RenderBufferInfo*, uint32_t numOutSamples, uint32_t outRate); 15 | bool getAudioCompressed(SceNgs2RenderBufferInfo*); 16 | 17 | public: 18 | Reader(SceNgs2Handle_voice* voice); 19 | ~Reader(); 20 | 21 | bool init(SceNgs2SamplerVoiceWaveformBlocksParam const* param); 22 | 23 | bool getAudio(SceNgs2RenderBufferInfo*, uint32_t numOutSamples, uint32_t outRate); 24 | 25 | void setNewData(void const* start, void const* end); 26 | 27 | void getState(SceNgs2SamplerVoiceState* state) const { 28 | *state = m_state; 29 | state->voiceState = voice->state; 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /modules/libSceAvPlayer/avplayer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utility/utility.h" 3 | 4 | struct SceAvPlayerFrameInfo; 5 | struct SceAvPlayerMemAllocator; 6 | 7 | class IAvplayer { 8 | CLASS_NO_COPY(IAvplayer); 9 | 10 | protected: 11 | IAvplayer() = default; 12 | 13 | public: 14 | virtual bool setFile(const char* filename) = 0; 15 | virtual void setLoop(bool isLoop) = 0; 16 | 17 | virtual bool getVideoData(void* videoInfo, bool isEx) = 0; 18 | virtual bool getAudioData(SceAvPlayerFrameInfo* videoInfo) = 0; 19 | 20 | virtual bool isPlaying() = 0; 21 | virtual void stop() = 0; 22 | 23 | /** 24 | * @brief Get the latest timestamp 25 | * 26 | * @return uint64_t [ms] 27 | */ 28 | virtual uint64_t getCurrentTime() const = 0; 29 | 30 | virtual ~IAvplayer() = default; 31 | }; 32 | 33 | std::unique_ptr createAvPlayer(SceAvPlayerMemAllocator const& initData); -------------------------------------------------------------------------------- /core/videoout/overlay/overlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../imageHandler.h" 3 | #include "../vulkan/vulkanSetup.h" 4 | #include "core/videoout/vulkan/vulkanTypes.h" 5 | #include "utility/utility.h" 6 | 7 | #include 8 | #include 9 | 10 | struct ImageData; 11 | 12 | class IOverlayHandler { 13 | CLASS_NO_COPY(IOverlayHandler); 14 | 15 | protected: 16 | IOverlayHandler() = default; 17 | 18 | public: 19 | virtual ~IOverlayHandler() = default; 20 | 21 | virtual void stop() = 0; 22 | 23 | virtual void submit(ImageData const& imageData) = 0; 24 | 25 | virtual void processEvent(SDL_Event const* event) = 0; 26 | }; 27 | 28 | std::unique_ptr createOverlay(std::shared_ptr& deviceInfo, std::shared_ptr& imageHandler, 29 | SDL_Window* window, vulkan::QueueInfo* queue, VkFormat displayFormat); 30 | -------------------------------------------------------------------------------- /docs/json/logging.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": false, 4 | "properties": { 5 | "$schema": { 6 | "type": "string" 7 | }, 8 | "sink": { 9 | "type": "string", 10 | "description": "Logging output.", 11 | "enum": [ 12 | "Null", 13 | "Auto", 14 | "Syslog", 15 | "Console", 16 | "FileTxt", 17 | "FileBin", 18 | "Baical" 19 | ] 20 | }, 21 | "verbosity": { 22 | "type": "integer", 23 | "description": "Verbosity level of logger.\nPossible values:\n0 - Trace\n1 - Debug\n2 - Warning\n3 - Error\n4 - Critical\n5 - None", 24 | "minimum": 0, 25 | "maximum": 5 26 | }, 27 | "_customVerb": { 28 | "type": "object", 29 | "description": "Custom verbosity level for each module." 30 | } 31 | }, 32 | "required": [ 33 | "sink", 34 | "verbosity" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /modules/libSceImeDialog/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceImeDialog); 7 | 8 | namespace { 9 | static SceCommonDialogStatus g_curStatus = SceCommonDialogStatus::NONE; 10 | } // namespace 11 | 12 | extern "C" { 13 | 14 | EXPORT const char* MODULE_NAME = "libSceImeDialog"; 15 | 16 | EXPORT SYSV_ABI int32_t sceImeDialogInit() { 17 | g_curStatus = SceCommonDialogStatus::INITIALIZED; 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceImeDialogTerm(void) { 22 | g_curStatus = SceCommonDialogStatus::NONE; 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI SceCommonDialogStatus sceImeDialogGetStatus(void) { 27 | return g_curStatus; 28 | } 29 | 30 | EXPORT SYSV_ABI int32_t sceImeDialogGetPanelSizeExtended() { 31 | return Ok; 32 | } 33 | 34 | EXPORT SYSV_ABI int32_t sceImeDialogGetResult() { 35 | return Ok; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /modules/libSceUserService/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Err { 6 | namespace UserService { 7 | constexpr int32_t INTERNAL = -2137653247; /* 0x80960001 */ 8 | constexpr int32_t NOT_INITIALIZED = -2137653246; /* 0x80960002 */ 9 | constexpr int32_t ALREADY_INITIALIZED = -2137653245; /* 0x80960003 */ 10 | constexpr int32_t NO_MEMORY = -2137653244; /* 0x80960004 */ 11 | constexpr int32_t INVALID_ARGUMENT = -2137653243; /* 0x80960005 */ 12 | constexpr int32_t OPERATION_NOT_SUPPORTED = -2137653242; /* 0x80960006 */ 13 | constexpr int32_t NO_EVENT = -2137653241; /* 0x80960007 */ 14 | constexpr int32_t NOT_LOGGED_IN = -2137653239; /* 0x80960009 */ 15 | constexpr int32_t BUFFER_TOO_SHORT = -2137653238; /* 0x8096000A */ 16 | } // namespace UserService 17 | } // namespace Err 18 | 19 | constexpr size_t USER_SERVICE_MAX_USER_NAME_LENGTH = 16; 20 | -------------------------------------------------------------------------------- /core/videoout/overlay/overtrophy/overtrophy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class OverTrophy { 8 | struct notify { 9 | float slide = 1.0f; 10 | float timer = 5.0f; 11 | bool animdone = false; 12 | 13 | uint8_t grade; 14 | std::string title; 15 | std::string subtext; 16 | void* pngdata; 17 | size_t pngsize; 18 | 19 | ~notify() { 20 | if (pngdata != nullptr) ::free(pngdata); 21 | } 22 | }; 23 | 24 | std::vector m_notifications; 25 | 26 | ImFont* m_defaultFont; 27 | ImFont* m_titleFont; 28 | ImFont* m_textFont; 29 | 30 | ImFont* CreateFont(float px); 31 | void addNotify(uint8_t grade, std::string title, std::string details); 32 | 33 | public: 34 | OverTrophy() = default; 35 | virtual ~OverTrophy() = default; 36 | 37 | void init(); 38 | void draw(double fps); 39 | }; 40 | -------------------------------------------------------------------------------- /modules/libSceNet/epoll.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "core/networking/networking.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | extern "C" { 7 | EXPORT SYSV_ABI SceNetId sceNetEpollCreate(const char* name, int flags) { 8 | return accessNetworking().epollCreate(name, flags); 9 | } 10 | 11 | EXPORT SYSV_ABI int sceNetEpollControl(SceNetId eid, int op, SceNetId id, SceNetEpollEvent* event) { 12 | return accessNetworking().epollControl(eid, op, id, event); 13 | } 14 | 15 | EXPORT SYSV_ABI int sceNetEpollWait(SceNetId eid, SceNetEpollEvent* events, int maxevents, int timeout) { 16 | return accessNetworking().epollWait(eid, events, maxevents, timeout); 17 | } 18 | 19 | EXPORT SYSV_ABI int sceNetEpollDestroy(SceNetId eid) { 20 | return accessNetworking().epollDestroy(eid); 21 | } 22 | 23 | EXPORT SYSV_ABI int sceNetEpollAbort(SceNetId eid, int flags) { 24 | return accessNetworking().epollAbort(eid, flags); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /modules/libSceRtc/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Err { 6 | namespace Rtc { 7 | constexpr int32_t NOT_INITIALIZED = -2135621631; 8 | constexpr int32_t INVALID_POINTER = -2135621630; 9 | constexpr int32_t INVALID_VALUE = -2135621629; 10 | constexpr int32_t INVALID_ARG = -2135621628; 11 | constexpr int32_t NOT_SUPPORTED = -2135621627; 12 | constexpr int32_t NO_CLOCK = -2135621626; 13 | constexpr int32_t BAD_PARSE = -2135621625; 14 | constexpr int32_t INVALID_YEAR = -2135621624; 15 | constexpr int32_t INVALID_MONTH = -2135621623; 16 | constexpr int32_t INVALID_DAY = -2135621622; 17 | constexpr int32_t INVALID_HOUR = -2135621621; 18 | constexpr int32_t INVALID_MINUTE = -2135621620; 19 | constexpr int32_t INVALID_SECOND = -2135621619; 20 | constexpr int32_t INVALID_MICROSECOND = -2135621618; 21 | } // namespace Rtc 22 | } // namespace Err 23 | -------------------------------------------------------------------------------- /core/videoout/vulkan/vulkanHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vulkanSetup.h" 4 | 5 | #include 6 | 7 | class IGraphics; 8 | struct ImageData; 9 | 10 | namespace vulkan { 11 | struct PresentData { 12 | VkImage swapchainImage = nullptr; 13 | VkSemaphore displayReady = nullptr; 14 | VkSemaphore presentReady = nullptr; 15 | uint32_t index = 0; 16 | }; 17 | 18 | std::pair getDisplayFormat(VulkanObj* obj); 19 | 20 | void submitDisplayTransfer(SwapchainData::DisplayBuffers const* displayBuffer, ImageData const& imageData, QueueInfo const* queue, VkSemaphore waitSema, 21 | size_t waitValue); 22 | 23 | void transfer2Display(SwapchainData::DisplayBuffers const* displayBuffer, ImageData const& imageData, IGraphics* graphics); 24 | 25 | void presentImage(ImageData const& imageData, VkSwapchainKHR swapchain, QueueInfo const* queue); 26 | 27 | } // namespace vulkan 28 | -------------------------------------------------------------------------------- /modules/libSceInvitationDialog/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceInvitationDialog); 7 | 8 | namespace { 9 | static SceCommonDialogStatus g_curStatus = SceCommonDialogStatus::NONE; 10 | } // namespace 11 | 12 | extern "C" { 13 | 14 | EXPORT const char* MODULE_NAME = "libSceInvitationDialog"; 15 | 16 | EXPORT SYSV_ABI int32_t sceInvitationDialogInitialize() { 17 | g_curStatus = SceCommonDialogStatus::INITIALIZED; 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceInvitationDialogTerminate(void) { 22 | g_curStatus = SceCommonDialogStatus::NONE; 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI SceCommonDialogStatus sceInvitationDialogUpdateStatus(void) { 27 | return g_curStatus; 28 | } 29 | 30 | EXPORT SYSV_ABI int32_t sceInvitationDialogOpen(const void* param) { 31 | g_curStatus = SceCommonDialogStatus::FINISHED; 32 | return Ok; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /modules/libScePadTracker/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libScePadTracker); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libScePadTracker"; 12 | 13 | EXPORT SYSV_ABI int32_t scePadTrackerCalibrate(int32_t* onionSize, int32_t* garlicSize) { 14 | return Ok; 15 | } 16 | 17 | EXPORT SYSV_ABI int32_t scePadTrackerGetWorkingMemorySize(int32_t* onionSize, int32_t* garlicSize) { 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t scePadTrackerInit(void* onionMemory, void* garlicMemory, int pipeId, int queueId) { 22 | return Ok; 23 | } 24 | 25 | EXPORT SYSV_ABI int32_t scePadTrackerReadState(int32_t handle, ScePadTrackerData* data) { 26 | return Ok; 27 | } 28 | 29 | EXPORT SYSV_ABI int32_t scePadTrackerTerm() { 30 | return Ok; 31 | } 32 | 33 | EXPORT SYSV_ABI int32_t scePadTrackerUpdate(ScePadTrackerInput input) { 34 | return Ok; 35 | } 36 | } -------------------------------------------------------------------------------- /modules/libScePad/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace Pad { 6 | constexpr int32_t INVALID_ARG = -2137915391; /* 0x80920001 */ 7 | constexpr int32_t INVALID_PORT = -2137915390; /* 0x80920002 */ 8 | constexpr int32_t INVALID_HANDLE = -2137915389; /* 0x80920003 */ 9 | constexpr int32_t ALREADY_OPENED = -2137915388; /* 0x80920004 */ 10 | constexpr int32_t NOT_INITIALIZED = -2137915387; /* 0x80920005 */ 11 | constexpr int32_t INVALID_LIGHTBAR_SETTING = -2137915386; /* 0x80920006 */ 12 | constexpr int32_t DEVICE_NOT_CONNECTED = -2137915385; /* 0x80920007 */ 13 | constexpr int32_t NO_HANDLE = -2137915384; /* 0x80920008 */ 14 | constexpr int32_t FATAL = -2137915137; /* 0x809200FF */ 15 | } // namespace Pad 16 | } // namespace Err 17 | 18 | constexpr uint32_t SCE_PAD_MAX_TOUCH_NUM = 2; 19 | constexpr uint32_t SCE_PAD_MAX_DEVICE_UNIQUE_DATA_SIZE = 12; 20 | -------------------------------------------------------------------------------- /modules/libSceAudiodecCpu/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceAudiodecCpu); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceAudiodecCpu"; 12 | 13 | EXPORT SYSV_ABI int32_t sceAudiodecCpuQueryMemSize(SceAudiodecCpuCtrl* pCtrl, SceAudiodecCpuResource* pRes, uint32_t uiCodecType) { 14 | LOG_USE_MODULE(libSceAudiodecCpu); 15 | LOG_ERR(L"todo %S", __FUNCTION__); 16 | return Ok; 17 | } 18 | 19 | EXPORT SYSV_ABI int32_t sceAudiodecCpuInitDecoder(SceAudiodecCpuCtrl* pCtrl, SceAudiodecCpuResource* pRes, uint32_t uiCodecType) { 20 | LOG_USE_MODULE(libSceAudiodecCpu); 21 | LOG_ERR(L"todo %S", __FUNCTION__); 22 | return Ok; 23 | } 24 | 25 | EXPORT SYSV_ABI int32_t sceAudiodecCpuDecode(SceAudiodecCpuCtrl* pCtrl, SceAudiodecCpuResource* pRes, uint32_t uiCodecType) { 26 | LOG_USE_MODULE(libSceAudiodecCpu); 27 | LOG_ERR(L"todo %S", __FUNCTION__); 28 | return Ok; 29 | } 30 | } -------------------------------------------------------------------------------- /modules/libSceMove/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t ERROR_NOT_INIT = -2131886079; // 0x80EE0001 6 | constexpr int32_t ERROR_ALREADY_INIT = -2131886078; // 0x80EE0002 7 | constexpr int32_t ERROR_INVALID_ARG = -2131886077; // 0x80EE0003 8 | constexpr int32_t ERROR_INVALID_HANDLE = -2131886076; // 0x80EE0004 9 | constexpr int32_t ERROR_MAX_CONTROLLERS_EXCEEDED = -2131886075; // 0x80EE0005 10 | constexpr int32_t ERROR_INVALID_PORT = -2131886074; // 0x80EE0006 11 | constexpr int32_t ERROR_ALREADY_OPENED = -2131886073; // 0x80EE0007 12 | constexpr int32_t ERROR_FATAL = -2131885825; // 0x80EE00FF 13 | } // namespace Err 14 | 15 | constexpr uint8_t SCE_MOVE_MAX_CONTROLLERS = 4; ///< Maximum number of motion controllers. 16 | constexpr uint8_t SCE_MOVE_MAX_CONTROLLERS_PER_PLAYER = 2; ///< Maximum number of motion controllers that can be bound to a player. 17 | -------------------------------------------------------------------------------- /tools/gamereport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(gamereport VERSION 0.0.1) 2 | 3 | set(SRC 4 | entry.cpp 5 | ) 6 | 7 | set(GIT_FAIL_IF_NONZERO_EXIT FALSE) 8 | set(GIT_WORKING_DIR ${PRJ_SRC_DIR}) 9 | set(PRE_CONFIGURE_FILE "git_ver.cpp.in") 10 | set(POST_CONFIGURE_FILE "${CMAKE_CURRENT_BINARY_DIR}/git_ver.cpp") 11 | include(git_watcher.cmake) 12 | 13 | add_library(gamereport SHARED ${SRC} ${POST_CONFIGURE_FILE}) 14 | 15 | target_include_directories(gamereport PRIVATE 16 | ${CMAKE_SOURCE_DIR} 17 | ) 18 | 19 | add_dependencies(gamereport third_party logging check_git core) 20 | target_link_libraries(gamereport PUBLIC libboost_url SDL2 libssl libcrypto core.lib logging.lib config_emu.lib) 21 | target_compile_definitions(gamereport PUBLIC BOOST_ALL_NO_LIB WIN32_LEAN_AND_MEAN) 22 | 23 | set_target_properties(gamereport 24 | PROPERTIES 25 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 26 | ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 27 | ) 28 | 29 | install(TARGETS gamereport LIBRARY DESTINATION .) 30 | -------------------------------------------------------------------------------- /modules/libSceAvPlayer/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace AvPlayer { 6 | constexpr int32_t INVALID_PARAMS = -2140536831; /* 0x806A0001 */ 7 | constexpr int32_t OPERATION_FAILED = -2140536830; /* 0x806A0002 */ 8 | constexpr int32_t NO_MEMORY = -2140536829; /* 0x806A0003 */ 9 | constexpr int32_t NOT_SUPPORTED = -2140536828; /* 0x806A0004 */ 10 | constexpr int32_t WAR_FILE_NONINTERLEAVED = -2140536672; /* 0x806A00A0 */ 11 | constexpr int32_t WAR_LOOPING_BACK = -2140536671; /* 0x806A00A1 */ 12 | constexpr int32_t WAR_JUMP_COMPLETE = -2140536669; /* 0x806A00A3 */ 13 | constexpr int32_t INFO_MARLIN_ENCRY = -2140536656; /* 0x806A00B0 */ 14 | constexpr int32_t INFO_PLAYREADY_ENCRY = -2140536652; /* 0x806A00B4 */ 15 | constexpr int32_t INFO_AES_ENCRY = -2140536651; /* 0x806A00B5 */ 16 | constexpr int32_t INFO_OTHER_ENCRY = -2140536641; /* 0x806A00BF */ 17 | } // namespace AvPlayer 18 | } // namespace Err 19 | -------------------------------------------------------------------------------- /modules/libSceJson2/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace Json { 6 | constexpr int32_t PARSE_INVALID_CHAR = -2138799871; 7 | constexpr int32_t NOMEM = -2138799870; 8 | constexpr int32_t NOFILE = -2138799869; 9 | constexpr int32_t NOROOT = -2138799868; 10 | constexpr int32_t NOBUF = -2138799867; 11 | constexpr int32_t NOINIT = -2138799856; 12 | constexpr int32_t MULTIPLEINIT = -2138799855; 13 | } // namespace Json 14 | 15 | namespace Json2 { 16 | constexpr int32_t ALREADY_SET = -2138799854; 17 | constexpr int32_t NOT_SUPPORTED = -2138799853; 18 | constexpr int32_t SPECIAL_FLOAT = -2138799852; 19 | constexpr int32_t NOT_EXIST_KEY = -2138799851; 20 | constexpr int32_t NOT_EXIST_INDEX = -2138799850; 21 | constexpr int32_t NOT_A_OBJECT = -2138799849; 22 | constexpr int32_t NOT_A_CONTAINER = -2138799848; 23 | constexpr int32_t INVALID_ARGUMENT = -2138799840; 24 | } // namespace Json2 25 | } // namespace Err 26 | -------------------------------------------------------------------------------- /modules/libSceMoveTracker/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceMoveTracker); 6 | 7 | extern "C" { 8 | 9 | EXPORT const char* MODULE_NAME = "libSceMoveTracker"; 10 | 11 | EXPORT SYSV_ABI int32_t sceMoveTrackerInit(void* onionMemory, void* garlicMemory, int pipeId, int queueId) { 12 | LOG_USE_MODULE(libSceMoveTracker); 13 | LOG_ERR(L"todo %S", __FUNCTION__); 14 | return Ok; 15 | } 16 | 17 | EXPORT SYSV_ABI int32_t sceMoveTrackerGetWorkingMemorySize(int* onionSize, int* garlicSize) { 18 | LOG_USE_MODULE(libSceMoveTracker); 19 | if (onionSize == nullptr || garlicSize == nullptr) { 20 | return Err::ERROR_INVALID_ARG; 21 | } 22 | *onionSize = 0x800000 + 0x200000; 23 | *garlicSize = 0x800000; 24 | return Ok; 25 | } 26 | 27 | EXPORT SYSV_ABI int32_t sceMoveTrackerControllersUpdate(SceMoveTrackerControllerInput controllerInputs) { 28 | LOG_USE_MODULE(libSceMoveTracker); 29 | LOG_ERR(L"todo %S", __FUNCTION__); 30 | return Ok; 31 | } 32 | } -------------------------------------------------------------------------------- /core/initParams/initParams.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utility/utility.h" 3 | 4 | #include 5 | 6 | class IInitParams { 7 | CLASS_NO_COPY(IInitParams); 8 | CLASS_NO_MOVE(IInitParams); 9 | 10 | public: 11 | IInitParams() = default; 12 | 13 | virtual bool init(int argc, char** argv) = 0; 14 | virtual bool isDebug() = 0; 15 | 16 | virtual std::string getApplicationPath() = 0; 17 | virtual std::string getApplicationRoot() = 0; 18 | virtual std::string getUpdateRoot() = 0; 19 | 20 | virtual bool enableValidation() = 0; 21 | virtual bool enableBrightness() = 0; 22 | virtual bool useVSYNC() = 0; 23 | virtual bool try4K() = 0; 24 | 25 | virtual ~IInitParams() = default; 26 | }; 27 | 28 | #if defined(__APICALL_INITPARAMS_EXTERN) 29 | #define __APICALL __declspec(dllexport) 30 | #elif defined(__APICALL_IMPORT) 31 | #define __APICALL __declspec(dllimport) 32 | #else 33 | #define __APICALL 34 | #endif 35 | 36 | __APICALL IInitParams* accessInitParams(); 37 | #undef __APICALL -------------------------------------------------------------------------------- /modules/libScePngEnc/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class ScePngEncColorSpace : uint16_t { 5 | RGB = 3, 6 | RGBA = 19, 7 | 8 | INVALID = 0xFFFF, 9 | }; 10 | 11 | enum class ScePngEncPixelFormat : uint16_t { 12 | R8G8B8A8 = 0, 13 | B8G8R8A8 = 1, 14 | }; 15 | 16 | typedef void* ScePngEncHandle; 17 | 18 | struct ScePngEncCreateParam { 19 | uint32_t cbSize; 20 | uint32_t attribute; 21 | uint32_t maxImageWidth; 22 | uint32_t maxFilterNumber; 23 | }; 24 | 25 | struct ScePngEncEncodeParam { 26 | const void* imageAddr; 27 | void* pngAddr; 28 | uint32_t imageSize; 29 | uint32_t pngSize; 30 | uint32_t imageWidth; 31 | uint32_t imageHeight; 32 | uint32_t imagePitch; 33 | uint16_t pixelFormat; 34 | uint16_t colorSpace; 35 | uint16_t bitDepth; 36 | uint16_t clutNumber; 37 | uint16_t filterType; 38 | uint16_t compressionLevel; 39 | }; 40 | 41 | struct ScePngEncOutputInfo { 42 | uint32_t dataSize; 43 | uint32_t processedHeight; 44 | }; 45 | -------------------------------------------------------------------------------- /modules/libSceDepth/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceDepth); 6 | 7 | extern "C" { 8 | 9 | EXPORT const char* MODULE_NAME = "libSceDepth"; 10 | 11 | EXPORT SYSV_ABI int sceDepthInitialize(const SceDepthInitializeParameter* initializeParameter, const SceDepthMemoryInformation* memoryInformation) { 12 | LOG_USE_MODULE(libSceDepth); 13 | LOG_ERR(L"todo %S", __FUNCTION__); 14 | return -1; 15 | } 16 | 17 | EXPORT SYSV_ABI int sceDepthQueryMemory(SceDepthInitializeParameter* initializeParameter, SceDepthQueryMemoryResult* queryMemoryResult) { 18 | LOG_USE_MODULE(libSceDepth); 19 | LOG_ERR(L"todo %S", __FUNCTION__); 20 | return Ok; 21 | } 22 | 23 | EXPORT SYSV_ABI int sceDepthEnableExtendedMode(uint32_t param1) { 24 | LOG_USE_MODULE(libSceDepth); 25 | LOG_ERR(L"todo %S", __FUNCTION__); 26 | return Ok; 27 | } 28 | 29 | EXPORT SYSV_ABI int sceDepthTerminate(int handle) { 30 | LOG_USE_MODULE(libSceDepth); 31 | LOG_ERR(L"todo %S", __FUNCTION__); 32 | return Ok; 33 | } 34 | } -------------------------------------------------------------------------------- /core/runtime/util/virtualmemory.cpp: -------------------------------------------------------------------------------- 1 | #include "virtualmemory.h" 2 | 3 | #include "core/memory/memory.h" 4 | #include "logging.h" 5 | 6 | #include 7 | 8 | LOG_DEFINE_MODULE(VIRTUALMEMORY); 9 | 10 | namespace {} // namespace 11 | 12 | bool flushInstructionCache(uint64_t address, uint64_t size) { 13 | LOG_USE_MODULE(VIRTUALMEMORY); 14 | if (::FlushInstructionCache(GetCurrentProcess(), reinterpret_cast(static_cast(address)), size) == 0) { 15 | LOG_ERR(L"FlushInstructionCache() failed: 0x%04x", static_cast(GetLastError())); 16 | return false; 17 | } 18 | return true; 19 | } 20 | 21 | bool patchReplace(uint64_t vaddr, uint64_t const value) { 22 | int oldMode; 23 | memory::protect(vaddr, 8, SceProtRead | SceProtWrite, &oldMode); 24 | 25 | auto* ptr = reinterpret_cast(vaddr); 26 | 27 | bool ret = (*ptr != value); 28 | 29 | *ptr = value; 30 | 31 | memory::protect(vaddr, 8, oldMode); 32 | 33 | if (memory::isExecute(oldMode)) { 34 | flushInstructionCache(vaddr, 8); 35 | } 36 | 37 | return ret; 38 | } -------------------------------------------------------------------------------- /modules/libSceNpSignaling/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceNpSignaling); 7 | 8 | namespace {} // namespace 9 | 10 | extern "C" { 11 | 12 | EXPORT const char* MODULE_NAME = "libSceNpSignaling"; 13 | 14 | EXPORT SYSV_ABI int32_t sceNpSignalingInitialize(uint64_t poolSize, int threadPriority, int cpuAffinityMask, uint64_t threadStackSize) { 15 | return Ok; 16 | } 17 | 18 | EXPORT SYSV_ABI int32_t sceNpSignalingCreateContext(const SceNpId* npId, SceNpSignalingHandler handler, void* arg, uint32_t* ctxId) { 19 | return Ok; 20 | } 21 | 22 | EXPORT SYSV_ABI int32_t sceNpSignalingCreateContextA(SceUserServiceUserId userId, SceNpSignalingHandler handler, void* arg, uint32_t* ctxId) { 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI int32_t sceNpSignalingGetLocalNetInfo(uint32_t ctxId, SceNpSignalingNetInfo* info) { 27 | return Ok; 28 | } 29 | 30 | EXPORT SYSV_ABI int32_t sceNpSignalingSetContextOption(uint32_t ctxId, int optname, int optval) { 31 | return Ok; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/videoout/overlay/imhelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define TR_BRONZE_COLOR IM_COL32(199, 124, 48, 255) 6 | #define TR_SILVER_COLOR IM_COL32(150, 164, 182, 255) 7 | #define TR_GOLD_COLOR IM_COL32(228, 194, 78, 255) 8 | #define TR_PLATINUM_COLOR IM_COL32(191, 191, 191, 255) 9 | #define TR_UNKNOWN_COLOR TR_BRONZE_COLOR 10 | 11 | static inline ImFont* _ImGuiCreateFont(float px) { 12 | ImGuiIO& io = ImGui::GetIO(); 13 | ImFontConfig cfg; 14 | cfg.MergeMode = true; 15 | cfg.FontDataOwnedByAtlas = false; 16 | 17 | ImVector ranges; 18 | ImFontGlyphRangesBuilder builder; 19 | builder.AddRanges(io.Fonts->GetGlyphRangesCyrillic()); 20 | builder.AddRanges(io.Fonts->GetGlyphRangesDefault()); 21 | builder.BuildRanges(&ranges); 22 | 23 | auto font = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\arial.ttf", px, nullptr, ranges.Data); 24 | io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Msyhl.ttc", px, &cfg, io.Fonts->GetGlyphRangesChineseFull()); 25 | io.Fonts->Build(); 26 | 27 | return font; 28 | } 29 | -------------------------------------------------------------------------------- /modules/libSceSsl/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class SceSslVersion : int { 5 | VERSION_NONE = 0, 6 | VERSION_SSL2_0, 7 | VERSION_SSL3_0, 8 | VERSION_TLS1_0, 9 | VERSION_TLS1_1, 10 | VERSION_TLS1_2 11 | 12 | }; 13 | enum class SceSslErrorVerify : unsigned int { 14 | ERROR_VERIFY_INTERNAL = 0x01U, 15 | ERROR_VERIFY_INVALID_CERT = 0x02U, 16 | ERROR_VERIFY_CN_CHECK = 0x04U, 17 | ERROR_VERify_NOT_AFTER_CHECK = 0x08U, 18 | ERROR_VERify_NOT_BEFORE_CHECK = 0x10U, 19 | ERROR_VERIFY_UNKNOWN_CA = 0x20U 20 | 21 | }; 22 | 23 | struct SceSslMemoryPoolStats { 24 | size_t poolSize; 25 | size_t maxInuseSize; 26 | size_t currentInuseSize; 27 | int32_t reserved; 28 | }; 29 | 30 | typedef void SceSslCert; 31 | typedef void SceSslCertName; 32 | 33 | struct SceSslCaList { 34 | SceSslCert** caCerts; 35 | int caNum; 36 | }; 37 | 38 | struct SceSslData { 39 | char* ptr; 40 | size_t size; 41 | }; 42 | 43 | struct SceSslCaCerts { 44 | SceSslData* certData; 45 | size_t certDataNum; 46 | void* pool; 47 | }; -------------------------------------------------------------------------------- /modules/libSceMouse/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class MouseButton : uint32_t { 5 | PRIMARY = 0x00000001, 6 | SECONDARY = 0x00000002, 7 | OPTIONAL = 0x00000004, 8 | OPTIONAL2 = 0x00000008, 9 | OPTIONAL3 = 0x00000010, 10 | INTERCEPTED = 0x80000000 11 | 12 | }; 13 | 14 | struct SceMouseData { 15 | uint64_t timestamp = 0; /*E System timestamp of this data(micro seconds). */ 16 | bool connected = false; /*E Mouse connection status. true:connected false:removed */ 17 | uint32_t buttons = 0; /*E Mouse buttons information */ 18 | int32_t xAxis = 0; /*E Amount of movement in the x direction */ 19 | int32_t yAxis = 0; /*E Amount of movement in the y direction */ 20 | int32_t wheel = 0; /*E Amount of wheel movement */ 21 | int32_t tilt = 0; /*E Amount of tilt movement (only for a mouse that supports a tilt wheel) */ 22 | uint8_t reserve[8]; /*E Reserved */ 23 | }; 24 | 25 | struct SceMouseOpenParam { 26 | uint8_t behaviorFlag; /*E Behavior flag */ 27 | uint8_t reserve[7]; /*E Reserved */ 28 | }; 29 | -------------------------------------------------------------------------------- /docs/json/audio.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": false, 4 | "properties": { 5 | "$schema": { 6 | "type": "string" 7 | }, 8 | "device": { 9 | "description": "The name of your sound output device e.g. \"Speakers (Realtek(R) Audio)\".\n* \"[default]\" means that emulator should use OS default audio device.\n* \"[null]\" means that emulator should not send the received data to any of audio devices.", 10 | "type": "string" 11 | }, 12 | "volume": { 13 | "description": "Master volume for every emulator's sound output.", 14 | "type": "number", 15 | "minimum": 0.0, 16 | "maximum": 1.0 17 | }, 18 | "padspeakers": { 19 | "type": "array", 20 | "description": "Host audio devices for each of connected gamepads.\n* \"[null]\" means that emulator should not send the received data to any of audio devices.", 21 | "minItems": 4, 22 | "maxItems": 4, 23 | "items": { 24 | "type": "string" 25 | } 26 | } 27 | }, 28 | "required": [ 29 | "device", 30 | "volume", 31 | "padspeakers" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /modules/libSceAudioIn/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t FATAL = -2144993024; 6 | constexpr int32_t INVALID_HANDLE = -2144993023; 7 | constexpr int32_t INVALID_SIZE = -2144993022; 8 | constexpr int32_t INVALID_FREQ = -2144993021; 9 | constexpr int32_t INVALID_TYPE = -2144993020; 10 | constexpr int32_t INVALID_POINTER = -2144993019; 11 | constexpr int32_t INVALID_PARAM = -2144993018; 12 | constexpr int32_t PORT_FULL = -2144993017; 13 | constexpr int32_t OUT_OF_MEMORY = -2144993016; 14 | constexpr int32_t NOT_OPENED = -2144993015; 15 | constexpr int32_t BUSY = -2144993014; 16 | constexpr int32_t SYSTEM_MEMORY = -2144993013; 17 | constexpr int32_t SYSTEM_IPC = -2144993012; 18 | } // namespace Err 19 | 20 | constexpr uint32_t SCE_AUDIO_IN_FREQ_DEFAULT = 16000; 21 | constexpr uint32_t SCE_AUDIO_IN_GRAIN_DEFAULT = 256; 22 | constexpr uint32_t SCE_AUDIO_IN_FREQ_HQ = 48000; 23 | constexpr uint32_t SCE_AUDIO_IN_TIME_SAMPLE_HQ = 128; 24 | constexpr uint32_t SCE_AUDIO_IN_GRAIN_MAX_HQ = (SCE_AUDIO_IN_TIME_SAMPLE_HQ * 3); 25 | -------------------------------------------------------------------------------- /core/systemContent/systemContent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace std::filesystem { 6 | class path; 7 | } 8 | 9 | class ISystemContent { 10 | public: 11 | /** 12 | * @brief Checks if the profided path contain "param.sfo" and reads it 13 | * 14 | * @param path 15 | */ 16 | virtual void init(std::filesystem::path const& path) = 0; 17 | 18 | /** 19 | * @brief Get an int value from the sfo 20 | * 21 | * @param name 22 | * @return std::optional 23 | */ 24 | virtual std::optional getInt(std::string_view name) const = 0; 25 | 26 | /** 27 | * @brief Get an string value from the sfo 28 | * 29 | * @param name 30 | * @return std::optional 31 | */ 32 | virtual std::optional getString(std::string_view name) const = 0; 33 | }; 34 | 35 | #if defined(__APICALL_EXTERN) 36 | #define __APICALL __declspec(dllexport) 37 | #elif defined(__APICALL_IMPORT) 38 | #define __APICALL __declspec(dllimport) 39 | #else 40 | #define __APICALL 41 | #endif 42 | __APICALL ISystemContent& accessSystemContent(); 43 | #undef __APICALL -------------------------------------------------------------------------------- /modules/libSceNgs2/readFuncs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "types.h" 3 | 4 | using funcReadBuf_t = int (*)(void*, uint8_t*, int); 5 | using funcSeekBuf_t = int64_t (*)(void*, int64_t, int); 6 | 7 | struct userData_user { 8 | SceWaveformUserFunc func; 9 | uintptr_t userData; 10 | size_t curOffset; 11 | }; 12 | 13 | struct userData_inerBuffer { 14 | const void* ptr; 15 | size_t size; 16 | size_t curOffset; 17 | }; 18 | 19 | int readFunc_linearBuffer(void* userData_, uint8_t* buf, int size); 20 | int64_t seekFunc_linearBuffer(void* userData_, int64_t offset, int whence); 21 | int readFunc_file(void* userData_, uint8_t* buf, int size); 22 | int64_t seekFunc_file(void* userData_, int64_t offset, int whence); 23 | int readFunc_user(void* userData_, uint8_t* buf, int size); 24 | int64_t seekFunc_user(void* userData_, int64_t offset, int whence); 25 | 26 | int32_t parseRiffWave(funcReadBuf_t readFunc, funcSeekBuf_t seekFunc, void* userData, SceNgs2WaveformFormat* wf); 27 | 28 | struct AVChannelLayout; 29 | AVChannelLayout convChannelLayout(SceNgs2ChannelsCount); 30 | uint32_t getSampleBytes(SceNgs2WaveFormType); -------------------------------------------------------------------------------- /modules/libSceAudiodec/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceAudiodec); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceAudiodec"; 12 | 13 | EXPORT SYSV_ABI int32_t sceAudiodecInitLibrary(uint32_t codecType) { 14 | LOG_USE_MODULE(libSceAudiodec); 15 | LOG_INFO(L"InitLibrary| codecType: %P", codecType); 16 | 17 | if (!(codecType >= Err::SCE_AUDIODEC_TYPE_AT9 && codecType <= Err::SCE_AUDIODEC_TYPE_M4AAC)) { 18 | return Err::SCE_AUDIODEC_ERROR_INVALID_TYPE; 19 | } else { 20 | return 0; 21 | } 22 | } 23 | 24 | EXPORT SYSV_ABI int32_t sceAudiodecClearContext(int32_t handle) { 25 | LOG_USE_MODULE(libSceAudiodec); 26 | return Ok; 27 | } 28 | 29 | EXPORT SYSV_ABI int32_t sceAudiodecTermLibrary(uint32_t codecType) { 30 | LOG_USE_MODULE(libSceAudiodec); 31 | LOG_INFO(L"TermLibrary| codecType: %P", codecType); 32 | 33 | if (!(codecType >= Err::SCE_AUDIODEC_TYPE_AT9 && codecType <= Err::SCE_AUDIODEC_TYPE_M4AAC)) { 34 | return Err::SCE_AUDIODEC_ERROR_INVALID_TYPE; 35 | } else { 36 | return 0; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /modules/libSceErrorDialog/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceErrorDialog); 7 | 8 | namespace { 9 | static SceCommonDialogStatus g_curStatus = SceCommonDialogStatus::NONE; 10 | } // namespace 11 | 12 | extern "C" { 13 | 14 | EXPORT const char* MODULE_NAME = "libSceErrorDialog"; 15 | 16 | EXPORT SYSV_ABI int32_t sceErrorDialogInitialize() { 17 | g_curStatus = SceCommonDialogStatus::INITIALIZED; 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceErrorDialogTerminate(void) { 22 | g_curStatus = SceCommonDialogStatus::NONE; 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI SceCommonDialogStatus sceErrorDialogUpdateStatus(void) { 27 | return g_curStatus; 28 | } 29 | 30 | EXPORT SYSV_ABI SceCommonDialogStatus sceErrorDialogGetStatus(void) { 31 | return g_curStatus; 32 | } 33 | 34 | EXPORT SYSV_ABI int32_t sceErrorDialogOpen(const void* param) { 35 | g_curStatus = SceCommonDialogStatus::FINISHED; 36 | return Ok; 37 | } 38 | 39 | EXPORT SYSV_ABI int32_t sceErrorDialogClose() { 40 | g_curStatus = SceCommonDialogStatus::FINISHED; 41 | return Ok; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /docs/json/graphics.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": false, 4 | "properties": { 5 | "$schema": { 6 | "type": "string" 7 | }, 8 | "display": { 9 | "type": "number", 10 | "description": "The display index where emulator windows will be shown." 11 | }, 12 | "fullscreen": { 13 | "type": "boolean", 14 | "description": "Wether emulator will run in fullscreen mode or not." 15 | }, 16 | "width": { 17 | "type": "number", 18 | "description": "The emulator window width, ignored in fullscreen mode.", 19 | "minimum": 400 20 | }, 21 | "height": { 22 | "type": "number", 23 | "description": "The emulator window height, ignored in fullscreen mode.", 24 | "minimum": 225 25 | }, 26 | "xpos": { 27 | "type": "number", 28 | "description": "The emulator window horizontal position." 29 | }, 30 | "ypos": { 31 | "type": "number", 32 | "description": "The emulator window vertical position." 33 | } 34 | }, 35 | "required": [ 36 | "display", 37 | "fullscreen", 38 | "width", 39 | "height", 40 | "xpos", 41 | "ypos" 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /tools/gamereport/gamereport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "utility/utility.h" 4 | 5 | #define GAMEREPORT_REPO_NAME "SysRay/psOff_compatibility" 6 | 7 | class IGameReport { 8 | CLASS_NO_COPY(IGameReport); 9 | CLASS_NO_MOVE(IGameReport); 10 | 11 | protected: 12 | bool m_bEnabled = true; 13 | 14 | IGameReport() = default; 15 | 16 | public: 17 | virtual ~IGameReport() = default; 18 | 19 | enum Type { 20 | USER, 21 | EXCEPTION, 22 | MISSING_SYMBOL, 23 | }; 24 | 25 | union AdditionalData { 26 | std::exception* ex; 27 | const char* message; 28 | const void* ptr; 29 | }; 30 | 31 | struct Info { 32 | const char* title; 33 | const char* title_id; 34 | const char* app_ver; 35 | const char* emu_ver; 36 | 37 | Type type; 38 | AdditionalData add; 39 | }; 40 | 41 | void SetStatus(bool enabled) { m_bEnabled = enabled; }; 42 | 43 | virtual void ShowReportWindow(const Info&) = 0; 44 | }; 45 | 46 | #ifdef __APICALL_EXTERN 47 | #define __APICALL __declspec(dllexport) 48 | #else 49 | #define __APICALL __declspec(dllimport) 50 | #endif 51 | 52 | __APICALL IGameReport& accessGameReport(); 53 | #undef __APICALL 54 | -------------------------------------------------------------------------------- /modules/libSceNpScore/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr size_t SCE_NP_SCORE_COMMENT_MAXLEN = 63; 7 | constexpr size_t SCE_NP_SCORE_GAMEINFO_MAXSIZE = 189; 8 | constexpr size_t SCE_NP_SCORE_CENSOR_COMMENT_MAXLEN = 255; 9 | constexpr size_t SCE_NP_SCORE_SANITIZE_COMMENT_MAXLEN = 255; 10 | 11 | enum class NpScoreUpdateType { NORMAL, FORCE }; 12 | 13 | enum class NpScoreOrderType { DESCENDING, ASCENDING }; 14 | 15 | constexpr uint32_t SCE_NP_SCORE_MAX_RANGE_NUM_PER_REQUEST = 100; 16 | constexpr uint32_t SCE_NP_SCORE_MAX_ID_NUM_PER_REQUEST = 101; 17 | constexpr uint32_t SCE_NP_SCORE_MAX_SELECTED_FRIENDS_NUM = 100; 18 | 19 | constexpr uint32_t SCE_NP_SCORE_MAX_RANGE_NUM_PER_TRANS = SCE_NP_SCORE_MAX_RANGE_NUM_PER_REQUEST; 20 | constexpr uint32_t SCE_NP_SCORE_MAX_NPID_NUM_PER_TRANS = SCE_NP_SCORE_MAX_ID_NUM_PER_REQUEST; 21 | constexpr uint32_t SCE_NP_SCORE_MAX_NPID_NUM_PER_REQUEST = SCE_NP_SCORE_MAX_ID_NUM_PER_REQUEST; 22 | 23 | constexpr uint32_t SCE_NP_SCORE_MAX_CTX_NUM = 32; 24 | 25 | enum class NpScoreBindMode { ALL_FORBIDDEN = 0x0000, RDONLY = 0x0001, WRONLY = 0x0002, RDWR = (RDONLY | WRONLY), DEFAULT = RDWR }; -------------------------------------------------------------------------------- /core/videoout/overlay/gamemenu/gamemenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class GameMenu { 8 | struct MenuButton { 9 | std::string title; 10 | std::function func; 11 | }; 12 | 13 | enum class MenuState { 14 | MAIN, 15 | TROPHIES, 16 | }; 17 | 18 | struct Trophy { 19 | int32_t id; 20 | uint8_t grade; 21 | bool hidden; 22 | std::string title; 23 | std::string subtitle; 24 | }; 25 | 26 | MenuState m_state = MenuState::MAIN; 27 | bool m_bShown = false; 28 | std::vector m_buttons = {}; 29 | std::vector m_trophyList = {}; 30 | 31 | ImFont* m_fontTitle = nullptr; 32 | ImFont* m_fontSubTitle = nullptr; 33 | 34 | void _DrawTrophiesFor(int32_t userId); 35 | 36 | public: 37 | GameMenu() = default; 38 | 39 | virtual ~GameMenu() = default; 40 | 41 | void toggle(); 42 | 43 | void _PushTrophy(int32_t trophyId, uint8_t grade, bool hidden, std::string& name, std::string& detail); 44 | 45 | void init(); 46 | void draw(); 47 | void switchTo(MenuState state); 48 | }; 49 | -------------------------------------------------------------------------------- /modules/libSceNpSnsFacebookDialog/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceNpSnsFacebookDialog); 7 | 8 | namespace { 9 | static SceCommonDialogStatus g_curStatus = SceCommonDialogStatus::NONE; 10 | } // namespace 11 | 12 | extern "C" { 13 | 14 | EXPORT const char* MODULE_NAME = "libSceNpSnsFacebookDialog"; 15 | 16 | EXPORT SYSV_ABI int32_t sceNpSnsFacebookDialogInitialize() { 17 | g_curStatus = SceCommonDialogStatus::INITIALIZED; 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceNpSnsFacebookDialogTerminate() { 22 | g_curStatus = SceCommonDialogStatus::NONE; 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI int32_t sceNpSnsFacebookDialogOpen() { 27 | return Ok; 28 | } 29 | 30 | EXPORT SYSV_ABI SceCommonDialogStatus sceNpSnsFacebookDialogGetStatus() { 31 | return g_curStatus; 32 | } 33 | 34 | EXPORT SYSV_ABI SceCommonDialogStatus sceNpSnsFacebookDialogUpdateStatus() { 35 | return g_curStatus; 36 | } 37 | 38 | EXPORT SYSV_ABI int32_t sceNpSnsFacebookDialogGetResult() { 39 | return Ok; 40 | } 41 | 42 | EXPORT SYSV_ABI int32_t sceNpSnsFacebookDialogClose() { 43 | return Ok; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core/fileManager/types/type_null.cpp: -------------------------------------------------------------------------------- 1 | #include "type_null.h" 2 | 3 | #include "modules_include/common.h" 4 | 5 | class TypeNull: public IFile { 6 | public: 7 | TypeNull(): IFile(FileType::Device) {} 8 | 9 | virtual ~TypeNull() {} 10 | 11 | // ### Interface 12 | size_t read(void* buf, size_t nbytes) final; 13 | size_t write(void* buf, size_t nbytes) final; 14 | void sync() final; 15 | int ioctl(int request, SceVariadicList argp) final; 16 | int fcntl(int cmd, SceVariadicList argp) final; 17 | int64_t lseek(int64_t offset, SceWhence whence) final; 18 | 19 | void* getNative() final { return nullptr; } 20 | }; 21 | 22 | std::unique_ptr createType_null() { 23 | return std::make_unique(); 24 | } 25 | 26 | size_t TypeNull::read(void* buf, size_t nbytes) { 27 | return -1; 28 | } 29 | 30 | size_t TypeNull::write(void* buf, size_t nbytes) { 31 | return nbytes; 32 | } 33 | 34 | void TypeNull::sync() {} 35 | 36 | int TypeNull::ioctl(int request, SceVariadicList argp) { 37 | return -1; 38 | } 39 | 40 | int TypeNull::fcntl(int cmd, SceVariadicList argp) { 41 | return -1; 42 | } 43 | 44 | int64_t TypeNull::lseek(int64_t offset, SceWhence whence) { 45 | return -1; 46 | } 47 | -------------------------------------------------------------------------------- /tools/config_emu/config_emu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "nlohmann/json.hpp" 3 | #include "utility/utility.h" 4 | 5 | #include 6 | 7 | using json = nlohmann::ordered_json; 8 | 9 | enum class ConfigModFlag : uint32_t { 10 | NONE = 0, 11 | LOGGING = 1 << 0, 12 | GRAPHICS = 1 << 1, 13 | AUDIO = 1 << 2, 14 | CONTROLS = 1 << 3, 15 | GENERAL = 1 << 4, 16 | RESOLVE = 1 << 5, 17 | }; 18 | 19 | class IConfig { 20 | CLASS_NO_COPY(IConfig); 21 | CLASS_NO_MOVE(IConfig); 22 | 23 | protected: 24 | IConfig() = default; 25 | 26 | public: 27 | virtual ~IConfig() = default; 28 | 29 | virtual std::pair, json*> accessModule(ConfigModFlag) = 0; 30 | 31 | virtual bool save(uint32_t flags) = 0; 32 | }; 33 | 34 | template 35 | bool getJsonParam(json* jData, std::string_view param, T& ret) { 36 | try { 37 | (*jData)[param.data()].get_to(ret); 38 | } catch (...) { 39 | return false; 40 | } 41 | return true; 42 | } 43 | 44 | #ifdef __APICALL_EXTERN 45 | #define __APICALL __declspec(dllexport) 46 | #else 47 | #define __APICALL __declspec(dllimport) 48 | #endif 49 | 50 | __APICALL IConfig* accessConfig(); 51 | #undef __APICALL 52 | -------------------------------------------------------------------------------- /modules/libScePngDec/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | 4 | enum class ScePngDecColorSpace : uint16_t { 5 | GRAYSCALE = 2, 6 | RGB = 3, 7 | CLUT = 4, 8 | GRAYSCALE_ALPHA = 18, 9 | RGBA = 19, 10 | 11 | INVALID = 0xFFFF, 12 | }; 13 | 14 | enum class ScePngDecPixelFormat : uint16_t { 15 | R8G8B8A8 = 0, 16 | B8G8R8A8 = 1, 17 | }; 18 | 19 | typedef void* ScePngDecHandle; 20 | 21 | struct ScePngDecParseParam { 22 | const void* pngAddr; 23 | uint32_t pngSize; 24 | uint32_t reserved; 25 | }; 26 | 27 | struct ScePngDecImageInfo { 28 | uint32_t imageWidth; 29 | uint32_t imageHeight; 30 | ScePngDecColorSpace colorSpace; 31 | uint16_t bitDepth; 32 | uint32_t imageFlag; 33 | }; 34 | 35 | struct ScePngDecCreateParam { 36 | uint32_t cbSize; 37 | uint32_t attribute; 38 | uint32_t maxImageWidth; 39 | }; 40 | 41 | struct ScePngDecDecodeParam { 42 | const void* pngAddr; 43 | void* imageAddr; 44 | uint32_t pngSize; 45 | uint32_t imageSize; 46 | ScePngDecPixelFormat pixelFormat; 47 | uint16_t alphaValue; 48 | uint32_t imagePitch; 49 | }; 50 | -------------------------------------------------------------------------------- /modules/libSceVoiceQoS/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | constexpr int32_t SCE_VOICE_ERROR_LIBVOICEQOS_NOT_INIT = -2142369535; 6 | constexpr int32_t SCE_VOICE_ERROR_LIBVOICEQOS_ARGUMENT_INVALID = -2142369534; 7 | constexpr int32_t SCE_VOICE_ERROR_LIBVOICEQOS_PACKET_INVALID = -2142369533; 8 | constexpr int32_t SCE_VOICE_ERROR_LIBVOICEQOS_INTERNAL_UNRECOVERABLE = -2142369532; 9 | constexpr int32_t SCE_VOICE_ERROR_LIBVOICEQOS_INITIALIZED = -2142369531; 10 | constexpr int32_t SCE_VOICE_ERROR_LIBVOICEQOS_SYSTEM = -2142369530; 11 | constexpr int32_t SCE_VOICE_ERROR_LIBVOICEQOS_RESOURCE_USED = -2142369529; 12 | } // namespace Err 13 | 14 | constexpr int32_t SCE_VOICE_QOS_MAX_LOCAL_ENDPOINTS = 1; 15 | constexpr int32_t SCE_VOICE_QOS_MAX_REMOTE_ENDPOINTS = 7; 16 | constexpr int32_t SCE_VOICE_QOS_MAX_CONNECTIONS = 7; 17 | constexpr int32_t SCE_VOICE_QOS_MAX_15_REMOTE_ENDPOINTS = 15; 18 | constexpr int32_t SCE_VOICE_QOS_MAX_15_CONNECTIONS = 15; 19 | 20 | constexpr int32_t SCE_VOICE_QOS_INVALID_LOCAL_ID = (-1); 21 | constexpr int32_t SCE_VOICE_QOS_INVALID_REMOTE_ID = (-1); 22 | constexpr int32_t SCE_VOICE_QOS_INVALID_CONNECTION_ID = (-1); -------------------------------------------------------------------------------- /modules/libSceAudioOut/mastering.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct SceAudioOutMasteringStatesHeader { 6 | uint32_t statesId; 7 | }; 8 | 9 | struct SceAudioOutMasteringStatesDescriptor { 10 | uint32_t id; 11 | uint32_t size; 12 | }; 13 | 14 | struct SceAudioOutMasteringCompressorStates { 15 | SceAudioOutMasteringStatesDescriptor desc; 16 | uint32_t reserved[2]; 17 | float inputRms[3][8]; 18 | float compressionCoeff[3][8]; 19 | }; 20 | 21 | struct SceAudioOutMasteringLimiterStates { 22 | SceAudioOutMasteringStatesDescriptor desc; 23 | uint32_t reserved[2]; 24 | float inputPeak[8]; 25 | float outputPeak[8]; 26 | float gainPeak[8]; 27 | }; 28 | 29 | struct SceAudioOutMasteringStates { 30 | SceAudioOutMasteringStatesHeader statesHeader; 31 | uint32_t reserved[3]; 32 | SceAudioOutMasteringCompressorStates compressorStates; 33 | SceAudioOutMasteringLimiterStates limiterStates; 34 | }; 35 | 36 | struct SceAudioOutMasteringParamsHeader { 37 | uint32_t paramsId; 38 | }; 39 | -------------------------------------------------------------------------------- /core/kernel/semaphore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utility/utility.h" 3 | 4 | #include 5 | 6 | class ISemaphore { 7 | CLASS_NO_COPY(ISemaphore); 8 | CLASS_NO_MOVE(ISemaphore); 9 | 10 | protected: 11 | ISemaphore() = default; 12 | 13 | public: 14 | virtual ~ISemaphore() = default; 15 | 16 | virtual int cancel(int setCount, int* numCanceled) = 0; 17 | virtual int signal(int signalCount) = 0; 18 | virtual int wait(int needcount, uint32_t* pMicros) = 0; 19 | virtual int try_wait(int needcount, uint32_t* pMicros) = 0; 20 | virtual int poll(int needCount) = 0; 21 | 22 | virtual std::string_view const getName() const = 0; 23 | 24 | virtual size_t getId() const = 0; 25 | 26 | virtual size_t getSignalCounter() const = 0; 27 | }; 28 | 29 | #if defined(__APICALL_EXTERN) 30 | #define __APICALL __declspec(dllexport) 31 | #elif defined(__APICALL_IMPORT) 32 | #define __APICALL __declspec(dllimport) 33 | #else 34 | #define __APICALL 35 | #endif 36 | 37 | __APICALL std::unique_ptr createSemaphore_fifo(const char* name, int initCount, int maxCount); 38 | __APICALL std::unique_ptr createSemaphore_prio(const char* name, int initCount, int maxCount); 39 | 40 | #undef __APICALL -------------------------------------------------------------------------------- /core/fileManager/types/type_zero.cpp: -------------------------------------------------------------------------------- 1 | #include "type_zero.h" 2 | 3 | class TypeZero: public IFile { 4 | public: 5 | TypeZero(): IFile(FileType::Device) {} 6 | 7 | virtual ~TypeZero() {} 8 | 9 | // ### Interface 10 | size_t read(void* buf, size_t nbytes) final; 11 | size_t write(void* buf, size_t nbytes) final; 12 | void sync() final; 13 | int ioctl(int request, SceVariadicList argp) final; 14 | int fcntl(int cmd, SceVariadicList argp) final; 15 | int64_t lseek(int64_t offset, SceWhence whence) final; 16 | 17 | void* getNative() final { return nullptr; } 18 | }; 19 | 20 | std::unique_ptr createType_zero() { 21 | return std::make_unique(); 22 | } 23 | 24 | size_t TypeZero::read(void* buf, size_t nbytes) { 25 | for (size_t i = 0; i < nbytes; i++) { 26 | ((char*)buf)[i] = '\0'; 27 | } 28 | 29 | return nbytes; 30 | } 31 | 32 | size_t TypeZero::write(void* buf, size_t nbytes) { 33 | return nbytes; 34 | } 35 | 36 | void TypeZero::sync() {} 37 | 38 | int TypeZero::ioctl(int request, SceVariadicList argp) { 39 | return 0; 40 | } 41 | 42 | int TypeZero::fcntl(int cmd, SceVariadicList argp) { 43 | return 0; 44 | } 45 | 46 | int64_t TypeZero::lseek(int64_t offset, SceWhence whence) { 47 | return -1; 48 | } 49 | -------------------------------------------------------------------------------- /modules/libSceHmd/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | #include "sceTypes.h" 4 | 5 | enum class SceHmdReprojectionReprojectionType {}; 6 | 7 | struct SceHmdInitializeParam { 8 | void* reserved0; 9 | uint8_t reserved[8]; 10 | }; 11 | 12 | struct SceHmdReprojectionResourceInfo { 13 | void* pOnionBuff; 14 | void* pGarlicBuff; 15 | int threadPriority; 16 | uint64_t cpuAffinityMask; 17 | uint32_t pipeId; 18 | uint32_t queueId; 19 | uint32_t reserved[3]; 20 | }; 21 | 22 | struct SceHmdDeviceInformation { 23 | uint32_t status; 24 | uint8_t reserve0[4], userId; 25 | 26 | struct DeviceInfo { 27 | struct PanelResolution { 28 | uint32_t width; 29 | uint32_t height; 30 | } panelResolution; 31 | 32 | struct FlipToDisplayLatency { 33 | uint16_t refreshRate90Hz; 34 | uint16_t refreshRate120Hz; 35 | } flipToDisplayLatency; 36 | 37 | } deviceInfo; 38 | 39 | uint8_t hmuMount; 40 | uint8_t reserve1[7]; 41 | }; 42 | 43 | struct SceHmdOpenParam { 44 | uint8_t reserve[8]; 45 | }; 46 | 47 | struct SceHmdFieldOfView { 48 | float tanOut; 49 | float tanIn; 50 | float tanTop; 51 | float tanBottom; 52 | }; 53 | 54 | struct SceHmdEyeOffset { 55 | SceFVector3 offset; 56 | uint8_t reserve[20]; 57 | }; -------------------------------------------------------------------------------- /modules/libSceSigninDialog/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceSigninDialog); 7 | 8 | namespace { 9 | static SceCommonDialogStatus g_curStatus = SceCommonDialogStatus::NONE; 10 | } // namespace 11 | 12 | extern "C" { 13 | 14 | EXPORT const char* MODULE_NAME = "libSceSigninDialog"; 15 | 16 | EXPORT SYSV_ABI int32_t sceSigninDialogInitialize() { 17 | g_curStatus = SceCommonDialogStatus::INITIALIZED; 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceSigninDialogTerminate(void) { 22 | g_curStatus = SceCommonDialogStatus::NONE; 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI SceCommonDialogStatus sceSigninDialogUpdateStatus(void) { 27 | return g_curStatus; 28 | } 29 | 30 | EXPORT SYSV_ABI SceCommonDialogStatus sceSigninDialogGetStatus(void) { 31 | return g_curStatus; 32 | } 33 | 34 | EXPORT SYSV_ABI int32_t sceSigninDialogGetResult(void) { 35 | return Ok; 36 | } 37 | 38 | EXPORT SYSV_ABI int32_t sceSigninDialogOpen(const void* param) { 39 | g_curStatus = SceCommonDialogStatus::FINISHED; 40 | return Ok; 41 | } 42 | 43 | EXPORT SYSV_ABI int32_t sceSigninDialogClose(void) { 44 | g_curStatus = SceCommonDialogStatus::FINISHED; 45 | return Ok; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.github/workflows/upwiki.yml: -------------------------------------------------------------------------------- 1 | name: upload wiki 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | paths: 7 | - '.github/workflows/upwiki.yml' 8 | - 'docs/wiki/**' 9 | 10 | jobs: 11 | update-wiki: 12 | name: Update wiki 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Pull main repo 16 | uses: actions/checkout@v4 17 | with: 18 | path: main_repo 19 | 20 | - name: Setup git 21 | run: | 22 | git config --global user.name github-actions[bot]; 23 | git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com; 24 | 25 | - name: Pull wiki content 26 | run: | 27 | mkdir wiki_repo; 28 | cd wiki_repo; 29 | git init; 30 | git pull https://${{ secrets.REPO_FULL_TOKEN }}@github.com/${{ github.repository }}.wiki.git 31 | 32 | - name: Push wiki content 33 | run: | 34 | rsync -av --delete main_repo/docs/wiki/markdown/ wiki_repo/ --exclude .git; 35 | cd wiki_repo; 36 | git add .; 37 | if git commit -m "Update wiki content"; then 38 | git push -f --set-upstream https://${{ secrets.REPO_FULL_TOKEN }}@github.com/${{ github.repository }}.wiki.git master; 39 | fi 40 | -------------------------------------------------------------------------------- /modules/libSceUsbd/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceUsbd); 7 | 8 | extern "C" { 9 | 10 | EXPORT const char* MODULE_NAME = "libSceUsbd"; 11 | 12 | EXPORT SYSV_ABI int sceUsbdInit() { 13 | LOG_USE_MODULE(libSceUsbd); 14 | LOG_ERR(L"todo %S", __FUNCTION__); 15 | return Ok; 16 | } 17 | 18 | EXPORT SYSV_ABI uint64_t sceUsbdGetDeviceList(SceUsbdDevice*** list) { 19 | LOG_USE_MODULE(libSceUsbd); 20 | LOG_ERR(L"todo %S", __FUNCTION__); 21 | return Ok; 22 | } 23 | 24 | EXPORT SYSV_ABI void sceUsbdFreeDeviceList(SceUsbdDevice** list, int unrefDevices) { 25 | LOG_USE_MODULE(libSceUsbd); 26 | LOG_ERR(L"todo %S", __FUNCTION__); 27 | } 28 | 29 | EXPORT SYSV_ABI int32_t sceUsbdHandleEvents() { 30 | LOG_USE_MODULE(libSceUsbd); 31 | LOG_TRACE(L"todo %S", __FUNCTION__); 32 | return Ok; 33 | } 34 | 35 | EXPORT SYSV_ABI int32_t sceUsbdHandleEventsTimeout(struct timeval* tv) { 36 | LOG_USE_MODULE(libSceUsbd); 37 | LOG_TRACE(L"todo %S", __FUNCTION__); 38 | return Ok; 39 | } 40 | 41 | EXPORT SYSV_ABI int32_t sceUsbdOpenDeviceWithVidPid(uint16_t vendorId, uint16_t productId) { 42 | LOG_USE_MODULE(libSceUsbd); 43 | LOG_ERR(L"todo %S", __FUNCTION__); 44 | return Ok; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modules/libSceNetCtl/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../libSceNet/types.h" 3 | #include "codes.h" 4 | #include "utility/utility.h" 5 | 6 | union SceNetCtlInfo { 7 | uint32_t device; 8 | SceNetEtherAddr ether_addr; 9 | uint32_t mtu; 10 | uint32_t link; 11 | SceNetEtherAddr bssid; 12 | char ssid[32 + 1]; 13 | uint32_t wifi_security; 14 | uint8_t rssi_dbm; 15 | uint8_t rssi_percentage; 16 | uint8_t channel; 17 | uint32_t ip_config; 18 | char dhcp_hostname[255 + 1]; 19 | char pppoe_auth_name[127 + 1]; 20 | char ip_address[16]; 21 | char netmask[16]; 22 | char default_route[16]; 23 | char primary_dns[16]; 24 | char secondary_dns[16]; 25 | uint32_t http_proxy_config; 26 | char http_proxy_server[255 + 1]; 27 | uint16_t http_proxy_port; 28 | }; 29 | 30 | struct SceNetCtlNatInfo { 31 | unsigned int size; 32 | int stunStatus; 33 | int natType; 34 | uint32_t mappedAddr; 35 | }; 36 | 37 | using SceNetCtlCallback = SYSV_ABI void (*)(int eventType, void* arg); 38 | 39 | struct SceNetCtlIfStat { 40 | uint32_t device; 41 | uint64_t txBytes; 42 | uint64_t rxBytes; 43 | }; -------------------------------------------------------------------------------- /core/kernel/pthread_types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utility/utility.h" 3 | 4 | // clang-format off 5 | 6 | using pthread_entry_func_t = SYSV_ABI void* (*)(void*); 7 | using pthread_key_destructor_func_t = SYSV_ABI void (*)(void*); 8 | using thread_dtors_func_t = SYSV_ABI void (*)(); 9 | using thread_clean_func_t = SYSV_ABI void (*)(void*); 10 | using pthread_once_init = SYSV_ABI void (*)(); 11 | 12 | // clang-format on 13 | 14 | struct SceSchedParam { 15 | int sched_priority; 16 | }; 17 | 18 | enum class SceMutexProtocol { PRIO_NONE, PRIO_INHERIT, PRIO_PROTECT }; 19 | enum class SceMutexType { DEFAULT, ERRORCHECK, RECURSIVE, NORMAL, ADAPTIVE_NP }; 20 | enum class SceMutexShared { PRIVATE, SHARED }; 21 | 22 | enum class SceDetachState { 23 | JOINABLE, 24 | DETACHED, 25 | }; 26 | 27 | enum class SceShedPolicy { 28 | OTHER, 29 | FIFO, 30 | RR, 31 | }; 32 | enum class SceInheritShed { 33 | EXPLICIT, 34 | INHERIT = 4, 35 | }; 36 | 37 | enum class SceCancelState { 38 | ENABLE, 39 | DISABLE, 40 | }; 41 | enum class SceCancelType { 42 | DEFERRED, 43 | ASYNC = 4, 44 | }; 45 | 46 | struct SceCleanInfo { 47 | SceCleanInfo* prev; 48 | thread_clean_func_t func; 49 | void* arg; 50 | int onHeap; 51 | }; 52 | -------------------------------------------------------------------------------- /modules/libSceNpCommerce/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceNpCommerce); 7 | 8 | namespace { 9 | static SceCommonDialogStatus g_curStatus = SceCommonDialogStatus::NONE; 10 | } // namespace 11 | 12 | extern "C" { 13 | 14 | EXPORT const char* MODULE_NAME = "libSceNpCommerce"; 15 | 16 | EXPORT SYSV_ABI int32_t sceNpCommerceDialogInitialize() { 17 | g_curStatus = SceCommonDialogStatus::INITIALIZED; 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceNpCommerceDialogTerminate(void) { 22 | g_curStatus = SceCommonDialogStatus::NONE; 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI SceCommonDialogStatus sceNpCommerceDialogUpdateStatus(void) { 27 | return g_curStatus; 28 | } 29 | 30 | EXPORT SYSV_ABI SceCommonDialogStatus sceNpCommerceDialogGetStatus(void) { 31 | return g_curStatus; 32 | } 33 | 34 | EXPORT SYSV_ABI int32_t sceNpCommerceDialogGetResult(void) { 35 | return Ok; 36 | } 37 | 38 | EXPORT SYSV_ABI int32_t sceNpCommerceDialogOpen(const void* param) { 39 | g_curStatus = SceCommonDialogStatus::FINISHED; 40 | return Ok; 41 | } 42 | 43 | EXPORT SYSV_ABI int32_t sceNpCommerceDialogClose(void) { 44 | g_curStatus = SceCommonDialogStatus::FINISHED; 45 | return Ok; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /modules/libSceSharePlay/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "codes.h" 3 | #include "modules/libSceNpManager/types.h" 4 | 5 | enum class SceSharePlayProhibitionMode : uint32_t { OFF = 0, CONTROL_ONLY = 1, CONTROL_SCREEN = 2 }; 6 | 7 | enum class SceSharePlayConnectionStatus : uint32_t { 8 | DORMANT = 0, 9 | READY = 1, 10 | CONNECTED = 2, 11 | }; 12 | 13 | enum class SceSharePlayControllerMode : uint32_t { 14 | WATCHING_HOST_PLAY = 0, 15 | PLAYING_AS_HOST = 1, 16 | PLAYING_GAME_WITH_HOST = 2, 17 | }; 18 | 19 | struct SceSharePlayConnectionInfo { 20 | SceSharePlayConnectionStatus status; 21 | SceSharePlayControllerMode mode; 22 | SceNpOnlineId hostOnelineId; 23 | SceNpOnlineId visitorOnlineId; 24 | SceUserServiceUserId hostUserId; 25 | SceUserServiceUserId visitorUserId; 26 | }; 27 | 28 | struct SceSharePlayConnectionInfoA { 29 | SceSharePlayConnectionStatus status; 30 | SceSharePlayControllerMode mode; 31 | SceNpOnlineId hostOnelineId; 32 | SceNpOnlineId visitorOnlineId; 33 | SceNpAccountId hostAccountId; 34 | SceNpAccountId visitorAccountId; 35 | SceUserServiceUserId hostUserId; 36 | SceUserServiceUserId visitorUserId; 37 | }; 38 | -------------------------------------------------------------------------------- /core/fileManager/types/type_in.cpp: -------------------------------------------------------------------------------- 1 | #include "type_in.h" 2 | 3 | #include "modules_include/common.h" 4 | 5 | class TypeIn: public IFile { 6 | public: 7 | TypeIn(): IFile(FileType::Device) {} 8 | 9 | virtual ~TypeIn() {} 10 | 11 | // ### Interface 12 | size_t read(void* buf, size_t nbytes) final; 13 | size_t write(void* buf, size_t nbytes) final; 14 | void sync() final; 15 | int ioctl(int request, SceVariadicList argp) final; 16 | int fcntl(int cmd, SceVariadicList argp) final; 17 | int64_t lseek(int64_t offset, SceWhence whence) final; 18 | 19 | void* getNative() final { return nullptr; } 20 | }; 21 | 22 | std::unique_ptr createType_in() { 23 | return std::make_unique(); 24 | } 25 | 26 | size_t TypeIn::read(void* buf, size_t nbytes) { 27 | if (nbytes == 0) return 0; 28 | printf("Emulator awaits your input: "); 29 | return std::fread(buf, 1, nbytes, stdin); 30 | } 31 | 32 | size_t TypeIn::write(void* buf, size_t nbytes) { 33 | return nbytes; 34 | } 35 | 36 | void TypeIn::sync() {} 37 | 38 | int TypeIn::ioctl(int request, SceVariadicList argp) { 39 | return 0; 40 | } 41 | 42 | int TypeIn::fcntl(int cmd, SceVariadicList argp) { 43 | return 0; 44 | } 45 | 46 | int64_t TypeIn::lseek(int64_t offset, SceWhence whence) { 47 | return -1; 48 | } 49 | -------------------------------------------------------------------------------- /docs/uml/modules/videoout_class.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | skinparam classAttributeIconSize 0 3 | 4 | interface IVideoOut { 5 | } 6 | class VideoOut << (S,#FF7700) Singleton >> {} 7 | 8 | IVideoOut <|-- VideoOut 9 | 10 | user ()- IVideoOut : accessVideoOut() 11 | 12 | package emulator{ 13 | class Graphics{} 14 | interface IGraphics {} 15 | 16 | interface IManager{ 17 | accessShaderManager() 18 | accessPipelineManager() 19 | accessSamplerManager() 20 | accessDescriptorManager() 21 | accessGpuMemory() 22 | } 23 | 24 | class Manager{} 25 | 26 | class IManagerChild{ 27 | VkDevice 28 | VkPhysicalDevice 29 | VkInstance 30 | manager 31 | --- 32 | void setDevice() 33 | void setParent() 34 | } 35 | 36 | class ShaderManager{} 37 | class PipelineManager{} 38 | class SamplerManager{} 39 | class DescriptorManager{} 40 | class GpuMemory{} 41 | } 42 | 43 | VideoOut *- IGraphics : createGraphics() 44 | IGraphics <|-- Graphics 45 | 46 | IManager <|-- Manager 47 | Graphics *- "1" Manager 48 | 49 | Manager "1" *- "n" IManagerChild 50 | 51 | IManager --o IManagerChild 52 | 53 | IManagerChild <|-- ShaderManager 54 | IManagerChild <|-- PipelineManager 55 | IManagerChild <|-- SamplerManager 56 | IManagerChild <|-- DescriptorManager 57 | IManagerChild <|-- GpuMemory 58 | 59 | @enduml -------------------------------------------------------------------------------- /modules/libSceNetCtl/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err { 5 | namespace NetCtl { 6 | constexpr int32_t NOT_INITIALIZED = -2143215359; 7 | constexpr int32_t CALLBACK_MAX = -2143215357; 8 | constexpr int32_t ID_NOT_FOUND = -2143215356; 9 | constexpr int32_t INVALID_ID = -2143215355; 10 | constexpr int32_t INVALID_CODE = -2143215354; 11 | constexpr int32_t INVALID_ADDR = -2143215353; 12 | constexpr int32_t NOT_CONNECTED = -2143215352; 13 | constexpr int32_t NOT_AVAIL = -2143215351; 14 | constexpr int32_t NETWORK_DISABLED = -2143215347; 15 | constexpr int32_t DISCONNECT_REQ = -2143215346; 16 | constexpr int32_t INVALID_TYPE = -2143215345; 17 | constexpr int32_t INVALID_SIZE = -2143215343; 18 | constexpr int32_t ETHERNET_PLUGOUT = -2143215339; 19 | constexpr int32_t WIFI_DEAUTHED = -2143215338; 20 | constexpr int32_t WIFI_BEACON_LOST = -2143215337; 21 | } // namespace NetCtl 22 | } // namespace Err 23 | 24 | constexpr size_t SCE_NET_CTL_SSID_LEN = 33; 25 | constexpr size_t SCE_NET_CTL_WIFI_SECURITY_KEY_LEN = 65; 26 | constexpr size_t SCE_NET_CTL_AUTH_NAME_LEN = 128; 27 | constexpr size_t SCE_NET_CTL_AUTH_KEY_LEN = 128; 28 | constexpr size_t SCE_NET_CTL_HOSTNAME_LEN = 256; 29 | constexpr size_t SCE_NET_CTL_IPV4_ADDR_STR_LEN = 16; 30 | -------------------------------------------------------------------------------- /modules/libSceNpProfileDialog/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "codes.h" 2 | #include "common.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceNpProfileDialog); 7 | 8 | namespace { 9 | static SceCommonDialogStatus g_curStatus = SceCommonDialogStatus::NONE; 10 | } // namespace 11 | 12 | extern "C" { 13 | 14 | EXPORT const char* MODULE_NAME = "libSceNpProfileDialog"; 15 | 16 | EXPORT SYSV_ABI int32_t sceNpProfileDialogInitialize() { 17 | g_curStatus = SceCommonDialogStatus::INITIALIZED; 18 | return Ok; 19 | } 20 | 21 | EXPORT SYSV_ABI int32_t sceNpProfileDialogTerminate(void) { 22 | g_curStatus = SceCommonDialogStatus::NONE; 23 | return Ok; 24 | } 25 | 26 | EXPORT SYSV_ABI SceCommonDialogStatus sceNpProfileDialogUpdateStatus(void) { 27 | return g_curStatus; 28 | } 29 | 30 | EXPORT SYSV_ABI SceCommonDialogStatus sceNpProfileDialogGetStatus(void) { 31 | return g_curStatus; 32 | } 33 | 34 | EXPORT SYSV_ABI int32_t sceNpProfileDialogOpen(const void* param) { 35 | g_curStatus = SceCommonDialogStatus::FINISHED; 36 | return Ok; 37 | } 38 | 39 | EXPORT SYSV_ABI int32_t sceNpProfileDialogOpenA(const void* param) { 40 | g_curStatus = SceCommonDialogStatus::FINISHED; 41 | return Ok; 42 | } 43 | 44 | EXPORT SYSV_ABI int32_t sceNpProfileDialogClose() { 45 | g_curStatus = SceCommonDialogStatus::FINISHED; 46 | return Ok; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /core/fileManager/types/type_random.cpp: -------------------------------------------------------------------------------- 1 | #include "type_random.h" 2 | 3 | class TypeRandom: public IFile { 4 | public: 5 | TypeRandom(): IFile(FileType::Device) {} 6 | 7 | virtual ~TypeRandom() {} 8 | 9 | // ### Interface 10 | size_t read(void* buf, size_t nbytes) final; 11 | size_t write(void* buf, size_t nbytes) final; 12 | void sync() final; 13 | int ioctl(int request, SceVariadicList argp) final; 14 | int fcntl(int cmd, SceVariadicList argp) final; 15 | int64_t lseek(int64_t offset, SceWhence whence) final; 16 | 17 | void* getNative() final { return nullptr; } 18 | }; 19 | 20 | std::unique_ptr createType_random() { 21 | std::srand(std::time(nullptr)); 22 | return std::make_unique(); 23 | } 24 | 25 | size_t TypeRandom::read(void* buf, size_t nbytes) { 26 | auto cbuf = static_cast(buf); 27 | 28 | for (size_t i = 0; i < nbytes; i++) 29 | cbuf[i] = std::rand() & 0xFF; 30 | 31 | return nbytes; 32 | } 33 | 34 | size_t TypeRandom::write(void* buf, size_t nbytes) { 35 | return 0; 36 | } 37 | 38 | void TypeRandom::sync() {} 39 | 40 | int TypeRandom::ioctl(int request, SceVariadicList argp) { 41 | return 0; 42 | } 43 | 44 | int TypeRandom::fcntl(int cmd, SceVariadicList argp) { 45 | return 0; 46 | } 47 | 48 | int64_t TypeRandom::lseek(int64_t offset, SceWhence whence) { 49 | return -1; 50 | } 51 | -------------------------------------------------------------------------------- /core/kernel/eventqueue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "eventqueue_types.h" 3 | #include "modules_include/common.h" 4 | #include "utility/utility.h" 5 | 6 | namespace Kernel::EventQueue { 7 | class IKernelEqueue { 8 | CLASS_NO_COPY(IKernelEqueue); 9 | CLASS_NO_MOVE(IKernelEqueue); 10 | 11 | protected: 12 | IKernelEqueue() = default; 13 | 14 | public: 15 | virtual ~IKernelEqueue() = default; 16 | 17 | virtual int wait(KernelEvent_t ev, int num, int* out, const SceKernelUseconds* timo) = 0; 18 | 19 | virtual int addUserEvent(int ident) = 0; 20 | virtual int addUserEventEdge(int ident) = 0; 21 | virtual int triggerUserEvent(uintptr_t ident, void* udata) = 0; 22 | 23 | virtual int addEvent(const KernelEqueueEvent& event) = 0; 24 | virtual int triggerEvent(uintptr_t ident, int16_t filter, void* trigger_data) = 0; 25 | virtual int deleteEvent(uintptr_t ident, int16_t filter) = 0; 26 | }; 27 | 28 | #if defined(__APICALL_EXTERN) 29 | #define __APICALL __declspec(dllexport) 30 | #elif defined(__APICALL_IMPORT) 31 | #define __APICALL __declspec(dllimport) 32 | #else 33 | #define __APICALL 34 | #endif 35 | 36 | __APICALL int createEqueue(IKernelEqueue_t* eq, const char* name); 37 | __APICALL int deleteEqueue(IKernelEqueue_t eq); 38 | 39 | #undef __APICALL 40 | 41 | } // namespace Kernel::EventQueue -------------------------------------------------------------------------------- /core/kernel/eventflag.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "utility/utility.h" 4 | 5 | namespace Kernel::EventFlag { 6 | 7 | enum class ClearMode { None, All, Bits }; 8 | 9 | enum class WaitMode { And, Or }; 10 | 11 | class IKernelEventFlag { 12 | CLASS_NO_COPY(IKernelEventFlag); 13 | CLASS_NO_MOVE(IKernelEventFlag); 14 | 15 | protected: 16 | IKernelEventFlag() = default; 17 | 18 | public: 19 | virtual ~IKernelEventFlag() = default; 20 | 21 | virtual void set(uint64_t bits) = 0; 22 | virtual void clear(uint64_t bits) = 0; 23 | virtual void cancel(uint64_t bits, int* num_waiting_threads) = 0; 24 | 25 | virtual int wait(uint64_t bits, WaitMode wait_mode, ClearMode clear_mode, uint64_t* result, uint32_t* ptr_micros) = 0; 26 | 27 | virtual int poll(uint64_t bits, WaitMode wait_mode, ClearMode clear_mode, uint64_t* result) = 0; 28 | }; 29 | 30 | using IKernelEventFlag_t = IKernelEventFlag*; 31 | 32 | #if defined(__APICALL_EXTERN) 33 | #define __APICALL __declspec(dllexport) 34 | #elif defined(__APICALL_IMPORT) 35 | #define __APICALL __declspec(dllimport) 36 | #else 37 | #define __APICALL 38 | #endif 39 | 40 | __APICALL IKernelEventFlag_t createEventFlag(std::string const& name, bool single, bool fifo, uint64_t bits); 41 | __APICALL int deleteEventFlag(IKernelEventFlag_t ef); 42 | 43 | #undef __APICALL 44 | } // namespace Kernel::EventFlag -------------------------------------------------------------------------------- /tools/logging/logging_dummy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace __Log { 5 | 6 | inline void* __registerModule(std::wstring&& name) { 7 | return nullptr; 8 | } 9 | 10 | enum class eTrace_Level : uint8_t { 11 | trace = 0, 12 | debug, 13 | info, 14 | warn, 15 | err, 16 | crit, 17 | }; 18 | 19 | void __log(bool doExit, const wchar_t* i_pFormat, ...); 20 | 21 | /** 22 | * @brief Call at end to flush messages 23 | * 24 | */ 25 | constexpr void deinit() {} 26 | 27 | /** 28 | * @brief Register thread (for better logging) 29 | * 30 | * @param name 31 | */ 32 | 33 | constexpr uint8_t isIgnored(void* module, eTrace_Level level) { 34 | return true; 35 | } 36 | 37 | constexpr void flush() {} 38 | } // namespace __Log 39 | 40 | /** 41 | * @brief Call at start of file or in class 42 | * 43 | */ 44 | #define LOG_DEFINE_MODULE(name) void* __TRACE_MODULE__DEFINED__##name = nullptr; 45 | 46 | /** 47 | * @brief Call before logging 48 | * 49 | */ 50 | #define LOG_USE_MODULE(name) [[maybe_unused]] void* __TRACE_MODULE = __TRACE_MODULE__DEFINED__##name 51 | #define LOG_GET_MODULE(name) __TRACE_MODULE__DEFINED__##name 52 | 53 | // Logging 54 | #define LOG_TRACE(...) /**/ 55 | #define LOG_DEBUG(...) /**/ 56 | #define LOG_INFO(...) /**/ 57 | #define LOG_WARN(...) /**/ 58 | #define LOG_ERR(...) __Log::__log(false, __VA_ARGS__) 59 | #define LOG_CRIT(...) __Log::__log(true, __VA_ARGS__) 60 | // - 61 | -------------------------------------------------------------------------------- /modules/libSceNetCtl/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "core/networking/networking.h" 3 | #include "logging.h" 4 | #include "types.h" 5 | 6 | LOG_DEFINE_MODULE(libSceNetCtl); 7 | 8 | namespace {} // namespace 9 | 10 | extern "C" { 11 | 12 | EXPORT const char* MODULE_NAME = "libSceNetCtl"; 13 | 14 | EXPORT SYSV_ABI int sceNetCtlInit(void) { 15 | return Ok; 16 | } 17 | 18 | EXPORT SYSV_ABI void sceNetCtlTerm(void) {} 19 | 20 | EXPORT SYSV_ABI int sceNetCtlCheckCallback(void) { 21 | return Ok; 22 | } 23 | 24 | EXPORT SYSV_ABI int sceNetCtlRegisterCallback(SceNetCtlCallback func, void* arg, int* cid) { 25 | *cid = 1; 26 | return Ok; 27 | } 28 | 29 | EXPORT SYSV_ABI int sceNetCtlUnregisterCallback(int cid) { 30 | return Ok; 31 | } 32 | 33 | EXPORT SYSV_ABI int sceNetCtlGetResult(int eventType, int* errorCode) { 34 | return Ok; 35 | } 36 | 37 | EXPORT SYSV_ABI int sceNetCtlGetState(int* state) { 38 | return accessNetworking().netCtlGetState(state); 39 | } 40 | 41 | EXPORT SYSV_ABI int sceNetCtlGetInfo(int code, SceNetCtlInfo* info) { 42 | return accessNetworking().netCtlGetInfo(code, info); 43 | } 44 | 45 | EXPORT SYSV_ABI int sceNetCtlGetIfStat(SceNetCtlIfStat* ifStat) { 46 | return Ok; 47 | } 48 | 49 | EXPORT SYSV_ABI int sceNetCtlGetNatInfo(SceNetCtlNatInfo* natInfo) { 50 | natInfo->stunStatus = 1; 51 | natInfo->natType = 3; 52 | natInfo->mappedAddr = 0x7f000001; 53 | return Ok; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /modules/libSceSharePlay/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceSharePlay); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceSharePlay"; 12 | 13 | EXPORT SYSV_ABI int32_t sceSharePlayInitialize(void* pHeap, size_t heapSize) { 14 | LOG_USE_MODULE(libSceSharePlay); 15 | 16 | LOG_INFO(L"pHeap:0x%08llx heapSize:0x%08x", (uint64_t)pHeap, heapSize); 17 | 18 | LOG_ERR(L"TODO: %S", __FUNCTION__); 19 | 20 | return Ok; 21 | } 22 | 23 | EXPORT SYSV_ABI int32_t sceSharePlayTerminate() { 24 | LOG_USE_MODULE(libSceSharePlay); 25 | 26 | LOG_ERR(L"TODO: %S", __FUNCTION__); 27 | 28 | return Ok; 29 | } 30 | 31 | EXPORT SYSV_ABI int32_t sceSharePlaySetProhibition(SceSharePlayProhibitionMode mode) { 32 | LOG_USE_MODULE(libSceSharePlay); 33 | 34 | LOG_ERR(L"TODO: %S", __FUNCTION__); 35 | 36 | return Ok; 37 | } 38 | 39 | EXPORT SYSV_ABI int32_t sceSharePlayGetCurrentConnectionInfo(SceSharePlayConnectionInfo* pInfo) { 40 | LOG_USE_MODULE(libSceSharePlay); 41 | 42 | *pInfo = {}; 43 | 44 | LOG_ERR(L"TODO: %S", __FUNCTION__); 45 | 46 | return Ok; 47 | } 48 | 49 | EXPORT SYSV_ABI int32_t sceSharePlayGetCurrentConnectionInfoA(SceSharePlayConnectionInfoA* pInfo) { 50 | LOG_USE_MODULE(libSceSharePlay); 51 | 52 | *pInfo = {}; 53 | 54 | LOG_ERR(L"TODO: %S", __FUNCTION__); 55 | 56 | return Ok; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /modules/libSceRemoteplay/entry.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "logging.h" 3 | #include "types.h" 4 | 5 | LOG_DEFINE_MODULE(libSceRemoteplay); 6 | 7 | namespace {} // namespace 8 | 9 | extern "C" { 10 | 11 | EXPORT const char* MODULE_NAME = "libSceRemoteplay"; 12 | 13 | EXPORT SYSV_ABI int sceRemoteplayInitialize(void* pHeap, size_t heapSize) { 14 | LOG_USE_MODULE(libSceRemoteplay); 15 | LOG_ERR(L"todo %S", __FUNCTION__); 16 | return Ok; 17 | } 18 | 19 | EXPORT SYSV_ABI int sceRemoteplayTerminate() { 20 | LOG_USE_MODULE(libSceRemoteplay); 21 | LOG_ERR(L"todo %S", __FUNCTION__); 22 | return Ok; 23 | } 24 | 25 | EXPORT SYSV_ABI int sceRemoteplayProhibit() { 26 | LOG_USE_MODULE(libSceRemoteplay); 27 | LOG_ERR(L"todo %S", __FUNCTION__); 28 | return Ok; 29 | } 30 | 31 | EXPORT SYSV_ABI int sceRemoteplayApprove() { 32 | LOG_USE_MODULE(libSceRemoteplay); 33 | LOG_ERR(L"todo %S", __FUNCTION__); 34 | return Ok; 35 | } 36 | 37 | EXPORT SYSV_ABI int sceRemoteplayProhibitStreaming(SceRemoteplayStreamingProhibition mode) { 38 | LOG_USE_MODULE(libSceRemoteplay); 39 | LOG_ERR(L"todo %S", __FUNCTION__); 40 | return Ok; 41 | } 42 | 43 | EXPORT SYSV_ABI int sceRemoteplayGetConnectionStatus(SceUserServiceUserId userid, SceRemoteplayConnectionStatus* pStatus) { 44 | *pStatus = SceRemoteplayConnectionStatus::Disconnect; 45 | LOG_USE_MODULE(libSceRemoteplay); 46 | LOG_TRACE(L"todo %S", __FUNCTION__); 47 | return Ok; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /modules/libSceCommonDialog/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Err { 6 | namespace CommonDialog { 7 | constexpr int32_t NOT_SYSTEM_INITIALIZED = -2135425023; /* 0x80B80001 */ 8 | constexpr int32_t ALREADY_SYSTEM_INITIALIZED = -2135425022; /* 0x80B80002 */ 9 | constexpr int32_t NOT_INITIALIZED = -2135425021; /* 0x80B80003 */ 10 | constexpr int32_t ALREADY_INITIALIZED = -2135425020; /* 0x80B80004 */ 11 | constexpr int32_t NOT_FINISHED = -2135425019; /* 0x80B80005 */ 12 | constexpr int32_t INVALID_STATE = -2135425018; /* 0x80B80006 */ 13 | constexpr int32_t RESULT_NONE = -2135425017; /* 0x80B80007 */ 14 | constexpr int32_t BUSY = -2135425016; /* 0x80B80008 */ 15 | constexpr int32_t OUT_OF_MEMORY = -2135425015; /* 0x80B80009 */ 16 | constexpr int32_t PARAM_INVALID = -2135425014; /* 0x80B8000A */ 17 | constexpr int32_t NOT_RUNNING = -2135425013; /* 0x80B8000B */ 18 | constexpr int32_t ALREADY_CLOSE = -2135425012; /* 0x80B8000C */ 19 | constexpr int32_t ARG_NULL = -2135425011; /* 0x80B8000D */ 20 | constexpr int32_t UNEXPECTED_FATAL = -2135425010; /* 0x80B8000E */ 21 | constexpr int32_t NOT_SUPPORTED = -2135425009; /* 0x80B8000F */ 22 | constexpr int32_t INHIBIT_SHAREPLAY_CLIENT = -2135425008; /* 0x80B80010 */ 23 | } // namespace CommonDialog 24 | } // namespace Err 25 | -------------------------------------------------------------------------------- /modules/libkernel/codes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Err {} // namespace Err 5 | 6 | constexpr size_t PROGNAME_MAX_SIZE = 511; 7 | 8 | constexpr uint8_t SCE_KERNEL_PROT_CPU_READ = 0x01; 9 | constexpr uint8_t SCE_KERNEL_PROT_CPU_RW = 0x02; 10 | constexpr uint8_t SCE_KERNEL_PROT_CPU_EXEC = 0x04; 11 | constexpr uint8_t SCE_KERNEL_PROT_CPU_ALL = 0x07; 12 | constexpr uint8_t SCE_KERNEL_PROT_GPU_READ = 0x10; 13 | constexpr uint8_t SCE_KERNEL_PROT_GPU_WRITE = 0x20; 14 | constexpr uint8_t SCE_KERNEL_PROT_GPU_RW = 0x30; 15 | constexpr uint8_t SCE_KERNEL_PROT_GPU_ALL = 0x30; 16 | 17 | constexpr uint32_t SCE_KERNEL_PAGE_SIZE = 16384; 18 | constexpr uint64_t SCE_KERNEL_MAIN_DMEM_SIZE = 0x180000000; 19 | 20 | constexpr uint32_t SCE_KERNEL_AIO_SCHED_WINDOW_MAX = 128; 21 | constexpr uint32_t SCE_KERNEL_AIO_DELAYED_COUNT_MAX = 128; 22 | constexpr uint32_t SCE_KERNEL_AIO_ENABLE_SPLIT = 1; 23 | constexpr uint32_t SCE_KERNEL_AIO_DISABLE_SPLIT = 0; 24 | constexpr uint32_t SCE_KERNEL_AIO_SPLIT_SIZE_MAX = 0x1000000; 25 | constexpr uint32_t SCE_KERNEL_AIO_SPLIT_CHUNK_SIZE_MAX = 0x1000000; 26 | constexpr uint32_t SCE_KERNEL_AIO_SCHED_WINDOW_DEFAULT = 32; 27 | constexpr uint32_t SCE_KERNEL_AIO_DELAYED_COUNT_DEFAULT = 32; 28 | constexpr uint32_t SCE_KERNEL_AIO_SPLIT_SIZE_DEFAULT = 0x100000; 29 | constexpr uint32_t SCE_KERNEL_AIO_REQUEST_NUM_MAX = 128; 30 | constexpr uint32_t SCE_KERNEL_AIO_ID_NUM_MAX = 128; --------------------------------------------------------------------------------