├── .ci ├── build-freebsd.sh ├── build-linux-aarch64.sh ├── build-linux.sh ├── build-mac-arm64.sh ├── build-mac.sh ├── deploy-linux.sh ├── deploy-mac-arm64.sh ├── deploy-mac.sh ├── deploy-windows.sh ├── docker.env ├── export-azure-vars.sh ├── export-cirrus-vars.sh ├── generate-qt-ts.sh ├── get_keys-windows.sh ├── github-upload.sh ├── install-freebsd.sh ├── optimize-mac.sh └── setup-windows.sh ├── .cirrus.yml ├── .clang-format ├── .editorconfig ├── .gdbinit ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── 1-regression-report.yml │ ├── 2-bug-report.yml │ ├── 3-feature-request.yml │ ├── 4-advanced.md │ └── config.yml └── workflows │ ├── qt-ts.yml │ └── rpcs3.yml ├── .gitignore ├── .gitmodules ├── 3rdparty ├── 7zip │ ├── 7zip.filters │ ├── 7zip.vcxproj │ └── CMakeLists.txt ├── CMakeLists.txt ├── DetectArchitecture.cmake ├── GL │ ├── KHR │ │ └── khrplatform.h │ └── glext.h ├── GPUOpen │ └── include │ │ ├── ffx_a.h │ │ └── ffx_fsr1.h ├── MoltenVK │ ├── .gitignore │ └── CMakeLists.txt ├── OpenAL │ ├── CMakeLists.txt │ └── openal-soft.vcxproj ├── SoundTouch │ ├── CMakeLists.txt │ ├── soundtouch.vcxproj │ └── soundtouch.vcxproj.filters ├── asmjit │ ├── CMakeLists.txt │ ├── asmjit.vcxproj │ └── asmjit.vcxproj.filters ├── bcdec │ └── bcdec.hpp ├── cubeb │ ├── CMakeLists.txt │ ├── extra │ │ └── cubeb_export.h │ ├── libcubeb.vcxproj │ └── libcubeb.vcxproj.filters ├── curl │ ├── CMakeLists.txt │ ├── extra │ │ └── wolfssl │ │ │ └── options.h │ ├── libcurl.vcxproj │ └── libcurl.vcxproj.filters ├── discord-rpc │ ├── CMakeLists.txt │ ├── discord-rpc.vcxproj │ └── discord-rpc.vcxproj.filters ├── fusion │ ├── CMakeLists.txt │ ├── fusion.vcxproj │ └── fusion.vcxproj.filters ├── glslang │ ├── .gitignore │ ├── CMakeLists.txt │ ├── glslang.vcxproj │ └── glslang.vcxproj.filters ├── hidapi │ ├── CMakeLists.txt │ ├── hidapi.vcxproj │ └── hidapi.vcxproj.filters ├── libpng │ ├── CMakeLists.txt │ ├── libpng.vcxproj │ └── pnglibconf.vcxproj ├── libsdl-org │ ├── CMakeLists.txt │ ├── SDL.vcxproj │ └── SDL.vcxproj.filters ├── libusb │ ├── CMakeLists.txt │ ├── cmake_modules │ │ ├── FindCoreFoundation.cmake │ │ ├── FindIOKit.cmake │ │ └── LibFindMacros.cmake │ ├── config.cmake │ ├── config.h.cmake │ ├── libusb-1.0.pc.cmake │ ├── libusb.cmake │ ├── libusb_static.vcxproj │ └── os.cmake ├── llvm │ ├── CMakeLists.txt │ ├── llvm_build.vcxproj │ ├── llvm_build.vcxproj.filters │ ├── llvm_build_clang_cl.vcxproj │ └── llvm_build_clang_cl.vcxproj.filters ├── miniupnp │ ├── CMakeLists.txt │ └── miniupnpc_static.vcxproj ├── opencv │ └── CMakeLists.txt ├── pine │ └── pine_server.h ├── qt6.cmake ├── rtmidi │ ├── CMakeLists.txt │ └── rtmidi.vcxproj ├── stblib │ └── CMakeLists.txt ├── unordered_dense │ └── include │ │ └── unordered_dense.h ├── version_check.sh ├── wolfssl │ ├── CMakeLists.txt │ ├── extra │ │ └── win32 │ │ │ └── user_settings.h │ └── wolfssl.vcxproj ├── yaml-cpp │ ├── CMakeLists.txt │ ├── yaml-cpp.vcxproj │ └── yaml-cpp.vcxproj.filters ├── zlib │ ├── CMakeLists.txt │ ├── zlib.props │ └── zlib.vcxproj └── zstd │ ├── CMakeLists.txt │ ├── zstd.rc │ └── zstd.vcxproj ├── BUILDING.md ├── CMakeLists.txt ├── CMakePresets.json ├── LICENSE ├── README.md ├── Utilities ├── BitField.h ├── CRC.h ├── Config.cpp ├── Config.h ├── File.cpp ├── File.h ├── JIT.h ├── JITASM.cpp ├── JITLLVM.cpp ├── LUrlParser.cpp ├── LUrlParser.h ├── StrFmt.cpp ├── StrFmt.h ├── StrUtil.h ├── Thread.cpp ├── Thread.h ├── Timer.h ├── address_range.h ├── bin_patch.cpp ├── bin_patch.h ├── bit_set.h ├── cfmt.h ├── cheat_info.cpp ├── cheat_info.h ├── cond.cpp ├── cond.h ├── date_time.cpp ├── date_time.h ├── geometry.h ├── git-version-gen.cmd ├── lockless.h ├── mutex.cpp ├── mutex.h ├── ppu_patch.h ├── rXml.cpp ├── rXml.h ├── sema.cpp ├── sema.h ├── simple_ringbuf.cpp ├── simple_ringbuf.h ├── stack_trace.cpp ├── stack_trace.h ├── sync.h ├── transactional_storage.h ├── version.cpp └── version.h ├── bin ├── GuiConfigs │ ├── Classic (Bright).qss │ ├── Darker Style by TheMitoSan.qss │ ├── Envy.qss │ ├── Kuroi (Dark) by Ani.qss │ ├── ModernBlue Theme by TheMitoSan.qss │ ├── Nekotekina by GooseWing.qss │ ├── Skyline (Nightfall).qss │ ├── Skyline.qss │ ├── YoRHa by Ani.qss │ ├── YoRHa-background.jpg │ ├── check_mark_white.png │ ├── kot-bg.jpg │ ├── list_arrow_blue.png │ ├── list_arrow_down_blue.png │ ├── list_arrow_down_green.png │ ├── list_arrow_down_white.png │ ├── list_arrow_green.png │ └── list_arrow_white.png ├── Icons │ └── ui │ │ ├── L1.png │ │ ├── L2.png │ │ ├── R1.png │ │ ├── R2.png │ │ ├── circle.png │ │ ├── cross.png │ │ ├── dpad.png │ │ ├── dpad_down.png │ │ ├── dpad_left.png │ │ ├── dpad_right.png │ │ ├── dpad_up.png │ │ ├── fade_bottom.png │ │ ├── fade_top.png │ │ ├── left_stick.png │ │ ├── new.png │ │ ├── right_stick.png │ │ ├── save.png │ │ ├── select.png │ │ ├── spinner-24.png │ │ ├── square.png │ │ ├── start.png │ │ └── triangle.png └── test │ ├── dump_stack.elf │ ├── gs_gcm_basic_triangle.elf │ ├── gs_gcm_cube.elf │ ├── gs_gcm_handle_system_cmd.elf │ ├── gs_gcm_hello_world.elf │ ├── gs_gcm_tetris.elf │ ├── pad_test.elf │ ├── ppu_thread.elf │ ├── pspgame.elf │ ├── rpcsp.elf │ └── spurs_test.self ├── buildfiles ├── cmake │ ├── ConfigureCompiler.cmake │ ├── FindFFMPEG.cmake │ ├── FindWayland.cmake │ ├── FindWolfSSL.cmake │ └── FindZLIB.cmake └── msvc │ ├── ci_only.targets │ ├── common_default.props │ ├── common_default_clang_cl.props │ ├── common_default_macros.props │ ├── rpcs3_debug.props │ ├── rpcs3_default.props │ └── rpcs3_release.props ├── darwin └── util │ └── sysinfo_darwin.mm ├── git-clang-format ├── objdump.cpp ├── pre-commit.readme ├── rpcs3.sln ├── rpcs3 ├── CMakeLists.txt ├── Crypto │ ├── aes.cpp │ ├── aes.h │ ├── aesni.cpp │ ├── aesni.h │ ├── decrypt_binaries.cpp │ ├── decrypt_binaries.h │ ├── ec.cpp │ ├── ec.h │ ├── key_vault.cpp │ ├── key_vault.h │ ├── lz.cpp │ ├── lz.h │ ├── md5.cpp │ ├── md5.h │ ├── sha1.cpp │ ├── sha1.h │ ├── sha256.cpp │ ├── sha256.h │ ├── unedat.cpp │ ├── unedat.h │ ├── unpkg.cpp │ ├── unpkg.h │ ├── unself.cpp │ ├── unself.h │ ├── unzip.cpp │ ├── unzip.h │ ├── utils.cpp │ └── utils.h ├── Cubeb.vcxproj ├── Cubeb.vcxproj.filters ├── Emu │ ├── Audio │ │ ├── AudioBackend.cpp │ │ ├── AudioBackend.h │ │ ├── AudioDumper.cpp │ │ ├── AudioDumper.h │ │ ├── Cubeb │ │ │ ├── CubebBackend.cpp │ │ │ ├── CubebBackend.h │ │ │ ├── cubeb_enumerator.cpp │ │ │ └── cubeb_enumerator.h │ │ ├── FAudio │ │ │ ├── FAudioBackend.cpp │ │ │ ├── FAudioBackend.h │ │ │ ├── faudio_enumerator.cpp │ │ │ └── faudio_enumerator.h │ │ ├── Null │ │ │ ├── NullAudioBackend.h │ │ │ └── null_enumerator.h │ │ ├── XAudio2 │ │ │ ├── XAudio2Backend.cpp │ │ │ ├── XAudio2Backend.h │ │ │ ├── xaudio2_enumerator.cpp │ │ │ └── xaudio2_enumerator.h │ │ ├── audio_device_enumerator.h │ │ ├── audio_resampler.cpp │ │ ├── audio_resampler.h │ │ ├── audio_utils.cpp │ │ └── audio_utils.h │ ├── CMakeLists.txt │ ├── CPU │ │ ├── Backends │ │ │ └── AArch64 │ │ │ │ ├── AArch64ASM.cpp │ │ │ │ ├── AArch64ASM.h │ │ │ │ ├── AArch64Common.cpp │ │ │ │ ├── AArch64Common.h │ │ │ │ ├── AArch64JIT.cpp │ │ │ │ ├── AArch64JIT.h │ │ │ │ ├── AArch64Signal.cpp │ │ │ │ └── AArch64Signal.h │ │ ├── CPUDisAsm.h │ │ ├── CPUThread.cpp │ │ ├── CPUThread.h │ │ ├── CPUTranslator.cpp │ │ ├── CPUTranslator.h │ │ ├── Hypervisor.h │ │ └── sse2neon.h │ ├── Cell │ │ ├── Common.h │ │ ├── ErrorCodes.cpp │ │ ├── ErrorCodes.h │ │ ├── MFC.cpp │ │ ├── MFC.h │ │ ├── Modules │ │ │ ├── HLE_PATCHES.cpp │ │ │ ├── StaticHLE.cpp │ │ │ ├── StaticHLE.h │ │ │ ├── cellAdec.cpp │ │ │ ├── cellAdec.h │ │ │ ├── cellAtrac.cpp │ │ │ ├── cellAtrac.h │ │ │ ├── cellAtracMulti.cpp │ │ │ ├── cellAtracMulti.h │ │ │ ├── cellAtracXdec.cpp │ │ │ ├── cellAtracXdec.h │ │ │ ├── cellAudio.cpp │ │ │ ├── cellAudio.h │ │ │ ├── cellAudioIn.h │ │ │ ├── cellAudioOut.cpp │ │ │ ├── cellAudioOut.h │ │ │ ├── cellAuthDialog.cpp │ │ │ ├── cellAvconfExt.cpp │ │ │ ├── cellBgdl.cpp │ │ │ ├── cellBgdl.h │ │ │ ├── cellCamera.cpp │ │ │ ├── cellCamera.h │ │ │ ├── cellCelp8Enc.cpp │ │ │ ├── cellCelp8Enc.h │ │ │ ├── cellCelpEnc.cpp │ │ │ ├── cellCelpEnc.h │ │ │ ├── cellCrossController.cpp │ │ │ ├── cellCrossController.h │ │ │ ├── cellDaisy.cpp │ │ │ ├── cellDaisy.h │ │ │ ├── cellDmux.cpp │ │ │ ├── cellDmux.h │ │ │ ├── cellDmuxPamf.cpp │ │ │ ├── cellDmuxPamf.h │ │ │ ├── cellDtcpIpUtility.cpp │ │ │ ├── cellFiber.cpp │ │ │ ├── cellFiber.h │ │ │ ├── cellFont.cpp │ │ │ ├── cellFont.h │ │ │ ├── cellFontFT.cpp │ │ │ ├── cellFontFT.h │ │ │ ├── cellFs.cpp │ │ │ ├── cellFs.h │ │ │ ├── cellGame.cpp │ │ │ ├── cellGame.h │ │ │ ├── cellGameExec.cpp │ │ │ ├── cellGcmSys.cpp │ │ │ ├── cellGcmSys.h │ │ │ ├── cellGem.cpp │ │ │ ├── cellGem.h │ │ │ ├── cellGifDec.cpp │ │ │ ├── cellGifDec.h │ │ │ ├── cellHttp.cpp │ │ │ ├── cellHttp.h │ │ │ ├── cellHttpUtil.cpp │ │ │ ├── cellHttpUtil.h │ │ │ ├── cellImeJp.cpp │ │ │ ├── cellImeJp.h │ │ │ ├── cellJpgDec.cpp │ │ │ ├── cellJpgDec.h │ │ │ ├── cellJpgEnc.cpp │ │ │ ├── cellJpgEnc.h │ │ │ ├── cellKb.cpp │ │ │ ├── cellKb.h │ │ │ ├── cellKey2char.cpp │ │ │ ├── cellL10n.cpp │ │ │ ├── cellL10n.h │ │ │ ├── cellLibprof.cpp │ │ │ ├── cellMic.cpp │ │ │ ├── cellMic.h │ │ │ ├── cellMouse.cpp │ │ │ ├── cellMouse.h │ │ │ ├── cellMsgDialog.cpp │ │ │ ├── cellMsgDialog.h │ │ │ ├── cellMusic.cpp │ │ │ ├── cellMusic.h │ │ │ ├── cellMusicDecode.cpp │ │ │ ├── cellMusicDecode.h │ │ │ ├── cellMusicExport.cpp │ │ │ ├── cellMusicSelectionContext.cpp │ │ │ ├── cellNetAoi.cpp │ │ │ ├── cellNetCtl.cpp │ │ │ ├── cellNetCtl.h │ │ │ ├── cellOskDialog.cpp │ │ │ ├── cellOskDialog.h │ │ │ ├── cellOvis.cpp │ │ │ ├── cellPad.cpp │ │ │ ├── cellPad.h │ │ │ ├── cellPamf.cpp │ │ │ ├── cellPamf.h │ │ │ ├── cellPesmUtility.cpp │ │ │ ├── cellPhotoDecode.cpp │ │ │ ├── cellPhotoExport.cpp │ │ │ ├── cellPhotoImport.cpp │ │ │ ├── cellPng.h │ │ │ ├── cellPngDec.cpp │ │ │ ├── cellPngDec.h │ │ │ ├── cellPngEnc.cpp │ │ │ ├── cellPngEnc.h │ │ │ ├── cellPrint.cpp │ │ │ ├── cellRec.cpp │ │ │ ├── cellRec.h │ │ │ ├── cellRemotePlay.cpp │ │ │ ├── cellRemotePlay.h │ │ │ ├── cellResc.cpp │ │ │ ├── cellResc.h │ │ │ ├── cellRtc.cpp │ │ │ ├── cellRtc.h │ │ │ ├── cellRtcAlarm.cpp │ │ │ ├── cellRudp.cpp │ │ │ ├── cellRudp.h │ │ │ ├── cellSail.cpp │ │ │ ├── cellSail.h │ │ │ ├── cellSailRec.cpp │ │ │ ├── cellSaveData.cpp │ │ │ ├── cellSaveData.h │ │ │ ├── cellScreenshot.cpp │ │ │ ├── cellScreenshot.h │ │ │ ├── cellSearch.cpp │ │ │ ├── cellSearch.h │ │ │ ├── cellSheap.cpp │ │ │ ├── cellSpudll.cpp │ │ │ ├── cellSpudll.h │ │ │ ├── cellSpurs.cpp │ │ │ ├── cellSpurs.h │ │ │ ├── cellSpursJq.cpp │ │ │ ├── cellSpursJq.h │ │ │ ├── cellSpursSpu.cpp │ │ │ ├── cellSsl.cpp │ │ │ ├── cellSsl.h │ │ │ ├── cellStorage.cpp │ │ │ ├── cellStorage.h │ │ │ ├── cellSubDisplay.cpp │ │ │ ├── cellSubDisplay.h │ │ │ ├── cellSync.cpp │ │ │ ├── cellSync.h │ │ │ ├── cellSync2.cpp │ │ │ ├── cellSync2.h │ │ │ ├── cellSysCache.cpp │ │ │ ├── cellSysconf.cpp │ │ │ ├── cellSysconf.h │ │ │ ├── cellSysmodule.cpp │ │ │ ├── cellSysutil.cpp │ │ │ ├── cellSysutil.h │ │ │ ├── cellSysutilAp.cpp │ │ │ ├── cellSysutilAvc.cpp │ │ │ ├── cellSysutilAvc.h │ │ │ ├── cellSysutilAvc2.cpp │ │ │ ├── cellSysutilAvc2.h │ │ │ ├── cellSysutilAvcExt.cpp │ │ │ ├── cellSysutilMisc.cpp │ │ │ ├── cellSysutilNpEula.cpp │ │ │ ├── cellUsbd.cpp │ │ │ ├── cellUsbd.h │ │ │ ├── cellUsbpspcm.cpp │ │ │ ├── cellUserInfo.cpp │ │ │ ├── cellUserInfo.h │ │ │ ├── cellVdec.cpp │ │ │ ├── cellVdec.h │ │ │ ├── cellVideoExport.cpp │ │ │ ├── cellVideoOut.cpp │ │ │ ├── cellVideoOut.h │ │ │ ├── cellVideoPlayerUtility.cpp │ │ │ ├── cellVideoUpload.cpp │ │ │ ├── cellVideoUpload.h │ │ │ ├── cellVoice.cpp │ │ │ ├── cellVoice.h │ │ │ ├── cellVpost.cpp │ │ │ ├── cellVpost.h │ │ │ ├── cellWebBrowser.cpp │ │ │ ├── cellWebBrowser.h │ │ │ ├── cell_FreeType2.cpp │ │ │ ├── libad_async.cpp │ │ │ ├── libad_core.cpp │ │ │ ├── libfs_utility_init.cpp │ │ │ ├── libfs_utility_init.h │ │ │ ├── libmedi.cpp │ │ │ ├── libmixer.cpp │ │ │ ├── libmixer.h │ │ │ ├── libsnd3.cpp │ │ │ ├── libsnd3.h │ │ │ ├── libsynth2.cpp │ │ │ ├── libsynth2.h │ │ │ ├── sceNp.cpp │ │ │ ├── sceNp.h │ │ │ ├── sceNp2.cpp │ │ │ ├── sceNp2.h │ │ │ ├── sceNpClans.cpp │ │ │ ├── sceNpClans.h │ │ │ ├── sceNpCommerce2.cpp │ │ │ ├── sceNpCommerce2.h │ │ │ ├── sceNpMatchingInt.cpp │ │ │ ├── sceNpPlus.cpp │ │ │ ├── sceNpPlus.h │ │ │ ├── sceNpSns.cpp │ │ │ ├── sceNpSns.h │ │ │ ├── sceNpTrophy.cpp │ │ │ ├── sceNpTrophy.h │ │ │ ├── sceNpTus.cpp │ │ │ ├── sceNpTus.h │ │ │ ├── sceNpUtil.cpp │ │ │ ├── sceNpUtil.h │ │ │ ├── sysPrxForUser.cpp │ │ │ ├── sysPrxForUser.h │ │ │ ├── sys_crashdump.cpp │ │ │ ├── sys_crashdump.h │ │ │ ├── sys_game_.cpp │ │ │ ├── sys_heap.cpp │ │ │ ├── sys_io_.cpp │ │ │ ├── sys_libc.cpp │ │ │ ├── sys_libc_.cpp │ │ │ ├── sys_lv2dbg.cpp │ │ │ ├── sys_lv2dbg.h │ │ │ ├── sys_lwcond_.cpp │ │ │ ├── sys_lwmutex_.cpp │ │ │ ├── sys_mempool.cpp │ │ │ ├── sys_mmapper_.cpp │ │ │ ├── sys_net_.cpp │ │ │ ├── sys_net_.h │ │ │ ├── sys_ppu_thread_.cpp │ │ │ ├── sys_prx_.cpp │ │ │ ├── sys_rsxaudio_.cpp │ │ │ ├── sys_spinlock.cpp │ │ │ └── sys_spu_.cpp │ │ ├── PPCDisAsm.h │ │ ├── PPUAnalyser.cpp │ │ ├── PPUAnalyser.h │ │ ├── PPUCallback.h │ │ ├── PPUDisAsm.cpp │ │ ├── PPUDisAsm.h │ │ ├── PPUFunction.cpp │ │ ├── PPUFunction.h │ │ ├── PPUInterpreter.cpp │ │ ├── PPUInterpreter.h │ │ ├── PPUModule.cpp │ │ ├── PPUModule.h │ │ ├── PPUOpcodes.h │ │ ├── PPUThread.cpp │ │ ├── PPUThread.h │ │ ├── PPUTranslator.cpp │ │ ├── PPUTranslator.h │ │ ├── RawSPUThread.cpp │ │ ├── RawSPUThread.h │ │ ├── SPUASMJITRecompiler.cpp │ │ ├── SPUASMJITRecompiler.h │ │ ├── SPUAnalyser.cpp │ │ ├── SPUAnalyser.h │ │ ├── SPUCommonRecompiler.cpp │ │ ├── SPUDisAsm.cpp │ │ ├── SPUDisAsm.h │ │ ├── SPUInterpreter.cpp │ │ ├── SPUInterpreter.h │ │ ├── SPULLVMRecompiler.cpp │ │ ├── SPUOpcodes.h │ │ ├── SPURecompiler.h │ │ ├── SPUThread.cpp │ │ ├── SPUThread.h │ │ ├── lv2 │ │ │ ├── lv2.cpp │ │ │ ├── sys_bdemu.cpp │ │ │ ├── sys_bdemu.h │ │ │ ├── sys_btsetting.cpp │ │ │ ├── sys_btsetting.h │ │ │ ├── sys_cond.cpp │ │ │ ├── sys_cond.h │ │ │ ├── sys_config.cpp │ │ │ ├── sys_config.h │ │ │ ├── sys_console.cpp │ │ │ ├── sys_console.h │ │ │ ├── sys_crypto_engine.cpp │ │ │ ├── sys_crypto_engine.h │ │ │ ├── sys_dbg.cpp │ │ │ ├── sys_dbg.h │ │ │ ├── sys_event.cpp │ │ │ ├── sys_event.h │ │ │ ├── sys_event_flag.cpp │ │ │ ├── sys_event_flag.h │ │ │ ├── sys_fs.cpp │ │ │ ├── sys_fs.h │ │ │ ├── sys_game.cpp │ │ │ ├── sys_game.h │ │ │ ├── sys_gamepad.cpp │ │ │ ├── sys_gamepad.h │ │ │ ├── sys_gpio.cpp │ │ │ ├── sys_gpio.h │ │ │ ├── sys_hid.cpp │ │ │ ├── sys_hid.h │ │ │ ├── sys_interrupt.cpp │ │ │ ├── sys_interrupt.h │ │ │ ├── sys_io.cpp │ │ │ ├── sys_io.h │ │ │ ├── sys_lwcond.cpp │ │ │ ├── sys_lwcond.h │ │ │ ├── sys_lwmutex.cpp │ │ │ ├── sys_lwmutex.h │ │ │ ├── sys_memory.cpp │ │ │ ├── sys_memory.h │ │ │ ├── sys_mmapper.cpp │ │ │ ├── sys_mmapper.h │ │ │ ├── sys_mutex.cpp │ │ │ ├── sys_mutex.h │ │ │ ├── sys_net.cpp │ │ │ ├── sys_net.h │ │ │ ├── sys_net │ │ │ │ ├── lv2_socket.cpp │ │ │ │ ├── lv2_socket.h │ │ │ │ ├── lv2_socket_native.cpp │ │ │ │ ├── lv2_socket_native.h │ │ │ │ ├── lv2_socket_p2p.cpp │ │ │ │ ├── lv2_socket_p2p.h │ │ │ │ ├── lv2_socket_p2ps.cpp │ │ │ │ ├── lv2_socket_p2ps.h │ │ │ │ ├── lv2_socket_raw.cpp │ │ │ │ ├── lv2_socket_raw.h │ │ │ │ ├── network_context.cpp │ │ │ │ ├── network_context.h │ │ │ │ ├── nt_p2p_port.cpp │ │ │ │ ├── nt_p2p_port.h │ │ │ │ ├── sys_net_helpers.cpp │ │ │ │ └── sys_net_helpers.h │ │ │ ├── sys_overlay.cpp │ │ │ ├── sys_overlay.h │ │ │ ├── sys_ppu_thread.cpp │ │ │ ├── sys_ppu_thread.h │ │ │ ├── sys_process.cpp │ │ │ ├── sys_process.h │ │ │ ├── sys_prx.cpp │ │ │ ├── sys_prx.h │ │ │ ├── sys_rsx.cpp │ │ │ ├── sys_rsx.h │ │ │ ├── sys_rsxaudio.cpp │ │ │ ├── sys_rsxaudio.h │ │ │ ├── sys_rwlock.cpp │ │ │ ├── sys_rwlock.h │ │ │ ├── sys_semaphore.cpp │ │ │ ├── sys_semaphore.h │ │ │ ├── sys_sm.cpp │ │ │ ├── sys_sm.h │ │ │ ├── sys_spu.cpp │ │ │ ├── sys_spu.h │ │ │ ├── sys_ss.cpp │ │ │ ├── sys_ss.h │ │ │ ├── sys_storage.cpp │ │ │ ├── sys_storage.h │ │ │ ├── sys_sync.h │ │ │ ├── sys_time.cpp │ │ │ ├── sys_time.h │ │ │ ├── sys_timer.cpp │ │ │ ├── sys_timer.h │ │ │ ├── sys_trace.cpp │ │ │ ├── sys_trace.h │ │ │ ├── sys_tty.cpp │ │ │ ├── sys_tty.h │ │ │ ├── sys_uart.cpp │ │ │ ├── sys_uart.h │ │ │ ├── sys_usbd.cpp │ │ │ ├── sys_usbd.h │ │ │ ├── sys_vm.cpp │ │ │ └── sys_vm.h │ │ └── timers.hpp │ ├── GDB.cpp │ ├── GDB.h │ ├── GameInfo.h │ ├── IPC.h │ ├── IPC_config.cpp │ ├── IPC_config.h │ ├── IPC_socket.cpp │ ├── IPC_socket.h │ ├── IdManager.cpp │ ├── IdManager.h │ ├── Io │ │ ├── Buzz.cpp │ │ ├── Buzz.h │ │ ├── Dimensions.cpp │ │ ├── Dimensions.h │ │ ├── GHLtar.cpp │ │ ├── GHLtar.h │ │ ├── GameTablet.cpp │ │ ├── GameTablet.h │ │ ├── GunCon3.cpp │ │ ├── GunCon3.h │ │ ├── Infinity.cpp │ │ ├── Infinity.h │ │ ├── Keyboard.h │ │ ├── KeyboardHandler.cpp │ │ ├── KeyboardHandler.h │ │ ├── LogitechG27.cpp │ │ ├── LogitechG27.h │ │ ├── LogitechG27Config.cpp │ │ ├── LogitechG27Config.h │ │ ├── MouseHandler.cpp │ │ ├── MouseHandler.h │ │ ├── Null │ │ │ ├── NullKeyboardHandler.h │ │ │ ├── NullMouseHandler.h │ │ │ ├── NullPadHandler.h │ │ │ ├── null_camera_handler.h │ │ │ └── null_music_handler.h │ │ ├── PadHandler.cpp │ │ ├── PadHandler.h │ │ ├── RB3MidiDrums.cpp │ │ ├── RB3MidiDrums.h │ │ ├── RB3MidiGuitar.cpp │ │ ├── RB3MidiGuitar.h │ │ ├── RB3MidiKeyboard.cpp │ │ ├── RB3MidiKeyboard.h │ │ ├── Skylander.cpp │ │ ├── Skylander.h │ │ ├── TopShotElite.cpp │ │ ├── TopShotElite.h │ │ ├── TopShotFearmaster.cpp │ │ ├── TopShotFearmaster.h │ │ ├── Turntable.cpp │ │ ├── Turntable.h │ │ ├── buzz_config.h │ │ ├── camera_config.cpp │ │ ├── camera_config.h │ │ ├── camera_handler_base.h │ │ ├── emulated_pad_config.h │ │ ├── evdev_gun_handler.cpp │ │ ├── evdev_gun_handler.h │ │ ├── gem_config.h │ │ ├── ghltar_config.h │ │ ├── guncon3_config.h │ │ ├── interception.cpp │ │ ├── interception.h │ │ ├── midi_config_types.cpp │ │ ├── midi_config_types.h │ │ ├── mouse_config.cpp │ │ ├── mouse_config.h │ │ ├── music_handler_base.h │ │ ├── pad_config.cpp │ │ ├── pad_config.h │ │ ├── pad_config_types.cpp │ │ ├── pad_config_types.h │ │ ├── pad_types.cpp │ │ ├── pad_types.h │ │ ├── rb3drums_config.cpp │ │ ├── rb3drums_config.h │ │ ├── recording_config.cpp │ │ ├── recording_config.h │ │ ├── topshotelite_config.h │ │ ├── topshotfearmaster_config.h │ │ ├── turntable_config.h │ │ ├── usb_device.cpp │ │ ├── usb_device.h │ │ ├── usb_vfs.cpp │ │ ├── usb_vfs.h │ │ ├── usio.cpp │ │ ├── usio.h │ │ └── usio_config.h │ ├── Memory │ │ ├── vm.cpp │ │ ├── vm.h │ │ ├── vm_locking.h │ │ ├── vm_ptr.h │ │ ├── vm_ref.h │ │ ├── vm_reservation.h │ │ └── vm_var.h │ ├── NP │ │ ├── fb_helpers.cpp │ │ ├── fb_helpers.h │ │ ├── generated │ │ │ ├── np2_structs.fbs │ │ │ └── np2_structs_generated.h │ │ ├── ip_address.cpp │ │ ├── ip_address.h │ │ ├── np_allocator.h │ │ ├── np_cache.cpp │ │ ├── np_cache.h │ │ ├── np_contexts.cpp │ │ ├── np_contexts.h │ │ ├── np_dnshook.cpp │ │ ├── np_dnshook.h │ │ ├── np_event_data.h │ │ ├── np_gui_cache.cpp │ │ ├── np_gui_cache.h │ │ ├── np_handler.cpp │ │ ├── np_handler.h │ │ ├── np_helpers.cpp │ │ ├── np_helpers.h │ │ ├── np_notifications.cpp │ │ ├── np_requests.cpp │ │ ├── np_requests_gui.cpp │ │ ├── np_structs_extra.cpp │ │ ├── np_structs_extra.h │ │ ├── rpcn_client.cpp │ │ ├── rpcn_client.h │ │ ├── rpcn_config.cpp │ │ ├── rpcn_config.h │ │ ├── rpcn_countries.cpp │ │ ├── rpcn_countries.h │ │ ├── rpcn_types.h │ │ ├── signaling_handler.cpp │ │ ├── signaling_handler.h │ │ ├── upnp_config.cpp │ │ ├── upnp_config.h │ │ ├── upnp_handler.cpp │ │ ├── upnp_handler.h │ │ └── vport0.h │ ├── RSX │ │ ├── Capture │ │ │ ├── rsx_capture.cpp │ │ │ ├── rsx_capture.h │ │ │ ├── rsx_replay.cpp │ │ │ ├── rsx_replay.h │ │ │ └── rsx_trace.h │ │ ├── Common │ │ │ ├── BufferUtils.cpp │ │ │ ├── BufferUtils.h │ │ │ ├── TextureUtils.cpp │ │ │ ├── TextureUtils.h │ │ │ ├── bitfield.hpp │ │ │ ├── buffer_stream.hpp │ │ │ ├── expected.hpp │ │ │ ├── io_buffer.h │ │ │ ├── profiling_timer.hpp │ │ │ ├── ranged_map.hpp │ │ │ ├── ring_buffer_helper.h │ │ │ ├── simple_array.hpp │ │ │ ├── surface_cache_dma.hpp │ │ │ ├── surface_store.cpp │ │ │ ├── surface_store.h │ │ │ ├── surface_utils.h │ │ │ ├── texture_cache.cpp │ │ │ ├── texture_cache.h │ │ │ ├── texture_cache_checker.h │ │ │ ├── texture_cache_helpers.h │ │ │ ├── texture_cache_predictor.h │ │ │ ├── texture_cache_types.cpp │ │ │ ├── texture_cache_types.h │ │ │ ├── texture_cache_utils.h │ │ │ ├── tiled_dma_copy.hpp │ │ │ ├── time.hpp │ │ │ └── unordered_map.hpp │ │ ├── Core │ │ │ ├── RSXContext.cpp │ │ │ ├── RSXContext.h │ │ │ ├── RSXDisplay.cpp │ │ │ ├── RSXDisplay.h │ │ │ ├── RSXDrawCommands.cpp │ │ │ ├── RSXDrawCommands.h │ │ │ ├── RSXDriverState.h │ │ │ ├── RSXEngLock.hpp │ │ │ ├── RSXFrameBuffer.h │ │ │ ├── RSXIOMap.hpp │ │ │ ├── RSXReservationLock.hpp │ │ │ └── RSXVertexTypes.h │ │ ├── GCM.h │ │ ├── GL │ │ │ ├── GLCommonDecompiler.cpp │ │ │ ├── GLCommonDecompiler.h │ │ │ ├── GLCompute.cpp │ │ │ ├── GLCompute.h │ │ │ ├── GLDMA.cpp │ │ │ ├── GLDMA.h │ │ │ ├── GLDraw.cpp │ │ │ ├── GLFragmentProgram.cpp │ │ │ ├── GLFragmentProgram.h │ │ │ ├── GLGSRender.cpp │ │ │ ├── GLGSRender.h │ │ │ ├── GLHelpers.cpp │ │ │ ├── GLHelpers.h │ │ │ ├── GLOverlays.cpp │ │ │ ├── GLOverlays.h │ │ │ ├── GLPipelineCompiler.cpp │ │ │ ├── GLPipelineCompiler.h │ │ │ ├── GLPresent.cpp │ │ │ ├── GLProcTable.h │ │ │ ├── GLProgramBuffer.h │ │ │ ├── GLRenderTargets.cpp │ │ │ ├── GLRenderTargets.h │ │ │ ├── GLResolveHelper.cpp │ │ │ ├── GLResolveHelper.h │ │ │ ├── GLShaderInterpreter.cpp │ │ │ ├── GLShaderInterpreter.h │ │ │ ├── GLTexture.cpp │ │ │ ├── GLTexture.h │ │ │ ├── GLTextureCache.cpp │ │ │ ├── GLTextureCache.h │ │ │ ├── GLVertexBuffers.cpp │ │ │ ├── GLVertexProgram.cpp │ │ │ ├── GLVertexProgram.h │ │ │ ├── OpenGL.cpp │ │ │ ├── OpenGL.h │ │ │ ├── glutils │ │ │ │ ├── blitter.cpp │ │ │ │ ├── blitter.h │ │ │ │ ├── buffer_object.cpp │ │ │ │ ├── buffer_object.h │ │ │ │ ├── capabilities.cpp │ │ │ │ ├── capabilities.h │ │ │ │ ├── common.cpp │ │ │ │ ├── common.h │ │ │ │ ├── fbo.cpp │ │ │ │ ├── fbo.h │ │ │ │ ├── image.cpp │ │ │ │ ├── image.h │ │ │ │ ├── pixel_settings.hpp │ │ │ │ ├── program.cpp │ │ │ │ ├── program.h │ │ │ │ ├── ring_buffer.cpp │ │ │ │ ├── ring_buffer.h │ │ │ │ ├── sampler.cpp │ │ │ │ ├── sampler.h │ │ │ │ ├── state_tracker.hpp │ │ │ │ ├── sync.hpp │ │ │ │ └── vao.hpp │ │ │ └── upscalers │ │ │ │ ├── bilinear_pass.hpp │ │ │ │ ├── fsr1 │ │ │ │ └── fsr_pass.cpp │ │ │ │ ├── fsr_pass.h │ │ │ │ ├── nearest_pass.hpp │ │ │ │ ├── static_pass.hpp │ │ │ │ └── upscaling.h │ │ ├── GSFrameBase.cpp │ │ ├── GSFrameBase.h │ │ ├── GSRender.cpp │ │ ├── GSRender.h │ │ ├── Host │ │ │ ├── MM.cpp │ │ │ ├── MM.h │ │ │ ├── RSXDMAWriter.cpp │ │ │ └── RSXDMAWriter.h │ │ ├── NV47 │ │ │ ├── FW │ │ │ │ ├── GRAPH_backend.h │ │ │ │ ├── draw_call.cpp │ │ │ │ ├── draw_call.hpp │ │ │ │ ├── draw_call.inc.h │ │ │ │ ├── reg_context.cpp │ │ │ │ └── reg_context.h │ │ │ └── HW │ │ │ │ ├── common.cpp │ │ │ │ ├── common.h │ │ │ │ ├── context.h │ │ │ │ ├── context_accessors.define.h │ │ │ │ ├── context_accessors.undef.h │ │ │ │ ├── nv0039.cpp │ │ │ │ ├── nv0039.h │ │ │ │ ├── nv3089.cpp │ │ │ │ ├── nv3089.h │ │ │ │ ├── nv308a.cpp │ │ │ │ ├── nv308a.h │ │ │ │ ├── nv406e.cpp │ │ │ │ ├── nv406e.h │ │ │ │ ├── nv4097.cpp │ │ │ │ ├── nv4097.h │ │ │ │ ├── nv47.h │ │ │ │ └── nv47_sync.hpp │ │ ├── Null │ │ │ ├── NullGSRender.cpp │ │ │ └── NullGSRender.h │ │ ├── Overlays │ │ │ ├── FriendsList │ │ │ │ ├── overlay_friends_list_dialog.cpp │ │ │ │ └── overlay_friends_list_dialog.h │ │ │ ├── HomeMenu │ │ │ │ ├── overlay_home_menu.cpp │ │ │ │ ├── overlay_home_menu.h │ │ │ │ ├── overlay_home_menu_components.cpp │ │ │ │ ├── overlay_home_menu_components.h │ │ │ │ ├── overlay_home_menu_main_menu.cpp │ │ │ │ ├── overlay_home_menu_main_menu.h │ │ │ │ ├── overlay_home_menu_message_box.cpp │ │ │ │ ├── overlay_home_menu_message_box.h │ │ │ │ ├── overlay_home_menu_page.cpp │ │ │ │ ├── overlay_home_menu_page.h │ │ │ │ ├── overlay_home_menu_savestate.cpp │ │ │ │ ├── overlay_home_menu_savestate.h │ │ │ │ ├── overlay_home_menu_settings.cpp │ │ │ │ └── overlay_home_menu_settings.h │ │ │ ├── Network │ │ │ │ ├── overlay_recvmessage_dialog.cpp │ │ │ │ ├── overlay_recvmessage_dialog.h │ │ │ │ ├── overlay_sendmessage_dialog.cpp │ │ │ │ └── overlay_sendmessage_dialog.h │ │ │ ├── Shaders │ │ │ │ ├── shader_loading_dialog.cpp │ │ │ │ ├── shader_loading_dialog.h │ │ │ │ ├── shader_loading_dialog_native.cpp │ │ │ │ └── shader_loading_dialog_native.h │ │ │ ├── Trophies │ │ │ │ ├── overlay_trophy_list_dialog.cpp │ │ │ │ └── overlay_trophy_list_dialog.h │ │ │ ├── overlay_animated_icon.cpp │ │ │ ├── overlay_animated_icon.h │ │ │ ├── overlay_animation.cpp │ │ │ ├── overlay_animation.h │ │ │ ├── overlay_compile_notification.cpp │ │ │ ├── overlay_compile_notification.h │ │ │ ├── overlay_controls.cpp │ │ │ ├── overlay_controls.h │ │ │ ├── overlay_cursor.cpp │ │ │ ├── overlay_cursor.h │ │ │ ├── overlay_debug_overlay.cpp │ │ │ ├── overlay_debug_overlay.h │ │ │ ├── overlay_edit_text.cpp │ │ │ ├── overlay_edit_text.hpp │ │ │ ├── overlay_fonts.cpp │ │ │ ├── overlay_fonts.h │ │ │ ├── overlay_list_view.cpp │ │ │ ├── overlay_list_view.hpp │ │ │ ├── overlay_loading_icon.hpp │ │ │ ├── overlay_manager.cpp │ │ │ ├── overlay_manager.h │ │ │ ├── overlay_media_list_dialog.cpp │ │ │ ├── overlay_media_list_dialog.h │ │ │ ├── overlay_message.cpp │ │ │ ├── overlay_message.h │ │ │ ├── overlay_message_dialog.cpp │ │ │ ├── overlay_message_dialog.h │ │ │ ├── overlay_osk.cpp │ │ │ ├── overlay_osk.h │ │ │ ├── overlay_osk_panel.cpp │ │ │ ├── overlay_osk_panel.h │ │ │ ├── overlay_perf_metrics.cpp │ │ │ ├── overlay_perf_metrics.h │ │ │ ├── overlay_progress_bar.cpp │ │ │ ├── overlay_progress_bar.hpp │ │ │ ├── overlay_save_dialog.cpp │ │ │ ├── overlay_save_dialog.h │ │ │ ├── overlay_trophy_notification.cpp │ │ │ ├── overlay_trophy_notification.h │ │ │ ├── overlay_user_list_dialog.cpp │ │ │ ├── overlay_user_list_dialog.h │ │ │ ├── overlay_utils.cpp │ │ │ ├── overlay_utils.h │ │ │ ├── overlay_video.cpp │ │ │ ├── overlay_video.h │ │ │ ├── overlays.cpp │ │ │ └── overlays.h │ │ ├── Program │ │ │ ├── CgBinaryFragmentProgram.cpp │ │ │ ├── CgBinaryProgram.cpp │ │ │ ├── CgBinaryProgram.h │ │ │ ├── CgBinaryVertexProgram.cpp │ │ │ ├── FragmentProgramDecompiler.cpp │ │ │ ├── FragmentProgramDecompiler.h │ │ │ ├── FragmentProgramRegister.cpp │ │ │ ├── FragmentProgramRegister.h │ │ │ ├── GLSLCommon.cpp │ │ │ ├── GLSLCommon.h │ │ │ ├── GLSLInterpreter │ │ │ │ ├── FragmentInterpreter.glsl │ │ │ │ └── VertexInterpreter.glsl │ │ │ ├── GLSLSnippets │ │ │ │ ├── CopyBufferToColorImage.glsl │ │ │ │ ├── CopyBufferToGenericImage.glsl │ │ │ │ ├── CopyD24x8ToBuffer.glsl │ │ │ │ ├── CopyRGBA8ToBuffer.glsl │ │ │ │ ├── GPUDeswizzle.glsl │ │ │ │ ├── GenericVSPassthrough.glsl │ │ │ │ ├── OverlayRenderFS.glsl │ │ │ │ ├── OverlayRenderVS.glsl │ │ │ │ ├── RSXMemoryTiling.glsl │ │ │ │ ├── RSXProg │ │ │ │ │ ├── RSXDefines2.glsl │ │ │ │ │ ├── RSXFragmentPrologue.glsl │ │ │ │ │ ├── RSXFragmentTextureDepthConversion.glsl │ │ │ │ │ ├── RSXFragmentTextureMSAAOps.glsl │ │ │ │ │ ├── RSXFragmentTextureMSAAOpsInternal.glsl │ │ │ │ │ ├── RSXFragmentTextureOps.glsl │ │ │ │ │ ├── RSXProgramCommon.glsl │ │ │ │ │ ├── RSXProgrammableBlendPrologue.glsl │ │ │ │ │ ├── RSXROPEpilogue.glsl │ │ │ │ │ ├── RSXROPPrologue.glsl │ │ │ │ │ ├── RSXVertexFetch.glsl │ │ │ │ │ └── RSXVertexPrologue.glsl │ │ │ │ ├── ShuffleBytes.glsl │ │ │ │ └── VideoOutCalibrationPass.glsl │ │ │ ├── GLSLTypes.h │ │ │ ├── MSAA │ │ │ │ ├── ColorResolvePass.glsl │ │ │ │ ├── ColorUnresolvePass.glsl │ │ │ │ ├── DepthResolvePass.glsl │ │ │ │ ├── DepthStencilResolvePass.glsl │ │ │ │ ├── DepthStencilUnresolvePass.glsl │ │ │ │ ├── DepthUnresolvePass.glsl │ │ │ │ ├── StencilResolvePass.glsl │ │ │ │ └── StencilUnresolvePass.glsl │ │ │ ├── ProgramStateCache.cpp │ │ │ ├── ProgramStateCache.h │ │ │ ├── RSXFragmentProgram.h │ │ │ ├── RSXOverlay.h │ │ │ ├── RSXVertexProgram.h │ │ │ ├── SPIRVCommon.cpp │ │ │ ├── SPIRVCommon.h │ │ │ ├── ShaderInterpreter.h │ │ │ ├── ShaderParam.h │ │ │ ├── Upscalers │ │ │ │ └── FSR1 │ │ │ │ │ ├── fsr_ffx_a_flattened.inc │ │ │ │ │ ├── fsr_ffx_fsr1_flattened.inc │ │ │ │ │ └── fsr_ubershader.glsl │ │ │ ├── VertexProgramDecompiler.cpp │ │ │ ├── VertexProgramDecompiler.h │ │ │ ├── program_util.cpp │ │ │ └── program_util.h │ │ ├── RSXDisAsm.cpp │ │ ├── RSXDisAsm.h │ │ ├── RSXFIFO.cpp │ │ ├── RSXFIFO.h │ │ ├── RSXOffload.cpp │ │ ├── RSXOffload.h │ │ ├── RSXTexture.cpp │ │ ├── RSXTexture.h │ │ ├── RSXThread.cpp │ │ ├── RSXThread.h │ │ ├── RSXZCULL.cpp │ │ ├── RSXZCULL.h │ │ ├── VK │ │ │ ├── VKAsyncScheduler.cpp │ │ │ ├── VKAsyncScheduler.h │ │ │ ├── VKCommandStream.cpp │ │ │ ├── VKCommandStream.h │ │ │ ├── VKCommonDecompiler.cpp │ │ │ ├── VKCommonDecompiler.h │ │ │ ├── VKCommonPipelineLayout.cpp │ │ │ ├── VKCommonPipelineLayout.h │ │ │ ├── VKCompute.cpp │ │ │ ├── VKCompute.h │ │ │ ├── VKDMA.cpp │ │ │ ├── VKDMA.h │ │ │ ├── VKDataHeapManager.cpp │ │ │ ├── VKDataHeapManager.h │ │ │ ├── VKDraw.cpp │ │ │ ├── VKFormats.cpp │ │ │ ├── VKFormats.h │ │ │ ├── VKFragmentProgram.cpp │ │ │ ├── VKFragmentProgram.h │ │ │ ├── VKFramebuffer.cpp │ │ │ ├── VKFramebuffer.h │ │ │ ├── VKGSRender.cpp │ │ │ ├── VKGSRender.h │ │ │ ├── VKGSRenderTypes.hpp │ │ │ ├── VKHelpers.cpp │ │ │ ├── VKHelpers.h │ │ │ ├── VKMemAlloc.cpp │ │ │ ├── VKOverlays.cpp │ │ │ ├── VKOverlays.h │ │ │ ├── VKPipelineCompiler.cpp │ │ │ ├── VKPipelineCompiler.h │ │ │ ├── VKPresent.cpp │ │ │ ├── VKProcTable.h │ │ │ ├── VKProgramBuffer.h │ │ │ ├── VKProgramPipeline.cpp │ │ │ ├── VKProgramPipeline.h │ │ │ ├── VKQueryPool.cpp │ │ │ ├── VKQueryPool.h │ │ │ ├── VKRenderPass.cpp │ │ │ ├── VKRenderPass.h │ │ │ ├── VKRenderTargets.cpp │ │ │ ├── VKRenderTargets.h │ │ │ ├── VKResolveHelper.cpp │ │ │ ├── VKResolveHelper.h │ │ │ ├── VKResourceManager.cpp │ │ │ ├── VKResourceManager.h │ │ │ ├── VKShaderInterpreter.cpp │ │ │ ├── VKShaderInterpreter.h │ │ │ ├── VKTexture.cpp │ │ │ ├── VKTextureCache.cpp │ │ │ ├── VKTextureCache.h │ │ │ ├── VKVertexBuffers.cpp │ │ │ ├── VKVertexProgram.cpp │ │ │ ├── VKVertexProgram.h │ │ │ ├── VulkanAPI.cpp │ │ │ ├── VulkanAPI.h │ │ │ ├── upscalers │ │ │ │ ├── bilinear_pass.hpp │ │ │ │ ├── fsr1 │ │ │ │ │ └── fsr_pass.cpp │ │ │ │ ├── fsr_pass.h │ │ │ │ ├── nearest_pass.hpp │ │ │ │ └── upscaling.h │ │ │ └── vkutils │ │ │ │ ├── barriers.cpp │ │ │ │ ├── barriers.h │ │ │ │ ├── buffer_object.cpp │ │ │ │ ├── buffer_object.h │ │ │ │ ├── chip_class.cpp │ │ │ │ ├── chip_class.h │ │ │ │ ├── commands.cpp │ │ │ │ ├── commands.h │ │ │ │ ├── data_heap.cpp │ │ │ │ ├── data_heap.h │ │ │ │ ├── descriptors.cpp │ │ │ │ ├── descriptors.h │ │ │ │ ├── device.cpp │ │ │ │ ├── device.h │ │ │ │ ├── framebuffer_object.hpp │ │ │ │ ├── garbage_collector.h │ │ │ │ ├── graphics_pipeline_state.hpp │ │ │ │ ├── image.cpp │ │ │ │ ├── image.h │ │ │ │ ├── image_helpers.cpp │ │ │ │ ├── image_helpers.h │ │ │ │ ├── instance.cpp │ │ │ │ ├── instance.h │ │ │ │ ├── memory.cpp │ │ │ │ ├── memory.h │ │ │ │ ├── pipeline_binding_table.h │ │ │ │ ├── query_pool.hpp │ │ │ │ ├── sampler.cpp │ │ │ │ ├── sampler.h │ │ │ │ ├── scratch.cpp │ │ │ │ ├── scratch.h │ │ │ │ ├── shared.cpp │ │ │ │ ├── shared.h │ │ │ │ ├── swapchain.cpp │ │ │ │ ├── swapchain.h │ │ │ │ ├── swapchain_android.hpp │ │ │ │ ├── swapchain_core.h │ │ │ │ ├── swapchain_macos.hpp │ │ │ │ ├── swapchain_unix.hpp │ │ │ │ ├── swapchain_win32.hpp │ │ │ │ ├── sync.cpp │ │ │ │ └── sync.h │ │ ├── color_utils.h │ │ ├── display.h │ │ ├── gcm_enums.cpp │ │ ├── gcm_enums.h │ │ ├── gcm_printing.cpp │ │ ├── gcm_printing.h │ │ ├── rsx_cache.h │ │ ├── rsx_decode.h │ │ ├── rsx_methods.cpp │ │ ├── rsx_methods.h │ │ ├── rsx_utils.cpp │ │ ├── rsx_utils.h │ │ ├── rsx_vertex_data.cpp │ │ └── rsx_vertex_data.h │ ├── System.cpp │ ├── System.h │ ├── VFS.cpp │ ├── VFS.h │ ├── cache_utils.cpp │ ├── cache_utils.hpp │ ├── config_mode.h │ ├── games_config.cpp │ ├── games_config.h │ ├── localized_string.cpp │ ├── localized_string.h │ ├── localized_string_id.h │ ├── perf_meter.cpp │ ├── perf_meter.hpp │ ├── perf_monitor.cpp │ ├── perf_monitor.hpp │ ├── savestate_utils.cpp │ ├── savestate_utils.hpp │ ├── scoped_progress_dialog.cpp │ ├── stb_image.cpp │ ├── system_config.cpp │ ├── system_config.h │ ├── system_config_types.cpp │ ├── system_config_types.h │ ├── system_progress.cpp │ ├── system_progress.hpp │ ├── system_utils.cpp │ ├── system_utils.hpp │ ├── title.cpp │ ├── title.h │ ├── vfs_config.cpp │ └── vfs_config.h ├── GLGSRender.vcxproj ├── GLGSRender.vcxproj.filters ├── Icons │ ├── DualShock_3.svg │ ├── combo_config_bordered.png │ ├── configure.png │ ├── controllers.png │ ├── custom_config.png │ ├── exit_fullscreen.png │ ├── fullscreen.png │ ├── grid.png │ ├── list.png │ ├── open.png │ ├── pause.png │ ├── play.png │ ├── refresh.png │ ├── restart.png │ └── stop.png ├── Input │ ├── basic_keyboard_handler.cpp │ ├── basic_keyboard_handler.h │ ├── basic_mouse_handler.cpp │ ├── basic_mouse_handler.h │ ├── ds3_pad_handler.cpp │ ├── ds3_pad_handler.h │ ├── ds4_pad_handler.cpp │ ├── ds4_pad_handler.h │ ├── dualsense_pad_handler.cpp │ ├── dualsense_pad_handler.h │ ├── evdev_joystick_handler.cpp │ ├── evdev_joystick_handler.h │ ├── gui_pad_thread.cpp │ ├── gui_pad_thread.h │ ├── hid_pad_handler.cpp │ ├── hid_pad_handler.h │ ├── keyboard_pad_handler.cpp │ ├── keyboard_pad_handler.h │ ├── mm_joystick_handler.cpp │ ├── mm_joystick_handler.h │ ├── pad_thread.cpp │ ├── pad_thread.h │ ├── product_info.cpp │ ├── product_info.h │ ├── ps_move_calibration.cpp │ ├── ps_move_calibration.h │ ├── ps_move_config.cpp │ ├── ps_move_config.h │ ├── ps_move_handler.cpp │ ├── ps_move_handler.h │ ├── ps_move_tracker.cpp │ ├── ps_move_tracker.h │ ├── raw_mouse_config.cpp │ ├── raw_mouse_config.h │ ├── raw_mouse_handler.cpp │ ├── raw_mouse_handler.h │ ├── sdl_instance.cpp │ ├── sdl_instance.h │ ├── sdl_pad_handler.cpp │ ├── sdl_pad_handler.h │ ├── skateboard_pad_handler.cpp │ ├── skateboard_pad_handler.h │ ├── xinput_pad_handler.cpp │ └── xinput_pad_handler.h ├── Loader │ ├── ELF.cpp │ ├── ELF.h │ ├── PSF.cpp │ ├── PSF.h │ ├── PUP.cpp │ ├── PUP.h │ ├── TAR.cpp │ ├── TAR.h │ ├── TROPUSR.cpp │ ├── TROPUSR.h │ ├── TRP.cpp │ ├── TRP.h │ ├── disc.cpp │ ├── disc.h │ ├── mself.cpp │ └── mself.hpp ├── VKGSRender.vcxproj ├── VKGSRender.vcxproj.filters ├── XAudio.vcxproj ├── XAudio.vcxproj.filters ├── display_sleep_control.cpp ├── display_sleep_control.h ├── emucore.vcxproj ├── emucore.vcxproj.filters ├── frame_icon.xpm ├── git-version.cmake ├── headless_application.cpp ├── headless_application.h ├── main.cpp ├── main_application.cpp ├── main_application.h ├── module_verifier.cpp ├── module_verifier.hpp ├── qt │ └── etc │ │ └── qt.conf ├── resource.h ├── resources.qrc ├── rpcs3.cpp ├── rpcs3.desktop ├── rpcs3.h ├── rpcs3.icns ├── rpcs3.ico ├── rpcs3.metainfo.xml ├── rpcs3.plist.in ├── rpcs3.png ├── rpcs3.rc ├── rpcs3.svg ├── rpcs3.vcxproj ├── rpcs3.vcxproj.filters ├── rpcs3_version.cpp ├── rpcs3_version.h ├── rpcs3qt │ ├── CMakeLists.txt │ ├── _discord_utils.cpp │ ├── _discord_utils.h │ ├── about_dialog.cpp │ ├── about_dialog.h │ ├── about_dialog.ui │ ├── auto_pause_settings_dialog.cpp │ ├── auto_pause_settings_dialog.h │ ├── basic_mouse_settings_dialog.cpp │ ├── basic_mouse_settings_dialog.h │ ├── breakpoint_handler.cpp │ ├── breakpoint_handler.h │ ├── breakpoint_list.cpp │ ├── breakpoint_list.h │ ├── call_stack_list.cpp │ ├── call_stack_list.h │ ├── camera_settings_dialog.cpp │ ├── camera_settings_dialog.h │ ├── camera_settings_dialog.ui │ ├── category.h │ ├── cg_disasm_window.cpp │ ├── cg_disasm_window.h │ ├── cheat_manager.cpp │ ├── cheat_manager.h │ ├── config_adapter.cpp │ ├── config_adapter.h │ ├── config_checker.cpp │ ├── config_checker.h │ ├── curl_handle.cpp │ ├── curl_handle.h │ ├── custom_dialog.cpp │ ├── custom_dialog.h │ ├── custom_dock_widget.h │ ├── custom_table_widget_item.cpp │ ├── custom_table_widget_item.h │ ├── debugger_add_bp_window.cpp │ ├── debugger_add_bp_window.h │ ├── debugger_frame.cpp │ ├── debugger_frame.h │ ├── debugger_list.cpp │ ├── debugger_list.h │ ├── dimensions_dialog.cpp │ ├── dimensions_dialog.h │ ├── downloader.cpp │ ├── downloader.h │ ├── elf_memory_dumping_dialog.cpp │ ├── elf_memory_dumping_dialog.h │ ├── emu_settings.cpp │ ├── emu_settings.h │ ├── emu_settings_type.h │ ├── emulated_logitech_g27_settings_dialog.cpp │ ├── emulated_logitech_g27_settings_dialog.h │ ├── emulated_pad_settings_dialog.cpp │ ├── emulated_pad_settings_dialog.h │ ├── fatal_error_dialog.cpp │ ├── fatal_error_dialog.h │ ├── find_dialog.cpp │ ├── find_dialog.h │ ├── flow_layout.cpp │ ├── flow_layout.h │ ├── flow_widget.cpp │ ├── flow_widget.h │ ├── flow_widget_item.cpp │ ├── flow_widget_item.h │ ├── game_compatibility.cpp │ ├── game_compatibility.h │ ├── game_list.cpp │ ├── game_list.h │ ├── game_list_base.cpp │ ├── game_list_base.h │ ├── game_list_delegate.cpp │ ├── game_list_delegate.h │ ├── game_list_frame.cpp │ ├── game_list_frame.h │ ├── game_list_grid.cpp │ ├── game_list_grid.h │ ├── game_list_grid_item.cpp │ ├── game_list_grid_item.h │ ├── game_list_table.cpp │ ├── game_list_table.h │ ├── gl_gs_frame.cpp │ ├── gl_gs_frame.h │ ├── gs_frame.cpp │ ├── gs_frame.h │ ├── gui_application.cpp │ ├── gui_application.h │ ├── gui_game_info.cpp │ ├── gui_game_info.h │ ├── gui_save.h │ ├── gui_settings.cpp │ ├── gui_settings.h │ ├── hex_validator.h │ ├── infinity_dialog.cpp │ ├── infinity_dialog.h │ ├── input_dialog.cpp │ ├── input_dialog.h │ ├── instruction_editor_dialog.cpp │ ├── instruction_editor_dialog.h │ ├── ipc_settings_dialog.cpp │ ├── ipc_settings_dialog.h │ ├── kernel_explorer.cpp │ ├── kernel_explorer.h │ ├── localized.cpp │ ├── localized.h │ ├── localized_emu.cpp │ ├── localized_emu.h │ ├── log_frame.cpp │ ├── log_frame.h │ ├── log_viewer.cpp │ ├── log_viewer.h │ ├── main_window.cpp │ ├── main_window.h │ ├── main_window.ui │ ├── memory_string_searcher.cpp │ ├── memory_viewer_panel.cpp │ ├── memory_viewer_panel.h │ ├── microphone_creator.cpp │ ├── microphone_creator.h │ ├── midi_creator.cpp │ ├── midi_creator.h │ ├── movie_item.cpp │ ├── movie_item.h │ ├── movie_item_base.cpp │ ├── movie_item_base.h │ ├── msg_dialog_frame.cpp │ ├── msg_dialog_frame.h │ ├── music_player_dialog.cpp │ ├── music_player_dialog.h │ ├── music_player_dialog.ui │ ├── numbered_widget_item.h │ ├── osk_dialog_frame.cpp │ ├── osk_dialog_frame.h │ ├── pad_device_info.h │ ├── pad_led_settings_dialog.cpp │ ├── pad_led_settings_dialog.h │ ├── pad_led_settings_dialog.ui │ ├── pad_motion_settings_dialog.cpp │ ├── pad_motion_settings_dialog.h │ ├── pad_motion_settings_dialog.ui │ ├── pad_settings_dialog.cpp │ ├── pad_settings_dialog.h │ ├── pad_settings_dialog.ui │ ├── patch_creator_dialog.cpp │ ├── patch_creator_dialog.h │ ├── patch_creator_dialog.ui │ ├── patch_manager_dialog.cpp │ ├── patch_manager_dialog.h │ ├── patch_manager_dialog.ui │ ├── permissions.cpp │ ├── permissions.h │ ├── persistent_settings.cpp │ ├── persistent_settings.h │ ├── pkg_install_dialog.cpp │ ├── pkg_install_dialog.h │ ├── progress_dialog.cpp │ ├── progress_dialog.h │ ├── progress_indicator.cpp │ ├── progress_indicator.h │ ├── ps_move_tracker_dialog.cpp │ ├── ps_move_tracker_dialog.h │ ├── ps_move_tracker_dialog.ui │ ├── qt_camera_handler.cpp │ ├── qt_camera_handler.h │ ├── qt_camera_video_sink.cpp │ ├── qt_camera_video_sink.h │ ├── qt_music_handler.cpp │ ├── qt_music_handler.h │ ├── qt_utils.cpp │ ├── qt_utils.h │ ├── qt_video_source.cpp │ ├── qt_video_source.h │ ├── raw_mouse_settings_dialog.cpp │ ├── raw_mouse_settings_dialog.h │ ├── recvmessage_dialog_frame.cpp │ ├── recvmessage_dialog_frame.h │ ├── register_editor_dialog.cpp │ ├── register_editor_dialog.h │ ├── render_creator.cpp │ ├── render_creator.h │ ├── richtext_item_delegate.h │ ├── rpcn_settings_dialog.cpp │ ├── rpcn_settings_dialog.h │ ├── rsx_debugger.cpp │ ├── rsx_debugger.h │ ├── save_data_dialog.cpp │ ├── save_data_dialog.h │ ├── save_data_info_dialog.cpp │ ├── save_data_info_dialog.h │ ├── save_data_list_dialog.cpp │ ├── save_data_list_dialog.h │ ├── save_manager_dialog.cpp │ ├── save_manager_dialog.h │ ├── savestate_manager_dialog.cpp │ ├── savestate_manager_dialog.h │ ├── screenshot_item.cpp │ ├── screenshot_item.h │ ├── screenshot_manager_dialog.cpp │ ├── screenshot_manager_dialog.h │ ├── screenshot_preview.cpp │ ├── screenshot_preview.h │ ├── sendmessage_dialog_frame.cpp │ ├── sendmessage_dialog_frame.h │ ├── settings.cpp │ ├── settings.h │ ├── settings_dialog.cpp │ ├── settings_dialog.h │ ├── settings_dialog.ui │ ├── shortcut_dialog.cpp │ ├── shortcut_dialog.h │ ├── shortcut_dialog.ui │ ├── shortcut_handler.cpp │ ├── shortcut_handler.h │ ├── shortcut_settings.cpp │ ├── shortcut_settings.h │ ├── shortcut_utils.cpp │ ├── shortcut_utils.h │ ├── skylander_dialog.cpp │ ├── skylander_dialog.h │ ├── stylesheets.h │ ├── syntax_highlighter.cpp │ ├── syntax_highlighter.h │ ├── system_cmd_dialog.cpp │ ├── system_cmd_dialog.h │ ├── table_item_delegate.cpp │ ├── table_item_delegate.h │ ├── tooltips.cpp │ ├── tooltips.h │ ├── trophy_manager_dialog.cpp │ ├── trophy_manager_dialog.h │ ├── trophy_notification_frame.cpp │ ├── trophy_notification_frame.h │ ├── trophy_notification_helper.cpp │ ├── trophy_notification_helper.h │ ├── update_manager.cpp │ ├── update_manager.h │ ├── user_account.cpp │ ├── user_account.h │ ├── user_manager_dialog.cpp │ ├── user_manager_dialog.h │ ├── uuid.cpp │ ├── uuid.h │ ├── vfs_dialog.cpp │ ├── vfs_dialog.h │ ├── vfs_dialog_path_widget.cpp │ ├── vfs_dialog_path_widget.h │ ├── vfs_dialog_tab.cpp │ ├── vfs_dialog_tab.h │ ├── vfs_dialog_usb_input.cpp │ ├── vfs_dialog_usb_input.h │ ├── vfs_dialog_usb_tab.cpp │ ├── vfs_dialog_usb_tab.h │ ├── vfs_tool_dialog.cpp │ ├── vfs_tool_dialog.h │ ├── vfs_tool_dialog.ui │ ├── video_label.cpp │ ├── video_label.h │ ├── welcome_dialog.cpp │ ├── welcome_dialog.h │ └── welcome_dialog.ui ├── stdafx.cpp ├── stdafx.h ├── tests │ ├── packages.config │ ├── rpcs3_test.vcxproj │ ├── test.cpp │ ├── test_address_range.cpp │ ├── test_fmt.cpp │ └── test_simple_array.cpp ├── update_helper.sh ├── util │ ├── asm.hpp │ ├── atomic.cpp │ ├── atomic.hpp │ ├── auto_typemap.hpp │ ├── bless.hpp │ ├── console.cpp │ ├── console.h │ ├── coro.hpp │ ├── cpu_stats.cpp │ ├── cpu_stats.hpp │ ├── dyn_lib.cpp │ ├── dyn_lib.hpp │ ├── emu_utils.cpp │ ├── endian.hpp │ ├── fence.hpp │ ├── fifo_mutex.hpp │ ├── fixed_typemap.hpp │ ├── fnv_hash.hpp │ ├── init_mutex.hpp │ ├── logs.cpp │ ├── logs.hpp │ ├── media_utils.cpp │ ├── media_utils.h │ ├── serialization.hpp │ ├── serialization_ext.cpp │ ├── serialization_ext.hpp │ ├── shared_ptr.hpp │ ├── simd.hpp │ ├── slow_mutex.hpp │ ├── sysinfo.cpp │ ├── sysinfo.hpp │ ├── to_endian.hpp │ ├── tsc.hpp │ ├── typeindices.hpp │ ├── types.hpp │ ├── v128.hpp │ ├── video_provider.cpp │ ├── video_provider.h │ ├── video_sink.h │ ├── video_source.h │ ├── vm.hpp │ ├── vm_native.cpp │ ├── yaml.cpp │ └── yaml.hpp └── windows.qrc └── usertype.dat /.ci/build-freebsd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | # Pull all the submodules except llvm, opencv, libpng, sdl and curl 4 | # Note: Tried to use git submodule status, but it takes over 20 seconds 5 | # shellcheck disable=SC2046 6 | git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ && !/opencv/ && !/libpng/ && !/libsdl-org/ && !/curl/ { print $3 }' .gitmodules) 7 | 8 | CONFIGURE_ARGS=" 9 | -DWITH_LLVM=ON 10 | -DUSE_SDL=OFF 11 | -DUSE_PRECOMPILED_HEADERS=OFF 12 | -DUSE_NATIVE_INSTRUCTIONS=OFF 13 | -DUSE_SYSTEM_FFMPEG=ON 14 | -DUSE_SYSTEM_CURL=ON 15 | -DUSE_SYSTEM_LIBPNG=ON 16 | -DUSE_SYSTEM_OPENCV=ON 17 | " 18 | 19 | # base Clang workaround (missing clang-scan-deps) 20 | CONFIGURE_ARGS="$CONFIGURE_ARGS -DCMAKE_CXX_SCAN_FOR_MODULES=OFF" 21 | 22 | # shellcheck disable=SC2086 23 | cmake -B build -G Ninja $CONFIGURE_ARGS 24 | cmake --build build 25 | 26 | ccache --show-stats 27 | ccache --zero-stats 28 | -------------------------------------------------------------------------------- /.ci/docker.env: -------------------------------------------------------------------------------- 1 | # Variables set by Azure Pipelines 2 | CI_HAS_ARTIFACTS 3 | BUILD_REASON 4 | BUILD_SOURCEVERSION 5 | BUILD_ARTIFACTSTAGINGDIRECTORY 6 | BUILD_REPOSITORY_NAME 7 | BUILD_SOURCEBRANCHNAME 8 | APPDIR 9 | ARTDIR 10 | RELEASE_MESSAGE 11 | RUN_UNIT_TESTS 12 | # Variables for build matrix 13 | COMPILER 14 | DEPLOY_APPIMAGE 15 | # Private variables 16 | GITHUB_TOKEN 17 | -------------------------------------------------------------------------------- /.ci/export-azure-vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Export variables for later stages of the Azure pipeline 4 | # Values done in this manner will appear as environment variables 5 | # in later stages. 6 | 7 | # From pure-sh-bible 8 | # Setting 'IFS' tells 'read' where to split the string. 9 | while IFS='=' read -r key val; do 10 | # Skip over lines containing comments. 11 | [ "${key##\#*}" ] || continue 12 | echo "##vso[task.setvariable variable=$key]$val" 13 | done < ".ci/ci-vars.env" 14 | -------------------------------------------------------------------------------- /.ci/export-cirrus-vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Export variables for later stages of the Cirrus pipeline 4 | # Values done in this manner will appear as environment variables 5 | # in later stages. 6 | 7 | # From pure-sh-bible 8 | # Setting 'IFS' tells 'read' where to split the string. 9 | while IFS='=' read -r key val; do 10 | # Skip over lines containing comments. 11 | [ "${key##\#*}" ] || continue 12 | export "$key"="$val" 13 | done < ".ci/ci-vars.env" 14 | -------------------------------------------------------------------------------- /.ci/generate-qt-ts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | mkdir -p ../translations 4 | 5 | LUPDATE_PATH=$(find /usr -name lupdate -type f 2>/dev/null | head -n 1) 6 | if [ -z "$LUPDATE_PATH" ]; then 7 | echo "Error: lupdate not found!" 8 | exit 1 9 | else 10 | echo "lupdate found at: $LUPDATE_PATH" 11 | $LUPDATE_PATH -recursive . -ts ../translations/rpcs3_template.ts 12 | sed -i 's|filename="\.\./|filename="./|g' ../translations/rpcs3_template.ts 13 | fi -------------------------------------------------------------------------------- /.ci/get_keys-windows.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | curl -fLo "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-${LLVM_VER}/llvmlibs_mt.7z.sha256" 4 | -------------------------------------------------------------------------------- /.ci/install-freebsd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S su -m root -ex 2 | # NOTE: this script is run under root permissions 3 | # shellcheck shell=sh disable=SC2096 4 | 5 | # RPCS3 often needs recent Qt and Vulkan-Headers 6 | sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf 7 | 8 | export ASSUME_ALWAYS_YES=true 9 | pkg info # debug 10 | 11 | # WITH_LLVM 12 | pkg install "llvm$LLVM_COMPILER_VER" 13 | 14 | # Mandatory dependencies (qtX-base is pulled via qtX-multimedia) 15 | pkg install git ccache cmake ninja "qt$QT_VER_MAIN-multimedia" "qt$QT_VER_MAIN-svg" glew openal-soft ffmpeg 16 | 17 | # Optional dependencies (libevdev is pulled by qtX-base) 18 | pkg install pkgconf alsa-lib pulseaudio sdl3 evdev-proto vulkan-headers vulkan-loader 19 | -------------------------------------------------------------------------------- /.ci/optimize-mac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | file_path=$(find "$1/Contents/MacOS" -type f -print0 | head -n 1) 4 | 5 | if [ -z "$file_path" ]; then 6 | echo "No executable file found in $1/Contents/MacOS" >&2 7 | exit 1 8 | fi 9 | 10 | 11 | target_architecture="$(lipo "$file_path" -archs)" 12 | 13 | if [ -z "$target_architecture" ]; then 14 | exit 1 15 | fi 16 | 17 | # shellcheck disable=SC3045 18 | find "$1" -type f -print0 | while IFS= read -r -d '' file; do 19 | echo Thinning "$file" -> "$target_architecture" 20 | lipo "$file" -thin "$target_architecture" -output "$file" || true 21 | done 22 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{h,cpp,hpp}] 4 | charset = utf-8 5 | indent_style = tab 6 | indent_size = 4 7 | trim_trailing_whitespace = true 8 | -------------------------------------------------------------------------------- /.gdbinit: -------------------------------------------------------------------------------- 1 | handle SIGSEGV nostop noprint 2 | handle SIGPIPE nostop noprint 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: Nekotekina 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/4-advanced.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Advanced 3 | about: For developers and experienced users only 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.gg/rpcs3) or [forums](https://forums.rpcs3.net/) instead. 11 | 12 | You're using the advanced template. You're expected to know what to write in order to fill in all the required information for proper report. 13 | 14 | If you're unsure on what to do, please return back to the issue type selection and choose different category. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Quickstart guide 4 | url: https://rpcs3.net/quickstart 5 | about: Everything you need to know to install and configure emulator, and add games 6 | - name: Ask for help 7 | url: https://discord.gg/rpcs3 8 | about: If you have some questions or need help, please use our Discord server instead of GitHub 9 | - name: Report game compatibility 10 | url: https://forums.rpcs3.net/thread-196671.html 11 | about: Please use RPCS3 forums to submit or update game compatibility status -------------------------------------------------------------------------------- /.github/workflows/qt-ts.yml: -------------------------------------------------------------------------------- 1 | name: Generate Translation Template 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - master 8 | paths: 9 | - 'rpcs3/**' 10 | 11 | jobs: 12 | Generate_Translation_Template: 13 | name: Generate Translation Template 14 | runs-on: ubuntu-24.04 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@main 18 | 19 | - name: Install Qt Tools 20 | run: | 21 | sudo apt update 22 | sudo apt install -y qt6-l10n-tools 23 | 24 | - name: Generate .ts file using lupdate (Qt) 25 | working-directory: rpcs3 26 | run: | 27 | ../.ci/generate-qt-ts.sh 28 | 29 | - name: Upload translation template 30 | uses: actions/upload-artifact@main 31 | with: 32 | name: RPCS3_Translation_Template 33 | path: translations/rpcs3_template.ts 34 | compression-level: 0 -------------------------------------------------------------------------------- /3rdparty/MoltenVK/.gitignore: -------------------------------------------------------------------------------- 1 | .ninja_log 2 | build.ninja 3 | cmake_install.cmake 4 | CMakeCache.txt 5 | CMakeFiles 6 | MoltenVK 7 | moltenvk-prefix 8 | -------------------------------------------------------------------------------- /3rdparty/MoltenVK/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(moltenvk NONE) 2 | include(ExternalProject) 3 | 4 | ExternalProject_Add(moltenvk 5 | GIT_REPOSITORY https://github.com/KhronosGroup/MoltenVK.git 6 | GIT_TAG 49b97f2 7 | BUILD_IN_SOURCE 1 8 | SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK 9 | CONFIGURE_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/fetchDependencies" --macos 10 | BUILD_COMMAND xcodebuild build -quiet -project "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/MoltenVKPackaging.xcodeproj" -scheme "MoltenVK Package \(macOS only\)" -configuration "Release" -arch "${CMAKE_HOST_SYSTEM_PROCESSOR}" 11 | COMMAND ln -f "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/MoltenVK/dylib/macOS/libMoltenVK.dylib" "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/Build/Products/Release/dynamic/libMoltenVK.dylib" 12 | INSTALL_COMMAND "" 13 | BUILD_BYPRODUCTS "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/Build/Products/Release/dynamic/libMoltenVK.dylib" 14 | ) 15 | -------------------------------------------------------------------------------- /3rdparty/OpenAL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # OpenAL 2 | if(USE_SYSTEM_OPENAL) 3 | if(WIN32) 4 | find_package(OpenAL CONFIG REQUIRED) 5 | else() 6 | find_package(OpenAL REQUIRED) 7 | endif() 8 | add_library(3rdparty_openal INTERFACE) 9 | target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL) 10 | set_target_properties(OpenAL::OpenAL PROPERTIES IMPORTED_GLOBAL ON) 11 | else() 12 | option(ALSOFT_UTILS "Build utility programs" OFF) 13 | option(ALSOFT_EXAMPLES "Build example programs" OFF) 14 | add_subdirectory(openal-soft EXCLUDE_FROM_ALL) 15 | add_library(3rdparty_openal INTERFACE) 16 | target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL) 17 | endif() 18 | -------------------------------------------------------------------------------- /3rdparty/asmjit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(ASMJIT_EMBED TRUE) 2 | set(ASMJIT_STATIC TRUE) 3 | set(ASMJIT_BUILD_X86 TRUE) 4 | set(ASMJIT_BUILD_ARM FALSE) 5 | set(ASMJIT_BUILD_TEST FALSE) 6 | set(ASMJIT_NO_DEPRECATED TRUE) 7 | set(ASMJIT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/asmjit" CACHE PATH "Location of 'asmjit'") 8 | 9 | include("${ASMJIT_DIR}/CMakeLists.txt") 10 | 11 | add_library(asmjit ${ASMJIT_SRC}) 12 | target_include_directories(asmjit PUBLIC ${ASMJIT_DIR}/src) 13 | target_link_libraries(asmjit PRIVATE ${ASMJIT_DEPS}) 14 | 15 | # ASMJIT should have a option for disabling installing and this wouldnt 16 | # be required to avoid installing ASMJIT... 17 | 18 | set_property(TARGET asmjit PROPERTY FOLDER "3rdparty/") 19 | add_library(3rdparty::asmjit ALIAS asmjit) 20 | -------------------------------------------------------------------------------- /3rdparty/cubeb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Cubeb 2 | 3 | set(BUILD_SHARED_LIBS FALSE CACHE BOOL "Don't build shared libs") 4 | set(BUILD_TESTS FALSE CACHE BOOL "Don't build tests") 5 | set(BUILD_RUST_LIBS FALSE CACHE BOOL "Don't build rust libs") 6 | set(BUILD_TOOLS FALSE CACHE BOOL "Don't build tools") 7 | set(BUNDLE_SPEEX TRUE CACHE BOOL "Bundle the speex library") 8 | set(LAZY_LOAD_LIBS TRUE CACHE BOOL "Lazily load shared libraries") 9 | set(USE_SANITIZERS FALSE CACHE BOOL "Dont't use sanitizers") 10 | 11 | add_subdirectory(cubeb EXCLUDE_FROM_ALL) 12 | add_library(3rdparty::cubeb ALIAS cubeb) 13 | 14 | if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|ARM|aarch64|AArch64|Aarch64)") 15 | target_compile_definitions(speex PUBLIC 16 | #_USE_NEON 17 | ) 18 | elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86|X86|amd64|AMD64|em64t|EM64T)") 19 | target_compile_definitions(speex PUBLIC 20 | _USE_SSE 21 | _USE_SSE2 22 | ) 23 | endif () 24 | -------------------------------------------------------------------------------- /3rdparty/cubeb/extra/cubeb_export.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define CUBEB_EXPORT 4 | -------------------------------------------------------------------------------- /3rdparty/discord-rpc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # DiscordRPC 2 | 3 | add_library(3rdparty_discordRPC INTERFACE) 4 | 5 | if (USE_DISCORD_RPC AND (WIN32 OR CMAKE_SYSTEM MATCHES "Linux" OR APPLE)) 6 | set(BUILD_EXAMPLES FALSE CACHE BOOL "Build example apps") 7 | set(ENABLE_IO_THREAD TRUE CACHE BOOL "Start up a separate I/O thread, otherwise I'd need to call an update function") 8 | set(USE_STATIC_CRT FALSE CACHE BOOL "Use /MT[d] for dynamic library") 9 | set(WARNINGS_AS_ERRORS FALSE CACHE BOOL "When enabled, compiles with `-Werror` (on *nix platforms).") 10 | 11 | add_subdirectory(discord-rpc EXCLUDE_FROM_ALL) 12 | target_include_directories(3rdparty_discordRPC INTERFACE discord-rpc/include) 13 | target_compile_definitions(3rdparty_discordRPC INTERFACE -DWITH_DISCORD_RPC) 14 | target_link_libraries(3rdparty_discordRPC INTERFACE discord-rpc) 15 | endif() 16 | -------------------------------------------------------------------------------- /3rdparty/fusion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # To avoid python numpy dependency in debug build, force release build of this library 2 | set(ORIG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) 3 | set(CMAKE_BUILD_TYPE Release) 4 | add_subdirectory(fusion EXCLUDE_FROM_ALL) 5 | set(CMAKE_BUILD_TYPE ${ORIG_BUILD_TYPE}) 6 | -------------------------------------------------------------------------------- /3rdparty/glslang/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /x64 3 | -------------------------------------------------------------------------------- /3rdparty/glslang/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #glslang 2 | 3 | set(ENABLE_PCH OFF CACHE BOOL "Enables Precompiled header" FORCE) 4 | set(BUILD_EXTERNAL OFF CACHE BOOL "Build external dependencies in /External" FORCE) 5 | set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "Skip installation" FORCE) 6 | set(ENABLE_SPVREMAPPER OFF CACHE BOOL "Enables building of SPVRemapper" FORCE) 7 | set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "Builds glslangValidator and spirv-remap" FORCE) 8 | set(ENABLE_HLSL OFF CACHE BOOL "Enables HLSL input support" FORCE) 9 | set(ENABLE_OPT OFF CACHE BOOL "Enables spirv-opt capability if present" FORCE) 10 | set(ENABLE_CTEST OFF CACHE BOOL "Enables testing" FORCE) 11 | add_subdirectory(glslang) 12 | -------------------------------------------------------------------------------- /3rdparty/glslang/glslang.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /3rdparty/hidapi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # hidapi 2 | set(BUILD_SHARED_LIBS FALSE CACHE BOOL "Don't build shared libs") 3 | set(HIDAPI_INSTALL_TARGETS FALSE CACHE BOOL "Don't install anything") 4 | 5 | if(CMAKE_SYSTEM MATCHES "Linux") 6 | set(HIDAPI_WITH_LIBUSB FALSE CACHE BOOL "Don't build with libusb for linux") 7 | endif() 8 | 9 | add_library(3rdparty_hidapi INTERFACE) 10 | add_subdirectory(hidapi EXCLUDE_FROM_ALL) 11 | 12 | if(APPLE) 13 | target_link_libraries(3rdparty_hidapi INTERFACE hidapi_darwin "-framework CoreFoundation" "-framework IOKit") 14 | elseif(CMAKE_SYSTEM MATCHES "Linux") 15 | target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hidraw udev) 16 | elseif(WIN32) 17 | target_link_libraries(3rdparty_hidapi INTERFACE hidapi::hidapi hidapi::include Shlwapi.lib) 18 | elseif(ANDROID) 19 | target_link_libraries(3rdparty_hidapi INTERFACE hidapi::libusb) 20 | else() 21 | target_link_libraries(3rdparty_hidapi INTERFACE hidapi-libusb usb) 22 | endif() 23 | -------------------------------------------------------------------------------- /3rdparty/libpng/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # libPNG 2 | # Select the version of libpng to use, default is builtin 3 | if (NOT USE_SYSTEM_LIBPNG) 4 | # We use libpng's static library and don't need to build the shared library and run the tests 5 | set(PNG_SHARED OFF CACHE BOOL "Build shared lib") 6 | set(PNG_TESTS OFF CACHE BOOL "Build libpng tests") 7 | set(SKIP_INSTALL_ALL ON) 8 | add_subdirectory(libpng EXCLUDE_FROM_ALL) 9 | target_include_directories(png_static INTERFACE "${libpng_BINARY_DIR}" "${libpng_SOURCE_DIR}") 10 | 11 | set(LIBPNG_TARGET png_static PARENT_SCOPE) 12 | else() 13 | find_package(PNG REQUIRED) 14 | 15 | add_library(3rdparty_system_libpng INTERFACE) 16 | target_include_directories(3rdparty_system_libpng INTERFACE ${PNG_INCLUDE_DIR}) 17 | target_link_libraries(3rdparty_system_libpng INTERFACE ${PNG_LIBRARY}) 18 | target_compile_definitions(3rdparty_system_libpng INTERFACE ${PNG_DEFINITIONS}) 19 | 20 | set(LIBPNG_TARGET 3rdparty_system_libpng PARENT_SCOPE) 21 | endif() 22 | -------------------------------------------------------------------------------- /3rdparty/libsdl-org/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(SDL_SHARED "Build a shared version of the library" OFF) 2 | option(SDL_STATIC "Build a static version of the library" ON) 3 | option(SDL_TEST_LIBRARY "Build the SDL3_test library" OFF) 4 | add_subdirectory(SDL EXCLUDE_FROM_ALL) 5 | -------------------------------------------------------------------------------- /3rdparty/libusb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(libusb) 2 | 3 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") 4 | set(LIBUSB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libusb) 5 | 6 | 7 | option(WITH_DEBUG_LOG "enable debug logging" OFF) 8 | # if debug logging is enabled, by default enable logging 9 | option(WITH_LOGGING "if false, disable all logging" ON) 10 | option(WITHOUT_PTHREADS "force pthreads to not be used. if on, then they are used based on detection logic" OFF) 11 | 12 | set(LIBUSB_MAJOR 1) 13 | set(LIBUSB_MINOR 0) 14 | set(LIBUSB_MICRO 26) 15 | 16 | macro(append_compiler_flags) 17 | foreach(FLAG IN ITEMS ${ARGN}) 18 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}") 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") 20 | endforeach() 21 | endmacro() 22 | 23 | include(libusb.cmake) 24 | -------------------------------------------------------------------------------- /3rdparty/libusb/cmake_modules/FindCoreFoundation.cmake: -------------------------------------------------------------------------------- 1 | # CoreFoundation_INCLUDE_DIR 2 | # CoreFoundation_LIBRARIES 3 | # CoreFoundation_FOUND 4 | include(LibFindMacros) 5 | 6 | find_path(CoreFoundation_INCLUDE_DIR 7 | CoreFoundation.h 8 | PATH_SUFFIXES CoreFoundation 9 | ) 10 | 11 | find_library(CoreFoundation_LIBRARY 12 | NAMES CoreFoundation 13 | ) 14 | 15 | set(CoreFoundation_PROCESS_INCLUDES CoreFoundation_INCLUDE_DIR) 16 | set(CoreFoundation_PROCESS_LIBS CoreFoundation_LIBRARY) 17 | libfind_process(CoreFoundation) 18 | -------------------------------------------------------------------------------- /3rdparty/libusb/cmake_modules/FindIOKit.cmake: -------------------------------------------------------------------------------- 1 | # IOKit_INCLUDE_DIR 2 | # IOKit_LIBRARIES 3 | # IOKit_FOUND 4 | include(LibFindMacros) 5 | 6 | # IOKit depends on CoreFoundation 7 | find_package(CoreFoundation REQUIRED) 8 | 9 | find_path(IOKit_INCLUDE_DIR 10 | IOKitLib.h 11 | PATH_SUFFIXES IOKit 12 | ) 13 | 14 | find_library(IOKit_LIBRARY 15 | NAMES IOKit 16 | ) 17 | 18 | set(IOKit_PROCESS_INCLUDES IOKit_INCLUDE_DIR CoreFoundation_INCLUDE_DIR) 19 | set(IOKit_PROCESS_LIBS IOKit_LIBRARY CoreFoundation_LIBRARIES) 20 | libfind_process(IOKit) 21 | -------------------------------------------------------------------------------- /3rdparty/libusb/libusb-1.0.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=@CMAKE_INSTALL_PREFIX@/lib@ 3 | includedir=@CMAKE_INSTALL_PREFIX@/include@ 4 | 5 | Name: libusb-1.0 6 | Description: C API for USB device access from Linux, Mac OS X and Windows userspace 7 | Version: @VERSION@ 8 | Libs: -L${libdir} -lusb-1.0 9 | Libs.private: @LIBUSB_LIB_DEPENDS@ 10 | Cflags: -I${includedir}/libusb-1.0 11 | 12 | -------------------------------------------------------------------------------- /3rdparty/llvm/llvm_build.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /3rdparty/llvm/llvm_build_clang_cl.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {fad608c4-4182-4423-85ed-9d1813b9c696} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {02fc0ad3-18aa-4762-b24b-8226dfb0e223} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {22cf2f8c-de87-4f6f-9b26-a5b9b746968c} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /3rdparty/miniupnp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option (UPNPC_BUILD_STATIC "Build static library" TRUE) 2 | option (UPNPC_BUILD_SHARED "Build shared library" FALSE) 3 | option (UPNPC_BUILD_TESTS "Build test executables" FALSE) 4 | option (UPNPC_BUILD_SAMPLE "Build sample executables" FALSE) 5 | option (NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE) 6 | option (UPNPC_NO_INSTALL "Disable installation" TRUE) 7 | 8 | add_subdirectory(miniupnp/miniupnpc EXCLUDE_FROM_ALL) 9 | -------------------------------------------------------------------------------- /3rdparty/opencv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # OpenCV 2 | 3 | set(OPENCV_TARGET 3rdparty_dummy_lib PARENT_SCOPE) 4 | 5 | if (USE_SYSTEM_OPENCV) 6 | message(STATUS "RPCS3: using system OpenCV") 7 | find_package(OpenCV COMPONENTS core photo) 8 | 9 | if(OPENCV_FOUND) 10 | message(STATUS "RPCS3: found system OpenCV") 11 | include_directories(${OpenCV_INCLUDE_DIRS}) 12 | add_library(3rdparty_opencv INTERFACE) 13 | target_link_libraries(3rdparty_opencv INTERFACE ${OpenCV_LIBS}) 14 | target_compile_definitions(3rdparty_opencv INTERFACE -DHAVE_OPENCV) 15 | set(OPENCV_TARGET 3rdparty_opencv PARENT_SCOPE) 16 | else() 17 | message(WARNING "RPCS3: OpenCV not found. Building without OpenCV support") 18 | endif() 19 | else() 20 | message(WARNING "RPCS3: Building without OpenCV support") 21 | endif() 22 | -------------------------------------------------------------------------------- /3rdparty/rtmidi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(RTMIDI_API_JACK "Compile with JACK support." OFF) 2 | option(RTMIDI_BUILD_TESTING "Build test programs" OFF) 3 | set(RTMIDI_TARGETNAME_UNINSTALL "uninstall-rpcs3-rtmidi") 4 | add_subdirectory(rtmidi EXCLUDE_FROM_ALL) 5 | -------------------------------------------------------------------------------- /3rdparty/stblib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(3rdparty_stblib INTERFACE) 2 | target_include_directories(3rdparty_stblib INTERFACE stb) 3 | -------------------------------------------------------------------------------- /3rdparty/yaml-cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # We don't want to install yaml-cpp but its cmake file doesn't have option 3 | # to disable it... 4 | # So we just install it to a different directory 5 | set(YAML_CPP_INSTALL OFF CACHE BOOL "Don't install YAML") 6 | set(YAML_CPP_DISABLE_UNINSTALL ON CACHE BOOL "Disable yaml-cpp uninstall") 7 | 8 | set(CMAKE_INSTALL_PREFIX_OLD ${CMAKE_INSTALL_PREFIX}) 9 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/yaml-cpp_install) 10 | 11 | set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Enable testing" FORCE) 12 | set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "Enable parse tools" FORCE) 13 | set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "Enable contrib stuff in library" FORCE) 14 | add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) 15 | 16 | set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_OLD}) 17 | -------------------------------------------------------------------------------- /3rdparty/zlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (USE_SYSTEM_ZLIB) 2 | message(STATUS "RPCS3: Using system ZLIB") 3 | find_package(ZLIB QUIET REQUIRED) 4 | 5 | add_library(3rdparty_zlib INTERFACE) 6 | target_link_libraries(3rdparty_zlib INTERFACE ZLIB::ZLIB) 7 | target_compile_definitions(3rdparty_zlib INTERFACE -DZLIB_CONST=1) 8 | else() 9 | option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" OFF) 10 | message(STATUS "RPCS3: Using builtin ZLIB") 11 | set(SKIP_INSTALL_ALL ON) 12 | add_subdirectory(zlib EXCLUDE_FROM_ALL) 13 | 14 | add_library(3rdparty_zlib INTERFACE) 15 | target_link_libraries(3rdparty_zlib INTERFACE zlibstatic) 16 | target_include_directories(3rdparty_zlib INTERFACE zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib) 17 | target_compile_definitions(3rdparty_zlib INTERFACE -DZLIB_CONST=1) 18 | endif() 19 | -------------------------------------------------------------------------------- /3rdparty/zstd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF) 2 | option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF) 3 | option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON) 4 | option(ZSTD_BUILD_TESTS "BUILD TESTS" OFF) 5 | 6 | add_subdirectory(zstd/build/cmake EXLUDE_FROM_ALL) 7 | add_library(3rdparty_zstd INTERFACE) 8 | target_link_libraries(3rdparty_zstd INTERFACE libzstd_static) 9 | -------------------------------------------------------------------------------- /Utilities/cheat_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | #include 6 | 7 | enum class cheat_type : u8 8 | { 9 | unsigned_8_cheat, 10 | unsigned_16_cheat, 11 | unsigned_32_cheat, 12 | unsigned_64_cheat, 13 | signed_8_cheat, 14 | signed_16_cheat, 15 | signed_32_cheat, 16 | signed_64_cheat, 17 | float_32_cheat, 18 | max 19 | }; 20 | 21 | constexpr u8 cheat_type_max = static_cast(cheat_type::max); 22 | 23 | struct cheat_info 24 | { 25 | std::string game{}; 26 | std::string description{}; 27 | cheat_type type = cheat_type::max; 28 | u32 offset{}; 29 | std::string red_script{}; 30 | 31 | bool from_str(const std::string& cheat_line); 32 | std::string to_str() const; 33 | }; 34 | -------------------------------------------------------------------------------- /Utilities/date_time.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "date_time.h" 3 | 4 | #include 5 | 6 | template <> 7 | void fmt_class_string>::format(std::string& out, u64 arg) 8 | { 9 | const std::time_t dateTime = std::chrono::system_clock::to_time_t(get_object(arg)); 10 | out += date_time::fmt_time("%Y-%m-%dT%H:%M:%S", dateTime); 11 | } 12 | -------------------------------------------------------------------------------- /Utilities/ppu_patch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | // Patch utilities specific to PPU code 8 | struct ppu_patch_block_registry_t 9 | { 10 | ppu_patch_block_registry_t() = default; 11 | ppu_patch_block_registry_t(const ppu_patch_block_registry_t&) = delete; 12 | ppu_patch_block_registry_t& operator=(const ppu_patch_block_registry_t&) = delete; 13 | 14 | std::unordered_set block_addresses{}; 15 | }; 16 | 17 | void ppu_register_range(u32 addr, u32 size); 18 | bool ppu_form_branch_to_code(u32 entry, u32 target, bool link = false, bool with_toc = false, std::string module_name = {}); 19 | u32 ppu_generate_id(std::string_view name); 20 | -------------------------------------------------------------------------------- /bin/GuiConfigs/YoRHa-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/YoRHa-background.jpg -------------------------------------------------------------------------------- /bin/GuiConfigs/check_mark_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/check_mark_white.png -------------------------------------------------------------------------------- /bin/GuiConfigs/kot-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/kot-bg.jpg -------------------------------------------------------------------------------- /bin/GuiConfigs/list_arrow_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/list_arrow_blue.png -------------------------------------------------------------------------------- /bin/GuiConfigs/list_arrow_down_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/list_arrow_down_blue.png -------------------------------------------------------------------------------- /bin/GuiConfigs/list_arrow_down_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/list_arrow_down_green.png -------------------------------------------------------------------------------- /bin/GuiConfigs/list_arrow_down_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/list_arrow_down_white.png -------------------------------------------------------------------------------- /bin/GuiConfigs/list_arrow_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/list_arrow_green.png -------------------------------------------------------------------------------- /bin/GuiConfigs/list_arrow_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/GuiConfigs/list_arrow_white.png -------------------------------------------------------------------------------- /bin/Icons/ui/L1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/L1.png -------------------------------------------------------------------------------- /bin/Icons/ui/L2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/L2.png -------------------------------------------------------------------------------- /bin/Icons/ui/R1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/R1.png -------------------------------------------------------------------------------- /bin/Icons/ui/R2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/R2.png -------------------------------------------------------------------------------- /bin/Icons/ui/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/circle.png -------------------------------------------------------------------------------- /bin/Icons/ui/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/cross.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/dpad.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/dpad_down.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/dpad_left.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/dpad_right.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/dpad_up.png -------------------------------------------------------------------------------- /bin/Icons/ui/fade_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/fade_bottom.png -------------------------------------------------------------------------------- /bin/Icons/ui/fade_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/fade_top.png -------------------------------------------------------------------------------- /bin/Icons/ui/left_stick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/left_stick.png -------------------------------------------------------------------------------- /bin/Icons/ui/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/new.png -------------------------------------------------------------------------------- /bin/Icons/ui/right_stick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/right_stick.png -------------------------------------------------------------------------------- /bin/Icons/ui/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/save.png -------------------------------------------------------------------------------- /bin/Icons/ui/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/select.png -------------------------------------------------------------------------------- /bin/Icons/ui/spinner-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/spinner-24.png -------------------------------------------------------------------------------- /bin/Icons/ui/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/square.png -------------------------------------------------------------------------------- /bin/Icons/ui/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/start.png -------------------------------------------------------------------------------- /bin/Icons/ui/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/Icons/ui/triangle.png -------------------------------------------------------------------------------- /bin/test/dump_stack.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/dump_stack.elf -------------------------------------------------------------------------------- /bin/test/gs_gcm_basic_triangle.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/gs_gcm_basic_triangle.elf -------------------------------------------------------------------------------- /bin/test/gs_gcm_cube.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/gs_gcm_cube.elf -------------------------------------------------------------------------------- /bin/test/gs_gcm_handle_system_cmd.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/gs_gcm_handle_system_cmd.elf -------------------------------------------------------------------------------- /bin/test/gs_gcm_hello_world.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/gs_gcm_hello_world.elf -------------------------------------------------------------------------------- /bin/test/gs_gcm_tetris.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/gs_gcm_tetris.elf -------------------------------------------------------------------------------- /bin/test/pad_test.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/pad_test.elf -------------------------------------------------------------------------------- /bin/test/ppu_thread.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/ppu_thread.elf -------------------------------------------------------------------------------- /bin/test/pspgame.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/pspgame.elf -------------------------------------------------------------------------------- /bin/test/rpcsp.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/rpcsp.elf -------------------------------------------------------------------------------- /bin/test/spurs_test.self: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/bin/test/spurs_test.self -------------------------------------------------------------------------------- /buildfiles/cmake/FindWolfSSL.cmake: -------------------------------------------------------------------------------- 1 | set(WOLFSSL_LIBRARY ON) 2 | set(WOLFSSL_INCLUDE_DIR ON) 3 | set(WOLFSSL_LIBRARIES wolfssl) 4 | set(WOLFSSL_FOUND TRUE) 5 | -------------------------------------------------------------------------------- /buildfiles/cmake/FindZLIB.cmake: -------------------------------------------------------------------------------- 1 | if(USE_SYSTEM_ZLIB) 2 | list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) 3 | find_package(ZLIB) 4 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) 5 | else() 6 | add_library(ZLIB::ZLIB INTERFACE IMPORTED) 7 | set_target_properties(ZLIB::ZLIB PROPERTIES 8 | INTERFACE_LINK_LIBRARIES zlibstatic 9 | INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/3rdparty/zlib/zlib;${CMAKE_BINARY_DIR}/3rdparty/zlib/zlib") 10 | set(ZLIB_FOUND TRUE) 11 | endif() 12 | -------------------------------------------------------------------------------- /buildfiles/msvc/ci_only.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | None 6 | true 7 | 8 | 9 | UseLinkTimeCodeGeneration 10 | 11 | 12 | -------------------------------------------------------------------------------- /buildfiles/msvc/common_default_macros.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | $(DefaultPlatformToolset) 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /darwin/util/sysinfo_darwin.mm: -------------------------------------------------------------------------------- 1 | #pragma GCC diagnostic push 2 | #pragma GCC diagnostic ignored "-Wold-style-cast" 3 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 4 | #pragma GCC diagnostic ignored "-Wmissing-declarations" 5 | #import 6 | #pragma GCC diagnostic pop 7 | 8 | namespace Darwin_Version 9 | { 10 | NSOperatingSystemVersion osver = NSProcessInfo.processInfo.operatingSystemVersion; 11 | 12 | int getNSmajorVersion() 13 | { 14 | return osver.majorVersion; 15 | } 16 | 17 | int getNSminorVersion() 18 | { 19 | return osver.minorVersion; 20 | } 21 | 22 | int getNSpatchVersion() 23 | { 24 | return osver.patchVersion; 25 | } 26 | } 27 | 28 | namespace Darwin_ProcessInfo 29 | { 30 | bool getLowPowerModeEnabled() 31 | { 32 | return NSProcessInfo.processInfo.isLowPowerModeEnabled; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pre-commit.readme: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # git pre-commit hook that run git-clang-format when committing. 4 | # To use it install clang-format and python 2.7 then copy this 5 | # file to .git/hooks/ and remove the extension 6 | 7 | git clang-format --style=file --diff > style.patch 8 | git apply --index style.patch 9 | rm style.patch 10 | exit 0 11 | -------------------------------------------------------------------------------- /rpcs3/Crypto/decrypt_binaries.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class decrypt_binaries_t 4 | { 5 | std::vector m_klics; 6 | std::vector m_modules; 7 | usz m_index = 0; 8 | 9 | public: 10 | decrypt_binaries_t(std::vector modules) noexcept 11 | : m_modules(std::move(modules)) 12 | { 13 | } 14 | 15 | usz decrypt(std::string_view klic_input = {}); 16 | 17 | bool done() const 18 | { 19 | return m_index >= m_modules.size(); 20 | } 21 | 22 | const std::string& operator[](usz index) const 23 | { 24 | return ::at32(m_modules, index); 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/Crypto/ec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Copyright (C) 2014 Hykem 4 | // Licensed under the terms of the GNU GPL, version 2.0 or later versions. 5 | // http://www.gnu.org/licenses/gpl-2.0.txt 6 | 7 | #include "util/types.hpp" 8 | 9 | void ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy); 10 | void ecdsa_set_pub(const u8* Q); 11 | void ecdsa_set_priv(const u8* k); 12 | bool ecdsa_verify(const u8* hash, u8* R, u8* S); 13 | -------------------------------------------------------------------------------- /rpcs3/Crypto/lz.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Copyright (C) 2014 Hykem 4 | // Licensed under the terms of the GNU GPL, version 2.0 or later versions. 5 | // http://www.gnu.org/licenses/gpl-2.0.txt 6 | 7 | // Reverse-engineered custom Lempel–Ziv–Markov based compression. 8 | 9 | void decode_range(unsigned int *range, unsigned int *code, unsigned char **src); 10 | int decode_bit(unsigned int *range, unsigned int *code, int *index, unsigned char **src, unsigned char *c); 11 | int decode_number(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src); 12 | int decode_word(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src); 13 | int decompress(unsigned char *out, unsigned char *in, unsigned int size); 14 | -------------------------------------------------------------------------------- /rpcs3/Crypto/unzip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | std::vector unzip(const void* src, usz size); 4 | 5 | template 6 | inline std::vector unzip(const T& src) 7 | { 8 | return unzip(src.data(), src.size()); 9 | } 10 | 11 | bool unzip(const void* src, usz size, fs::file& out); 12 | 13 | template 14 | inline bool unzip(const std::vector& src, fs::file& out) 15 | { 16 | return unzip(src.data(), src.size(), out); 17 | } 18 | 19 | bool zip(const void* src, usz size, fs::file& out, bool multi_thread_it = false); 20 | 21 | template 22 | inline bool zip(const T& src, fs::file& out) 23 | { 24 | return zip(src.data(), src.size(), out); 25 | } 26 | -------------------------------------------------------------------------------- /rpcs3/Cubeb.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {F573EFFC-2BB8-43DF-AEFA-4E9EA31A817F} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Audio/audio_device_enumerator.h" 4 | 5 | #include "cubeb/cubeb.h" 6 | 7 | class cubeb_enumerator final : public audio_device_enumerator 8 | { 9 | public: 10 | 11 | cubeb_enumerator(); 12 | ~cubeb_enumerator() override; 13 | 14 | std::vector get_output_devices() override; 15 | 16 | private: 17 | 18 | cubeb* ctx{}; 19 | #ifdef _WIN32 20 | bool com_init_success = false; 21 | #endif 22 | }; 23 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/FAudio/faudio_enumerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef HAVE_FAUDIO 4 | #error "FAudio support disabled but still being built." 5 | #endif 6 | 7 | #include "Emu/Audio/audio_device_enumerator.h" 8 | #include "FAudio.h" 9 | 10 | class faudio_enumerator final : public audio_device_enumerator 11 | { 12 | public: 13 | 14 | faudio_enumerator(); 15 | ~faudio_enumerator() override; 16 | 17 | std::vector get_output_devices() override; 18 | 19 | private: 20 | 21 | FAudio* instance{}; 22 | }; 23 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/Null/NullAudioBackend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Audio/AudioBackend.h" 4 | 5 | class NullAudioBackend final : public AudioBackend 6 | { 7 | public: 8 | NullAudioBackend() {} 9 | ~NullAudioBackend() {} 10 | 11 | std::string_view GetName() const override { return "Null"sv; } 12 | 13 | bool Open(std::string_view /* dev_id */, AudioFreq /* freq */, AudioSampleSize /* sample_size */, AudioChannelCnt /* ch_cnt */, audio_channel_layout /*layout*/) override 14 | { 15 | Close(); 16 | return true; 17 | } 18 | void Close() override { m_playing = false; } 19 | 20 | f64 GetCallbackFrameLen() override { return 0.01; }; 21 | 22 | void Play() override { m_playing = true; } 23 | void Pause() override { m_playing = false; } 24 | bool IsPlaying() override { return m_playing; } 25 | 26 | private: 27 | bool m_playing = false; 28 | }; 29 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/Null/null_enumerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Audio/audio_device_enumerator.h" 4 | 5 | class null_enumerator final : public audio_device_enumerator 6 | { 7 | public: 8 | 9 | null_enumerator() {}; 10 | ~null_enumerator() override {}; 11 | 12 | std::vector get_output_devices() override { return {}; } 13 | }; 14 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef _WIN32 4 | #error "XAudio2 can only be built on Windows." 5 | #endif 6 | 7 | #include "Emu/Audio/audio_device_enumerator.h" 8 | 9 | class xaudio2_enumerator final : public audio_device_enumerator 10 | { 11 | public: 12 | 13 | xaudio2_enumerator(); 14 | ~xaudio2_enumerator() override; 15 | 16 | std::vector get_output_devices() override; 17 | }; 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/audio_device_enumerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include 5 | #include 6 | 7 | class audio_device_enumerator 8 | { 9 | public: 10 | 11 | static constexpr std::string_view DEFAULT_DEV_ID = "@@@default@@@"; 12 | 13 | struct audio_device 14 | { 15 | std::string id{}; 16 | std::string name{}; 17 | usz max_ch{}; 18 | }; 19 | 20 | audio_device_enumerator() {}; 21 | 22 | virtual ~audio_device_enumerator() = default; 23 | 24 | // Enumerate available output devices. 25 | virtual std::vector get_output_devices() = 0; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/audio_resampler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "Emu/Audio/AudioBackend.h" 5 | 6 | #ifndef _MSC_VER 7 | #pragma GCC diagnostic push 8 | #pragma GCC diagnostic ignored "-Wsuggest-override" 9 | #pragma GCC diagnostic ignored "-Wold-style-cast" 10 | #endif 11 | #include "SoundTouch.h" 12 | #ifndef _MSC_VER 13 | #pragma GCC diagnostic pop 14 | #endif 15 | 16 | constexpr f64 RESAMPLER_MAX_FREQ_VAL = 1.0; 17 | constexpr f64 RESAMPLER_MIN_FREQ_VAL = 0.1; 18 | 19 | class audio_resampler 20 | { 21 | public: 22 | audio_resampler(); 23 | ~audio_resampler(); 24 | 25 | void set_params(AudioChannelCnt ch_cnt, AudioFreq freq); 26 | f64 set_tempo(f64 new_tempo); 27 | 28 | void put_samples(const f32* buf, u32 sample_cnt); 29 | std::pair get_samples(u32 sample_cnt); 30 | 31 | u32 samples_available() const; 32 | f64 get_resample_ratio(); 33 | 34 | void flush(); 35 | 36 | private: 37 | soundtouch::SoundTouch resampler{}; 38 | }; 39 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/audio_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace audio 4 | { 5 | struct audio_fxo 6 | { 7 | atomic_t audio_muted {false}; 8 | }; 9 | 10 | f32 get_volume(); 11 | 12 | void toggle_mute(); 13 | void change_volume(s32 delta); 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/CPU/Hypervisor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace rpcs3 6 | { 7 | #if defined(ARCH_x64) 8 | union hypervisor_context_t 9 | { 10 | u64 regs[1]; 11 | struct 12 | { 13 | u64 rsp; 14 | } x86; 15 | }; 16 | 17 | static_assert(sizeof(hypervisor_context_t) == 8); 18 | #else 19 | union alignas(16) hypervisor_context_t 20 | { 21 | u64 regs[16]; 22 | 23 | struct 24 | { 25 | u64 pc; 26 | u64 sp; 27 | 28 | u64 x18; 29 | u64 x19; 30 | u64 x20; 31 | u64 x21; 32 | u64 x22; 33 | u64 x23; 34 | u64 x24; 35 | u64 x25; 36 | u64 x26; 37 | u64 x27; 38 | u64 x28; 39 | u64 x29; 40 | u64 x30; 41 | 42 | // x0-x17 unused 43 | } aarch64; 44 | }; 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/StaticHLE.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "Emu/Memory/vm_ptr.h" 5 | #include 6 | 7 | struct shle_pattern 8 | { 9 | u16 start_pattern[32]; 10 | u8 crc16_length; 11 | u16 crc16; 12 | u16 total_length; 13 | std::string _module; 14 | std::string name; 15 | 16 | u32 fnid; 17 | }; 18 | 19 | class statichle_handler 20 | { 21 | public: 22 | statichle_handler(int); 23 | ~statichle_handler(); 24 | 25 | statichle_handler(const statichle_handler&) = delete; 26 | statichle_handler& operator=(const statichle_handler&) = delete; 27 | 28 | bool load_patterns(); 29 | bool check_against_patterns(vm::cptr& data, u32 size, u32 addr); 30 | 31 | protected: 32 | static u16 gen_CRC16(const u8* data_p, usz length); 33 | 34 | std::vector hle_patterns; 35 | }; 36 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellBgdl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // Return Codes 6 | enum 7 | { 8 | CELL_BGDL_UTIL_ERROR_BUSY = 0x8002ce01, 9 | CELL_BGDL_UTIL_ERROR_INTERNAL = 0x8002ce02, 10 | CELL_BGDL_UTIL_ERROR_PARAM = 0x8002ce03, 11 | CELL_BGDL_UTIL_ERROR_ACCESS_ERROR = 0x8002ce04, 12 | CELL_BGDL_UTIL_ERROR_INITIALIZE = 0x8002ce05, 13 | }; 14 | 15 | enum CellBGDLState : s32 16 | { 17 | CELL_BGDL_STATE_ERROR = 0, 18 | CELL_BGDL_STATE_PAUSE, 19 | CELL_BGDL_STATE_READY, 20 | CELL_BGDL_STATE_RUN, 21 | CELL_BGDL_STATE_COMPLETE, 22 | }; 23 | 24 | enum CellBGDLMode : s32 25 | { 26 | CELL_BGDL_MODE_AUTO = 0, 27 | CELL_BGDL_MODE_ALWAYS_ALLOW, 28 | }; 29 | 30 | struct CellBGDLInfo 31 | { 32 | be_t received_size; 33 | be_t content_size; 34 | be_t state; // CellBGDLState 35 | vm::bptr reserved; 36 | }; 37 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellDmuxPamf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct CellDmuxPamfAttr 4 | { 5 | be_t maxEnabledEsNum; 6 | be_t version; 7 | be_t memSize; 8 | }; 9 | 10 | struct CellDmuxPamfEsAttr 11 | { 12 | be_t auQueueMaxSize; 13 | be_t memSize; 14 | be_t specificInfoSize; 15 | }; 16 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellFontFT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "cellFont.h" 4 | 5 | #include "Emu/Memory/vm_ptr.h" 6 | 7 | struct CellFontLibraryConfigFT 8 | { 9 | vm::bptr library; 10 | CellFontMemoryInterface MemoryIF; 11 | }; 12 | 13 | using CellFontRendererConfigFT = CellFontRendererConfig; 14 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellFs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // CellFsRingBuffer.copy 6 | enum : s32 7 | { 8 | CELL_FS_ST_COPY = 0, 9 | CELL_FS_ST_COPYLESS = 1, 10 | }; 11 | 12 | struct CellFsRingBuffer 13 | { 14 | be_t ringbuf_size; 15 | be_t block_size; 16 | be_t transfer_rate; 17 | be_t copy; 18 | }; 19 | 20 | // cellFsStReadGetStatus status 21 | enum : u64 22 | { 23 | CELL_FS_ST_INITIALIZED = 0x0001, 24 | CELL_FS_ST_NOT_INITIALIZED = 0x0002, 25 | CELL_FS_ST_STOP = 0x0100, 26 | CELL_FS_ST_PROGRESS = 0x0200, 27 | }; 28 | 29 | enum : s32 30 | { 31 | CELL_FS_AIO_MAX_FS = 10, // cellFsAioInit limit 32 | CELL_FS_AIO_MAX_REQUEST = 32, // cellFsAioRead request limit per mount point 33 | }; 34 | 35 | struct CellFsAio 36 | { 37 | be_t fd; 38 | be_t offset; 39 | vm::bptrb buf; 40 | be_t size; 41 | be_t user_data; 42 | }; 43 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellLibprof.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | LOG_CHANNEL(cellLibprof); 5 | 6 | error_code cellUserTraceInit() 7 | { 8 | UNIMPLEMENTED_FUNC(cellLibprof); 9 | return CELL_OK; 10 | } 11 | 12 | error_code cellUserTraceRegister() 13 | { 14 | UNIMPLEMENTED_FUNC(cellLibprof); 15 | return CELL_OK; 16 | } 17 | 18 | error_code cellUserTraceUnregister() 19 | { 20 | UNIMPLEMENTED_FUNC(cellLibprof); 21 | return CELL_OK; 22 | } 23 | 24 | error_code cellUserTraceTerminate() 25 | { 26 | UNIMPLEMENTED_FUNC(cellLibprof); 27 | return CELL_OK; 28 | } 29 | 30 | DECLARE(ppu_module_manager::cellLibprof)("cellLibprof", []() 31 | { 32 | REG_FUNC(cellLibprof, cellUserTraceInit); 33 | REG_FUNC(cellLibprof, cellUserTraceRegister); 34 | REG_FUNC(cellLibprof, cellUserTraceUnregister); 35 | REG_FUNC(cellLibprof, cellUserTraceTerminate); 36 | }); 37 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellRemotePlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum CellRemotePlayError : u32 4 | { 5 | CELL_REMOTEPLAY_ERROR_INTERNAL = 0x80029830 6 | }; 7 | 8 | enum 9 | { 10 | CELL_REMOTEPLAY_STATUS_LOADING = 0x00000000, 11 | CELL_REMOTEPLAY_STATUS_WAIT = 0x00000001, 12 | CELL_REMOTEPLAY_STATUS_RUNNING = 0x00000002, 13 | CELL_REMOTEPLAY_STATUS_UNLOADING = 0x00000003, 14 | CELL_REMOTEPLAY_STATUS_FATALERROR = 0x00000004, 15 | CELL_REMOTEPLAY_STATUS_PREMOEND = 0x00000005, 16 | }; 17 | 18 | enum 19 | { 20 | CELL_REMOTEPLAY_M4V_MEMORY_CONTAINER_SIZE = 8 * 1024 * 1024, 21 | CELL_REMOTEPLAY_AVC_MEMORY_CONTAINER_SIZE = 10 * 1024 * 1024, 22 | CELL_REMOTEPLAY_480P_MEMORY_CONTAINER_SIZE = 10 * 1024 * 1024, 23 | }; 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSpudll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | enum CellSpudllError : u32 6 | { 7 | CELL_SPUDLL_ERROR_INVAL = 0x80410602, 8 | CELL_SPUDLL_ERROR_STAT = 0x8041060f, 9 | CELL_SPUDLL_ERROR_ALIGN = 0x80410610, 10 | CELL_SPUDLL_ERROR_NULL_POINTER = 0x80410611, 11 | CELL_SPUDLL_ERROR_SRCH = 0x80410605, 12 | CELL_SPUDLL_ERROR_UNDEF = 0x80410612, 13 | CELL_SPUDLL_ERROR_FATAL = 0x80410613, 14 | }; 15 | 16 | struct CellSpudllHandleConfig 17 | { 18 | be_t mode; 19 | be_t dmaTag; 20 | be_t numMaxReferred; 21 | be_t numMaxDepend; 22 | vm::bptr unresolvedSymbolValueForFunc; 23 | vm::bptr unresolvedSymbolValueForObject; 24 | vm::bptr unresolvedSymbolValueForOther; 25 | be_t __reserved__[9]; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSpursJq.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSysconf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | typedef void(CellSysconfCallback)(s32 result, vm::ptr userdata); 6 | 7 | struct CellSysconfBtDeviceInfo 8 | { 9 | be_t deviceId; 10 | be_t deviceType; // CellSysconfBtDeviceType 11 | be_t state; // CellSysconfBtDeviceState 12 | char name[64]; 13 | be_t reserved[4]; 14 | }; 15 | 16 | struct CellSysconfBtDeviceList 17 | { 18 | CellSysconfBtDeviceInfo device[16]; 19 | }; 20 | 21 | enum CellSysconfBtDeviceType : s32 22 | { 23 | CELL_SYSCONF_BT_DEVICE_TYPE_AUDIO = 0x00000001, 24 | CELL_SYSCONF_BT_DEVICE_TYPE_HID = 0x00000002, 25 | }; 26 | 27 | enum CellSysconfBtDeviceState : s32 28 | { 29 | CELL_SYSCONF_BT_DEVICE_STATE_UNAVAILABLE = 0, 30 | CELL_SYSCONF_BT_DEVICE_STATE_AVAILABLE = 1, 31 | }; 32 | 33 | enum CellSysConfError : u32 34 | { 35 | CELL_SYSCONF_ERROR_PARAM = 0x8002bb01 36 | }; 37 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/system_config.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | #include "cellSysutil.h" 5 | 6 | LOG_CHANNEL(cellSysutilMisc); 7 | 8 | s32 cellSysutilGetLicenseArea() 9 | { 10 | cellSysutilMisc.warning("cellSysutilGetLicenseArea()"); 11 | 12 | const CellSysutilLicenseArea license_area = g_cfg.sys.license_area; 13 | cellSysutilMisc.notice("cellSysutilGetLicenseArea(): %s", license_area); 14 | return license_area; 15 | } 16 | 17 | DECLARE(ppu_module_manager::cellSysutilMisc)("cellSysutilMisc", []() 18 | { 19 | REG_FUNC(cellSysutilMisc, cellSysutilGetLicenseArea); 20 | }); 21 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/libfs_utility_init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/libsynth2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Error Codes 4 | enum CellSoundSynth2Error : u32 5 | { 6 | CELL_SOUND_SYNTH2_ERROR_FATAL = 0x80310201, 7 | CELL_SOUND_SYNTH2_ERROR_INVALID_PARAMETER = 0x80310202, 8 | CELL_SOUND_SYNTH2_ERROR_ALREADY_INITIALIZED = 0x80310203, 9 | }; 10 | 11 | struct CellSoundSynth2EffectAttr 12 | { 13 | be_t core; 14 | be_t mode; 15 | be_t depth_L; 16 | be_t depth_R; 17 | be_t delay; 18 | be_t feedback; 19 | }; 20 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sceNpPlus.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | LOG_CHANNEL(sceNpPlus); 6 | 7 | error_code sceNpManagerIsSP() 8 | { 9 | sceNpPlus.warning("sceNpManagerIsSP()"); 10 | // TODO seems to be cut to 1 byte by pshome likely a bool but may be more. 11 | return not_an_error(1); 12 | } 13 | 14 | DECLARE(ppu_module_manager::sceNpPlus)("sceNpPlus", []() 15 | { 16 | REG_FUNC(sceNpPlus, sceNpManagerIsSP); 17 | }); 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sceNpPlus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | error_code sceNpManagerIsSP(); 4 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sceNpUtil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum 4 | { 5 | SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_NONE = 0, 6 | SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_RUNNING = 1, 7 | SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_FINISHED = 2 8 | }; 9 | 10 | struct SceNpUtilBandwidthTestResult 11 | { 12 | be_t upload_bps; 13 | be_t download_bps; 14 | be_t result; 15 | s8 padding[4]; 16 | }; 17 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sys_crashdump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Emu/Memory/vm_ptr.h" 3 | 4 | enum 5 | { 6 | SYS_CRASH_DUMP_MAX_LABEL_SIZE = 16, 7 | SYS_CRASH_DUMP_MAX_LOG_AREA = 127 // not actually defined in CELL 8 | }; 9 | 10 | struct sys_crash_dump_log_area_info_t 11 | { 12 | char label[SYS_CRASH_DUMP_MAX_LABEL_SIZE]; // 15 + 1 (0 terminated) 13 | vm::bptr addr; 14 | be_t size; 15 | }; 16 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sys_net_.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Cell/lv2/sys_net.h" 4 | 5 | struct sys_net_sockinfo_t 6 | { 7 | be_t s; 8 | be_t proto; 9 | be_t recv_queue_length; 10 | be_t send_queue_length; 11 | sys_net_in_addr local_adr; 12 | be_t local_port; 13 | sys_net_in_addr remote_adr; 14 | be_t remote_port; 15 | be_t state; 16 | }; 17 | 18 | struct sys_net_sockinfo_ex_t 19 | { 20 | be_t s; 21 | be_t proto; 22 | be_t recv_queue_length; 23 | be_t send_queue_length; 24 | sys_net_in_addr local_adr; 25 | be_t local_port; 26 | sys_net_in_addr remote_adr; 27 | be_t remote_port; 28 | be_t state; 29 | be_t socket_type; 30 | be_t local_vport; 31 | be_t remote_vport; 32 | be_t reserved[8]; 33 | }; 34 | 35 | struct sys_net_initialize_parameter_t 36 | { 37 | vm::bptr memory; 38 | be_t memory_size; 39 | be_t flags; 40 | }; 41 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/RawSPUThread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/SPUAnalyser.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "SPUAnalyser.h" 3 | #include "SPUOpcodes.h" 4 | 5 | const extern spu_decoder g_spu_itype{}; 6 | const extern spu_decoder g_spu_iname{}; 7 | const extern spu_decoder g_spu_iflag{}; 8 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/SPUInterpreter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SPUOpcodes.h" 4 | 5 | class spu_thread; 6 | 7 | using spu_intrp_func_t = bool(*)(spu_thread& spu, spu_opcode_t op); 8 | 9 | template 10 | struct spu_interpreter_t; 11 | 12 | struct spu_interpreter 13 | { 14 | static void set_interrupt_status(spu_thread&, spu_opcode_t); 15 | }; 16 | 17 | struct spu_interpreter_rt_base 18 | { 19 | protected: 20 | std::unique_ptr> ptrs; 21 | 22 | spu_interpreter_rt_base() noexcept; 23 | 24 | spu_interpreter_rt_base(const spu_interpreter_rt_base&) = delete; 25 | 26 | spu_interpreter_rt_base& operator=(const spu_interpreter_rt_base&) = delete; 27 | 28 | virtual ~spu_interpreter_rt_base(); 29 | }; 30 | 31 | struct spu_interpreter_rt : spu_interpreter_rt_base 32 | { 33 | spu_interpreter_rt() noexcept; 34 | 35 | spu_intrp_func_t decode(u32 op) const noexcept 36 | { 37 | return table.decode(op); 38 | } 39 | 40 | private: 41 | spu_decoder, spu_intrp_func_t> table; 42 | }; 43 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_bdemu.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Emu/Cell/ErrorCodes.h" 4 | 5 | #include "sys_bdemu.h" 6 | 7 | LOG_CHANNEL(sys_bdemu); 8 | 9 | error_code sys_bdemu_send_command(u64 cmd, u64 a2, u64 a3, vm::ptr buf, u64 buf_len) 10 | { 11 | sys_bdemu.todo("sys_bdemu_send_command(cmd=0%llx, a2=0x%x, a3=0x%x, buf=0x%x, buf_len=0x%x)", cmd, a2, a3, buf, buf_len); 12 | 13 | return CELL_OK; 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_bdemu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | // SysCalls 7 | 8 | error_code sys_bdemu_send_command(u64 cmd, u64 a2, u64 a3, vm::ptr buf, u64 buf_len); 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_btsetting.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "sys_btsetting.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | LOG_CHANNEL(sys_btsetting); 7 | 8 | error_code sys_btsetting_if(u64 cmd, vm::ptr msg) 9 | { 10 | sys_btsetting.todo("sys_btsetting_if(cmd=0x%llx, msg=*0x%x)", cmd, msg); 11 | 12 | return CELL_OK; 13 | } 14 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_btsetting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | // SysCalls 7 | 8 | error_code sys_btsetting_if(u64 cmd, vm::ptr msg); 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_console.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/ErrorCodes.h" 3 | 4 | #include "sys_console.h" 5 | 6 | 7 | LOG_CHANNEL(sys_console); 8 | 9 | error_code sys_console_write(vm::cptr buf, u32 len) 10 | { 11 | sys_console.todo("sys_console_write(buf=*0x%x, len=0x%x)", buf, len); 12 | 13 | return CELL_OK; 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_console.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // SysCalls 6 | 7 | error_code sys_console_write(vm::cptr buf, u32 len); 8 | constexpr auto sys_console_write2 = sys_console_write; 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Emu/Cell/ErrorCodes.h" 4 | 5 | #include "sys_crypto_engine.h" 6 | 7 | LOG_CHANNEL(sys_crypto_engine); 8 | 9 | error_code sys_crypto_engine_create(vm::ptr id) 10 | { 11 | sys_crypto_engine.todo("sys_crypto_engine_create(id=*0x%x)", id); 12 | 13 | return CELL_OK; 14 | } 15 | 16 | error_code sys_crypto_engine_destroy(u32 id) 17 | { 18 | sys_crypto_engine.todo("sys_crypto_engine_destroy(id=0x%x)", id); 19 | 20 | return CELL_OK; 21 | } 22 | 23 | error_code sys_crypto_engine_random_generate(vm::ptr buffer, u64 buffer_size) 24 | { 25 | sys_crypto_engine.todo("sys_crypto_engine_random_generate(buffer=*0x%x, buffer_size=0x%x", buffer, buffer_size); 26 | 27 | return CELL_OK; 28 | } 29 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_crypto_engine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | // SysCalls 7 | 8 | error_code sys_crypto_engine_create(vm::ptr id); 9 | error_code sys_crypto_engine_destroy(u32 id); 10 | error_code sys_crypto_engine_random_generate(vm::ptr buffer, u64 buffer_size); 11 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_dbg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | // Syscalls 7 | 8 | error_code sys_dbg_read_process_memory(s32 pid, u32 address, u32 size, vm::ptr data); 9 | error_code sys_dbg_write_process_memory(s32 pid, u32 address, u32 size, vm::cptr data); 10 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_game.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void abort_lv2_watchdog(); 4 | 5 | error_code _sys_game_watchdog_start(u32 timeout); 6 | error_code _sys_game_watchdog_stop(); 7 | error_code _sys_game_watchdog_clear(); 8 | error_code _sys_game_set_system_sw_version(u64 version); 9 | u64 _sys_game_get_system_sw_version(); 10 | error_code _sys_game_board_storage_read(vm::ptr buffer, vm::ptr status); 11 | error_code _sys_game_board_storage_write(vm::ptr buffer, vm::ptr status); 12 | error_code _sys_game_get_rtc_status(vm::ptr status); 13 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_gamepad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | //Syscalls 6 | 7 | u32 sys_gamepad_ycon_if(u8 packet_id, vm::ptr in, vm::ptr out); 8 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_gpio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | enum : u64 7 | { 8 | SYS_GPIO_UNKNOWN_DEVICE_ID = 0x0, 9 | SYS_GPIO_LED_DEVICE_ID = 0x1, 10 | SYS_GPIO_DIP_SWITCH_DEVICE_ID = 0x2, 11 | }; 12 | 13 | error_code sys_gpio_get(u64 device_id, vm::ptr value); 14 | error_code sys_gpio_set(u64 device_id, u64 mask, u64 value); 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_io.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | struct lv2_io_buf 6 | { 7 | static const u32 id_base = 0x44000000; 8 | static const u32 id_step = 1; 9 | static const u32 id_count = 2048; 10 | SAVESTATE_INIT_POS(41); 11 | 12 | const u32 block_count; 13 | const u32 block_size; 14 | const u32 blocks; 15 | const u32 unk1; 16 | 17 | lv2_io_buf(u32 block_count, u32 block_size, u32 blocks, u32 unk1) 18 | : block_count(block_count) 19 | , block_size(block_size) 20 | , blocks(blocks) 21 | , unk1(unk1) 22 | { 23 | } 24 | }; 25 | 26 | // SysCalls 27 | 28 | error_code sys_io_buffer_create(u32 block_count, u32 block_size, u32 blocks, u32 unk1, vm::ptr handle); 29 | error_code sys_io_buffer_destroy(u32 handle); 30 | error_code sys_io_buffer_allocate(u32 handle, vm::ptr block); 31 | error_code sys_io_buffer_free(u32 handle, u32 block); 32 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_sm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | // SysCalls 7 | 8 | error_code sys_sm_get_ext_event2(vm::ptr a1, vm::ptr a2, vm::ptr a3, u64 a4); 9 | error_code sys_sm_shutdown(ppu_thread& ppu, u16 op, vm::ptr param, u64 size); 10 | error_code sys_sm_get_params(vm::ptr a, vm::ptr b, vm::ptr c, vm::ptr d); 11 | error_code sys_sm_set_shop_mode(s32 mode); 12 | error_code sys_sm_control_led(u8 led, u8 action); 13 | error_code sys_sm_ring_buzzer(u64 packet, u64 a1, u64 a2); 14 | constexpr auto sys_sm_ring_buzzer2 = sys_sm_ring_buzzer; 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_time.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | // SysCalls 7 | 8 | error_code sys_time_set_timezone(s32 timezone, s32 summertime); 9 | error_code sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime); 10 | error_code sys_time_get_current_time(vm::ptr sec, vm::ptr nsec); 11 | error_code sys_time_set_current_time(s64 sec, s64 nsec); 12 | u64 sys_time_get_timebase_frequency(); 13 | error_code sys_time_get_rtc(vm::ptr rtc); 14 | 15 | extern u64 g_timebase_offs; 16 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_trace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | // SysCalls 6 | s32 sys_trace_create(); 7 | s32 sys_trace_start(); 8 | s32 sys_trace_stop(); 9 | s32 sys_trace_update_top_index(); 10 | s32 sys_trace_destroy(); 11 | s32 sys_trace_drain(); 12 | s32 sys_trace_attach_process(); 13 | s32 sys_trace_allocate_buffer(); 14 | s32 sys_trace_free_buffer(); 15 | s32 sys_trace_create2(); 16 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_tty.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | // TTY channels 7 | enum 8 | { 9 | SYS_TTYP_PPU_STDIN = 0, 10 | SYS_TTYP_PPU_STDOUT = 0, 11 | SYS_TTYP_PPU_STDERR = 1, 12 | SYS_TTYP_SPU_STDOUT = 2, 13 | SYS_TTYP_USER1 = 3, 14 | SYS_TTYP_USER2 = 4, 15 | SYS_TTYP_USER3 = 5, 16 | SYS_TTYP_USER4 = 6, 17 | SYS_TTYP_USER5 = 7, 18 | SYS_TTYP_USER6 = 8, 19 | SYS_TTYP_USER7 = 9, 20 | SYS_TTYP_USER8 = 10, 21 | SYS_TTYP_USER9 = 11, 22 | SYS_TTYP_USER10 = 12, 23 | SYS_TTYP_USER11 = 13, 24 | SYS_TTYP_USER12 = 14, 25 | SYS_TTYP_USER13 = 15, 26 | }; 27 | 28 | class ppu_thread; 29 | 30 | // SysCalls 31 | error_code sys_tty_read(s32 ch, vm::ptr buf, u32 len, vm::ptr preadlen); 32 | error_code sys_tty_write(ppu_thread& ppu, s32 ch, vm::cptr buf, u32 len, vm::ptr pwritelen); 33 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/timers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | u64 convert_to_timebased_time(u64 time); 6 | u64 get_timebased_time(); 7 | 8 | // Returns some relative time in microseconds, don't change this fact 9 | u64 get_system_time(); 10 | 11 | // As get_system_time but obeys Clocks scaling setting. Microseconds. 12 | u64 get_guest_system_time(u64 time = umax); 13 | -------------------------------------------------------------------------------- /rpcs3/Emu/GameInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include 5 | 6 | struct GameInfo 7 | { 8 | std::string path; 9 | std::string icon_path; 10 | std::string movie_path; 11 | 12 | std::string name; 13 | std::string serial; 14 | std::string app_ver; 15 | std::string version; 16 | std::string category; 17 | std::string fw; 18 | 19 | u32 attr = 0; 20 | u32 bootable = 0; 21 | u32 parental_lvl = 0; 22 | u32 sound_format = 0; 23 | u32 resolution = 0; 24 | 25 | u64 size_on_disk = umax; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/Emu/IPC_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/Config.h" 4 | 5 | struct cfg_ipc : cfg::node 6 | { 7 | cfg::_bool ipc_server_enabled{ this, "IPC Server enabled", false }; 8 | cfg::_int<1025, 65535> ipc_port{ this, "IPC Port", 28012 }; 9 | 10 | void load(); 11 | void save() const; 12 | 13 | bool get_server_enabled() const; 14 | int get_port() const; 15 | 16 | void set_server_enabled(const bool enabled); 17 | void set_port(const int port); 18 | 19 | private: 20 | static std::string get_path(); 21 | }; 22 | 23 | extern cfg_ipc g_cfg_ipc; 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/Buzz.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | 5 | class usb_device_buzz : public usb_device_emulated 6 | { 7 | public: 8 | usb_device_buzz(u32 first_controller, u32 last_controller, const std::array& location); 9 | ~usb_device_buzz(); 10 | 11 | static std::shared_ptr make_instance(u32 controller_index, const std::array& location); 12 | static u16 get_num_emu_devices(); 13 | 14 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 15 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 16 | 17 | private: 18 | u32 m_first_controller; 19 | u32 m_last_controller; 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/GHLtar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | 5 | class usb_device_ghltar : public usb_device_emulated 6 | { 7 | public: 8 | usb_device_ghltar(u32 controller_index, const std::array& location); 9 | ~usb_device_ghltar(); 10 | 11 | static std::shared_ptr make_instance(u32 controller_index, const std::array& location); 12 | static u16 get_num_emu_devices(); 13 | 14 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 15 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 16 | 17 | private: 18 | u32 m_controller_index; 19 | }; 20 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/GameTablet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | 5 | class usb_device_gametablet : public usb_device_emulated 6 | { 7 | public: 8 | usb_device_gametablet(u32 controller_index, const std::array& location); 9 | ~usb_device_gametablet(); 10 | 11 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 12 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 13 | 14 | private: 15 | u32 m_controller_index; 16 | }; 17 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/GunCon3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | 5 | class usb_device_guncon3 : public usb_device_emulated 6 | { 7 | public: 8 | usb_device_guncon3(u32 controller_index, const std::array& location); 9 | ~usb_device_guncon3(); 10 | 11 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 12 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 13 | 14 | private: 15 | u32 m_controller_index; 16 | std::array m_key{}; 17 | }; 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/Null/NullKeyboardHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/KeyboardHandler.h" 4 | 5 | class NullKeyboardHandler final : public KeyboardHandlerBase 6 | { 7 | using KeyboardHandlerBase::KeyboardHandlerBase; 8 | 9 | public: 10 | void Init(keyboard_consumer& consumer, const u32 max_connect) override 11 | { 12 | KbInfo& info = consumer.GetInfo(); 13 | std::vector& keyboards = consumer.GetKeyboards(); 14 | 15 | info = {}; 16 | info.max_connect = max_connect; 17 | info.is_null_handler = true; 18 | keyboards.clear(); 19 | for (u32 i = 0; i < max_connect; i++) 20 | { 21 | keyboards.emplace_back(Keyboard()); 22 | } 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/Null/NullMouseHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/MouseHandler.h" 4 | 5 | class NullMouseHandler final : public MouseHandlerBase 6 | { 7 | using MouseHandlerBase::MouseHandlerBase; 8 | 9 | public: 10 | void Init(const u32 max_connect) override 11 | { 12 | m_info = {}; 13 | m_info.max_connect = max_connect; 14 | m_info.is_null_handler = true; 15 | m_mice.clear(); 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/Null/null_music_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/music_handler_base.h" 4 | 5 | class null_music_handler final : public music_handler_base 6 | { 7 | public: 8 | null_music_handler() : music_handler_base() {} 9 | 10 | void stop() override { m_state = 0; } // CELL_MUSIC_PB_STATUS_STOP 11 | void pause() override { m_state = 2; } // CELL_MUSIC_PB_STATUS_PAUSE 12 | void play(const std::string& /*path*/) override { m_state = 1; } // CELL_MUSIC_PB_STATUS_PLAY 13 | void fast_forward(const std::string& /*path*/) override { m_state = 3; } // CELL_MUSIC_PB_STATUS_FASTFORWARD 14 | void fast_reverse(const std::string& /*path*/) override { m_state = 4; } // CELL_MUSIC_PB_STATUS_FASTREVERSE 15 | void set_volume(f32 volume) override { m_volume = volume; } 16 | f32 get_volume() const override { return m_volume; } 17 | 18 | private: 19 | atomic_t m_volume{0.0f}; 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/TopShotElite.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | 5 | class usb_device_topshotelite : public usb_device_emulated 6 | { 7 | public: 8 | usb_device_topshotelite(u32 controller_index, const std::array& location); 9 | ~usb_device_topshotelite(); 10 | 11 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 12 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 13 | 14 | private: 15 | u32 m_controller_index; 16 | u8 m_mode; 17 | }; 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/TopShotFearmaster.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | 5 | class usb_device_topshotfearmaster: public usb_device_emulated 6 | { 7 | public: 8 | usb_device_topshotfearmaster(u32 controller_index, const std::array& location); 9 | ~usb_device_topshotfearmaster(); 10 | 11 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 12 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 13 | 14 | private: 15 | u32 m_controller_index; 16 | u8 m_mode; 17 | }; 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/Turntable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | 5 | class usb_device_turntable : public usb_device_emulated 6 | { 7 | public: 8 | usb_device_turntable(u32 controller_index, const std::array& location); 9 | ~usb_device_turntable(); 10 | 11 | static std::shared_ptr make_instance(u32 controller_index, const std::array& location); 12 | static u16 get_num_emu_devices(); 13 | 14 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 15 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 16 | 17 | private: 18 | u32 m_controller_index; 19 | }; 20 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/buzz_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "emulated_pad_config.h" 4 | 5 | enum class buzz_btn 6 | { 7 | red, 8 | yellow, 9 | green, 10 | orange, 11 | blue, 12 | 13 | count 14 | }; 15 | 16 | struct cfg_buzzer final : public emulated_pad_config 17 | { 18 | cfg_buzzer(node* owner, const std::string& name) : emulated_pad_config(owner, name) {} 19 | 20 | cfg_pad_btn red{ this, "Red", buzz_btn::red, pad_button::R1 }; 21 | cfg_pad_btn yellow{ this, "Yellow", buzz_btn::yellow, pad_button::cross }; 22 | cfg_pad_btn green{ this, "Green", buzz_btn::green, pad_button::circle }; 23 | cfg_pad_btn orange{ this, "Orange", buzz_btn::orange, pad_button::square }; 24 | cfg_pad_btn blue{ this, "Blue", buzz_btn::blue, pad_button::triangle }; 25 | }; 26 | 27 | struct cfg_buzz final : public emulated_pads_config 28 | { 29 | cfg_buzz() : emulated_pads_config("buzz") {}; 30 | }; 31 | 32 | extern cfg_buzz g_cfg_buzz; 33 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/camera_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/Config.h" 4 | 5 | struct cfg_camera final : cfg::node 6 | { 7 | cfg_camera(); 8 | bool load(); 9 | void save() const; 10 | 11 | struct camera_setting 12 | { 13 | int width = 0; 14 | int height = 0; 15 | double min_fps = 0; 16 | double max_fps = 0; 17 | int format = 0; 18 | 19 | static constexpr u32 member_count = 5; 20 | 21 | std::string to_string() const; 22 | void from_string(const std::string& text); 23 | }; 24 | camera_setting get_camera_setting(const std::string& camera, bool& success); 25 | void set_camera_setting(const std::string& camera, const camera_setting& setting); 26 | 27 | const std::string path; 28 | 29 | cfg::map_entry cameras{ this, "Cameras" }; // : ,,,, 30 | }; 31 | 32 | extern cfg_camera g_cfg_camera; 33 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/interception.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/atomic.hpp" 4 | 5 | namespace input 6 | { 7 | enum class active_mouse_and_keyboard : u32 8 | { 9 | pad, 10 | emulated 11 | }; 12 | extern atomic_t g_active_mouse_and_keyboard; 13 | 14 | extern atomic_t g_pads_intercepted; 15 | extern atomic_t g_keyboards_intercepted; 16 | extern atomic_t g_mice_intercepted; 17 | 18 | void SetIntercepted(bool pads_intercepted, bool keyboards_intercepted, bool mice_intercepted, const char* func = __builtin_FUNCTION()); 19 | void SetIntercepted(bool all_intercepted, const char* func = __builtin_FUNCTION()); 20 | 21 | void set_mouse_and_keyboard(active_mouse_and_keyboard device); 22 | void toggle_mouse_and_keyboard(); 23 | } 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/midi_config_types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | static constexpr usz max_midi_devices = 3; 6 | 7 | enum class midi_device_type 8 | { 9 | keyboard, 10 | guitar, 11 | guitar_22fret, 12 | drums, 13 | }; 14 | 15 | struct midi_device 16 | { 17 | midi_device_type type{}; 18 | std::string name; 19 | 20 | static midi_device from_string(const std::string& str); 21 | }; 22 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/mouse_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/Config.h" 4 | 5 | // For simplicity's sake, there is only one config instead of 127 for MAX_MICE 6 | struct mouse_config final : cfg::node 7 | { 8 | mouse_config(); 9 | 10 | const std::string cfg_name; 11 | 12 | cfg::string mouse_button_1{ this, "Button 1", "Mouse Left", true }; 13 | cfg::string mouse_button_2{ this, "Button 2", "Mouse Right", true }; 14 | cfg::string mouse_button_3{ this, "Button 3", "Mouse Middle", true }; 15 | cfg::string mouse_button_4{ this, "Button 4", "", true }; 16 | cfg::string mouse_button_5{ this, "Button 5", "", true }; 17 | cfg::string mouse_button_6{ this, "Button 6", "", true }; 18 | cfg::string mouse_button_7{ this, "Button 7", "", true }; 19 | cfg::string mouse_button_8{ this, "Button 8", "", true }; 20 | 21 | atomic_t reload_requested = true; 22 | 23 | bool exist() const; 24 | bool load(); 25 | void save(); 26 | 27 | cfg::string& get_button(int code); 28 | }; 29 | 30 | extern mouse_config g_cfg_mouse; 31 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/music_handler_base.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "util/atomic.hpp" 5 | 6 | class music_handler_base 7 | { 8 | public: 9 | enum class player_status 10 | { 11 | end_of_media 12 | }; 13 | 14 | virtual ~music_handler_base() = default; 15 | 16 | virtual void stop() = 0; 17 | virtual void pause() = 0; 18 | virtual void play(const std::string& path) = 0; 19 | virtual void fast_forward(const std::string& path) = 0; 20 | virtual void fast_reverse(const std::string& path) = 0; 21 | virtual void set_volume(f32 volume) = 0; 22 | virtual f32 get_volume() const = 0; 23 | 24 | s32 get_state() const 25 | { 26 | return m_state; 27 | } 28 | 29 | void set_status_callback(std::function status_callback) 30 | { 31 | m_status_callback = std::move(status_callback); 32 | } 33 | 34 | protected: 35 | atomic_t m_state{0}; 36 | std::function m_status_callback; 37 | }; 38 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/pad_config_types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | enum class pad_handler 6 | { 7 | null, 8 | keyboard, 9 | ds3, 10 | ds4, 11 | dualsense, 12 | skateboard, 13 | move, 14 | #ifdef _WIN32 15 | xinput, 16 | mm, 17 | #endif 18 | #ifdef HAVE_SDL3 19 | sdl, 20 | #endif 21 | #ifdef HAVE_LIBEVDEV 22 | evdev, 23 | #endif 24 | }; 25 | 26 | enum class mouse_movement_mode : s32 27 | { 28 | relative = 0, 29 | absolute = 1 30 | }; 31 | 32 | struct PadInfo 33 | { 34 | u32 now_connect = 0; 35 | u32 system_info = 0; 36 | bool ignore_input = false; 37 | }; 38 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/rb3drums_config.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "rb3drums_config.h" 3 | 4 | LOG_CHANNEL(cfg_log, "CFG"); 5 | 6 | cfg_rb3drums g_cfg_rb3drums; 7 | 8 | cfg_rb3drums::cfg_rb3drums() 9 | : cfg::node() 10 | , path(fs::get_config_dir(true) + "rb3drums.yml") 11 | { 12 | } 13 | 14 | bool cfg_rb3drums::load() 15 | { 16 | cfg_log.notice("Loading rb3drums config from '%s'", path); 17 | 18 | if (fs::file cfg_file{path, fs::read}) 19 | { 20 | return from_string(cfg_file.to_string()); 21 | } 22 | 23 | cfg_log.notice("No rb3drums config found. Using default settings. Path: %s", path); 24 | from_default(); 25 | save(); 26 | return false; 27 | } 28 | 29 | void cfg_rb3drums::save() 30 | { 31 | cfg_log.notice("Saving rb3drums config to '%s'", path); 32 | 33 | if (!cfg::node::save(path)) 34 | { 35 | cfg_log.error("Failed to save rb3drums config to '%s' (error=%s)", path, fs::g_tls_error); 36 | } 37 | 38 | reload_requested = true; 39 | } 40 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/recording_config.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "recording_config.h" 3 | 4 | LOG_CHANNEL(cfg_log, "CFG"); 5 | 6 | cfg_recording g_cfg_recording; 7 | 8 | cfg_recording::cfg_recording() 9 | : cfg::node() 10 | , path(fs::get_config_dir(true) + "recording.yml") 11 | { 12 | } 13 | 14 | bool cfg_recording::load() 15 | { 16 | cfg_log.notice("Loading recording config from '%s'", path); 17 | 18 | if (fs::file cfg_file{path, fs::read}) 19 | { 20 | return from_string(cfg_file.to_string()); 21 | } 22 | 23 | cfg_log.notice("Recording config missing. Using default settings. Path: %s", path); 24 | from_default(); 25 | save(); 26 | return false; 27 | } 28 | 29 | void cfg_recording::save() const 30 | { 31 | cfg_log.notice("Saving recording config to '%s'", path); 32 | 33 | if (!cfg::node::save(path)) 34 | { 35 | cfg_log.error("Failed to save recording config to '%s' (error=%s)", path, fs::g_tls_error); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/usb_vfs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | #include "Utilities/Config.h" 5 | 6 | class usb_device_vfs : public usb_device_emulated 7 | { 8 | public: 9 | usb_device_vfs(const cfg::device_info& device_info, const std::array& location); 10 | ~usb_device_vfs(); 11 | }; 12 | -------------------------------------------------------------------------------- /rpcs3/Emu/NP/np_dnshook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "util/types.hpp" 9 | #include "Utilities/mutex.h" 10 | 11 | namespace np 12 | { 13 | class dnshook 14 | { 15 | public: 16 | dnshook(); 17 | 18 | void add_dns_spy(u32 sock); 19 | void remove_dns_spy(u32 sock); 20 | 21 | bool is_dns(u32 sock); 22 | bool is_dns_queue(u32 sock); 23 | 24 | std::vector get_dns_packet(u32 sock); 25 | s32 analyze_dns_packet(s32 s, const u8* buf, u32 len); 26 | 27 | private: 28 | std::optional get_redir(const std::string& hostname); 29 | 30 | private: 31 | shared_mutex mutex; 32 | std::unordered_map>> m_dns_spylist; 33 | std::vector> m_redirs; 34 | }; 35 | } // namespace np 36 | -------------------------------------------------------------------------------- /rpcs3/Emu/NP/rpcn_countries.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace countries 7 | { 8 | struct country_code 9 | { 10 | std::string_view name; 11 | std::string_view ccode; 12 | }; 13 | extern const std::array g_countries; 14 | } // namespace countries 15 | 16 | -------------------------------------------------------------------------------- /rpcs3/Emu/NP/upnp_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/Config.h" 4 | 5 | struct cfg_upnp : cfg::node 6 | { 7 | cfg::string device_url{this, "DeviceUrl", ""}; 8 | 9 | void load(); 10 | void save() const; 11 | 12 | std::string get_device_url() const; 13 | 14 | void set_device_url(std::string_view url); 15 | 16 | private: 17 | static std::string get_path(); 18 | }; 19 | -------------------------------------------------------------------------------- /rpcs3/Emu/NP/upnp_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | #include "upnp_config.h" 8 | #include "Utilities/mutex.h" 9 | 10 | class upnp_handler 11 | { 12 | public: 13 | ~upnp_handler(); 14 | 15 | void upnp_enable(); 16 | void add_port_redir(std::string_view addr, u16 internal_port, std::string_view protocol); 17 | void remove_port_redir(u16 internal_port, std::string_view protocol); 18 | 19 | bool is_active() const; 20 | 21 | private: 22 | void remove_port_redir_external(u16 external_port, std::string_view protocol, bool verbose = true); 23 | 24 | private: 25 | atomic_t m_active = false; 26 | 27 | shared_mutex m_mutex; 28 | cfg_upnp m_cfg; 29 | IGDdatas m_igd_data{}; 30 | UPNPUrls m_igd_urls{}; 31 | std::unordered_map> m_bindings; 32 | }; 33 | -------------------------------------------------------------------------------- /rpcs3/Emu/NP/vport0.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef _WIN32 6 | #include 7 | #else 8 | #include 9 | #endif 10 | 11 | #include "Emu/Cell/lv2/sys_net/nt_p2p_port.h" 12 | 13 | bool send_packet_from_p2p_port_ipv4(const std::vector& data, const sockaddr_in& addr); 14 | bool send_packet_from_p2p_port_ipv6(const std::vector& data, const sockaddr_in6& addr); 15 | std::vector get_sign_msgs(); 16 | std::vector> get_rpcn_msgs(); 17 | 18 | constexpr s32 VPORT_0_HEADER_SIZE = sizeof(u16) + sizeof(u8); 19 | 20 | // VPort 0 is invalid for sys_net so we use it for: 21 | // Subset 0: Messages from RPCN server, IP retrieval / UDP hole punching 22 | // Subset 1: Signaling 23 | enum VPORT_0_SUBSET : u8 24 | { 25 | SUBSET_RPCN = 0, 26 | SUBSET_SIGNALING = 1, 27 | }; 28 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Capture/rsx_capture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "rsx_replay.h" 3 | 4 | namespace rsx 5 | { 6 | class thread; 7 | namespace capture 8 | { 9 | void capture_draw_memory(thread* rsx); 10 | void capture_image_in(thread* rsx, frame_capture_data::replay_command& replay_command); 11 | void capture_buffer_notify(thread* rsx, frame_capture_data::replay_command& replay_command); 12 | void capture_display_tile_state(thread* rsx, frame_capture_data::replay_command& replay_command); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Capture/rsx_trace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include "util/types.hpp" 7 | #include "Emu/RSX/rsx_methods.h" 8 | 9 | namespace rsx 10 | { 11 | struct frame_trace_data 12 | { 13 | struct draw_state 14 | { 15 | std::string name; 16 | std::pair programs; 17 | rsx::rsx_state state; 18 | std::array, 4> color_buffer; 19 | std::array, 2> depth_stencil; 20 | std::vector index; 21 | u32 vertex_count; 22 | }; 23 | 24 | std::vector> command_queue; 25 | std::vector draw_calls; 26 | 27 | void reset() 28 | { 29 | command_queue.clear(); 30 | draw_calls.clear(); 31 | } 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Common/profiling_timer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Emu/Cell/timers.hpp" 5 | 6 | namespace rsx 7 | { 8 | struct profiling_timer 9 | { 10 | bool enabled = false; 11 | u64 last; 12 | 13 | profiling_timer() = default; 14 | 15 | void start() 16 | { 17 | if (enabled) [[unlikely]] 18 | { 19 | last = get_system_time(); 20 | } 21 | } 22 | 23 | s64 duration() 24 | { 25 | if (!enabled) [[likely]] 26 | { 27 | return 0ll; 28 | } 29 | 30 | auto old = last; 31 | last = get_system_time(); 32 | return static_cast(last - old); 33 | } 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Common/time.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Common/unordered_map.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef RSX_USE_STD_MAP 4 | #include 5 | 6 | namespace rsx 7 | { 8 | template 9 | using unordered_map = std::unordered_map; 10 | } 11 | #else 12 | #include "3rdparty/unordered_dense/include/unordered_dense.h" 13 | 14 | namespace rsx 15 | { 16 | template 17 | using unordered_map = ankerl::unordered_dense::map; 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Core/RSXEngLock.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "../RSXThread.h" 5 | 6 | namespace rsx 7 | { 8 | class eng_lock 9 | { 10 | rsx::thread* pthr; 11 | 12 | public: 13 | eng_lock(rsx::thread* target) 14 | :pthr(target) 15 | { 16 | if (pthr->is_current_thread()) 17 | { 18 | pthr = nullptr; 19 | } 20 | else 21 | { 22 | pthr->pause(); 23 | } 24 | } 25 | 26 | ~eng_lock() 27 | { 28 | if (pthr) pthr->unpause(); 29 | } 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "GLCommonDecompiler.h" 3 | 4 | namespace gl 5 | { 6 | static constexpr std::array, 17> varying_registers = 7 | {{ 8 | {"diff_color", 1}, 9 | {"spec_color", 2}, 10 | {"diff_color1", 3}, 11 | {"spec_color1", 4}, 12 | {"fogc", 5}, 13 | {"fog_c", 5}, 14 | {"tc0", 6}, 15 | {"tc1", 7}, 16 | {"tc2", 8}, 17 | {"tc3", 9}, 18 | {"tc4", 10}, 19 | {"tc5", 11}, 20 | {"tc6", 12}, 21 | {"tc7", 13}, 22 | {"tc8", 14}, 23 | {"tc9", 15} 24 | }}; 25 | 26 | int get_varying_register_location(std::string_view varying_register_name) 27 | { 28 | for (const auto& varying_register : varying_registers) 29 | { 30 | if (varying_register.first == varying_register_name) 31 | { 32 | return varying_register.second; 33 | } 34 | } 35 | 36 | fmt::throw_exception("Unknown register name: %s", varying_register_name); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/GLCommonDecompiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gl 4 | { 5 | int get_varying_register_location(std::string_view varying_register_name); 6 | } 7 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/GLHelpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "../GCM.h" 11 | #include "../Common/TextureUtils.h" 12 | #include "../Program/GLSLTypes.h" 13 | 14 | #include "Utilities/mutex.h" 15 | #include "Utilities/geometry.h" 16 | #include "Utilities/File.h" 17 | #include "util/logs.hpp" 18 | #include "util/asm.hpp" 19 | 20 | #include "glutils/common.h" 21 | // TODO: Include on use 22 | #include "glutils/buffer_object.h" 23 | #include "glutils/image.h" 24 | #include "glutils/sampler.h" 25 | #include "glutils/pixel_settings.hpp" 26 | #include "glutils/state_tracker.hpp" 27 | 28 | // Noop keyword outside of Windows (used in log_debug) 29 | #if !defined(_WIN32) && !defined(APIENTRY) 30 | #define APIENTRY 31 | #endif 32 | 33 | 34 | namespace gl 35 | { 36 | void enable_debugging(); 37 | bool is_primitive_native(rsx::primitive_type in); 38 | GLenum draw_mode(rsx::primitive_type in); 39 | } 40 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/glutils/common.cpp: -------------------------------------------------------------------------------- 1 | #include "state_tracker.hpp" 2 | #include "vao.hpp" 3 | 4 | namespace gl 5 | { 6 | static thread_local bool s_tls_primary_context_thread = false; 7 | static gl::driver_state* s_current_state = nullptr; 8 | 9 | void set_primary_context_thread(bool value) 10 | { 11 | s_tls_primary_context_thread = value; 12 | } 13 | 14 | bool is_primary_context_thread() 15 | { 16 | return s_tls_primary_context_thread; 17 | } 18 | 19 | void set_command_context(gl::command_context& ctx) 20 | { 21 | s_current_state = ctx.operator->(); 22 | } 23 | 24 | void set_command_context(gl::driver_state& ctx) 25 | { 26 | s_current_state = &ctx; 27 | } 28 | 29 | gl::command_context get_command_context() 30 | { 31 | return { *s_current_state }; 32 | } 33 | 34 | attrib_t vao::operator[](u32 index) const noexcept 35 | { 36 | return attrib_t(index); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/upscalers/bilinear_pass.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "static_pass.hpp" 4 | 5 | namespace gl 6 | { 7 | using bilinear_upscale_pass = static_upscale_pass; 8 | } 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/upscalers/nearest_pass.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "static_pass.hpp" 4 | 5 | namespace gl 6 | { 7 | using nearest_upscale_pass = static_upscale_pass; 8 | } 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/upscalers/upscaling.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../glutils/image.h" 4 | #include "../glutils/state_tracker.hpp" 5 | 6 | namespace gl 7 | { 8 | namespace upscaling_flags_ 9 | { 10 | enum upscaling_flags 11 | { 12 | UPSCALE_DEFAULT_VIEW = (1 << 0), 13 | UPSCALE_LEFT_VIEW = (1 << 0), 14 | UPSCALE_RIGHT_VIEW = (1 << 1), 15 | UPSCALE_AND_COMMIT = (1 << 2) 16 | }; 17 | } 18 | 19 | using namespace upscaling_flags_; 20 | 21 | struct upscaler 22 | { 23 | virtual ~upscaler() {} 24 | 25 | virtual gl::texture* scale_output( 26 | gl::command_context& cmd, // State 27 | gl::texture* src, // Source input 28 | const areai& src_region, // Scaling request information 29 | const areai& dst_region, // Ditto 30 | gl::flags32_t mode // Mode 31 | ) = 0; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GSFrameBase.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "GSFrameBase.h" 3 | #include "Emu/system_config.h" 4 | 5 | atomic_t g_game_window_focused = false; 6 | 7 | bool is_input_allowed() 8 | { 9 | return g_game_window_focused || g_cfg.io.background_input_enabled; 10 | } 11 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Host/MM.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "Emu/RSX/Common/simple_array.hpp" 7 | #include "Utilities/address_range.h" 8 | 9 | namespace rsx 10 | { 11 | struct MM_block 12 | { 13 | utils::address_range64 range; 14 | utils::protection prot; 15 | 16 | inline bool overlaps(const utils::address_range64& test) const 17 | { 18 | return range.overlaps(test); 19 | } 20 | 21 | inline bool overlaps(u64 addr) const 22 | { 23 | return range.overlaps(addr); 24 | } 25 | }; 26 | 27 | enum mm_backend_ctrl : u32 28 | { 29 | cmd_mm_flush = 0x81000000, 30 | }; 31 | 32 | void mm_protect(void* start, u64 length, utils::protection prot); 33 | void mm_flush_lazy(); 34 | void mm_flush(u32 vm_address); 35 | void mm_flush(const rsx::simple_array& ranges); 36 | void mm_flush(); 37 | } 38 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/FW/GRAPH_backend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../HW/context.h" 4 | 5 | namespace rsx 6 | { 7 | // GRAPH backend class. Wraps RSX acceleration capabilities for the host. 8 | // TODO: Flesh this out. 9 | // TODO: Replace the virtuals with something faster 10 | class GRAPH_backend 11 | { 12 | public: 13 | // virtual void begin() = 0; 14 | // virtual void end() = 0; 15 | 16 | // Patch transform constants. Units are in 32x4 units 17 | virtual void patch_transform_constants(context* /*ctx*/, u32 /*index*/, u32 /*count*/) {}; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/FW/reg_context.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/FW/reg_context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace rsx 6 | { 7 | // TODO: Basically replaces parts of the current "rsx_state" object 8 | struct reg_context 9 | { 10 | u32 registers[1]; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "context.h" 5 | #include "context_accessors.define.h" 6 | 7 | namespace rsx 8 | { 9 | enum command_barrier_type : u32; 10 | enum class vertex_base_type : u8; 11 | 12 | namespace util 13 | { 14 | u32 get_report_data_impl(rsx::context* ctx, u32 offset); 15 | 16 | void push_vertex_data(rsx::context* ctx, u32 attrib_index, u32 channel_select, int count, rsx::vertex_base_type vtype, u32 value); 17 | 18 | void push_draw_parameter_change(rsx::context* ctx, rsx::command_barrier_type type, u32 reg, u32 arg0, u32 arg1 = 0u, u32 index = 0u); 19 | 20 | void set_fragment_texture_dirty_bit(rsx::context* ctx, u32 arg, u32 index); 21 | 22 | void set_vertex_texture_dirty_bit(rsx::context* ctx, u32 index); 23 | } 24 | } 25 | 26 | #include "context_accessors.undef.h" 27 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace rsx 6 | { 7 | class thread; 8 | struct rsx_state; 9 | 10 | #if 0 11 | // TODO: Separate GRAPH context from RSX state 12 | struct GRAPH_context 13 | { 14 | u32 id; 15 | std::array registers; 16 | 17 | GRAPH_context(u32 ctx_id) 18 | : id(ctx_id) 19 | { 20 | std::fill(registers.begin(), registers.end(), 0); 21 | } 22 | }; 23 | #endif 24 | 25 | struct context 26 | { 27 | thread* rsxthr; 28 | // GRAPH_context* graph; 29 | rsx_state* register_state; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/context_accessors.define.h: -------------------------------------------------------------------------------- 1 | #define RSX(ctx) ctx->rsxthr 2 | #define REGS(ctx) ctx->register_state 3 | #define RSX_CAPTURE_EVENT(name) if (RSX(ctx)->capture_current_frame) { RSX(ctx)->capture_frame(name); } 4 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/context_accessors.undef.h: -------------------------------------------------------------------------------- 1 | #undef RSX 2 | #undef REGS 3 | #undef RSX_CAPTURE_EVENT 4 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/nv0039.h: -------------------------------------------------------------------------------- 1 | // NV47 Buffer Management 2 | #pragma once 3 | 4 | #include "context.h" 5 | 6 | namespace rsx 7 | { 8 | namespace nv0039 9 | { 10 | void buffer_notify(context* ctx, u32 reg, u32 arg); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/nv3089.h: -------------------------------------------------------------------------------- 1 | // NV47 2D Blit Engine 2 | #pragma once 3 | 4 | #include "context.h" 5 | 6 | namespace rsx 7 | { 8 | namespace nv3089 9 | { 10 | void image_in(context* ctx, u32 reg, u32 arg); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/nv308a.h: -------------------------------------------------------------------------------- 1 | // NV47 Format Conversion 2 | #pragma once 3 | 4 | #include "context.h" 5 | 6 | namespace rsx 7 | { 8 | namespace nv308a 9 | { 10 | struct color 11 | { 12 | static void impl(context* ctx, u32 reg, u32 arg); 13 | }; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/nv406e.h: -------------------------------------------------------------------------------- 1 | // NV47 Sync Objects 2 | #pragma once 3 | 4 | #include "context.h" 5 | 6 | namespace rsx 7 | { 8 | namespace nv406e 9 | { 10 | void set_reference(context* ctx, u32 reg, u32 arg); 11 | 12 | void semaphore_acquire(context* ctx, u32 reg, u32 arg); 13 | 14 | void semaphore_release(context* ctx, u32 reg, u32 arg); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/NV47/HW/nv47.h: -------------------------------------------------------------------------------- 1 | // RSX Hardware definitions 2 | #pragma once 3 | 4 | #include "nv0039.h" // Buffer objects 5 | #include "nv3089.h" // Blit engine (2D) 6 | #include "nv308a.h" // Format conversion 7 | #include "nv406e.h" // Sync objects 8 | #include "nv4097.h" // 3D engine (GRAPH) 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Null/NullGSRender.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "NullGSRender.h" 3 | 4 | u64 NullGSRender::get_cycles() 5 | { 6 | return thread_ctrl::get_cycles(static_cast&>(*this)); 7 | } 8 | 9 | NullGSRender::NullGSRender(utils::serial* ar) noexcept : GSRender(ar) 10 | { 11 | } 12 | 13 | void NullGSRender::end() 14 | { 15 | execute_nop_draw(); 16 | rsx::thread::end(); 17 | } 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Null/NullGSRender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Emu/RSX/GSRender.h" 3 | 4 | class NullGSRender : public GSRender 5 | { 6 | public: 7 | u64 get_cycles() final; 8 | 9 | NullGSRender(utils::serial* ar) noexcept; 10 | NullGSRender() noexcept : NullGSRender(nullptr) {} 11 | 12 | private: 13 | void end() override; 14 | }; 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/RSX/Overlays/overlays.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | #include "overlay_home_menu_main_menu.h" 6 | 7 | namespace rsx 8 | { 9 | namespace overlays 10 | { 11 | struct home_menu_dialog : public user_interface 12 | { 13 | public: 14 | home_menu_dialog(); 15 | 16 | void update(u64 timestamp_us) override; 17 | void on_button_pressed(pad_button button_press, bool is_auto_repeat) override; 18 | 19 | compiled_resource get_compiled() override; 20 | 21 | error_code show(std::function on_close); 22 | 23 | private: 24 | home_menu_main_menu m_main_menu; 25 | overlay_element m_dim_background{}; 26 | label m_description{}; 27 | label m_time_display{}; 28 | 29 | animation_color_interpolate fade_animation{}; 30 | }; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlay_home_menu_page.h" 4 | 5 | namespace rsx 6 | { 7 | namespace overlays 8 | { 9 | struct home_menu_main_menu : public home_menu_page 10 | { 11 | home_menu_main_menu(s16 x, s16 y, u16 width, u16 height, bool use_separators, home_menu_page* parent); 12 | }; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlay_home_menu_components.h" 4 | 5 | namespace rsx 6 | { 7 | namespace overlays 8 | { 9 | struct home_menu_message_box : public overlay_element 10 | { 11 | public: 12 | home_menu_message_box(s16 x, s16 y, u16 width, u16 height); 13 | compiled_resource& get_compiled() override; 14 | void show(const std::string& text, std::function on_accept = nullptr, std::function on_cancel = nullptr); 15 | void hide(); 16 | page_navigation handle_button_press(pad_button button_press); 17 | 18 | private: 19 | label m_label{}; 20 | image_button m_accept_btn; 21 | image_button m_cancel_btn; 22 | std::function m_on_accept; 23 | std::function m_on_cancel; 24 | }; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlay_home_menu_page.h" 4 | 5 | namespace rsx 6 | { 7 | namespace overlays 8 | { 9 | struct home_menu_savestate : public home_menu_page 10 | { 11 | home_menu_savestate(s16 x, s16 y, u16 width, u16 height, bool use_separators, home_menu_page* parent); 12 | }; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class MsgDialogBase; 4 | 5 | namespace rsx 6 | { 7 | struct shader_loading_dialog 8 | { 9 | std::shared_ptr dlg{}; 10 | atomic_t ref_cnt{0}; 11 | 12 | virtual ~shader_loading_dialog() = default; 13 | virtual void create(const std::string& msg, const std::string& title); 14 | virtual void update_msg(u32 index, std::string msg); 15 | virtual void inc_value(u32 index, u32 value); 16 | virtual void set_value(u32 index, u32 value); 17 | virtual void set_limit(u32 index, u32 limit); 18 | virtual void refresh(); 19 | virtual void close(); 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "shader_loading_dialog.h" 4 | 5 | class GSRender; 6 | 7 | namespace rsx 8 | { 9 | namespace overlays 10 | { 11 | class message_dialog; 12 | } 13 | 14 | class thread; 15 | 16 | struct shader_loading_dialog_native : rsx::shader_loading_dialog 17 | { 18 | rsx::thread* owner = nullptr; 19 | std::shared_ptr dlg{}; 20 | 21 | shader_loading_dialog_native(GSRender* ptr); 22 | 23 | void create(const std::string& msg, const std::string&/* title*/) override; 24 | void update_msg(u32 index, std::string msg) override; 25 | void inc_value(u32 index, u32 value) override; 26 | void set_value(u32 index, u32 value) override; 27 | void set_limit(u32 index, u32 limit) override; 28 | void refresh() override; 29 | void close() override; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/overlay_compile_notification.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "util/atomic.hpp" 5 | 6 | namespace rsx 7 | { 8 | namespace overlays 9 | { 10 | void show_shader_compile_notification(); 11 | std::shared_ptr> show_ppu_compile_notification(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlays.h" 4 | 5 | namespace rsx 6 | { 7 | namespace overlays 8 | { 9 | class debug_overlay : public user_interface 10 | { 11 | label text_display; 12 | text_guard_t text_guard{}; 13 | 14 | public: 15 | debug_overlay(); 16 | 17 | compiled_resource get_compiled() override; 18 | 19 | void set_text(std::string&& text); 20 | }; 21 | 22 | void reset_debug_overlay(); 23 | void set_debug_overlay_text(std::string&& text); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/overlay_edit_text.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlay_controls.h" 4 | 5 | namespace rsx 6 | { 7 | namespace overlays 8 | { 9 | struct edit_text : public label 10 | { 11 | enum class direction 12 | { 13 | up, 14 | down, 15 | left, 16 | right 17 | }; 18 | 19 | usz caret_position = 0; 20 | 21 | bool m_reset_caret_pulse = false; 22 | bool password_mode = false; 23 | 24 | std::u32string value; 25 | std::u32string placeholder; 26 | 27 | using label::label; 28 | 29 | void set_text(const std::string& text) override; 30 | void set_unicode_text(const std::u32string& text) override; 31 | 32 | void set_placeholder(const std::u32string& placeholder_text); 33 | 34 | void move_caret(direction dir); 35 | void insert_text(const std::u32string& str); 36 | void erase(); 37 | void del(); 38 | 39 | compiled_resource& get_compiled() override; 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/overlay_loading_icon.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlay_animated_icon.h" 4 | 5 | namespace rsx 6 | { 7 | namespace overlays 8 | { 9 | class loading_icon24 : public animated_icon 10 | { 11 | public: 12 | loading_icon24() 13 | : animated_icon("spinner-24.png") 14 | { 15 | init_params(); 16 | } 17 | 18 | loading_icon24(const std::vector& icon_data) 19 | : animated_icon(icon_data) 20 | { 21 | init_params(); 22 | } 23 | 24 | private: 25 | void init_params() 26 | { 27 | m_frame_width = m_frame_height = 24; 28 | m_spacing_x = m_spacing_y = 6; 29 | 30 | set_size(24, 30); 31 | set_padding(4, 0, 2, 8); 32 | } 33 | }; 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/overlay_progress_bar.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlay_controls.h" 4 | 5 | namespace rsx 6 | { 7 | namespace overlays 8 | { 9 | struct progress_bar : public overlay_element 10 | { 11 | private: 12 | overlay_element indicator; 13 | label text_view; 14 | 15 | f32 m_limit = 100.f; 16 | f32 m_value = 0.f; 17 | 18 | public: 19 | progress_bar(); 20 | void inc(f32 value); 21 | void dec(f32 value); 22 | void set_limit(f32 limit); 23 | void set_value(f32 value); 24 | void set_pos(s16 _x, s16 _y) override; 25 | void set_size(u16 _w, u16 _h) override; 26 | void translate(s16 dx, s16 dy) override; 27 | void set_text(const std::string& str) override; 28 | 29 | compiled_resource& get_compiled() override; 30 | }; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "overlays.h" 4 | #include "Emu/Cell/Modules/sceNpTrophy.h" 5 | 6 | namespace rsx 7 | { 8 | namespace overlays 9 | { 10 | struct trophy_notification : public user_interface 11 | { 12 | private: 13 | overlay_element frame; 14 | image_view image; 15 | label text_view; 16 | 17 | u64 display_sched_id = 0; 18 | u64 creation_time_us = 0; 19 | std::unique_ptr icon_info; 20 | 21 | animation_translate sliding_animation; 22 | animation_color_interpolate fade_animation; 23 | 24 | public: 25 | trophy_notification(); 26 | 27 | void update(u64 timestamp_us) override; 28 | 29 | compiled_resource get_compiled() override; 30 | 31 | s32 show(const SceNpTrophyDetails& trophy, const std::vector& trophy_icon_buffer); 32 | }; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/GLSLSnippets/GenericVSPassthrough.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #version 420 3 | #extension GL_ARB_separate_shader_objects: enable 4 | 5 | layout(location=0) out vec2 tc0; 6 | 7 | #ifdef VULKAN 8 | #define gl_VertexID gl_VertexIndex 9 | #endif 10 | 11 | void main() 12 | { 13 | vec2 positions[] = {vec2(-1., -1.), vec2(1., -1.), vec2(-1., 1.), vec2(1., 1.)}; 14 | #ifdef VULKAN 15 | // Origin at top left 16 | vec2 coords[] = {vec2(0., 0.), vec2(1., 0.), vec2(0., 1.), vec2(1., 1.)}; 17 | #else 18 | // Origin at bottom left. Flip Y coordinate. 19 | vec2 coords[] = {vec2(0., 1.), vec2(1., 1.), vec2(0., 0.), vec2(1., 0.)}; 20 | #endif 21 | 22 | tc0 = coords[gl_VertexID % 4]; 23 | vec2 pos = positions[gl_VertexID % 4]; 24 | gl_Position = vec4(pos, 0., 1.); 25 | } 26 | )" 27 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXDefines2.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | // Small structures that should be defined before any backend logic 3 | // Avoid arrays and sub-vec4 members because of std140 padding constraints 4 | struct sampler_info 5 | { 6 | float scale_x, scale_y, scale_z; // 12 7 | float bias_x, bias_y, bias_z; // 24 8 | float clamp_min_x, clamp_min_y; // 32 9 | float clamp_max_x, clamp_max_y; // 40 10 | uint remap; // 44 11 | uint flags; // 48 12 | }; 13 | 14 | )" 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgramCommon.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #define _select mix 3 | #define _saturate(x) clamp(x, 0., 1.) 4 | #define _get_bits(x, off, count) bitfieldExtract(x, off, count) 5 | #define _set_bits(x, y, off, count) bitfieldInsert(x, y, off, count) 6 | #define _test_bit(x, y) (_get_bits(x, y, 1) != 0) 7 | #define _rand(seed) fract(sin(dot(seed.xy, vec2(12.9898f, 78.233f))) * 43758.5453f) 8 | 9 | #ifdef _GPU_LOW_PRECISION_COMPARE 10 | #define CMP_FIXUP(a) (sign(a) * 16. + a) 11 | #else 12 | #define CMP_FIXUP(a) (a) 13 | #endif 14 | 15 | #ifdef _ENABLE_LIT_EMULATION 16 | vec4 lit_legacy(const in vec4 val) 17 | { 18 | vec4 clamped_val = vec4(max(val.xy, vec2(0.)), val.zw); 19 | return vec4( 20 | 1., 21 | clamped_val.x, 22 | exp2(clamped_val.w * log2(max(clamped_val.y, 0.0000000001))) * sign(clamped_val.x), 23 | 1.); 24 | } 25 | #endif 26 | 27 | )" 28 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPPrologue.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | 3 | #ifdef _ENABLE_POLYGON_STIPPLE 4 | if (_test_bit(rop_control, POLYGON_STIPPLE_ENABLE_BIT)) 5 | { 6 | // Convert x,y to linear address 7 | const uvec2 stipple_coord = uvec2(gl_FragCoord.xy) % uvec2(32, 32); 8 | const uint address = stipple_coord.y * 32u + stipple_coord.x; 9 | const uint bit_offset = (address & 31u); 10 | const uint word_index = _get_bits(address, 7, 3); 11 | const uint sub_index = _get_bits(address, 5, 2); 12 | 13 | if (!_test_bit(stipple_pattern[word_index][sub_index], int(bit_offset))) 14 | { 15 | _kill(); 16 | } 17 | } 18 | #endif 19 | 20 | #ifdef _ENABLE_PROGRAMMABLE_BLENDING 21 | vec4 mrt_color[4]; 22 | for (int n = 0; n < framebufferCount; ++n) 23 | { 24 | mrt_color[n] = subPassLoad(mrtAttachments[n]); 25 | } 26 | #endif 27 | )" 28 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/MSAA/DepthResolvePass.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #version 420 3 | #extension GL_ARB_separate_shader_objects: enable 4 | 5 | #ifdef VULKAN 6 | layout(set=0, binding=0) uniform sampler2DMS fs0; 7 | layout(push_constant) uniform static_data { ivec2 sample_count; }; 8 | #else 9 | layout(binding=31) uniform sampler2DMS fs0; 10 | uniform ivec2 sample_count; 11 | #endif 12 | 13 | void main() 14 | { 15 | ivec2 out_coord = ivec2(gl_FragCoord.xy); 16 | ivec2 in_coord = (out_coord / sample_count.xy); 17 | ivec2 sample_loc = out_coord % sample_count.xy; 18 | int sample_index = sample_loc.x + (sample_loc.y * sample_count.y); 19 | float frag_depth = texelFetch(fs0, in_coord, sample_index).x; 20 | gl_FragDepth = frag_depth; 21 | } 22 | 23 | )" 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/MSAA/DepthStencilResolvePass.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #version 420 3 | #extension GL_ARB_separate_shader_objects: enable 4 | #extension GL_ARB_shader_stencil_export : enable 5 | 6 | #ifdef VULKAN 7 | layout(set=0, binding=0) uniform sampler2DMS fs0; 8 | layout(set=0, binding=1) uniform usampler2DMS fs1; 9 | layout(push_constant) uniform static_data { ivec2 sample_count; }; 10 | #else 11 | layout(binding=31) uniform sampler2DMS fs0; 12 | layout(binding=30) uniform usampler2DMS fs1; 13 | uniform ivec2 sample_count; 14 | #endif 15 | 16 | void main() 17 | { 18 | ivec2 out_coord = ivec2(gl_FragCoord.xy); 19 | ivec2 in_coord = (out_coord / sample_count.xy); 20 | ivec2 sample_loc = out_coord % ivec2(sample_count.xy); 21 | int sample_index = sample_loc.x + (sample_loc.y * sample_count.y); 22 | float frag_depth = texelFetch(fs0, in_coord, sample_index).x; 23 | uint frag_stencil = texelFetch(fs1, in_coord, sample_index).x; 24 | gl_FragDepth = frag_depth; 25 | gl_FragStencilRefARB = int(frag_stencil); 26 | } 27 | 28 | )" 29 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/MSAA/DepthStencilUnresolvePass.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #version 420 3 | #extension GL_ARB_separate_shader_objects: enable 4 | #extension GL_ARB_shader_stencil_export : enable 5 | 6 | #ifdef VULKAN 7 | layout(set=0, binding=0) uniform sampler2D fs0; 8 | layout(set=0, binding=1) uniform usampler2D fs1; 9 | layout(push_constant) uniform static_data { ivec2 sample_count; }; 10 | #else 11 | layout(binding=31) uniform sampler2D fs0; 12 | layout(binding=30) uniform usampler2D fs1; 13 | uniform ivec2 sample_count; 14 | #endif 15 | 16 | void main() 17 | { 18 | ivec2 pixel_coord = ivec2(gl_FragCoord.xy); 19 | pixel_coord *= sample_count.xy; 20 | pixel_coord.x += (gl_SampleID % sample_count.x); 21 | pixel_coord.y += (gl_SampleID / sample_count.x); 22 | float frag_depth = texelFetch(fs0, pixel_coord, 0).x; 23 | uint frag_stencil = texelFetch(fs1, pixel_coord, 0).x; 24 | gl_FragDepth = frag_depth; 25 | gl_FragStencilRefARB = int(frag_stencil); 26 | } 27 | 28 | )" 29 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/MSAA/DepthUnresolvePass.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #version 420 3 | #extension GL_ARB_separate_shader_objects: enable 4 | 5 | #ifdef VULKAN 6 | layout(set=0, binding=0) uniform sampler2D fs0; 7 | layout(push_constant) uniform static_data { ivec2 sample_count; }; 8 | #else 9 | layout(binding=31) uniform sampler2D fs0; 10 | uniform ivec2 sample_count; 11 | #endif 12 | 13 | void main() 14 | { 15 | ivec2 pixel_coord = ivec2(gl_FragCoord.xy); 16 | pixel_coord *= sample_count.xy; 17 | pixel_coord.x += (gl_SampleID % sample_count.x); 18 | pixel_coord.y += (gl_SampleID / sample_count.x); 19 | float frag_depth = texelFetch(fs0, pixel_coord, 0).x; 20 | gl_FragDepth = frag_depth; 21 | } 22 | 23 | )" 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/MSAA/StencilResolvePass.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #version 420 3 | #extension GL_ARB_separate_shader_objects: enable 4 | 5 | #ifdef VULKAN 6 | layout(set=0, binding=0) uniform usampler2DMS fs0; 7 | layout(push_constant) uniform static_data 8 | { 9 | layout(offset=0) ivec2 sample_count; 10 | layout(offset=8) int stencil_mask; 11 | }; 12 | #else 13 | layout(binding=31) uniform usampler2DMS fs0; 14 | uniform ivec2 sample_count; 15 | uniform int stencil_mask; 16 | #endif 17 | 18 | void main() 19 | { 20 | ivec2 out_coord = ivec2(gl_FragCoord.xy); 21 | ivec2 in_coord = (out_coord / sample_count.xy); 22 | ivec2 sample_loc = out_coord % sample_count.xy; 23 | int sample_index = sample_loc.x + (sample_loc.y * sample_count.y); 24 | uint frag_stencil = texelFetch(fs0, in_coord, sample_index).x; 25 | if ((frag_stencil & uint(stencil_mask)) == 0) discard; 26 | } 27 | 28 | )" 29 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/MSAA/StencilUnresolvePass.glsl: -------------------------------------------------------------------------------- 1 | R"( 2 | #version 420 3 | #extension GL_ARB_separate_shader_objects: enable 4 | 5 | #ifdef VULKAN 6 | layout(set=0, binding=0) uniform usampler2D fs0; 7 | layout(push_constant) uniform static_data 8 | { 9 | layout(offset=0) ivec2 sample_count; 10 | layout(offset=8) int stencil_mask; 11 | }; 12 | #else 13 | layout(binding=31) uniform usampler2D fs0; 14 | uniform ivec2 sample_count; 15 | uniform int stencil_mask; 16 | #endif 17 | 18 | void main() 19 | { 20 | ivec2 pixel_coord = ivec2(gl_FragCoord.xy); 21 | pixel_coord *= sample_count.xy; 22 | pixel_coord.x += (gl_SampleID % sample_count.x); 23 | pixel_coord.y += (gl_SampleID / sample_count.x); 24 | uint frag_stencil = texelFetch(fs0, pixel_coord, 0).x; 25 | if ((frag_stencil & uint(stencil_mask)) == 0) discard; 26 | } 27 | 28 | )" 29 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Program/SPIRVCommon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace glsl 4 | { 5 | enum program_domain : unsigned char; 6 | enum glsl_rules : unsigned char; 7 | } 8 | 9 | namespace spirv 10 | { 11 | bool compile_glsl_to_spv(std::vector& spv, std::string& shader, ::glsl::program_domain domain, ::glsl::glsl_rules rules); 12 | 13 | void initialize_compiler_context(); 14 | void finalize_compiler_context(); 15 | } 16 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/RSXDisAsm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/CPU/CPUDisAsm.h" 4 | 5 | class RSXDisAsm final : public CPUDisAsm 6 | { 7 | public: 8 | RSXDisAsm(cpu_disasm_mode mode, const u8* offset, u32 start_pc, const cpu_thread* cpu) : CPUDisAsm(mode, offset, start_pc, cpu) 9 | { 10 | } 11 | 12 | private: 13 | void Write(std::string_view str, s32 count, bool is_non_inc = false, u32 id = 0); 14 | 15 | public: 16 | u32 disasm(u32 pc) override; 17 | std::pair get_memory_span() const override; 18 | std::unique_ptr copy_type_erased() const override; 19 | }; 20 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKCommonDecompiler.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "VKCommonDecompiler.h" 3 | 4 | namespace vk 5 | { 6 | static constexpr std::array, 18> varying_registers = 7 | { { 8 | { "tc0", 0 }, 9 | { "tc1", 1 }, 10 | { "tc2", 2 }, 11 | { "tc3", 3 }, 12 | { "tc4", 4 }, 13 | { "tc5", 5 }, 14 | { "tc6", 6 }, 15 | { "tc7", 7 }, 16 | { "tc8", 8 }, 17 | { "tc9", 9 }, 18 | { "diff_color", 10 }, 19 | { "diff_color1", 11 }, 20 | { "spec_color", 12 }, 21 | { "spec_color1", 13 }, 22 | { "fog_c", 14 }, 23 | { "fogc", 14 } 24 | } }; 25 | 26 | int get_varying_register_location(std::string_view varying_register_name) 27 | { 28 | for (const auto& varying_register : varying_registers) 29 | { 30 | if (varying_register.first == varying_register_name) 31 | { 32 | return varying_register.second; 33 | } 34 | } 35 | 36 | fmt::throw_exception("Unknown register name: %s", varying_register_name); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKCommonDecompiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Program/GLSLTypes.h" 3 | 4 | namespace vk 5 | { 6 | using namespace ::glsl; 7 | 8 | int get_varying_register_location(std::string_view varying_register_name); 9 | } 10 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vkutils/shared.h" 4 | #include "Emu/RSX/Common/simple_array.hpp" 5 | 6 | namespace vk 7 | { 8 | // Grab standard layout for decompiled RSX programs. Also used by the interpreter. 9 | // FIXME: This generates a bloated monstrosity that needs to die. 10 | std::tuple> get_common_pipeline_layout(VkDevice dev); 11 | 12 | // Returns the standard binding layout without texture slots. Those have special handling depending on the consumer. 13 | rsx::simple_array get_common_binding_table(); 14 | 15 | // Returns an array of pool sizes that can be used to generate a proper descriptor pool 16 | rsx::simple_array get_descriptor_pool_sizes(const rsx::simple_array& bindings); 17 | } 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKDataHeapManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace vk 8 | { 9 | class data_heap; 10 | 11 | namespace data_heap_manager 12 | { 13 | using managed_heap_snapshot_t = std::unordered_map; 14 | 15 | // Submit ring buffer for management 16 | void register_ring_buffer(vk::data_heap& heap); 17 | 18 | // Bulk registration 19 | void register_ring_buffers(std::initializer_list> heaps); 20 | 21 | // Capture managed ring buffers snapshot at current time 22 | managed_heap_snapshot_t get_heap_snapshot(); 23 | 24 | // Synchronize heap with snapshot 25 | void restore_snapshot(const managed_heap_snapshot_t& snapshot); 26 | 27 | // Reset all managed heap allocations 28 | void reset_heap_allocations(); 29 | 30 | // Cleanup 31 | void reset(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKFramebuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vkutils/framebuffer_object.hpp" 4 | 5 | namespace vk 6 | { 7 | struct framebuffer_holder : public vk::framebuffer, public rsx::ref_counted 8 | { 9 | using framebuffer::framebuffer; 10 | }; 11 | 12 | vk::framebuffer_holder* get_framebuffer(VkDevice dev, u16 width, u16 height, VkBool32 has_input_attachments, VkRenderPass renderpass, const std::vector& image_list); 13 | vk::framebuffer_holder* get_framebuffer(VkDevice dev, u16 width, u16 height, VkBool32 has_input_attachments, VkRenderPass renderpass, VkFormat format, VkImage attachment); 14 | 15 | void remove_unused_framebuffers(); 16 | void clear_framebuffer_cache(); 17 | } 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VulkanAPI.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "VulkanAPI.h" 3 | 4 | #include "vkutils/device.h" 5 | 6 | #define DECLARE_VK_FUNCTION_BODY 7 | #include "VKProcTable.h" 8 | 9 | namespace vk 10 | { 11 | const render_device* get_current_renderer(); 12 | 13 | void init() 14 | { 15 | auto pdev = get_current_renderer(); 16 | 17 | #define VK_FUNC(func) _##func = reinterpret_cast(vkGetDeviceProcAddr(*pdev, #func)) 18 | #include "VKProcTable.h" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/vkutils/pipeline_binding_table.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | namespace vk 6 | { 7 | struct pipeline_binding_table 8 | { 9 | u8 vertex_params_bind_slot = 0; 10 | u8 vertex_constant_buffers_bind_slot = 1; 11 | u8 fragment_constant_buffers_bind_slot = 2; 12 | u8 fragment_state_bind_slot = 3; 13 | u8 fragment_texture_params_bind_slot = 4; 14 | u8 vertex_buffers_first_bind_slot = 5; 15 | u8 conditional_render_predicate_slot = 8; 16 | u8 rasterizer_env_bind_slot = 9; 17 | u8 instancing_lookup_table_bind_slot = 10; 18 | u8 instancing_constants_buffer_slot = 11; 19 | u8 textures_first_bind_slot = 12; 20 | u8 vertex_textures_first_bind_slot = 12; // Invalid, has to be initialized properly 21 | u8 total_descriptor_bindings = vertex_textures_first_bind_slot; // Invalid, has to be initialized properly 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/vkutils/scratch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "image.h" 3 | 4 | namespace vk 5 | { 6 | VkSampler null_sampler(); 7 | image_view* null_image_view(const command_buffer& cmd, VkImageViewType type); 8 | image* get_typeless_helper(VkFormat format, rsx::format_class format_class, u32 requested_width, u32 requested_height); 9 | buffer* get_scratch_buffer(const command_buffer& cmd, u64 min_required_size, bool zero_memory = false); 10 | 11 | void clear_scratch_resources(); 12 | } 13 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/vkutils/shared.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../VulkanAPI.h" 4 | #include 5 | 6 | namespace vk 7 | { 8 | #define CHECK_RESULT(expr) { VkResult _res = (expr); if (_res != VK_SUCCESS) vk::die_with_error(_res); } 9 | #define CHECK_RESULT_EX(expr, msg) { VkResult _res = (expr); if (_res != VK_SUCCESS) vk::die_with_error(_res, msg); } 10 | 11 | void die_with_error(VkResult error_code, std::string message = {}, std::source_location src_loc = std::source_location::current()); 12 | 13 | VKAPI_ATTR VkBool32 VKAPI_CALL dbgFunc(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, 14 | u64 srcObject, usz location, s32 msgCode, 15 | const char *pLayerPrefix, const char *pMsg, void *pUserData); 16 | 17 | VkBool32 BreakCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, 18 | u64 srcObject, usz location, s32 msgCode, 19 | const char* pLayerPrefix, const char* pMsg, 20 | void* pUserData); 21 | } 22 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/vkutils/swapchain.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined (_WIN32) 4 | #include "swapchain_win32.hpp" 5 | #elif defined (ANDROID) 6 | #include "swapchain_android.hpp" 7 | #elif defined (__APPLE__) 8 | #include "swapchain_macos.hpp" 9 | #else // Both linux and BSD families 10 | #include "swapchain_unix.hpp" 11 | #endif 12 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "swapchain_core.h" 4 | 5 | namespace vk 6 | { 7 | #if defined(ANDROID) 8 | using swapchain_ANDROID = native_swapchain_base; 9 | using swapchain_NATIVE = swapchain_ANDROID; 10 | 11 | [[maybe_unused]] static 12 | VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle, WSI_config* /*config*/) 13 | { 14 | VkSurfaceKHR result = VK_NULL_HANDLE; 15 | 16 | VkWin32SurfaceCreateInfoKHR createInfo = {}; 17 | createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; 18 | createInfo.window = std::get(window_handle); 19 | 20 | CHECK_RESULT(vkCreateAndroidSurfaceKHR(this->m_instance, &createInfo, nullptr, &result)); 21 | return result; 22 | } 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "swapchain_core.h" 4 | 5 | namespace vk 6 | { 7 | #if defined(__APPLE__) 8 | using swapchain_MacOS = native_swapchain_base; 9 | using swapchain_NATIVE = swapchain_MacOS; 10 | 11 | [[maybe_unused]] static 12 | VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle, WSI_config* /*config*/) 13 | { 14 | VkSurfaceKHR result = VK_NULL_HANDLE; 15 | VkMacOSSurfaceCreateInfoMVK createInfo = {}; 16 | createInfo.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; 17 | createInfo.pView = window_handle; 18 | 19 | CHECK_RESULT(vkCreateMacOSSurfaceMVK(vk_instance, &createInfo, NULL, &result)); 20 | return result; 21 | } 22 | #endif 23 | } 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | #include 5 | #elif defined(__APPLE__) 6 | // nothing 7 | #elif defined(HAVE_X11) 8 | // Cannot include Xlib.h before Qt 9 | // and we don't need all of Xlib anyway 10 | using Display = struct _XDisplay; 11 | using Window = unsigned long; 12 | #endif 13 | 14 | #ifdef HAVE_WAYLAND 15 | #include 16 | #endif 17 | 18 | #ifdef _WIN32 19 | using display_handle_t = HWND; 20 | #elif defined(__APPLE__) 21 | using display_handle_t = void*; // NSView 22 | #else 23 | #include 24 | using display_handle_t = std::variant< 25 | #if defined(HAVE_X11) && defined(HAVE_WAYLAND) 26 | std::pair, std::pair 27 | #elif defined(HAVE_X11) 28 | std::pair 29 | #elif defined(HAVE_WAYLAND) 30 | std::pair 31 | #elif defined(ANDROID) 32 | struct ANativeWindow* 33 | #endif 34 | >; 35 | #endif 36 | 37 | using draw_context_t = void*; 38 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/gcm_printing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include 5 | 6 | namespace rsx 7 | { 8 | std::pair get_method_name(u32 id, std::string& result_str); 9 | 10 | std::add_pointer_t get_pretty_printing_function(u32 id); 11 | } 12 | -------------------------------------------------------------------------------- /rpcs3/Emu/cache_utils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace rpcs3::cache 4 | { 5 | std::string get_ppu_cache(); 6 | void limit_cache_size(); 7 | } 8 | -------------------------------------------------------------------------------- /rpcs3/Emu/config_mode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class cfg_mode 4 | { 5 | custom, // Prefer regular custom config. Fall back to global config. 6 | custom_selection, // Use user-selected custom config. Fall back to global config. 7 | global, // Use global config. 8 | config_override, // Use config override. This does not use the global VFS settings! Fall back to global config. 9 | continuous, // Use same config as on last boot. Fall back to global config. 10 | default_config // Use the default values of the config entries. 11 | }; 12 | -------------------------------------------------------------------------------- /rpcs3/Emu/games_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/mutex.h" 4 | #include 5 | 6 | class games_config 7 | { 8 | public: 9 | games_config(); 10 | virtual ~games_config(); 11 | 12 | void set_save_on_dirty(bool enabled) { m_save_on_dirty = enabled; } 13 | 14 | const std::map get_games() const; 15 | bool is_dirty() const { return m_dirty; } 16 | 17 | std::string get_path(const std::string& title_id) const; 18 | 19 | enum class result 20 | { 21 | failure, 22 | success, 23 | exists 24 | }; 25 | result add_game(const std::string& key, const std::string& path); 26 | result add_external_hdd_game(const std::string& key, std::string& path); 27 | result remove_game(const std::string& key); 28 | bool save(); 29 | 30 | private: 31 | bool save_nl(); 32 | void load(); 33 | 34 | std::map m_games; 35 | mutable shared_mutex m_mutex; 36 | 37 | bool m_dirty = false; 38 | bool m_save_on_dirty = true; 39 | }; 40 | -------------------------------------------------------------------------------- /rpcs3/Emu/localized_string.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "localized_string.h" 3 | #include "System.h" 4 | 5 | std::string get_localized_string(localized_string_id id, const char* args) 6 | { 7 | return Emu.GetCallbacks().get_localized_string(id, args); 8 | } 9 | 10 | std::u32string get_localized_u32string(localized_string_id id, const char* args) 11 | { 12 | return Emu.GetCallbacks().get_localized_u32string(id, args); 13 | } 14 | -------------------------------------------------------------------------------- /rpcs3/Emu/localized_string.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "localized_string_id.h" 5 | 6 | std::string get_localized_string(localized_string_id id, const char* args = ""); 7 | std::u32string get_localized_u32string(localized_string_id id, const char* args = ""); 8 | -------------------------------------------------------------------------------- /rpcs3/Emu/perf_monitor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | using namespace std::literals; 5 | 6 | struct perf_monitor 7 | { 8 | void operator()(); 9 | ~perf_monitor(); 10 | 11 | static constexpr auto thread_name = "Performance Sensor"sv; 12 | }; 13 | -------------------------------------------------------------------------------- /rpcs3/Emu/system_config.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "system_config.h" 3 | 4 | #include "util/sysinfo.hpp" 5 | 6 | cfg_root g_cfg{}; 7 | cfg_root g_backup_cfg{}; 8 | 9 | bool cfg_root::node_core::enable_tsx_by_default() 10 | { 11 | return utils::has_rtm() && utils::has_mpx() && !utils::has_tsx_force_abort(); 12 | } 13 | 14 | std::string cfg_root::node_sys::get_random_system_name() 15 | { 16 | std::srand(static_cast(std::time(nullptr))); 17 | return "RPCS3-" + std::to_string(100 + std::rand() % 899); 18 | } 19 | -------------------------------------------------------------------------------- /rpcs3/Emu/title.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace rpcs3 6 | { 7 | struct title_format_data 8 | { 9 | std::string format; 10 | std::string title; 11 | std::string title_id; 12 | std::string renderer; 13 | std::string vulkan_adapter; 14 | double fps = .0; 15 | }; 16 | 17 | std::string get_formatted_title(const title_format_data& title_data); 18 | } 19 | -------------------------------------------------------------------------------- /rpcs3/Icons/combo_config_bordered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/combo_config_bordered.png -------------------------------------------------------------------------------- /rpcs3/Icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/configure.png -------------------------------------------------------------------------------- /rpcs3/Icons/controllers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/controllers.png -------------------------------------------------------------------------------- /rpcs3/Icons/custom_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/custom_config.png -------------------------------------------------------------------------------- /rpcs3/Icons/exit_fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/exit_fullscreen.png -------------------------------------------------------------------------------- /rpcs3/Icons/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/fullscreen.png -------------------------------------------------------------------------------- /rpcs3/Icons/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/grid.png -------------------------------------------------------------------------------- /rpcs3/Icons/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/list.png -------------------------------------------------------------------------------- /rpcs3/Icons/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/open.png -------------------------------------------------------------------------------- /rpcs3/Icons/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/pause.png -------------------------------------------------------------------------------- /rpcs3/Icons/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/play.png -------------------------------------------------------------------------------- /rpcs3/Icons/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/refresh.png -------------------------------------------------------------------------------- /rpcs3/Icons/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/restart.png -------------------------------------------------------------------------------- /rpcs3/Icons/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/Icons/stop.png -------------------------------------------------------------------------------- /rpcs3/Input/basic_keyboard_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "Emu/Io/KeyboardHandler.h" 5 | 6 | #include 7 | #include 8 | 9 | class basic_keyboard_handler final : public KeyboardHandlerBase, public QObject 10 | { 11 | using KeyboardHandlerBase::KeyboardHandlerBase; 12 | 13 | public: 14 | void Init(keyboard_consumer& consumer, const u32 max_connect) override; 15 | 16 | void SetTargetWindow(QWindow* target); 17 | bool eventFilter(QObject* watched, QEvent* event) override; 18 | void keyPressEvent(QKeyEvent* event); 19 | void keyReleaseEvent(QKeyEvent* event); 20 | static s32 getUnmodifiedKey(QKeyEvent* event); 21 | 22 | private: 23 | void LoadSettings(Keyboard& keyboard); 24 | 25 | QWindow* m_target = nullptr; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/Input/ps_move_calibration.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ps_move_handler.h" 4 | 5 | void psmove_parse_calibration(const reports::ps_move_calibration_blob& calibration, ps_move_device& device); 6 | -------------------------------------------------------------------------------- /rpcs3/Input/ps_move_config.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ps_move_config.h" 3 | 4 | LOG_CHANNEL(ps_move); 5 | 6 | cfg_ps_moves g_cfg_move; 7 | 8 | cfg_ps_moves::cfg_ps_moves() 9 | : cfg::node() 10 | , path(fs::get_config_dir(true) + "ps_move.yml") 11 | { 12 | } 13 | 14 | bool cfg_ps_moves::load() 15 | { 16 | ps_move.notice("Loading PS Move config from '%s'", path); 17 | 18 | if (fs::file cfg_file{ path, fs::read }) 19 | { 20 | return from_string(cfg_file.to_string()); 21 | } 22 | 23 | ps_move.notice("PS Move config missing. Using default settings. Path: %s", path); 24 | from_default(); 25 | return false; 26 | } 27 | 28 | void cfg_ps_moves::save() const 29 | { 30 | ps_move.notice("Saving PS Move config to '%s'", path); 31 | 32 | if (!cfg::node::save(path)) 33 | { 34 | ps_move.error("Failed to save PS Move config to '%s' (error=%s)", path, fs::g_tls_error); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rpcs3/Input/sdl_instance.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef HAVE_SDL3 4 | 5 | #include 6 | 7 | struct sdl_instance 8 | { 9 | public: 10 | sdl_instance() = default; 11 | virtual ~sdl_instance(); 12 | 13 | static sdl_instance& get_instance(); 14 | 15 | bool initialize(); 16 | void pump_events(); 17 | 18 | private: 19 | void set_hint(const char* name, const char* value); 20 | bool initialize_impl(); 21 | 22 | bool m_initialized = false; 23 | std::mutex m_instance_mutex; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /rpcs3/Loader/TRP.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct TRPHeader 4 | { 5 | be_t trp_magic; 6 | be_t trp_version; 7 | be_t trp_file_size; 8 | be_t trp_files_count; 9 | be_t trp_element_size; 10 | be_t trp_dev_flag; 11 | unsigned char sha1[20]; 12 | unsigned char padding[16]; 13 | }; 14 | 15 | struct TRPEntry 16 | { 17 | char name[32]; 18 | be_t offset; 19 | be_t size; 20 | be_t unknown; 21 | char padding[12]; 22 | }; 23 | 24 | class TRPLoader final 25 | { 26 | const fs::file& trp_f; 27 | TRPHeader m_header{}; 28 | std::vector m_entries{}; 29 | 30 | public: 31 | TRPLoader(const fs::file& f); 32 | 33 | bool Install(std::string_view dest, bool show = false); 34 | bool LoadHeader(bool show = false); 35 | u64 GetRequiredSpace() const; 36 | 37 | bool ContainsEntry(std::string_view filename); 38 | void RemoveEntry(std::string_view filename); 39 | void RenameEntry(std::string_view oldname, std::string_view newname); 40 | }; 41 | -------------------------------------------------------------------------------- /rpcs3/Loader/disc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace disc 4 | { 5 | enum class disc_type 6 | { 7 | invalid, 8 | unknown, 9 | ps1, 10 | ps2, 11 | ps3 12 | }; 13 | 14 | disc_type get_disc_type(const std::string& path, std::string& disc_root, std::string& ps3_game_dir); 15 | } 16 | -------------------------------------------------------------------------------- /rpcs3/XAudio.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /rpcs3/display_sleep_control.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | bool display_sleep_control_supported(); 4 | void enable_display_sleep(bool enabled); 5 | -------------------------------------------------------------------------------- /rpcs3/headless_application.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "main_application.h" 6 | #include "util/atomic.hpp" 7 | 8 | #include 9 | 10 | /** Headless RPCS3 Application Class 11 | * The main point of this class is to do application initialization and initialize callbacks. 12 | */ 13 | 14 | class headless_application : public QCoreApplication, public main_application 15 | { 16 | Q_OBJECT 17 | public: 18 | headless_application(int& argc, char** argv); 19 | 20 | /** Call this method before calling app.exec */ 21 | bool Init() override; 22 | 23 | private: 24 | void InitializeCallbacks(); 25 | void InitializeConnects() const; 26 | 27 | QThread* get_thread() override 28 | { 29 | return thread(); 30 | } 31 | 32 | Q_SIGNALS: 33 | void RequestCallFromMainThread(std::function func, atomic_t* wake_up); 34 | 35 | private Q_SLOTS: 36 | static void CallFromMainThread(const std::function& func, atomic_t* wake_up); 37 | }; 38 | -------------------------------------------------------------------------------- /rpcs3/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "rpcs3.h" 3 | 4 | LOG_CHANNEL(sys_log, "SYS"); 5 | 6 | int main(int argc, char** argv) 7 | { 8 | const int exit_code = run_rpcs3(argc, argv); 9 | sys_log.notice("RPCS3 terminated with exit code %d", exit_code); 10 | return exit_code; 11 | } 12 | -------------------------------------------------------------------------------- /rpcs3/main_application.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct EmuCallbacks; 7 | class gs_frame; 8 | 9 | class main_application 10 | { 11 | public: 12 | virtual bool Init() = 0; 13 | 14 | static void InitializeEmulator(const std::string& user, bool show_gui); 15 | 16 | void SetActiveUser(const std::string& user) 17 | { 18 | m_active_user = user; 19 | } 20 | 21 | protected: 22 | virtual QThread* get_thread() = 0; 23 | 24 | void OnEmuSettingsChange(); 25 | 26 | EmuCallbacks CreateCallbacks(); 27 | 28 | std::string m_active_user; 29 | gs_frame* m_game_window = nullptr; 30 | }; 31 | -------------------------------------------------------------------------------- /rpcs3/module_verifier.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef _WIN32 3 | 4 | #include 5 | 6 | // Validates that system modules are properly installed 7 | // Only relevant for WIN32 8 | class WIN32_module_verifier 9 | { 10 | void run_module_verification(); 11 | 12 | WIN32_module_verifier() = default; 13 | 14 | public: 15 | static void run(); 16 | }; 17 | 18 | #endif // _WIN32 19 | -------------------------------------------------------------------------------- /rpcs3/qt/etc/qt.conf: -------------------------------------------------------------------------------- 1 | [Paths] 2 | Prefix = qt6/ 3 | Plugins = plugins 4 | Translations = translations 5 | -------------------------------------------------------------------------------- /rpcs3/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | #define IDI_ICON1 101 3 | 4 | // Next default values for new objects 5 | // 6 | #ifdef APSTUDIO_INVOKED 7 | #ifndef APSTUDIO_READONLY_SYMBOLS 8 | #define _APS_NEXT_RESOURCE_VALUE 102 9 | #define _APS_NEXT_COMMAND_VALUE 40001 10 | #define _APS_NEXT_CONTROL_VALUE 1000 11 | #define _APS_NEXT_SYMED_VALUE 101 12 | #endif 13 | #endif 14 | -------------------------------------------------------------------------------- /rpcs3/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Icons/pause.png 4 | Icons/play.png 5 | Icons/restart.png 6 | Icons/stop.png 7 | rpcs3.ico 8 | Icons/configure.png 9 | Icons/controllers.png 10 | Icons/fullscreen.png 11 | Icons/grid.png 12 | Icons/list.png 13 | Icons/refresh.png 14 | Icons/exit_fullscreen.png 15 | Icons/open.png 16 | Icons/custom_config.png 17 | Icons/combo_config_bordered.png 18 | rpcs3.svg 19 | Icons/DualShock_3.svg 20 | 21 | 22 | -------------------------------------------------------------------------------- /rpcs3/rpcs3.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=RPCS3 4 | GenericName=PlayStation 3 Emulator 5 | Comment=An open-source PlayStation 3 emulator/debugger written in C++. 6 | Icon=rpcs3 7 | TryExec=rpcs3 8 | Exec=rpcs3 %f 9 | Terminal=false 10 | Categories=Game;Emulator; 11 | Keywords=PS3;Playstation; 12 | StartupWMClass=rpcs3 13 | -------------------------------------------------------------------------------- /rpcs3/rpcs3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | int run_rpcs3(int argc, char** argv); 4 | -------------------------------------------------------------------------------- /rpcs3/rpcs3.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/rpcs3.icns -------------------------------------------------------------------------------- /rpcs3/rpcs3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/rpcs3.ico -------------------------------------------------------------------------------- /rpcs3/rpcs3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPCS3/rpcs3/99db73a34fd3d988d0a944f2adf259605da57bf7/rpcs3/rpcs3.png -------------------------------------------------------------------------------- /rpcs3/rpcs3.rc: -------------------------------------------------------------------------------- 1 | #include "resource.h" 2 | IDI_ICON1 ICON "rpcs3.ico" 3 | frame_icon ICON "rpcs3.ico" 4 | -------------------------------------------------------------------------------- /rpcs3/rpcs3_version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace rpcs3 6 | { 7 | std::string_view get_branch(); 8 | std::string_view get_full_branch(); 9 | std::pair get_commit_and_hash(); 10 | const ::utils::version& get_version(); 11 | std::string get_version_and_branch(); 12 | std::string get_verbose_version(); 13 | bool is_release_build(); 14 | bool is_local_build(); 15 | } 16 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/_discord_utils.cpp: -------------------------------------------------------------------------------- 1 | #ifdef WITH_DISCORD_RPC 2 | #include "_discord_utils.h" 3 | #include "discord_rpc.h" 4 | 5 | #include 6 | #include 7 | 8 | namespace discord 9 | { 10 | void initialize(const std::string& application_id) 11 | { 12 | DiscordEventHandlers handlers = {}; 13 | Discord_Initialize(application_id.c_str(), &handlers, 1, nullptr); 14 | } 15 | 16 | void shutdown() 17 | { 18 | Discord_Shutdown(); 19 | } 20 | 21 | void update_presence(const std::string& state, const std::string& details, bool reset_timer) 22 | { 23 | DiscordRichPresence discordPresence = {}; 24 | discordPresence.details = details.c_str(); 25 | discordPresence.state = state.c_str(); 26 | discordPresence.largeImageKey = "rpcs3_logo"; 27 | discordPresence.largeImageText = "RPCS3 is the world's first PlayStation 3 emulator."; 28 | 29 | if (reset_timer) 30 | { 31 | discordPresence.startTimestamp = std::time(nullptr); 32 | } 33 | 34 | Discord_UpdatePresence(&discordPresence); 35 | } 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/_discord_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace discord 6 | { 7 | // Convenience function for initialization 8 | void initialize(const std::string& application_id = "424004941485572097"); 9 | 10 | // Convenience function for shutdown 11 | void shutdown(); 12 | 13 | // Convenience function for status updates. The default is set to idle. 14 | void update_presence(const std::string& state = "", const std::string& details = "Idle", bool reset_timer = true); 15 | } 16 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/about_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui 6 | { 7 | class about_dialog; 8 | } 9 | 10 | class about_dialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit about_dialog(QWidget* parent = nullptr); 16 | ~about_dialog(); 17 | 18 | private: 19 | std::unique_ptr ui; 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/call_stack_list.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | #include 6 | #include 7 | 8 | class cpu_thread; 9 | class CPUDisAsm; 10 | 11 | class call_stack_list : public QListWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit call_stack_list(QWidget* parent); 17 | 18 | protected: 19 | void mouseDoubleClickEvent(QMouseEvent* ev) override; 20 | 21 | Q_SIGNALS: 22 | void RequestShowAddress(u32 addr, bool select_addr = true, bool force = false); 23 | public Q_SLOTS: 24 | void HandleUpdate(const std::vector>& call_stack); 25 | 26 | private Q_SLOTS: 27 | void ShowItemAddress(); 28 | 29 | private: 30 | void keyPressEvent(QKeyEvent* event) override; 31 | }; 32 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/camera_settings_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Ui 8 | { 9 | class camera_settings_dialog; 10 | } 11 | 12 | class camera_settings_dialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | camera_settings_dialog(QWidget* parent = nullptr); 18 | virtual ~camera_settings_dialog(); 19 | 20 | private Q_SLOTS: 21 | void handle_camera_change(int index); 22 | void handle_settings_change(int index); 23 | 24 | private: 25 | void load_config(); 26 | void save_config(); 27 | 28 | std::unique_ptr ui; 29 | std::unique_ptr m_camera; 30 | std::unique_ptr m_media_capture_session; 31 | }; 32 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/cg_disasm_window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | class AsmHighlighter; 9 | class GlslHighlighter; 10 | class gui_settings; 11 | 12 | class cg_disasm_window : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | private Q_SLOTS: 17 | void ShowContextMenu(const QPoint &pos); 18 | 19 | private: 20 | void ShowDisasm() const; 21 | bool IsValidFile(const QMimeData& md, bool save = false); 22 | 23 | QString m_path_last; 24 | QTextEdit* m_disasm_text; 25 | QTextEdit* m_glsl_text; 26 | 27 | std::shared_ptr m_gui_settings; 28 | 29 | AsmHighlighter* sh_asm; 30 | GlslHighlighter* sh_glsl; 31 | 32 | public: 33 | explicit cg_disasm_window(std::shared_ptr xSettings); 34 | 35 | protected: 36 | void dropEvent(QDropEvent* ev) override; 37 | void dragEnterEvent(QDragEnterEvent* ev) override; 38 | void dragMoveEvent(QDragMoveEvent* ev) override; 39 | void dragLeaveEvent(QDragLeaveEvent* ev) override; 40 | }; 41 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/config_adapter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "emu_settings_type.h" 4 | #include "util/yaml.hpp" 5 | 6 | // Helper methods to interact with YAML and the config settings. 7 | namespace cfg_adapter 8 | { 9 | YAML::Node get_node(const YAML::Node& node, const cfg_location::const_iterator begin, const cfg_location::const_iterator end); 10 | 11 | /** Syntactic sugar to get a setting at a given config location. */ 12 | YAML::Node get_node(const YAML::Node& node, const cfg_location& location); 13 | 14 | /** Returns possible options for values for some particular setting.*/ 15 | std::vector get_options(const cfg_location& location); 16 | 17 | /** Returns dynamic property for some particular setting.*/ 18 | bool get_is_dynamic(emu_settings_type type); 19 | 20 | /** Returns the string for a given setting.*/ 21 | std::string get_setting_name(emu_settings_type type); 22 | } 23 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/config_checker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class config_checker : public QDialog 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | config_checker(QWidget* parent, const QString& path, bool is_log); 11 | 12 | bool check_config(QString content, QString& result, bool is_log); 13 | }; 14 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/curl_handle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifndef CURL_STATICLIB 6 | #define CURL_STATICLIB 7 | #endif 8 | #include 9 | 10 | namespace rpcs3::curl 11 | { 12 | inline bool g_curl_verbose = false; 13 | 14 | class curl_handle 15 | { 16 | public: 17 | explicit curl_handle(); 18 | ~curl_handle(); 19 | 20 | CURL* get_curl() const; 21 | 22 | operator CURL*() const 23 | { 24 | return get_curl(); 25 | } 26 | 27 | void reset_error_buffer(); 28 | std::string get_verbose_error(CURLcode code) const; 29 | 30 | private: 31 | CURL* m_curl = nullptr; 32 | bool m_uses_error_buffer = false; 33 | std::array m_error_buffer; 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/custom_dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "custom_dialog.h" 2 | 3 | custom_dialog::custom_dialog(bool disableCancel, QWidget* parent) 4 | : QDialog(parent), m_disable_cancel(disableCancel) 5 | { 6 | if (m_disable_cancel) 7 | { 8 | setWindowFlags(windowFlags() & ~Qt::WindowCloseButtonHint); 9 | } 10 | } 11 | 12 | void custom_dialog::keyPressEvent(QKeyEvent* event) 13 | { 14 | // this won't work with Alt+F4, the window still closes 15 | if (m_disable_cancel && event->key() == Qt::Key_Escape) 16 | { 17 | event->ignore(); 18 | } 19 | else 20 | { 21 | QDialog::keyPressEvent(event); 22 | } 23 | } 24 | 25 | void custom_dialog::closeEvent(QCloseEvent* event) 26 | { 27 | // spontaneous: don't close on external system level events like Alt+F4 28 | if (m_disable_cancel && event->spontaneous()) 29 | { 30 | event->ignore(); 31 | } 32 | else 33 | { 34 | QDialog::closeEvent(event); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/custom_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class custom_dialog : public QDialog 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | explicit custom_dialog(bool disableCancel, QWidget* parent = nullptr); 12 | bool m_disable_cancel; 13 | 14 | private: 15 | void keyPressEvent(QKeyEvent* event) override; 16 | void closeEvent(QCloseEvent* event) override; 17 | }; 18 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/custom_table_widget_item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "movie_item.h" 4 | 5 | class custom_table_widget_item : public movie_item 6 | { 7 | private: 8 | int m_sort_role = Qt::DisplayRole; 9 | 10 | public: 11 | using QTableWidgetItem::setData; 12 | 13 | custom_table_widget_item() = default; 14 | custom_table_widget_item(const std::string& text, int sort_role = Qt::DisplayRole, const QVariant& sort_value = 0); 15 | custom_table_widget_item(const QString& text, int sort_role = Qt::DisplayRole, const QVariant& sort_value = 0); 16 | 17 | bool operator<(const QTableWidgetItem& other) const override; 18 | 19 | void setData(int role, const QVariant& value, bool assign_sort_role); 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/debugger_add_bp_window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "breakpoint_list.h" 4 | 5 | #include 6 | 7 | class debugger_add_bp_window : public QDialog 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit debugger_add_bp_window(breakpoint_list* bp_list, QWidget* parent = nullptr); 13 | }; 14 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/elf_memory_dumping_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "gui_settings.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | class elf_memory_dumping_dialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit elf_memory_dumping_dialog(u32 ppu_debugger_pc, std::shared_ptr _gui_settings, QWidget* parent = nullptr); 18 | 19 | protected: 20 | void add_new_segment(); 21 | void remove_segment(); 22 | void save_to_file(); 23 | 24 | std::shared_ptr m_gui_settings; 25 | 26 | // UI variables needed in higher scope 27 | QListWidget* m_seg_list = nullptr; 28 | 29 | QLineEdit* m_ls_address_input = nullptr; 30 | QLineEdit* m_segment_size_input = nullptr; 31 | QLineEdit* m_ppu_address_input = nullptr; 32 | QLineEdit* m_segment_flags_input = nullptr; 33 | }; 34 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/emulated_pad_settings_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class emulated_pad_settings_dialog : public QDialog 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | enum class pad_type 15 | { 16 | buzz, 17 | turntable, 18 | ghltar, 19 | usio, 20 | gem, 21 | ds3gem, 22 | mousegem, 23 | guncon3, 24 | topshotelite, 25 | topshotfearmaster, 26 | }; 27 | 28 | emulated_pad_settings_dialog(pad_type type, QWidget* parent = nullptr); 29 | 30 | private: 31 | template 32 | void add_tabs(QTabWidget* tabs); 33 | 34 | void load_config(); 35 | void save_config(); 36 | void reset_config(); 37 | 38 | pad_type m_type; 39 | 40 | std::vector> m_combos; 41 | }; 42 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/fatal_error_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | class fatal_error_dialog : public QMessageBox 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit fatal_error_dialog(std::string_view text, bool is_html, bool include_help_text); 13 | }; 14 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/find_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class find_dialog : public QDialog 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | find_dialog(QPlainTextEdit* edit, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); 15 | 16 | private: 17 | int m_count_lines = 0; 18 | int m_count_total = 0; 19 | QLabel* m_label_count_lines; 20 | QLabel* m_label_count_total; 21 | QPlainTextEdit* m_text_edit; 22 | QLineEdit* m_find_bar; 23 | QPushButton* m_find_first; 24 | QPushButton* m_find_last; 25 | QPushButton* m_find_next; 26 | QPushButton* m_find_previous; 27 | 28 | private Q_SLOTS: 29 | int count_all(); 30 | void find_first(); 31 | void find_last(); 32 | void find_next(); 33 | void find_previous(); 34 | void show_count() const; 35 | }; 36 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/game_list_delegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "table_item_delegate.h" 4 | 5 | class game_list_delegate : public table_item_delegate 6 | { 7 | public: 8 | explicit game_list_delegate(QObject* parent); 9 | 10 | void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; 11 | }; 12 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/game_list_grid_item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "flow_widget_item.h" 4 | #include "movie_item_base.h" 5 | #include "game_list_base.h" 6 | 7 | #include 8 | 9 | class game_list_grid_item : public flow_widget_item, public movie_item_base 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | game_list_grid_item(QWidget* parent, game_info game, const QString& title); 15 | 16 | void set_icon_size(const QSize& size); 17 | void set_icon(const QPixmap& pixmap); 18 | void adjust_size(); 19 | 20 | const game_info& game() const 21 | { 22 | return m_game; 23 | } 24 | 25 | void show_title(bool visible); 26 | 27 | void polish_style() override; 28 | 29 | bool event(QEvent* event) override; 30 | 31 | private: 32 | QSize m_icon_size{}; 33 | QLabel* m_icon_label{}; 34 | QLabel* m_title_label{}; 35 | game_info m_game{}; 36 | }; 37 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/gl_gs_frame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gs_frame.h" 4 | 5 | #include 6 | 7 | struct GLContext 8 | { 9 | QSurface *surface = nullptr; 10 | QOpenGLContext *handle = nullptr; 11 | bool owner = false; 12 | }; 13 | 14 | class gl_gs_frame : public gs_frame 15 | { 16 | private: 17 | QSurfaceFormat m_format; 18 | GLContext *m_primary_context = nullptr; 19 | 20 | public: 21 | explicit gl_gs_frame(QScreen* screen, const QRect& geometry, const QIcon& appIcon, std::shared_ptr gui_settings, bool force_fullscreen); 22 | 23 | void reset() override; 24 | draw_context_t make_context() override; 25 | void set_current(draw_context_t ctx) override; 26 | void delete_context(draw_context_t ctx) override; 27 | void flip(draw_context_t context, bool skip_frame = false) override; 28 | }; 29 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/gui_game_info.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "gui_game_info.h" 3 | #include "localized.h" 4 | 5 | std::string gui_game_info::GetGameVersion() const 6 | { 7 | if (info.app_ver == Localized().category.unknown.toStdString()) 8 | { 9 | // Fall back to Disc/Pkg Revision 10 | return info.version; 11 | } 12 | 13 | return info.app_ver; 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/gui_game_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "movie_item_base.h" 4 | #include "game_compatibility.h" 5 | 6 | #include "Emu/GameInfo.h" 7 | 8 | #include 9 | 10 | /* Having the icons associated with the game info simplifies logic internally */ 11 | struct gui_game_info 12 | { 13 | GameInfo info{}; 14 | QString localized_category; 15 | compat::status compat; 16 | QPixmap icon; 17 | QPixmap pxmap; 18 | bool has_custom_config = false; 19 | bool has_custom_pad_config = false; 20 | bool has_custom_icon = false; 21 | bool has_hover_gif = false; 22 | bool has_hover_pam = false; 23 | movie_item_base* item = nullptr; 24 | 25 | // Returns the visible version string in the game list 26 | std::string GetGameVersion() const; 27 | }; 28 | 29 | typedef std::shared_ptr game_info; 30 | Q_DECLARE_METATYPE(game_info) 31 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/gui_save.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct gui_save 7 | { 8 | QString key; 9 | QString name; 10 | QVariant def; 11 | 12 | gui_save() 13 | { 14 | } 15 | 16 | gui_save(const QString& k, const QString& n, const QVariant& d) 17 | : key(k), name(n), def(d) 18 | { 19 | } 20 | 21 | bool operator==(const gui_save& rhs) const noexcept 22 | { 23 | return key == rhs.key && name == rhs.name && def == rhs.def; 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/instruction_editor_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | class CPUDisAsm; 10 | class cpu_thread; 11 | class QCheckBox; 12 | 13 | class instruction_editor_dialog : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | private: 18 | u32 m_pc; 19 | u8* m_cpu_offset; 20 | std::shared_ptr m_disasm; // shared in order to allow an incomplete type 21 | QLineEdit* m_instr; 22 | QLabel* m_preview; 23 | QLabel* m_func_info = nullptr; 24 | QCheckBox* m_apply_for_spu_group = nullptr; 25 | 26 | const std::function m_get_cpu; 27 | 28 | public: 29 | instruction_editor_dialog(QWidget *parent, u32 _pc, CPUDisAsm* _disasm, std::function func); 30 | 31 | void updatePreview() const; 32 | }; 33 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/ipc_settings_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class ipc_settings_dialog : public QDialog 6 | { 7 | Q_OBJECT 8 | public: 9 | ipc_settings_dialog(QWidget* parent = nullptr); 10 | }; 11 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/kernel_explorer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "util/types.hpp" 7 | 8 | class QTreeWidget; 9 | class QTreeWidgetItem; 10 | 11 | class kernel_explorer : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | static const usz sys_size = 256; 16 | 17 | enum additional_nodes 18 | { 19 | memory_containers = sys_size, 20 | virtual_memory, 21 | sockets, 22 | ppu_threads, 23 | spu_threads, 24 | spu_thread_groups, 25 | rsx_contexts, 26 | file_descriptors, 27 | process_info, 28 | }; 29 | 30 | public: 31 | explicit kernel_explorer(QWidget* parent); 32 | 33 | private: 34 | QTreeWidget* m_tree; 35 | QString m_log_buf; 36 | 37 | void log(u32 level = 0, QTreeWidgetItem* node = nullptr); 38 | 39 | private Q_SLOTS: 40 | void update(); 41 | }; 42 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/microphone_creator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | class microphone_creator : public QObject 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | microphone_creator(); 18 | QString get_none(); 19 | std::string set_device(u32 num, const QString& text); 20 | void parse_devices(const std::string& list); 21 | void refresh_list(); 22 | QStringList get_microphone_list() const; 23 | std::array get_selection_list() const; 24 | 25 | private: 26 | QStringList m_microphone_list; 27 | std::array m_sel_list; 28 | }; 29 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/midi_creator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "Emu/Io/midi_config_types.h" 5 | 6 | #include 7 | #include 8 | 9 | class midi_creator : public QObject 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | midi_creator(); 15 | QString get_none(); 16 | std::string set_device(u32 num, const midi_device& device); 17 | void parse_devices(const std::string& list); 18 | void refresh_list(); 19 | QStringList get_midi_list() const; 20 | std::array get_selection_list() const; 21 | 22 | private: 23 | QStringList m_midi_list; 24 | std::array m_sel_list; 25 | }; 26 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/movie_item.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "movie_item.h" 3 | 4 | movie_item::movie_item() : QTableWidgetItem(), movie_item_base() 5 | { 6 | } 7 | 8 | movie_item::movie_item(const QString& text, int type) : QTableWidgetItem(text, type), movie_item_base() 9 | { 10 | } 11 | 12 | movie_item::movie_item(const QIcon& icon, const QString& text, int type) : QTableWidgetItem(icon, text, type), movie_item_base() 13 | { 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/movie_item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "movie_item_base.h" 4 | 5 | #include 6 | 7 | class movie_item : public QTableWidgetItem, public movie_item_base 8 | { 9 | public: 10 | movie_item(); 11 | movie_item(const QString& text, int type = Type); 12 | movie_item(const QIcon& icon, const QString& text, int type = Type); 13 | }; 14 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/music_player_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class music_handler_base; 6 | 7 | namespace Ui 8 | { 9 | class music_player_dialog; 10 | } 11 | 12 | class music_player_dialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit music_player_dialog(QWidget* parent = nullptr); 18 | ~music_player_dialog(); 19 | 20 | private: 21 | void select_file(); 22 | 23 | std::unique_ptr ui; 24 | std::unique_ptr m_handler; 25 | std::string m_file_path; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/numbered_widget_item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class numbered_widget_item final : public QListWidgetItem 6 | { 7 | public: 8 | explicit numbered_widget_item(const QString& text, QListWidget* listview = nullptr, int type = QListWidgetItem::Type) 9 | : QListWidgetItem(text, listview, type) 10 | { 11 | } 12 | 13 | QVariant data(int role) const override 14 | { 15 | switch (role) 16 | { 17 | case Qt::DisplayRole: 18 | // Return number and original display text (e.g. "14. My Cool Game (BLUS12345)") 19 | return QStringLiteral("%1. %2").arg(listWidget()->row(this) + 1).arg(QListWidgetItem::data(Qt::DisplayRole).toString()); 20 | default: 21 | // Return original data 22 | return QListWidgetItem::data(role); 23 | } 24 | } 25 | 26 | bool operator<(const QListWidgetItem& other) const override 27 | { 28 | // Compare original display text 29 | return QListWidgetItem::data(Qt::DisplayRole).toString() < other.QListWidgetItem::data(Qt::DisplayRole).toString(); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/osk_dialog_frame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "Emu/Cell/Modules/cellOskDialog.h" 5 | 6 | #include 7 | 8 | #include 9 | 10 | class custom_dialog; 11 | 12 | class osk_dialog_frame : public QObject, public OskDialogBase 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | osk_dialog_frame() = default; 18 | ~osk_dialog_frame(); 19 | void Create(const osk_params& params) override; 20 | void Close(s32 status) override; 21 | void Clear(bool clear_all_data) override; 22 | void SetText(const std::u16string& text) override; 23 | void Insert(const std::u16string& text) override; 24 | 25 | private: 26 | void SetOskText(const QString& text); 27 | 28 | custom_dialog* m_dialog = nullptr; 29 | QString m_text_old; 30 | }; 31 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/pad_device_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct pad_device_info 7 | { 8 | std::string name; 9 | QString localized_name; 10 | bool is_connected{false}; 11 | }; 12 | 13 | Q_DECLARE_METATYPE(pad_device_info) 14 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/permissions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gui 4 | { 5 | namespace utils 6 | { 7 | void check_microphone_permission(); 8 | bool check_camera_permission(void* obj, std::function repeat_callback, std::function denied_callback); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/pkg_install_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace compat 7 | { 8 | struct package_info; 9 | } 10 | 11 | class game_compatibility; 12 | 13 | class pkg_install_dialog : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit pkg_install_dialog(const QStringList& paths, game_compatibility* compat, QWidget* parent = nullptr); 19 | std::vector GetPathsToInstall() const; 20 | 21 | private: 22 | void MoveItem(int offset) const; 23 | 24 | QListWidget* m_dir_list; 25 | }; 26 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/progress_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "progress_indicator.h" 4 | 5 | #include 6 | 7 | class progress_dialog : public QProgressDialog 8 | { 9 | public: 10 | progress_dialog(const QString& windowTitle, const QString& labelText, const QString& cancelButtonText, int minimum, int maximum, bool delete_on_close, QWidget* parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags()); 11 | ~progress_dialog(); 12 | void SetRange(int min, int max); 13 | void SetValue(int progress); 14 | void SetDeleteOnClose(); 15 | void SignalFailure() const; 16 | 17 | private: 18 | std::unique_ptr m_progress_indicator; 19 | }; 20 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/progress_indicator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class progress_indicator 4 | { 5 | public: 6 | progress_indicator(int minimum, int maximum); 7 | ~progress_indicator(); 8 | 9 | int value() const; 10 | 11 | void set_value(int value); 12 | void set_range(int minimum, int maximum); 13 | void reset(); 14 | void signal_failure(); 15 | 16 | private: 17 | int m_value = 0; 18 | int m_minimum = 0; 19 | int m_maximum = 100; 20 | #if HAVE_QTDBUS 21 | void update_progress(int progress, bool progress_visible, bool urgent); 22 | #endif 23 | }; 24 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/register_editor_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class CPUDisAsm; 8 | class cpu_thread; 9 | 10 | class register_editor_dialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | CPUDisAsm* m_disasm; 15 | QComboBox* m_register_combo; 16 | QLineEdit* m_value_line; 17 | 18 | const std::function m_get_cpu; 19 | 20 | public: 21 | register_editor_dialog(QWidget *parent, CPUDisAsm* _disasm, std::function func); 22 | 23 | private: 24 | void OnOkay(); 25 | 26 | private Q_SLOTS: 27 | void updateRegister(int reg) const; 28 | }; 29 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/render_creator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "emu_settings_type.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | class render_creator : public QObject 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | render_creator(QObject* parent); 15 | 16 | void update_names(const QStringList& names); 17 | 18 | struct render_info 19 | { 20 | QString name; 21 | QString old_adapter; 22 | QStringList adapters; 23 | emu_settings_type type = emu_settings_type::VulkanAdapter; 24 | bool supported = true; 25 | bool has_adapters = true; 26 | 27 | render_info() 28 | : has_adapters(false) {} 29 | 30 | render_info(QStringList adapters, bool supported, emu_settings_type type) 31 | : adapters(std::move(adapters)) 32 | , type(type) 33 | , supported(supported) {} 34 | }; 35 | 36 | bool abort_requested = false; 37 | bool supports_vulkan = false; 38 | QStringList vulkan_adapters; 39 | render_info Vulkan; 40 | render_info OpenGL; 41 | render_info NullRender; 42 | std::vector renderers; 43 | }; 44 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/save_data_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "Emu/Cell/Modules/cellSaveData.h" 5 | 6 | class save_data_dialog : public SaveDialogBase 7 | { 8 | public: 9 | s32 ShowSaveDataList(const std::string& base_dir, std::vector& save_entries, s32 focused, u32 op, vm::ptr listSet, bool enable_overlay) override; 10 | }; 11 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/save_data_info_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // I just want the struct for the save data. 4 | #include "Emu/Cell/Modules/cellSaveData.h" 5 | 6 | #include 7 | #include 8 | 9 | //Used to display the information of a savedata. 10 | class save_data_info_dialog :public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit save_data_info_dialog(SaveDataEntry save, QWidget* parent = nullptr); 16 | private: 17 | void UpdateData(); 18 | 19 | SaveDataEntry m_entry; 20 | QTableWidget* m_list; 21 | }; 22 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/screenshot_item.cpp: -------------------------------------------------------------------------------- 1 | #include "screenshot_item.h" 2 | #include "qt_utils.h" 3 | 4 | #include 5 | 6 | screenshot_item::screenshot_item(QWidget* parent) 7 | : flow_widget_item(parent) 8 | { 9 | cb_on_first_visibility = [this]() 10 | { 11 | m_thread.reset(QThread::create([this]() 12 | { 13 | const QPixmap pixmap = gui::utils::get_centered_pixmap(icon_path, icon_size, 0, 0, 1.0, Qt::SmoothTransformation); 14 | Q_EMIT signal_icon_update(pixmap); 15 | })); 16 | m_thread->start(); 17 | }; 18 | 19 | label = new QLabel(this); 20 | QVBoxLayout* layout = new QVBoxLayout(this); 21 | layout->setContentsMargins(0, 0, 0, 0); 22 | layout->addWidget(label); 23 | setLayout(layout); 24 | } 25 | 26 | screenshot_item::~screenshot_item() 27 | { 28 | if (m_thread && m_thread->isRunning()) 29 | { 30 | m_thread->wait(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/screenshot_item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "flow_widget_item.h" 4 | #include 5 | #include 6 | 7 | class screenshot_item : public flow_widget_item 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | screenshot_item(QWidget* parent); 13 | virtual ~screenshot_item(); 14 | 15 | QString icon_path; 16 | QSize icon_size; 17 | QLabel* label{}; 18 | 19 | private: 20 | std::unique_ptr m_thread; 21 | 22 | Q_SIGNALS: 23 | void signal_icon_update(const QPixmap& pixmap); 24 | }; 25 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/screenshot_preview.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class screenshot_preview : public QLabel 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | screenshot_preview(const QString& filepath, QWidget* parent = nullptr); 12 | 13 | protected: 14 | void resizeEvent(QResizeEvent* event) override; 15 | 16 | private Q_SLOTS: 17 | void show_context_menu(const QPoint& pos); 18 | 19 | private: 20 | void scale(const QSize& size); 21 | 22 | QString m_filepath; 23 | QImage m_image; 24 | double m_factor = 1.0; 25 | bool m_stretch = false; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/shortcut_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gui_settings.h" 4 | 5 | #include 6 | 7 | namespace Ui 8 | { 9 | class shortcut_dialog; 10 | } 11 | 12 | class shortcut_dialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit shortcut_dialog(const std::shared_ptr gui_settings, QWidget* parent = nullptr); 18 | ~shortcut_dialog(); 19 | 20 | Q_SIGNALS: 21 | void saved(); 22 | 23 | private: 24 | void save(); 25 | 26 | Ui::shortcut_dialog* ui; 27 | std::shared_ptr m_gui_settings; 28 | std::map m_values; 29 | 30 | private Q_SLOTS: 31 | void handle_change(const QKeySequence& keySequence); 32 | }; 33 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/shortcut_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gui_settings.h" 4 | #include "shortcut_settings.h" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | class shortcut_handler : public QObject 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | shortcut_handler(gui::shortcuts::shortcut_handler_id handler_id, QObject* parent, const std::shared_ptr& gui_settings); 17 | 18 | Q_SIGNALS: 19 | void shortcut_activated(gui::shortcuts::shortcut shortcut_key, const QKeySequence& key_sequence); 20 | 21 | public Q_SLOTS: 22 | void update(); 23 | 24 | private: 25 | void handle_shortcut(gui::shortcuts::shortcut shortcut_key, const QKeySequence& key_sequence); 26 | 27 | gui::shortcuts::shortcut_handler_id m_handler_id; 28 | std::shared_ptr m_gui_settings; 29 | 30 | struct shortcut_key_info 31 | { 32 | QShortcut* shortcut = nullptr; 33 | QKeySequence key_sequence{}; 34 | shortcut_info info{}; 35 | }; 36 | std::map m_shortcuts; 37 | }; 38 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/shortcut_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gui::utils 4 | { 5 | enum shortcut_location 6 | { 7 | desktop, 8 | applications, 9 | #ifdef _WIN32 10 | rpcs3_shortcuts, 11 | #endif 12 | }; 13 | 14 | bool create_shortcut(const std::string& name, 15 | const std::string& serial, 16 | const std::string& target_cli_args, 17 | const std::string& description, 18 | const std::string& src_icon_path, 19 | const std::string& target_icon_dir, 20 | shortcut_location shortcut_location); 21 | } 22 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/system_cmd_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class system_cmd_dialog : public QDialog 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | system_cmd_dialog(QWidget* parent = nullptr); 13 | ~system_cmd_dialog(); 14 | 15 | private Q_SLOTS: 16 | void send_command(); 17 | void send_custom_command(); 18 | 19 | private: 20 | void send_cmd(qulonglong status, qulonglong param) const; 21 | qulonglong hex_value(QString text, bool& ok) const; 22 | 23 | QLineEdit* m_value_input = nullptr; 24 | QLineEdit* m_custom_command_input = nullptr; 25 | QComboBox* m_command_box = nullptr; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/table_item_delegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | /** This class is used to get rid of somewhat ugly item focus rectangles. You could change the rectangle instead of omiting it if you wanted */ 7 | class table_item_delegate : public QStyledItemDelegate 8 | { 9 | public: 10 | explicit table_item_delegate(QObject *parent = nullptr, bool has_icons = false); 11 | 12 | void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override; 13 | 14 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 15 | 16 | protected: 17 | bool m_has_icons{}; 18 | }; 19 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/tooltips.cpp: -------------------------------------------------------------------------------- 1 | #include "tooltips.h" 2 | 3 | Tooltips::Tooltips() 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/trophy_notification_frame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Cell/Modules/sceNpTrophy.h" 4 | 5 | #include 6 | 7 | class trophy_notification_frame : public QWidget 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | trophy_notification_frame(const std::vector& imgBuffer, const SceNpTrophyDetails& trophy, int height); 13 | }; 14 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/trophy_notification_helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include "Emu/Cell/Modules/sceNpTrophy.h" 5 | 6 | #include 7 | #include 8 | 9 | class trophy_notification_helper : public TrophyNotificationBase 10 | { 11 | public: 12 | explicit trophy_notification_helper(QWindow* game_window) : m_game_window(game_window) { } 13 | s32 ShowTrophyNotification(const SceNpTrophyDetails& trophy, const std::vector& trophy_icon_buffer) override; 14 | private: 15 | QWindow* m_game_window; 16 | }; 17 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/user_account.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | #include 6 | #include 7 | 8 | // Do not confuse this with the "user" in Emu/System.h. 9 | // That user is read from config.yml, and it only represents the currently "logged in" user. 10 | // The user_account class will represent all users in the home directory for the User Manager dialog. 11 | // Selecting a user account in this dialog and saving writes it to config.yml. 12 | class user_account 13 | { 14 | public: 15 | explicit user_account(const std::string& user_id = "00000001"); 16 | 17 | const std::string& GetUserId() const { return m_user_id; } 18 | const std::string& GetUserDir() const { return m_user_dir; } 19 | const std::string& GetUsername() const { return m_username; } 20 | 21 | static std::map GetUserAccounts(const std::string& base_dir); 22 | 23 | private: 24 | std::string m_user_id; 25 | std::string m_user_dir; 26 | std::string m_username; 27 | }; 28 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/uuid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gui 4 | { 5 | namespace utils 6 | { 7 | std::string get_uuid_path(); 8 | std::string make_uuid(); 9 | std::string load_uuid(); 10 | 11 | bool validate_uuid(const std::string& uuid); 12 | bool save_uuid(const std::string& uuid); 13 | bool create_new_uuid(std::string& uuid); 14 | 15 | void log_uuid(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class gui_settings; 6 | 7 | class vfs_dialog : public QDialog 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit vfs_dialog(std::shared_ptr _gui_settings, QWidget* parent = nullptr); 13 | private: 14 | std::shared_ptr m_gui_settings; 15 | }; 16 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_dialog_tab.cpp: -------------------------------------------------------------------------------- 1 | #include "vfs_dialog_tab.h" 2 | #include "Utilities/Config.h" 3 | 4 | vfs_dialog_tab::vfs_dialog_tab(const QString& name, gui_save list_location, cfg::string* cfg_node, std::shared_ptr _gui_settings, QWidget* parent) 5 | : vfs_dialog_path_widget(name, QString::fromStdString(cfg_node->to_string()), QString::fromStdString(cfg_node->def), std::move(list_location), std::move(_gui_settings), parent) 6 | , m_cfg_node(cfg_node) 7 | { 8 | } 9 | 10 | void vfs_dialog_tab::set_settings() const 11 | { 12 | m_gui_settings->SetValue(m_list_location, get_dir_list()); 13 | m_cfg_node->from_string(get_selected_path()); 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_dialog_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vfs_dialog_path_widget.h" 4 | 5 | #include 6 | 7 | namespace cfg 8 | { 9 | class string; 10 | } 11 | 12 | class gui_settings; 13 | 14 | class vfs_dialog_tab : public vfs_dialog_path_widget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit vfs_dialog_tab(const QString& name, gui_save list_location, cfg::string* cfg_node, std::shared_ptr _gui_settings, QWidget* parent = nullptr); 20 | 21 | void set_settings() const; 22 | 23 | private: 24 | cfg::string* m_cfg_node; 25 | }; 26 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_dialog_usb_input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vfs_dialog_path_widget.h" 4 | 5 | #include 6 | #include 7 | 8 | namespace cfg 9 | { 10 | struct device_info; 11 | } 12 | 13 | class gui_settings; 14 | 15 | class vfs_dialog_usb_input : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit vfs_dialog_usb_input(const QString& name, const cfg::device_info& default_info, cfg::device_info* info, std::shared_ptr _gui_settings, QWidget* parent = nullptr); 21 | 22 | private: 23 | std::shared_ptr m_gui_settings; 24 | gui_save m_gui_save; 25 | vfs_dialog_path_widget* m_path_widget; 26 | QLineEdit* m_vid_edit = nullptr; 27 | QLineEdit* m_pid_edit = nullptr; 28 | QLineEdit* m_serial_edit = nullptr; 29 | }; 30 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_dialog_usb_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gui_settings.h" 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | namespace cfg 11 | { 12 | class device_entry; 13 | } 14 | 15 | class vfs_dialog_usb_tab : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit vfs_dialog_usb_tab(cfg::device_entry* cfg_node, std::shared_ptr _gui_settings, QWidget* parent = nullptr); 21 | 22 | void set_settings() const; 23 | 24 | // Reset this tab without saving the settings yet 25 | void reset() const; 26 | 27 | protected: 28 | void mouseDoubleClickEvent(QMouseEvent* ev) override; 29 | 30 | private: 31 | void show_usb_input_dialog(int index); 32 | void show_context_menu(const QPoint& pos); 33 | void double_clicked_slot(QTableWidgetItem* item); 34 | 35 | cfg::device_entry* m_cfg_node; 36 | std::shared_ptr m_gui_settings; 37 | QTableWidget* m_usb_table; 38 | }; 39 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_tool_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui 6 | { 7 | class vfs_tool_dialog; 8 | } 9 | 10 | class vfs_tool_dialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | vfs_tool_dialog(QWidget *parent); 16 | virtual ~vfs_tool_dialog(); 17 | 18 | private: 19 | std::unique_ptr ui; 20 | 21 | private Q_SLOTS: 22 | void handle_vfs_path(const QString& path); 23 | }; 24 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/video_label.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "qt_video_source.h" 4 | #include 5 | #include 6 | #include 7 | 8 | class video_label : public QLabel, public qt_video_source 9 | { 10 | public: 11 | video_label(QWidget* parent = nullptr); 12 | virtual ~video_label(); 13 | 14 | void set_thumbnail(const QPixmap& pxmap); 15 | void set_active(bool active) override; 16 | 17 | void enterEvent(QEnterEvent* event) override; 18 | void leaveEvent(QEvent* event) override; 19 | 20 | private: 21 | QPixmap m_current_pixmap; 22 | }; 23 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/welcome_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui 6 | { 7 | class welcome_dialog; 8 | } 9 | 10 | class gui_settings; 11 | 12 | class welcome_dialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit welcome_dialog(std::shared_ptr gui_settings, bool is_manual_show, QWidget* parent = nullptr); 18 | ~welcome_dialog(); 19 | 20 | private: 21 | std::unique_ptr ui; 22 | std::shared_ptr m_gui_settings; 23 | }; 24 | -------------------------------------------------------------------------------- /rpcs3/tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /rpcs3/tests/test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char** argv) 4 | { 5 | ::testing::InitGoogleTest(&argc, argv); 6 | 7 | return RUN_ALL_TESTS(); 8 | } 9 | -------------------------------------------------------------------------------- /rpcs3/update_helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This script copies the new app over the old app and launches it. 3 | # This is required since invalidating the code signing of an app by 4 | # replacing it while it is running can result in the app being killed. 5 | 6 | if [ "$#" -ne 2 ]; then 7 | echo "Usage: update_helper.sh " 8 | exit 1 9 | fi 10 | new_app="$1/" 11 | old_app="$2/" 12 | 13 | cp -Rf -p "$new_app" "$old_app" 14 | open -n -a "$2" --args --updating 15 | -------------------------------------------------------------------------------- /rpcs3/util/bless.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace utils 4 | { 5 | // Hack. Pointer cast util to workaround UB. Use with extreme care. 6 | template 7 | [[nodiscard]] T* bless(U* ptr) 8 | { 9 | #ifdef _MSC_VER 10 | return (T*)ptr; 11 | #elif defined(ARCH_X64) 12 | T* result; 13 | __asm__("movq %1, %0;" : "=r" (result) : "r" (ptr) : "memory"); 14 | return result; 15 | #elif defined(ARCH_ARM64) 16 | T* result; 17 | __asm__("mov %0, %1" : "=r" (result) : "r" (ptr) : "memory"); 18 | return result; 19 | #else 20 | #error "Missing utils::bless() implementation" 21 | #endif 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /rpcs3/util/console.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace utils 6 | { 7 | enum console_stream 8 | { 9 | std_out = 0x01, 10 | std_err = 0x02, 11 | std_in = 0x04, 12 | }; 13 | 14 | void attach_console(int stream, bool open_console); 15 | 16 | void output_stderr(std::string_view str, bool with_endline = false); 17 | } 18 | -------------------------------------------------------------------------------- /rpcs3/util/cpu_stats.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | #include 5 | 6 | #ifdef _WIN32 7 | #include 8 | #include 9 | #endif 10 | 11 | namespace utils 12 | { 13 | class cpu_stats 14 | { 15 | u64 m_last_cpu = 0; 16 | u64 m_sys_cpu = 0; 17 | u64 m_usr_cpu = 0; 18 | 19 | #ifdef _WIN32 20 | PDH_HQUERY m_cpu_query = nullptr; 21 | PDH_HCOUNTER m_cpu_cores = nullptr; 22 | #elif __linux__ 23 | size_t m_previous_idle_time_total = 0; 24 | size_t m_previous_total_time_total = 0; 25 | std::vector m_previous_idle_times_per_cpu; 26 | std::vector m_previous_total_times_per_cpu; 27 | #endif 28 | 29 | public: 30 | cpu_stats(); 31 | ~cpu_stats(); 32 | 33 | double get_usage(); 34 | 35 | void init_cpu_query(); 36 | void get_per_core_usage(std::vector& per_core_usage, double& total_usage); 37 | 38 | static u32 get_current_thread_count(); 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /rpcs3/util/fence.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | #ifdef _M_X64 6 | #ifdef _MSC_VER 7 | extern "C" void _mm_lfence(); 8 | #else 9 | #include 10 | #endif 11 | #endif 12 | 13 | namespace utils 14 | { 15 | inline void lfence() 16 | { 17 | #ifdef _M_X64 18 | _mm_lfence(); 19 | #elif defined(ARCH_X64) 20 | __builtin_ia32_lfence(); 21 | #elif defined(ARCH_ARM64) 22 | // TODO 23 | __asm__ volatile("isb"); 24 | #else 25 | #error "Missing lfence() implementation" 26 | #endif 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /rpcs3/util/tsc.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "util/types.hpp" 4 | 5 | #ifdef _M_X64 6 | #ifdef _MSC_VER 7 | extern "C" u64 __rdtsc(); 8 | #else 9 | #include 10 | #endif 11 | #endif 12 | 13 | namespace utils 14 | { 15 | inline u64 get_tsc() 16 | { 17 | #if defined(ARCH_ARM64) 18 | u64 r = 0; 19 | __asm__ volatile("mrs %0, cntvct_el0" : "=r" (r)); 20 | return r; 21 | #elif defined(_M_X64) 22 | return __rdtsc(); 23 | #elif defined(ARCH_X64) 24 | return __builtin_ia32_rdtsc(); 25 | #else 26 | #error "Missing utils::get_tsc() implementation" 27 | #endif 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /rpcs3/util/video_source.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.hpp" 4 | #include 5 | 6 | class video_source 7 | { 8 | public: 9 | video_source() {}; 10 | virtual ~video_source() {}; 11 | virtual void set_video_path(const std::string& video_path) = 0; 12 | virtual void set_active(bool active) = 0; 13 | virtual bool get_active() const = 0; 14 | virtual bool has_new() const = 0; 15 | virtual void get_image(std::vector& data, int& w, int& h, int& ch, int& bpp) = 0; 16 | 17 | void set_update_callback(std::function callback) 18 | { 19 | m_update_callback = callback; 20 | } 21 | 22 | protected: 23 | void notify_update() 24 | { 25 | if (m_update_callback) 26 | { 27 | m_update_callback(); 28 | } 29 | } 30 | 31 | private: 32 | std::function m_update_callback; 33 | }; 34 | -------------------------------------------------------------------------------- /rpcs3/windows.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qt/etc/qt.conf 4 | 5 | 6 | -------------------------------------------------------------------------------- /usertype.dat: -------------------------------------------------------------------------------- 1 | throw_exception 2 | rethrow_exception 3 | --------------------------------------------------------------------------------