From fe75311be2c3b97005f3276b54ba33a5354c2732 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 15 Feb 2020 23:36:20 +0100 Subject: [PATCH] move config structs to own files and clean up some headers --- Utilities/Config.cpp | 2 +- Utilities/Thread.cpp | 3 - Utilities/sysinfo.cpp | 2 +- rpcs3/Crypto/unself.cpp | 2 +- rpcs3/Emu/Audio/AL/OpenALBackend.cpp | 1 - rpcs3/Emu/Audio/ALSA/ALSABackend.cpp | 2 +- rpcs3/Emu/Audio/AudioBackend.cpp | 68 +++ rpcs3/Emu/Audio/AudioBackend.h | 63 +-- rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp | 2 + rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp | 1 + rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp | 1 + rpcs3/Emu/CMakeLists.txt | 3 + rpcs3/Emu/CPU/CPUThread.cpp | 1 + rpcs3/Emu/Cell/MFC.cpp | 8 +- rpcs3/Emu/Cell/Modules/cellAdec.cpp | 1 - rpcs3/Emu/Cell/Modules/cellAtrac.cpp | 1 - rpcs3/Emu/Cell/Modules/cellAtracMulti.cpp | 1 - rpcs3/Emu/Cell/Modules/cellAudio.cpp | 2 - rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellBgdl.cpp | 1 - rpcs3/Emu/Cell/Modules/cellCamera.cpp | 4 +- .../Emu/Cell/Modules/cellCrossController.cpp | 1 - rpcs3/Emu/Cell/Modules/cellDmux.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellFiber.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellFont.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellFs.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellGame.cpp | 1 + rpcs3/Emu/Cell/Modules/cellGcmSys.cpp | 1 - rpcs3/Emu/Cell/Modules/cellGem.cpp | 5 +- rpcs3/Emu/Cell/Modules/cellGifDec.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellJpgDec.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellKb.cpp | 1 - rpcs3/Emu/Cell/Modules/cellMic.cpp | 1 + rpcs3/Emu/Cell/Modules/cellMouse.cpp | 1 - rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp | 2 - rpcs3/Emu/Cell/Modules/cellMusic.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellNetCtl.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellOskDialog.cpp | 1 - rpcs3/Emu/Cell/Modules/cellPad.cpp | 1 - rpcs3/Emu/Cell/Modules/cellPamf.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellPngDec.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellPrint.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellResc.cpp | 1 - rpcs3/Emu/Cell/Modules/cellRudp.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellSail.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellSaveData.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellScreenshot.cpp | 32 +- rpcs3/Emu/Cell/Modules/cellScreenshot.h | 33 +- rpcs3/Emu/Cell/Modules/cellSearch.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellSpurs.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellSpursJq.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellSync.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellSync2.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellSysCache.cpp | 1 + rpcs3/Emu/Cell/Modules/cellSysmodule.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellSysutil.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellUserInfo.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellVdec.cpp | 1 - rpcs3/Emu/Cell/Modules/cellVideoOut.cpp | 2 +- .../Cell/Modules/cellVideoPlayerUtility.cpp | 3 +- rpcs3/Emu/Cell/Modules/cellVoice.cpp | 2 - rpcs3/Emu/Cell/Modules/cellVpost.cpp | 3 +- rpcs3/Emu/Cell/Modules/libmedi.cpp | 1 - rpcs3/Emu/Cell/Modules/libmixer.cpp | 2 - rpcs3/Emu/Cell/Modules/sceNp.cpp | 1 + rpcs3/Emu/Cell/Modules/sceNpClans.cpp | 1 - rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp | 2 +- rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp | 1 - rpcs3/Emu/Cell/Modules/sys_game.cpp | 3 +- rpcs3/Emu/Cell/Modules/sys_heap.cpp | 3 +- rpcs3/Emu/Cell/Modules/sys_libc.cpp | 1 - rpcs3/Emu/Cell/Modules/sys_lv2dbg.cpp | 4 +- rpcs3/Emu/Cell/Modules/sys_lwcond_.cpp | 4 +- rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp | 5 +- rpcs3/Emu/Cell/Modules/sys_mempool.cpp | 2 - rpcs3/Emu/Cell/Modules/sys_ppu_thread_.cpp | 3 +- rpcs3/Emu/Cell/Modules/sys_prx_.cpp | 3 +- rpcs3/Emu/Cell/Modules/sys_rsxaudio_.cpp | 3 +- rpcs3/Emu/Cell/Modules/sys_spinlock.cpp | 3 +- rpcs3/Emu/Cell/Modules/sys_spu_.cpp | 4 +- rpcs3/Emu/Cell/PPUInterpreter.cpp | 2 +- rpcs3/Emu/Cell/PPUModule.cpp | 3 +- rpcs3/Emu/Cell/PPUThread.cpp | 3 +- rpcs3/Emu/Cell/RawSPUThread.cpp | 2 - rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp | 2 +- rpcs3/Emu/Cell/SPUInterpreter.cpp | 1 - rpcs3/Emu/Cell/SPURecompiler.cpp | 1 + rpcs3/Emu/Cell/SPUThread.cpp | 1 - rpcs3/Emu/Cell/lv2/lv2.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_bdemu.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_cond.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_config.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_console.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_event.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_event_flag.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_gamepad.cpp | 6 +- rpcs3/Emu/Cell/lv2/sys_gpio.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_hid.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_interrupt.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_io.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_lwcond.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_mutex.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_net.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_overlay.cpp | 4 +- rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_process.cpp | 1 + rpcs3/Emu/Cell/lv2/sys_prx.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_rsx.cpp | 2 - rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_rwlock.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_semaphore.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_sm.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_spu.cpp | 1 + rpcs3/Emu/Cell/lv2/sys_storage.cpp | 5 +- rpcs3/Emu/Cell/lv2/sys_sync.h | 1 + rpcs3/Emu/Cell/lv2/sys_time.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_timer.cpp | 1 - rpcs3/Emu/Cell/lv2/sys_trace.cpp | 2 - rpcs3/Emu/Cell/lv2/sys_tty.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_uart.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_usbd.cpp | 1 - rpcs3/Emu/GDB.cpp | 3 +- rpcs3/Emu/Io/Null/NullPadHandler.h | 2 + rpcs3/Emu/Io/PadHandler.cpp | 1 + rpcs3/Emu/Io/PadHandler.h | 141 +----- rpcs3/Emu/Io/pad_config.cpp | 53 +++ rpcs3/Emu/Io/pad_config.h | 110 +++++ rpcs3/Emu/RSX/Capture/rsx_replay.cpp | 2 - rpcs3/Emu/RSX/Capture/rsx_replay.h | 4 +- rpcs3/Emu/RSX/CgBinaryFragmentProgram.cpp | 3 +- rpcs3/Emu/RSX/CgBinaryVertexProgram.cpp | 2 +- .../RSX/Common/FragmentProgramDecompiler.cpp | 1 - rpcs3/Emu/RSX/Common/ProgramStateCache.cpp | 2 +- rpcs3/Emu/RSX/Common/texture_cache.h | 1 - rpcs3/Emu/RSX/Common/texture_cache_utils.h | 3 +- rpcs3/Emu/RSX/GL/GLGSRender.cpp | 2 - rpcs3/Emu/RSX/GL/GLHelpers.h | 2 +- rpcs3/Emu/RSX/GL/GLRenderTargets.cpp | 1 - rpcs3/Emu/RSX/GL/GLTextureCache.h | 1 - rpcs3/Emu/RSX/GSRender.cpp | 2 - rpcs3/Emu/RSX/Null/NullGSRender.cpp | 1 - .../Shaders/shader_loading_dialog.cpp | 1 + .../Overlays/Shaders/shader_loading_dialog.h | 1 - rpcs3/Emu/RSX/Overlays/overlay_animation.cpp | 1 + rpcs3/Emu/RSX/Overlays/overlay_controls.h | 1 - rpcs3/Emu/RSX/Overlays/overlay_font.cpp | 1 + rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp | 1 + .../RSX/Overlays/overlay_message_dialog.cpp | 2 + rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h | 1 + .../overlay_shader_compile_notification.cpp | 1 + rpcs3/Emu/RSX/RSXOffload.cpp | 1 - rpcs3/Emu/RSX/RSXThread.cpp | 3 - rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp | 2 - rpcs3/Emu/RSX/VK/VKGSRender.cpp | 2 - rpcs3/Emu/RSX/VK/VKHelpers.h | 1 - rpcs3/Emu/RSX/VK/VKTextureCache.h | 1 - rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp | 2 - rpcs3/Emu/RSX/VK/VKVertexProgram.cpp | 1 - rpcs3/Emu/RSX/rsx_methods.cpp | 2 - rpcs3/Emu/RSX/rsx_utils.h | 2 +- rpcs3/Emu/System.cpp | 21 +- rpcs3/Emu/System.h | 446 +----------------- rpcs3/Emu/system_config.cpp | 19 + rpcs3/Emu/system_config.h | 263 +++++++++++ rpcs3/Emu/system_config_types.h | 169 +++++++ rpcs3/Input/basic_keyboard_handler.cpp | 2 +- rpcs3/Input/ds3_pad_handler.cpp | 5 +- rpcs3/Input/ds3_pad_handler.h | 3 - rpcs3/Input/ds4_pad_handler.cpp | 5 +- rpcs3/Input/ds4_pad_handler.h | 3 - rpcs3/Input/pad_thread.cpp | 3 +- rpcs3/Input/xinput_pad_handler.cpp | 1 + rpcs3/Loader/TROPUSR.cpp | 2 +- rpcs3/Loader/TRP.cpp | 4 +- rpcs3/display_sleep_control.cpp | 1 - rpcs3/emucore.vcxproj | 6 + rpcs3/emucore.vcxproj.filters | 18 + rpcs3/headless_application.cpp | 2 - rpcs3/main_application.cpp | 12 +- rpcs3/main_application.h | 3 +- rpcs3/rpcs3qt/auto_pause_settings_dialog.cpp | 5 +- rpcs3/rpcs3qt/auto_pause_settings_dialog.h | 5 +- rpcs3/rpcs3qt/cheat_manager.cpp | 1 + rpcs3/rpcs3qt/debugger_frame.cpp | 4 +- rpcs3/rpcs3qt/debugger_frame.h | 5 +- rpcs3/rpcs3qt/debugger_list.cpp | 2 +- rpcs3/rpcs3qt/emu_settings.cpp | 1 - rpcs3/rpcs3qt/gl_gs_frame.cpp | 5 +- rpcs3/rpcs3qt/instruction_editor_dialog.h | 4 +- rpcs3/rpcs3qt/kernel_explorer.cpp | 6 +- rpcs3/rpcs3qt/kernel_explorer.h | 5 +- rpcs3/rpcs3qt/main_window.cpp | 1 + rpcs3/rpcs3qt/memory_string_searcher.cpp | 3 + rpcs3/rpcs3qt/memory_string_searcher.h | 7 +- rpcs3/rpcs3qt/msg_dialog_frame.h | 3 - rpcs3/rpcs3qt/osk_dialog_frame.h | 3 - rpcs3/rpcs3qt/register_editor_dialog.h | 3 +- rpcs3/rpcs3qt/rsx_debugger.cpp | 2 + rpcs3/rpcs3qt/rsx_debugger.h | 4 - rpcs3/rpcs3qt/save_data_dialog.cpp | 1 + rpcs3/rpcs3qt/save_data_list_dialog.h | 1 - rpcs3/rpcs3qt/settings_dialog.cpp | 1 + rpcs3/rpcs3qt/skylander_dialog.cpp | 1 - rpcs3/rpcs3qt/user_account.cpp | 7 +- rpcs3/rpcs3qt/user_account.h | 6 +- rpcs3/rpcs3qt/user_manager_dialog.cpp | 2 + rpcs3/rpcs3qt/user_manager_dialog.h | 3 +- rpcs3/rpcs3qt/vfs_dialog.cpp | 1 + rpcs3/rpcs3qt/vfs_dialog_tab.h | 2 +- rpcs3/rpcs3qt/welcome_dialog.cpp | 4 +- 213 files changed, 919 insertions(+), 997 deletions(-) create mode 100644 rpcs3/Emu/Audio/AudioBackend.cpp create mode 100644 rpcs3/Emu/Io/pad_config.cpp create mode 100644 rpcs3/Emu/Io/pad_config.h create mode 100644 rpcs3/Emu/system_config.cpp create mode 100644 rpcs3/Emu/system_config.h create mode 100644 rpcs3/Emu/system_config_types.h diff --git a/Utilities/Config.cpp b/Utilities/Config.cpp index 882fdafe7c..3c59881acb 100644 --- a/Utilities/Config.cpp +++ b/Utilities/Config.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Config.h" #include "yaml-cpp/yaml.h" diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index ecf3eb9cd3..5fbf5ec6ba 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1,7 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" #include "Emu/Cell/SPUThread.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/RawSPUThread.h" diff --git a/Utilities/sysinfo.cpp b/Utilities/sysinfo.cpp index 94a138eb9f..70836d0416 100755 --- a/Utilities/sysinfo.cpp +++ b/Utilities/sysinfo.cpp @@ -1,7 +1,7 @@ #include "sysinfo.h" #include "StrFmt.h" #include "File.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #ifdef _WIN32 #include "windows.h" diff --git a/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp index 0ecce45fc9..5a96d53405 100644 --- a/rpcs3/Crypto/unself.cpp +++ b/rpcs3/Crypto/unself.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "aes.h" #include "sha1.h" #include "utils.h" diff --git a/rpcs3/Emu/Audio/AL/OpenALBackend.cpp b/rpcs3/Emu/Audio/AL/OpenALBackend.cpp index 4a80d978cd..06aa7bacba 100644 --- a/rpcs3/Emu/Audio/AL/OpenALBackend.cpp +++ b/rpcs3/Emu/Audio/AL/OpenALBackend.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "OpenALBackend.h" diff --git a/rpcs3/Emu/Audio/ALSA/ALSABackend.cpp b/rpcs3/Emu/Audio/ALSA/ALSABackend.cpp index 3d0006dce9..dc436ee6c6 100644 --- a/rpcs3/Emu/Audio/ALSA/ALSABackend.cpp +++ b/rpcs3/Emu/Audio/ALSA/ALSABackend.cpp @@ -3,7 +3,7 @@ #endif #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "ALSABackend.h" diff --git a/rpcs3/Emu/Audio/AudioBackend.cpp b/rpcs3/Emu/Audio/AudioBackend.cpp new file mode 100644 index 0000000000..0d0cd7f1d0 --- /dev/null +++ b/rpcs3/Emu/Audio/AudioBackend.cpp @@ -0,0 +1,68 @@ +#include "stdafx.h" +#include "AudioBackend.h" +#include "Emu/system_config.h" + +/* + * Helper methods + */ +u32 AudioBackend::get_sampling_rate() +{ + const u32 sampling_period_multiplier_u32 = g_cfg.audio.sampling_period_multiplier; + + if (sampling_period_multiplier_u32 == 100) + return DEFAULT_AUDIO_SAMPLING_RATE; + + const f32 sampling_period_multiplier = sampling_period_multiplier_u32 / 100.0f; + const f32 sampling_rate_multiplier = 1.0f / sampling_period_multiplier; + return static_cast(DEFAULT_AUDIO_SAMPLING_RATE * sampling_rate_multiplier); +} + +u32 AudioBackend::get_sample_size() +{ + return g_cfg.audio.convert_to_u16 ? sizeof(u16) : sizeof(float); +} + +u32 AudioBackend::get_channels() +{ + return g_cfg.audio.downmix_to_2ch ? 2 : 8; +} + +bool AudioBackend::has_capability(u32 cap) const +{ + return (cap & GetCapabilities()) == cap; +} + +void AudioBackend::dump_capabilities(std::string& out) const +{ + u32 count = 0; + u32 capabilities = GetCapabilities(); + + if (capabilities & PLAY_PAUSE_FLUSH) + { + fmt::append(out, "PLAY_PAUSE_FLUSH"); + count++; + } + + if (capabilities & IS_PLAYING) + { + fmt::append(out, "%sIS_PLAYING", count > 0 ? " | " : ""); + count++; + } + + if (capabilities & GET_NUM_ENQUEUED_SAMPLES) + { + fmt::append(out, "%sGET_NUM_ENQUEUED_SAMPLES", count > 0 ? " | " : ""); + count++; + } + + if (capabilities & SET_FREQUENCY_RATIO) + { + fmt::append(out, "%sSET_FREQUENCY_RATIO", count > 0 ? " | " : ""); + count++; + } + + if (count == 0) + { + fmt::append(out, "NONE"); + } +} diff --git a/rpcs3/Emu/Audio/AudioBackend.h b/rpcs3/Emu/Audio/AudioBackend.h index cb665dd9d0..e751ad6b6a 100644 --- a/rpcs3/Emu/Audio/AudioBackend.h +++ b/rpcs3/Emu/Audio/AudioBackend.h @@ -1,7 +1,6 @@ #pragma once #include "Utilities/types.h" -#include "Emu/System.h" enum : u32 { @@ -89,65 +88,13 @@ public: /* * Helper methods */ - static u32 get_sampling_rate() - { - const u32 sampling_period_multiplier_u32 = g_cfg.audio.sampling_period_multiplier; + static u32 get_sampling_rate(); - if (sampling_period_multiplier_u32 == 100) - return DEFAULT_AUDIO_SAMPLING_RATE; + static u32 get_sample_size(); - const f32 sampling_period_multiplier = sampling_period_multiplier_u32 / 100.0f; - const f32 sampling_rate_multiplier = 1.0f / sampling_period_multiplier; - return static_cast(DEFAULT_AUDIO_SAMPLING_RATE * sampling_rate_multiplier); - } + static u32 get_channels(); - static u32 get_sample_size() - { - return g_cfg.audio.convert_to_u16 ? sizeof(u16) : sizeof(float); - } + bool has_capability(u32 cap) const; - static u32 get_channels() - { - return g_cfg.audio.downmix_to_2ch ? 2 : 8; - } - - bool has_capability(u32 cap) const - { - return (cap & GetCapabilities()) == cap; - } - - void dump_capabilities(std::string& out) const - { - u32 count = 0; - u32 capabilities = GetCapabilities(); - - if (capabilities & PLAY_PAUSE_FLUSH) - { - fmt::append(out, "PLAY_PAUSE_FLUSH"); - count++; - } - - if (capabilities & IS_PLAYING) - { - fmt::append(out, "%sIS_PLAYING", count > 0 ? " | " : ""); - count++; - } - - if (capabilities & GET_NUM_ENQUEUED_SAMPLES) - { - fmt::append(out, "%sGET_NUM_ENQUEUED_SAMPLES", count > 0 ? " | " : ""); - count++; - } - - if (capabilities & SET_FREQUENCY_RATIO) - { - fmt::append(out, "%sSET_FREQUENCY_RATIO", count > 0 ? " | " : ""); - count++; - } - - if (count == 0) - { - fmt::append(out, "NONE"); - } - } + void dump_capabilities(std::string& out) const; }; diff --git a/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp b/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp index fb988f5489..a9c914d006 100644 --- a/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp +++ b/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp @@ -3,6 +3,8 @@ #endif #include "FAudioBackend.h" +#include "Emu/system_config.h" +#include "Emu/System.h" LOG_CHANNEL(FAudio_, "FAudio"); diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp index f378833a71..4e6d21aabe 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio27Backend.cpp @@ -5,6 +5,7 @@ #include "Utilities/Log.h" #include "Utilities/StrFmt.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "XAudio2Backend.h" #include "3rdparty/XAudio2_7/XAudio2.h" diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp index 8c6f8b9d21..282deb1c3e 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio28Backend.cpp @@ -5,6 +5,7 @@ #include "Utilities/Log.h" #include "Utilities/StrFmt.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "XAudio2Backend.h" #include "3rdparty/minidx12/Include/xaudio2.h" diff --git a/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt index c9faf34fa3..47668d7254 100644 --- a/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -1,6 +1,7 @@ add_library(rpcs3_emu IdManager.cpp System.cpp + system_config.cpp VFS.cpp GDB.cpp title.cpp @@ -90,6 +91,7 @@ target_sources(rpcs3_emu PRIVATE # Audio target_sources(rpcs3_emu PRIVATE Audio/AudioDumper.cpp + Audio/AudioBackend.cpp Audio/AL/OpenALBackend.cpp ) @@ -338,6 +340,7 @@ target_link_libraries(rpcs3_emu # Io target_sources(rpcs3_emu PRIVATE + Io/pad_config.cpp Io/KeyboardHandler.cpp Io/PadHandler.cpp Io/usb_device.cpp diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index 72bb8f1119..86337ba551 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -2,6 +2,7 @@ #include "CPUThread.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/Memory/vm_locking.h" #include "Emu/IdManager.h" #include "Emu/GDB.h" diff --git a/rpcs3/Emu/Cell/MFC.cpp b/rpcs3/Emu/Cell/MFC.cpp index 8f846c964b..bc1e513653 100644 --- a/rpcs3/Emu/Cell/MFC.cpp +++ b/rpcs3/Emu/Cell/MFC.cpp @@ -1,12 +1,6 @@ -#include "stdafx.h" +#include "stdafx.h" #include "MFC.h" -#include "Utilities/sysinfo.h" -#include "Emu/Memory/vm.h" -#include "Emu/Cell/SPUThread.h" -#include "Emu/Cell/lv2/sys_sync.h" -#include "Emu/System.h" - template <> void fmt_class_string::format(std::string& out, u64 arg) { diff --git a/rpcs3/Emu/Cell/Modules/cellAdec.cpp b/rpcs3/Emu/Cell/Modules/cellAdec.cpp index c928867a37..c542b911fe 100644 --- a/rpcs3/Emu/Cell/Modules/cellAdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAdec.cpp @@ -1,5 +1,4 @@ #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/cellAtrac.cpp b/rpcs3/Emu/Cell/Modules/cellAtrac.cpp index 755cae8fc9..155cd3fdb6 100644 --- a/rpcs3/Emu/Cell/Modules/cellAtrac.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAtrac.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "cellAtrac.h" diff --git a/rpcs3/Emu/Cell/Modules/cellAtracMulti.cpp b/rpcs3/Emu/Cell/Modules/cellAtracMulti.cpp index fc55a1bd59..26bda571a1 100644 --- a/rpcs3/Emu/Cell/Modules/cellAtracMulti.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAtracMulti.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "cellAtracMulti.h" diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.cpp b/rpcs3/Emu/Cell/Modules/cellAudio.cpp index 82293a4d53..47e20f0cdb 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAudio.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_process.h" diff --git a/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp b/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp index 95acc734d7..bc18670048 100644 --- a/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" #include "Emu/RSX/rsx_utils.h" diff --git a/rpcs3/Emu/Cell/Modules/cellBgdl.cpp b/rpcs3/Emu/Cell/Modules/cellBgdl.cpp index 424a5acf5a..ad644d0ae4 100644 --- a/rpcs3/Emu/Cell/Modules/cellBgdl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellBgdl.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "cellBgdl.h" diff --git a/rpcs3/Emu/Cell/Modules/cellCamera.cpp b/rpcs3/Emu/Cell/Modules/cellCamera.cpp index 58db6b5151..857567e9b2 100644 --- a/rpcs3/Emu/Cell/Modules/cellCamera.cpp +++ b/rpcs3/Emu/Cell/Modules/cellCamera.cpp @@ -1,11 +1,9 @@ -#include "stdafx.h" +#include "stdafx.h" #include "cellCamera.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_event.h" #include "Emu/IdManager.h" -#include "Emu/Io/PadHandler.h" -#include "Emu/System.h" LOG_CHANNEL(cellCamera); diff --git a/rpcs3/Emu/Cell/Modules/cellCrossController.cpp b/rpcs3/Emu/Cell/Modules/cellCrossController.cpp index a930e26e07..9dbf5bf9da 100644 --- a/rpcs3/Emu/Cell/Modules/cellCrossController.cpp +++ b/rpcs3/Emu/Cell/Modules/cellCrossController.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "cellSysutil.h" #include "cellCrossController.h" diff --git a/rpcs3/Emu/Cell/Modules/cellDmux.cpp b/rpcs3/Emu/Cell/Modules/cellDmux.cpp index 466e417156..a75982e915 100644 --- a/rpcs3/Emu/Cell/Modules/cellDmux.cpp +++ b/rpcs3/Emu/Cell/Modules/cellDmux.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_sync.h" diff --git a/rpcs3/Emu/Cell/Modules/cellFiber.cpp b/rpcs3/Emu/Cell/Modules/cellFiber.cpp index 6a07e23bd8..8fc813be6f 100644 --- a/rpcs3/Emu/Cell/Modules/cellFiber.cpp +++ b/rpcs3/Emu/Cell/Modules/cellFiber.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "cellFiber.h" diff --git a/rpcs3/Emu/Cell/Modules/cellFont.cpp b/rpcs3/Emu/Cell/Modules/cellFont.cpp index da4a4cf1b4..ab5887ccac 100644 --- a/rpcs3/Emu/Cell/Modules/cellFont.cpp +++ b/rpcs3/Emu/Cell/Modules/cellFont.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUModule.h" #include diff --git a/rpcs3/Emu/Cell/Modules/cellFs.cpp b/rpcs3/Emu/Cell/Modules/cellFs.cpp index e3e5a7f544..2ca1fa62f2 100644 --- a/rpcs3/Emu/Cell/Modules/cellFs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellFs.cpp @@ -1,5 +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/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index beb190d2b6..8b3fbdd495 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -1,5 +1,6 @@ #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/cellGcmSys.cpp b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp index 5c2440a0c0..8e7ed089cf 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellGem.cpp b/rpcs3/Emu/Cell/Modules/cellGem.cpp index 4b61a9c43e..3f49cdfc2f 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGem.cpp @@ -1,11 +1,8 @@ #include "stdafx.h" #include "cellGem.h" - #include "cellCamera.h" -#include "Emu/IdManager.h" -#include "Emu/System.h" + #include "Emu/Cell/PPUModule.h" -#include "Input/pad_thread.h" #include "Emu/Io/MouseHandler.h" #include "Emu/RSX/GSRender.h" #include "Utilities/Timer.h" diff --git a/rpcs3/Emu/Cell/Modules/cellGifDec.cpp b/rpcs3/Emu/Cell/Modules/cellGifDec.cpp index 1646b2a031..0d896d7097 100644 --- a/rpcs3/Emu/Cell/Modules/cellGifDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGifDec.cpp @@ -1,5 +1,5 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp b/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp index e1d90b7ef9..da87be4faf 100644 --- a/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp @@ -1,5 +1,5 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellKb.cpp b/rpcs3/Emu/Cell/Modules/cellKb.cpp index 39fc8f4bcb..e0ec6d1a43 100644 --- a/rpcs3/Emu/Cell/Modules/cellKb.cpp +++ b/rpcs3/Emu/Cell/Modules/cellKb.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellMic.cpp b/rpcs3/Emu/Cell/Modules/cellMic.cpp index aade805988..59fba378ba 100644 --- a/rpcs3/Emu/Cell/Modules/cellMic.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMic.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/Cell/PPUModule.h" #include "Utilities/StrUtil.h" diff --git a/rpcs3/Emu/Cell/Modules/cellMouse.cpp b/rpcs3/Emu/Cell/Modules/cellMouse.cpp index bdfe6ae636..cfb04a2402 100644 --- a/rpcs3/Emu/Cell/Modules/cellMouse.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMouse.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp index 49e5aba4fa..73b6df498f 100644 --- a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" -#include "Emu/IdManager.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/cellMusic.cpp b/rpcs3/Emu/Cell/Modules/cellMusic.cpp index 96a10ad91a..c2092c0cf8 100644 --- a/rpcs3/Emu/Cell/Modules/cellMusic.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMusic.cpp @@ -1,6 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_lwmutex.h" #include "Emu/Cell/lv2/sys_lwcond.h" diff --git a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp index 521f92d7a8..60ef2428e8 100644 --- a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp b/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp index e74f22f00c..7b07540f3c 100644 --- a/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp +++ b/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" #include "Emu/System.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/RSX/Overlays/overlays.h" #include "Input/pad_thread.h" diff --git a/rpcs3/Emu/Cell/Modules/cellPad.cpp b/rpcs3/Emu/Cell/Modules/cellPad.cpp index 076adcb84d..fec83fdc42 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPad.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_process.h" diff --git a/rpcs3/Emu/Cell/Modules/cellPamf.cpp b/rpcs3/Emu/Cell/Modules/cellPamf.cpp index 27a4216cf4..e8dfcbab79 100644 --- a/rpcs3/Emu/Cell/Modules/cellPamf.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPamf.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Emu/System.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellPngDec.cpp b/rpcs3/Emu/Cell/Modules/cellPngDec.cpp index 18f3556d16..9af0855e76 100644 --- a/rpcs3/Emu/Cell/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPngDec.cpp @@ -1,5 +1,5 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellPrint.cpp b/rpcs3/Emu/Cell/Modules/cellPrint.cpp index 89d4f713cc..766c90245a 100644 --- a/rpcs3/Emu/Cell/Modules/cellPrint.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPrint.cpp @@ -1,6 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "cellSysutil.h" diff --git a/rpcs3/Emu/Cell/Modules/cellResc.cpp b/rpcs3/Emu/Cell/Modules/cellResc.cpp index 00d8925f92..ff8a21225c 100644 --- a/rpcs3/Emu/Cell/Modules/cellResc.cpp +++ b/rpcs3/Emu/Cell/Modules/cellResc.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellRudp.cpp b/rpcs3/Emu/Cell/Modules/cellRudp.cpp index 0c5f83e51e..e18812f023 100644 --- a/rpcs3/Emu/Cell/Modules/cellRudp.cpp +++ b/rpcs3/Emu/Cell/Modules/cellRudp.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSail.cpp b/rpcs3/Emu/Cell/Modules/cellSail.cpp index 7ad401ebdf..52a1472ca9 100644 --- a/rpcs3/Emu/Cell/Modules/cellSail.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSail.cpp @@ -1,5 +1,5 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUModule.h" #include "cellSail.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index 7412c36890..7de45d251a 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/Cell/lv2/sys_sync.h" #include "Emu/Cell/lv2/sys_process.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp b/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp index 50cfbadf5c..8e8611d72e 100644 --- a/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp +++ b/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp @@ -5,8 +5,6 @@ #include "cellScreenshot.h" - - LOG_CHANNEL(cellScreenshot); template<> @@ -27,6 +25,36 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } + +std::string screenshot_manager::get_overlay_path() const +{ + return vfs::get(overlay_dir_name + overlay_file_name); +} + +std::string screenshot_manager::get_photo_title() const +{ + std::string photo = photo_title; + if (photo.empty()) + photo = Emu.GetTitle(); + return photo; +} + +std::string screenshot_manager::get_game_title() const +{ + std::string game = game_title; + if (game.empty()) + game = Emu.GetTitle(); + return game; +} + +std::string screenshot_manager::get_screenshot_path() const +{ + // TODO: make sure the file can be saved, add suffix and increase counter if file exists + // TODO: maybe find a proper home for these + return fs::get_config_dir() + "/screenshots/cell/" + get_photo_title() + ".png"; +} + + error_code cellScreenShotSetParameter(vm::cptr param) { cellScreenshot.warning("cellScreenShotSetParameter(param=*0x%x)", param); diff --git a/rpcs3/Emu/Cell/Modules/cellScreenshot.h b/rpcs3/Emu/Cell/Modules/cellScreenshot.h index 29bb693099..73e0e51a8c 100644 --- a/rpcs3/Emu/Cell/Modules/cellScreenshot.h +++ b/rpcs3/Emu/Cell/Modules/cellScreenshot.h @@ -1,6 +1,6 @@ #pragma once -#include "Emu/Memory/vm_ptr.h" +#include "Emu/VFS.h" // Return Codes enum CellScreenShotError : u32 @@ -40,31 +40,8 @@ struct screenshot_manager std::string overlay_dir_name; std::string overlay_file_name; - std::string get_overlay_path() const - { - return vfs::get(overlay_dir_name + overlay_file_name); - } - - std::string get_photo_title() const - { - std::string photo = photo_title; - if (photo.empty()) - photo = Emu.GetTitle(); - return photo; - } - - std::string get_game_title() const - { - std::string game = game_title; - if (game.empty()) - game = Emu.GetTitle(); - return game; - } - - std::string get_screenshot_path() const - { - // TODO: make sure the file can be saved, add suffix and increase counter if file exists - // TODO: maybe find a proper home for these - return fs::get_config_dir() + "/screenshots/cell/" + get_photo_title() + ".png"; - } + std::string get_overlay_path() const; + std::string get_photo_title() const; + std::string get_game_title() const; + std::string get_screenshot_path() const; }; diff --git a/rpcs3/Emu/Cell/Modules/cellSearch.cpp b/rpcs3/Emu/Cell/Modules/cellSearch.cpp index 73f1059dae..46d1ac15b8 100644 --- a/rpcs3/Emu/Cell/Modules/cellSearch.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSearch.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "cellMusic.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp index 7724a6155c..ea3ea98362 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Utilities/asm.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSpursJq.cpp b/rpcs3/Emu/Cell/Modules/cellSpursJq.cpp index b5d85f2d5c..5d8534e6ff 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpursJq.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpursJq.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_lwmutex.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp b/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp index b8566aa691..8ce618226b 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp @@ -1,6 +1,5 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Loader/ELF.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/SPUThread.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSync.cpp b/rpcs3/Emu/Cell/Modules/cellSync.cpp index d1f1484df9..8bb4fc5714 100644 --- a/rpcs3/Emu/Cell/Modules/cellSync.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSync.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Utilities/asm.h" #include "Emu/Cell/lv2/sys_event.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSync2.cpp b/rpcs3/Emu/Cell/Modules/cellSync2.cpp index 1b8447e4a8..2ec11535d2 100644 --- a/rpcs3/Emu/Cell/Modules/cellSync2.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSync2.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "cellSync2.h" diff --git a/rpcs3/Emu/Cell/Modules/cellSysCache.cpp b/rpcs3/Emu/Cell/Modules/cellSysCache.cpp index ab637d7d71..780f413627 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysCache.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysCache.cpp @@ -1,5 +1,6 @@ #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/cellSysmodule.cpp b/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp index 204cd62605..4272e41349 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" LOG_CHANNEL(cellSysmodule); diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp index d78b3cdc77..35a7fd0a57 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp @@ -1,6 +1,8 @@ #include "stdafx.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/IdManager.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_process.h" @@ -221,7 +223,7 @@ error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr valu break; case CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN: - *value = g_cfg.sys.enter_button_assignment; + *value = static_cast(g_cfg.sys.enter_button_assignment.get()); break; case CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT: diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp b/rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp index e009f8e0bc..a77c16c027 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Emu/System.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp b/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp index e34c5fe7d1..d2ad711d42 100644 --- a/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp +++ b/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp @@ -1,5 +1,6 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUModule.h" #include "cellUserInfo.h" diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index cd020e0bcc..d95b5a83d1 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -1,5 +1,4 @@ #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/cellVideoOut.cpp b/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp index 0223ed4aae..5a2fa772eb 100644 --- a/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/system_config_types.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" #include "Emu/RSX/rsx_utils.h" diff --git a/rpcs3/Emu/Cell/Modules/cellVideoPlayerUtility.cpp b/rpcs3/Emu/Cell/Modules/cellVideoPlayerUtility.cpp index c8e7bf0a16..e0d31fe7bb 100644 --- a/rpcs3/Emu/Cell/Modules/cellVideoPlayerUtility.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVideoPlayerUtility.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" LOG_CHANNEL(cellVideoPlayerUtility); diff --git a/rpcs3/Emu/Cell/Modules/cellVoice.cpp b/rpcs3/Emu/Cell/Modules/cellVoice.cpp index 687699d1b8..61717b34c3 100644 --- a/rpcs3/Emu/Cell/Modules/cellVoice.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVoice.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_event.h" diff --git a/rpcs3/Emu/Cell/Modules/cellVpost.cpp b/rpcs3/Emu/Cell/Modules/cellVpost.cpp index e53d5052d4..89e5aa7a29 100644 --- a/rpcs3/Emu/Cell/Modules/cellVpost.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVpost.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/libmedi.cpp b/rpcs3/Emu/Cell/Modules/libmedi.cpp index 4c3a7ed92a..b378512a41 100644 --- a/rpcs3/Emu/Cell/Modules/libmedi.cpp +++ b/rpcs3/Emu/Cell/Modules/libmedi.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" LOG_CHANNEL(libmedi); diff --git a/rpcs3/Emu/Cell/Modules/libmixer.cpp b/rpcs3/Emu/Cell/Modules/libmixer.cpp index f9c0b9bc4a..2735351ce1 100644 --- a/rpcs3/Emu/Cell/Modules/libmixer.cpp +++ b/rpcs3/Emu/Cell/Modules/libmixer.cpp @@ -1,6 +1,4 @@ #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/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index 34662b01c5..46ee7082cd 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUModule.h" #include "sysPrxForUser.h" diff --git a/rpcs3/Emu/Cell/Modules/sceNpClans.cpp b/rpcs3/Emu/Cell/Modules/sceNpClans.cpp index 0d60378ef1..af3786890d 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpClans.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNpClans.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp index d0bb6cd846..7b93ce29d0 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp @@ -1,5 +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/sysPrxForUser.cpp b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp index 6d5f4fc86f..53f58da1f8 100644 --- a/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_mutex.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_game.cpp b/rpcs3/Emu/Cell/Modules/sys_game.cpp index e4c1f9f69b..45fa7a4a85 100644 --- a/rpcs3/Emu/Cell/Modules/sys_game.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_game.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_mutex.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_heap.cpp b/rpcs3/Emu/Cell/Modules/sys_heap.cpp index 7f07fb8434..b5f73bf3ea 100644 --- a/rpcs3/Emu/Cell/Modules/sys_heap.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_heap.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_libc.cpp b/rpcs3/Emu/Cell/Modules/sys_libc.cpp index fa5301e750..05430e1ca9 100644 --- a/rpcs3/Emu/Cell/Modules/sys_libc.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_libc.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" LOG_CHANNEL(sys_libc); diff --git a/rpcs3/Emu/Cell/Modules/sys_lv2dbg.cpp b/rpcs3/Emu/Cell/Modules/sys_lv2dbg.cpp index 7adca0e695..0fdbe813ec 100644 --- a/rpcs3/Emu/Cell/Modules/sys_lv2dbg.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_lv2dbg.cpp @@ -1,6 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "sys_lv2dbg.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_lwcond_.cpp b/rpcs3/Emu/Cell/Modules/sys_lwcond_.cpp index 9fc1049240..95813eadca 100644 --- a/rpcs3/Emu/Cell/Modules/sys_lwcond_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_lwcond_.cpp @@ -1,6 +1,4 @@ -#include "stdafx.h" -#include "Emu/IdManager.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_lwmutex.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp b/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp index e455ef4126..8999616c5f 100644 --- a/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp @@ -1,7 +1,4 @@ -#include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/IdManager.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_lwmutex.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_mempool.cpp b/rpcs3/Emu/Cell/Modules/sys_mempool.cpp index 1868912d32..49c82d1a45 100644 --- a/rpcs3/Emu/Cell/Modules/sys_mempool.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_mempool.cpp @@ -2,8 +2,6 @@ #include "Utilities/StrUtil.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_mutex.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_ppu_thread_.cpp b/rpcs3/Emu/Cell/Modules/sys_ppu_thread_.cpp index 6f29599542..724b54cefd 100644 --- a/rpcs3/Emu/Cell/Modules/sys_ppu_thread_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_ppu_thread_.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_prx_.cpp b/rpcs3/Emu/Cell/Modules/sys_prx_.cpp index ef3bdaadc8..924cea1332 100644 --- a/rpcs3/Emu/Cell/Modules/sys_prx_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_prx_.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_lwmutex.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_rsxaudio_.cpp b/rpcs3/Emu/Cell/Modules/sys_rsxaudio_.cpp index 7ec04abc3a..fab7bbccbc 100644 --- a/rpcs3/Emu/Cell/Modules/sys_rsxaudio_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_rsxaudio_.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "sysPrxForUser.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_spinlock.cpp b/rpcs3/Emu/Cell/Modules/sys_spinlock.cpp index c1d90ad869..51b93cbdc6 100644 --- a/rpcs3/Emu/Cell/Modules/sys_spinlock.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_spinlock.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "sysPrxForUser.h" diff --git a/rpcs3/Emu/Cell/Modules/sys_spu_.cpp b/rpcs3/Emu/Cell/Modules/sys_spu_.cpp index 496f9683cf..3595c8ad10 100644 --- a/rpcs3/Emu/Cell/Modules/sys_spu_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_spu_.cpp @@ -1,5 +1,5 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/RawSPUThread.h" diff --git a/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp index 8f07fb6fa7..102171e23e 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -2,7 +2,7 @@ #include "PPUInterpreter.h" #include "Emu/Memory/vm_reservation.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "PPUThread.h" #include "Utilities/asm.h" #include "Emu/Cell/Common.h" diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 1140d764a9..6b831ed4e2 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -6,8 +6,7 @@ #include "Crypto/sha1.h" #include "Crypto/unself.h" #include "Loader/ELF.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" +#include "Emu/VFS.h" #include "Emu/Cell/PPUOpcodes.h" #include "Emu/Cell/PPUAnalyser.h" diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 51297630da..1b65bab09c 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -4,8 +4,7 @@ #include "Utilities/JIT.h" #include "Crypto/sha1.h" #include "Emu/Memory/vm_reservation.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" +#include "Emu/VFS.h" #include "PPUThread.h" #include "PPUInterpreter.h" #include "PPUAnalyser.h" diff --git a/rpcs3/Emu/Cell/RawSPUThread.cpp b/rpcs3/Emu/Cell/RawSPUThread.cpp index b4a003f6b9..3b891fb1d3 100644 --- a/rpcs3/Emu/Cell/RawSPUThread.cpp +++ b/rpcs3/Emu/Cell/RawSPUThread.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Loader/ELF.h" diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index 7a935af50f..923dda5766 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "SPUASMJITRecompiler.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/IdManager.h" #include "SPUDisAsm.h" diff --git a/rpcs3/Emu/Cell/SPUInterpreter.cpp b/rpcs3/Emu/Cell/SPUInterpreter.cpp index 692c4f648f..7621c04fb2 100644 --- a/rpcs3/Emu/Cell/SPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/SPUInterpreter.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "SPUInterpreter.h" -#include "Emu/System.h" #include "Utilities/JIT.h" #include "Utilities/sysinfo.h" #include "Utilities/asm.h" diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 654198d4b6..663965ae3e 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -2,6 +2,7 @@ #include "SPURecompiler.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/IdManager.h" #include "Crypto/sha1.h" #include "Utilities/StrUtil.h" diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 7acfc4a038..197799bfa1 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -3,7 +3,6 @@ #include "Utilities/sysinfo.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/Memory/vm_reservation.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUThread.h" diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index f8cd9122c9..39102d341e 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -1,5 +1,4 @@ #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_bdemu.cpp b/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp index 5cc18fa013..c7958ad2a1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Memory/vm.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_cond.cpp b/rpcs3/Emu/Cell/lv2/sys_cond.cpp index 57322cf191..ef53522bfb 100644 --- a/rpcs3/Emu/Cell/lv2/sys_cond.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_cond.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_cond.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_config.cpp b/rpcs3/Emu/Cell/lv2/sys_config.cpp index b98e925307..a2e68d5ef3 100644 --- a/rpcs3/Emu/Cell/lv2/sys_config.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_config.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Memory/vm.h" #include "Emu/IdManager.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_console.cpp b/rpcs3/Emu/Cell/lv2/sys_console.cpp index 9001d3019e..b8d7db4c6c 100644 --- a/rpcs3/Emu/Cell/lv2/sys_console.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_console.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/ErrorCodes.h" #include "sys_console.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_event.cpp b/rpcs3/Emu/Cell/lv2/sys_event.cpp index b1b00e5d28..fbf2b64331 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_event.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_event.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp b/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp index ec6232fb81..1d12dfd4a1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_event_flag.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp b/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp index 73e4e03cba..6baa985eb1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp @@ -1,10 +1,6 @@ -#include "stdafx.h" +#include "stdafx.h" #include "sys_gamepad.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" - - LOG_CHANNEL(sys_gamepad); u32 sys_gamepad_ycon_initalize(vm::ptr in, vm::ptr out) diff --git a/rpcs3/Emu/Cell/lv2/sys_gpio.cpp b/rpcs3/Emu/Cell/lv2/sys_gpio.cpp index e76f36cd9e..2bec31ef0b 100644 --- a/rpcs3/Emu/Cell/lv2/sys_gpio.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_gpio.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_gpio.h" -#include "Emu/System.h" #include "Emu/Cell/ErrorCodes.h" LOG_CHANNEL(sys_gpio); diff --git a/rpcs3/Emu/Cell/lv2/sys_hid.cpp b/rpcs3/Emu/Cell/lv2/sys_hid.cpp index 5d6729b4eb..a08fdd86d8 100644 --- a/rpcs3/Emu/Cell/lv2/sys_hid.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_hid.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Memory/vm.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp b/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp index a218275bb7..fede071bd2 100644 --- a/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp @@ -1,7 +1,6 @@ -#include "stdafx.h" +#include "stdafx.h" #include "sys_interrupt.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_io.cpp b/rpcs3/Emu/Cell/lv2/sys_io.cpp index 8b7162f17c..54110b370f 100644 --- a/rpcs3/Emu/Cell/lv2/sys_io.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_io.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Memory/vm.h" #include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp b/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp index c6bca42876..72681938d4 100644 --- a/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_lwcond.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp b/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp index 91cd8a026f..7ef508fd83 100644 --- a/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_lwmutex.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_mutex.cpp b/rpcs3/Emu/Cell/lv2/sys_mutex.cpp index e83bbc7a6b..564ec73b59 100644 --- a/rpcs3/Emu/Cell/lv2/sys_mutex.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_mutex.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_mutex.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_net.cpp b/rpcs3/Emu/Cell/lv2/sys_net.cpp index 58c55c447b..ef167696ed 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_net.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUThread.h" #include "Utilities/Thread.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_overlay.cpp b/rpcs3/Emu/Cell/lv2/sys_overlay.cpp index 3a22470b30..c23eb41597 100644 --- a/rpcs3/Emu/Cell/lv2/sys_overlay.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_overlay.cpp @@ -1,7 +1,7 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Emu/Memory/vm_ptr.h" -#include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Crypto/unself.h" #include "Crypto/unedat.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp index ffd6fe4ffc..9e37efe74c 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_ppu_thread.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_process.cpp b/rpcs3/Emu/Cell/lv2/sys_process.cpp index 6d24464db6..134aa1983f 100644 --- a/rpcs3/Emu/Cell/lv2/sys_process.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_process.cpp @@ -2,6 +2,7 @@ #include "sys_process.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Crypto/unedat.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_prx.cpp b/rpcs3/Emu/Cell/lv2/sys_prx.cpp index c33be08516..c924ef0c2a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_prx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_prx.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "sys_prx.h" -#include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Crypto/unself.h" #include "Loader/ELF.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index e24f76f89a..d800dc727b 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -1,10 +1,8 @@ #include "stdafx.h" #include "sys_rsx.h" -#include "Emu/System.h" #include "Emu/Cell/PPUModule.h" #include "Emu/RSX/GSRender.h" -#include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" #include "sys_event.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp index 7b5482e0b5..2f140cb8dc 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Memory/vm.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp b/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp index ded4ea1606..10ebc00ac9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp @@ -1,7 +1,6 @@ -#include "stdafx.h" +#include "stdafx.h" #include "sys_rwlock.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp b/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp index 7e125d4b74..72ee32aa4d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_semaphore.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_sm.cpp b/rpcs3/Emu/Cell/lv2/sys_sm.cpp index 62ac5448e1..7c4cdc3ee7 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sm.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_sm.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Memory/vm.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp index 424b52c203..b75912b70f 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -2,6 +2,7 @@ #include "sys_spu.h" #include "Emu/System.h" +#include "Emu/VFS.h" #include "Emu/IdManager.h" #include "Crypto/unself.h" #include "Crypto/unedat.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_storage.cpp b/rpcs3/Emu/Cell/lv2/sys_storage.cpp index ace73e1416..bd44084340 100644 --- a/rpcs3/Emu/Cell/lv2/sys_storage.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_storage.cpp @@ -1,7 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" -#include "Emu/Memory/vm.h" -#include "Emu/IdManager.h" +#include "stdafx.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index 4e5b26337b..2821fa84fb 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -9,6 +9,7 @@ #include "Emu/Cell/ErrorCodes.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" +#include "Emu/system_config.h" #include "Emu/System.h" #include diff --git a/rpcs3/Emu/Cell/lv2/sys_time.cpp b/rpcs3/Emu/Cell/lv2/sys_time.cpp index a5796d5b12..bd48cc1ea9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_time.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "sys_time.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/Cell/ErrorCodes.h" #include "Utilities/asm.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_timer.cpp b/rpcs3/Emu/Cell/lv2/sys_timer.cpp index 82f000b76c..96090cd901 100644 --- a/rpcs3/Emu/Cell/lv2/sys_timer.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_timer.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "sys_timer.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_trace.cpp b/rpcs3/Emu/Cell/lv2/sys_trace.cpp index 2b0e5870fc..c4e9f135be 100644 --- a/rpcs3/Emu/Cell/lv2/sys_trace.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_trace.cpp @@ -1,8 +1,6 @@ #include "stdafx.h" #include "sys_trace.h" -#include "Emu/System.h" - #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_tty.cpp b/rpcs3/Emu/Cell/lv2/sys_tty.cpp index 04b22ffa95..08844a43a9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_tty.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_tty.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "sys_tty.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_uart.cpp b/rpcs3/Emu/Cell/lv2/sys_uart.cpp index 5472836fb9..7be042b8f1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_uart.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_uart.cpp @@ -1,5 +1,4 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp index 9b1258442e..79aa5ab034 100644 --- a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp @@ -4,7 +4,6 @@ #include #include #include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/GDB.cpp b/rpcs3/Emu/GDB.cpp index 2b72d9f5ab..10f0eb85ab 100644 --- a/rpcs3/Emu/GDB.cpp +++ b/rpcs3/Emu/GDB.cpp @@ -1,10 +1,11 @@ -#include "stdafx.h" +#include "stdafx.h" #include "GDB.h" #include "Utilities/Log.h" #include "Utilities/StrUtil.h" #include "Emu/Memory/vm.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/IdManager.h" #include "Emu/CPU/CPUThread.h" #include "Emu/Cell/PPUThread.h" diff --git a/rpcs3/Emu/Io/Null/NullPadHandler.h b/rpcs3/Emu/Io/Null/NullPadHandler.h index 13c47b431c..895c2c7d8c 100644 --- a/rpcs3/Emu/Io/Null/NullPadHandler.h +++ b/rpcs3/Emu/Io/Null/NullPadHandler.h @@ -5,6 +5,8 @@ class NullPadHandler final : public PadHandlerBase { public: + NullPadHandler() : PadHandlerBase(pad_handler::null) {} + bool Init() override { return true; diff --git a/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp index 29a193bd0d..a6fd9fdfef 100644 --- a/rpcs3/Emu/Io/PadHandler.cpp +++ b/rpcs3/Emu/Io/PadHandler.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "PadHandler.h" +#include "Emu/System.h" #include "Input/pad_thread.h" cfg_input g_cfg_input; diff --git a/rpcs3/Emu/Io/PadHandler.h b/rpcs3/Emu/Io/PadHandler.h index cc66417f31..89d1126df5 100644 --- a/rpcs3/Emu/Io/PadHandler.h +++ b/rpcs3/Emu/Io/PadHandler.h @@ -1,12 +1,8 @@ #pragma once #include -#include -#include -#include "stdafx.h" -#include "Utilities/Config.h" +#include "pad_config.h" #include "Utilities/types.h" -#include "Emu/System.h" #include "Emu/GameInfo.h" // TODO: HLE info (constants, structs, etc.) should not be available here @@ -263,139 +259,6 @@ struct Pad } }; -struct cfg_player final : cfg::node -{ - pad_handler def_handler = pad_handler::null; - cfg_player(node* owner, const std::string& name, pad_handler type) : cfg::node(owner, name), def_handler(type) {} - - cfg::_enum handler{ this, "Handler", def_handler }; - cfg::string device{ this, "Device", handler.to_string() }; - cfg::string profile{ this, "Profile", "Default Profile" }; -}; - -struct cfg_input final : cfg::node -{ - std::string cfg_name = fs::get_config_dir() + "/config_input.yml"; - - cfg_player player1{ this, "Player 1 Input", pad_handler::keyboard }; - cfg_player player2{ this, "Player 2 Input", pad_handler::null }; - cfg_player player3{ this, "Player 3 Input", pad_handler::null }; - cfg_player player4{ this, "Player 4 Input", pad_handler::null }; - cfg_player player5{ this, "Player 5 Input", pad_handler::null }; - cfg_player player6{ this, "Player 6 Input", pad_handler::null }; - cfg_player player7{ this, "Player 7 Input", pad_handler::null }; - - cfg_player *player[7]{ &player1, &player2, &player3, &player4, &player5, &player6, &player7 }; // Thanks gcc! - - bool load(const std::string& title_id = "") - { - cfg_name = Emulator::GetCustomInputConfigPath(title_id); - - if (!fs::is_file(cfg_name)) - { - cfg_name = fs::get_config_dir() + "/config_input.yml"; - } - - if (fs::file cfg_file{cfg_name, fs::read}) - { - return from_string(cfg_file.to_string()); - } - return false; - } - - void save(const std::string& title_id = "") - { - if (title_id.empty()) - { - cfg_name = fs::get_config_dir() + "/config_input.yml"; - } - else - { - cfg_name = Emulator::GetCustomInputConfigPath(title_id); - } - fs::file(cfg_name, fs::rewrite).write(to_string()); - } -}; - -extern cfg_input g_cfg_input; - -struct pad_config final : cfg::node -{ - std::string cfg_name = ""; - - cfg::string ls_left { this, "Left Stick Left", "" }; - cfg::string ls_down { this, "Left Stick Down", "" }; - cfg::string ls_right{ this, "Left Stick Right", "" }; - cfg::string ls_up { this, "Left Stick Up", "" }; - cfg::string rs_left { this, "Right Stick Left", "" }; - cfg::string rs_down { this, "Right Stick Down", "" }; - cfg::string rs_right{ this, "Right Stick Right", "" }; - cfg::string rs_up { this, "Right Stick Up", "" }; - cfg::string start { this, "Start", "" }; - cfg::string select { this, "Select", "" }; - cfg::string ps { this, "PS Button", "" }; - cfg::string square { this, "Square", "" }; - cfg::string cross { this, "Cross", "" }; - cfg::string circle { this, "Circle", "" }; - cfg::string triangle{ this, "Triangle", "" }; - cfg::string left { this, "Left", "" }; - cfg::string down { this, "Down", "" }; - cfg::string right { this, "Right", "" }; - cfg::string up { this, "Up", "" }; - cfg::string r1 { this, "R1", "" }; - cfg::string r2 { this, "R2", "" }; - cfg::string r3 { this, "R3", "" }; - cfg::string l1 { this, "L1", "" }; - cfg::string l2 { this, "L2", "" }; - cfg::string l3 { this, "L3", "" }; - - cfg::_int<0, 200> lstickmultiplier{this, "Left Stick Multiplier", 100}; - cfg::_int<0, 200> rstickmultiplier{this, "Right Stick Multiplier", 100}; - cfg::_int<0, 1000000> lstickdeadzone{ this, "Left Stick Deadzone", 0 }; - cfg::_int<0, 1000000> rstickdeadzone{ this, "Right Stick Deadzone", 0 }; - cfg::_int<0, 1000000> ltriggerthreshold{ this, "Left Trigger Threshold", 0 }; - cfg::_int<0, 1000000> rtriggerthreshold{ this, "Right Trigger Threshold", 0 }; - cfg::_int<0, 1000000> padsquircling{ this, "Pad Squircling Factor", 0 }; - - cfg::_int<0, 255> colorR{ this, "Color Value R", 0 }; - cfg::_int<0, 255> colorG{ this, "Color Value G", 0 }; - cfg::_int<0, 255> colorB{ this, "Color Value B", 0 }; - - cfg::_bool enable_vibration_motor_large{ this, "Enable Large Vibration Motor", true }; - cfg::_bool enable_vibration_motor_small{ this, "Enable Small Vibration Motor", true }; - cfg::_bool switch_vibration_motors{ this, "Switch Vibration Motors", false }; - - cfg::_int<0, 255> mouse_deadzone_x{ this, "Mouse Deadzone X Axis", 60 }; - cfg::_int<0, 255> mouse_deadzone_y{ this, "Mouse Deadzone Y Axis", 60 }; - cfg::_int<0, 3000> mouse_acceleration_x{ this, "Mouse Acceleration X Axis", 200 }; - cfg::_int<0, 3000> mouse_acceleration_y{ this, "Mouse Acceleration Y Axis", 250 }; - - cfg::_int<0, 100> l_stick_lerp_factor{ this, "Left Stick Lerp Factor", 100 }; - cfg::_int<0, 100> r_stick_lerp_factor{ this, "Right Stick Lerp Factor", 100 }; - - cfg::_int<0, 5> device_class_type{ this, "Device Class Type", 0 }; - - bool load() - { - if (fs::file cfg_file{ cfg_name, fs::read }) - { - return from_string(cfg_file.to_string()); - } - - return false; - } - - void save() - { - fs::file(cfg_name, fs::rewrite).write(to_string()); - } - - bool exist() - { - return fs::is_file(cfg_name); - } -}; - struct PadDevice { pad_config* config{ nullptr }; @@ -521,7 +384,7 @@ public: s32 vibration_max = 255; u32 connected_devices = 0; - pad_handler m_type = pad_handler::null; + pad_handler m_type; std::string name_string(); size_t max_devices(); diff --git a/rpcs3/Emu/Io/pad_config.cpp b/rpcs3/Emu/Io/pad_config.cpp new file mode 100644 index 0000000000..5c356dedac --- /dev/null +++ b/rpcs3/Emu/Io/pad_config.cpp @@ -0,0 +1,53 @@ +#include "stdafx.h" +#include "pad_config.h" +#include "Emu/System.h" + +bool cfg_input::load(const std::string& title_id) +{ + cfg_name = Emulator::GetCustomInputConfigPath(title_id); + + if (!fs::is_file(cfg_name)) + { + cfg_name = fs::get_config_dir() + "/config_input.yml"; + } + + if (fs::file cfg_file{ cfg_name, fs::read }) + { + return from_string(cfg_file.to_string()); + } + return false; +} + +void cfg_input::save(const std::string& title_id) +{ + if (title_id.empty()) + { + cfg_name = fs::get_config_dir() + "/config_input.yml"; + } + else + { + cfg_name = Emulator::GetCustomInputConfigPath(title_id); + } + fs::file(cfg_name, fs::rewrite).write(to_string()); +} + + +bool pad_config::exist() +{ + return fs::is_file(cfg_name); +} + +bool pad_config::load() +{ + if (fs::file cfg_file{ cfg_name, fs::read }) + { + return from_string(cfg_file.to_string()); + } + + return false; +} + +void pad_config::save() +{ + fs::file(cfg_name, fs::rewrite).write(to_string()); +} diff --git a/rpcs3/Emu/Io/pad_config.h b/rpcs3/Emu/Io/pad_config.h new file mode 100644 index 0000000000..96434a18a7 --- /dev/null +++ b/rpcs3/Emu/Io/pad_config.h @@ -0,0 +1,110 @@ +#pragma once + +#include "Utilities/Config.h" +#include "Utilities/File.h" + +enum class pad_handler +{ + null, + keyboard, + ds3, + ds4, +#ifdef _WIN32 + xinput, + mm, +#endif +#ifdef HAVE_LIBEVDEV + evdev, +#endif +}; + +struct cfg_player final : cfg::node +{ + pad_handler def_handler = pad_handler::null; + cfg_player(node* owner, const std::string& name, pad_handler type) : cfg::node(owner, name), def_handler(type) {} + + cfg::_enum handler{ this, "Handler", def_handler }; + cfg::string device{ this, "Device", handler.to_string() }; + cfg::string profile{ this, "Profile", "Default Profile" }; +}; + +struct cfg_input final : cfg::node +{ + std::string cfg_name = fs::get_config_dir() + "/config_input.yml"; + + cfg_player player1{ this, "Player 1 Input", pad_handler::keyboard }; + cfg_player player2{ this, "Player 2 Input", pad_handler::null }; + cfg_player player3{ this, "Player 3 Input", pad_handler::null }; + cfg_player player4{ this, "Player 4 Input", pad_handler::null }; + cfg_player player5{ this, "Player 5 Input", pad_handler::null }; + cfg_player player6{ this, "Player 6 Input", pad_handler::null }; + cfg_player player7{ this, "Player 7 Input", pad_handler::null }; + + cfg_player* player[7]{ &player1, &player2, &player3, &player4, &player5, &player6, &player7 }; // Thanks gcc! + + bool load(const std::string& title_id = ""); + void save(const std::string& title_id = ""); +}; + +struct pad_config final : cfg::node +{ + std::string cfg_name = ""; + + cfg::string ls_left{ this, "Left Stick Left", "" }; + cfg::string ls_down{ this, "Left Stick Down", "" }; + cfg::string ls_right{ this, "Left Stick Right", "" }; + cfg::string ls_up{ this, "Left Stick Up", "" }; + cfg::string rs_left{ this, "Right Stick Left", "" }; + cfg::string rs_down{ this, "Right Stick Down", "" }; + cfg::string rs_right{ this, "Right Stick Right", "" }; + cfg::string rs_up{ this, "Right Stick Up", "" }; + cfg::string start{ this, "Start", "" }; + cfg::string select{ this, "Select", "" }; + cfg::string ps{ this, "PS Button", "" }; + cfg::string square{ this, "Square", "" }; + cfg::string cross{ this, "Cross", "" }; + cfg::string circle{ this, "Circle", "" }; + cfg::string triangle{ this, "Triangle", "" }; + cfg::string left{ this, "Left", "" }; + cfg::string down{ this, "Down", "" }; + cfg::string right{ this, "Right", "" }; + cfg::string up{ this, "Up", "" }; + cfg::string r1{ this, "R1", "" }; + cfg::string r2{ this, "R2", "" }; + cfg::string r3{ this, "R3", "" }; + cfg::string l1{ this, "L1", "" }; + cfg::string l2{ this, "L2", "" }; + cfg::string l3{ this, "L3", "" }; + + cfg::_int<0, 200> lstickmultiplier{ this, "Left Stick Multiplier", 100 }; + cfg::_int<0, 200> rstickmultiplier{ this, "Right Stick Multiplier", 100 }; + cfg::_int<0, 1000000> lstickdeadzone{ this, "Left Stick Deadzone", 0 }; + cfg::_int<0, 1000000> rstickdeadzone{ this, "Right Stick Deadzone", 0 }; + cfg::_int<0, 1000000> ltriggerthreshold{ this, "Left Trigger Threshold", 0 }; + cfg::_int<0, 1000000> rtriggerthreshold{ this, "Right Trigger Threshold", 0 }; + cfg::_int<0, 1000000> padsquircling{ this, "Pad Squircling Factor", 0 }; + + cfg::_int<0, 255> colorR{ this, "Color Value R", 0 }; + cfg::_int<0, 255> colorG{ this, "Color Value G", 0 }; + cfg::_int<0, 255> colorB{ this, "Color Value B", 0 }; + + cfg::_bool enable_vibration_motor_large{ this, "Enable Large Vibration Motor", true }; + cfg::_bool enable_vibration_motor_small{ this, "Enable Small Vibration Motor", true }; + cfg::_bool switch_vibration_motors{ this, "Switch Vibration Motors", false }; + + cfg::_int<0, 255> mouse_deadzone_x{ this, "Mouse Deadzone X Axis", 60 }; + cfg::_int<0, 255> mouse_deadzone_y{ this, "Mouse Deadzone Y Axis", 60 }; + cfg::_int<0, 3000> mouse_acceleration_x{ this, "Mouse Acceleration X Axis", 200 }; + cfg::_int<0, 3000> mouse_acceleration_y{ this, "Mouse Acceleration Y Axis", 250 }; + + cfg::_int<0, 100> l_stick_lerp_factor{ this, "Left Stick Lerp Factor", 100 }; + cfg::_int<0, 100> r_stick_lerp_factor{ this, "Right Stick Lerp Factor", 100 }; + + cfg::_int<0, 5> device_class_type{ this, "Device Class Type", 0 }; + + bool exist(); + bool load(); + void save(); +}; + +extern cfg_input g_cfg_input; diff --git a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp index 9f67a840c3..0208c13294 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp +++ b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp @@ -1,10 +1,8 @@ #include "stdafx.h" #include "rsx_replay.h" -#include "Emu/System.h" #include "Emu/Cell/lv2/sys_rsx.h" #include "Emu/Cell/lv2/sys_memory.h" -#include "Emu/Memory/vm.h" #include "Emu/RSX/GSRender.h" #include diff --git a/rpcs3/Emu/RSX/Capture/rsx_replay.h b/rpcs3/Emu/RSX/Capture/rsx_replay.h index d0c704a590..104e12c18c 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_replay.h +++ b/rpcs3/Emu/RSX/Capture/rsx_replay.h @@ -1,7 +1,5 @@ -#pragma once +#pragma once -#include "Emu/System.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_sync.h" #include "Emu/RSX/rsx_methods.h" diff --git a/rpcs3/Emu/RSX/CgBinaryFragmentProgram.cpp b/rpcs3/Emu/RSX/CgBinaryFragmentProgram.cpp index 77820cf338..be65ee68af 100644 --- a/rpcs3/Emu/RSX/CgBinaryFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/CgBinaryFragmentProgram.cpp @@ -1,7 +1,6 @@ -#include "stdafx.h" +#include "stdafx.h" #include "CgBinaryProgram.h" -#include "Emu/System.h" #include "Emu/RSX/RSXFragmentProgram.h" #include diff --git a/rpcs3/Emu/RSX/CgBinaryVertexProgram.cpp b/rpcs3/Emu/RSX/CgBinaryVertexProgram.cpp index 643c36e33b..2d2ad61a33 100644 --- a/rpcs3/Emu/RSX/CgBinaryVertexProgram.cpp +++ b/rpcs3/Emu/RSX/CgBinaryVertexProgram.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "CgBinaryProgram.h" #include "Emu/System.h" diff --git a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp index 8c9e3a2b01..d4d35614d5 100644 --- a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" #include "Emu/System.h" #include "../rsx_methods.h" diff --git a/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp b/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp index 8eb36e08f1..5a157cacd7 100644 --- a/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp +++ b/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "ProgramStateCache.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index c3f7e32c2d..8657e07bd6 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -1,7 +1,6 @@ #pragma once #include "texture_cache_predictor.h" -#include "texture_cache_utils.h" #include "texture_cache_helpers.h" #include diff --git a/rpcs3/Emu/RSX/Common/texture_cache_utils.h b/rpcs3/Emu/RSX/Common/texture_cache_utils.h index 38f98255a2..6b854e50c7 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_utils.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_utils.h @@ -41,7 +41,8 @@ namespace rsx flush_once = 1 }; - struct invalidation_cause { + struct invalidation_cause + { enum enum_type { invalid = 0, diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 13c34e084b..e45cc6cb83 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "GLGSRender.h" #include "GLCompute.h" #include "GLVertexProgram.h" diff --git a/rpcs3/Emu/RSX/GL/GLHelpers.h b/rpcs3/Emu/RSX/GL/GLHelpers.h index 5930a62f92..4ce8aa9cba 100644 --- a/rpcs3/Emu/RSX/GL/GLHelpers.h +++ b/rpcs3/Emu/RSX/GL/GLHelpers.h @@ -12,7 +12,7 @@ #include "../GCM.h" #include "../Common/TextureUtils.h" -#include "Emu/System.h" +#include "Emu/system_config.h" #include "Utilities/geometry.h" #include "Utilities/Log.h" diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp index f03ee9d348..94f0952bf5 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" #include "GLGSRender.h" -#include "Emu/System.h" color_format rsx::internals::surface_color_format_to_gl(rsx::surface_color_format color_format) { diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index b2d1d83174..385a26393d 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -12,7 +12,6 @@ #include #include "Utilities/mutex.h" -#include "Emu/System.h" #include "GLRenderTargets.h" #include "GLOverlays.h" #include "GLTexture.h" diff --git a/rpcs3/Emu/RSX/GSRender.cpp b/rpcs3/Emu/RSX/GSRender.cpp index 77bf2b2e6c..a99bf949ee 100644 --- a/rpcs3/Emu/RSX/GSRender.cpp +++ b/rpcs3/Emu/RSX/GSRender.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "GSRender.h" diff --git a/rpcs3/Emu/RSX/Null/NullGSRender.cpp b/rpcs3/Emu/RSX/Null/NullGSRender.cpp index e3dcec47fd..c32e563861 100644 --- a/rpcs3/Emu/RSX/Null/NullGSRender.cpp +++ b/rpcs3/Emu/RSX/Null/NullGSRender.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" #include "NullGSRender.h" -#include "Emu/System.h" u64 NullGSRender::get_cycles() { diff --git a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp index 57b5a51f2e..daa8c576f4 100644 --- a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "shader_loading_dialog.h" +#include "Emu/System.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 5a49ae1b39..4bb22ee22c 100644 --- a/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h @@ -1,6 +1,5 @@ #pragma once -#include "Emu/System.h" #include "Emu/Cell/Modules/cellMsgDialog.h" namespace rsx diff --git a/rpcs3/Emu/RSX/Overlays/overlay_animation.cpp b/rpcs3/Emu/RSX/Overlays/overlay_animation.cpp index 7c361e4519..f44e0bea55 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_animation.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_animation.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "overlay_animation.h" #include "overlay_controls.h" +#include "Emu/system_config.h" #include diff --git a/rpcs3/Emu/RSX/Overlays/overlay_controls.h b/rpcs3/Emu/RSX/Overlays/overlay_controls.h index d4eda1c5cf..93fc9487cf 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_controls.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_controls.h @@ -3,7 +3,6 @@ #include "Utilities/geometry.h" #include "Utilities/File.h" #include "overlay_utils.h" -#include "Emu/System.h" #include #include diff --git a/rpcs3/Emu/RSX/Overlays/overlay_font.cpp b/rpcs3/Emu/RSX/Overlays/overlay_font.cpp index 4576a2bad3..803c49634f 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_font.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_font.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "overlay_controls.h" +#include "Emu/system_config.h" namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp b/rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp index 79a7d46024..accd474e35 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "overlay_controls.h" +#include "Emu/system_config.h" namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp index 64f8f52fc5..75e6e3abbd 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp @@ -1,5 +1,7 @@ #include "stdafx.h" #include "overlays.h" +#include "Emu/System.h" +#include "Emu/system_config.h" namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h index 77c1aae91f..4ebe28f4ea 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h @@ -1,6 +1,7 @@ #pragma once #include "overlays.h" +#include "Emu/system_config_types.h" namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp b/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp index 9a8d08921c..282c91bbdf 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "overlays.h" +#include "Emu/system_config.h" namespace rsx { diff --git a/rpcs3/Emu/RSX/RSXOffload.cpp b/rpcs3/Emu/RSX/RSXOffload.cpp index b22aeba572..e9f8465060 100644 --- a/rpcs3/Emu/RSX/RSXOffload.cpp +++ b/rpcs3/Emu/RSX/RSXOffload.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "Common/BufferUtils.h" -#include "Emu/System.h" #include "RSXOffload.h" #include "RSXThread.h" #include "rsx_utils.h" diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index e1dacba5ba..7e7425f96c 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -1,7 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" #include "RSXThread.h" #include "Emu/Cell/PPUCallback.h" diff --git a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp index d4121b6475..5e1a307fe4 100644 --- a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "VKFragmentProgram.h" #include "VKCommonDecompiler.h" #include "VKHelpers.h" diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index a990b92784..99bed151f0 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "VKGSRender.h" #include "../Overlays/Shaders/shader_loading_dialog_native.h" #include "../rsx_methods.h" diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index 87e0025bbe..89902d16fe 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -16,7 +16,6 @@ #endif #include "Emu/RSX/GSRender.h" -#include "Emu/System.h" #include "VulkanAPI.h" #include "VKCommonDecompiler.h" #include "../GCM.h" diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index e0c8b80e10..f1959640bc 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -5,7 +5,6 @@ #include "VKCompute.h" #include "VKResourceManager.h" #include "VKDMA.h" -#include "Emu/System.h" #include "../Common/TextureUtils.h" #include "Utilities/mutex.h" #include "../Common/texture_cache.h" diff --git a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp index 9cba6765b9..8b8189b545 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "VKGSRender.h" #include "../rsx_methods.h" #include "../Common/BufferUtils.h" diff --git a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp index 2c4417a92d..db4482e679 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" -#include "Emu/System.h" #include "VKVertexProgram.h" #include "VKCommonDecompiler.h" diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 90c55d34fc..22d41e678c 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -2,12 +2,10 @@ #include "rsx_methods.h" #include "RSXThread.h" #include "Emu/Memory/vm_reservation.h" -#include "Emu/System.h" #include "rsx_utils.h" #include "rsx_decode.h" #include "Emu/Cell/PPUCallback.h" #include "Emu/Cell/lv2/sys_rsx.h" -#include "Capture/rsx_capture.h" #include #include diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index 7ffa54e801..1c0e886003 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -1,6 +1,6 @@ #pragma once -#include "../System.h" +#include "../system_config.h" #include "Utilities/address_range.h" #include "Utilities/geometry.h" #include "Utilities/asm.h" diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 831369ca9d..338d24a4a0 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "VFS.h" #include "Utilities/bin_patch.h" #include "Emu/Memory/vm.h" #include "Emu/System.h" @@ -53,8 +54,6 @@ LOG_CHANNEL(sys_log, "SYS"); stx::manual_fixed_typemap g_fixed_typemap; -cfg_root g_cfg; - bool g_use_rtm; std::string g_cfg_defaults; @@ -226,7 +225,7 @@ void fmt_class_string::format(std::string& out, u64 arg) } template <> -inline void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format(std::string& out, u64 arg) { format_enum(out, arg, [](detail_level value) { @@ -243,7 +242,7 @@ inline void fmt_class_string::format(std::string& out, u64 arg) } template <> -inline void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format(std::string& out, u64 arg) { format_enum(out, arg, [](screen_quadrant value) { @@ -1878,20 +1877,6 @@ std::string Emulator::GetFormattedTitle(double fps) const return rpcs3::get_formatted_title(title_data); } -std::string cfg_root::node_vfs::get(const cfg::string& _cfg, const char* _def) const -{ - auto [spath, sshared] = _cfg.get(); - - if (spath.empty()) - { - return fs::get_config_dir() + _def; - } - - auto [semudir, sshared2] = emulator_dir.get(); - - return fmt::replace_all(spath, "$(EmulatorDir)", semudir.empty() ? fs::get_config_dir() : semudir); -} - s32 error_code::error_report(const fmt_type_info* sup, u64 arg, const fmt_type_info* sup2, u64 arg2) { static thread_local std::unordered_map g_tls_error_stats; diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index f12414c027..26bbb1e096 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -1,8 +1,6 @@ #pragma once -#include "VFS.h" -#include "util/atomic.hpp" -#include "Utilities/Config.h" +#include "stdafx.h" #include #include #include @@ -18,193 +16,6 @@ enum class system_state ready, }; -enum class ppu_decoder_type -{ - precise, - fast, - llvm, -}; - -enum class spu_decoder_type -{ - precise, - fast, - asmjit, - llvm, -}; - -enum class spu_block_size_type -{ - safe, - mega, - giga, -}; - -enum class lib_loading_type -{ - manual, - hybrid, - liblv2only, - liblv2both, - liblv2list, -}; - -enum sleep_timers_accuracy_level : u32 -{ - _as_host = 0, - _usleep, - _all_timers, -}; - -enum class keyboard_handler -{ - null, - basic, -}; - -enum class mouse_handler -{ - null, - basic, -}; - -enum class pad_handler -{ - null, - keyboard, - ds3, - ds4, -#ifdef _WIN32 - xinput, - mm, -#endif -#ifdef HAVE_LIBEVDEV - evdev, -#endif -}; - -enum class video_renderer -{ - null, - opengl, - vulkan, -}; - -enum class audio_renderer -{ - null, -#ifdef _WIN32 - xaudio, -#endif -#ifdef HAVE_ALSA - alsa, -#endif - openal, -#ifdef HAVE_PULSE - pulse, -#endif -#ifdef HAVE_FAUDIO - faudio, -#endif -}; - -enum class camera_handler -{ - null, - fake, -}; - -enum class fake_camera_type -{ - unknown, - eyetoy, - eyetoy2, - uvc1_1, -}; - -enum class move_handler -{ - null, - fake, - mouse, -}; - -enum class microphone_handler -{ - null, - standard, - singstar, - real_singstar, - rocksmith, -}; - -enum class video_resolution -{ - _1080, - _720, - _480, - _576, - _1600x1080, - _1440x1080, - _1280x1080, - _960x1080, -}; - -enum class video_aspect -{ - _4_3, - _16_9, -}; - -enum class frame_limit_type -{ - none, - _59_94, - _50, - _60, - _30, - _auto, -}; - -enum class msaa_level -{ - none, - _auto -}; - -enum class detail_level -{ - minimal, - low, - medium, - high, -}; - -enum class screen_quadrant -{ - top_left, - top_right, - bottom_left, - bottom_right -}; - -enum class tsx_usage -{ - disabled, - enabled, - forced, -}; - -enum enter_button_assign -{ - circle = 0, // CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CIRCLE - cross = 1 // CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CROSS -}; - -enum CellNetCtlState : s32; -enum CellSysutilLang : s32; -enum CellKbMappingType : s32; - struct EmuCallbacks { std::function)> call_after; @@ -383,259 +194,4 @@ public: extern Emulator Emu; -struct cfg_root : cfg::node -{ - struct node_core : cfg::node - { - static constexpr bool thread_scheduler_enabled_def = -#ifdef _WIN32 - true; -#else - false; -#endif - - node_core(cfg::node* _this) : cfg::node(_this, "Core") {} - - cfg::_enum ppu_decoder{this, "PPU Decoder", ppu_decoder_type::llvm}; - cfg::_int<1, 8> ppu_threads{this, "PPU Threads", 2}; // Amount of PPU threads running simultaneously (must be 2) - cfg::_bool ppu_debug{this, "PPU Debug"}; - cfg::_bool llvm_logs{this, "Save LLVM logs"}; - cfg::string llvm_cpu{this, "Use LLVM CPU"}; - cfg::_int<0, INT32_MAX> llvm_threads{this, "Max LLVM Compile Threads", 0}; - cfg::_bool thread_scheduler_enabled{this, "Enable thread scheduler", thread_scheduler_enabled_def}; - cfg::_bool set_daz_and_ftz{this, "Set DAZ and FTZ", false}; - cfg::_enum spu_decoder{this, "SPU Decoder", spu_decoder_type::llvm}; - cfg::_bool lower_spu_priority{this, "Lower SPU thread priority"}; - cfg::_bool spu_debug{this, "SPU Debug"}; - cfg::_int<0, 6> preferred_spu_threads{this, "Preferred SPU Threads", 0, true}; //Numnber of hardware threads dedicated to heavy simultaneous spu tasks - cfg::_int<0, 16> spu_delay_penalty{this, "SPU delay penalty", 3}; //Number of milliseconds to block a thread if a virtual 'core' isn't free - cfg::_bool spu_loop_detection{this, "SPU loop detection", true}; //Try to detect wait loops and trigger thread yield - cfg::_int<0, 6> max_spurs_threads{this, "Max SPURS Threads", 6}; // HACK. If less then 6, max number of running SPURS threads in each thread group. - cfg::_enum spu_block_size{this, "SPU Block Size", spu_block_size_type::safe}; - cfg::_bool spu_accurate_getllar{this, "Accurate GETLLAR", false}; - cfg::_bool spu_accurate_putlluc{this, "Accurate PUTLLUC", false}; - cfg::_bool spu_verification{this, "SPU Verification", true}; // Should be enabled - cfg::_bool spu_cache{this, "SPU Cache", true}; - cfg::_bool spu_prof{this, "SPU Profiler", false}; - cfg::_enum enable_TSX{this, "Enable TSX", tsx_usage::enabled}; // Enable TSX. Forcing this on Haswell/Broadwell CPUs should be used carefully - cfg::_bool spu_accurate_xfloat{this, "Accurate xfloat", false}; - cfg::_bool spu_approx_xfloat{this, "Approximate xfloat", true}; - - cfg::_bool debug_console_mode{this, "Debug Console Mode", false}; // Debug console emulation, not recommended - cfg::_enum lib_loading{this, "Lib Loader", lib_loading_type::liblv2only}; - cfg::_bool hook_functions{this, "Hook static functions"}; - cfg::set_entry load_libraries{this, "Load libraries"}; - cfg::_bool hle_lwmutex{this, "HLE lwmutex"}; // Force alternative lwmutex/lwcond implementation - - cfg::_int<10, 3000> clocks_scale{this, "Clocks scale", 100, true}; // Changing this from 100 (percentage) may affect game speed in unexpected ways - cfg::_enum sleep_timers_accuracy{this, "Sleep Timers Accuracy", -#ifdef __linux__ - sleep_timers_accuracy_level::_as_host, true}; -#else - sleep_timers_accuracy_level::_usleep, true}; -#endif - } core{this}; - - struct node_vfs : cfg::node - { - node_vfs(cfg::node* _this) : cfg::node(_this, "VFS") {} - - std::string get(const cfg::string&, const char*) const; - - cfg::string emulator_dir{this, "$(EmulatorDir)"}; // Default (empty): taken from fs::get_config_dir() - cfg::string dev_hdd0{this, "/dev_hdd0/", "$(EmulatorDir)dev_hdd0/"}; - cfg::string dev_hdd1{this, "/dev_hdd1/", "$(EmulatorDir)dev_hdd1/"}; - cfg::string dev_flash{this, "/dev_flash/"}; - cfg::string dev_usb000{this, "/dev_usb000/", "$(EmulatorDir)dev_usb000/"}; - cfg::string dev_bdvd{this, "/dev_bdvd/"}; // Not mounted - cfg::string app_home{this, "/app_home/"}; // Not mounted - - std::string get_dev_flash() const - { - return get(dev_flash, "dev_flash/"); - } - - cfg::_bool host_root{this, "Enable /host_root/"}; - cfg::_bool init_dirs{this, "Initialize Directories", true}; - - cfg::_bool limit_cache_size{this, "Limit disk cache size", false}; - cfg::_int<0, 10240> cache_max_size{this, "Disk cache maximum size (MB)", 5120}; - - } vfs{this}; - - struct node_video : cfg::node - { - node_video(cfg::node* _this) : cfg::node(_this, "Video") {} - - cfg::_enum renderer{this, "Renderer", video_renderer::opengl}; - - cfg::_enum resolution{this, "Resolution", video_resolution::_720}; - cfg::_enum aspect_ratio{this, "Aspect ratio", video_aspect::_16_9}; - cfg::_enum frame_limit{this, "Frame limit", frame_limit_type::none}; - cfg::_enum antialiasing_level{this, "MSAA", msaa_level::_auto}; - - cfg::_bool write_color_buffers{this, "Write Color Buffers"}; - cfg::_bool write_depth_buffer{this, "Write Depth Buffer"}; - cfg::_bool read_color_buffers{this, "Read Color Buffers"}; - cfg::_bool read_depth_buffer{this, "Read Depth Buffer"}; - cfg::_bool log_programs{this, "Log shader programs"}; - cfg::_bool vsync{this, "VSync"}; - cfg::_bool debug_output{this, "Debug output"}; - cfg::_bool overlay{this, "Debug overlay"}; - cfg::_bool gl_legacy_buffers{this, "Use Legacy OpenGL Buffers"}; - cfg::_bool use_gpu_texture_scaling{this, "Use GPU texture scaling", false}; - cfg::_bool stretch_to_display_area{this, "Stretch To Display Area"}; - cfg::_bool force_high_precision_z_buffer{this, "Force High Precision Z buffer"}; - cfg::_bool strict_rendering_mode{this, "Strict Rendering Mode"}; - cfg::_bool disable_zcull_queries{this, "Disable ZCull Occlusion Queries", false}; - cfg::_bool disable_vertex_cache{this, "Disable Vertex Cache", false}; - cfg::_bool disable_FIFO_reordering{this, "Disable FIFO Reordering", false}; - cfg::_bool frame_skip_enabled{this, "Enable Frame Skip", false}; - cfg::_bool force_cpu_blit_processing{this, "Force CPU Blit", false}; // Debugging option - cfg::_bool disable_on_disk_shader_cache{this, "Disable On-Disk Shader Cache", false}; - cfg::_bool disable_vulkan_mem_allocator{this, "Disable Vulkan Memory Allocator", false}; - cfg::_bool full_rgb_range_output{this, "Use full RGB output range", true}; // Video out dynamic range - cfg::_bool disable_asynchronous_shader_compiler{this, "Disable Asynchronous Shader Compiler", false}; - cfg::_bool strict_texture_flushing{this, "Strict Texture Flushing", false}; - cfg::_bool disable_native_float16{this, "Disable native float16 support", false}; - cfg::_bool multithreaded_rsx{this, "Multithreaded RSX", false}; - cfg::_bool relaxed_zcull_sync{this, "Relaxed ZCULL Sync", false}; - cfg::_int<1, 8> consequtive_frames_to_draw{this, "Consecutive Frames To Draw", 1}; - cfg::_int<1, 8> consequtive_frames_to_skip{this, "Consecutive Frames To Skip", 1}; - cfg::_int<50, 800> resolution_scale_percent{this, "Resolution Scale", 100}; - cfg::_int<0, 16> anisotropic_level_override{this, "Anisotropic Filter Override", 0}; - cfg::_int<1, 1024> min_scalable_dimension{this, "Minimum Scalable Dimension", 16}; - cfg::_int<0, 30000000> driver_recovery_timeout{this, "Driver Recovery Timeout", 1000000, true}; - cfg::_int<0, 16667> driver_wakeup_delay{this, "Driver Wake-Up Delay", 1, true}; - cfg::_int<1, 1800> vblank_rate{this, "Vblank Rate", 60, true}; // Changing this from 60 may affect game speed in unexpected ways - - struct node_vk : cfg::node - { - node_vk(cfg::node* _this) : cfg::node(_this, "Vulkan") {} - - cfg::string adapter{this, "Adapter"}; - cfg::_bool force_fifo{this, "Force FIFO present mode"}; - cfg::_bool force_primitive_restart{this, "Force primitive restart flag"}; - - } vk{this}; - - struct node_perf_overlay : cfg::node - { - node_perf_overlay(cfg::node* _this) : cfg::node(_this, "Performance Overlay") {} - - cfg::_bool perf_overlay_enabled{ this, "Enabled", false, true }; - cfg::_bool framerate_graph_enabled{ this, "Enable Framerate Graph", false, true }; - cfg::_bool frametime_graph_enabled{ this, "Enable Frametime Graph", false, true }; - cfg::_enum level{ this, "Detail level", detail_level::medium, true }; - cfg::_int<30, 5000> update_interval{ this, "Metrics update interval (ms)", 350, true }; - cfg::_int<4, 36> font_size{ this, "Font size (px)", 10, true }; - cfg::_enum position{ this, "Position", screen_quadrant::top_left, true }; - cfg::string font{ this, "Font", "n023055ms.ttf", true }; - cfg::_int<0, 1280> margin_x{ this, "Horizontal Margin (px)", 50, true }; // horizontal distance to the screen border relative to the screen_quadrant in px - cfg::_int<0, 720> margin_y{ this, "Vertical Margin (px)", 50, true }; // vertical distance to the screen border relative to the screen_quadrant in px - cfg::_bool center_x{ this, "Center Horizontally", false, true }; - cfg::_bool center_y{ this, "Center Vertically", false, true }; - cfg::_int<0, 100> opacity{ this, "Opacity (%)", 70, true }; - cfg::string color_body{ this, "Body Color (hex)", "#FFE138FF", true }; - cfg::string background_body{ this, "Body Background (hex)", "#002339FF", true }; - cfg::string color_title{ this, "Title Color (hex)", "#F26C24FF", true }; - cfg::string background_title{ this, "Title Background (hex)", "#00000000", true }; - - } perf_overlay{this}; - - struct node_shader_compilation_hint : cfg::node - { - node_shader_compilation_hint(cfg::node* _this) : cfg::node(_this, "Shader Compilation Hint") {} - - cfg::_int<0, 1280> pos_x{ this, "Position X (px)", 20, true }; // horizontal position starting from the upper border in px - cfg::_int<0, 720> pos_y{ this, "Position Y (px)", 690, true }; // vertical position starting from the left border in px - - } shader_compilation_hint{this}; - - struct node_shader_preloading_dialog : cfg::node - { - node_shader_preloading_dialog(cfg::node* _this) : cfg::node(_this, "Shader Loading Dialog"){} - - cfg::_bool use_custom_background{ this, "Allow custom background", true, true }; - cfg::_int<0, 100> darkening_strength{ this, "Darkening effect strength", 30, true }; - cfg::_int<0, 100> blur_strength{ this, "Blur effect strength", 0, true }; - - } shader_preloading_dialog{this}; - - } video{this}; - - struct node_audio : cfg::node - { - node_audio(cfg::node* _this) : cfg::node(_this, "Audio") {} - - cfg::_enum renderer{this, "Renderer", static_cast(1)}; - - cfg::_bool dump_to_file{this, "Dump to file"}; - cfg::_bool convert_to_u16{this, "Convert to 16 bit"}; - cfg::_bool downmix_to_2ch{this, "Downmix to Stereo", true}; - cfg::_int<1, 128> startt{this, "Start Threshold", 1}; // TODO: used only by ALSA, should probably be removed once ALSA is upgraded - cfg::_int<0, 200> volume{this, "Master Volume", 100}; - cfg::_bool enable_buffering{this, "Enable Buffering", true}; - cfg::_int <20, 250> desired_buffer_duration{this, "Desired Audio Buffer Duration", 100}; - cfg::_int<1, 1000> sampling_period_multiplier{this, "Sampling Period Multiplier", 100}; - cfg::_bool enable_time_stretching{this, "Enable Time Stretching", false}; - cfg::_int<0, 100> time_stretching_threshold{this, "Time Stretching Threshold", 75}; - cfg::_enum microphone_type{ this, "Microphone Type", microphone_handler::null }; - cfg::string microphone_devices{ this, "Microphone Devices", ";;;;" }; - } audio{this}; - - struct node_io : cfg::node - { - node_io(cfg::node* _this) : cfg::node(_this, "Input/Output") {} - - cfg::_enum keyboard{this, "Keyboard", keyboard_handler::null}; - cfg::_enum mouse{this, "Mouse", mouse_handler::basic}; - cfg::_enum camera{this, "Camera", camera_handler::null}; - cfg::_enum camera_type{this, "Camera type", fake_camera_type::unknown}; - cfg::_enum move{this, "Move", move_handler::null}; - } io{this}; - - struct node_sys : cfg::node - { - node_sys(cfg::node* _this) : cfg::node(_this, "System") {} - - cfg::_enum language{this, "Language", CellSysutilLang{1}}; // CELL_SYSUTIL_LANG_ENGLISH_US - cfg::_enum keyboard_type{this, "Keyboard Type", CellKbMappingType{0}}; // CELL_KB_MAPPING_101 = US - cfg::_enum enter_button_assignment{this, "Enter button assignment", enter_button_assign::cross}; - - } sys{this}; - - struct node_net : cfg::node - { - node_net(cfg::node* _this) : cfg::node(_this, "Net") {} - - cfg::_enum net_status{this, "Connection status"}; - cfg::string ip_address{this, "IP address", "192.168.1.1"}; - - } net{this}; - - struct node_misc : cfg::node - { - node_misc(cfg::node* _this) : cfg::node(_this, "Miscellaneous") {} - - cfg::_bool autostart{ this, "Automatically start games after boot", true, true }; - cfg::_bool autoexit{ this, "Exit RPCS3 when process finishes", false, true }; - cfg::_bool start_fullscreen{ this, "Start games in fullscreen mode", false, true }; - cfg::_bool prevent_display_sleep{ this, "Prevent display sleep while running games", true}; - cfg::_bool show_trophy_popups{ this, "Show trophy popups", true, true }; - cfg::_bool show_shader_compilation_hint{ this, "Show shader compilation hint", true, true }; - cfg::_bool use_native_interface{ this, "Use native user interface", true }; - cfg::string gdb_server{this, "GDB Server", "127.0.0.1:2345"}; - cfg::_bool silence_all_logs{this, "Silence All Logs", false, false}; - cfg::string title_format{this, "Window Title Format", "FPS: %F | %R | %V | %T [%t]", true}; - - } misc{this}; - - cfg::log_entry log{this, "Log"}; - - std::string name; -}; - -extern cfg_root g_cfg; - extern bool g_use_rtm; diff --git a/rpcs3/Emu/system_config.cpp b/rpcs3/Emu/system_config.cpp new file mode 100644 index 0000000000..1136989d31 --- /dev/null +++ b/rpcs3/Emu/system_config.cpp @@ -0,0 +1,19 @@ +#include "stdafx.h" +#include "system_config.h" +#include "Utilities/StrUtil.h" + +cfg_root g_cfg; + +std::string cfg_root::node_vfs::get(const cfg::string& _cfg, const char* _def) const +{ + auto [spath, sshared] = _cfg.get(); + + if (spath.empty()) + { + return fs::get_config_dir() + _def; + } + + auto [semudir, sshared2] = emulator_dir.get(); + + return fmt::replace_all(spath, "$(EmulatorDir)", semudir.empty() ? fs::get_config_dir() : semudir); +} diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h new file mode 100644 index 0000000000..40d5bc9929 --- /dev/null +++ b/rpcs3/Emu/system_config.h @@ -0,0 +1,263 @@ +#pragma once + +#include "system_config_types.h" +#include "Utilities/Config.h" + +enum CellNetCtlState : s32; +enum CellSysutilLang : s32; +enum CellKbMappingType : s32; + +struct cfg_root : cfg::node +{ + struct node_core : cfg::node + { + static constexpr bool thread_scheduler_enabled_def = +#ifdef _WIN32 + true; +#else + false; +#endif + + node_core(cfg::node* _this) : cfg::node(_this, "Core") {} + + cfg::_enum ppu_decoder{ this, "PPU Decoder", ppu_decoder_type::llvm }; + cfg::_int<1, 8> ppu_threads{ this, "PPU Threads", 2 }; // Amount of PPU threads running simultaneously (must be 2) + cfg::_bool ppu_debug{ this, "PPU Debug" }; + cfg::_bool llvm_logs{ this, "Save LLVM logs" }; + cfg::string llvm_cpu{ this, "Use LLVM CPU" }; + cfg::_int<0, INT32_MAX> llvm_threads{ this, "Max LLVM Compile Threads", 0 }; + cfg::_bool thread_scheduler_enabled{ this, "Enable thread scheduler", thread_scheduler_enabled_def }; + cfg::_bool set_daz_and_ftz{ this, "Set DAZ and FTZ", false }; + cfg::_enum spu_decoder{ this, "SPU Decoder", spu_decoder_type::llvm }; + cfg::_bool lower_spu_priority{ this, "Lower SPU thread priority" }; + cfg::_bool spu_debug{ this, "SPU Debug" }; + cfg::_int<0, 6> preferred_spu_threads{ this, "Preferred SPU Threads", 0, true }; // Number of hardware threads dedicated to heavy simultaneous spu tasks + cfg::_int<0, 16> spu_delay_penalty{ this, "SPU delay penalty", 3 }; // Number of milliseconds to block a thread if a virtual 'core' isn't free + cfg::_bool spu_loop_detection{ this, "SPU loop detection", true }; // Try to detect wait loops and trigger thread yield + cfg::_int<0, 6> max_spurs_threads{ this, "Max SPURS Threads", 6 }; // HACK. If less then 6, max number of running SPURS threads in each thread group. + cfg::_enum spu_block_size{ this, "SPU Block Size", spu_block_size_type::safe }; + cfg::_bool spu_accurate_getllar{ this, "Accurate GETLLAR", false }; + cfg::_bool spu_accurate_putlluc{ this, "Accurate PUTLLUC", false }; + cfg::_bool spu_verification{ this, "SPU Verification", true }; // Should be enabled + cfg::_bool spu_cache{ this, "SPU Cache", true }; + cfg::_bool spu_prof{ this, "SPU Profiler", false }; + cfg::_enum enable_TSX{ this, "Enable TSX", tsx_usage::enabled }; // Enable TSX. Forcing this on Haswell/Broadwell CPUs should be used carefully + cfg::_bool spu_accurate_xfloat{ this, "Accurate xfloat", false }; + cfg::_bool spu_approx_xfloat{ this, "Approximate xfloat", true }; + + cfg::_bool debug_console_mode{ this, "Debug Console Mode", false }; // Debug console emulation, not recommended + cfg::_enum lib_loading{ this, "Lib Loader", lib_loading_type::liblv2only }; + cfg::_bool hook_functions{ this, "Hook static functions" }; + cfg::set_entry load_libraries{ this, "Load libraries" }; + cfg::_bool hle_lwmutex{ this, "HLE lwmutex" }; // Force alternative lwmutex/lwcond implementation + + cfg::_int<10, 3000> clocks_scale{ this, "Clocks scale", 100, true }; // Changing this from 100 (percentage) may affect game speed in unexpected ways + cfg::_enum sleep_timers_accuracy{ this, "Sleep Timers Accuracy", +#ifdef __linux__ + sleep_timers_accuracy_level::_as_host, true }; +#else + sleep_timers_accuracy_level::_usleep, true }; +#endif + } core{ this }; + + struct node_vfs : cfg::node + { + node_vfs(cfg::node* _this) : cfg::node(_this, "VFS") {} + + std::string get(const cfg::string&, const char*) const; + + cfg::string emulator_dir{ this, "$(EmulatorDir)" }; // Default (empty): taken from fs::get_config_dir() + cfg::string dev_hdd0{ this, "/dev_hdd0/", "$(EmulatorDir)dev_hdd0/" }; + cfg::string dev_hdd1{ this, "/dev_hdd1/", "$(EmulatorDir)dev_hdd1/" }; + cfg::string dev_flash{ this, "/dev_flash/" }; + cfg::string dev_usb000{ this, "/dev_usb000/", "$(EmulatorDir)dev_usb000/" }; + cfg::string dev_bdvd{ this, "/dev_bdvd/" }; // Not mounted + cfg::string app_home{ this, "/app_home/" }; // Not mounted + + std::string get_dev_flash() const + { + return get(dev_flash, "dev_flash/"); + } + + cfg::_bool host_root{ this, "Enable /host_root/" }; + cfg::_bool init_dirs{ this, "Initialize Directories", true }; + + cfg::_bool limit_cache_size{ this, "Limit disk cache size", false }; + cfg::_int<0, 10240> cache_max_size{ this, "Disk cache maximum size (MB)", 5120 }; + + } vfs{ this }; + + struct node_video : cfg::node + { + node_video(cfg::node* _this) : cfg::node(_this, "Video") {} + + cfg::_enum renderer{ this, "Renderer", video_renderer::opengl }; + + cfg::_enum resolution{ this, "Resolution", video_resolution::_720 }; + cfg::_enum aspect_ratio{ this, "Aspect ratio", video_aspect::_16_9 }; + cfg::_enum frame_limit{ this, "Frame limit", frame_limit_type::none }; + cfg::_enum antialiasing_level{ this, "MSAA", msaa_level::_auto }; + + cfg::_bool write_color_buffers{ this, "Write Color Buffers" }; + cfg::_bool write_depth_buffer{ this, "Write Depth Buffer" }; + cfg::_bool read_color_buffers{ this, "Read Color Buffers" }; + cfg::_bool read_depth_buffer{ this, "Read Depth Buffer" }; + cfg::_bool log_programs{ this, "Log shader programs" }; + cfg::_bool vsync{ this, "VSync" }; + cfg::_bool debug_output{ this, "Debug output" }; + cfg::_bool overlay{ this, "Debug overlay" }; + cfg::_bool gl_legacy_buffers{ this, "Use Legacy OpenGL Buffers" }; + cfg::_bool use_gpu_texture_scaling{ this, "Use GPU texture scaling", false }; + cfg::_bool stretch_to_display_area{ this, "Stretch To Display Area" }; + cfg::_bool force_high_precision_z_buffer{ this, "Force High Precision Z buffer" }; + cfg::_bool strict_rendering_mode{ this, "Strict Rendering Mode" }; + cfg::_bool disable_zcull_queries{ this, "Disable ZCull Occlusion Queries", false }; + cfg::_bool disable_vertex_cache{ this, "Disable Vertex Cache", false }; + cfg::_bool disable_FIFO_reordering{ this, "Disable FIFO Reordering", false }; + cfg::_bool frame_skip_enabled{ this, "Enable Frame Skip", false }; + cfg::_bool force_cpu_blit_processing{ this, "Force CPU Blit", false }; // Debugging option + cfg::_bool disable_on_disk_shader_cache{ this, "Disable On-Disk Shader Cache", false }; + cfg::_bool disable_vulkan_mem_allocator{ this, "Disable Vulkan Memory Allocator", false }; + cfg::_bool full_rgb_range_output{ this, "Use full RGB output range", true }; // Video out dynamic range + cfg::_bool disable_asynchronous_shader_compiler{ this, "Disable Asynchronous Shader Compiler", false }; + cfg::_bool strict_texture_flushing{ this, "Strict Texture Flushing", false }; + cfg::_bool disable_native_float16{ this, "Disable native float16 support", false }; + cfg::_bool multithreaded_rsx{ this, "Multithreaded RSX", false }; + cfg::_bool relaxed_zcull_sync{ this, "Relaxed ZCULL Sync", false }; + cfg::_int<1, 8> consequtive_frames_to_draw{ this, "Consecutive Frames To Draw", 1 }; + cfg::_int<1, 8> consequtive_frames_to_skip{ this, "Consecutive Frames To Skip", 1 }; + cfg::_int<50, 800> resolution_scale_percent{ this, "Resolution Scale", 100 }; + cfg::_int<0, 16> anisotropic_level_override{ this, "Anisotropic Filter Override", 0 }; + cfg::_int<1, 1024> min_scalable_dimension{ this, "Minimum Scalable Dimension", 16 }; + cfg::_int<0, 30000000> driver_recovery_timeout{ this, "Driver Recovery Timeout", 1000000, true }; + cfg::_int<0, 16667> driver_wakeup_delay{ this, "Driver Wake-Up Delay", 1, true }; + cfg::_int<1, 1800> vblank_rate{ this, "Vblank Rate", 60, true }; // Changing this from 60 may affect game speed in unexpected ways + + struct node_vk : cfg::node + { + node_vk(cfg::node* _this) : cfg::node(_this, "Vulkan") {} + + cfg::string adapter{ this, "Adapter" }; + cfg::_bool force_fifo{ this, "Force FIFO present mode" }; + cfg::_bool force_primitive_restart{ this, "Force primitive restart flag" }; + + } vk{ this }; + + struct node_perf_overlay : cfg::node + { + node_perf_overlay(cfg::node* _this) : cfg::node(_this, "Performance Overlay") {} + + cfg::_bool perf_overlay_enabled{ this, "Enabled", false, true }; + cfg::_bool framerate_graph_enabled{ this, "Enable Framerate Graph", false, true }; + cfg::_bool frametime_graph_enabled{ this, "Enable Frametime Graph", false, true }; + cfg::_enum level{ this, "Detail level", detail_level::medium, true }; + cfg::_int<30, 5000> update_interval{ this, "Metrics update interval (ms)", 350, true }; + cfg::_int<4, 36> font_size{ this, "Font size (px)", 10, true }; + cfg::_enum position{ this, "Position", screen_quadrant::top_left, true }; + cfg::string font{ this, "Font", "n023055ms.ttf", true }; + cfg::_int<0, 1280> margin_x{ this, "Horizontal Margin (px)", 50, true }; // horizontal distance to the screen border relative to the screen_quadrant in px + cfg::_int<0, 720> margin_y{ this, "Vertical Margin (px)", 50, true }; // vertical distance to the screen border relative to the screen_quadrant in px + cfg::_bool center_x{ this, "Center Horizontally", false, true }; + cfg::_bool center_y{ this, "Center Vertically", false, true }; + cfg::_int<0, 100> opacity{ this, "Opacity (%)", 70, true }; + cfg::string color_body{ this, "Body Color (hex)", "#FFE138FF", true }; + cfg::string background_body{ this, "Body Background (hex)", "#002339FF", true }; + cfg::string color_title{ this, "Title Color (hex)", "#F26C24FF", true }; + cfg::string background_title{ this, "Title Background (hex)", "#00000000", true }; + + } perf_overlay{ this }; + + struct node_shader_compilation_hint : cfg::node + { + node_shader_compilation_hint(cfg::node* _this) : cfg::node(_this, "Shader Compilation Hint") {} + + cfg::_int<0, 1280> pos_x{ this, "Position X (px)", 20, true }; // horizontal position starting from the upper border in px + cfg::_int<0, 720> pos_y{ this, "Position Y (px)", 690, true }; // vertical position starting from the left border in px + + } shader_compilation_hint{ this }; + + struct node_shader_preloading_dialog : cfg::node + { + node_shader_preloading_dialog(cfg::node* _this) : cfg::node(_this, "Shader Loading Dialog") {} + + cfg::_bool use_custom_background{ this, "Allow custom background", true, true }; + cfg::_int<0, 100> darkening_strength{ this, "Darkening effect strength", 30, true }; + cfg::_int<0, 100> blur_strength{ this, "Blur effect strength", 0, true }; + + } shader_preloading_dialog{ this }; + + } video{ this }; + + struct node_audio : cfg::node + { + node_audio(cfg::node* _this) : cfg::node(_this, "Audio") {} + + cfg::_enum renderer{ this, "Renderer", static_cast(1) }; + + cfg::_bool dump_to_file{ this, "Dump to file" }; + cfg::_bool convert_to_u16{ this, "Convert to 16 bit" }; + cfg::_bool downmix_to_2ch{ this, "Downmix to Stereo", true }; + cfg::_int<1, 128> startt{ this, "Start Threshold", 1 }; // TODO: used only by ALSA, should probably be removed once ALSA is upgraded + cfg::_int<0, 200> volume{ this, "Master Volume", 100 }; + cfg::_bool enable_buffering{ this, "Enable Buffering", true }; + cfg::_int <20, 250> desired_buffer_duration{ this, "Desired Audio Buffer Duration", 100 }; + cfg::_int<1, 1000> sampling_period_multiplier{ this, "Sampling Period Multiplier", 100 }; + cfg::_bool enable_time_stretching{ this, "Enable Time Stretching", false }; + cfg::_int<0, 100> time_stretching_threshold{ this, "Time Stretching Threshold", 75 }; + cfg::_enum microphone_type{ this, "Microphone Type", microphone_handler::null }; + cfg::string microphone_devices{ this, "Microphone Devices", ";;;;" }; + } audio{ this }; + + struct node_io : cfg::node + { + node_io(cfg::node* _this) : cfg::node(_this, "Input/Output") {} + + cfg::_enum keyboard{ this, "Keyboard", keyboard_handler::null }; + cfg::_enum mouse{ this, "Mouse", mouse_handler::basic }; + cfg::_enum camera{ this, "Camera", camera_handler::null }; + cfg::_enum camera_type{ this, "Camera type", fake_camera_type::unknown }; + cfg::_enum move{ this, "Move", move_handler::null }; + } io{ this }; + + struct node_sys : cfg::node + { + node_sys(cfg::node* _this) : cfg::node(_this, "System") {} + + cfg::_enum language{ this, "Language", CellSysutilLang{1} }; // CELL_SYSUTIL_LANG_ENGLISH_US + cfg::_enum keyboard_type{ this, "Keyboard Type", CellKbMappingType{0} }; // CELL_KB_MAPPING_101 = US + cfg::_enum enter_button_assignment{ this, "Enter button assignment", enter_button_assign::cross }; + + } sys{ this }; + + struct node_net : cfg::node + { + node_net(cfg::node* _this) : cfg::node(_this, "Net") {} + + cfg::_enum net_status{ this, "Connection status" }; + cfg::string ip_address{ this, "IP address", "192.168.1.1" }; + + } net{ this }; + + struct node_misc : cfg::node + { + node_misc(cfg::node* _this) : cfg::node(_this, "Miscellaneous") {} + + cfg::_bool autostart{ this, "Automatically start games after boot", true, true }; + cfg::_bool autoexit{ this, "Exit RPCS3 when process finishes", false, true }; + cfg::_bool start_fullscreen{ this, "Start games in fullscreen mode", false, true }; + cfg::_bool prevent_display_sleep{ this, "Prevent display sleep while running games", true }; + cfg::_bool show_trophy_popups{ this, "Show trophy popups", true, true }; + cfg::_bool show_shader_compilation_hint{ this, "Show shader compilation hint", true, true }; + cfg::_bool use_native_interface{ this, "Use native user interface", true }; + cfg::string gdb_server{ this, "GDB Server", "127.0.0.1:2345" }; + cfg::_bool silence_all_logs{ this, "Silence All Logs", false, false }; + cfg::string title_format{ this, "Window Title Format", "FPS: %F | %R | %V | %T [%t]", true }; + + } misc{ this }; + + cfg::log_entry log{ this, "Log" }; + + std::string name; +}; + +extern cfg_root g_cfg; diff --git a/rpcs3/Emu/system_config_types.h b/rpcs3/Emu/system_config_types.h new file mode 100644 index 0000000000..3ba520ae33 --- /dev/null +++ b/rpcs3/Emu/system_config_types.h @@ -0,0 +1,169 @@ +#pragma once + +enum class ppu_decoder_type +{ + precise, + fast, + llvm, +}; + +enum class spu_decoder_type +{ + precise, + fast, + asmjit, + llvm, +}; + +enum class spu_block_size_type +{ + safe, + mega, + giga, +}; + +enum class lib_loading_type +{ + manual, + hybrid, + liblv2only, + liblv2both, + liblv2list, +}; + +enum class sleep_timers_accuracy_level +{ + _as_host, + _usleep, + _all_timers, +}; + +enum class keyboard_handler +{ + null, + basic, +}; + +enum class mouse_handler +{ + null, + basic, +}; + +enum class video_renderer +{ + null, + opengl, + vulkan, +}; + +enum class audio_renderer +{ + null, +#ifdef _WIN32 + xaudio, +#endif +#ifdef HAVE_ALSA + alsa, +#endif + openal, +#ifdef HAVE_PULSE + pulse, +#endif +#ifdef HAVE_FAUDIO + faudio, +#endif +}; + +enum class camera_handler +{ + null, + fake, +}; + +enum class fake_camera_type +{ + unknown, + eyetoy, + eyetoy2, + uvc1_1, +}; + +enum class move_handler +{ + null, + fake, + mouse, +}; + +enum class microphone_handler +{ + null, + standard, + singstar, + real_singstar, + rocksmith, +}; + +enum class video_resolution +{ + _1080, + _720, + _480, + _576, + _1600x1080, + _1440x1080, + _1280x1080, + _960x1080, +}; + +enum class video_aspect +{ + _4_3, + _16_9, +}; + +enum class frame_limit_type +{ + none, + _59_94, + _50, + _60, + _30, + _auto, +}; + +enum class msaa_level +{ + none, + _auto +}; + +enum class detail_level +{ + minimal, + low, + medium, + high, +}; + +enum class screen_quadrant +{ + top_left, + top_right, + bottom_left, + bottom_right +}; + +enum class tsx_usage +{ + disabled, + enabled, + forced, +}; + +enum class enter_button_assign +{ + circle, // CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CIRCLE + cross // CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CROSS +}; diff --git a/rpcs3/Input/basic_keyboard_handler.cpp b/rpcs3/Input/basic_keyboard_handler.cpp index 5fe6a2b2ad..ad6b873d6e 100644 --- a/rpcs3/Input/basic_keyboard_handler.cpp +++ b/rpcs3/Input/basic_keyboard_handler.cpp @@ -3,7 +3,7 @@ #include #include -#include "Emu/System.h" +#include "Emu/system_config.h" #ifdef _WIN32 #include "windows.h" diff --git a/rpcs3/Input/ds3_pad_handler.cpp b/rpcs3/Input/ds3_pad_handler.cpp index dd28cff24d..2b8b6f069b 100644 --- a/rpcs3/Input/ds3_pad_handler.cpp +++ b/rpcs3/Input/ds3_pad_handler.cpp @@ -1,6 +1,5 @@ -#include "ds3_pad_handler.h" - -#include +#include "stdafx.h" +#include "ds3_pad_handler.h" LOG_CHANNEL(ds3_log, "DS3"); diff --git a/rpcs3/Input/ds3_pad_handler.h b/rpcs3/Input/ds3_pad_handler.h index b4229e0b25..c74c3e57ba 100644 --- a/rpcs3/Input/ds3_pad_handler.h +++ b/rpcs3/Input/ds3_pad_handler.h @@ -1,9 +1,6 @@ #pragma once #include "Emu/Io/PadHandler.h" -#include "Utilities/Thread.h" -#include -#include #include "hidapi.h" diff --git a/rpcs3/Input/ds4_pad_handler.cpp b/rpcs3/Input/ds4_pad_handler.cpp index 7b26841328..5499f45975 100644 --- a/rpcs3/Input/ds4_pad_handler.cpp +++ b/rpcs3/Input/ds4_pad_handler.cpp @@ -1,6 +1,5 @@ -#include "ds4_pad_handler.h" - -#include +#include "stdafx.h" +#include "ds4_pad_handler.h" LOG_CHANNEL(ds4_log, "DS4"); diff --git a/rpcs3/Input/ds4_pad_handler.h b/rpcs3/Input/ds4_pad_handler.h index c4b81b8c1a..1270fe4692 100644 --- a/rpcs3/Input/ds4_pad_handler.h +++ b/rpcs3/Input/ds4_pad_handler.h @@ -1,11 +1,8 @@ #pragma once #include "Emu/Io/PadHandler.h" -#include "Utilities/Thread.h" #include "Utilities/CRC.h" #include "hidapi.h" -#include -#include class ds4_pad_handler final : public PadHandlerBase { diff --git a/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp index b1096b7444..3db3ccc739 100644 --- a/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -1,4 +1,5 @@ -#include "pad_thread.h" +#include "stdafx.h" +#include "pad_thread.h" #include "ds3_pad_handler.h" #include "ds4_pad_handler.h" #ifdef _WIN32 diff --git a/rpcs3/Input/xinput_pad_handler.cpp b/rpcs3/Input/xinput_pad_handler.cpp index 6f66a8d7f8..61dfda57eb 100644 --- a/rpcs3/Input/xinput_pad_handler.cpp +++ b/rpcs3/Input/xinput_pad_handler.cpp @@ -1,5 +1,6 @@  #ifdef _WIN32 +#include "stdafx.h" #include "xinput_pad_handler.h" namespace XINPUT_INFO diff --git a/rpcs3/Loader/TROPUSR.cpp b/rpcs3/Loader/TROPUSR.cpp index f739b57e5d..fe1b58e162 100644 --- a/rpcs3/Loader/TROPUSR.cpp +++ b/rpcs3/Loader/TROPUSR.cpp @@ -2,7 +2,7 @@ #include "restore_new.h" #include "Utilities/rXml.h" #include "define_new_memleakdetect.h" -#include "Emu/System.h" +#include "Emu/VFS.h" #include "TROPUSR.h" LOG_CHANNEL(trp_log, "Trophy"); diff --git a/rpcs3/Loader/TRP.cpp b/rpcs3/Loader/TRP.cpp index cb37922fcf..a7cf64f170 100644 --- a/rpcs3/Loader/TRP.cpp +++ b/rpcs3/Loader/TRP.cpp @@ -1,5 +1,5 @@ -#include "stdafx.h" -#include "Emu/System.h" +#include "stdafx.h" +#include "Emu/VFS.h" #include "TRP.h" #include "Crypto/sha1.h" #include "Utilities/StrUtil.h" diff --git a/rpcs3/display_sleep_control.cpp b/rpcs3/display_sleep_control.cpp index 644ea42c28..f6bf8a1305 100644 --- a/rpcs3/display_sleep_control.cpp +++ b/rpcs3/display_sleep_control.cpp @@ -1,6 +1,5 @@ #include "display_sleep_control.h" -#include "Emu/System.h" #include "Utilities/Log.h" #ifdef _WIN32 diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index db06f0d317..5188ea935f 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -69,10 +69,13 @@ + + + NotUsing @@ -411,12 +414,15 @@ + + + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 8a8b312a3e..3f32d9a18c 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -884,6 +884,15 @@ Emu + + Emu + + + Emu\Audio + + + Emu\Io + @@ -1678,5 +1687,14 @@ Emu + + Emu + + + Emu\Io + + + Emu + \ No newline at end of file diff --git a/rpcs3/headless_application.cpp b/rpcs3/headless_application.cpp index 31d6636020..0f647a0083 100644 --- a/rpcs3/headless_application.cpp +++ b/rpcs3/headless_application.cpp @@ -1,7 +1,5 @@ #include "headless_application.h" -#include "Emu/System.h" - #include "Emu/RSX/GSRender.h" #include diff --git a/rpcs3/main_application.cpp b/rpcs3/main_application.cpp index 4ec03cc303..a3a5ac977b 100644 --- a/rpcs3/main_application.cpp +++ b/rpcs3/main_application.cpp @@ -1,23 +1,13 @@ #include "main_application.h" #include "Input/pad_thread.h" -#include "Emu/Io/Null/NullPadHandler.h" +#include "Emu/System.h" #include "Emu/Io/Null/NullKeyboardHandler.h" #include "Emu/Io/Null/NullMouseHandler.h" #include "Emu/Io/KeyboardHandler.h" -#include "Emu/Io/PadHandler.h" #include "Emu/Io/MouseHandler.h" #include "Input/basic_keyboard_handler.h" #include "Input/basic_mouse_handler.h" -#include "Input/keyboard_pad_handler.h" -#include "Input/ds4_pad_handler.h" -#ifdef _WIN32 -#include "Input/xinput_pad_handler.h" -#include "Input/mm_joystick_handler.h" -#endif -#ifdef HAVE_LIBEVDEV -#include "Input/evdev_joystick_handler.h" -#endif #include "Emu/Audio/AudioBackend.h" #include "Emu/Audio/Null/NullAudioBackend.h" diff --git a/rpcs3/main_application.h b/rpcs3/main_application.h index 7931c8252c..6dacc1c95c 100644 --- a/rpcs3/main_application.h +++ b/rpcs3/main_application.h @@ -2,7 +2,8 @@ #include "stdafx.h" #include -#include "Emu/System.h" + +struct EmuCallbacks; class main_application { diff --git a/rpcs3/rpcs3qt/auto_pause_settings_dialog.cpp b/rpcs3/rpcs3qt/auto_pause_settings_dialog.cpp index 1efc945ef9..e6cbf773ca 100644 --- a/rpcs3/rpcs3qt/auto_pause_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/auto_pause_settings_dialog.cpp @@ -1,5 +1,6 @@ - -#include "auto_pause_settings_dialog.h" +#include "auto_pause_settings_dialog.h" +#include "table_item_delegate.h" +#include "Emu/System.h" LOG_CHANNEL(autopause_log, "AutoPause"); diff --git a/rpcs3/rpcs3qt/auto_pause_settings_dialog.h b/rpcs3/rpcs3qt/auto_pause_settings_dialog.h index 51a637feb0..b7cdb1c485 100644 --- a/rpcs3/rpcs3qt/auto_pause_settings_dialog.h +++ b/rpcs3/rpcs3qt/auto_pause_settings_dialog.h @@ -1,9 +1,6 @@ -#pragma once +#pragma once #include "stdafx.h" -#include "Emu/System.h" -#include "Emu/Memory/vm.h" -#include "table_item_delegate.h" #include #include diff --git a/rpcs3/rpcs3qt/cheat_manager.cpp b/rpcs3/rpcs3qt/cheat_manager.cpp index 76726b6683..ea8d9f9790 100644 --- a/rpcs3/rpcs3qt/cheat_manager.cpp +++ b/rpcs3/rpcs3qt/cheat_manager.cpp @@ -11,6 +11,7 @@ #include "cheat_manager.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/Memory/vm.h" #include "Emu/CPU/CPUThread.h" diff --git a/rpcs3/rpcs3qt/debugger_frame.cpp b/rpcs3/rpcs3qt/debugger_frame.cpp index c5c496852b..bb15e84437 100644 --- a/rpcs3/rpcs3qt/debugger_frame.cpp +++ b/rpcs3/rpcs3qt/debugger_frame.cpp @@ -1,5 +1,7 @@ -#include "debugger_frame.h" +#include "debugger_frame.h" #include "qt_utils.h" +#include "Emu/System.h" +#include "Emu/IdManager.h" #include #include diff --git a/rpcs3/rpcs3qt/debugger_frame.h b/rpcs3/rpcs3qt/debugger_frame.h index 252de74552..d124662d0b 100644 --- a/rpcs3/rpcs3qt/debugger_frame.h +++ b/rpcs3/rpcs3qt/debugger_frame.h @@ -1,9 +1,6 @@ -#pragma once +#pragma once #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" -#include "Emu/IdManager.h" #include "Emu/CPU/CPUThread.h" #include "Emu/CPU/CPUDisAsm.h" #include "Emu/Cell/PPUThread.h" diff --git a/rpcs3/rpcs3qt/debugger_list.cpp b/rpcs3/rpcs3qt/debugger_list.cpp index df847d0a46..eeb082e333 100644 --- a/rpcs3/rpcs3qt/debugger_list.cpp +++ b/rpcs3/rpcs3qt/debugger_list.cpp @@ -1,4 +1,4 @@ -#include "debugger_list.h" +#include "debugger_list.h" #include "Emu/Cell/SPUThread.h" #include "Emu/System.h" diff --git a/rpcs3/rpcs3qt/emu_settings.cpp b/rpcs3/rpcs3qt/emu_settings.cpp index ec89a45b39..0f8729782b 100644 --- a/rpcs3/rpcs3qt/emu_settings.cpp +++ b/rpcs3/rpcs3qt/emu_settings.cpp @@ -6,7 +6,6 @@ #include #include "stdafx.h" -#include "Emu/System.h" #include "Utilities/Config.h" #include "Utilities/Thread.h" #include "Utilities/StrUtil.h" diff --git a/rpcs3/rpcs3qt/gl_gs_frame.cpp b/rpcs3/rpcs3qt/gl_gs_frame.cpp index 5c2c602d4e..3eca482cfb 100644 --- a/rpcs3/rpcs3qt/gl_gs_frame.cpp +++ b/rpcs3/rpcs3qt/gl_gs_frame.cpp @@ -1,9 +1,8 @@ -#include "stdafx.h" +#include "stdafx.h" #include "gl_gs_frame.h" -#include "Emu/System.h" #include -#include +#include #include gl_gs_frame::gl_gs_frame(const QRect& geometry, const QIcon& appIcon, const std::shared_ptr& gui_settings) diff --git a/rpcs3/rpcs3qt/instruction_editor_dialog.h b/rpcs3/rpcs3qt/instruction_editor_dialog.h index 90b66e13bb..66afe9f84f 100644 --- a/rpcs3/rpcs3qt/instruction_editor_dialog.h +++ b/rpcs3/rpcs3qt/instruction_editor_dialog.h @@ -1,8 +1,6 @@ -#pragma once +#pragma once #include "stdafx.h" -#include "Emu/System.h" -#include "Emu/Memory/vm.h" #include "Emu/CPU/CPUThread.h" #include "Emu/CPU/CPUDisAsm.h" #include "Emu/Cell/PPUThread.h" diff --git a/rpcs3/rpcs3qt/kernel_explorer.cpp b/rpcs3/rpcs3qt/kernel_explorer.cpp index f7eefdca21..dd56ad2fa1 100644 --- a/rpcs3/rpcs3qt/kernel_explorer.cpp +++ b/rpcs3/rpcs3qt/kernel_explorer.cpp @@ -1,6 +1,4 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" #include "Emu/IdManager.h" #include "Emu/Cell/PPUThread.h" @@ -26,6 +24,10 @@ #include "kernel_explorer.h" +#include +#include +#include + kernel_explorer::kernel_explorer(QWidget* parent) : QDialog(parent) { setWindowTitle(tr("Kernel Explorer")); diff --git a/rpcs3/rpcs3qt/kernel_explorer.h b/rpcs3/rpcs3qt/kernel_explorer.h index b4c10095e4..6523d2a9e4 100644 --- a/rpcs3/rpcs3qt/kernel_explorer.h +++ b/rpcs3/rpcs3qt/kernel_explorer.h @@ -1,10 +1,7 @@ -#pragma once +#pragma once #include -#include -#include #include -#include class kernel_explorer : public QDialog { diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 0690e9f28a..09331184aa 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -38,6 +38,7 @@ #include "stdafx.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/Memory/vm.h" #include "Crypto/unpkg.h" diff --git a/rpcs3/rpcs3qt/memory_string_searcher.cpp b/rpcs3/rpcs3qt/memory_string_searcher.cpp index 945db15a94..3cc80a19a0 100644 --- a/rpcs3/rpcs3qt/memory_string_searcher.cpp +++ b/rpcs3/rpcs3qt/memory_string_searcher.cpp @@ -1,6 +1,9 @@ +#include "stdafx.h" #include "memory_string_searcher.h" +#include "Emu/Memory/vm.h" #include +#include LOG_CHANNEL(gui_log, "GUI"); diff --git a/rpcs3/rpcs3qt/memory_string_searcher.h b/rpcs3/rpcs3qt/memory_string_searcher.h index 12949299a7..61e48619cb 100644 --- a/rpcs3/rpcs3qt/memory_string_searcher.h +++ b/rpcs3/rpcs3qt/memory_string_searcher.h @@ -1,12 +1,7 @@ -#pragma once - -#include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" +#pragma once #include #include -#include #include class memory_string_searcher : public QDialog diff --git a/rpcs3/rpcs3qt/msg_dialog_frame.h b/rpcs3/rpcs3qt/msg_dialog_frame.h index 648a18b7e4..30279d5e63 100644 --- a/rpcs3/rpcs3qt/msg_dialog_frame.h +++ b/rpcs3/rpcs3qt/msg_dialog_frame.h @@ -1,10 +1,7 @@ #pragma once #include "stdafx.h" -#include "Emu/Memory/vm.h" #include "Emu/Cell/Modules/cellMsgDialog.h" -#include "Emu/System.h" -#include "Emu/Cell/lv2/sys_time.h" #include "custom_dialog.h" diff --git a/rpcs3/rpcs3qt/osk_dialog_frame.h b/rpcs3/rpcs3qt/osk_dialog_frame.h index 46c0d880f2..6778e79190 100644 --- a/rpcs3/rpcs3qt/osk_dialog_frame.h +++ b/rpcs3/rpcs3qt/osk_dialog_frame.h @@ -1,10 +1,7 @@ #pragma once #include "stdafx.h" -#include "Emu/Memory/vm.h" #include "Emu/Cell/Modules/cellOskDialog.h" -#include "Emu/System.h" -#include "Emu/Cell/lv2/sys_time.h" #include "custom_dialog.h" diff --git a/rpcs3/rpcs3qt/register_editor_dialog.h b/rpcs3/rpcs3qt/register_editor_dialog.h index fc8bd2ca6c..0490bf58e4 100644 --- a/rpcs3/rpcs3qt/register_editor_dialog.h +++ b/rpcs3/rpcs3qt/register_editor_dialog.h @@ -1,7 +1,6 @@ -#pragma once +#pragma once #include "stdafx.h" -#include "Emu/System.h" #include "Emu/CPU/CPUThread.h" #include "Emu/CPU/CPUDisAsm.h" #include "Emu/Cell/PPUThread.h" diff --git a/rpcs3/rpcs3qt/rsx_debugger.cpp b/rpcs3/rpcs3qt/rsx_debugger.cpp index cdb6daaa84..12eb070b1f 100644 --- a/rpcs3/rpcs3qt/rsx_debugger.cpp +++ b/rpcs3/rpcs3qt/rsx_debugger.cpp @@ -2,6 +2,8 @@ #include "rsx_debugger.h" #include "qt_utils.h" +#include "Emu/RSX/GSRender.h" + enum GCMEnumTypes { CELL_GCM_ENUM, diff --git a/rpcs3/rpcs3qt/rsx_debugger.h b/rpcs3/rpcs3qt/rsx_debugger.h index c3f43ec986..4ab201bd80 100644 --- a/rpcs3/rpcs3qt/rsx_debugger.h +++ b/rpcs3/rpcs3qt/rsx_debugger.h @@ -2,10 +2,6 @@ #include "stdafx.h" -#include "Emu/Memory/vm.h" -#include "Emu/System.h" -#include "Emu/RSX/GSRender.h" - #include "memory_viewer_panel.h" #include "table_item_delegate.h" #include "gui_settings.h" diff --git a/rpcs3/rpcs3qt/save_data_dialog.cpp b/rpcs3/rpcs3qt/save_data_dialog.cpp index 2208174eb0..3d57752ac7 100644 --- a/rpcs3/rpcs3qt/save_data_dialog.cpp +++ b/rpcs3/rpcs3qt/save_data_dialog.cpp @@ -1,6 +1,7 @@ #include "save_data_dialog.h" #include "save_data_list_dialog.h" +#include #include #include diff --git a/rpcs3/rpcs3qt/save_data_list_dialog.h b/rpcs3/rpcs3qt/save_data_list_dialog.h index 3bbafecd2b..a5502c4b87 100644 --- a/rpcs3/rpcs3qt/save_data_list_dialog.h +++ b/rpcs3/rpcs3qt/save_data_list_dialog.h @@ -2,7 +2,6 @@ // I just want the struct for the save data. #include "stdafx.h" -#include "Emu/System.h" #include "Emu/Memory/vm.h" #include "Emu/Cell/Modules/cellSaveData.h" #include "gui_settings.h" diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index cc8a766d09..96aa39bcb8 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -21,6 +21,7 @@ #include "stdafx.h" #include "Emu/System.h" +#include "Emu/system_config.h" #include "Emu/title.h" #include "Crypto/unself.h" #include "Utilities/sysinfo.h" diff --git a/rpcs3/rpcs3qt/skylander_dialog.cpp b/rpcs3/rpcs3qt/skylander_dialog.cpp index 5387070c7c..4afe5d26a7 100644 --- a/rpcs3/rpcs3qt/skylander_dialog.cpp +++ b/rpcs3/rpcs3qt/skylander_dialog.cpp @@ -1,5 +1,4 @@ #include -#include "Emu/System.h" #include "Utilities/File.h" #include "Crypto/md5.h" #include "Crypto/aes.h" diff --git a/rpcs3/rpcs3qt/user_account.cpp b/rpcs3/rpcs3qt/user_account.cpp index 8b19d3a526..39c67a60c4 100644 --- a/rpcs3/rpcs3qt/user_account.cpp +++ b/rpcs3/rpcs3qt/user_account.cpp @@ -1,4 +1,9 @@ -#include "user_account.h" +#include "user_account.h" + +#include "Emu/System.h" +#include "Utilities/File.h" +#include "Utilities/StrFmt.h" +#include "Utilities/Log.h" LOG_CHANNEL(gui_log, "GUI"); diff --git a/rpcs3/rpcs3qt/user_account.h b/rpcs3/rpcs3qt/user_account.h index 20c4473b01..7a048be348 100644 --- a/rpcs3/rpcs3qt/user_account.h +++ b/rpcs3/rpcs3qt/user_account.h @@ -1,8 +1,6 @@ -#pragma once +#pragma once -#include "Emu/System.h" -#include "Utilities/File.h" -#include "Utilities/StrFmt.h" +#include // Do not confuse this with the "user" in Emu/System.h. // That user is read from config.yml, and it only represents the currently "logged in" user. diff --git a/rpcs3/rpcs3qt/user_manager_dialog.cpp b/rpcs3/rpcs3qt/user_manager_dialog.cpp index f6fa38e18e..710d8187d6 100644 --- a/rpcs3/rpcs3qt/user_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/user_manager_dialog.cpp @@ -7,6 +7,8 @@ #include "table_item_delegate.h" #include "main_application.h" +#include "Emu/System.h" + #include "Utilities/StrUtil.h" #include "Utilities/Log.h" diff --git a/rpcs3/rpcs3qt/user_manager_dialog.h b/rpcs3/rpcs3qt/user_manager_dialog.h index 991a04d767..b83aa04601 100644 --- a/rpcs3/rpcs3qt/user_manager_dialog.h +++ b/rpcs3/rpcs3qt/user_manager_dialog.h @@ -1,9 +1,8 @@ -#pragma once +#pragma once #include "stdafx.h" #include "gui_settings.h" #include "emu_settings.h" -#include "Emu/System.h" #include "Utilities/File.h" #include "user_account.h" diff --git a/rpcs3/rpcs3qt/vfs_dialog.cpp b/rpcs3/rpcs3qt/vfs_dialog.cpp index 81ec0497b6..f0093e2f1c 100644 --- a/rpcs3/rpcs3qt/vfs_dialog.cpp +++ b/rpcs3/rpcs3qt/vfs_dialog.cpp @@ -5,6 +5,7 @@ #include #include "Emu/System.h" +#include "Emu/system_config.h" inline std::string sstr(const QString& _in) { return _in.toStdString(); } diff --git a/rpcs3/rpcs3qt/vfs_dialog_tab.h b/rpcs3/rpcs3qt/vfs_dialog_tab.h index d40b3dbdb9..0f851b7b9e 100644 --- a/rpcs3/rpcs3qt/vfs_dialog_tab.h +++ b/rpcs3/rpcs3qt/vfs_dialog_tab.h @@ -1,7 +1,7 @@ #pragma once #include "stdafx.h" -#include "Emu/System.h" +#include "Utilities/Config.h" #include "gui_settings.h" #include "emu_settings.h" diff --git a/rpcs3/rpcs3qt/welcome_dialog.cpp b/rpcs3/rpcs3qt/welcome_dialog.cpp index 56b5128814..2471b7b372 100644 --- a/rpcs3/rpcs3qt/welcome_dialog.cpp +++ b/rpcs3/rpcs3qt/welcome_dialog.cpp @@ -1,10 +1,8 @@ -#include "welcome_dialog.h" +#include "welcome_dialog.h" #include "ui_welcome_dialog.h" #include "gui_settings.h" -#include "Emu/System.h" - #include #include #include