├── rpcs3 ├── stdafx.cpp ├── Emu │ ├── Cell │ │ ├── Modules │ │ │ ├── cellSpursJq.h │ │ │ ├── cellFontFT.h │ │ │ ├── libsynth2.h │ │ │ ├── libad_billboard_util.cpp │ │ │ ├── sceNpUtil.h │ │ │ ├── cellScreenshot.h │ │ │ ├── cellGcmSys.h │ │ │ ├── cellImeJp.h │ │ │ ├── StaticHLE.h │ │ │ ├── cellCelpEnc.h │ │ │ ├── cellSpudll.h │ │ │ ├── cellLibprof.cpp │ │ │ ├── cellSysutilNpEula.cpp │ │ │ ├── cellBgdl.h │ │ │ ├── cellSysconf.h │ │ │ ├── cellVideoUpload.cpp │ │ │ ├── cellFs.h │ │ │ ├── sys_net_.h │ │ │ ├── cellCelp8Enc.h │ │ │ ├── cellRtcAlarm.cpp │ │ │ ├── cellKb.h │ │ │ ├── cellRtc.h │ │ │ ├── libad_async.cpp │ │ │ ├── cellBgdl.cpp │ │ │ ├── cellSysconf.cpp │ │ │ ├── cellJpgEnc.h │ │ │ ├── cellSysutilMisc.cpp │ │ │ ├── cellScreenshot.cpp │ │ │ ├── libsnd3.h │ │ │ ├── cellOvis.cpp │ │ │ ├── sceNpTus.h │ │ │ ├── sys_libc.cpp │ │ │ ├── libad_core.cpp │ │ │ ├── sys_spinlock.cpp │ │ │ ├── cellUsbd.h │ │ │ ├── cellUserInfo.h │ │ │ ├── cellNetAoi.cpp │ │ │ ├── cellCrossController.cpp │ │ │ ├── cellCelp8Enc.cpp │ │ │ ├── cellMouse.h │ │ │ └── cellCelpEnc.cpp │ │ ├── RawSPUThread.h │ │ ├── lv2 │ │ │ ├── sys_gamepad.h │ │ │ ├── sys_time.h │ │ │ ├── sys_dbg.h │ │ │ ├── sys_gpio.h │ │ │ ├── sys_ss.h │ │ │ ├── sys_trace.h │ │ │ ├── sys_tty.h │ │ │ ├── sys_gpio.cpp │ │ │ ├── sys_interrupt.h │ │ │ ├── sys_overlay.h │ │ │ ├── sys_trace.cpp │ │ │ ├── sys_lwcond.h │ │ │ ├── sys_cond.h │ │ │ ├── sys_semaphore.h │ │ │ ├── sys_rwlock.h │ │ │ └── sys_timer.h │ │ ├── SPUDisAsm.cpp │ │ ├── Common.h │ │ └── SPUAnalyser.cpp │ ├── RSX │ │ ├── VK │ │ │ ├── VulkanAPI.cpp │ │ │ ├── VKMemAlloc.cpp │ │ │ ├── VKCommonDecompiler.h │ │ │ ├── VKRenderPass.h │ │ │ ├── VulkanAPI.h │ │ │ ├── VKResourceManager.cpp │ │ │ ├── VKFramebuffer.h │ │ │ ├── VKFormats.h │ │ │ └── VKDMA.h │ │ ├── Common │ │ │ ├── ShaderParam.cpp │ │ │ └── GLSLTypes.h │ │ ├── GL │ │ │ ├── GLCommonDecompiler.h │ │ │ ├── GLCommonDecompiler.cpp │ │ │ ├── OpenGL.h │ │ │ └── OpenGL.cpp │ │ ├── gcm_printing.h │ │ ├── Null │ │ │ ├── NullGSRender.h │ │ │ └── NullGSRender.cpp │ │ ├── D3D12 │ │ │ ├── D3D12CommonDecompiler.h │ │ │ ├── D3D12FragmentProgramDecompiler.h │ │ │ └── D3D12VertexProgramDecompiler.h │ │ ├── Capture │ │ │ ├── rsx_capture.h │ │ │ └── rsx_trace.h │ │ └── GSRender.cpp │ ├── Io │ │ ├── Null │ │ │ ├── NullMouseHandler.h │ │ │ ├── NullKeyboardHandler.h │ │ │ └── NullPadHandler.h │ │ └── Skylander.h │ ├── Audio │ │ ├── Pulse │ │ │ └── PulseBackend.h │ │ ├── Null │ │ │ └── NullAudioBackend.h │ │ ├── AudioDumper.cpp │ │ ├── ALSA │ │ │ └── ALSABackend.h │ │ ├── AL │ │ │ └── OpenALBackend.h │ │ ├── XAudio2 │ │ │ └── XAudio2Backend.h │ │ └── AudioDumper.h │ ├── GameInfo.h │ ├── VFS.h │ ├── Memory │ │ ├── vm_locking.h │ │ └── vm_reservation.h │ └── CPU │ │ └── CPUDisAsm.h ├── qt │ └── etc │ │ └── qt.conf ├── rpcs3.ico ├── rpcs3.png ├── rpcs3.icns ├── Icons │ ├── grid.png │ ├── list.png │ ├── open.png │ ├── play.png │ ├── stop.png │ ├── pause.png │ ├── refresh.png │ ├── restart.png │ ├── configure.png │ ├── insignia.png │ ├── controller.png │ ├── controllers.png │ ├── fullscreen.png │ ├── controllers_2.png │ ├── custom_config.png │ ├── custom_config_2.png │ ├── exit_fullscreen.png │ └── combo_config_bordered.png ├── rpcs3.rc ├── windows.qrc ├── rpcs3_version.h ├── restore_new.h ├── define_new_memleakdetect.h ├── rpcs3.desktop ├── rpcs3qt │ ├── about_dialog.h │ ├── save_data_dialog.h │ ├── trophy_notification_frame.h │ ├── kernel_explorer.h │ ├── custom_dialog.h │ ├── welcome_dialog.h │ ├── vfs_dialog.h │ ├── memory_string_searcher.h │ ├── _discord_utils.h │ ├── game_list.h │ ├── trophy_notification_helper.h │ ├── input_dialog.h │ ├── save_data_info_dialog.h │ ├── breakpoint_handler.cpp │ ├── gl_gs_frame.h │ ├── osk_dialog_frame.h │ ├── game_list_grid_delegate.h │ ├── instruction_editor_dialog.h │ ├── find_dialog.h │ ├── game_list_grid.h │ ├── user_account.h │ ├── custom_dialog.cpp │ ├── user_account.cpp │ ├── trophy_notification_helper.cpp │ ├── progress_dialog.h │ ├── register_editor_dialog.h │ ├── _discord_utils.cpp │ ├── breakpoint_list.h │ ├── cg_disasm_window.h │ ├── memory_viewer_panel.h │ ├── welcome_dialog.cpp │ ├── syntax_highlighter.h │ ├── save_data_dialog.cpp │ ├── about_dialog.cpp │ ├── input_dialog.cpp │ ├── save_data_list_dialog.h │ ├── breakpoint_handler.h │ ├── custom_table_widget_item.h │ ├── table_item_delegate.h │ ├── debugger_list.h │ ├── vfs_dialog_tab.h │ ├── auto_pause_settings_dialog.h │ ├── user_manager_dialog.h │ └── skylander_dialog.h ├── stdafx_d3d12.h ├── resource.h ├── rpcs3_version.cpp ├── main_application.h ├── Crypto │ ├── ec.h │ └── lz.h ├── basic_keyboard_handler.h ├── OpenAL.vcxproj.filters ├── basic_mouse_handler.h ├── headless_application.h ├── Loader │ ├── PUP.h │ ├── TRP.h │ ├── PUP.cpp │ ├── TAR.h │ └── ELF.cpp ├── XAudio.vcxproj.filters ├── stb_image.cpp ├── resources.qrc ├── rpcs3.plist.in ├── stdafx.h └── GLGSRender.vcxproj.filters ├── usertype.dat ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE.md ├── .mention-bot ├── bin ├── OpenAL32.dll ├── Icons │ └── ui │ │ ├── L1.png │ │ ├── L2.png │ │ ├── R1.png │ │ ├── R2.png │ │ ├── new.png │ │ ├── circle.png │ │ ├── cross.png │ │ ├── dpad.png │ │ ├── save.png │ │ ├── select.png │ │ ├── square.png │ │ ├── start.png │ │ ├── dpad_up.png │ │ ├── fade_top.png │ │ ├── triangle.png │ │ ├── dpad_down.png │ │ ├── dpad_left.png │ │ ├── dpad_right.png │ │ ├── fade_bottom.png │ │ ├── left_stick.png │ │ └── right_stick.png ├── GuiConfigs │ ├── YoRHa-background.jpg │ └── Dark Orange (Hollow)-background.jpg └── dev_hdd0 │ └── game │ └── TEST12345 │ └── USRDIR │ ├── rpcsp.elf │ ├── pad_test.elf │ ├── pspgame.elf │ ├── dump_stack.elf │ ├── gs_gcm_cube.elf │ ├── ppu_thread.elf │ ├── spurs_test.self │ ├── gs_gcm_tetris.elf │ ├── gs_gcm_hello_world.elf │ ├── gs_gcm_basic_triangle.elf │ └── gs_gcm_handle_system_cmd.elf ├── 3rdparty ├── minidx12 │ └── Lib │ │ ├── d2d1.lib │ │ ├── dxgi.lib │ │ └── dwrite.lib ├── OpenAL │ ├── libs │ │ └── Win64 │ │ │ └── OpenAL32.lib │ └── include │ │ └── efx-creative.h ├── discord-rpc │ ├── lib │ │ ├── discord-rpc.lib │ │ ├── libdiscord-rpc-mac.a │ │ └── libdiscord-rpc-linux.a │ └── include │ │ └── discord_register.h ├── XAudio2_7 │ └── dxsdkver.h └── hidapi.vcxproj.filters ├── .editorconfig ├── Vulkan ├── glslang-build │ └── glslang-build.vcxproj.filters └── CMakeLists.txt ├── Utilities ├── GSL.h ├── rXml.h ├── bin_patch.h ├── date_time.h ├── sysinfo.h ├── Interval.h ├── hash.h ├── version.cpp ├── version.h ├── sema.cpp ├── dynamic_library.cpp ├── Timer.h └── rXml.cpp ├── .travis ├── travis.env ├── build-mac.bash └── build-linux.bash ├── pre-commit.readme ├── rpcs3_memleak.props ├── common_default_macros.props ├── asmjitsrc └── CMakeLists.txt ├── common_default.props ├── rpcs3_debug.props ├── rpcs3_release.props ├── llvm_build ├── llvm_build.vcxproj.filters └── UpdateProjectFiles.bat ├── .clang-format ├── .travis.yml └── rpcs3_llvm.props /rpcs3/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSpursJq.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VulkanAPI.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /usertype.dat: -------------------------------------------------------------------------------- 1 | throw_exception 2 | rethrow_exception 3 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/RawSPUThread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SPUThread.h" 4 | -------------------------------------------------------------------------------- /rpcs3/qt/etc/qt.conf: -------------------------------------------------------------------------------- 1 | [Paths] 2 | Prefix = qt/ 3 | Plugins = plugins 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: Nekotekina 2 | custom: https://rpcs3.net/alipay 3 | -------------------------------------------------------------------------------- /.mention-bot: -------------------------------------------------------------------------------- 1 | { 2 | "userBlacklist": ["AlexAltea", "tambry", "DHrpcs3"] 3 | } 4 | -------------------------------------------------------------------------------- /rpcs3/rpcs3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/rpcs3.ico -------------------------------------------------------------------------------- /rpcs3/rpcs3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/rpcs3.png -------------------------------------------------------------------------------- /bin/OpenAL32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/OpenAL32.dll -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Common/ShaderParam.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ShaderParam.h" -------------------------------------------------------------------------------- /rpcs3/rpcs3.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/rpcs3.icns -------------------------------------------------------------------------------- /bin/Icons/ui/L1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/L1.png -------------------------------------------------------------------------------- /bin/Icons/ui/L2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/L2.png -------------------------------------------------------------------------------- /bin/Icons/ui/R1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/R1.png -------------------------------------------------------------------------------- /bin/Icons/ui/R2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/R2.png -------------------------------------------------------------------------------- /bin/Icons/ui/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/new.png -------------------------------------------------------------------------------- /rpcs3/Icons/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/grid.png -------------------------------------------------------------------------------- /rpcs3/Icons/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/list.png -------------------------------------------------------------------------------- /rpcs3/Icons/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/open.png -------------------------------------------------------------------------------- /rpcs3/Icons/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/play.png -------------------------------------------------------------------------------- /rpcs3/Icons/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/stop.png -------------------------------------------------------------------------------- /bin/Icons/ui/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/circle.png -------------------------------------------------------------------------------- /bin/Icons/ui/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/cross.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/dpad.png -------------------------------------------------------------------------------- /bin/Icons/ui/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/save.png -------------------------------------------------------------------------------- /bin/Icons/ui/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/select.png -------------------------------------------------------------------------------- /bin/Icons/ui/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/square.png -------------------------------------------------------------------------------- /bin/Icons/ui/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/start.png -------------------------------------------------------------------------------- /rpcs3/Icons/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/pause.png -------------------------------------------------------------------------------- /rpcs3/Icons/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/refresh.png -------------------------------------------------------------------------------- /rpcs3/Icons/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/restart.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/dpad_up.png -------------------------------------------------------------------------------- /bin/Icons/ui/fade_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/fade_top.png -------------------------------------------------------------------------------- /bin/Icons/ui/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/triangle.png -------------------------------------------------------------------------------- /rpcs3/Icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/configure.png -------------------------------------------------------------------------------- /rpcs3/Icons/insignia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/insignia.png -------------------------------------------------------------------------------- /rpcs3/rpcs3.rc: -------------------------------------------------------------------------------- 1 | #include "resource.h" 2 | IDI_ICON1 ICON "rpcs3.ico" 3 | frame_icon ICON "rpcs3.ico" 4 | -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/dpad_down.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/dpad_left.png -------------------------------------------------------------------------------- /bin/Icons/ui/dpad_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/dpad_right.png -------------------------------------------------------------------------------- /bin/Icons/ui/fade_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/fade_bottom.png -------------------------------------------------------------------------------- /bin/Icons/ui/left_stick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/left_stick.png -------------------------------------------------------------------------------- /bin/Icons/ui/right_stick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/Icons/ui/right_stick.png -------------------------------------------------------------------------------- /rpcs3/Icons/controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/controller.png -------------------------------------------------------------------------------- /rpcs3/Icons/controllers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/controllers.png -------------------------------------------------------------------------------- /rpcs3/Icons/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/fullscreen.png -------------------------------------------------------------------------------- /3rdparty/minidx12/Lib/d2d1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/3rdparty/minidx12/Lib/d2d1.lib -------------------------------------------------------------------------------- /3rdparty/minidx12/Lib/dxgi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/3rdparty/minidx12/Lib/dxgi.lib -------------------------------------------------------------------------------- /rpcs3/Icons/controllers_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/controllers_2.png -------------------------------------------------------------------------------- /rpcs3/Icons/custom_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/custom_config.png -------------------------------------------------------------------------------- /3rdparty/minidx12/Lib/dwrite.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/3rdparty/minidx12/Lib/dwrite.lib -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKMemAlloc.cpp: -------------------------------------------------------------------------------- 1 | #define VMA_IMPLEMENTATION 2 | #include "3rdparty/GPUOpen/include/vk_mem_alloc.h" 3 | -------------------------------------------------------------------------------- /rpcs3/Icons/custom_config_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/custom_config_2.png -------------------------------------------------------------------------------- /rpcs3/Icons/exit_fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/exit_fullscreen.png -------------------------------------------------------------------------------- /bin/GuiConfigs/YoRHa-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/GuiConfigs/YoRHa-background.jpg -------------------------------------------------------------------------------- /rpcs3/Icons/combo_config_bordered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/rpcs3/Icons/combo_config_bordered.png -------------------------------------------------------------------------------- /3rdparty/OpenAL/libs/Win64/OpenAL32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/3rdparty/OpenAL/libs/Win64/OpenAL32.lib -------------------------------------------------------------------------------- /3rdparty/discord-rpc/lib/discord-rpc.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/3rdparty/discord-rpc/lib/discord-rpc.lib -------------------------------------------------------------------------------- /rpcs3/windows.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qt/etc/qt.conf 4 | 5 | 6 | -------------------------------------------------------------------------------- /3rdparty/discord-rpc/lib/libdiscord-rpc-mac.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/3rdparty/discord-rpc/lib/libdiscord-rpc-mac.a -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/rpcsp.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/rpcsp.elf -------------------------------------------------------------------------------- /3rdparty/discord-rpc/lib/libdiscord-rpc-linux.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/3rdparty/discord-rpc/lib/libdiscord-rpc-linux.a -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/pad_test.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/pad_test.elf -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/pspgame.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/pspgame.elf -------------------------------------------------------------------------------- /bin/GuiConfigs/Dark Orange (Hollow)-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/GuiConfigs/Dark Orange (Hollow)-background.jpg -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/dump_stack.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/dump_stack.elf -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_cube.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_cube.elf -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/ppu_thread.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/ppu_thread.elf -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/spurs_test.self: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/spurs_test.self -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{h,cpp,hpp}] 4 | charset = utf-8-bom 5 | indent_style = tab 6 | indent_size = 4 7 | trim_trailing_whitespace = true 8 | -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_tetris.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_tetris.elf -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_hello_world.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_hello_world.elf -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_basic_triangle.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_basic_triangle.elf -------------------------------------------------------------------------------- /bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_handle_system_cmd.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zangetsu38/rpcs3/HEAD/bin/dev_hdd0/game/TEST12345/USRDIR/gs_gcm_handle_system_cmd.elf -------------------------------------------------------------------------------- /Vulkan/glslang-build/glslang-build.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /3rdparty/OpenAL/include/efx-creative.h: -------------------------------------------------------------------------------- 1 | /* The tokens that would be defined here are already defined in efx.h. This 2 | * empty file is here to provide compatibility with Windows-based projects 3 | * that would include it. */ 4 | -------------------------------------------------------------------------------- /Utilities/GSL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define GSL_THROW_ON_CONTRACT_VIOLATION 4 | 5 | #pragma push_macro("new") 6 | #undef new 7 | #include 8 | #pragma pop_macro("new") 9 | #undef Expects 10 | #undef Ensures 11 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_gamepad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Cell/ErrorCodes.h" 4 | #include "Emu/Memory/vm_ptr.h" 5 | 6 | //Syscalls 7 | 8 | u32 sys_gamepad_ycon_if(uint8_t packet_id, vm::ptr in, vm::ptr out); 9 | -------------------------------------------------------------------------------- /.travis/travis.env: -------------------------------------------------------------------------------- 1 | # Variables set by Travis CI 2 | TRAVIS_PULL_REQUEST 3 | TRAVIS_BRANCH 4 | TRAVIS_COMMIT 5 | # Variables for Travis build matrix 6 | COMPILER 7 | DEPLOY_APPIMAGE 8 | # Private Travis CI variables 9 | GITHUB_TOKEN 10 | -------------------------------------------------------------------------------- /rpcs3/rpcs3_version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace rpcs3 7 | { 8 | std::string get_branch(); 9 | 10 | extern const utils::version version; 11 | } 12 | -------------------------------------------------------------------------------- /rpcs3/restore_new.h: -------------------------------------------------------------------------------- 1 | //Restore the new operator if previously saved before overriding 2 | //Allow the use of placement new 3 | #if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && defined(DBG_NEW) 4 | #pragma pop_macro("new") 5 | #endif 6 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/gcm_printing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace rsx 7 | { 8 | std::string get_method_name(u32 id); 9 | 10 | std::function get_pretty_printing_function(u32 id); 11 | } 12 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_time.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // SysCalls 6 | s32 sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime); 7 | s32 sys_time_get_current_time(vm::ptr sec, vm::ptr nsec); 8 | u64 sys_time_get_timebase_frequency(); 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/SPUDisAsm.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "SPUDisAsm.h" 3 | 4 | const spu_decoder s_spu_disasm; 5 | 6 | u32 SPUDisAsm::disasm(u32 pc) 7 | { 8 | const u32 op = *(be_t*)(offset + pc); 9 | (this->*(s_spu_disasm.decode(op)))({ op }); 10 | return 4; 11 | } 12 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_dbg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // Syscalls 6 | 7 | error_code sys_dbg_read_process_memory(s32 pid, u32 address, u32 size, vm::ptr data); 8 | error_code sys_dbg_write_process_memory(s32 pid, u32 address, u32 size, vm::cptr data); 9 | -------------------------------------------------------------------------------- /rpcs3/define_new_memleakdetect.h: -------------------------------------------------------------------------------- 1 | //Override the new operator to use the memory leak detection from visual studio 2 | //Does not work with placement new 3 | #if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && defined(DBG_NEW) 4 | #pragma push_macro("new") 5 | #define new DBG_NEW 6 | #endif 7 | -------------------------------------------------------------------------------- /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 | NullGSRender(); 9 | 10 | private: 11 | bool do_method(u32 cmd, u32 value) final; 12 | void end() override; 13 | }; 14 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/Emu/Cell/lv2/sys_gpio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | enum : u64 6 | { 7 | SYS_GPIO_UNKNOWN_DEVICE_ID, 8 | SYS_GPIO_LED_DEVICE_ID, 9 | SYS_GPIO_DIP_SWITCH_DEVICE_ID, 10 | }; 11 | 12 | error_code sys_gpio_get(u64 device_id, vm::ptr value); 13 | error_code sys_gpio_set(u64 device_id, u64 mask, u64 value); 14 | -------------------------------------------------------------------------------- /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 | public: 8 | void Init(const u32 max_connect) override 9 | { 10 | memset(&m_info, 0, sizeof(MouseInfo)); 11 | m_info.max_connect = max_connect; 12 | m_mice.clear(); 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /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 | Ui::about_dialog *ui; 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/save_data_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/Memory/vm.h" 5 | #include "Emu/Cell/Modules/cellSaveData.h" 6 | 7 | class save_data_dialog : public SaveDialogBase 8 | { 9 | public: 10 | virtual s32 ShowSaveDataList(std::vector& save_entries, s32 focused, u32 op, vm::ptr listSet) override; 11 | }; 12 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/trophy_notification_frame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/Memory/vm.h" 5 | #include "Emu/Cell/Modules/sceNpTrophy.h" 6 | 7 | #include 8 | 9 | class trophy_notification_frame : public QWidget 10 | { 11 | public: 12 | trophy_notification_frame(const std::vector& imgBuffer, const SceNpTrophyDetails& trophy, int height); 13 | }; -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/kernel_explorer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class kernel_explorer : public QDialog 10 | { 11 | Q_OBJECT 12 | 13 | QTreeWidget* m_tree; 14 | 15 | public: 16 | kernel_explorer(QWidget* parent); 17 | private Q_SLOTS: 18 | void Update(); 19 | }; 20 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/types.h" 4 | 5 | // Floating-point rounding mode (for both PPU and SPU) 6 | enum FPSCR_RN 7 | { 8 | FPSCR_RN_NEAR = 0, 9 | FPSCR_RN_ZERO = 1, 10 | FPSCR_RN_PINF = 2, 11 | FPSCR_RN_MINF = 3, 12 | }; 13 | 14 | // Get the exponent of a float 15 | inline int fexpf(float x) 16 | { 17 | return (std::bit_cast(x) >> 23) & 0xff; 18 | } 19 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_ss.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | #include "Emu/Cell/ErrorCodes.h" 5 | 6 | struct CellSsOpenPSID 7 | { 8 | be_t high; 9 | be_t low; 10 | }; 11 | 12 | error_code sys_ss_random_number_generator(u32 arg1, vm::ptr buf, u64 size); 13 | s32 sys_ss_get_console_id(vm::ptr buf); 14 | s32 sys_ss_get_open_psid(vm::ptr ptr); 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/SPUAnalyser.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "SPUAnalyser.h" 3 | 4 | template <> 5 | void fmt_class_string::format(std::string& out, u64 arg) 6 | { 7 | // Decode instruction name from the enum value 8 | for (u32 i = 0; i < 10; i++) 9 | { 10 | if (u64 value = (arg >> (54 - i * 6)) & 0x3f) 11 | { 12 | out += static_cast(value + 0x20); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /rpcs3/stdafx_d3d12.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _MSC_VER 4 | 5 | // Must be included first 6 | #include 7 | 8 | #include 9 | #include "Emu/RSX/D3D12/D3D12Utils.h" 10 | #include "Emu/RSX/D3D12/D3D12Formats.h" 11 | #include "Emu/RSX/D3D12/D3D12GSRender.h" 12 | 13 | #pragma comment(lib, "d2d1") 14 | #pragma comment(lib, "DXGI") 15 | #pragma comment(lib, "Dwrite") 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_trace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/types.h" 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/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/welcome_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Ui 8 | { 9 | class welcome_dialog; 10 | } 11 | 12 | class welcome_dialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit welcome_dialog(QWidget* parent = nullptr); 18 | ~welcome_dialog(); 19 | 20 | private: 21 | Ui::welcome_dialog *ui; 22 | }; 23 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKCommonDecompiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Common/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 | bool compile_glsl_to_spv(std::string& shader, program_domain domain, std::vector &spv); 10 | 11 | void initialize_compiler_context(); 12 | void finalize_compiler_context(); 13 | } 14 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/D3D12/D3D12CommonDecompiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Common/ShaderParam.h" 4 | #include "../Common/GLSLCommon.h" 5 | 6 | std::string getFloatTypeNameImp(size_t elementCount); 7 | std::string getFunctionImp(FUNCTION f); 8 | std::string compareFunctionImp(COMPARE f, const std::string &Op0, const std::string &Op1); 9 | 10 | void insert_d3d12_legacy_function(std::ostream&, bool is_fragment_program); 11 | -------------------------------------------------------------------------------- /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/rpcs3_version.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "rpcs3_version.h" 3 | #include "git-version.h" 4 | 5 | namespace rpcs3 6 | { 7 | std::string get_branch() 8 | { 9 | return RPCS3_GIT_BRANCH; 10 | } 11 | 12 | //TODO: Make this accessible from cmake and keep in sync with MACOSX_BUNDLE_BUNDLE_VERSION. 13 | const extern utils::version version{ 0, 0, 7, utils::version_type::alpha, 1, RPCS3_GIT_VERSION }; 14 | } 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKRenderPass.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "VKHelpers.h" 4 | 5 | namespace vk 6 | { 7 | u64 get_renderpass_key(const std::vector& images); 8 | u64 get_renderpass_key(const std::vector& images, u64 previous_key); 9 | u64 get_renderpass_key(VkFormat surface_format); 10 | VkRenderPass get_renderpass(VkDevice dev, u64 renderpass_key); 11 | 12 | void clear_renderpass_cache(VkDevice dev); 13 | } 14 | -------------------------------------------------------------------------------- /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 | public: 8 | void Init(const u32 max_connect) override 9 | { 10 | memset(&m_info, 0, sizeof(KbInfo)); 11 | m_info.max_connect = max_connect; 12 | m_keyboards.clear(); 13 | for(u32 i=0; i 13 | #include 14 | #include "define_new_memleakdetect.h" 15 | #include "Utilities/types.h" 16 | 17 | namespace vk 18 | { 19 | void init(); 20 | } 21 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vfs_dialog_tab.h" 4 | 5 | #include 6 | #include 7 | 8 | class vfs_dialog : public QDialog 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | explicit vfs_dialog(std::shared_ptr guiSettings, std::shared_ptr emuSettings, QWidget* parent = nullptr); 14 | private: 15 | std::shared_ptr m_gui_settings; 16 | std::shared_ptr m_emu_settings; 17 | }; 18 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/memory_string_searcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/Memory/vm.h" 5 | #include "Emu/System.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class memory_string_searcher : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | QLineEdit* m_addr_line; 17 | 18 | public: 19 | memory_string_searcher(QWidget* parent); 20 | 21 | private Q_SLOTS: 22 | void OnSearch(); 23 | }; 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/libsynth2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/BEType.h" 4 | 5 | // Error Codes 6 | enum 7 | { 8 | CELL_SOUND_SYNTH2_ERROR_FATAL = 0x80310201, 9 | CELL_SOUND_SYNTH2_ERROR_INVALID_PARAMETER = 0x80310202, 10 | CELL_SOUND_SYNTH2_ERROR_ALREADY_INITIALIZED = 0x80310203, 11 | }; 12 | 13 | struct CellSoundSynth2EffectAttr 14 | { 15 | be_t core; 16 | be_t mode; 17 | be_t depth_L; 18 | be_t depth_R; 19 | be_t delay; 20 | be_t feedback; 21 | }; 22 | -------------------------------------------------------------------------------- /rpcs3_memleak.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | MSVC_CRT_MEMLEAK_DETECTION;%(PreprocessorDefinitions) 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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/Null/NullGSRender.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "NullGSRender.h" 3 | #include "Emu/System.h" 4 | 5 | u64 NullGSRender::get_cycles() 6 | { 7 | return thread_ctrl::get_cycles(static_cast&>(*this)); 8 | } 9 | 10 | NullGSRender::NullGSRender() : GSRender() 11 | { 12 | } 13 | 14 | bool NullGSRender::do_method(u32 cmd, u32 value) 15 | { 16 | return false; 17 | } 18 | 19 | void NullGSRender::end() 20 | { 21 | rsx::method_registers.current_draw_clause.end(); 22 | } 23 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/_discord_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 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/Emu/Cell/Modules/libad_billboard_util.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | LOG_CHANNEL(libad_billboard_util); 6 | 7 | s32 libad_billboard_util_47BC7BED() //Pain 8 | { 9 | libad_billboard_util.todo("libad_billboard_util_47BC7BED"); 10 | return CELL_OK; 11 | } 12 | 13 | 14 | DECLARE(ppu_module_manager::libad_billboard_util)("libad_billboard_util", []() 15 | { 16 | REG_FNID(libad_billboard_util, 0x47BC7BED, libad_billboard_util_47BC7BED); 17 | }); 18 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sceNpUtil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | enum 6 | { 7 | SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_NONE = 0, 8 | SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_RUNNING = 1, 9 | SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_FINISHED = 2 10 | }; 11 | 12 | struct SceNpUtilBandwidthTestResult 13 | { 14 | be_t upload_bps; 15 | be_t download_bps; 16 | be_t result; 17 | }; 18 | 19 | // fxm objects 20 | 21 | struct sce_np_util_manager 22 | { 23 | std::atomic is_initialized = false; 24 | }; 25 | -------------------------------------------------------------------------------- /rpcs3/main_application.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include 5 | #include "Emu/System.h" 6 | 7 | class main_application 8 | { 9 | public: 10 | virtual void Init() = 0; 11 | 12 | static bool InitializeEmulator(const std::string& user, bool force_init); 13 | 14 | protected: 15 | virtual QThread* get_thread() = 0; 16 | 17 | EmuCallbacks CreateCallbacks(); 18 | 19 | QWindow* m_game_window = nullptr; // (Currently) only needed so that pad handlers have a valid target for event filtering. 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/game_list.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | /* 7 | class used in order to get deselection 8 | if you know a simpler way, tell @Megamouse 9 | */ 10 | class game_list : public QTableWidget 11 | { 12 | private: 13 | void mousePressEvent(QMouseEvent *event) override 14 | { 15 | if (!indexAt(event->pos()).isValid() || itemAt(event->pos())->data(Qt::UserRole) < 0) 16 | { 17 | clearSelection(); 18 | } 19 | QTableWidget::mousePressEvent(event); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/trophy_notification_helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/Memory/vm.h" 5 | #include "Emu/Cell/Modules/sceNpTrophy.h" 6 | 7 | #include 8 | 9 | class trophy_notification_helper : public TrophyNotificationBase 10 | { 11 | public: 12 | 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 | -------------------------------------------------------------------------------- /common_default_macros.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | $(DefaultPlatformToolset) 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellScreenshot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // Return Codes 6 | enum 7 | { 8 | CELL_SCREENSHOT_ERROR_INTERNAL = 0x8002d101, 9 | CELL_SCREENSHOT_ERROR_PARAM = 0x8002d102, 10 | CELL_SCREENSHOT_ERROR_DECODE = 0x8002d103, 11 | CELL_SCREENSHOT_ERROR_NOSPACE = 0x8002d104, 12 | CELL_SCREENSHOT_ERROR_UNSUPPORTED_COLOR_FORMAT = 0x8002d105, 13 | }; 14 | 15 | struct CellScreenShotSetParam 16 | { 17 | vm::bcptr photo_title; 18 | vm::bcptr game_title; 19 | vm::bcptr game_comment; 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/input_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class input_dialog : public QDialog 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | input_dialog(int max_length, const QString& text, const QString& title, const QString& label, const QString& placeholder, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 14 | ~input_dialog(); 15 | 16 | private: 17 | QString m_text; 18 | 19 | Q_SIGNALS: 20 | void text_changed(const QString& text); 21 | }; 22 | -------------------------------------------------------------------------------- /3rdparty/XAudio2_7/dxsdkver.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * 4 | * File: dxsdkver.h 5 | * Content: DirectX SDK Version Include File 6 | * 7 | ****************************************************************************/ 8 | 9 | #ifndef _DXSDKVER_H_ 10 | #define _DXSDKVER_H_ 11 | 12 | #define _DXSDK_PRODUCT_MAJOR 9 13 | #define _DXSDK_PRODUCT_MINOR 29 14 | #define _DXSDK_BUILD_MAJOR 1962 15 | #define _DXSDK_BUILD_MINOR 0 16 | 17 | #endif // _DXSDKVER_H_ 18 | 19 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/save_data_info_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // I just want the struct for the save data. 4 | #include "stdafx.h" 5 | #include "Emu/Memory/vm.h" 6 | #include "Emu/Cell/Modules/cellSaveData.h" 7 | 8 | #include 9 | #include 10 | 11 | //Used to display the information of a savedata. 12 | class save_data_info_dialog :public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit save_data_info_dialog(const SaveDataEntry& save, QWidget* parent = nullptr); 18 | private: 19 | void UpdateData(); 20 | 21 | SaveDataEntry m_entry; 22 | QTableWidget* m_list; 23 | }; 24 | -------------------------------------------------------------------------------- /Vulkan/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "Skip installation" FORCE) 2 | set(ENABLE_SPVREMAPPER OFF CACHE BOOL "Enables building of SPVRemapper" FORCE) 3 | set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "Builds glslangValidator and spirv-remap" FORCE) 4 | set(ENABLE_OPT OFF CACHE BOOL "Enables spirv-opt capability if present" FORCE) 5 | set(ENABLE_HLSL OFF CACHE BOOL "Enables HLSL input support" FORCE) 6 | set(ENABLE_AMD_EXTENSIONS ON CACHE BOOL "Enables support of AMD-specific extensions" FORCE) 7 | set(ENABLE_NV_EXTENSIONS ON CACHE BOOL "Enables support of Nvidia-specific extensions" FORCE) 8 | add_subdirectory(glslang) 9 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKResourceManager.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "VKResourceManager.h" 3 | 4 | namespace vk 5 | { 6 | resource_manager g_resource_manager; 7 | atomic_t g_event_ctr; 8 | 9 | resource_manager* get_resource_manager() 10 | { 11 | return &g_resource_manager; 12 | } 13 | 14 | u64 get_event_id() 15 | { 16 | return g_event_ctr++; 17 | } 18 | 19 | u64 current_event_id() 20 | { 21 | return g_event_ctr.load(); 22 | } 23 | 24 | void on_event_completed(u64 event_id) 25 | { 26 | // TODO: Offload this to a secondary thread 27 | g_resource_manager.eid_completed(event_id); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /rpcs3/Crypto/ec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Copyright (C) 2014 Hykem 4 | // Licensed under the terms of the GNU GPL, version 3 5 | // http://www.gnu.org/licenses/gpl-3.0.txt 6 | 7 | #include 8 | #include 9 | 10 | int ecdsa_set_curve(unsigned char *p, unsigned char *a, unsigned char *b, unsigned char *N, unsigned char *Gx, unsigned char *Gy); 11 | void ecdsa_set_pub(unsigned char *Q); 12 | void ecdsa_set_priv(unsigned char *k); 13 | int ecdsa_verify(unsigned char *hash, unsigned char *R, unsigned char *S); 14 | void ecdsa_sign(unsigned char *hash, unsigned char *R, unsigned char *S); 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKFramebuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "VKHelpers.h" 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, VkRenderPass renderpass, const std::vector& image_list); 13 | vk::framebuffer_holder* get_framebuffer(VkDevice dev, u16 width, u16 height, VkRenderPass renderpass, VkFormat format, VkImage attachment); 14 | 15 | void remove_unused_framebuffers(); 16 | void clear_framebuffer_cache(); 17 | } 18 | -------------------------------------------------------------------------------- /asmjitsrc/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_DIR "${CMAKE_SOURCE_DIR}/asmjit" CACHE PATH "Location of 'asmjit'") 7 | 8 | include("${ASMJIT_DIR}/CMakeLists.txt") 9 | 10 | add_library(asmjit ${ASMJIT_SRC}) 11 | target_include_directories(asmjit PUBLIC ${ASMJIT_DIR}/src) 12 | target_link_libraries(asmjit PRIVATE ${ASMJIT_DEPS}) 13 | 14 | # ASMJIT should have a option for disabling installing and this wouldnt 15 | # be required to avoid installing ASMJIT... 16 | 17 | add_library(3rdparty::asmjit ALIAS asmjit) 18 | -------------------------------------------------------------------------------- /common_default.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10.0 8 | 9 | 10 | 11 | stdcpp17 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellGcmSys.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/RSX/GCM.h" 4 | #include "Emu/Memory/vm_ptr.h" 5 | 6 | enum 7 | { 8 | CELL_GCM_ERROR_FAILURE = 0x802100ff, 9 | CELL_GCM_ERROR_NO_IO_PAGE_TABLE = 0x80210001, 10 | CELL_GCM_ERROR_INVALID_ENUM = 0x80210002, 11 | CELL_GCM_ERROR_INVALID_VALUE = 0x80210003, 12 | CELL_GCM_ERROR_INVALID_ALIGNMENT = 0x80210004, 13 | CELL_GCM_ERROR_ADDRESS_OVERWRAP = 0x80210005, 14 | }; 15 | 16 | struct CellGcmOffsetTable 17 | { 18 | vm::bptr ioAddress; 19 | vm::bptr eaAddress; 20 | }; 21 | 22 | void InitOffsetTable(); 23 | 24 | // Auxiliary functions 25 | s32 gcmMapEaIoAddress(u32 ea, u32 io, u32 size, bool is_strict); 26 | -------------------------------------------------------------------------------- /Utilities/rXml.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct rXmlNode 6 | { 7 | rXmlNode(); 8 | rXmlNode(const pugi::xml_node &); 9 | std::shared_ptr GetChildren(); 10 | std::shared_ptr GetNext(); 11 | std::string GetName(); 12 | std::string GetAttribute( const std::string &name); 13 | std::string GetNodeContent(); 14 | 15 | pugi::xml_node handle; 16 | }; 17 | 18 | struct rXmlDocument 19 | { 20 | rXmlDocument(); 21 | rXmlDocument(const rXmlDocument& other) = delete; 22 | rXmlDocument &operator=(const rXmlDocument& other) = delete; 23 | void Read(const std::string& data); 24 | std::shared_ptr GetRoot(); 25 | 26 | pugi::xml_document handle; 27 | }; 28 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/Pulse/PulseBackend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef HAVE_PULSE 4 | #include 5 | #include "Emu/Audio/AudioBackend.h" 6 | 7 | class PulseBackend : public AudioBackend 8 | { 9 | public: 10 | PulseBackend(); 11 | virtual ~PulseBackend() override; 12 | 13 | virtual const char* GetName() const override { return "Pulse"; } 14 | 15 | static const u32 capabilities = 0; 16 | virtual u32 GetCapabilities() const override { return capabilities; } 17 | 18 | virtual void Open(u32) override; 19 | virtual void Close() override; 20 | 21 | virtual bool AddData(const void* src, u32 num_samples) override; 22 | 23 | private: 24 | pa_simple *connection = nullptr; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /rpcs3/Emu/Io/Null/NullPadHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/PadHandler.h" 4 | 5 | class NullPadHandler final : public PadHandlerBase 6 | { 7 | public: 8 | bool Init() override 9 | { 10 | return true; 11 | } 12 | 13 | void init_config(pad_config* /*cfg*/, const std::string& /*name*/) override 14 | { 15 | } 16 | 17 | std::vector ListDevices() override 18 | { 19 | std::vector nulllist; 20 | nulllist.push_back("Default Null Device"); 21 | return nulllist; 22 | } 23 | 24 | bool bindPadToDevice(std::shared_ptr /*pad*/, const std::string& /*device*/) override 25 | { 26 | return true; 27 | } 28 | 29 | void ThreadProc() override 30 | { 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /rpcs3/basic_keyboard_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/Io/KeyboardHandler.h" 5 | 6 | #include 7 | #include 8 | 9 | class basic_keyboard_handler final : public QObject, public KeyboardHandlerBase 10 | { 11 | Q_OBJECT 12 | public: 13 | virtual void Init(const u32 max_connect) override; 14 | 15 | explicit basic_keyboard_handler(); 16 | 17 | void SetTargetWindow(QWindow* target); 18 | bool eventFilter(QObject* obj, QEvent* ev) override; 19 | void keyPressEvent(QKeyEvent* event); 20 | void keyReleaseEvent(QKeyEvent* event); 21 | s32 getUnmodifiedKey(QKeyEvent* event); 22 | void LoadSettings(); 23 | private: 24 | QWindow* m_target = nullptr; 25 | }; 26 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellImeJp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | typedef vm::ptr CellImeJpHandle; 6 | 7 | //Input state of the ImeJp 8 | enum { 9 | CELL_IMEJP_BEFORE_INPUT = 0, 10 | CELL_IMEJP_BEFORE_CONVERT = 1, 11 | CELL_IMEJP_CONVERTING = 2, 12 | CELL_IMEJP_CANDIDATE_EMPTY = 3, 13 | CELL_IMEJP_POSTCONVERT_KANA = 4, 14 | CELL_IMEJP_POSTCONVERT_HALF = 5, 15 | CELL_IMEJP_POSTCONVERT_RAW = 6, 16 | CELL_IMEJP_CANDIDATES = 7, 17 | CELL_IMEJP_MOVE_CLAUSE_GAP = 8, 18 | }; 19 | 20 | //cellImeJpEnterChar, returning values pointed in pOutputStatus. 21 | enum { 22 | CELL_IMEJP_RET_NONE = 0, 23 | CELL_IMEJP_RET_THROUGH = 1, 24 | CELL_IMEJP_RET_CONFIRMED = 2, 25 | }; 26 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/Null/NullAudioBackend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Audio/AudioBackend.h" 4 | 5 | class NullAudioBackend : public AudioBackend 6 | { 7 | public: 8 | NullAudioBackend() {} 9 | virtual ~NullAudioBackend() {} 10 | 11 | virtual const char* GetName() const override { return "Null"; } 12 | 13 | static const u32 capabilities = PLAY_PAUSE_FLUSH; 14 | virtual u32 GetCapabilities() const override { return capabilities; } 15 | 16 | virtual void Open(u32) override {} 17 | virtual void Close() override {} 18 | 19 | virtual void Play() override {} 20 | virtual void Pause() override {} 21 | 22 | virtual bool AddData(const void*, u32) override { return true; } 23 | virtual void Flush() override {} 24 | }; 25 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/AudioDumper.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "AudioDumper.h" 3 | 4 | 5 | AudioDumper::AudioDumper(u16 ch) 6 | : m_header(ch) 7 | { 8 | if (GetCh()) 9 | { 10 | m_output.open(fs::get_cache_dir() + "audio.wav", fs::rewrite); 11 | m_output.write(m_header); // write initial file header 12 | } 13 | } 14 | 15 | AudioDumper::~AudioDumper() 16 | { 17 | if (GetCh()) 18 | { 19 | m_output.seek(0); 20 | m_output.write(m_header); // rewrite file header 21 | } 22 | } 23 | 24 | void AudioDumper::WriteData(const void* buffer, u32 size) 25 | { 26 | if (GetCh()) 27 | { 28 | verify(HERE), size, m_output.write(buffer, size) == size; 29 | m_header.Size += size; 30 | m_header.RIFF.Size += size; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/breakpoint_handler.cpp: -------------------------------------------------------------------------------- 1 | #include "breakpoint_handler.h" 2 | 3 | extern void ppu_breakpoint(u32 loc, bool isAdding); 4 | 5 | breakpoint_handler::breakpoint_handler() :m_breakpoints() 6 | { 7 | 8 | } 9 | 10 | breakpoint_handler::~breakpoint_handler() 11 | { 12 | 13 | } 14 | 15 | bool breakpoint_handler::HasBreakpoint(u32 loc) const 16 | { 17 | return m_breakpoints.find(loc) != m_breakpoints.end(); 18 | } 19 | 20 | bool breakpoint_handler::AddBreakpoint(u32 loc) 21 | { 22 | m_breakpoints.insert(loc); 23 | ppu_breakpoint(loc, true); 24 | return true; 25 | } 26 | 27 | bool breakpoint_handler::RemoveBreakpoint(u32 loc) 28 | { 29 | m_breakpoints.erase(loc); 30 | ppu_breakpoint(loc, false); 31 | return true; 32 | } 33 | -------------------------------------------------------------------------------- /rpcs3_debug.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 11 | _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 12 | Disabled 13 | MultiThreadedDebugDLL 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /rpcs3/OpenAL.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 | 15 | 16 | Source Files 17 | 18 | 19 | -------------------------------------------------------------------------------- /rpcs3/basic_mouse_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/Io/MouseHandler.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class basic_mouse_handler final : public QObject, public MouseHandlerBase 11 | { 12 | Q_OBJECT 13 | public: 14 | virtual void Init(const u32 max_connect) override; 15 | 16 | basic_mouse_handler(); 17 | 18 | void SetTargetWindow(QWindow* target); 19 | void MouseButtonDown(QMouseEvent* event); 20 | void MouseButtonUp(QMouseEvent* event); 21 | void MouseScroll(QWheelEvent* event); 22 | void MouseMove(QMouseEvent* event); 23 | 24 | bool eventFilter(QObject* obj, QEvent* ev) override; 25 | private: 26 | QWindow* m_target = nullptr; 27 | }; 28 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/StaticHLE.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../../Utilities/types.h" 4 | #include "Emu/Cell/PPUModule.h" 5 | #include "Emu/Cell/PPUOpcodes.h" 6 | #include 7 | 8 | struct shle_pattern 9 | { 10 | u16 start_pattern[32]; 11 | u8 crc16_length; 12 | u16 crc16; 13 | u16 total_length; 14 | std::string module; 15 | std::string name; 16 | 17 | u32 fnid; 18 | }; 19 | 20 | class statichle_handler 21 | { 22 | public: 23 | statichle_handler(); 24 | ~statichle_handler(); 25 | 26 | bool load_patterns(); 27 | bool check_against_patterns(vm::cptr& data, u32 size, u32 addr); 28 | 29 | protected: 30 | uint16_t gen_CRC16(const uint8_t* data_p, size_t length); 31 | 32 | std::vector hle_patterns; 33 | }; 34 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/gl_gs_frame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "gs_frame.h" 5 | 6 | struct GLContext 7 | { 8 | QSurface *surface = nullptr; 9 | QOpenGLContext *handle = nullptr; 10 | bool owner = false; 11 | }; 12 | 13 | class gl_gs_frame : public gs_frame 14 | { 15 | private: 16 | QSurfaceFormat m_format; 17 | GLContext *m_primary_context = nullptr; 18 | 19 | public: 20 | gl_gs_frame(const QRect& geometry, const QIcon& appIcon, const std::shared_ptr& gui_settings); 21 | 22 | draw_context_t make_context() override; 23 | void set_current(draw_context_t context) override; 24 | void delete_context(draw_context_t context) override; 25 | void flip(draw_context_t context, bool skip_frame=false) override; 26 | }; 27 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/osk_dialog_frame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/Memory/vm.h" 5 | #include "Emu/Cell/Modules/cellOskDialog.h" 6 | #include "Emu/System.h" 7 | #include "Emu/Cell/lv2/sys_time.h" 8 | 9 | #include "custom_dialog.h" 10 | 11 | class osk_dialog_frame : public QObject, public OskDialogBase 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | osk_dialog_frame(); 17 | ~osk_dialog_frame(); 18 | virtual void Create(const std::string& title, const std::u16string& message, char16_t* init_text, u32 charlimit, u32 options) override; 19 | virtual void Close(bool accepted) override; 20 | 21 | private: 22 | void SetOskText(const QString& text); 23 | 24 | custom_dialog* m_dialog = nullptr; 25 | QString m_text_old; 26 | }; 27 | -------------------------------------------------------------------------------- /3rdparty/discord-rpc/include/discord_register.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(DISCORD_DYNAMIC_LIB) 4 | # if defined(_WIN32) 5 | # if defined(DISCORD_BUILDING_SDK) 6 | # define DISCORD_EXPORT __declspec(dllexport) 7 | # else 8 | # define DISCORD_EXPORT __declspec(dllimport) 9 | # endif 10 | # else 11 | # define DISCORD_EXPORT __attribute__((visibility("default"))) 12 | # endif 13 | #else 14 | # define DISCORD_EXPORT 15 | #endif 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | DISCORD_EXPORT void Discord_Register(const char* applicationId, const char* command); 22 | DISCORD_EXPORT void Discord_RegisterSteamGame(const char* applicationId, const char* steamId); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /Utilities/bin_patch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "BEType.h" 4 | #include 5 | #include 6 | #include 7 | 8 | enum class patch_type 9 | { 10 | load, 11 | byte, 12 | le16, 13 | le32, 14 | le64, 15 | lef32, 16 | lef64, 17 | be16, 18 | be32, 19 | be64, 20 | bef32, 21 | bef64, 22 | }; 23 | 24 | class patch_engine 25 | { 26 | struct patch 27 | { 28 | patch_type type; 29 | u32 offset; 30 | u64 value; 31 | }; 32 | 33 | // Database 34 | std::unordered_map> m_map; 35 | 36 | public: 37 | // Load from file 38 | void append(const std::string& path); 39 | 40 | // Apply patch (returns the number of entries applied) 41 | std::size_t apply(const std::string& name, u8* dst) const; 42 | }; 43 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Common/GLSLTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace glsl 4 | { 5 | enum program_domain 6 | { 7 | glsl_vertex_program = 0, 8 | glsl_fragment_program = 1, 9 | glsl_compute_program = 2 10 | }; 11 | 12 | enum glsl_rules 13 | { 14 | glsl_rules_opengl4, 15 | glsl_rules_spirv 16 | }; 17 | 18 | struct shader_properties 19 | { 20 | glsl::program_domain domain; 21 | // Applicable in vertex stage 22 | bool require_lit_emulation; 23 | 24 | // Only relevant for fragment programs 25 | bool fp32_outputs; 26 | bool require_wpos; 27 | bool require_depth_conversion; 28 | bool require_texture_ops; 29 | bool require_shadow_ops; 30 | bool emulate_coverage_tests; 31 | bool emulate_shadow_compare; 32 | bool low_precision_tests; 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/Capture/rsx_trace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include "Utilities/types.h" 6 | #include "Emu/RSX/rsx_methods.h" 7 | 8 | namespace rsx 9 | { 10 | struct frame_trace_data 11 | { 12 | struct draw_state 13 | { 14 | std::string name; 15 | std::pair programs; 16 | rsx::rsx_state state; 17 | std::array, 4> color_buffer; 18 | std::array, 2> depth_stencil; 19 | std::vector index; 20 | u32 vertex_count; 21 | 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/Cell/Modules/cellCelpEnc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | 5 | // libCelpEnc = 0x80614001 - 0x806140ff 6 | 7 | // Return Codes 8 | enum 9 | { 10 | CELL_CELPENC_ERROR_FAILED = 0x80614001, 11 | CELL_CELPENC_ERROR_SEQ = 0x80614002, 12 | CELL_CELPENC_ERROR_ARG = 0x80614003, 13 | CELL_CELPENC_ERROR_CORE_FAILED = 0x80614081, 14 | CELL_CELPENC_ERROR_CORE_SEQ = 0x80614082, 15 | CELL_CELPENC_ERROR_CORE_ARG = 0x80614083, 16 | }; 17 | 18 | // Definitions 19 | enum 20 | { 21 | CELL_CELPENC_FS_16kHz = 2, 22 | 23 | CELL_CELPENC_EXCITATION_MODE_RPE = 1, 24 | 25 | CELL_CELPENC_RPE_CONFIG_0, 26 | CELL_CELPENC_RPE_CONFIG_1, 27 | CELL_CELPENC_RPE_CONFIG_2, 28 | CELL_CELPENC_RPE_CONFIG_3, 29 | 30 | CELL_CELPENC_WORD_SZ_INI16_LE, 31 | CELL_CELPENC_WORD_SZ_FLOAT, 32 | }; 33 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/ALSA/ALSABackend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef HAVE_ALSA 4 | 5 | #include "Emu/Audio/AudioBackend.h" 6 | 7 | #include 8 | 9 | class ALSABackend : public AudioBackend 10 | { 11 | snd_pcm_t* tls_handle{nullptr}; 12 | snd_pcm_hw_params_t* tls_hw_params{nullptr}; 13 | snd_pcm_sw_params_t* tls_sw_params{nullptr}; 14 | 15 | public: 16 | ALSABackend(); 17 | virtual ~ALSABackend() override; 18 | 19 | virtual const char* GetName() const override { return "ALSA"; } 20 | 21 | static const u32 capabilities = 0; 22 | virtual u32 GetCapabilities() const override { return capabilities; } 23 | 24 | virtual void Open(u32) override; 25 | virtual void Close() override; 26 | 27 | virtual bool AddData(const void* src, u32 num_samples) override; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /rpcs3_release.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Full 9 | true 10 | true 11 | Speed 12 | MultiThreadedDLL 13 | 14 | 15 | true 16 | true 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /rpcs3/Crypto/lz.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Copyright (C) 2014 Hykem 4 | // Licensed under the terms of the GNU GPL, version 3 5 | // http://www.gnu.org/licenses/gpl-3.0.txt 6 | 7 | // Reverse-engineered custom Lempel–Ziv–Markov based compression. 8 | 9 | #include 10 | 11 | void decode_range(unsigned int *range, unsigned int *code, unsigned char **src); 12 | int decode_bit(unsigned int *range, unsigned int *code, int *index, unsigned char **src, unsigned char *c); 13 | int decode_number(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src); 14 | int decode_word(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src); 15 | int decompress(unsigned char *out, unsigned char *in, unsigned int size); 16 | -------------------------------------------------------------------------------- /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/rpcs3qt/game_list_grid_delegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class game_list_grid_delegate : public QStyledItemDelegate 7 | { 8 | public: 9 | game_list_grid_delegate(const QSize& imageSize, const qreal& margin_factor, const qreal& margin_ratio, QObject *parent = 0); 10 | 11 | virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override; 12 | void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override; 13 | QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const override; 14 | void setItemSize(const QSize& size); 15 | virtual ~game_list_grid_delegate(); 16 | private: 17 | QSize m_size; 18 | qreal m_margin_factor; 19 | qreal m_text_factor; 20 | }; 21 | -------------------------------------------------------------------------------- /rpcs3/Emu/GameInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/types.h" 4 | 5 | struct GameInfo 6 | { 7 | std::string path; 8 | 9 | std::string icon_path; 10 | std::string name; 11 | std::string serial; 12 | std::string app_ver; 13 | std::string version; 14 | std::string category; 15 | std::string fw; 16 | 17 | u32 attr = 0; 18 | u32 bootable = 0; 19 | u32 parental_lvl = 0; 20 | u32 sound_format = 0; 21 | u32 resolution = 0; 22 | 23 | GameInfo() 24 | { 25 | Reset(); 26 | } 27 | 28 | void Reset() 29 | { 30 | path.clear(); 31 | 32 | name = "Unknown"; 33 | serial = "Unknown"; 34 | app_ver = "Unknown"; 35 | version = "Unknown"; 36 | category = "Unknown"; 37 | fw = "Unknown"; 38 | 39 | attr = 0; 40 | bootable = 0; 41 | parental_lvl = 0; 42 | sound_format = 0; 43 | resolution = 0; 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/instruction_editor_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/System.h" 5 | #include "Emu/Memory/vm.h" 6 | #include "Emu/CPU/CPUThread.h" 7 | #include "Emu/CPU/CPUDisAsm.h" 8 | #include "Emu/Cell/PPUThread.h" 9 | #include "Emu/Cell/SPUThread.h" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | class instruction_editor_dialog : public QDialog 19 | { 20 | u32 m_pc; 21 | u32 m_cpu_offset; 22 | CPUDisAsm* m_disasm; 23 | QLineEdit* m_instr; 24 | QLabel* m_preview; 25 | 26 | public: 27 | std::weak_ptr cpu; 28 | 29 | public: 30 | instruction_editor_dialog(QWidget *parent, u32 _pc, const std::shared_ptr& _cpu, CPUDisAsm* _disasm); 31 | 32 | void updatePreview(); 33 | }; 34 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellLibprof.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | LOG_CHANNEL(cellLibprof); 5 | 6 | s32 cellUserTraceInit() 7 | { 8 | UNIMPLEMENTED_FUNC(cellLibprof); 9 | return CELL_OK; 10 | } 11 | 12 | s32 cellUserTraceRegister() 13 | { 14 | UNIMPLEMENTED_FUNC(cellLibprof); 15 | return CELL_OK; 16 | } 17 | 18 | s32 cellUserTraceUnregister() 19 | { 20 | UNIMPLEMENTED_FUNC(cellLibprof); 21 | return CELL_OK; 22 | } 23 | 24 | s32 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/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 | public: 12 | find_dialog(QTextEdit* edit, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); 13 | ~find_dialog(); 14 | 15 | private: 16 | int m_count_lines = 0; 17 | int m_count_total = 0; 18 | QLabel* m_label_count_lines; 19 | QLabel* m_label_count_total; 20 | QTextEdit* m_text_edit; 21 | QLineEdit* m_find_bar; 22 | QPushButton* m_find_first; 23 | QPushButton* m_find_last; 24 | QPushButton* m_find_next; 25 | QPushButton* m_find_previous; 26 | 27 | private Q_SLOTS: 28 | int count_all(); 29 | void find_first(); 30 | void find_last(); 31 | void find_next(); 32 | void find_previous(); 33 | void show_count(); 34 | }; 35 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSysutilNpEula.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | LOG_CHANNEL(cellSysutilNpEula); 5 | 6 | s32 cellSysutilNpEula_59D1629A() // Resistance 3, Uncharted 2 7 | { 8 | cellSysutilNpEula.todo("cellSysutilNpEula_59D1629A"); 9 | return CELL_OK; 10 | } 11 | 12 | s32 sceNpEulaAbort() 13 | { 14 | UNIMPLEMENTED_FUNC(cellSysutilNpEula); 15 | return CELL_OK; 16 | } 17 | 18 | s32 cellSysutilNpEula_6599500D() // Resistance 3, Uncharted 2 19 | { 20 | cellSysutilNpEula.todo("cellSysutilNpEula_6599500D"); 21 | return CELL_OK; 22 | } 23 | 24 | DECLARE(ppu_module_manager::cellSysutilNpEula)("cellSysutilNpEula", []() 25 | { 26 | REG_FNID(cellSysutilNpEula, 0x59D1629A, cellSysutilNpEula_59D1629A); 27 | REG_FUNC(cellSysutilNpEula, sceNpEulaAbort); 28 | REG_FNID(cellSysutilNpEula, 0x6599500D, cellSysutilNpEula_6599500D); 29 | }); 30 | -------------------------------------------------------------------------------- /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/Io/Skylander.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Io/usb_device.h" 4 | #include 5 | #include 6 | 7 | struct sky_portal 8 | { 9 | std::mutex sky_mutex; 10 | fs::file sky_file; 11 | bool sky_reload = false; 12 | u8 sky_dump[0x40 * 0x10] = {}; 13 | 14 | void sky_save(); 15 | void sky_load(); 16 | }; 17 | 18 | extern sky_portal g_skylander; 19 | 20 | class usb_device_skylander : public usb_device_emulated 21 | { 22 | public: 23 | usb_device_skylander(); 24 | ~usb_device_skylander(); 25 | 26 | void control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue, u16 wIndex, u16 wLength, u32 buf_size, u8* buf, UsbTransfer* transfer) override; 27 | void interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer) override; 28 | 29 | protected: 30 | u8 interrupt_counter = 0; 31 | std::queue> q_queries; 32 | }; 33 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/game_list_grid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "game_list.h" 4 | #include "game_list_grid_delegate.h" 5 | 6 | #include 7 | #include 8 | 9 | class game_list_grid : public game_list 10 | { 11 | Q_OBJECT 12 | 13 | QSize m_icon_size; 14 | QColor m_icon_color; 15 | qreal m_margin_factor; 16 | qreal m_text_factor; 17 | bool m_text_enabled = true; 18 | 19 | public: 20 | explicit game_list_grid(const QSize& icon_size, const QColor& icon_color, const qreal& margin_factor, const qreal& text_factor, const bool& showText); 21 | ~game_list_grid(); 22 | 23 | void enableText(const bool& enabled); 24 | void setIconSize(const QSize& size); 25 | void addItem(const QPixmap& img, const QString& name, const int& row, const int& col); 26 | 27 | qreal getMarginFactor(); 28 | 29 | private: 30 | game_list_grid_delegate* grid_item_delegate; 31 | }; 32 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/user_account.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/System.h" 4 | #include "Utilities/File.h" 5 | #include "Utilities/StrFmt.h" 6 | 7 | // Do not confuse this with the "user" in Emu/System.h. 8 | // That user is read from config.yml, and it only represents the currently "logged in" user. 9 | // The UserAccount class will represent all users in the home directory for the User Manager dialog. 10 | // Selecting a user account in this dialog and saving writes it to config.yml. 11 | class UserAccount 12 | { 13 | public: 14 | explicit UserAccount(const std::string& user_id = "00000001"); 15 | 16 | std::string GetUserId() { return m_user_id; } 17 | std::string GetUserDir() { return m_user_dir; } 18 | std::string GetUsername() { return m_username; } 19 | ~UserAccount(); 20 | 21 | private: 22 | std::string m_user_id; 23 | std::string m_user_dir; 24 | std::string m_username; 25 | }; 26 | -------------------------------------------------------------------------------- /llvm_build/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 | -------------------------------------------------------------------------------- /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 34 | { 35 | CELL_SYSCONF_ERROR_PARAM = 0x8002bb01 36 | }; 37 | -------------------------------------------------------------------------------- /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 | // SysCalls 29 | error_code sys_tty_read(s32 ch, vm::ptr buf, u32 len, vm::ptr preadlen); 30 | error_code sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwritelen); 31 | -------------------------------------------------------------------------------- /rpcs3/headless_application.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | #include 6 | 7 | #include "main_application.h" 8 | 9 | /** Headless RPCS3 Application Class 10 | * The main point of this class is to do application initialization and initialize callbacks. 11 | */ 12 | 13 | class headless_application : public QCoreApplication, public main_application 14 | { 15 | Q_OBJECT 16 | public: 17 | headless_application(int& argc, char** argv); 18 | 19 | /** Call this method before calling app.exec */ 20 | void Init() override; 21 | 22 | private: 23 | void InitializeCallbacks(); 24 | void InitializeConnects(); 25 | 26 | QThread* get_thread() override 27 | { 28 | return thread(); 29 | }; 30 | 31 | Q_SIGNALS: 32 | void RequestCallAfter(const std::function& func); 33 | 34 | private Q_SLOTS: 35 | void HandleCallAfter(const std::function& func); 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/user_account.cpp: -------------------------------------------------------------------------------- 1 | #include "user_account.h" 2 | 3 | UserAccount::UserAccount(const std::string& user_id) 4 | { 5 | // Setting userId. 6 | m_user_id = user_id; 7 | 8 | // Setting userDir. 9 | m_user_dir = Emulator::GetHddDir() + "home/" + m_user_id + "/"; 10 | 11 | // Setting userName. 12 | fs::file file; 13 | if (file.open(m_user_dir + "localusername", fs::read)) 14 | { 15 | m_username = file.to_string(); 16 | file.close(); 17 | 18 | if (m_username.length() > 16) // max of 16 chars on real PS3 19 | { 20 | m_username = m_username.substr(0, 16); 21 | LOG_WARNING(GENERAL, "UserAccount: localusername of userId=%s was too long, cropped to: %s", m_user_id, m_username); 22 | } 23 | } 24 | else 25 | { 26 | LOG_ERROR(GENERAL, "UserAccount: localusername file read error (userId=%s, userDir=%s).", m_user_id, m_user_dir); 27 | } 28 | } 29 | 30 | UserAccount::~UserAccount() 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/trophy_notification_helper.cpp: -------------------------------------------------------------------------------- 1 | #include "trophy_notification_helper.h" 2 | 3 | #include "trophy_notification_frame.h" 4 | 5 | #include "../Emu/System.h" 6 | #include "../Emu/RSX/Overlays/overlays.h" 7 | 8 | s32 trophy_notification_helper::ShowTrophyNotification(const SceNpTrophyDetails& trophy, const std::vector& trophy_icon_buffer) 9 | { 10 | if (auto manager = g_fxo->get()) 11 | { 12 | return manager->create()->show(trophy, trophy_icon_buffer); 13 | } 14 | 15 | Emu.CallAfter([=] 16 | { 17 | trophy_notification_frame* trophy_notification = new trophy_notification_frame(trophy_icon_buffer, trophy, m_game_window->frameGeometry().height() / 10); 18 | 19 | // Move notification to upper lefthand corner 20 | trophy_notification->move(m_game_window->mapToGlobal(QPoint(0, 0))); 21 | trophy_notification->show(); 22 | }); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/progress_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | #include 6 | 7 | #ifdef _WIN32 8 | #include 9 | #include 10 | #include 11 | #include 12 | #elif HAVE_QTDBUS 13 | #include 14 | #include 15 | #endif 16 | 17 | class progress_dialog : public QProgressDialog 18 | { 19 | public: 20 | progress_dialog(const QString &labelText, const QString &cancelButtonText, int minimum, int maximum, QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags()); 21 | ~progress_dialog(); 22 | void SetValue(int progress); 23 | 24 | private: 25 | #ifdef _WIN32 26 | std::unique_ptr m_tb_button = nullptr; 27 | QWinTaskbarProgress* m_tb_progress = nullptr; 28 | #elif HAVE_QTDBUS 29 | void UpdateProgress(int progress, bool disable = false); 30 | #endif 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" HERE, varying_register_name); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rpcs3/Loader/PUP.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../../Utilities/types.h" 4 | #include "../../Utilities/File.h" 5 | 6 | #include 7 | 8 | struct PUPHeader 9 | { 10 | le_t magic; 11 | be_t package_version; 12 | be_t image_version; 13 | be_t file_count; 14 | be_t header_length; 15 | be_t data_length; 16 | }; 17 | 18 | struct PUPFileEntry 19 | { 20 | be_t entry_id; 21 | be_t data_offset; 22 | be_t data_length; 23 | u8 padding[8]; 24 | }; 25 | 26 | struct PUPHashEntry 27 | { 28 | be_t entry_id; 29 | u8 hash[20]; 30 | u8 padding[4]; 31 | }; 32 | 33 | class pup_object 34 | { 35 | const fs::file& m_file; 36 | bool isValid = true; 37 | 38 | std::vector m_file_tbl; 39 | std::vector m_hash_tbl; 40 | 41 | public: 42 | pup_object(const fs::file& file); 43 | 44 | explicit operator bool() const { return isValid; } 45 | 46 | fs::file get_file(u64 entry_id); 47 | }; 48 | -------------------------------------------------------------------------------- /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(const std::string& dest, bool show = false); 34 | bool LoadHeader(bool show = false); 35 | u64 GetRequiredSpace() const; 36 | 37 | bool ContainsEntry(const char *filename); 38 | void RemoveEntry(const char *filename); 39 | void RenameEntry(const char *oldname, const char *newname); 40 | }; 41 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellVideoUpload.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | #include "cellVideoUpload.h" 5 | #include "cellSysutil.h" 6 | 7 | LOG_CHANNEL(cellVideoUpload); 8 | 9 | error_code cellVideoUploadInitialize(vm::cptr pParam, vm::ptr cb, vm::ptr userdata) 10 | { 11 | cellVideoUpload.todo("cellVideoUploadInitialize(pParam=*0x%x, cb=*0x%x, userdata=*0x%x)", pParam, cb, userdata); 12 | 13 | sysutil_register_cb([=](ppu_thread& ppu) -> s32 14 | { 15 | vm::var pResultURL(128); 16 | 17 | cb(ppu, CELL_VIDEO_UPLOAD_STATUS_INITIALIZED, CELL_OK, pResultURL, userdata); 18 | cb(ppu, CELL_VIDEO_UPLOAD_STATUS_FINALIZED, CELL_OK, pResultURL, userdata); 19 | 20 | return CELL_OK; 21 | }); 22 | 23 | return CELL_OK; 24 | } 25 | 26 | DECLARE(ppu_module_manager::cellVideoUpload)("cellVideoUpload", []() 27 | { 28 | REG_FUNC(cellVideoUpload, cellVideoUploadInitialize); 29 | }); 30 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/register_editor_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/System.h" 5 | #include "Emu/CPU/CPUThread.h" 6 | #include "Emu/CPU/CPUDisAsm.h" 7 | #include "Emu/Cell/PPUThread.h" 8 | #include "Emu/Cell/SPUThread.h" 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | class register_editor_dialog : public QDialog 19 | { 20 | Q_OBJECT 21 | 22 | u32 m_pc; 23 | CPUDisAsm* m_disasm; 24 | QComboBox* m_register_combo; 25 | QLineEdit* m_value_line; 26 | 27 | public: 28 | std::weak_ptr cpu; 29 | 30 | public: 31 | register_editor_dialog(QWidget *parent, u32 _pc, const std::shared_ptr& _cpu, CPUDisAsm* _disasm); 32 | 33 | private: 34 | void OnOkay(const std::shared_ptr& _cpu); 35 | 36 | private Q_SLOTS: 37 | void updateRegister(const QString& text); 38 | }; 39 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellFs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Cell/lv2/sys_fs.h" 4 | #include "Emu/Memory/vm_ptr.h" 5 | 6 | // CellFsRingBuffer.copy 7 | enum : s32 8 | { 9 | CELL_FS_ST_COPY = 0, 10 | CELL_FS_ST_COPYLESS = 1, 11 | }; 12 | 13 | struct CellFsRingBuffer 14 | { 15 | be_t ringbuf_size; 16 | be_t block_size; 17 | be_t transfer_rate; 18 | be_t copy; 19 | }; 20 | 21 | // cellFsStReadGetStatus status 22 | enum : u64 23 | { 24 | CELL_FS_ST_INITIALIZED = 0x0001, 25 | CELL_FS_ST_NOT_INITIALIZED = 0x0002, 26 | CELL_FS_ST_STOP = 0x0100, 27 | CELL_FS_ST_PROGRESS = 0x0200, 28 | }; 29 | 30 | enum : s32 31 | { 32 | CELL_FS_AIO_MAX_FS = 10, // cellFsAioInit limit 33 | CELL_FS_AIO_MAX_REQUEST = 32, // cellFsAioRead request limit per mount point 34 | }; 35 | 36 | struct CellFsAio 37 | { 38 | be_t fd; 39 | be_t offset; 40 | vm::bptrb buf; 41 | be_t size; 42 | be_t user_data; 43 | }; 44 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sys_net_.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Cell/lv2/sys_net.h" 4 | #include "Emu/Memory/vm.h" 5 | 6 | struct sys_net_sockinfo_t 7 | { 8 | be_t s; 9 | be_t proto; 10 | be_t recv_queue_length; 11 | be_t send_queue_length; 12 | sys_net_in_addr local_adr; 13 | be_t local_port; 14 | sys_net_in_addr remote_adr; 15 | be_t remote_port; 16 | be_t state; 17 | }; 18 | 19 | struct sys_net_sockinfo_ex_t 20 | { 21 | be_t s; 22 | be_t proto; 23 | be_t recv_queue_length; 24 | be_t send_queue_length; 25 | sys_net_in_addr local_adr; 26 | be_t local_port; 27 | sys_net_in_addr remote_adr; 28 | be_t remote_port; 29 | be_t state; 30 | be_t socket_type; 31 | be_t local_vport; 32 | be_t remote_vport; 33 | be_t reserved[8]; 34 | }; 35 | 36 | struct sys_net_initialize_parameter_t 37 | { 38 | vm::bptr memory; 39 | be_t memory_size; 40 | be_t flags; 41 | }; 42 | -------------------------------------------------------------------------------- /rpcs3/Loader/PUP.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "PUP.h" 4 | 5 | pup_object::pup_object(const fs::file& file): m_file(file) 6 | { 7 | if (!file) 8 | { 9 | isValid = false; 10 | return; 11 | } 12 | 13 | PUPHeader m_header; 14 | m_file.read(m_header); 15 | if (m_header.magic != "SCEUF\0\0\0"_u64) 16 | { 17 | isValid = false; 18 | return; 19 | } 20 | 21 | m_file_tbl.resize(m_header.file_count); 22 | m_file.read(m_file_tbl); 23 | m_hash_tbl.resize(m_header.file_count); 24 | m_file.read(m_hash_tbl); 25 | } 26 | 27 | fs::file pup_object::get_file(u64 entry_id) 28 | { 29 | if (!isValid) return fs::file(); 30 | 31 | for (PUPFileEntry file_entry : m_file_tbl) 32 | { 33 | if (file_entry.entry_id == entry_id) 34 | { 35 | std::vector file_buf(file_entry.data_length); 36 | m_file.seek(file_entry.data_offset); 37 | m_file.read(file_buf, file_entry.data_length); 38 | return fs::make_stream(std::move(file_buf)); 39 | } 40 | } 41 | return fs::file(); 42 | } 43 | -------------------------------------------------------------------------------- /rpcs3/Loader/TAR.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct TARHeader 6 | { 7 | char name[100]; 8 | char dontcare[24]; 9 | char size[12]; 10 | char mtime[12]; 11 | char chksum[8]; 12 | char filetype; 13 | char linkname[100]; 14 | char magic[6]; 15 | char dontcare2[82]; 16 | char prefix[155]; 17 | char padding[12]; 18 | }; 19 | 20 | class tar_object 21 | { 22 | const fs::file& m_file; 23 | 24 | int initial_offset; 25 | int largest_offset; //we store the largest offset so we can continue to scan from there. 26 | std::map m_map; //maps path to offset of header of that file, so we only need to scan the entire file once. 27 | 28 | TARHeader read_header(u64 offset); 29 | 30 | public: 31 | tar_object(const fs::file& file, size_t offset = 0); 32 | 33 | std::vector get_filenames(); 34 | 35 | fs::file get_file(std::string path); 36 | 37 | bool extract(std::string path, std::string ignore = ""); // extract all files in archive to path 38 | }; 39 | -------------------------------------------------------------------------------- /rpcs3/Emu/VFS.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace vfs 8 | { 9 | // Mount VFS device 10 | bool mount(std::string_view vpath, std::string_view path); 11 | 12 | // Convert VFS path to fs path, optionally listing directories mounted in it 13 | std::string get(std::string_view vpath, std::vector* out_dir = nullptr); 14 | 15 | // Escape VFS path by replacing non-portable characters with surrogates 16 | std::string escape(std::string_view path); 17 | 18 | // Invert escape operation 19 | std::string unescape(std::string_view path); 20 | 21 | // Functions in this namespace operate on host filepaths, similar to fs:: 22 | namespace host 23 | { 24 | // Call fs::rename with retry on access error 25 | bool rename(const std::string& from, const std::string& to, bool overwrite); 26 | 27 | // Delete file without deleting its contents, emulated with MoveFileEx on Windows 28 | bool unlink(const std::string&); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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 | Source Files 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/_discord_utils.cpp: -------------------------------------------------------------------------------- 1 | #ifdef WITH_DISCORD_RPC 2 | #include "_discord_utils.h" 3 | #include "discord_rpc.h" 4 | #include "discord_register.h" 5 | 6 | namespace discord 7 | { 8 | void initialize(const std::string& application_id) 9 | { 10 | DiscordEventHandlers handlers = {}; 11 | Discord_Initialize(application_id.c_str(), &handlers, 1, NULL); 12 | } 13 | 14 | void shutdown() 15 | { 16 | Discord_Shutdown(); 17 | } 18 | 19 | void update_presence(const std::string& state, const std::string& details, bool reset_timer) 20 | { 21 | DiscordRichPresence discordPresence = {}; 22 | discordPresence.details = details.c_str(); 23 | discordPresence.state = state.c_str(); 24 | discordPresence.largeImageKey = "rpcs3_logo"; 25 | discordPresence.largeImageText = "RPCS3 is the world's first PlayStation 3 emulator."; 26 | 27 | if (reset_timer) 28 | { 29 | discordPresence.startTimestamp = time(0); 30 | } 31 | 32 | Discord_UpdatePresence(&discordPresence); 33 | } 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /rpcs3/stb_image.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | // Defines STB_IMAGE_IMPLEMENTATION *once* for stb_image.h includes (Should this be placed somewhere else?) 3 | #define STB_IMAGE_IMPLEMENTATION 4 | 5 | // This header generates lots of errors, so we ignore those (not rpcs3 code) 6 | #if defined(__clang__) 7 | #pragma clang diagnostic push 8 | #pragma clang diagnostic ignored "-Weverything" 9 | #include 10 | #pragma clang diagnostic pop 11 | 12 | #elif defined(__GNUC__) || defined(__GNUG__) 13 | #pragma GCC diagnostic push 14 | #pragma GCC diagnostic ignored "-Wall" 15 | #pragma GCC diagnostic ignored "-Wextra" 16 | #include 17 | #pragma GCC diagnostic pop 18 | 19 | #elif defined(_MSC_VER) 20 | // TODO Turn off warnings for MSVC. Using the normal push warning levels simply 21 | // creates a new warning about warnings being supressed (ie fuck msvc) 22 | // #pragma warning( push, 4 ) 23 | #include 24 | // #pragma warning( pop ) 25 | 26 | #else 27 | #include 28 | #endif 29 | -------------------------------------------------------------------------------- /Utilities/date_time.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace date_time 7 | { 8 | static inline tm get_time(time_t* _time) 9 | { 10 | tm buf; 11 | time_t t = time(_time); 12 | #ifdef _MSC_VER 13 | localtime_s(&buf, &t); 14 | #else 15 | buf = *localtime(&t); 16 | #endif 17 | return buf; 18 | } 19 | 20 | static inline std::string current_time() 21 | { 22 | char str[80]; 23 | tm now = get_time(0); 24 | strftime(str, sizeof(str), "%c", &now); 25 | return str; 26 | } 27 | 28 | template 29 | static inline std::string current_time_narrow() 30 | { 31 | char str[80]; 32 | tm now = get_time(0); 33 | 34 | std::string parse_buf; 35 | 36 | if constexpr(separator != 0) 37 | parse_buf = std::string("%Y") + separator + "%m" + separator + "%d" + separator + "%H" + separator + "%M" + separator + "%S"; 38 | else 39 | parse_buf = "%Y%m%d%H%M%S"; 40 | 41 | strftime(str, sizeof(str), parse_buf.c_str(), &now); 42 | return str; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellCelp8Enc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | 5 | // libCelp8Enc = 0x806140a1 - 0x806140bf 6 | 7 | // Return Codes 8 | enum 9 | { 10 | CELL_CELP8ENC_ERROR_FAILED = 0x806140a1, 11 | CELL_CELP8ENC_ERROR_SEQ = 0x806140a2, 12 | CELL_CELP8ENC_ERROR_ARG = 0x806140a3, 13 | CELL_CELP8ENC_ERROR_CORE_FAILED = 0x806140b1, 14 | CELL_CELP8ENC_ERROR_CORE_SEQ = 0x806140b2, 15 | CELL_CELP8ENC_ERROR_CORE_ARG = 0x806140b3, 16 | }; 17 | 18 | // Definitions 19 | enum 20 | { 21 | CELL_CELP8ENC_FS_8kHz = 1, 22 | 23 | CELL_CELP8ENC_EXCITATION_MODE_MPE = 0, 24 | 25 | CELL_CELP8ENC_MPE_CONFIG_0 = 0, 26 | CELL_CELP8ENC_MPE_CONFIG_2 = 2, 27 | CELL_CELP8ENC_MPE_CONFIG_6 = 6, 28 | CELL_CELP8ENC_MPE_CONFIG_9 = 9, 29 | CELL_CELP8ENC_MPE_CONFIG_12 = 12, 30 | CELL_CELP8ENC_MPE_CONFIG_15 = 15, 31 | CELL_CELP8ENC_MPE_CONFIG_18 = 18, 32 | CELL_CELP8ENC_MPE_CONFIG_21 = 21, 33 | CELL_CELP8ENC_MPE_CONFIG_24 = 24, 34 | CELL_CELP8ENC_MPE_CONFIG_26 = 26, 35 | 36 | CELL_CELP8ENC_WORD_SZ_FLOAT, 37 | }; 38 | -------------------------------------------------------------------------------- /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/controller.png 9 | Icons/insignia.png 10 | Icons/configure.png 11 | Icons/controllers.png 12 | Icons/fullscreen.png 13 | Icons/grid.png 14 | Icons/list.png 15 | Icons/refresh.png 16 | Json/tooltips.json 17 | Json/pad_settings.json 18 | Icons/exit_fullscreen.png 19 | Icons/open.png 20 | Icons/custom_config.png 21 | Icons/custom_config_2.png 22 | Icons/controllers_2.png 23 | Icons/combo_config_bordered.png 24 | 25 | 26 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_gpio.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "sys_gpio.h" 3 | 4 | #include "Emu/System.h" 5 | #include "Emu/IdManager.h" 6 | 7 | #include "Emu/Cell/ErrorCodes.h" 8 | 9 | 10 | error_code sys_gpio_get(u64 device_id, vm::ptr value) 11 | { 12 | if (device_id != SYS_GPIO_LED_DEVICE_ID && device_id != SYS_GPIO_DIP_SWITCH_DEVICE_ID) 13 | { 14 | return CELL_ESRCH; 15 | } 16 | 17 | if (!vm::check_addr(value.addr(), sizeof(u64), vm::page_writable)) 18 | { 19 | return CELL_EFAULT; 20 | } 21 | 22 | // Retail consoles dont have LEDs or DIPs switches, hence always sets 0 in paramenter 23 | *value = 0; 24 | 25 | return CELL_OK; 26 | } 27 | 28 | error_code sys_gpio_set(u64 device_id, u64 mask, u64 value) 29 | { 30 | // Retail consoles dont have LEDs or DIPs switches, hence the syscall can't modify devices's value 31 | switch (device_id) 32 | { 33 | case SYS_GPIO_LED_DEVICE_ID: return CELL_OK; 34 | case SYS_GPIO_DIP_SWITCH_DEVICE_ID: return CELL_EINVAL; 35 | } 36 | 37 | return CELL_ESRCH; 38 | } 39 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/breakpoint_list.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/CPU/CPUDisAsm.h" 5 | 6 | #include "breakpoint_handler.h" 7 | 8 | #include 9 | 10 | class breakpoint_list : public QListWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | breakpoint_list(QWidget* parent, breakpoint_handler* handler); 16 | void UpdateCPUData(std::weak_ptr cpu, std::shared_ptr disasm); 17 | void ClearBreakpoints(); 18 | void AddBreakpoint(u32 addr); 19 | void RemoveBreakpoint(u32 addr); 20 | 21 | QColor m_text_color_bp; 22 | QColor m_color_bp; 23 | Q_SIGNALS: 24 | void RequestShowAddress(u32 addr); 25 | public Q_SLOTS: 26 | void HandleBreakpointRequest(u32 addr); 27 | private Q_SLOTS: 28 | void OnBreakpointListDoubleClicked(); 29 | void OnBreakpointListRightClicked(const QPoint &pos); 30 | void OnBreakpointListDelete(); 31 | private: 32 | breakpoint_handler* m_breakpoint_handler; 33 | 34 | std::weak_ptr cpu; 35 | std::shared_ptr m_disasm; 36 | }; 37 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellRtcAlarm.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | LOG_CHANNEL(cellRtcAlarm); 5 | 6 | s32 cellRtcAlarmRegister() 7 | { 8 | UNIMPLEMENTED_FUNC(cellRtcAlarm); 9 | return CELL_OK; 10 | } 11 | 12 | s32 cellRtcAlarmUnregister() 13 | { 14 | UNIMPLEMENTED_FUNC(cellRtcAlarm); 15 | return CELL_OK; 16 | } 17 | 18 | s32 cellRtcAlarmNotification() 19 | { 20 | UNIMPLEMENTED_FUNC(cellRtcAlarm); 21 | return CELL_OK; 22 | } 23 | 24 | s32 cellRtcAlarmStopRunning() 25 | { 26 | UNIMPLEMENTED_FUNC(cellRtcAlarm); 27 | return CELL_OK; 28 | } 29 | 30 | s32 cellRtcAlarmGetStatus() 31 | { 32 | UNIMPLEMENTED_FUNC(cellRtcAlarm); 33 | return CELL_OK; 34 | } 35 | 36 | DECLARE(ppu_module_manager::cellRtcAlarm)("cellRtcAlarm", []() 37 | { 38 | REG_FUNC(cellRtcAlarm, cellRtcAlarmRegister); 39 | REG_FUNC(cellRtcAlarm, cellRtcAlarmUnregister); 40 | REG_FUNC(cellRtcAlarm, cellRtcAlarmNotification); 41 | REG_FUNC(cellRtcAlarm, cellRtcAlarmStopRunning); 42 | REG_FUNC(cellRtcAlarm, cellRtcAlarmGetStatus); 43 | }); 44 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/cg_disasm_window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "stdafx.h" 7 | #include "gui_settings.h" 8 | #include "syntax_highlighter.h" 9 | 10 | class cg_disasm_window : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | private Q_SLOTS: 15 | void ShowContextMenu(const QPoint &pos); 16 | void ShowDisasm(); 17 | bool IsValidFile(const QMimeData& md, bool save = false); 18 | 19 | private: 20 | QString m_path_last; 21 | QTextEdit* m_disasm_text; 22 | QTextEdit* m_glsl_text; 23 | QList m_urls; 24 | 25 | QAction *openCgBinaryProgram; 26 | 27 | std::shared_ptr xgui_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/memory_viewer_panel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | class memory_viewer_panel : public QDialog 19 | { 20 | u32 m_addr; 21 | u32 m_colcount; 22 | u32 m_rowcount; 23 | 24 | QLineEdit* m_addr_line; 25 | 26 | QLabel* m_mem_addr; 27 | QLabel* m_mem_hex; 28 | QLabel* m_mem_ascii; 29 | 30 | QFontMetrics* m_fontMetrics; 31 | 32 | public: 33 | bool exit; 34 | memory_viewer_panel(QWidget* parent); 35 | ~memory_viewer_panel(); 36 | 37 | virtual void wheelEvent(QWheelEvent *event); 38 | 39 | virtual void ShowMemory(); 40 | void SetPC(const uint pc); 41 | 42 | //Static methods 43 | static void ShowImage(QWidget* parent, u32 addr, int mode, u32 sizex, u32 sizey, bool flipv); 44 | }; 45 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | Standard: Cpp11 2 | UseTab: ForIndentation 3 | TabWidth: 1 4 | IndentWidth: 1 5 | AccessModifierOffset: -1 6 | PointerAlignment: Left 7 | NamespaceIndentation: All 8 | ColumnLimit: 200 9 | BreakBeforeBraces: Allman 10 | BreakConstructorInitializersBeforeComma: true 11 | BreakBeforeBinaryOperators: false 12 | BreakBeforeTernaryOperators: false 13 | AlwaysBreakTemplateDeclarations: true 14 | AllowShortIfStatementsOnASingleLine: false 15 | AllowShortBlocksOnASingleLine: false 16 | AllowShortCaseLabelsOnASingleLine: true 17 | AllowShortFunctionsOnASingleLine: false 18 | AllowShortLoopsOnASingleLine: false 19 | Cpp11BracedListStyle: true 20 | IndentCaseLabels: false 21 | SortIncludes: false 22 | ReflowComments: true 23 | AlignConsecutiveAssignments: true 24 | AlignTrailingComments: true 25 | AlignAfterOpenBracket: DontAlign 26 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 27 | BinPackArguments: true 28 | BinPackParameters: true 29 | AlwaysBreakAfterReturnType: None 30 | KeepEmptyLinesAtTheStartOfBlocks: true 31 | IndentWrappedFunctionNames: false 32 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/OpenGL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef _WIN32 3 | #include 4 | #endif 5 | 6 | #ifdef _WIN32 7 | #include 8 | #include "GL/gl.h" 9 | #include 10 | typedef BOOL (WINAPI* PFNWGLSWAPINTERVALEXTPROC) (int interval); 11 | 12 | #define OPENGL_PROC(p, n) extern p gl##n 13 | #define WGL_PROC(p, n) extern p wgl##n 14 | #define OPENGL_PROC2(p, n, tn) OPENGL_PROC(p, n) 15 | #include "GLProcTable.h" 16 | #undef OPENGL_PROC 17 | #undef WGL_PROC 18 | #undef OPENGL_PROC2 19 | 20 | #elif defined(__APPLE__) 21 | #include 22 | #include 23 | 24 | #else 25 | #include 26 | #include 27 | #include 28 | #include 29 | #endif 30 | 31 | #ifndef GL_TEXTURE_BUFFER_BINDING 32 | //During spec release, this enum was removed during upgrade from ARB equivalent 33 | //See https://www.khronos.org/bugzilla/show_bug.cgi?id=844 34 | #define GL_TEXTURE_BUFFER_BINDING 0x8C2A 35 | #endif 36 | 37 | namespace gl 38 | { 39 | void init(); 40 | void set_swapinterval(int interval); 41 | } 42 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellKb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/BEType.h" 4 | #include "Emu/Io/Keyboard.h" 5 | 6 | enum CellKbError : u32 7 | { 8 | CELL_KB_ERROR_FATAL = 0x80121001, 9 | CELL_KB_ERROR_INVALID_PARAMETER = 0x80121002, 10 | CELL_KB_ERROR_ALREADY_INITIALIZED = 0x80121003, 11 | CELL_KB_ERROR_UNINITIALIZED = 0x80121004, 12 | CELL_KB_ERROR_RESOURCE_ALLOCATION_FAILED = 0x80121005, 13 | CELL_KB_ERROR_READ_FAILED = 0x80121006, 14 | CELL_KB_ERROR_NO_DEVICE = 0x80121007, 15 | CELL_KB_ERROR_SYS_SETTING_FAILED = 0x80121008, 16 | }; 17 | 18 | struct CellKbInfo 19 | { 20 | be_t max_connect; 21 | be_t now_connect; 22 | be_t info; 23 | u8 status[CELL_KB_MAX_KEYBOARDS]; 24 | }; 25 | 26 | struct CellKbData 27 | { 28 | be_t led; 29 | be_t mkey; 30 | be_t len; 31 | be_t keycode[CELL_KB_MAX_KEYCODES]; 32 | }; 33 | 34 | struct CellKbConfig 35 | { 36 | be_t arrange; 37 | be_t read_mode; 38 | be_t code_type; 39 | }; 40 | -------------------------------------------------------------------------------- /rpcs3/rpcs3.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | rpcs3 9 | CFBundleGetInfoString 10 | Open-source Sony PlayStation 3 emulator 11 | CFBundleIconFile 12 | rpcs3.icns 13 | CFBundleIdentifier 14 | net.rpcs3.rpcs3 15 | CFBundleLongVersionString 16 | ${RPCS3_GIT_TAG} 17 | CFBundleName 18 | RPCS3 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | ${RPCS3_GIT_TAG} 23 | CFBundleVersion 24 | ${RPCS3_GIT_TAG} 25 | NSHumanReadableCopyright 26 | Licensed under GPLv2 27 | NSHighResolutionCapable 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/welcome_dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "welcome_dialog.h" 2 | #include "ui_welcome_dialog.h" 3 | 4 | #include "gui_settings.h" 5 | 6 | #include "Emu/System.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | welcome_dialog::welcome_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::welcome_dialog) 15 | { 16 | ui->setupUi(this); 17 | 18 | setWindowFlags(windowFlags() & Qt::WindowTitleHint); 19 | 20 | gui_settings* settings = new gui_settings(this); 21 | 22 | ui->okay->setEnabled(false); 23 | 24 | connect(ui->i_have_read, &QCheckBox::clicked, [=](bool checked) 25 | { 26 | ui->okay->setEnabled(checked); 27 | }); 28 | 29 | connect(ui->do_not_show, &QCheckBox::clicked, [=](bool checked) 30 | { 31 | settings->SetValue(gui::ib_show_welcome, QVariant(!checked)); 32 | }); 33 | 34 | connect(ui->okay, &QPushButton::clicked, this, &QDialog::accept); 35 | 36 | layout()->setSizeConstraint(QLayout::SetFixedSize); 37 | } 38 | 39 | welcome_dialog::~welcome_dialog() 40 | { 41 | delete ui; 42 | } 43 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_interrupt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sys_sync.h" 4 | 5 | #include "Emu/Memory/vm_ptr.h" 6 | 7 | class ppu_thread; 8 | 9 | struct lv2_int_tag final : lv2_obj 10 | { 11 | static const u32 id_base = 0x0a000000; 12 | 13 | std::weak_ptr handler; 14 | }; 15 | 16 | struct lv2_int_serv final : lv2_obj 17 | { 18 | static const u32 id_base = 0x0b000000; 19 | 20 | const std::shared_ptr> thread; 21 | const u64 arg1; 22 | const u64 arg2; 23 | 24 | lv2_int_serv(const std::shared_ptr>& thread, u64 arg1, u64 arg2) 25 | : thread(thread) 26 | , arg1(arg1) 27 | , arg2(arg2) 28 | { 29 | } 30 | 31 | void exec(); 32 | void join(); 33 | }; 34 | 35 | // Syscalls 36 | 37 | error_code sys_interrupt_tag_destroy(ppu_thread& ppu, u32 intrtag); 38 | error_code _sys_interrupt_thread_establish(ppu_thread& ppu, vm::ptr ih, u32 intrtag, u32 intrthread, u64 arg1, u64 arg2); 39 | error_code _sys_interrupt_thread_disestablish(ppu_thread& ppu, u32 ih, vm::ptr r13); 40 | void sys_interrupt_thread_eoi(ppu_thread& ppu); 41 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/syntax_highlighter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // Inspired by https://doc.qt.io/qt-5/qtwidgets-richtext-syntaxhighlighter-example.html 7 | 8 | class Highlighter : public QSyntaxHighlighter 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Highlighter(QTextDocument *parent = 0); 14 | 15 | protected: 16 | void highlightBlock(const QString &text) override; 17 | void addRule(const QString &pattern, const QBrush &brush); 18 | 19 | struct HighlightingRule 20 | { 21 | QRegularExpression pattern; 22 | QTextCharFormat format; 23 | }; 24 | QVector highlightingRules; 25 | 26 | QRegularExpression commentStartExpression; 27 | QRegularExpression commentEndExpression; 28 | 29 | QTextCharFormat multiLineCommentFormat; 30 | }; 31 | 32 | class AsmHighlighter : public Highlighter 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | AsmHighlighter(QTextDocument *parent = 0); 38 | }; 39 | 40 | class GlslHighlighter : public Highlighter 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | GlslHighlighter(QTextDocument *parent = 0); 46 | }; 47 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GSRender.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Memory/vm.h" 3 | #include "Emu/System.h" 4 | 5 | #include "GSRender.h" 6 | 7 | GSRender::GSRender() 8 | { 9 | if (auto gs_frame = Emu.GetCallbacks().get_gs_frame()) 10 | { 11 | m_frame = gs_frame.release(); 12 | } 13 | else 14 | { 15 | m_frame = nullptr; 16 | } 17 | } 18 | 19 | GSRender::~GSRender() 20 | { 21 | m_context = nullptr; 22 | 23 | if (m_frame) 24 | { 25 | m_frame->hide(); 26 | m_frame->close(); 27 | } 28 | } 29 | 30 | void GSRender::on_init_rsx() 31 | { 32 | if (m_frame) 33 | { 34 | m_frame->show(); 35 | } 36 | } 37 | 38 | void GSRender::on_init_thread() 39 | { 40 | if (m_frame) 41 | { 42 | m_context = m_frame->make_context(); 43 | m_frame->set_current(m_context); 44 | } 45 | } 46 | 47 | void GSRender::on_exit() 48 | { 49 | if (m_frame) 50 | { 51 | m_frame->delete_context(m_context); 52 | m_context = nullptr; 53 | } 54 | 55 | rsx::thread::on_exit(); 56 | } 57 | 58 | void GSRender::flip(const rsx::display_flip_info_t& info) 59 | { 60 | if (m_frame) 61 | { 62 | m_frame->flip(m_context); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/RSX/RSXFragmentProgram.h" 4 | #include 5 | 6 | #include "../Common/FragmentProgramDecompiler.h" 7 | 8 | class D3D12FragmentDecompiler : public FragmentProgramDecompiler 9 | { 10 | protected: 11 | virtual std::string getFloatTypeName(size_t elementCount) override; 12 | virtual std::string getHalfTypeName(size_t elementCount) override; 13 | virtual std::string getFunction(enum FUNCTION) override; 14 | virtual std::string compareFunction(enum COMPARE, const std::string &, const std::string &) override; 15 | 16 | virtual void insertHeader(std::stringstream &OS) override; 17 | virtual void insertInputs(std::stringstream &OS) override; 18 | virtual void insertOutputs(std::stringstream &OS) override; 19 | virtual void insertConstants(std::stringstream &OS) override; 20 | virtual void insertGlobalFunctions(std::stringstream &OS) override; 21 | virtual void insertMainStart(std::stringstream &OS) override; 22 | virtual void insertMainEnd(std::stringstream &OS) override; 23 | public: 24 | D3D12FragmentDecompiler(const RSXFragmentProgram &prog, u32& size); 25 | }; 26 | -------------------------------------------------------------------------------- /.travis/build-mac.bash: -------------------------------------------------------------------------------- 1 | export CCACHE_SLOPPINESS=pch_defines,time_macros 2 | export CMAKE_PREFIX_PATH=/usr/local/opt/qt5/ 3 | export PATH="/usr/local/opt/ccache/libexec:$PATH" 4 | 5 | # Setup vulkan and gfx-rs/portability 6 | curl -sLO https://github.com/gfx-rs/portability/releases/download/latest/gfx-portability-macos-latest.zip 7 | unzip -: gfx-portability-macos-latest.zip 8 | curl -sLO https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.106.0.zip 9 | unzip -: sdk-*.zip 10 | mkdir vulkan-sdk 11 | ln -s ${PWD}/Vulkan-Headers*/include vulkan-sdk/include 12 | mkdir vulkan-sdk/lib 13 | cp target/release/libportability.dylib vulkan-sdk/lib/libVulkan.dylib 14 | # Let macdeployqt locate and install Vulkan library 15 | install_name_tool -id ${PWD}/vulkan-sdk/lib/libVulkan.dylib vulkan-sdk/lib/libVulkan.dylib 16 | export VULKAN_SDK=${PWD}/vulkan-sdk 17 | 18 | git submodule update --quiet --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng 3rdparty/cereal 3rdparty/hidapi 3rdparty/libusb 3rdparty/xxHash 3rdparty/yaml-cpp Vulkan/glslang 19 | 20 | mkdir build; cd build 21 | cmake .. -DWITH_LLVM=OFF -DUSE_NATIVE_INSTRUCTIONS=OFF -G Ninja 22 | ninja 23 | -------------------------------------------------------------------------------- /Utilities/sysinfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.h" 4 | #include 5 | 6 | namespace utils 7 | { 8 | inline std::array get_cpuid(u32 func, u32 subfunc) 9 | { 10 | int regs[4]; 11 | #ifdef _MSC_VER 12 | __cpuidex(regs, func, subfunc); 13 | #else 14 | __asm__ volatile("cpuid" : "=a" (regs[0]), "=b" (regs[1]), "=c" (regs[2]), "=d" (regs[3]) : "a" (func), "c" (subfunc)); 15 | #endif 16 | return {0u+regs[0], 0u+regs[1], 0u+regs[2], 0u+regs[3]}; 17 | } 18 | 19 | inline u64 get_xgetbv(u32 xcr) 20 | { 21 | #ifdef _MSC_VER 22 | return _xgetbv(xcr); 23 | #else 24 | u32 eax, edx; 25 | __asm__ volatile( "xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr)); 26 | return eax | (u64(edx) << 32); 27 | #endif 28 | } 29 | 30 | bool has_ssse3(); 31 | 32 | bool has_sse41(); 33 | 34 | bool has_avx(); 35 | 36 | bool has_avx2(); 37 | 38 | bool has_rtm(); 39 | 40 | bool has_tsx_force_abort(); 41 | 42 | bool has_mpx(); 43 | 44 | bool has_512(); 45 | 46 | bool has_xop(); 47 | 48 | std::string get_system_info(); 49 | 50 | std::string get_firmware_version(); 51 | 52 | std::string get_OS_version(); 53 | 54 | ullong get_tsc_freq(); 55 | } 56 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellRtc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/BEType.h" 4 | 5 | // Return Codes 6 | enum 7 | { 8 | CELL_RTC_ERROR_NOT_INITIALIZED = 0x80010601, 9 | CELL_RTC_ERROR_INVALID_POINTER = 0x80010602, 10 | CELL_RTC_ERROR_INVALID_VALUE = 0x80010603, 11 | CELL_RTC_ERROR_INVALID_ARG = 0x80010604, 12 | CELL_RTC_ERROR_NOT_SUPPORTED = 0x80010605, 13 | CELL_RTC_ERROR_NO_CLOCK = 0x80010606, 14 | CELL_RTC_ERROR_BAD_PARSE = 0x80010607, 15 | CELL_RTC_ERROR_INVALID_YEAR = 0x80010621, 16 | CELL_RTC_ERROR_INVALID_MONTH = 0x80010622, 17 | CELL_RTC_ERROR_INVALID_DAY = 0x80010623, 18 | CELL_RTC_ERROR_INVALID_HOUR = 0x80010624, 19 | CELL_RTC_ERROR_INVALID_MINUTE = 0x80010625, 20 | CELL_RTC_ERROR_INVALID_SECOND = 0x80010626, 21 | CELL_RTC_ERROR_INVALID_MICROSECOND = 0x80010627, 22 | }; 23 | 24 | struct CellRtcTick 25 | { 26 | be_t tick; 27 | }; 28 | 29 | struct CellRtcDateTime 30 | { 31 | be_t year; 32 | be_t month; 33 | be_t day; 34 | be_t hour; 35 | be_t minute; 36 | be_t second; 37 | be_t microsecond; 38 | }; 39 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/D3D12/D3D12VertexProgramDecompiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "../Common/VertexProgramDecompiler.h" 6 | 7 | struct D3D12VertexProgramDecompiler : public VertexProgramDecompiler 8 | { 9 | protected: 10 | virtual std::string getFloatTypeName(size_t elementCount) override; 11 | std::string getIntTypeName(size_t elementCount) override; 12 | virtual std::string getFunction(enum FUNCTION) override; 13 | virtual std::string compareFunction(enum COMPARE, const std::string &, const std::string &, bool scalar) override; 14 | 15 | virtual void insertHeader(std::stringstream &OS); 16 | virtual void insertInputs(std::stringstream &OS, const std::vector &inputs); 17 | virtual void insertConstants(std::stringstream &OS, const std::vector &constants); 18 | virtual void insertOutputs(std::stringstream &OS, const std::vector &outputs); 19 | virtual void insertMainStart(std::stringstream &OS); 20 | virtual void insertMainEnd(std::stringstream &OS); 21 | 22 | const RSXVertexProgram &rsx_vertex_program; 23 | public: 24 | D3D12VertexProgramDecompiler(const RSXVertexProgram &prog); 25 | }; 26 | -------------------------------------------------------------------------------- /3rdparty/hidapi.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;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 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/libad_async.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | LOG_CHANNEL(libad_async); 5 | 6 | s32 sceAdAsyncOpenContext() 7 | { 8 | UNIMPLEMENTED_FUNC(libad_async); 9 | return CELL_OK; 10 | } 11 | 12 | s32 sceAdAsyncConnectContext() 13 | { 14 | UNIMPLEMENTED_FUNC(libad_async); 15 | return CELL_OK; 16 | } 17 | 18 | s32 sceAdAsyncSpaceOpen() 19 | { 20 | UNIMPLEMENTED_FUNC(libad_async); 21 | return CELL_OK; 22 | } 23 | 24 | s32 sceAdAsyncFlushReports() 25 | { 26 | UNIMPLEMENTED_FUNC(libad_async); 27 | return CELL_OK; 28 | } 29 | 30 | s32 sceAdAsyncSpaceClose() 31 | { 32 | UNIMPLEMENTED_FUNC(libad_async); 33 | return CELL_OK; 34 | } 35 | 36 | s32 sceAdAsyncCloseContext() 37 | { 38 | UNIMPLEMENTED_FUNC(libad_async); 39 | return CELL_OK; 40 | } 41 | 42 | DECLARE(ppu_module_manager::libad_async)("libad_async", []() 43 | { 44 | REG_FUNC(libad_async, sceAdAsyncOpenContext); 45 | REG_FUNC(libad_async, sceAdAsyncConnectContext); 46 | REG_FUNC(libad_async, sceAdAsyncSpaceOpen); 47 | REG_FUNC(libad_async, sceAdAsyncFlushReports); 48 | REG_FUNC(libad_async, sceAdAsyncSpaceClose); 49 | REG_FUNC(libad_async, sceAdAsyncCloseContext); 50 | }); 51 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_overlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Cell/PPUAnalyser.h" 4 | #include "sys_sync.h" 5 | #include "Emu/Cell/ErrorCodes.h" 6 | 7 | struct lv2_overlay final : lv2_obj, ppu_module 8 | { 9 | static const u32 id_base = 0x25000000; 10 | 11 | u32 entry; 12 | }; 13 | 14 | error_code sys_overlay_load_module(vm::ptr ovlmid, vm::cptr path, u64 flags, vm::ptr entry); 15 | error_code sys_overlay_load_module_by_fd(vm::ptr ovlmid, u32 fd, u64 offset, u64 flags, vm::ptr entry); 16 | error_code sys_overlay_unload_module(u32 ovlmid); 17 | //error_code sys_overlay_get_module_list(sys_pid_t pid, size_t ovlmids_num, sys_overlay_t * ovlmids, size_t * num_of_modules); 18 | //error_code sys_overlay_get_module_info(sys_pid_t pid, sys_overlay_t ovlmid, sys_overlay_module_info_t * info); 19 | //error_code sys_overlay_get_module_info2(sys_pid_t pid, sys_overlay_t ovlmid, sys_overlay_module_info2_t * info);// 20 | //error_code sys_overlay_get_sdk_version(); //2 params 21 | //error_code sys_overlay_get_module_dbg_info(); //3 params? 22 | 23 | //error_code _sys_prx_load_module(vm::ps3::cptr path, u64 flags, vm::ps3::ptr pOpt); 24 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/save_data_dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "save_data_dialog.h" 2 | #include "save_data_list_dialog.h" 3 | 4 | #include 5 | #include 6 | 7 | s32 save_data_dialog::ShowSaveDataList(std::vector& save_entries, s32 focused, u32 op, vm::ptr listSet) 8 | { 9 | // TODO: Install native shell as an Emu callback 10 | if (auto manager = g_fxo->get()) 11 | { 12 | auto result = manager->create()->show(save_entries, focused, op, listSet); 13 | if (result != rsx::overlays::user_interface::selection_code::error) 14 | return result; 15 | } 16 | 17 | // Fall back to front-end GUI 18 | atomic_t dlg_result(false); 19 | atomic_t selection; 20 | 21 | pad::SetIntercepted(true); 22 | 23 | Emu.CallAfter([&]() 24 | { 25 | save_data_list_dialog sdid(save_entries, focused, op, listSet); 26 | sdid.exec(); 27 | selection = sdid.GetSelection(); 28 | dlg_result = true; 29 | }); 30 | 31 | while (!dlg_result) 32 | { 33 | thread_ctrl::wait_for(1000); 34 | } 35 | 36 | pad::SetIntercepted(false); 37 | 38 | return selection.load(); 39 | } 40 | -------------------------------------------------------------------------------- /Utilities/Interval.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | template struct range_t 6 | { 7 | T1 _min; // first value 8 | T2 _max; // second value 9 | }; 10 | 11 | template constexpr range_t, std::decay_t> make_range(T1&& _min, T2&& _max) 12 | { 13 | return{ std::forward(_min), std::forward(_max) }; 14 | } 15 | 16 | template constexpr bool operator <(const range_t& range, const T& value) 17 | { 18 | return range._min < value && range._max < value; 19 | } 20 | 21 | template constexpr bool operator <(const T& value, const range_t& range) 22 | { 23 | return value < range._min && value < range._max; 24 | } 25 | 26 | template constexpr bool operator ==(const range_t& range, const T& value) 27 | { 28 | return !(value < range._min) && !(range._max < value); 29 | } 30 | 31 | template constexpr bool operator ==(const T& value, const range_t& range) 32 | { 33 | return !(value < range._min) && !(range._max < value); 34 | } 35 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKFormats.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "VKHelpers.h" 3 | #include 4 | 5 | namespace vk 6 | { 7 | VkBorderColor get_border_color(u32 color); 8 | 9 | VkFormat get_compatible_depth_surface_format(const gpu_formats_support &support, rsx::surface_depth_format format); 10 | VkFormat get_compatible_sampler_format(const gpu_formats_support &support, u32 format); 11 | VkFormat get_compatible_srgb_format(VkFormat rgb_format); 12 | u8 get_format_texel_width(VkFormat format); 13 | std::pair get_format_element_size(VkFormat format); 14 | std::pair get_format_convert_flags(VkFormat format); 15 | bool formats_are_bitcast_compatible(VkFormat format1, VkFormat format2); 16 | 17 | std::tuple get_min_filter_and_mip(rsx::texture_minify_filter min_filter); 18 | VkFilter get_mag_filter(rsx::texture_magnify_filter mag_filter); 19 | VkSamplerAddressMode vk_wrap_mode(rsx::texture_wrap_mode gcm_wrap); 20 | float max_aniso(rsx::texture_max_anisotropy gcm_aniso); 21 | std::array get_component_mapping(u32 format); 22 | VkPrimitiveTopology get_appropriate_topology(rsx::primitive_type mode, bool &requires_modification); 23 | } 24 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellBgdl.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | #include "cellBgdl.h" 6 | 7 | 8 | 9 | LOG_CHANNEL(cellBGDL); 10 | 11 | s32 cellBGDLGetInfo(vm::cptr content_id, vm::ptr info, s32 num) 12 | { 13 | cellBGDL.todo("cellBGDLGetInfo(content_id=%s, info=*0x%x, num=%d)", content_id, info, num); 14 | return 0; 15 | } 16 | 17 | s32 cellBGDLGetInfo2(vm::cptr service_id, vm::ptr info, s32 num) 18 | { 19 | cellBGDL.todo("cellBGDLGetInfo2(service_id=%s, info=*0x%x, num=%d)", service_id, info, num); 20 | return 0; 21 | } 22 | 23 | s32 cellBGDLSetMode(CellBGDLMode mode) 24 | { 25 | cellBGDL.todo("cellBGDLSetMode(mode=%d)", (s32) mode); 26 | return CELL_OK; 27 | } 28 | 29 | s32 cellBGDLGetMode(vm::ptr mode) 30 | { 31 | cellBGDL.todo("cellBGDLGetMode(mode=*0x%x)", mode); 32 | return CELL_OK; 33 | } 34 | 35 | DECLARE(ppu_module_manager::cellBGDL)("cellBGDLUtility", []() 36 | { 37 | REG_FUNC(cellBGDLUtility, cellBGDLGetInfo); 38 | REG_FUNC(cellBGDLUtility, cellBGDLGetInfo2); 39 | REG_FUNC(cellBGDLUtility, cellBGDLSetMode); 40 | REG_FUNC(cellBGDLUtility, cellBGDLGetMode); 41 | }); 42 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/about_dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "about_dialog.h" 2 | #include "ui_about_dialog.h" 3 | 4 | #include "rpcs3_version.h" 5 | 6 | #include 7 | #include 8 | 9 | constexpr auto qstr = QString::fromStdString; 10 | 11 | about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_dialog) 12 | { 13 | ui->setupUi(this); 14 | 15 | ui->close->setDefault(true); 16 | 17 | ui->version->setText(tr("RPCS3 Version: %1").arg(qstr(rpcs3::version.to_string()))); 18 | 19 | // Events 20 | connect(ui->gitHub, &QPushButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.github.com/RPCS3")); }); 21 | connect(ui->website, &QPushButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.rpcs3.net")); }); 22 | connect(ui->forum, &QPushButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://forums.rpcs3.net")); }); 23 | connect(ui->patreon, &QPushButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.patreon.com/Nekotekina")); }); 24 | connect(ui->close, &QPushButton::clicked, this, &QWidget::close); 25 | 26 | layout()->setSizeConstraint(QLayout::SetFixedSize); 27 | } 28 | 29 | about_dialog::~about_dialog() 30 | { 31 | delete ui; 32 | } 33 | -------------------------------------------------------------------------------- /Utilities/hash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/types.h" 4 | 5 | namespace rpcs3 6 | { 7 | template 8 | static size_t hash_base(T value) 9 | { 10 | return static_cast(value); 11 | } 12 | 13 | template 14 | static size_t hash_struct_base(const T& value) 15 | { 16 | // FNV 64-bit 17 | size_t result = 14695981039346656037ull; 18 | const U *bits = reinterpret_cast(&value); 19 | 20 | for (size_t n = 0; n < (sizeof(T) / sizeof(U)); ++n) 21 | { 22 | result ^= bits[n]; 23 | result *= 1099511628211ull; 24 | } 25 | 26 | return result; 27 | } 28 | 29 | template 30 | static size_t hash_struct(const T& value) 31 | { 32 | static constexpr auto block_sz = sizeof(T); 33 | 34 | if constexpr ((block_sz & 0x7) == 0) 35 | { 36 | return hash_struct_base(value); 37 | } 38 | 39 | if constexpr ((block_sz & 0x3) == 0) 40 | { 41 | return hash_struct_base(value); 42 | } 43 | 44 | if constexpr ((block_sz & 0x1) == 0) 45 | { 46 | return hash_struct_base(value); 47 | } 48 | 49 | return hash_struct_base(value); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /rpcs3/Emu/Memory/vm_locking.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vm.h" 4 | 5 | class cpu_thread; 6 | class shared_mutex; 7 | 8 | namespace vm 9 | { 10 | extern shared_mutex g_mutex; 11 | 12 | extern thread_local atomic_t* g_tls_locked; 13 | 14 | // Register reader 15 | void passive_lock(cpu_thread& cpu); 16 | atomic_t* passive_lock(const u32 begin, const u32 end); 17 | 18 | // Unregister reader 19 | void passive_unlock(cpu_thread& cpu); 20 | 21 | // Unregister reader (foreign thread) 22 | void cleanup_unlock(cpu_thread& cpu) noexcept; 23 | 24 | // Optimization (set cpu_flag::memory) 25 | void temporary_unlock(cpu_thread& cpu) noexcept; 26 | void temporary_unlock() noexcept; 27 | 28 | class reader_lock final 29 | { 30 | bool m_upgraded = false; 31 | 32 | public: 33 | reader_lock(const reader_lock&) = delete; 34 | reader_lock& operator=(const reader_lock&) = delete; 35 | reader_lock(); 36 | ~reader_lock(); 37 | 38 | void upgrade(); 39 | }; 40 | 41 | struct writer_lock final 42 | { 43 | writer_lock(const writer_lock&) = delete; 44 | writer_lock& operator=(const writer_lock&) = delete; 45 | writer_lock(u32 addr = 0); 46 | ~writer_lock(); 47 | }; 48 | } // namespace vm 49 | -------------------------------------------------------------------------------- /Utilities/version.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "version.h" 3 | 4 | namespace utils 5 | { 6 | std::string to_string(version_type type) 7 | { 8 | switch (type) 9 | { 10 | case version_type::pre_alpha: return "Pre-Alpha"; 11 | case version_type::alpha: return "Alpha"; 12 | case version_type::beta: return "Beta"; 13 | case version_type::release_candidate: return "RC"; 14 | case version_type::release: return "Release"; 15 | } 16 | 17 | return "Unknown"; 18 | } 19 | 20 | uint version::to_hex() const 21 | { 22 | return (m_hi << 24) | (m_mid << 16) | (m_lo << 8) | ((uint(m_type) & 0xf) << 4) | (m_type_index & 0xf); 23 | } 24 | 25 | std::string version::to_string() const 26 | { 27 | std::string version = std::to_string(hi()) + "." + std::to_string(mid()); 28 | 29 | if (lo()) 30 | { 31 | version += "." + std::to_string(lo()); 32 | } 33 | 34 | if (type() != version_type::release) 35 | { 36 | if (!postfix().empty()) 37 | { 38 | version += "-" + postfix(); 39 | } 40 | 41 | version += " " + utils::to_string(type()); 42 | 43 | if (type_index() > 1) 44 | { 45 | version += " " + std::to_string(type_index()); 46 | } 47 | } 48 | 49 | return version; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /rpcs3/Emu/Memory/vm_reservation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vm.h" 4 | #include "Utilities/cond.h" 5 | #include "util/atomic.hpp" 6 | 7 | namespace vm 8 | { 9 | // Get reservation status for further atomic update: last update timestamp 10 | inline atomic_t& reservation_acquire(u32 addr, u32 size) 11 | { 12 | // Access reservation info: stamp and the lock bit 13 | return reinterpret_cast*>(g_reservations)[addr / 128]; 14 | } 15 | 16 | // Update reservation status 17 | inline void reservation_update(u32 addr, u32 size, bool lsb = false) 18 | { 19 | // Update reservation info with new timestamp 20 | reservation_acquire(addr, size) += 128; 21 | } 22 | 23 | // Get reservation sync variable 24 | inline shared_cond& reservation_notifier(u32 addr, u32 size) 25 | { 26 | return *reinterpret_cast(g_reservations2 + addr / 128 * 8); 27 | } 28 | 29 | void reservation_lock_internal(atomic_t&); 30 | 31 | inline atomic_t& reservation_lock(u32 addr, u32 size) 32 | { 33 | auto& res = vm::reservation_acquire(addr, size); 34 | 35 | if (UNLIKELY(res.bts(0))) 36 | { 37 | reservation_lock_internal(res); 38 | } 39 | 40 | return res; 41 | } 42 | 43 | } // namespace vm 44 | -------------------------------------------------------------------------------- /rpcs3/Loader/ELF.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ELF.h" 3 | 4 | // ELF loading error information 5 | template<> 6 | void fmt_class_string::format(std::string& out, u64 arg) 7 | { 8 | format_enum(out, arg, [](elf_error error) 9 | { 10 | switch (error) 11 | { 12 | case elf_error::ok: return "OK"; 13 | 14 | case elf_error::stream: return "Invalid stream or file not found"; 15 | case elf_error::stream_header: return "Failed to read ELF header"; 16 | case elf_error::stream_phdrs: return "Failed to read ELF program headers"; 17 | case elf_error::stream_shdrs: return "Failed to read ELF section headers"; 18 | case elf_error::stream_data: return "Failed to read ELF program data"; 19 | 20 | case elf_error::header_magic: return "Not an ELF"; 21 | case elf_error::header_version: return "Invalid or unsupported ELF format"; 22 | case elf_error::header_class: return "Invalid ELF class"; 23 | case elf_error::header_machine: return "Invalid ELF machine"; 24 | case elf_error::header_endianness: return "Invalid ELF data (endianness)"; 25 | case elf_error::header_type: return "Invalid ELF type"; 26 | case elf_error::header_os: return "Invalid ELF OS ABI"; 27 | } 28 | 29 | return unknown; 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/input_dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "input_dialog.h" 2 | 3 | #include 4 | #include 5 | 6 | input_dialog::input_dialog(int max_length, const QString& text, const QString& title, const QString& label, const QString& placeholder, QWidget *parent, Qt::WindowFlags f) 7 | : QDialog(parent, f) 8 | { 9 | setWindowTitle(title); 10 | 11 | QLabel* m_label = new QLabel(label); 12 | 13 | QLineEdit* m_input = new QLineEdit(); 14 | m_input->setPlaceholderText(placeholder); 15 | m_input->setText(text); 16 | m_input->setMaxLength(max_length); 17 | m_input->setClearButtonEnabled(true); 18 | connect(m_input, &QLineEdit::textChanged, this, &input_dialog::text_changed); 19 | 20 | QDialogButtonBox* button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 21 | connect(button_box, &QDialogButtonBox::accepted, this, &QDialog::accept); 22 | connect(button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); 23 | 24 | QVBoxLayout* layout = new QVBoxLayout(); 25 | layout->addWidget(m_label); 26 | layout->addWidget(m_input); 27 | layout->addWidget(button_box); 28 | setLayout(layout); 29 | 30 | setFixedHeight(sizeHint().height()); 31 | } 32 | 33 | input_dialog::~input_dialog(){} 34 | -------------------------------------------------------------------------------- /llvm_build/UpdateProjectFiles.bat: -------------------------------------------------------------------------------- 1 | REM You need cmake and python to update the project files 2 | REM this script relies on CWD being the path that this script is in 3 | 4 | cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm 5 | 6 | RD /S /Q cmake 7 | RD /S /Q CMakeFiles 8 | RD /S /Q projects 9 | RD /S /Q share 10 | RD /S /Q tools 11 | DEL ALL_BUILD.vcxproj 12 | DEL ALL_BUILD.vcxproj.filters 13 | DEL CMakeCache.txt 14 | DEL cmake_install.cmake 15 | DEL CPackConfig.cmake 16 | DEL CPackSourceConfig.cmake 17 | DEL DummyConfigureOutput 18 | DEL INSTALL.vcxproj 19 | DEL INSTALL.vcxproj.filters 20 | DEL LLVM.sdf 21 | DEL LLVM.sln 22 | DEL LLVMBuild.cmake 23 | DEL PACKAGE.vcxproj 24 | DEL PACKAGE.vcxproj.filters 25 | DEL ZERO_CHECK.vcxproj 26 | DEL ZERO_CHECK.vcxproj.filters 27 | DEL include\llvm\llvm_headers_do_not_build.vcxproj 28 | DEL include\llvm\llvm_headers_do_not_build.vcxproj.filters 29 | python make_paths_relative.py 30 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSysconf.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | #include "cellSysutil.h" 4 | 5 | #include "cellSysconf.h" 6 | 7 | LOG_CHANNEL(cellSysconf); 8 | 9 | s32 cellSysconfAbort() 10 | { 11 | cellSysconf.todo("cellSysconfAbort()"); 12 | return CELL_OK; 13 | } 14 | 15 | s32 cellSysconfOpen(u32 type, vm::ptr func, vm::ptr userdata, vm::ptr extparam, u32 id) 16 | { 17 | cellSysconf.todo("cellSysconfOpen(type=%d, func=*0x%x, userdata=*0x%x, extparam=*0x%x, id=%d)", type, func, userdata, extparam, id); 18 | 19 | sysutil_register_cb([=](ppu_thread& ppu) -> s32 20 | { 21 | func(ppu, CELL_OK, userdata); 22 | return CELL_OK; 23 | }); 24 | 25 | return CELL_OK; 26 | } 27 | 28 | s32 cellSysconfBtGetDeviceList(vm::ptr deviceList) 29 | { 30 | cellSysconf.todo("cellSysconfBtGetDeviceList(deviceList=*0x%x)", deviceList); 31 | return CELL_OK; 32 | } 33 | 34 | void cellSysutil_Sysconf_init() 35 | { 36 | REG_FUNC(cellSysutil, cellSysconfAbort); 37 | REG_FUNC(cellSysutil, cellSysconfOpen); 38 | } 39 | 40 | DECLARE(ppu_module_manager::cellSysconf)("cellSysconfExtUtility", []() 41 | { 42 | REG_FUNC(cellSysconfExtUtility, cellSysconfBtGetDeviceList); 43 | }); 44 | -------------------------------------------------------------------------------- /rpcs3/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef MSVC_CRT_MEMLEAK_DETECTION 4 | #define _CRTDBG_MAP_ALLOC 5 | #include 6 | #include 7 | #endif 8 | 9 | #define NOMINMAX 10 | 11 | //#ifndef __STDC_CONSTANT_MACROS 12 | //#define __STDC_CONSTANT_MACROS 13 | //#endif 14 | 15 | #if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && !defined(DBG_NEW) 16 | #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) 17 | #include "define_new_memleakdetect.h" 18 | #endif 19 | 20 | #pragma warning( disable : 4351 ) 21 | 22 | // MSVC bug workaround 23 | #ifdef _MSC_VER 24 | namespace std { inline namespace literals { inline namespace chrono_literals {}}} 25 | #endif 26 | 27 | #include "Utilities/types.h" 28 | #include "Utilities/BEType.h" 29 | #include "util/atomic.hpp" 30 | #include "Utilities/StrFmt.h" 31 | #include "Utilities/File.h" 32 | #include "Utilities/Log.h" 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | using namespace std::literals; 49 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/save_data_list_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // I just want the struct for the save data. 4 | #include "stdafx.h" 5 | #include "Emu/System.h" 6 | #include "Emu/Memory/vm.h" 7 | #include "Emu/Cell/Modules/cellSaveData.h" 8 | #include "gui_settings.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | //Display a list of SaveData. Would need to be initialized. 15 | //Can also be used as a Save Data Chooser. 16 | class save_data_list_dialog : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | enum selection_code 21 | { 22 | new_save = -1, 23 | canceled = -2 24 | }; 25 | 26 | public: 27 | explicit save_data_list_dialog(const std::vector& entries, s32 focusedEntry, u32 op, vm::ptr, QWidget* parent = nullptr); 28 | 29 | s32 GetSelection(); 30 | private Q_SLOTS: 31 | void OnEntryInfo(); 32 | void OnSort(int logicalIndex); 33 | private: 34 | void UpdateSelectionLabel(void); 35 | void UpdateList(void); 36 | 37 | s32 m_entry; 38 | QLabel* m_entry_label = nullptr; 39 | 40 | QTableWidget* m_list = nullptr; 41 | std::vector m_save_entries; 42 | 43 | std::shared_ptr m_gui_settings; 44 | 45 | int m_sort_column; 46 | bool m_sort_ascending; 47 | }; 48 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/breakpoint_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "Emu/Cell/PPUThread.h" 4 | #include 5 | 6 | enum class breakpoint_types 7 | { 8 | bp_read = 0x1, 9 | bp_write = 0x2, 10 | bp_exec = 0x4, 11 | }; 12 | 13 | /* 14 | * This class acts as a layer between the UI and Emu for breakpoints. 15 | */ 16 | class breakpoint_handler 17 | { 18 | 19 | public: 20 | breakpoint_handler(); 21 | ~breakpoint_handler(); 22 | 23 | /** 24 | * Returns true iff breakpoint exists at loc. 25 | * TODO: Add arg for flags, gameid, and maybe even thread if it should be thread local breakpoint.... breakpoint struct is probably what'll happen 26 | */ 27 | bool HasBreakpoint(u32 loc) const; 28 | 29 | /** 30 | * Returns true if added successfully. TODO: flags 31 | */ 32 | bool AddBreakpoint(u32 loc); 33 | 34 | 35 | /** 36 | * Returns true if removed breakpoint at loc successfully. 37 | */ 38 | bool RemoveBreakpoint(u32 loc); 39 | 40 | private: 41 | // TODO : generalize to hold multiple games and handle flags.Probably do : std::map>. 42 | // Although, externally, they'll only be accessed by loc (I think) so a map of maps may also do? 43 | std::set m_breakpoints; //! Holds all breakpoints. 44 | }; 45 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellJpgEnc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | 5 | // Error Codes 6 | enum 7 | { 8 | CELL_JPGENC_ERROR_ARG = 0x80611191, 9 | CELL_JPGENC_ERROR_SEQ = 0x80611192, 10 | CELL_JPGENC_ERROR_BUSY = 0x80611193, 11 | CELL_JPGENC_ERROR_EMPTY = 0x80611194, 12 | CELL_JPGENC_ERROR_RESET = 0x80611195, 13 | CELL_JPGENC_ERROR_FATAL = 0x80611196, 14 | 15 | CELL_JPGENC_ERROR_STREAM_ABORT = 0x806111A1, 16 | CELL_JPGENC_ERROR_STREAM_SKIP = 0x806111A2, 17 | CELL_JPGENC_ERROR_STREAM_OVERFLOW = 0x806111A3, 18 | CELL_JPGENC_ERROR_STREAM_FILE_OPEN = 0x806111A4, 19 | }; 20 | 21 | // Definitions 22 | enum 23 | { 24 | CELL_JPGENC_COLOR_SPACE_GRAYSCALE = 1, 25 | CELL_JPGENC_COLOR_SPACE_RGB = 2, 26 | CELL_JPGENC_COLOR_SPACE_YCbCr = 3, 27 | CELL_JPGENC_COLOR_SPACE_RGBA = 10, 28 | CELL_JPGENC_COLOR_SPACE_ARGB = 20, 29 | 30 | CELL_JPGENC_SAMPLING_FMT_YCbCr444, 31 | CELL_JPGENC_SAMPLING_FMT_YCbCr422, 32 | CELL_JPGENC_SAMPLING_FMT_YCbCr420, 33 | CELL_JPGENC_SAMPLING_FMT_YCbCr411, 34 | CELL_JPGENC_SAMPLING_FMT_FULL, 35 | 36 | CELL_JPGENC_DCT_METHOD_QUALITY = 0, 37 | CELL_JPGENC_DCT_METHOD_FAST = 5, 38 | 39 | CELL_JPGENC_COMPR_MODE_CONSTANT_QUALITY, 40 | CELL_JPGENC_COMPR_MODE_STREAM_SIZE_LIMIT, 41 | 42 | CELL_JPGENC_LOCATION_FILE, 43 | CELL_JPGENC_LOCATION_BUFFER, 44 | }; 45 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | LOG_CHANNEL(cellSysutilMisc); 6 | 7 | // License areas 8 | enum 9 | { 10 | CELL_SYSUTIL_LICENSE_AREA_J = 0, 11 | CELL_SYSUTIL_LICENSE_AREA_A = 1, 12 | CELL_SYSUTIL_LICENSE_AREA_E = 2, 13 | CELL_SYSUTIL_LICENSE_AREA_H = 3, 14 | CELL_SYSUTIL_LICENSE_AREA_K = 4, 15 | CELL_SYSUTIL_LICENSE_AREA_C = 5, 16 | CELL_SYSUTIL_LICENSE_AREA_OTHER = 100, 17 | }; 18 | 19 | s32 cellSysutilGetLicenseArea() 20 | { 21 | cellSysutilMisc.warning("cellSysutilGetLicenseArea()"); 22 | 23 | switch (const char region = Emu.GetTitleID().at(2)) 24 | { 25 | case 'J': return CELL_SYSUTIL_LICENSE_AREA_J; 26 | case 'U': return CELL_SYSUTIL_LICENSE_AREA_A; 27 | case 'E': return CELL_SYSUTIL_LICENSE_AREA_E; 28 | case 'H': return CELL_SYSUTIL_LICENSE_AREA_H; 29 | case 'K': return CELL_SYSUTIL_LICENSE_AREA_K; 30 | case 'A': return CELL_SYSUTIL_LICENSE_AREA_C; 31 | default: cellSysutilMisc.todo("Unknown license area: %s", Emu.GetTitleID().c_str()); return CELL_SYSUTIL_LICENSE_AREA_OTHER; 32 | } 33 | } 34 | 35 | DECLARE(ppu_module_manager::cellSysutilMisc)("cellSysutilMisc", []() 36 | { 37 | REG_FUNC(cellSysutilMisc, cellSysutilGetLicenseArea); 38 | }); 39 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/custom_table_widget_item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class custom_table_widget_item : public QTableWidgetItem 6 | { 7 | private: 8 | int m_sort_role = Qt::DisplayRole; 9 | 10 | public: 11 | custom_table_widget_item(){} 12 | custom_table_widget_item(const std::string& text, int sort_role = Qt::DisplayRole, const QVariant& sort_value = 0) 13 | : QTableWidgetItem(QString::fromStdString(text).simplified()) // simplified() forces single line text 14 | { 15 | if (sort_role != Qt::DisplayRole) 16 | { 17 | setData(sort_role, sort_value, true); 18 | } 19 | } 20 | custom_table_widget_item(const QString& text, int sort_role = Qt::DisplayRole, const QVariant& sort_value = 0) 21 | : QTableWidgetItem(text.simplified()) // simplified() forces single line text 22 | { 23 | if (sort_role != Qt::DisplayRole) 24 | { 25 | setData(sort_role, sort_value, true); 26 | } 27 | } 28 | 29 | bool operator <(const QTableWidgetItem &other) const 30 | { 31 | return data(m_sort_role) < other.data(m_sort_role); 32 | } 33 | 34 | void setData(int role, const QVariant &value, bool assign_sort_role = false) 35 | { 36 | if (assign_sort_role) 37 | { 38 | m_sort_role = role; 39 | } 40 | QTableWidgetItem::setData(role, value); 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/AL/OpenALBackend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Audio/AudioBackend.h" 4 | #include "3rdparty/OpenAL/include/alext.h" 5 | #include 6 | 7 | class OpenALBackend : public AudioBackend 8 | { 9 | private: 10 | ALint m_format; 11 | ALuint m_source; 12 | ALuint m_buffers[MAX_AUDIO_BUFFERS]; 13 | ALsizei m_num_buffers; 14 | 15 | u32 m_next_buffer = 0; 16 | u32 m_num_unqueued = 0; 17 | 18 | const u32 m_sampling_rate; 19 | const u32 m_sample_size; 20 | 21 | void unqueue_processed(); 22 | 23 | public: 24 | OpenALBackend(); 25 | virtual ~OpenALBackend() override; 26 | 27 | virtual const char* GetName() const override { return "OpenAL"; } 28 | 29 | static const u32 capabilities = PLAY_PAUSE_FLUSH | IS_PLAYING | GET_NUM_ENQUEUED_SAMPLES | SET_FREQUENCY_RATIO; 30 | virtual u32 GetCapabilities() const override { return capabilities; } 31 | 32 | virtual void Open(u32 num_buffers) override; 33 | virtual void Close() override; 34 | 35 | virtual void Play() override; 36 | virtual void Pause() override; 37 | virtual bool IsPlaying() override; 38 | 39 | virtual bool AddData(const void* src, u32 size) override; 40 | virtual void Flush() override; 41 | 42 | virtual u64 GetNumEnqueuedSamples() override; 43 | virtual f32 SetFrequencyRatio(f32 new_ratio) override; 44 | }; -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellScreenshot.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | #include "cellScreenshot.h" 6 | 7 | 8 | 9 | LOG_CHANNEL(cellScreenshot); 10 | 11 | s32 cellScreenShotSetParameter(vm::cptr param) 12 | { 13 | cellScreenshot.todo("cellScreenShotSetParameter(param=*0x%x)", param); 14 | return CELL_OK; 15 | } 16 | 17 | s32 cellScreenShotSetOverlayImage(vm::cptr srcDir, vm::cptr srcFile, s32 offset_x, s32 offset_y) 18 | { 19 | cellScreenshot.todo("cellScreenShotSetOverlayImage(srcDir=%s, srcFile=%s, offset_x=%d, offset_y=%d)", srcDir, srcFile, offset_x, offset_y); 20 | return CELL_OK; 21 | } 22 | 23 | s32 cellScreenShotEnable() 24 | { 25 | cellScreenshot.todo("cellScreenShotEnable()"); 26 | return CELL_OK; 27 | } 28 | 29 | s32 cellScreenShotDisable() 30 | { 31 | cellScreenshot.todo("cellScreenShotDisable()"); 32 | return CELL_OK; 33 | } 34 | 35 | DECLARE(ppu_module_manager::cellScreenShot)("cellScreenShotUtility", []() 36 | { 37 | REG_FUNC(cellScreenShotUtility, cellScreenShotSetParameter); 38 | REG_FUNC(cellScreenShotUtility, cellScreenShotSetOverlayImage); 39 | REG_FUNC(cellScreenShotUtility, cellScreenShotEnable); 40 | REG_FUNC(cellScreenShotUtility, cellScreenShotDisable); 41 | }); 42 | -------------------------------------------------------------------------------- /Utilities/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.h" 4 | #include 5 | 6 | namespace utils 7 | { 8 | enum class version_type : uint 9 | { 10 | pre_alpha, 11 | alpha, 12 | beta, 13 | release_candidate, 14 | release 15 | }; 16 | 17 | std::string to_string(version_type type); 18 | 19 | class version 20 | { 21 | uint m_hi; 22 | uint m_mid; 23 | uint m_lo; 24 | version_type m_type = version_type::release; 25 | uint m_type_index = 1; 26 | const char* m_postfix; 27 | 28 | public: 29 | constexpr version(uint hi, uint mid, uint lo, version_type type, uint type_index, const char* postfix) 30 | : m_hi(hi) 31 | , m_mid(mid) 32 | , m_lo(lo) 33 | , m_type(type) 34 | , m_type_index(type_index) 35 | , m_postfix(postfix) 36 | { 37 | } 38 | 39 | uint hi() const 40 | { 41 | return m_hi; 42 | } 43 | 44 | uint mid() const 45 | { 46 | return m_mid; 47 | } 48 | 49 | uint lo() const 50 | { 51 | return m_lo; 52 | } 53 | 54 | version_type type() const 55 | { 56 | return m_type; 57 | } 58 | 59 | std::string postfix() const 60 | { 61 | return m_postfix; 62 | } 63 | 64 | uint type_index() const 65 | { 66 | return m_type_index; 67 | } 68 | 69 | uint to_hex() const; 70 | std::string to_string() const; 71 | }; 72 | } 73 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/libsnd3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // Error Codes 6 | enum 7 | { 8 | CELL_SND3_ERROR_PARAM = 0x80310301, 9 | CELL_SND3_ERROR_CREATE_MUTEX = 0x80310302, 10 | CELL_SND3_ERROR_SYNTH = 0x80310303, 11 | CELL_SND3_ERROR_ALREADY = 0x80310304, 12 | CELL_SND3_ERROR_NOTINIT = 0x80310305, 13 | CELL_SND3_ERROR_SMFFULL = 0x80310306, 14 | CELL_SND3_ERROR_HD3ID = 0x80310307, 15 | CELL_SND3_ERROR_SMF = 0x80310308, 16 | CELL_SND3_ERROR_SMFCTX = 0x80310309, 17 | CELL_SND3_ERROR_FORMAT = 0x8031030a, 18 | CELL_SND3_ERROR_SMFID = 0x8031030b, 19 | CELL_SND3_ERROR_SOUNDDATAFULL = 0x8031030c, 20 | CELL_SND3_ERROR_VOICENUM = 0x8031030d, 21 | CELL_SND3_ERROR_RESERVEDVOICE = 0x8031030e, 22 | CELL_SND3_ERROR_REQUESTQUEFULL = 0x8031030f, 23 | CELL_SND3_ERROR_OUTPUTMODE = 0x80310310, 24 | }; 25 | 26 | struct CellSnd3KeyOnParam 27 | { 28 | u8 vel; 29 | u8 pan; 30 | u8 panEx; 31 | be_t addPitch; 32 | }; 33 | 34 | struct CellSnd3VoiceBitCtx 35 | { 36 | be_t core[4]; 37 | }; 38 | 39 | struct CellSnd3DataCtx 40 | { 41 | s8 system[32]; 42 | }; 43 | 44 | struct CellSnd3SmfCtx 45 | { 46 | s8 system[352]; 47 | }; 48 | 49 | struct CellSnd3RequestQueueCtx 50 | { 51 | vm::bptr frontQueue; 52 | be_t frontQueueSize; 53 | vm::bptr rearQueue; 54 | be_t rearQueueSize; 55 | }; 56 | -------------------------------------------------------------------------------- /.travis/build-linux.bash: -------------------------------------------------------------------------------- 1 | #!/bin/env bash -ex 2 | shopt -s nocasematch 3 | 4 | # Setup Qt variables 5 | export QT_BASE_DIR=/opt/qt${QTVERMIN} 6 | export PATH=$QT_BASE_DIR/bin:$PATH 7 | export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib 8 | 9 | cd rpcs3 10 | 11 | git submodule update --quiet --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng 3rdparty/cereal 3rdparty/hidapi 3rdparty/xxHash 3rdparty/yaml-cpp 3rdparty/libusb Vulkan/glslang 12 | 13 | # Download pre-compiled llvm libs 14 | curl -sLO https://github.com/RPCS3/llvm/releases/download/continuous-linux-master/llvmlibs-linux.tar.gz 15 | mkdir llvmlibs 16 | tar -xzf ./llvmlibs-linux.tar.gz -C llvmlibs 17 | 18 | mkdir build ; cd build 19 | 20 | if [ $COMPILER = "gcc" ]; then 21 | # These are set in the dockerfile 22 | export CC=${GCC_BINARY} 23 | export CXX=${GXX_BINARY} 24 | else 25 | export CC=${CLANG_BINARY} 26 | export CXX=${CLANGXX_BINARY} 27 | fi 28 | 29 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_LLVM_SUBMODULE=OFF -DLLVM_DIR=llvmlibs/lib/cmake/llvm/ -DUSE_NATIVE_INSTRUCTIONS=OFF -G Ninja 30 | 31 | ninja; build_status=$?; 32 | 33 | cd .. 34 | # If it compiled succesfully let's deploy 35 | if [ $build_status -eq 0 ] && [ -n "$GITHUB_TOKEN" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then /bin/bash -ex .travis/deploy-linux.bash ; fi 36 | -------------------------------------------------------------------------------- /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 | private: 10 | bool m_has_icons; 11 | 12 | public: 13 | explicit table_item_delegate(QObject *parent = 0, bool has_icons = false) : QStyledItemDelegate(parent), m_has_icons(has_icons) {} 14 | 15 | virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override 16 | { 17 | // Remove the focus frame around selected items 18 | option->state &= ~QStyle::State_HasFocus; 19 | 20 | if (m_has_icons && index.column() == 0) 21 | { 22 | // Don't highlight icons 23 | option->state &= ~QStyle::State_Selected; 24 | } 25 | 26 | QStyledItemDelegate::initStyleOption(option, index); 27 | } 28 | 29 | virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override 30 | { 31 | if (index.column() == 0 && option.state & QStyle::State_Selected) 32 | { 33 | // Add background highlight color to icons 34 | painter->fillRect(option.rect, option.palette.color(QPalette::Highlight)); 35 | } 36 | 37 | QStyledItemDelegate::paint(painter, option, index); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellOvis.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | #include "Emu/Cell/lv2/sys_spu.h" 4 | 5 | 6 | 7 | LOG_CHANNEL(cellOvis); 8 | 9 | // Return Codes 10 | enum 11 | { 12 | CELL_OVIS_ERROR_INVAL = 0x80410402, 13 | CELL_OVIS_ERROR_ABORT = 0x8041040C, 14 | CELL_OVIS_ERROR_ALIGN = 0x80410410, 15 | }; 16 | 17 | s32 cellOvisGetOverlayTableSize(vm::cptr elf) 18 | { 19 | cellOvis.todo("cellOvisGetOverlayTableSize(elf=%s)", elf); 20 | return CELL_OK; 21 | } 22 | 23 | s32 cellOvisInitializeOverlayTable(vm::ptr ea_ovly_table, vm::cptr elf) 24 | { 25 | cellOvis.todo("cellOvisInitializeOverlayTable(ea_ovly_table=*0x%x, elf=%s)", ea_ovly_table, elf); 26 | return CELL_OK; 27 | } 28 | 29 | void cellOvisFixSpuSegments(vm::ptr image) 30 | { 31 | cellOvis.todo("cellOvisFixSpuSegments(image=*0x%x)", image); 32 | } 33 | 34 | void cellOvisInvalidateOverlappedSegments(vm::ptr segs, vm::ptr nsegs) 35 | { 36 | cellOvis.todo("cellOvisInvalidateOverlappedSegments(segs=*0x%x, nsegs=*0x%x)", segs, nsegs); 37 | } 38 | 39 | DECLARE(ppu_module_manager::cellOvis)("cellOvis", []() 40 | { 41 | REG_FUNC(cellOvis, cellOvisGetOverlayTableSize); 42 | REG_FUNC(cellOvis, cellOvisInitializeOverlayTable); 43 | REG_FUNC(cellOvis, cellOvisFixSpuSegments); 44 | REG_FUNC(cellOvis, cellOvisInvalidateOverlappedSegments); 45 | }); 46 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sceNpTus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/BEType.h" 4 | 5 | #include "cellRtc.h" 6 | #include "sceNp.h" 7 | 8 | #include 9 | 10 | // Constants for TUS functions and structures 11 | enum 12 | { 13 | SCE_NP_TUS_DATA_INFO_MAX_SIZE = 384, 14 | SCE_NP_TUS_MAX_CTX_NUM = 32, 15 | SCE_NP_TUS_MAX_SLOT_NUM_PER_TRANS = 64, 16 | SCE_NP_TUS_MAX_USER_NUM_PER_TRANS = 101, 17 | }; 18 | 19 | SceNpOnlineId SceNpTusVirtualUserId; 20 | 21 | // Structure for representing a TUS variable 22 | struct SceNpTusVariable 23 | { 24 | SceNpId ownerId; 25 | be_t hasData; 26 | u8 pad[4]; 27 | CellRtcTick lastChangedDate; 28 | SceNpId lastChangedAuthorId; 29 | be_t variable; 30 | be_t oldVariable; 31 | u8 reserved[16]; 32 | }; 33 | 34 | // Structure for representing the accessory information of a TUS data 35 | struct SceNpTusDataInfo 36 | { 37 | be_t infoSize; 38 | u8 pad[4]; 39 | u8 data[SCE_NP_TUS_DATA_INFO_MAX_SIZE]; 40 | }; 41 | 42 | // Structure for respreseting the status of TUS data 43 | struct SceNpTusDataStatus 44 | { 45 | SceNpId ownerId; 46 | be_t hasData; 47 | CellRtcTick lastChangedDate; 48 | SceNpId lastChangedAuthorId; 49 | be_t data; 50 | be_t dataSize; 51 | u8 pad[4]; 52 | SceNpTusDataInfo info; 53 | }; 54 | 55 | // fxm objects 56 | 57 | struct sce_np_tus_manager 58 | { 59 | std::atomic is_initialized = false; 60 | }; 61 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | matrix: 3 | include: 4 | # - os: linux 5 | # env: 6 | # - NAME="Linux build" 7 | # - COMPILER="gcc" 8 | # services: docker 9 | # cache: ccache 10 | # install: "docker pull rpcs3/rpcs3-travis-trusty:1.1" 11 | # script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .travis/travis.env rpcs3/rpcs3-travis-trusty:1.1 /bin/bash -ex /rpcs3/.travis/build-linux.bash' 12 | - os: linux 13 | env: 14 | - NAME="Linux build" 15 | - COMPILER="clang" 16 | - DEPLOY_APPIMAGE="true" 17 | services: docker 18 | cache: ccache 19 | install: "docker pull rpcs3/rpcs3-travis-trusty:1.1" 20 | script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .travis/travis.env rpcs3/rpcs3-travis-trusty:1.1 /bin/bash -ex /rpcs3/.travis/build-linux.bash' 21 | - os: osx 22 | osx_image: xcode10.2 23 | addons: 24 | homebrew: 25 | packages: 26 | - ccache 27 | - glew 28 | - ninja 29 | - qt 30 | script: "/bin/bash -ex .travis/build-mac.bash" 31 | cache: ccache 32 | 33 | git: 34 | depth: false # Unshallow clone to obtain proper GIT_VERSION 35 | submodules: false 36 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/debugger_list.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "breakpoint_handler.h" 4 | #include "gui_settings.h" 5 | 6 | #include "Emu/CPU/CPUThread.h" 7 | #include "Emu/CPU/CPUDisAsm.h" 8 | 9 | #include 10 | 11 | class debugger_list : public QListWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | u32 m_pc; 17 | u32 m_item_count; 18 | bool m_no_thread_selected; 19 | QColor m_color_bp; 20 | QColor m_color_pc; 21 | QColor m_text_color_bp; 22 | QColor m_text_color_pc; 23 | 24 | Q_SIGNALS: 25 | void BreakpointRequested(u32 loc); 26 | public: 27 | debugger_list(QWidget* parent, std::shared_ptr settings, breakpoint_handler* handler); 28 | void UpdateCPUData(std::weak_ptr cpu, std::shared_ptr disasm); 29 | public Q_SLOTS: 30 | void ShowAddress(u32 addr); 31 | protected: 32 | void keyPressEvent(QKeyEvent* event) override; 33 | void mouseDoubleClickEvent(QMouseEvent* event) override; 34 | void wheelEvent(QWheelEvent* event) override; 35 | void resizeEvent(QResizeEvent* event) override; 36 | private: 37 | /** 38 | * It really upsetted me I had to copy this code to make debugger_list/frame not circularly dependent. 39 | */ 40 | u32 GetPc() const; 41 | u32 GetCenteredAddress(u32 address) const; 42 | 43 | std::shared_ptr xgui_settings; 44 | 45 | breakpoint_handler* m_breakpoint_handler; 46 | std::weak_ptr cpu; 47 | std::shared_ptr m_disasm; 48 | }; 49 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/vfs_dialog_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/System.h" 5 | 6 | #include "gui_settings.h" 7 | #include "emu_settings.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | struct vfs_settings_info 14 | { 15 | QString name; // name of tab 16 | emu_settings::SettingsType settingLoc; // Where the setting is saved in emu_settings 17 | gui_save listLocation; // Where the list of dir options are saved 18 | cfg::string* cfg_node; // Needed since emu_settings overrides settings file and doesn't touch g_cfg currently. 19 | }; 20 | 21 | class vfs_dialog_tab : public QWidget 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | explicit vfs_dialog_tab(vfs_settings_info info, std::shared_ptr guiSettings, std::shared_ptr emuSettings, QWidget* parent = nullptr); 27 | 28 | void SetSettings(); 29 | 30 | // Reset this tab without saving the settings yet 31 | void Reset(); 32 | 33 | private: 34 | void AddNewDirectory(); 35 | void RemoveDirectory(); 36 | void SetCurrentRow(int row) { m_currentRow = row; } 37 | 38 | const QString EmptyPath = tr("Empty Path"); 39 | 40 | vfs_settings_info m_info; 41 | std::shared_ptr m_gui_settings; 42 | std::shared_ptr m_emu_settings; 43 | int m_currentRow = -1; 44 | 45 | // UI variables needed in higher scope 46 | QListWidget* m_dirList; 47 | QLabel* m_selectedConfigLabel; 48 | }; 49 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sys_libc.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | LOG_CHANNEL(sys_libc); 6 | 7 | vm::ptr sys_libc_memcpy(vm::ptr dst, vm::cptr src, u32 size) 8 | { 9 | sys_libc.trace("memcpy(dst=*0x%x, src=*0x%x, size=0x%x)", dst, src, size); 10 | 11 | ::memcpy(dst.get_ptr(), src.get_ptr(), size); 12 | return dst; 13 | } 14 | vm::ptr sys_libc_memset(vm::ptr dst, s32 value, u32 size) 15 | { 16 | sys_libc.trace("memset(dst=*0x%x, value=0x%x, size=0x%x)", dst, value, size); 17 | 18 | ::memset(dst.get_ptr(), value, size); 19 | return dst; 20 | } 21 | 22 | vm::ptr sys_libc_memmove(vm::ptr dst, vm::ptr src, u32 size) 23 | { 24 | sys_libc.trace("memmove(dst=*0x%x, src=*0x%x, size=0x%x)", dst, src, size); 25 | 26 | ::memmove(dst.get_ptr(), src.get_ptr(), size); 27 | return dst; 28 | } 29 | 30 | u32 sys_libc_memcmp(vm::ptr buf1, vm::ptr buf2, u32 size) 31 | { 32 | sys_libc.trace("memcmp(buf1=*0x%x, buf2=*0x%x, size=0x%x)", buf1, buf2, size); 33 | 34 | return ::memcmp(buf1.get_ptr(), buf2.get_ptr(), size); 35 | } 36 | 37 | DECLARE(ppu_module_manager::sys_libc)("sys_libc", []() 38 | { 39 | REG_FNID(sys_libc, "memcpy", sys_libc_memcpy)/*.flag(MFF_FORCED_HLE)*/; 40 | REG_FNID(sys_libc, "memset", sys_libc_memset); 41 | REG_FNID(sys_libc, "memmove", sys_libc_memmove); 42 | REG_FNID(sys_libc, "memcmp", sys_libc_memcmp); 43 | }); 44 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_trace.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "sys_trace.h" 3 | 4 | #include "Emu/System.h" 5 | 6 | #include "Emu/Cell/ErrorCodes.h" 7 | 8 | 9 | 10 | LOG_CHANNEL(sys_trace); 11 | 12 | // TODO: DEX/DECR mode support? 13 | 14 | s32 sys_trace_create() 15 | { 16 | sys_trace.todo("sys_trace_create()"); 17 | return CELL_ENOSYS; 18 | } 19 | 20 | s32 sys_trace_start() 21 | { 22 | sys_trace.todo("sys_trace_start()"); 23 | return CELL_ENOSYS; 24 | } 25 | 26 | s32 sys_trace_stop() 27 | { 28 | sys_trace.todo("sys_trace_stop()"); 29 | return CELL_ENOSYS; 30 | } 31 | 32 | s32 sys_trace_update_top_index() 33 | { 34 | sys_trace.todo("sys_trace_update_top_index()"); 35 | return CELL_ENOSYS; 36 | } 37 | 38 | s32 sys_trace_destroy() 39 | { 40 | sys_trace.todo("sys_trace_destroy()"); 41 | return CELL_ENOSYS; 42 | } 43 | 44 | s32 sys_trace_drain() 45 | { 46 | sys_trace.todo("sys_trace_drain()"); 47 | return CELL_ENOSYS; 48 | } 49 | 50 | s32 sys_trace_attach_process() 51 | { 52 | sys_trace.todo("sys_trace_attach_process()"); 53 | return CELL_ENOSYS; 54 | } 55 | 56 | s32 sys_trace_allocate_buffer() 57 | { 58 | sys_trace.todo("sys_trace_allocate_buffer()"); 59 | return CELL_ENOSYS; 60 | } 61 | 62 | s32 sys_trace_free_buffer() 63 | { 64 | sys_trace.todo("sys_trace_free_buffer()"); 65 | return CELL_ENOSYS; 66 | } 67 | 68 | s32 sys_trace_create2() 69 | { 70 | sys_trace.todo("sys_trace_create2()"); 71 | return CELL_ENOSYS; 72 | } 73 | -------------------------------------------------------------------------------- /Utilities/sema.cpp: -------------------------------------------------------------------------------- 1 | #include "sema.h" 2 | 3 | void semaphore_base::imp_wait() 4 | { 5 | for (int i = 0; i < 10; i++) 6 | { 7 | busy_wait(); 8 | 9 | const s32 value = m_value.load(); 10 | 11 | if (value > 0 && m_value.compare_and_swap_test(value, value - 1)) 12 | { 13 | return; 14 | } 15 | } 16 | 17 | while (true) 18 | { 19 | // Try hard way 20 | const s32 value = m_value.atomic_op([](s32& value) 21 | { 22 | // Use sign bit to acknowledge waiter presence 23 | if (value && value > INT32_MIN) 24 | { 25 | value--; 26 | 27 | if (value < 0) 28 | { 29 | // Remove sign bit 30 | value -= INT32_MIN; 31 | } 32 | } 33 | else 34 | { 35 | // Set sign bit 36 | value = INT32_MIN; 37 | } 38 | 39 | return value; 40 | }); 41 | 42 | if (value >= 0) 43 | { 44 | // Signal other waiter to wake up or to restore sign bit 45 | m_value.notify_one(); 46 | return; 47 | } 48 | 49 | m_value.wait(value); 50 | } 51 | } 52 | 53 | void semaphore_base::imp_post(s32 _old) 54 | { 55 | verify("semaphore_base: overflow" HERE), _old < 0; 56 | 57 | m_value.notify_one(); 58 | } 59 | 60 | bool semaphore_base::try_post(s32 _max) 61 | { 62 | // Conditional increment 63 | const s32 value = m_value.fetch_op([&](s32& value) 64 | { 65 | if (value < _max) 66 | { 67 | value += 1; 68 | } 69 | }); 70 | 71 | if (value < 0) 72 | { 73 | imp_post(value); 74 | } 75 | 76 | return value < _max; 77 | } 78 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/libad_core.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | LOG_CHANNEL(libad_core); 5 | 6 | s32 sceAdOpenContext() 7 | { 8 | UNIMPLEMENTED_FUNC(libad_core); 9 | return CELL_OK; 10 | } 11 | 12 | s32 sceAdFlushReports() 13 | { 14 | UNIMPLEMENTED_FUNC(libad_core); 15 | return CELL_OK; 16 | } 17 | 18 | s32 sceAdGetAssetInfo() 19 | { 20 | UNIMPLEMENTED_FUNC(libad_core); 21 | return CELL_OK; 22 | } 23 | 24 | s32 sceAdCloseContext() 25 | { 26 | UNIMPLEMENTED_FUNC(libad_core); 27 | return CELL_OK; 28 | } 29 | 30 | s32 sceAdGetSpaceInfo() 31 | { 32 | UNIMPLEMENTED_FUNC(libad_core); 33 | return CELL_OK; 34 | } 35 | 36 | s32 sceAdGetConnectionInfo() 37 | { 38 | UNIMPLEMENTED_FUNC(libad_core); 39 | return CELL_OK; 40 | } 41 | 42 | s32 sceAdConnectContext() 43 | { 44 | UNIMPLEMENTED_FUNC(libad_core); 45 | return CELL_OK; 46 | } 47 | 48 | s32 libad_core_260DB83D() //Pain 49 | { 50 | UNIMPLEMENTED_FUNC(libad_core); 51 | return CELL_OK; 52 | } 53 | 54 | DECLARE(ppu_module_manager::libad_core)("libad_core", []() 55 | { 56 | REG_FUNC(libad_core, sceAdOpenContext); 57 | REG_FUNC(libad_core, sceAdFlushReports); 58 | REG_FUNC(libad_core, sceAdGetAssetInfo); 59 | REG_FUNC(libad_core, sceAdCloseContext); 60 | REG_FUNC(libad_core, sceAdGetSpaceInfo); 61 | REG_FUNC(libad_core, sceAdGetConnectionInfo); 62 | REG_FUNC(libad_core, sceAdConnectContext); 63 | 64 | //Need found real name. 65 | REG_FNID(libad_core, 0x260DB83D, libad_core_260DB83D); 66 | }); 67 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_lwcond.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sys_sync.h" 4 | 5 | #include "Emu/Memory/vm_ptr.h" 6 | 7 | struct sys_lwmutex_t; 8 | 9 | struct sys_lwcond_attribute_t 10 | { 11 | union 12 | { 13 | u64 name_u64; 14 | char name[sizeof(u64)]; 15 | }; 16 | }; 17 | 18 | struct sys_lwcond_t 19 | { 20 | vm::bptr lwmutex; 21 | be_t lwcond_queue; // lwcond pseudo-id 22 | }; 23 | 24 | struct lv2_lwcond final : lv2_obj 25 | { 26 | static const u32 id_base = 0x97000000; 27 | 28 | const u64 name; 29 | const u32 lwid; 30 | const u32 protocol; 31 | vm::ptr control; 32 | 33 | shared_mutex mutex; 34 | atomic_t waiters{0}; 35 | std::deque sq; 36 | 37 | lv2_lwcond(u64 name, u32 lwid, u32 protocol, vm::ptr control) 38 | : name(name) 39 | , lwid(lwid) 40 | , protocol(protocol) 41 | , control(control) 42 | { 43 | } 44 | }; 45 | 46 | // Aux 47 | class ppu_thread; 48 | 49 | // Syscalls 50 | 51 | error_code _sys_lwcond_create(ppu_thread& ppu, vm::ptr lwcond_id, u32 lwmutex_id, vm::ptr control, u64 name, u32 arg5); 52 | error_code _sys_lwcond_destroy(ppu_thread& ppu, u32 lwcond_id); 53 | error_code _sys_lwcond_signal(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u32 ppu_thread_id, u32 mode); 54 | error_code _sys_lwcond_signal_all(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u32 mode); 55 | error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u64 timeout); 56 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_cond.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sys_sync.h" 4 | #include "sys_mutex.h" 5 | 6 | struct lv2_mutex; 7 | 8 | struct sys_cond_attribute_t 9 | { 10 | be_t pshared; 11 | be_t flags; 12 | be_t ipc_key; 13 | 14 | union 15 | { 16 | u64 name_u64; 17 | char name[sizeof(u64)]; 18 | }; 19 | }; 20 | 21 | struct lv2_cond final : lv2_obj 22 | { 23 | static const u32 id_base = 0x86000000; 24 | 25 | const u32 shared; 26 | const s32 flags; 27 | const u64 key; 28 | const u64 name; 29 | 30 | std::shared_ptr mutex; // Associated Mutex 31 | atomic_t waiters{0}; 32 | std::deque sq; 33 | 34 | lv2_cond(u32 shared, s32 flags, u64 key, u64 name, std::shared_ptr mutex) 35 | : shared(shared) 36 | , key(key) 37 | , flags(flags) 38 | , name(name) 39 | , mutex(std::move(mutex)) 40 | { 41 | this->mutex->cond_count++; 42 | } 43 | 44 | ~lv2_cond() 45 | { 46 | this->mutex->cond_count--; 47 | } 48 | }; 49 | 50 | class ppu_thread; 51 | 52 | // Syscalls 53 | 54 | error_code sys_cond_create(ppu_thread& ppu, vm::ptr cond_id, u32 mutex_id, vm::ptr attr); 55 | error_code sys_cond_destroy(ppu_thread& ppu, u32 cond_id); 56 | error_code sys_cond_wait(ppu_thread& ppu, u32 cond_id, u64 timeout); 57 | error_code sys_cond_signal(ppu_thread& ppu, u32 cond_id); 58 | error_code sys_cond_signal_all(ppu_thread& ppu, u32 cond_id); 59 | error_code sys_cond_signal_to(ppu_thread& ppu, u32 cond_id, u32 thread_id); 60 | -------------------------------------------------------------------------------- /Utilities/dynamic_library.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "dynamic_library.h" 3 | 4 | #ifdef _WIN32 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | namespace utils 11 | { 12 | dynamic_library::dynamic_library(const std::string &path) 13 | { 14 | load(path); 15 | } 16 | 17 | dynamic_library::~dynamic_library() 18 | { 19 | close(); 20 | } 21 | 22 | bool dynamic_library::load(const std::string &path) 23 | { 24 | #ifdef _WIN32 25 | m_handle = LoadLibraryA(path.c_str()); 26 | #else 27 | m_handle = dlopen(path.c_str(), RTLD_LAZY); 28 | #endif 29 | return loaded(); 30 | } 31 | 32 | void dynamic_library::close() 33 | { 34 | #ifdef _WIN32 35 | FreeLibrary((HMODULE)m_handle); 36 | #else 37 | dlclose(m_handle); 38 | #endif 39 | m_handle = nullptr; 40 | } 41 | 42 | void *dynamic_library::get_impl(const std::string &name) const 43 | { 44 | #ifdef _WIN32 45 | return (void*)GetProcAddress((HMODULE)m_handle, name.c_str()); 46 | #else 47 | return dlsym(m_handle, (char *)name.c_str()); 48 | #endif 49 | } 50 | 51 | bool dynamic_library::loaded() const 52 | { 53 | return m_handle != nullptr; 54 | } 55 | 56 | dynamic_library::operator bool() const 57 | { 58 | return loaded(); 59 | } 60 | 61 | void* get_proc_address(const char* lib, const char* name) 62 | { 63 | #ifdef _WIN32 64 | return reinterpret_cast(GetProcAddress(GetModuleHandleA(lib), name)); 65 | #else 66 | return dlsym(dlopen(lib, RTLD_NOLOAD), name); 67 | #endif 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /rpcs3/Emu/CPU/CPUDisAsm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Utilities/StrFmt.h" 5 | 6 | enum CPUDisAsmMode 7 | { 8 | CPUDisAsm_DumpMode, 9 | CPUDisAsm_InterpreterMode, 10 | //CPUDisAsm_NormalMode, 11 | CPUDisAsm_CompilerElfMode, 12 | }; 13 | 14 | class CPUDisAsm 15 | { 16 | protected: 17 | const CPUDisAsmMode m_mode; 18 | 19 | virtual void Write(const std::string& value) 20 | { 21 | switch(m_mode) 22 | { 23 | case CPUDisAsm_DumpMode: 24 | last_opcode = fmt::format("\t%08x:\t%02x %02x %02x %02x\t%s\n", dump_pc, 25 | offset[dump_pc], 26 | offset[dump_pc + 1], 27 | offset[dump_pc + 2], 28 | offset[dump_pc + 3], value); 29 | break; 30 | 31 | case CPUDisAsm_InterpreterMode: 32 | last_opcode = fmt::format("[%08x] %02x %02x %02x %02x: %s", dump_pc, 33 | offset[dump_pc], 34 | offset[dump_pc + 1], 35 | offset[dump_pc + 2], 36 | offset[dump_pc + 3], value); 37 | break; 38 | 39 | case CPUDisAsm_CompilerElfMode: 40 | last_opcode = value + "\n"; 41 | break; 42 | } 43 | } 44 | 45 | public: 46 | std::string last_opcode; 47 | u32 dump_pc; 48 | const u8* offset; 49 | 50 | protected: 51 | CPUDisAsm(CPUDisAsmMode mode) 52 | : m_mode(mode) 53 | , offset(0) 54 | { 55 | } 56 | 57 | virtual u32 DisAsmBranchTarget(const s32 imm) = 0; 58 | 59 | std::string FixOp(std::string op) 60 | { 61 | op.resize(std::max(op.length(), 10), ' '); 62 | return op; 63 | } 64 | 65 | public: 66 | virtual u32 disasm(u32 pc) = 0; 67 | }; 68 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/sys_spinlock.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | #include "sysPrxForUser.h" 6 | 7 | extern logs::channel sysPrxForUser; 8 | 9 | void sys_spinlock_initialize(vm::ptr> lock) 10 | { 11 | sysPrxForUser.trace("sys_spinlock_initialize(lock=*0x%x)", lock); 12 | 13 | if (*lock) 14 | { 15 | *lock = 0; 16 | } 17 | } 18 | 19 | error_code sys_spinlock_lock(ppu_thread& ppu, vm::ptr> lock) 20 | { 21 | sysPrxForUser.trace("sys_spinlock_lock(lock=*0x%x)", lock); 22 | 23 | // Try to exchange with 0xabadcafe, repeat until exchanged with 0 24 | while (*lock || lock->exchange(0xabadcafe)) 25 | { 26 | if (ppu.test_stopped()) 27 | { 28 | return 0; 29 | } 30 | } 31 | 32 | return not_an_error(ppu.gpr[3]); 33 | } 34 | 35 | s32 sys_spinlock_trylock(vm::ptr> lock) 36 | { 37 | sysPrxForUser.trace("sys_spinlock_trylock(lock=*0x%x)", lock); 38 | 39 | if (*lock || lock->exchange(0xabadcafe)) 40 | { 41 | return CELL_EBUSY; 42 | } 43 | 44 | return CELL_OK; 45 | } 46 | 47 | void sys_spinlock_unlock(vm::ptr> lock) 48 | { 49 | sysPrxForUser.trace("sys_spinlock_unlock(lock=*0x%x)", lock); 50 | 51 | *lock = 0; 52 | } 53 | 54 | void sysPrxForUser_sys_spinlock_init() 55 | { 56 | REG_FUNC(sysPrxForUser, sys_spinlock_initialize); 57 | REG_FUNC(sysPrxForUser, sys_spinlock_lock); 58 | REG_FUNC(sysPrxForUser, sys_spinlock_trylock); 59 | REG_FUNC(sysPrxForUser, sys_spinlock_unlock); 60 | } 61 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | 5 | #include "Emu/Audio/AudioBackend.h" 6 | 7 | 8 | class XAudio2Backend : public AudioBackend 9 | { 10 | public: 11 | class XAudio2Library 12 | { 13 | public: 14 | virtual void play() = 0; 15 | virtual void flush() = 0; 16 | virtual void stop() = 0; 17 | virtual void open() = 0; 18 | virtual bool is_playing() = 0; 19 | virtual bool add(const void*, u32) = 0; 20 | virtual u64 enqueued_samples() = 0; 21 | virtual f32 set_freq_ratio(f32) = 0; 22 | }; 23 | 24 | private: 25 | static XAudio2Library* xa27_init(void*); 26 | static XAudio2Library* xa28_init(void*); 27 | 28 | std::unique_ptr lib = nullptr; 29 | 30 | public: 31 | XAudio2Backend(); 32 | virtual ~XAudio2Backend() override; 33 | 34 | virtual const char* GetName() const override { return "XAudio2"; }; 35 | 36 | static const u32 capabilities = PLAY_PAUSE_FLUSH | IS_PLAYING | GET_NUM_ENQUEUED_SAMPLES | SET_FREQUENCY_RATIO; 37 | virtual u32 GetCapabilities() const override { return capabilities; }; 38 | 39 | virtual void Open(u32 /* num_buffers */) override; 40 | virtual void Close() override; 41 | 42 | virtual void Play() override; 43 | virtual void Pause() override; 44 | virtual bool IsPlaying() override; 45 | 46 | virtual bool AddData(const void* src, u32 num_samples) override; 47 | virtual void Flush() override; 48 | 49 | virtual u64 GetNumEnqueuedSamples() override; 50 | virtual f32 SetFrequencyRatio(f32 new_ratio) override; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_semaphore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sys_sync.h" 4 | 5 | #include "Emu/Memory/vm_ptr.h" 6 | 7 | struct sys_semaphore_attribute_t 8 | { 9 | be_t protocol; 10 | be_t pshared; 11 | be_t ipc_key; 12 | be_t flags; 13 | be_t pad; 14 | 15 | union 16 | { 17 | u64 name_u64; 18 | char name[sizeof(u64)]; 19 | }; 20 | }; 21 | 22 | struct lv2_sema final : lv2_obj 23 | { 24 | static const u32 id_base = 0x96000000; 25 | 26 | const u32 protocol; 27 | const u32 shared; 28 | const u64 key; 29 | const u64 name; 30 | const s32 flags; 31 | const s32 max; 32 | 33 | shared_mutex mutex; 34 | atomic_t val; 35 | std::deque sq; 36 | 37 | lv2_sema(u32 protocol, u32 shared, u64 key, s32 flags, u64 name, s32 max, s32 value) 38 | : protocol(protocol) 39 | , shared(shared) 40 | , key(key) 41 | , flags(flags) 42 | , name(name) 43 | , max(max) 44 | , val(value) 45 | { 46 | } 47 | }; 48 | 49 | // Aux 50 | class ppu_thread; 51 | 52 | // Syscalls 53 | 54 | error_code sys_semaphore_create(ppu_thread& ppu, vm::ptr sem_id, vm::ptr attr, s32 initial_val, s32 max_val); 55 | error_code sys_semaphore_destroy(ppu_thread& ppu, u32 sem_id); 56 | error_code sys_semaphore_wait(ppu_thread& ppu, u32 sem_id, u64 timeout); 57 | error_code sys_semaphore_trywait(ppu_thread& ppu, u32 sem_id); 58 | error_code sys_semaphore_post(ppu_thread& ppu, u32 sem_id, s32 count); 59 | error_code sys_semaphore_get_value(ppu_thread& ppu, u32 sem_id, vm::ptr count); 60 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellUsbd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | 5 | // Return Codes 6 | enum 7 | { 8 | CELL_USBD_ERROR_NOT_INITIALIZED = 0x80110001, 9 | CELL_USBD_ERROR_ALREADY_INITIALIZED = 0x80110002, 10 | CELL_USBD_ERROR_NO_MEMORY = 0x80110003, 11 | CELL_USBD_ERROR_INVALID_PARAM = 0x80110004, 12 | CELL_USBD_ERROR_INVALID_TRANSFER_TYPE = 0x80110005, 13 | CELL_USBD_ERROR_LDD_ALREADY_REGISTERED = 0x80110006, 14 | CELL_USBD_ERROR_LDD_NOT_ALLOCATED = 0x80110007, 15 | CELL_USBD_ERROR_LDD_NOT_RELEASED = 0x80110008, 16 | CELL_USBD_ERROR_LDD_NOT_FOUND = 0x80110009, 17 | CELL_USBD_ERROR_DEVICE_NOT_FOUND = 0x8011000a, 18 | CELL_USBD_ERROR_PIPE_NOT_ALLOCATED = 0x8011000b, 19 | CELL_USBD_ERROR_PIPE_NOT_RELEASED = 0x8011000c, 20 | CELL_USBD_ERROR_PIPE_NOT_FOUND = 0x8011000d, 21 | CELL_USBD_ERROR_IOREQ_NOT_ALLOCATED = 0x8011000e, 22 | CELL_USBD_ERROR_IOREQ_NOT_RELEASED = 0x8011000f, 23 | CELL_USBD_ERROR_IOREQ_NOT_FOUND = 0x80110010, 24 | CELL_USBD_ERROR_CANNOT_GET_DESCRIPTOR = 0x80110011, 25 | CELL_USBD_ERROR_FATAL = 0x801100ff, 26 | }; 27 | 28 | // TCC (Transfer Completion Codes) 29 | enum 30 | { 31 | HC_CC_NOERR = 0x0, 32 | EHCI_CC_MISSMF = 0x10, 33 | EHCI_CC_XACT = 0x20, 34 | EHCI_CC_BABBLE = 0x30, 35 | EHCI_CC_DATABUF = 0x40, 36 | EHCI_CC_HALTED = 0x50, 37 | 38 | USBD_HC_CC_NOERR = 0x0, 39 | USBD_HC_CC_MISSMF = 0x1, 40 | USBD_HC_CC_XACT = 0x2, 41 | USBD_HC_CC_BABBLE = 0x4, 42 | USBD_HC_CC_DATABUF = 0x8, 43 | }; 44 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellUserInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Emu/Memory/vm_ptr.h" 4 | 5 | // Error Codes 6 | enum CellUserInfoError : u32 7 | { 8 | CELL_USERINFO_ERROR_BUSY = 0x8002c301, 9 | CELL_USERINFO_ERROR_INTERNAL = 0x8002c302, 10 | CELL_USERINFO_ERROR_PARAM = 0x8002c303, 11 | CELL_USERINFO_ERROR_NOUSER = 0x8002c304, 12 | }; 13 | 14 | // Enums 15 | enum CellUserInfoParamSize 16 | { 17 | CELL_USERINFO_USER_MAX = 16, 18 | CELL_USERINFO_TITLE_SIZE = 256, 19 | CELL_USERINFO_USERNAME_SIZE = 64, 20 | }; 21 | 22 | enum CellUserInfoListType 23 | { 24 | CELL_USERINFO_LISTTYPE_ALL = 0, 25 | CELL_USERINFO_LISTTYPE_NOCURRENT = 1, 26 | }; 27 | 28 | enum 29 | { 30 | CELL_SYSUTIL_USERID_CURRENT = 0, 31 | CELL_SYSUTIL_USERID_MAX = 99999999, 32 | }; 33 | 34 | // Structs 35 | struct CellUserInfoUserStat 36 | { 37 | be_t id; 38 | char name[CELL_USERINFO_USERNAME_SIZE]; 39 | }; 40 | 41 | struct CellUserInfoUserList 42 | { 43 | be_t userId[CELL_USERINFO_USER_MAX]; 44 | }; 45 | 46 | struct CellUserInfoListSet 47 | { 48 | vm::bptr title; 49 | be_t focus; // id 50 | be_t fixedListNum; 51 | vm::bptr fixedList; 52 | vm::bptr reserved; 53 | }; 54 | 55 | struct CellUserInfoTypeSet 56 | { 57 | vm::bptr title; 58 | be_t focus; // id 59 | be_t type; // CellUserInfoListType 60 | vm::bptr reserved; 61 | }; 62 | 63 | using CellUserInfoFinishCallback = void(s32 result, vm::ptr selectedUser, vm::ptr userdata); 64 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/auto_pause_settings_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Emu/System.h" 5 | #include "Emu/Memory/vm.h" 6 | #include "table_item_delegate.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | class auto_pause_settings_dialog : public QDialog 23 | { 24 | Q_OBJECT 25 | 26 | enum 27 | { 28 | id_add, 29 | id_remove, 30 | id_config, 31 | }; 32 | 33 | std::vector m_entries; 34 | 35 | public: 36 | explicit auto_pause_settings_dialog(QWidget* parent); 37 | QTableWidget *pauseList; 38 | void UpdateList(void); 39 | void LoadEntries(void); 40 | void SaveEntries(void); 41 | 42 | public Q_SLOTS: 43 | void OnRemove(); 44 | private Q_SLOTS: 45 | void ShowContextMenu(const QPoint &pos); 46 | void keyPressEvent(QKeyEvent *event) override; 47 | }; 48 | 49 | class AutoPauseConfigDialog : public QDialog 50 | { 51 | Q_OBJECT 52 | 53 | u32 m_entry; 54 | u32* m_presult; 55 | bool m_newEntry; 56 | QLineEdit* m_id; 57 | QLabel* m_current_converted; 58 | auto_pause_settings_dialog* m_apsd; 59 | 60 | public: 61 | explicit AutoPauseConfigDialog(QWidget* parent, auto_pause_settings_dialog* apsd, bool newEntry, u32* entry); 62 | 63 | private Q_SLOTS: 64 | void OnOk(); 65 | void OnCancel(); 66 | void OnUpdateValue(); 67 | }; 68 | -------------------------------------------------------------------------------- /rpcs3_llvm.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LLVM_AVAILABLE;%(PreprocessorDefinitions) 9 | 10 | 11 | ..\llvm_build\Debug\lib 12 | ..\llvm_build\Release\lib 13 | LLVMProfileData.lib;LLVMDebugInfoCodeView.lib;LLVMDebugInfoMSF.lib;LLVMInstrumentation.lib;LLVMMCJIT.lib;LLVMRuntimeDyld.lib;LLVMVectorize.lib;LLVMX86CodeGen.lib;LLVMGlobalISel.lib;LLVMX86Disassembler.lib;LLVMExecutionEngine.lib;LLVMAsmPrinter.lib;LLVMSelectionDAG.lib;LLVMCodeGen.lib;LLVMScalarOpts.lib;LLVMInstCombine.lib;LLVMTransformUtils.lib;LLVMAnalysis.lib;LLVMTarget.lib;LLVMX86Desc.lib;LLVMX86AsmPrinter.lib;LLVMObject.lib;LLVMMCParser.lib;LLVMBitReader.lib;LLVMCore.lib;LLVMX86Utils.lib;LLVMMC.lib;LLVMX86Info.lib;LLVMSupport.lib;LLVMMCDisassembler.lib;LLVMipo.lib;LLVMBinaryFormat.lib;LLVMPasses.lib;LLVMIRReader.lib;LLVMLinker.lib;LLVMAsmParser.lib;LLVMX86AsmParser.lib;LLVMDemangle.lib;LLVMDebugInfoDWARF.lib;LLVMRemarks.lib 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/user_manager_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "gui_settings.h" 5 | #include "emu_settings.h" 6 | #include "Emu/System.h" 7 | 8 | #include "Utilities/File.h" 9 | #include "user_account.h" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class user_manager_dialog : public QDialog 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit user_manager_dialog(std::shared_ptr gui_settings, QWidget* parent = nullptr); 28 | Q_SIGNALS: 29 | void OnUserLoginSuccess(); 30 | private Q_SLOTS: 31 | void OnUserLogin(); 32 | void OnUserCreate(); 33 | void OnUserRemove(); 34 | void OnUserRename(); 35 | void OnSort(int logicalIndex); 36 | private: 37 | void Init(); 38 | void UpdateTable(bool mark_only = false); 39 | void GenerateUser(const std::string& user_id, const std::string& username); 40 | bool ValidateUsername(const QString& text_to_validate); 41 | 42 | void ShowContextMenu(const QPoint &pos); 43 | 44 | void closeEvent(QCloseEvent* event) override; 45 | bool eventFilter(QObject* object, QEvent* event) override; 46 | 47 | u32 GetUserKey(); 48 | 49 | QTableWidget* m_table; 50 | std::string m_active_user; 51 | std::map m_user_list; 52 | 53 | std::shared_ptr m_gui_settings; 54 | 55 | int m_sort_column; 56 | bool m_sort_ascending; 57 | }; 58 | -------------------------------------------------------------------------------- /rpcs3/GLGSRender.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellNetAoi.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | LOG_CHANNEL(cellNetAoi); 5 | 6 | s32 cellNetAoiDeletePeer() 7 | { 8 | UNIMPLEMENTED_FUNC(cellNetAoi); 9 | return CELL_OK; 10 | } 11 | 12 | s32 cellNetAoiInit() 13 | { 14 | UNIMPLEMENTED_FUNC(cellNetAoi); 15 | return CELL_OK; 16 | } 17 | 18 | s32 cellNetAoiGetPspTitleId() 19 | { 20 | UNIMPLEMENTED_FUNC(cellNetAoi); 21 | return CELL_OK; 22 | } 23 | 24 | s32 cellNetAoiTerm() 25 | { 26 | UNIMPLEMENTED_FUNC(cellNetAoi); 27 | return CELL_OK; 28 | } 29 | 30 | s32 cellNetAoiStop() 31 | { 32 | UNIMPLEMENTED_FUNC(cellNetAoi); 33 | return CELL_OK; 34 | } 35 | 36 | s32 cellNetAoiGetRemotePeerInfo() 37 | { 38 | UNIMPLEMENTED_FUNC(cellNetAoi); 39 | return CELL_OK; 40 | } 41 | 42 | s32 cellNetAoiStart() 43 | { 44 | UNIMPLEMENTED_FUNC(cellNetAoi); 45 | return CELL_OK; 46 | } 47 | 48 | s32 cellNetAoiGetLocalInfo() 49 | { 50 | UNIMPLEMENTED_FUNC(cellNetAoi); 51 | return CELL_OK; 52 | } 53 | 54 | s32 cellNetAoiAddPeer() 55 | { 56 | UNIMPLEMENTED_FUNC(cellNetAoi); 57 | return CELL_OK; 58 | } 59 | 60 | DECLARE(ppu_module_manager::cellNetAoi)("cellNetAoi", []() 61 | { 62 | REG_FUNC(cellNetAoi, cellNetAoiDeletePeer); 63 | REG_FUNC(cellNetAoi, cellNetAoiInit); 64 | REG_FUNC(cellNetAoi, cellNetAoiGetPspTitleId); 65 | REG_FUNC(cellNetAoi, cellNetAoiTerm); 66 | REG_FUNC(cellNetAoi, cellNetAoiStop); 67 | REG_FUNC(cellNetAoi, cellNetAoiGetRemotePeerInfo); 68 | REG_FUNC(cellNetAoi, cellNetAoiStart); 69 | REG_FUNC(cellNetAoi, cellNetAoiGetLocalInfo); 70 | REG_FUNC(cellNetAoi, cellNetAoiAddPeer); 71 | }); 72 | -------------------------------------------------------------------------------- /Utilities/Timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.h" 4 | 5 | #include 6 | 7 | class Timer 8 | { 9 | private: 10 | bool m_stopped; 11 | std::chrono::steady_clock::time_point m_start; 12 | std::chrono::steady_clock::time_point m_end; 13 | 14 | public: 15 | Timer() : m_stopped(false) 16 | { 17 | } 18 | 19 | void Start() 20 | { 21 | m_stopped = false; 22 | m_start = std::chrono::steady_clock::now(); 23 | } 24 | 25 | void Stop() 26 | { 27 | m_stopped = true; 28 | m_end = std::chrono::steady_clock::now(); 29 | } 30 | 31 | double GetElapsedTimeInSec() const 32 | { 33 | return double(GetElapsedTimeInMicroSec()) / 1000000.0; 34 | } 35 | 36 | double GetElapsedTimeInMilliSec() const 37 | { 38 | return double(GetElapsedTimeInMicroSec()) / 1000.0; 39 | } 40 | 41 | u64 GetElapsedTimeInMicroSec() const 42 | { 43 | std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now(); 44 | 45 | return std::chrono::duration_cast(now - m_start).count(); 46 | } 47 | 48 | u64 GetElapsedTimeInNanoSec() const 49 | { 50 | std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now(); 51 | 52 | return std::chrono::duration_cast(now - m_start).count(); 53 | } 54 | 55 | u64 GetMsSince(std::chrono::steady_clock::time_point timestamp) 56 | { 57 | std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now(); 58 | 59 | return std::chrono::duration_cast(now - timestamp).count(); 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /Utilities/rXml.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "restore_new.h" 3 | #include "Utilities/rXml.h" 4 | #include "define_new_memleakdetect.h" 5 | 6 | rXmlNode::rXmlNode() : handle() 7 | { 8 | } 9 | 10 | rXmlNode::rXmlNode(const pugi::xml_node &node) 11 | { 12 | handle = node; 13 | } 14 | 15 | std::shared_ptr rXmlNode::GetChildren() 16 | { 17 | // it.begin() returns node_iterator*, *it.begin() return node*. 18 | pugi::xml_object_range it = handle.children(); 19 | pugi::xml_node begin = *it.begin(); 20 | 21 | if (begin) 22 | { 23 | return std::make_shared(begin); 24 | } 25 | else 26 | { 27 | return nullptr; 28 | } 29 | } 30 | 31 | std::shared_ptr rXmlNode::GetNext() 32 | { 33 | pugi::xml_node result = handle.next_sibling(); 34 | if (result) 35 | { 36 | return std::make_shared(result); 37 | } 38 | else 39 | { 40 | return nullptr; 41 | } 42 | } 43 | 44 | std::string rXmlNode::GetName() 45 | { 46 | return handle.name(); 47 | } 48 | 49 | std::string rXmlNode::GetAttribute(const std::string &name) 50 | { 51 | auto pred = [&name](pugi::xml_attribute attr) { return (name == attr.name()); }; 52 | return handle.find_attribute(pred).value(); 53 | } 54 | 55 | std::string rXmlNode::GetNodeContent() 56 | { 57 | return handle.text().get(); 58 | } 59 | 60 | rXmlDocument::rXmlDocument() : handle() 61 | { 62 | } 63 | 64 | void rXmlDocument::Read(const std::string& data) 65 | { 66 | handle.load_buffer(data.data(), data.size()); 67 | } 68 | 69 | std::shared_ptr rXmlDocument::GetRoot() 70 | { 71 | return std::make_shared(handle.root()); 72 | } 73 | 74 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/VK/VKDMA.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "VKHelpers.h" 3 | 4 | namespace vk 5 | { 6 | std::pair map_dma(command_buffer& cmd, u32 local_address, u32 length); 7 | void load_dma(u32 local_address, u32 length); 8 | void flush_dma(u32 local_address, u32 length); 9 | 10 | void clear_dma_resources(); 11 | 12 | class dma_block 13 | { 14 | enum page_bits 15 | { 16 | synchronized = 0, 17 | dirty = 1, 18 | nocache = 3 19 | }; 20 | 21 | struct 22 | { 23 | dma_block* parent = nullptr; 24 | u32 block_offset = 0; 25 | } 26 | inheritance_info; 27 | 28 | u32 base_address = 0; 29 | std::unique_ptr allocated_memory; 30 | std::vector page_info; 31 | 32 | void* map_range(const utils::address_range& range); 33 | void unmap(); 34 | 35 | void set_page_bit(u32 page, u64 bits); 36 | bool test_page_bit(u32 page, u64 bits); 37 | void mark_dirty(const utils::address_range& range); 38 | void set_page_info(u32 page_offset, const std::vector& bits); 39 | 40 | public: 41 | 42 | void init(const render_device& dev, u32 addr, size_t size); 43 | void init(dma_block* parent, u32 addr, size_t size); 44 | void flush(const utils::address_range& range); 45 | void load(const utils::address_range& range); 46 | std::pair get(const utils::address_range& range); 47 | 48 | u32 start() const; 49 | u32 end() const; 50 | u32 size() const; 51 | 52 | dma_block* head(); 53 | const dma_block* head() const; 54 | void set_parent(command_buffer& cmd, dma_block* parent); 55 | void extend(command_buffer& cmd, const render_device& dev, size_t new_size); 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_rwlock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sys_sync.h" 4 | 5 | #include "Emu/Memory/vm_ptr.h" 6 | 7 | struct sys_rwlock_attribute_t 8 | { 9 | be_t protocol; 10 | be_t pshared; 11 | be_t ipc_key; 12 | be_t flags; 13 | be_t pad; 14 | 15 | union 16 | { 17 | u64 name_u64; 18 | char name[sizeof(u64)]; 19 | }; 20 | }; 21 | 22 | struct lv2_rwlock final : lv2_obj 23 | { 24 | static const u32 id_base = 0x88000000; 25 | 26 | const u32 protocol; 27 | const u32 shared; 28 | const u64 key; 29 | const u64 name; 30 | const s32 flags; 31 | 32 | shared_mutex mutex; 33 | atomic_t owner{0}; 34 | std::deque rq; 35 | std::deque wq; 36 | 37 | lv2_rwlock(u32 protocol, u32 shared, u64 key, s32 flags, u64 name) 38 | : protocol(protocol) 39 | , shared(shared) 40 | , key(key) 41 | , flags(flags) 42 | , name(name) 43 | { 44 | } 45 | }; 46 | 47 | // Aux 48 | class ppu_thread; 49 | 50 | // Syscalls 51 | 52 | error_code sys_rwlock_create(ppu_thread& ppu, vm::ptr rw_lock_id, vm::ptr attr); 53 | error_code sys_rwlock_destroy(ppu_thread& ppu, u32 rw_lock_id); 54 | error_code sys_rwlock_rlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout); 55 | error_code sys_rwlock_tryrlock(ppu_thread& ppu, u32 rw_lock_id); 56 | error_code sys_rwlock_runlock(ppu_thread& ppu, u32 rw_lock_id); 57 | error_code sys_rwlock_wlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout); 58 | error_code sys_rwlock_trywlock(ppu_thread& ppu, u32 rw_lock_id); 59 | error_code sys_rwlock_wunlock(ppu_thread& ppu, u32 rw_lock_id); 60 | 61 | constexpr auto _sys_rwlock_trywlock = sys_rwlock_trywlock; 62 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellCrossController.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | #include "cellSysutil.h" 5 | 6 | 7 | 8 | LOG_CHANNEL(cellCrossController); 9 | 10 | enum 11 | { 12 | CELL_CROSS_CONTROLLER_STATUS_INITIALIZED = 1, 13 | CELL_CROSS_CONTROLLER_STATUS_FINALIZED = 2 14 | }; 15 | 16 | struct CellCrossControllerParam 17 | { 18 | vm::bcptr pPackageFileName; 19 | vm::bcptr pSignatureFileName; 20 | vm::bcptr pIconFileName; 21 | vm::bptr option; 22 | }; 23 | 24 | struct CellCrossControllerPackageInfo 25 | { 26 | vm::bcptr pTitle; 27 | vm::bcptr pTitleId; 28 | vm::bcptr pAppVer; 29 | }; 30 | 31 | using CellCrossControllerCallback = void(s32 status, s32 errorCode, vm::ptr option, vm::ptr userdata); 32 | 33 | s32 cellCrossControllerInitialize(vm::cptr pParam, vm::cptr pPkgInfo, vm::ptr cb, vm::ptr userdata) // LittleBigPlanet 2 and 3 34 | { 35 | cellCrossController.todo("cellCrossControllerInitialize(pParam=*0x%x, pPkgInfo=*0x%x, cb=*0x%x, userdata=*0x%x)", pParam, pPkgInfo, cb, userdata); 36 | 37 | sysutil_register_cb([=](ppu_thread& ppu) -> s32 38 | { 39 | cb(ppu, CELL_CROSS_CONTROLLER_STATUS_INITIALIZED, CELL_OK, vm::null, userdata); 40 | cb(ppu, CELL_CROSS_CONTROLLER_STATUS_FINALIZED, CELL_OK, vm::null, userdata); 41 | 42 | return CELL_OK; 43 | }); 44 | 45 | return CELL_OK; 46 | } 47 | 48 | 49 | DECLARE(ppu_module_manager::cellCrossController)("cellCrossController", []() 50 | { 51 | REG_FUNC(cellCrossController, cellCrossControllerInitialize); 52 | }); 53 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/lv2/sys_timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sys_event.h" 4 | 5 | #include "Utilities/Thread.h" 6 | #include "Emu/Memory/vm_ptr.h" 7 | 8 | 9 | // Timer State 10 | enum : u32 11 | { 12 | SYS_TIMER_STATE_STOP = 0, 13 | SYS_TIMER_STATE_RUN = 1, 14 | }; 15 | 16 | struct sys_timer_information_t 17 | { 18 | be_t next_expire; 19 | be_t period; 20 | be_t timer_state; 21 | be_t pad; 22 | }; 23 | 24 | struct lv2_timer_context : lv2_obj 25 | { 26 | static const u32 id_base = 0x11000000; 27 | 28 | void operator()(); 29 | void on_abort(); 30 | 31 | shared_mutex mutex; 32 | atomic_t state{SYS_TIMER_STATE_STOP}; 33 | 34 | std::weak_ptr port; 35 | u64 source; 36 | u64 data1; 37 | u64 data2; 38 | 39 | atomic_t expire{0}; // Next expiration time 40 | atomic_t period{0}; // Period (oneshot if 0) 41 | }; 42 | 43 | using lv2_timer = named_thread; 44 | 45 | class ppu_thread; 46 | 47 | // Syscalls 48 | 49 | error_code sys_timer_create(ppu_thread&, vm::ptr timer_id); 50 | error_code sys_timer_destroy(ppu_thread&, u32 timer_id); 51 | error_code sys_timer_get_information(ppu_thread&, u32 timer_id, vm::ptr info); 52 | error_code _sys_timer_start(ppu_thread&, u32 timer_id, u64 basetime, u64 period); // basetime type changed from s64 53 | error_code sys_timer_stop(ppu_thread&, u32 timer_id); 54 | error_code sys_timer_connect_event_queue(ppu_thread&, u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2); 55 | error_code sys_timer_disconnect_event_queue(ppu_thread&, u32 timer_id); 56 | error_code sys_timer_sleep(ppu_thread&, u32 sleep_time); 57 | error_code sys_timer_usleep(ppu_thread&, u64 sleep_time); 58 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellCelp8Enc.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/System.h" 3 | #include "Emu/Cell/PPUModule.h" 4 | 5 | #include "cellCelp8Enc.h" 6 | 7 | LOG_CHANNEL(cellCelp8Enc); 8 | 9 | 10 | s32 cellCelp8EncQueryAttr() 11 | { 12 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 13 | return CELL_OK; 14 | } 15 | 16 | s32 cellCelp8EncOpen() 17 | { 18 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 19 | return CELL_OK; 20 | } 21 | 22 | s32 cellCelp8EncOpenEx() 23 | { 24 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 25 | return CELL_OK; 26 | } 27 | 28 | s32 cellCelp8EncClose() 29 | { 30 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 31 | return CELL_OK; 32 | } 33 | 34 | s32 cellCelp8EncStart() 35 | { 36 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 37 | return CELL_OK; 38 | } 39 | 40 | s32 cellCelp8EncEnd() 41 | { 42 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 43 | return CELL_OK; 44 | } 45 | 46 | s32 cellCelp8EncEncodeFrame() 47 | { 48 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 49 | return CELL_OK; 50 | } 51 | 52 | s32 cellCelp8EncWaitForOutput() 53 | { 54 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 55 | return CELL_OK; 56 | } 57 | 58 | s32 cellCelp8EncGetAu() 59 | { 60 | UNIMPLEMENTED_FUNC(cellCelp8Enc); 61 | return CELL_OK; 62 | } 63 | 64 | DECLARE(ppu_module_manager::cellCelp8Enc)("cellCelp8Enc", []() 65 | { 66 | REG_FUNC(cellCelp8Enc, cellCelp8EncQueryAttr); 67 | REG_FUNC(cellCelp8Enc, cellCelp8EncOpen); 68 | REG_FUNC(cellCelp8Enc, cellCelp8EncOpenEx); 69 | REG_FUNC(cellCelp8Enc, cellCelp8EncClose); 70 | REG_FUNC(cellCelp8Enc, cellCelp8EncStart); 71 | REG_FUNC(cellCelp8Enc, cellCelp8EncEnd); 72 | REG_FUNC(cellCelp8Enc, cellCelp8EncEncodeFrame); 73 | REG_FUNC(cellCelp8Enc, cellCelp8EncWaitForOutput); 74 | REG_FUNC(cellCelp8Enc, cellCelp8EncGetAu); 75 | }); 76 | -------------------------------------------------------------------------------- /rpcs3/rpcs3qt/skylander_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class skylander_dialog : public QDialog 14 | { 15 | public: 16 | skylander_dialog(QWidget* parent); 17 | ~skylander_dialog(); 18 | static skylander_dialog* get_dlg(QWidget* parent); 19 | 20 | skylander_dialog(skylander_dialog const&) = delete; 21 | void operator=(skylander_dialog const&) = delete; 22 | 23 | protected: 24 | // Update the edits from skylander loaded in memory 25 | void update_edits(); 26 | // Parse edits and apply them to skylander in memory 27 | void process_edits(); 28 | 29 | // Creates a new skylander 30 | void new_skylander(); 31 | // Loads a skylander 32 | void load_skylander(); 33 | 34 | u16 skylander_crc16(u16 init_value, const u8* buffer, u32 size); 35 | // Get hash used for encryption of block 36 | void get_hash(u8 block, std::array& res_hash); 37 | // encrypt a block to memory 38 | void set_block(const u8 block, const std::array& to_encrypt); 39 | // decrypt a block in memory 40 | void get_block(const u8 block, std::array& decrypted); 41 | 42 | // get the active Area(0x08 or 0x24) 43 | u8 get_active_block(); 44 | 45 | void set_checksums(); 46 | 47 | protected: 48 | QLineEdit* edit_curfile = nullptr; 49 | QComboBox* combo_skylist = nullptr; 50 | QLineEdit* edit_skyid = nullptr; 51 | QLineEdit* edit_skyxp = nullptr; 52 | QLineEdit* edit_skymoney = nullptr; 53 | QPushButton* button_update = nullptr; 54 | 55 | private: 56 | static skylander_dialog* inst; 57 | }; 58 | -------------------------------------------------------------------------------- /rpcs3/Emu/Audio/AudioDumper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/types.h" 4 | #include "Utilities/File.h" 5 | 6 | struct WAVHeader 7 | { 8 | struct RIFFHeader 9 | { 10 | u32 ID; // "RIFF" 11 | u32 Size; // FileSize - 8 12 | u32 WAVE; // "WAVE" 13 | 14 | RIFFHeader() = default; 15 | 16 | RIFFHeader(u32 size) 17 | : ID(*(u32*)"RIFF") 18 | , WAVE(*(u32*)"WAVE") 19 | , Size(size) 20 | { 21 | } 22 | } RIFF; 23 | 24 | struct FMTHeader 25 | { 26 | u32 ID; // "fmt " 27 | u32 Size; // 16 28 | u16 AudioFormat; // 1 for PCM, 3 for IEEE Floating Point 29 | u16 NumChannels; // 1, 2, 6, 8 30 | u32 SampleRate; // 48000 31 | u32 ByteRate; // SampleRate * NumChannels * BitsPerSample/8 32 | u16 BlockAlign; // NumChannels * BitsPerSample/8 33 | u16 BitsPerSample; // sizeof(float) * 8 34 | 35 | FMTHeader() = default; 36 | 37 | FMTHeader(u16 ch) 38 | : ID(*(u32*)"fmt ") 39 | , Size(16) 40 | , AudioFormat(3) 41 | , NumChannels(ch) 42 | , SampleRate(48000) 43 | , ByteRate(SampleRate * ch * sizeof(float)) 44 | , BlockAlign(ch * sizeof(float)) 45 | , BitsPerSample(sizeof(float) * 8) 46 | { 47 | } 48 | } FMT; 49 | 50 | u32 ID; // "data" 51 | u32 Size; // size of data (256 * NumChannels * sizeof(float)) 52 | 53 | WAVHeader() = default; 54 | 55 | WAVHeader(u16 ch) 56 | : ID(*(u32*)"data") 57 | , Size(0) 58 | , FMT(ch) 59 | , RIFF(sizeof(RIFFHeader) + sizeof(FMTHeader)) 60 | { 61 | } 62 | }; 63 | 64 | class AudioDumper 65 | { 66 | WAVHeader m_header; 67 | fs::file m_output; 68 | 69 | public: 70 | AudioDumper(u16 ch); 71 | ~AudioDumper(); 72 | 73 | void WriteData(const void* buffer, u32 size); 74 | const u16 GetCh() const { return m_header.FMT.NumChannels; } 75 | }; 76 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellMouse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utilities/BEType.h" 4 | 5 | enum CellMouseError : u32 6 | { 7 | CELL_MOUSE_ERROR_FATAL = 0x80121201, 8 | CELL_MOUSE_ERROR_INVALID_PARAMETER = 0x80121202, 9 | CELL_MOUSE_ERROR_ALREADY_INITIALIZED = 0x80121203, 10 | CELL_MOUSE_ERROR_UNINITIALIZED = 0x80121204, 11 | CELL_MOUSE_ERROR_RESOURCE_ALLOCATION_FAILED = 0x80121205, 12 | CELL_MOUSE_ERROR_DATA_READ_FAILED = 0x80121206, 13 | CELL_MOUSE_ERROR_NO_DEVICE = 0x80121207, 14 | CELL_MOUSE_ERROR_SYS_SETTING_FAILED = 0x80121208, 15 | }; 16 | 17 | enum 18 | { 19 | CELL_MOUSE_MAX_DATA_LIST_NUM = 8, 20 | CELL_MOUSE_MAX_CODES = 64, 21 | CELL_MAX_MICE = 127, 22 | }; 23 | 24 | struct CellMouseInfo 25 | { 26 | be_t max_connect; 27 | be_t now_connect; 28 | be_t info; 29 | be_t vendor_id[CELL_MAX_MICE]; 30 | be_t product_id[CELL_MAX_MICE]; 31 | u8 status[CELL_MAX_MICE]; 32 | }; 33 | 34 | struct CellMouseInfoTablet 35 | { 36 | be_t is_supported; 37 | be_t mode; 38 | }; 39 | 40 | struct CellMouseData 41 | { 42 | u8 update; 43 | u8 buttons; 44 | s8 x_axis; 45 | s8 y_axis; 46 | s8 wheel; 47 | s8 tilt; 48 | }; 49 | 50 | struct CellMouseTabletData 51 | { 52 | be_t len; 53 | u8 data[CELL_MOUSE_MAX_CODES]; 54 | }; 55 | 56 | struct CellMouseDataList 57 | { 58 | be_t list_num; 59 | CellMouseData list[CELL_MOUSE_MAX_DATA_LIST_NUM]; 60 | }; 61 | 62 | struct CellMouseTabletDataList 63 | { 64 | be_t list_num; 65 | CellMouseTabletData list[CELL_MOUSE_MAX_DATA_LIST_NUM]; 66 | }; 67 | 68 | struct CellMouseRawData 69 | { 70 | be_t len; 71 | u8 data[CELL_MOUSE_MAX_CODES]; 72 | }; 73 | -------------------------------------------------------------------------------- /rpcs3/Emu/RSX/GL/OpenGL.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "OpenGL.h" 3 | 4 | #ifdef _WIN32 5 | 6 | extern "C" 7 | { 8 | // NVIDIA Optimus: Default dGPU instead of iGPU (Driver: 302+) 9 | __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; 10 | // AMD: Request dGPU High Performance (Driver: 13.35+) 11 | __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; 12 | } 13 | 14 | #define OPENGL_PROC(p, n) p gl##n = nullptr 15 | #define WGL_PROC(p, n) p wgl##n = nullptr 16 | #define OPENGL_PROC2(p, n, tn) OPENGL_PROC(p, n) 17 | #include "GLProcTable.h" 18 | #undef OPENGL_PROC 19 | #undef OPENGL_PROC2 20 | #undef WGL_PROC 21 | #endif 22 | 23 | void gl::init() 24 | { 25 | #ifdef _WIN32 26 | #define OPENGL_PROC(p, n) OPENGL_PROC2(p, gl##n, gl##n) 27 | #define WGL_PROC(p, n) OPENGL_PROC2(p, wgl##n, wgl##n) 28 | #define OPENGL_PROC2(p, n, tn) /*if(!gl##n)*/ if(!(n = (p)wglGetProcAddress(#tn))) LOG_ERROR(RSX, "OpenGL: initialization of " #tn " failed.") 29 | #include "GLProcTable.h" 30 | #undef OPENGL_PROC 31 | #undef WGL_PROC 32 | #undef OPENGL_PROC2 33 | #endif 34 | #ifdef __unix__ 35 | glewExperimental = true; 36 | glewInit(); 37 | #ifndef __APPLE__ 38 | glxewInit(); 39 | #endif 40 | #endif 41 | } 42 | 43 | void gl::set_swapinterval(int interval) 44 | { 45 | #ifdef _WIN32 46 | wglSwapIntervalEXT(interval); 47 | #elif !defined(__APPLE__) 48 | if (glXSwapIntervalEXT) 49 | { 50 | if (auto window = glXGetCurrentDrawable()) 51 | { 52 | glXSwapIntervalEXT(glXGetCurrentDisplay(), window, interval); 53 | return; 54 | } 55 | } 56 | 57 | //No existing drawable or missing swap extension, EGL? 58 | LOG_ERROR(RSX, "Failed to set swap interval"); 59 | #else 60 | LOG_ERROR(RSX, "Swap control not implemented for this platform. Vsync options not available."); 61 | #endif 62 | } 63 | -------------------------------------------------------------------------------- /rpcs3/Emu/Cell/Modules/cellCelpEnc.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Emu/Cell/PPUModule.h" 3 | 4 | #include "cellCelpEnc.h" 5 | 6 | LOG_CHANNEL(cellCelpEnc); 7 | 8 | s32 cellCelpEncQueryAttr() 9 | { 10 | UNIMPLEMENTED_FUNC(cellCelpEnc); 11 | return CELL_OK; 12 | } 13 | 14 | s32 cellCelpEncOpen() 15 | { 16 | UNIMPLEMENTED_FUNC(cellCelpEnc); 17 | return CELL_OK; 18 | } 19 | 20 | s32 cellCelpEncOpenEx() 21 | { 22 | UNIMPLEMENTED_FUNC(cellCelpEnc); 23 | return CELL_OK; 24 | } 25 | 26 | s32 cellCelpEncOpenExt() 27 | { 28 | UNIMPLEMENTED_FUNC(cellCelpEnc); 29 | return CELL_OK; 30 | } 31 | 32 | s32 cellCelpEncClose() 33 | { 34 | UNIMPLEMENTED_FUNC(cellCelpEnc); 35 | return CELL_OK; 36 | } 37 | 38 | s32 cellCelpEncStart() 39 | { 40 | UNIMPLEMENTED_FUNC(cellCelpEnc); 41 | return CELL_OK; 42 | } 43 | 44 | s32 cellCelpEncEnd() 45 | { 46 | UNIMPLEMENTED_FUNC(cellCelpEnc); 47 | return CELL_OK; 48 | } 49 | 50 | s32 cellCelpEncEncodeFrame() 51 | { 52 | UNIMPLEMENTED_FUNC(cellCelpEnc); 53 | return CELL_OK; 54 | } 55 | 56 | s32 cellCelpEncWaitForOutput() 57 | { 58 | UNIMPLEMENTED_FUNC(cellCelpEnc); 59 | return CELL_OK; 60 | } 61 | 62 | s32 cellCelpEncGetAu() 63 | { 64 | UNIMPLEMENTED_FUNC(cellCelpEnc); 65 | return CELL_OK; 66 | } 67 | 68 | DECLARE(ppu_module_manager::cellCelpEnc)("cellCelpEnc", []() 69 | { 70 | REG_FUNC(cellCelpEnc, cellCelpEncQueryAttr); 71 | REG_FUNC(cellCelpEnc, cellCelpEncOpen); 72 | REG_FUNC(cellCelpEnc, cellCelpEncOpenEx); 73 | REG_FUNC(cellCelpEnc, cellCelpEncOpenExt); 74 | REG_FUNC(cellCelpEnc, cellCelpEncClose); 75 | REG_FUNC(cellCelpEnc, cellCelpEncStart); 76 | REG_FUNC(cellCelpEnc, cellCelpEncEnd); 77 | REG_FUNC(cellCelpEnc, cellCelpEncEncodeFrame); 78 | REG_FUNC(cellCelpEnc, cellCelpEncWaitForOutput); 79 | REG_FUNC(cellCelpEnc, cellCelpEncGetAu); 80 | }); 81 | --------------------------------------------------------------------------------