diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index fa24b9368b..44f0096e6b 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/Cell/SPUThread.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/RawSPUThread.h" diff --git a/rpcs3/Emu/Cell/Modules/StaticHLE.cpp b/rpcs3/Emu/Cell/Modules/StaticHLE.cpp index cec3fee415..02d5c84524 100644 --- a/rpcs3/Emu/Cell/Modules/StaticHLE.cpp +++ b/rpcs3/Emu/Cell/Modules/StaticHLE.cpp @@ -1,5 +1,7 @@ #include "stdafx.h" #include "StaticHLE.h" +#include "Emu/Cell/PPUModule.h" +#include "Emu/Cell/PPUOpcodes.h" LOG_CHANNEL(static_hle); diff --git a/rpcs3/Emu/Cell/Modules/StaticHLE.h b/rpcs3/Emu/Cell/Modules/StaticHLE.h index c70960af86..e9a8253519 100644 --- a/rpcs3/Emu/Cell/Modules/StaticHLE.h +++ b/rpcs3/Emu/Cell/Modules/StaticHLE.h @@ -1,8 +1,7 @@ #pragma once #include "../../Utilities/types.h" -#include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/PPUOpcodes.h" +#include "Emu/Memory/vm_ptr.h" #include struct shle_pattern diff --git a/rpcs3/Emu/Cell/Modules/cellAdec.cpp b/rpcs3/Emu/Cell/Modules/cellAdec.cpp index 68e05c91b4..339eb8d51e 100644 --- a/rpcs3/Emu/Cell/Modules/cellAdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAdec.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_sync.h" diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.cpp b/rpcs3/Emu/Cell/Modules/cellAudio.cpp index 7cb5640421..8568ac4401 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAudio.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_process.h" @@ -157,6 +158,11 @@ f32 audio_ringbuffer::set_frequency_ratio(f32 new_ratio) return frequency_ratio; } +u64 audio_ringbuffer::get_timestamp() const +{ + return get_system_time() - Emu.GetPauseTime(); +} + void audio_ringbuffer::enqueue(const float* in_buffer) { AUDIT(cur_pos < cfg.num_allocated_buffers); diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.h b/rpcs3/Emu/Cell/Modules/cellAudio.h index ba63a9d652..2f38908abc 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.h +++ b/rpcs3/Emu/Cell/Modules/cellAudio.h @@ -5,6 +5,7 @@ #include "Emu/Memory/vm.h" #include "Emu/Audio/AudioBackend.h" #include "Emu/Audio/AudioDumper.h" +#include "Emu/system_config_types.h" struct lv2_event_queue; @@ -306,10 +307,7 @@ public: return buffer[num].get(); } - u64 get_timestamp() const - { - return get_system_time() - Emu.GetPauseTime(); - } + u64 get_timestamp() const; float* get_current_buffer() const { diff --git a/rpcs3/Emu/Cell/Modules/cellCamera.cpp b/rpcs3/Emu/Cell/Modules/cellCamera.cpp index becb5718c7..74fdeca058 100644 --- a/rpcs3/Emu/Cell/Modules/cellCamera.cpp +++ b/rpcs3/Emu/Cell/Modules/cellCamera.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "cellCamera.h" +#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_event.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/Modules/cellDmux.cpp b/rpcs3/Emu/Cell/Modules/cellDmux.cpp index 0befe5e813..cf9f979a70 100644 --- a/rpcs3/Emu/Cell/Modules/cellDmux.cpp +++ b/rpcs3/Emu/Cell/Modules/cellDmux.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_sync.h" diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index f16774e55c..ba91754b4b 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -3,6 +3,7 @@ #include "Emu/System.h" #include "Emu/VFS.h" #include "Emu/IdManager.h" +#include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_fs.h" #include "Emu/Cell/lv2/sys_sync.h" diff --git a/rpcs3/Emu/Cell/Modules/cellGame.h b/rpcs3/Emu/Cell/Modules/cellGame.h index 7109a6dc5c..1b56213238 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.h +++ b/rpcs3/Emu/Cell/Modules/cellGame.h @@ -1,7 +1,5 @@ #pragma once -#include "Emu/Cell/ErrorCodes.h" - #include "Emu/Memory/vm_ptr.h" // Return Codes diff --git a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp index 8cd683990d..5cd3d866cc 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp @@ -3,9 +3,9 @@ #include "Emu/Cell/PPUModule.h" #include "Emu/Memory/vm.h" -#include "Emu/RSX/GSRender.h" #include "Emu/Cell/lv2/sys_ppu_thread.h" #include "Emu/Cell/lv2/sys_rsx.h" +#include "Emu/RSX/RSXThread.h" #include "cellGcmSys.h" #include "sysPrxForUser.h" diff --git a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp index 26c7d60948..34ebc69a0c 100644 --- a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/lv2/sys_sync.h" diff --git a/rpcs3/Emu/Cell/Modules/cellPad.h b/rpcs3/Emu/Cell/Modules/cellPad.h index 74e71f1b02..ab438a2486 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.h +++ b/rpcs3/Emu/Cell/Modules/cellPad.h @@ -1,6 +1,5 @@ #pragma once -#include "Emu/Io/PadHandler.h" #include "Utilities/BEType.h" #include diff --git a/rpcs3/Emu/Cell/Modules/cellRtc.h b/rpcs3/Emu/Cell/Modules/cellRtc.h index 89d062da85..cf841a7b1f 100644 --- a/rpcs3/Emu/Cell/Modules/cellRtc.h +++ b/rpcs3/Emu/Cell/Modules/cellRtc.h @@ -1,6 +1,7 @@ #pragma once #include "Utilities/BEType.h" +#include "Emu/Memory/vm_ptr.h" // Return Codes enum CellRtcError diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index aea7fdfbc1..df33e3bea6 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/VFS.h" #include "Emu/localized_string.h" #include "Emu/Cell/lv2/sys_fs.h" diff --git a/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp b/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp index 8e8611d72e..ca580990de 100644 --- a/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp +++ b/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "Emu/System.h" #include "Emu/IdManager.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUModule.h" #include "cellScreenshot.h" diff --git a/rpcs3/Emu/Cell/Modules/cellScreenshot.h b/rpcs3/Emu/Cell/Modules/cellScreenshot.h index 73e0e51a8c..425731d4ca 100644 --- a/rpcs3/Emu/Cell/Modules/cellScreenshot.h +++ b/rpcs3/Emu/Cell/Modules/cellScreenshot.h @@ -1,6 +1,6 @@ #pragma once -#include "Emu/VFS.h" +#include "Emu/Memory/vm_ptr.h" // Return Codes enum CellScreenShotError : u32 diff --git a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp index eb54870031..e26978b94c 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Memory/vm_reservation.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp b/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp index ff6d97ed07..8d2a3c03a5 100644 --- a/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "Emu/system_config_types.h" +#include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" #include "Emu/RSX/rsx_utils.h" diff --git a/rpcs3/Emu/Cell/Modules/cellVideoOut.h b/rpcs3/Emu/Cell/Modules/cellVideoOut.h index 5cee8dc34b..cf9150586e 100644 --- a/rpcs3/Emu/Cell/Modules/cellVideoOut.h +++ b/rpcs3/Emu/Cell/Modules/cellVideoOut.h @@ -1,6 +1,4 @@ -#pragma once - -#include "Emu/Cell/ErrorCodes.h" +#pragma once #include "Emu/Memory/vm_ptr.h" diff --git a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp index e0f31d97a8..825d9d388c 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp b/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp index ea7ba4ce1c..1e360b8dbe 100644 --- a/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_lwmutex.h" diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index bfa42ef6c8..fc377d2006 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -7,6 +7,7 @@ #include "Crypto/sha1.h" #include "Crypto/unself.h" #include "Loader/ELF.h" +#include "Emu/System.h" #include "Emu/VFS.h" #include "Emu/Cell/PPUOpcodes.h" diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index 0276212ae8..8a1d53520c 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -4,7 +4,6 @@ #include "Emu/Cell/SPUInterpreter.h" #include "Emu/Memory/vm.h" #include "MFC.h" -#include "Emu/Memory/vm.h" #include "Utilities/BEType.h" #include diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index c801ed925a..94f9f3117b 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/PPUFunction.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_config.cpp b/rpcs3/Emu/Cell/lv2/sys_config.cpp index 84637b45c6..7c4a0b71a0 100644 --- a/rpcs3/Emu/Cell/lv2/sys_config.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_config.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/System.h" #include "Emu/Memory/vm.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index da5bf7edc7..62e51f107e 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -4,6 +4,7 @@ #include "Emu/Cell/PPUThread.h" #include "Crypto/unedat.h" +#include "Emu/System.h" #include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Utilities/StrUtil.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp b/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp index 6baa985eb1..9e9d3b75b2 100644 --- a/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "sys_gamepad.h" +#include "Emu/Cell/ErrorCodes.h" LOG_CHANNEL(sys_gamepad); diff --git a/rpcs3/Emu/Cell/lv2/sys_gamepad.h b/rpcs3/Emu/Cell/lv2/sys_gamepad.h index c743a5239f..109f757b77 100644 --- a/rpcs3/Emu/Cell/lv2/sys_gamepad.h +++ b/rpcs3/Emu/Cell/lv2/sys_gamepad.h @@ -1,6 +1,5 @@ -#pragma once +#pragma once -#include "Emu/Cell/ErrorCodes.h" #include "Emu/Memory/vm_ptr.h" //Syscalls diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.cpp b/rpcs3/Emu/Cell/lv2/sys_memory.cpp index dda9afa978..d929641486 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_memory.cpp @@ -4,6 +4,7 @@ #include "Utilities/VirtualMemory.h" #include "Emu/Memory/vm_locking.h" #include "Emu/CPU/CPUThread.h" +#include "Emu/Cell/ErrorCodes.h" #include "Emu/IdManager.h" #include diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.h b/rpcs3/Emu/Cell/lv2/sys_memory.h index e309080014..90c4a6857e 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.h +++ b/rpcs3/Emu/Cell/lv2/sys_memory.h @@ -1,6 +1,5 @@ -#pragma once +#pragma once -#include "Emu/Cell/ErrorCodes.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_overlay.cpp b/rpcs3/Emu/Cell/lv2/sys_overlay.cpp index 951f878ea8..632998b3f1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_overlay.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_overlay.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" +#include "Emu/Cell/ErrorCodes.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/VFS.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_overlay.h b/rpcs3/Emu/Cell/lv2/sys_overlay.h index a13ece4ecb..3786414acf 100644 --- a/rpcs3/Emu/Cell/lv2/sys_overlay.h +++ b/rpcs3/Emu/Cell/lv2/sys_overlay.h @@ -1,8 +1,7 @@ -#pragma once +#pragma once #include "Emu/Cell/PPUAnalyser.h" #include "sys_sync.h" -#include "Emu/Cell/ErrorCodes.h" struct lv2_overlay final : lv2_obj, ppu_module { diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h index 28bcb5ebb1..f386277893 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h @@ -1,6 +1,5 @@ -#pragma once +#pragma once -#include "sys_sync.h" #include "Emu/Memory/vm_ptr.h" class ppu_thread; diff --git a/rpcs3/Emu/Cell/lv2/sys_process.h b/rpcs3/Emu/Cell/lv2/sys_process.h index 784d2b44c8..78b86f3f59 100644 --- a/rpcs3/Emu/Cell/lv2/sys_process.h +++ b/rpcs3/Emu/Cell/lv2/sys_process.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Crypto/unself.h" #include "Emu/Memory/vm_ptr.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_prx.h b/rpcs3/Emu/Cell/lv2/sys_prx.h index d612180ee5..7385c383a5 100644 --- a/rpcs3/Emu/Cell/lv2/sys_prx.h +++ b/rpcs3/Emu/Cell/lv2/sys_prx.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "sys_sync.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index 73b13ffd1e..06c7ef22f8 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -2,8 +2,8 @@ #include "sys_rsx.h" #include "Emu/Cell/PPUModule.h" -#include "Emu/RSX/GSRender.h" #include "Emu/Cell/ErrorCodes.h" +#include "Emu/RSX/RSXThread.h" #include "sys_event.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index b0f3f49848..2d7adeda56 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -10,7 +10,6 @@ #include "Emu/IdManager.h" #include "Emu/IPC.h" #include "Emu/system_config.h" -#include "Emu/System.h" #include #include diff --git a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp index 7da45e73f4..57b0b67123 100644 --- a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp @@ -1,13 +1,16 @@ #include "stdafx.h" #include "sys_usbd.h" +#include "sys_ppu_thread.h" +#include "sys_sync.h" #include #include +#include "Emu/System.h" #include "Emu/Memory/vm.h" +#include "Emu/IdManager.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/ErrorCodes.h" -#include "sys_ppu_thread.h" #include "Emu/Io/usb_device.h" #include "Emu/Io/Skylander.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_vm.cpp b/rpcs3/Emu/Cell/lv2/sys_vm.cpp index be2f01f2ad..6caa04d386 100644 --- a/rpcs3/Emu/Cell/lv2/sys_vm.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_vm.cpp @@ -2,6 +2,7 @@ #include "sys_vm.h" #include "Emu/IdManager.h" +#include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Memory/vm_locking.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_vm.h b/rpcs3/Emu/Cell/lv2/sys_vm.h index 45b6429be6..31a4d6b1a0 100644 --- a/rpcs3/Emu/Cell/lv2/sys_vm.h +++ b/rpcs3/Emu/Cell/lv2/sys_vm.h @@ -1,7 +1,6 @@ #pragma once #include "Emu/Memory/vm_ptr.h" -#include "Emu/Cell/ErrorCodes.h" #include "sys_memory.h" #include diff --git a/rpcs3/Emu/Io/pad_config.cpp b/rpcs3/Emu/Io/pad_config.cpp index f0c19b1589..c5c6324102 100644 --- a/rpcs3/Emu/Io/pad_config.cpp +++ b/rpcs3/Emu/Io/pad_config.cpp @@ -2,6 +2,11 @@ #include "pad_config.h" #include "Emu/System.h" +cfg_input::cfg_input() + : cfg_name(fs::get_config_dir() + "/config_input.yml") +{ +} + bool cfg_input::load(const std::string& title_id) { cfg_name = Emulator::GetCustomInputConfigPath(title_id); diff --git a/rpcs3/Emu/Io/pad_config.h b/rpcs3/Emu/Io/pad_config.h index 9acc45e059..03802a95f7 100644 --- a/rpcs3/Emu/Io/pad_config.h +++ b/rpcs3/Emu/Io/pad_config.h @@ -3,7 +3,6 @@ #include "pad_config_types.h" #include "Utilities/Config.h" -#include "Utilities/File.h" namespace pad { @@ -22,7 +21,9 @@ struct cfg_player final : cfg::node struct cfg_input final : cfg::node { - std::string cfg_name = fs::get_config_dir() + "/config_input.yml"; + cfg_input(); + + std::string cfg_name; cfg_player player1{ this, "Player 1 Input", pad_handler::null }; cfg_player player2{ this, "Player 2 Input", pad_handler::null }; diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 023b6d1c57..4f350885e0 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -12,7 +12,7 @@ #include "Utilities/address_range.h" #include "Emu/CPU/CPUThread.h" #include "Emu/Cell/lv2/sys_memory.h" -#include "Emu/RSX/GSRender.h" +#include "Emu/RSX/RSXThread.h" #include "Emu/Cell/SPURecompiler.h" #include "Emu/perf_meter.hpp" #include diff --git a/rpcs3/Emu/NP/np_structs_extra.cpp b/rpcs3/Emu/NP/np_structs_extra.cpp index 234677155d..81420a595c 100644 --- a/rpcs3/Emu/NP/np_structs_extra.cpp +++ b/rpcs3/Emu/NP/np_structs_extra.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" #include "Emu/System.h" -#include "Emu/NP/rpcn_client.h" #include "np_structs_extra.h" LOG_CHANNEL(sceNp2); diff --git a/rpcs3/Emu/NP/np_structs_extra.h b/rpcs3/Emu/NP/np_structs_extra.h index 715b0cad9c..fd1b56b5c1 100644 --- a/rpcs3/Emu/NP/np_structs_extra.h +++ b/rpcs3/Emu/NP/np_structs_extra.h @@ -1,9 +1,6 @@ -#pragma once +#pragma once -#include "Emu/Memory/vm_ptr.h" -#include "Emu/Cell/Modules/sceNp.h" #include "Emu/Cell/Modules/sceNp2.h" -#include "Emu/NP/rpcn_client.h" namespace extra_nps { diff --git a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp index 5e3f6bd679..6317be606d 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp +++ b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp @@ -3,7 +3,7 @@ #include "Emu/Cell/lv2/sys_rsx.h" #include "Emu/Cell/lv2/sys_memory.h" -#include "Emu/RSX/GSRender.h" +#include "Emu/RSX/RSXThread.h" #include #include diff --git a/rpcs3/Emu/RSX/GSFrameBase.h b/rpcs3/Emu/RSX/GSFrameBase.h new file mode 100644 index 0000000000..7d36eb6b56 --- /dev/null +++ b/rpcs3/Emu/RSX/GSFrameBase.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include + +#include "display.h" + +class GSFrameBase +{ +public: + GSFrameBase() = default; + GSFrameBase(const GSFrameBase&) = delete; + virtual ~GSFrameBase() = default; + + virtual void close() = 0; + virtual bool shown() = 0; + virtual void hide() = 0; + virtual void show() = 0; + virtual void toggle_fullscreen() = 0; + + virtual void delete_context(draw_context_t ctx) = 0; + virtual draw_context_t make_context() = 0; + virtual void set_current(draw_context_t ctx) = 0; + virtual void flip(draw_context_t ctx, bool skip_frame = false) = 0; + virtual int client_width() = 0; + virtual int client_height() = 0; + + virtual display_handle_t handle() const = 0; + + std::atomic screenshot_toggle = false; + virtual void take_screenshot(const std::vector sshot_data, const u32 sshot_width, const u32 sshot_height, bool is_bgra) = 0; +}; diff --git a/rpcs3/Emu/RSX/GSRender.h b/rpcs3/Emu/RSX/GSRender.h index c99a2bbbff..9e36f7f582 100644 --- a/rpcs3/Emu/RSX/GSRender.h +++ b/rpcs3/Emu/RSX/GSRender.h @@ -1,38 +1,7 @@ #pragma once +#include "GSFrameBase.h" #include "Emu/RSX/RSXThread.h" -#include -#include - -#ifdef _WIN32 -#include -#elif defined(__APPLE__) -// nothing -#elif defined(HAVE_X11) -// Cannot include Xlib.h before Qt5 -// and we don't need all of Xlib anyway -using Display = struct _XDisplay; -using Window = unsigned long; -#endif - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR -#include -#endif - -struct RSXDebuggerProgram -{ - u32 id; - u32 vp_id; - u32 fp_id; - std::string vp_shader; - std::string fp_shader; - bool modified; - - RSXDebuggerProgram() - : modified(false) - { - } -}; enum wm_event { @@ -47,52 +16,6 @@ enum wm_event window_visibility_changed }; -using RSXDebuggerPrograms = std::vector; - -using draw_context_t = void*; - -#ifdef _WIN32 -using display_handle_t = HWND; -#elif defined(__APPLE__) -using display_handle_t = void*; // NSView -#else -using display_handle_t = std::variant< -#if defined(HAVE_X11) && defined(VK_USE_PLATFORM_WAYLAND_KHR) - std::pair, std::pair -#elif defined(HAVE_X11) - std::pair -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - std::pair -#endif ->; -#endif - -class GSFrameBase -{ -public: - GSFrameBase() = default; - GSFrameBase(const GSFrameBase&) = delete; - virtual ~GSFrameBase() = default; - - virtual void close() = 0; - virtual bool shown() = 0; - virtual void hide() = 0; - virtual void show() = 0; - virtual void toggle_fullscreen() = 0; - - virtual void delete_context(draw_context_t ctx) = 0; - virtual draw_context_t make_context() = 0; - virtual void set_current(draw_context_t ctx) = 0; - virtual void flip(draw_context_t ctx, bool skip_frame = false) = 0; - virtual int client_width() = 0; - virtual int client_height() = 0; - - virtual display_handle_t handle() const = 0; - - std::atomic screenshot_toggle = false; - virtual void take_screenshot(const std::vector sshot_data, const u32 sshot_width, const u32 sshot_height, bool is_bgra) = 0; -}; - class GSRender : public rsx::thread { protected: diff --git a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp index daa8c576f4..d4141f905a 100644 --- a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "shader_loading_dialog.h" #include "Emu/System.h" +#include "Emu/Cell/Modules/cellMsgDialog.h" namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h index 4bb22ee22c..07a8b47280 100644 --- a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h @@ -1,6 +1,6 @@ #pragma once -#include "Emu/Cell/Modules/cellMsgDialog.h" +class MsgDialogBase; namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp index 65fe9243a1..b932f0b99f 100644 --- a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp +++ b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "shader_loading_dialog_native.h" #include "../overlay_message_dialog.h" +#include "../../GSRender.h" namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h index b6cb51ca74..1fc22ec15d 100644 --- a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h +++ b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h @@ -1,7 +1,8 @@ #pragma once #include "shader_loading_dialog.h" -#include "../../GSRender.h" + +class GSRender; namespace rsx { @@ -10,6 +11,8 @@ namespace rsx class message_dialog; } + class thread; + struct shader_loading_dialog_native : rsx::shader_loading_dialog { rsx::thread* owner = nullptr; diff --git a/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp b/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp index 371cdd3aa3..8f617c99fb 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp @@ -2,6 +2,7 @@ #include "overlay_osk.h" #include "Emu/RSX/RSXThread.h" #include "Emu/Cell/Modules/cellSysutil.h" +#include "Emu/Cell/Modules/cellMsgDialog.h" LOG_CHANNEL(osk, "OSK"); diff --git a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp index 7d218b0e8b..f73f08bcdd 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "overlay_perf_metrics.h" -#include "../GSRender.h" - +#include "Emu/RSX/RSXThread.h" #include "Emu/Cell/SPUThread.h" #include "Emu/Cell/RawSPUThread.h" #include "Emu/Cell/PPUThread.h" diff --git a/rpcs3/Emu/RSX/Overlays/overlays.cpp b/rpcs3/Emu/RSX/Overlays/overlays.cpp index 50ec0e9691..3f64c00348 100644 --- a/rpcs3/Emu/RSX/Overlays/overlays.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlays.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "overlays.h" #include "overlay_message_dialog.h" -#include "../GSRender.h" #include "Input/pad_thread.h" #include "Emu/Io/interception.h" +#include "Emu/RSX/RSXThread.h" LOG_CHANNEL(overlays); diff --git a/rpcs3/Emu/RSX/VK/VKCommandStream.cpp b/rpcs3/Emu/RSX/VK/VKCommandStream.cpp index 96fb768f53..8f9de9e992 100644 --- a/rpcs3/Emu/RSX/VK/VKCommandStream.cpp +++ b/rpcs3/Emu/RSX/VK/VKCommandStream.cpp @@ -1,5 +1,7 @@ #include "stdafx.h" #include "VKCommandStream.h" +#include "Emu/IdManager.h" +#include "Emu/RSX/RSXOffload.h" namespace vk { diff --git a/rpcs3/Emu/RSX/VK/VKCompute.h b/rpcs3/Emu/RSX/VK/VKCompute.h index 7f6046996c..8555d4e765 100644 --- a/rpcs3/Emu/RSX/VK/VKCompute.h +++ b/rpcs3/Emu/RSX/VK/VKCompute.h @@ -2,6 +2,7 @@ #include "VKHelpers.h" #include "VKRenderPass.h" #include "Utilities/StrUtil.h" +#include "Emu/IdManager.h" #define VK_MAX_COMPUTE_TASKS 4096 // Max number of jobs per frame diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index b35908b9e1..627b791234 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -14,12 +14,13 @@ #include #endif -#include "Emu/RSX/GSRender.h" #include "VulkanAPI.h" #include "VKCommonDecompiler.h" #include "../GCM.h" #include "../Common/ring_buffer_helper.h" #include "../Common/TextureUtils.h" +#include "../display.h" +#include "../rsx_utils.h" #include "3rdparty/GPUOpen/include/vk_mem_alloc.h" diff --git a/rpcs3/Emu/RSX/display.h b/rpcs3/Emu/RSX/display.h new file mode 100644 index 0000000000..773685c7ab --- /dev/null +++ b/rpcs3/Emu/RSX/display.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef _WIN32 +#include +#elif defined(__APPLE__) +// nothing +#elif defined(HAVE_X11) +// Cannot include Xlib.h before Qt5 +// and we don't need all of Xlib anyway +using Display = struct _XDisplay; +using Window = unsigned long; +#endif + +#ifdef VK_USE_PLATFORM_WAYLAND_KHR +#include +#endif + +#ifdef _WIN32 +using display_handle_t = HWND; +#elif defined(__APPLE__) +using display_handle_t = void*; // NSView +#else +#include +using display_handle_t = std::variant< +#if defined(HAVE_X11) && defined(VK_USE_PLATFORM_WAYLAND_KHR) + std::pair, std::pair +#elif defined(HAVE_X11) + std::pair +#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) + std::pair +#endif +>; +#endif + +using draw_context_t = void*; diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index 728b39bf1a..6c0f87b66a 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -578,7 +578,7 @@ namespace rsx static inline const f32 get_resolution_scale() { - return g_cfg.video.strict_rendering_mode? 1.f : (g_cfg.video.resolution_scale_percent / 100.f); + return g_cfg.video.strict_rendering_mode ? 1.f : (g_cfg.video.resolution_scale_percent / 100.f); } static inline const int get_resolution_scale_percent() diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index afd152a257..a71dbb51c1 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -16,10 +16,10 @@ #include "Emu/Cell/lv2/sys_sync.h" #include "Emu/Cell/lv2/sys_prx.h" #include "Emu/Cell/lv2/sys_rsx.h" +#include "Emu/Cell/Modules/cellMsgDialog.h" #include "Emu/title.h" #include "Emu/IdManager.h" -#include "Emu/RSX/GSRender.h" #include "Emu/RSX/Capture/rsx_replay.h" #include "Loader/PSF.h" diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index f7f97456e2..24184cfeb0 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -502,6 +502,8 @@ + + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 82d33c9822..56e222e385 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -18,9 +18,6 @@ {1df5b438-f263-4ff4-9b86-a9ea368f2106} - - {28902cf4-4fa6-428b-ab94-6b410fd5077f} - {037247b4-0370-4193-a25d-bc9d075bf0a7} @@ -1879,6 +1876,12 @@ Emu\Io + + Emu\GPU\RSX + + + Emu\GPU\RSX + diff --git a/rpcs3/headless_application.cpp b/rpcs3/headless_application.cpp index c6904fcdf0..0feb107c9e 100644 --- a/rpcs3/headless_application.cpp +++ b/rpcs3/headless_application.cpp @@ -1,6 +1,5 @@ #include "headless_application.h" -#include "Emu/RSX/GSRender.h" #include "Emu/RSX/Null/NullGSRender.h" #include "Emu/Cell/Modules/cellMsgDialog.h" #include "Emu/Cell/Modules/cellOskDialog.h" diff --git a/rpcs3/rpcs3qt/gl_gs_frame.cpp b/rpcs3/rpcs3qt/gl_gs_frame.cpp index 7ffb995dd0..bc97e615cc 100644 --- a/rpcs3/rpcs3qt/gl_gs_frame.cpp +++ b/rpcs3/rpcs3qt/gl_gs_frame.cpp @@ -1,6 +1,8 @@ #include "stdafx.h" #include "gl_gs_frame.h" +#include "Emu/system_config.h" + #include #include diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index 16e60f3844..4f85127ed5 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -5,12 +5,15 @@ #include "Utilities/Timer.h" #include "Utilities/date_time.h" #include "Emu/System.h" +#include "Emu/system_config.h" +#include "Emu/IdManager.h" #include "Emu/Cell/Modules/cellScreenshot.h" #include #include #include #include +#include #include "png.h" diff --git a/rpcs3/rpcs3qt/gs_frame.h b/rpcs3/rpcs3qt/gs_frame.h index 7f92784f08..2442519cd0 100644 --- a/rpcs3/rpcs3qt/gs_frame.h +++ b/rpcs3/rpcs3qt/gs_frame.h @@ -1,7 +1,7 @@ #pragma once #include "stdafx.h" -#include "Emu/RSX/GSRender.h" +#include "Emu/RSX/GSFrameBase.h" #include #include diff --git a/rpcs3/rpcs3qt/gui_application.cpp b/rpcs3/rpcs3qt/gui_application.cpp index 3f192e34a9..40672c5772 100644 --- a/rpcs3/rpcs3qt/gui_application.cpp +++ b/rpcs3/rpcs3qt/gui_application.cpp @@ -30,7 +30,6 @@ #include -#include "Emu/RSX/GSRender.h" #include "Emu/RSX/Null/NullGSRender.h" #include "Emu/RSX/GL/GLGSRender.h" diff --git a/rpcs3/rpcs3qt/render_creator.cpp b/rpcs3/rpcs3qt/render_creator.cpp index 9566b45280..d65390d574 100644 --- a/rpcs3/rpcs3qt/render_creator.cpp +++ b/rpcs3/rpcs3qt/render_creator.cpp @@ -13,6 +13,7 @@ #include #include #include +#include LOG_CHANNEL(cfg_log, "CFG"); diff --git a/rpcs3/rpcs3qt/rsx_debugger.cpp b/rpcs3/rpcs3qt/rsx_debugger.cpp index 8bf96d44b8..9eea59b24b 100644 --- a/rpcs3/rpcs3qt/rsx_debugger.cpp +++ b/rpcs3/rpcs3qt/rsx_debugger.cpp @@ -3,8 +3,7 @@ #include "qt_utils.h" #include "memory_viewer_panel.h" #include "table_item_delegate.h" - -#include "Emu/RSX/GSRender.h" +#include "Emu/RSX/RSXThread.h" #include #include