Compare commits

..

1 Commits

Author SHA1 Message Date
Tygyh
93cffebc5d
Merge e3aa5f0763 into a0611b512b 2025-06-05 14:34:47 -05:00
264 changed files with 1506 additions and 1996 deletions

3
.gitmodules vendored
View File

@ -84,9 +84,6 @@
[submodule "Externals/Vulkan-Headers"] [submodule "Externals/Vulkan-Headers"]
path = Externals/Vulkan-Headers path = Externals/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git url = https://github.com/KhronosGroup/Vulkan-Headers.git
[submodule "Externals/watcher/watcher"]
path = Externals/watcher/watcher
url = https://github.com/e-dant/watcher.git
[submodule "Externals/SFML/SFML"] [submodule "Externals/SFML/SFML"]
path = Externals/SFML/SFML path = Externals/SFML/SFML
url = https://github.com/SFML/SFML.git url = https://github.com/SFML/SFML.git

View File

@ -784,8 +784,6 @@ if (USE_RETRO_ACHIEVEMENTS)
add_subdirectory(Externals/rcheevos) add_subdirectory(Externals/rcheevos)
endif() endif()
add_subdirectory(Externals/watcher)
######################################## ########################################
# Pre-build events: Define configuration variables and write SCM info header # Pre-build events: Define configuration variables and write SCM info header
# #

View File

@ -1,9 +0,0 @@
# SCYE4Q - Cars 2
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8019CB1C:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# SCYP4Q - Cars 2
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8019CB1C:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# SCYR4Q - Cars 2
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8019B4EC:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# SCYX4Q - Cars 2
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8019CBBC:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# SCYY4Q - Cars 2
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8019B55C:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# SCYZ4Q - Cars 2
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8019B55C:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,4 +1,4 @@
# SQIE4Q, SQIP4Q, SQIY4Q - Disney Infinity # SQIE4Q, SQIP4Q - Disney Infinity
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.

View File

@ -1,9 +0,0 @@
# SQIE4Q - Disney Infinity
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8008E60C:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# SQIP4Q - Disney Infinity
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8008E60C:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# SQIY4Q - Disney Infinity
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x8008E60C:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# STSE4Q - Toy Story 3
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x801FA2E4:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# STSP4Q - Toy Story 3
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x801FA2E4:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# STSP4Q - Toy Story 3
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x801FA354:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# STSX4Q - Toy Story 3
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x801FA354:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# STSY4Q - Toy Story 3
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x801FA2E4:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# STSY4Q - Toy Story 3
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x801FA354:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,9 +0,0 @@
# STSZ4Q - Toy Story 3 Toy Box Special Edition
[OnFrame]
#This speedhack modifies the way the game manages memory to run faster in Dolphin.
$BAT Speedhack
0x801FA2E4:dword:0x48000180
[OnFrame_Enabled]
$BAT Speedhack

View File

@ -1,4 +0,0 @@
add_library(watcher INTERFACE IMPORTED GLOBAL)
set_target_properties(watcher PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/watcher/include
)

@ -1 +0,0 @@
Subproject commit b03bdcfc11549df595b77239cefe2643943a3e2f

View File

@ -3,7 +3,9 @@
#pragma once #pragma once
#include <atomic>
#include <condition_variable> #include <condition_variable>
#include <mutex>
#include <thread> #include <thread>
#if defined(HAVE_ALSA) && HAVE_ALSA #if defined(HAVE_ALSA) && HAVE_ALSA

View File

@ -166,8 +166,7 @@ void UpdateSoundStream(Core::System& system)
if (sound_stream) if (sound_stream)
{ {
int const volume = int volume = Config::Get(Config::MAIN_AUDIO_MUTED) ? 0 : Config::Get(Config::MAIN_AUDIO_VOLUME);
Config::Get(Config::MAIN_AUDIO_MUTED) ? 0 : Config::Get(Config::MAIN_AUDIO_VOLUME);
sound_stream->SetVolume(volume); sound_stream->SetVolume(volume);
} }
} }
@ -193,7 +192,7 @@ void SetSoundStreamRunning(Core::System& system, bool running)
void SendAIBuffer(Core::System& system, const short* samples, unsigned int num_samples) void SendAIBuffer(Core::System& system, const short* samples, unsigned int num_samples)
{ {
const SoundStream* const sound_stream = system.GetSoundStream(); SoundStream* sound_stream = system.GetSoundStream();
if (!sound_stream) if (!sound_stream)
return; return;
@ -213,9 +212,9 @@ void SendAIBuffer(Core::System& system, const short* samples, unsigned int num_s
void StartAudioDump(Core::System& system) void StartAudioDump(Core::System& system)
{ {
const SoundStream* const sound_stream = system.GetSoundStream(); SoundStream* sound_stream = system.GetSoundStream();
std::time_t const start_time = std::time(nullptr); std::time_t start_time = std::time(nullptr);
std::string path_prefix = File::GetUserPath(D_DUMPAUDIO_IDX) + SConfig::GetInstance().GetGameID(); std::string path_prefix = File::GetUserPath(D_DUMPAUDIO_IDX) + SConfig::GetInstance().GetGameID();
@ -233,7 +232,7 @@ void StartAudioDump(Core::System& system)
void StopAudioDump(Core::System& system) void StopAudioDump(Core::System& system)
{ {
const SoundStream* const sound_stream = system.GetSoundStream(); SoundStream* sound_stream = system.GetSoundStream();
if (!sound_stream) if (!sound_stream)
return; return;
@ -266,7 +265,7 @@ void DecreaseVolume(Core::System& system, unsigned short offset)
void ToggleMuteVolume(Core::System& system) void ToggleMuteVolume(Core::System& system)
{ {
bool const isMuted = Config::Get(Config::MAIN_AUDIO_MUTED); bool isMuted = Config::Get(Config::MAIN_AUDIO_MUTED);
Config::SetBaseOrCurrent(Config::MAIN_AUDIO_MUTED, !isMuted); Config::SetBaseOrCurrent(Config::MAIN_AUDIO_MUTED, !isMuted);
UpdateSoundStream(system); UpdateSoundStream(system);
} }

View File

@ -3,6 +3,7 @@
#pragma once #pragma once
#include <memory>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <vector> #include <vector>

View File

@ -10,6 +10,7 @@
#include "Common/Event.h" #include "Common/Event.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/ScopeGuard.h" #include "Common/ScopeGuard.h"
#include "Common/Thread.h"
#include "Core/Config/MainSettings.h" #include "Core/Config/MainSettings.h"
#ifdef _WIN32 #ifdef _WIN32
@ -22,7 +23,7 @@ constexpr u32 BUFFER_SAMPLES = 512;
long CubebStream::DataCallback(cubeb_stream* stream, void* user_data, const void* /*input_buffer*/, long CubebStream::DataCallback(cubeb_stream* stream, void* user_data, const void* /*input_buffer*/,
void* output_buffer, long num_frames) void* output_buffer, long num_frames)
{ {
const auto* const self = static_cast<CubebStream*>(user_data); auto* self = static_cast<CubebStream*>(user_data);
if (self->m_stereo) if (self->m_stereo)
self->m_mixer->Mix(static_cast<short*>(output_buffer), num_frames); self->m_mixer->Mix(static_cast<short*>(output_buffer), num_frames);
@ -43,7 +44,7 @@ CubebStream::CubebStream()
Common::Event sync_event; Common::Event sync_event;
m_work_queue.Push([this, &sync_event] { m_work_queue.Push([this, &sync_event] {
Common::ScopeGuard sync_event_guard([&sync_event] { sync_event.Set(); }); Common::ScopeGuard sync_event_guard([&sync_event] { sync_event.Set(); });
auto const result = CoInitializeEx(nullptr, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE); auto result = ::CoInitializeEx(nullptr, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE);
m_coinit_success = result == S_OK; m_coinit_success = result == S_OK;
m_should_couninit = result == S_OK || result == S_FALSE; m_should_couninit = result == S_OK || result == S_FALSE;
}); });

View File

@ -3,6 +3,8 @@
#pragma once #pragma once
#include <cstddef>
#include <functional>
#include <memory> #include <memory>
#include <vector> #include <vector>

View File

@ -182,8 +182,7 @@ std::size_t Mixer::MixSurround(float* samples, std::size_t num_samples)
memset(samples, 0, num_samples * SURROUND_CHANNELS * sizeof(float)); memset(samples, 0, num_samples * SURROUND_CHANNELS * sizeof(float));
std::size_t const needed_frames = std::size_t needed_frames = m_surround_decoder.QueryFramesNeededForSurroundOutput(num_samples);
m_surround_decoder.QueryFramesNeededForSurroundOutput(num_samples);
constexpr std::size_t max_samples = 0x8000; constexpr std::size_t max_samples = 0x8000;
ASSERT_MSG(AUDIO, needed_frames <= max_samples, ASSERT_MSG(AUDIO, needed_frames <= max_samples,
@ -191,7 +190,7 @@ std::size_t Mixer::MixSurround(float* samples, std::size_t num_samples)
needed_frames, max_samples); needed_frames, max_samples);
std::array<s16, max_samples> buffer; std::array<s16, max_samples> buffer;
std::size_t const available_frames = Mix(buffer.data(), static_cast<std::size_t>(needed_frames)); std::size_t available_frames = Mix(buffer.data(), static_cast<std::size_t>(needed_frames));
if (available_frames != needed_frames) if (available_frames != needed_frames)
{ {
ERROR_LOG_FMT(AUDIO, ERROR_LOG_FMT(AUDIO,
@ -230,7 +229,7 @@ void Mixer::PushSamples(const s16* samples, std::size_t num_samples)
if (m_log_dsp_audio) if (m_log_dsp_audio)
{ {
const s32 sample_rate_divisor = m_dma_mixer.GetInputSampleRateDivisor(); const s32 sample_rate_divisor = m_dma_mixer.GetInputSampleRateDivisor();
auto const volume = m_dma_mixer.GetVolume(); auto volume = m_dma_mixer.GetVolume();
m_wave_writer_dsp.AddStereoSamplesBE(samples, static_cast<u32>(num_samples), m_wave_writer_dsp.AddStereoSamplesBE(samples, static_cast<u32>(num_samples),
sample_rate_divisor, volume.first, volume.second); sample_rate_divisor, volume.first, volume.second);
} }
@ -242,7 +241,7 @@ void Mixer::PushStreamingSamples(const s16* samples, std::size_t num_samples)
if (m_log_dtk_audio) if (m_log_dtk_audio)
{ {
const s32 sample_rate_divisor = m_streaming_mixer.GetInputSampleRateDivisor(); const s32 sample_rate_divisor = m_streaming_mixer.GetInputSampleRateDivisor();
auto const volume = m_streaming_mixer.GetVolume(); auto volume = m_streaming_mixer.GetVolume();
m_wave_writer_dtk.AddStereoSamplesBE(samples, static_cast<u32>(num_samples), m_wave_writer_dtk.AddStereoSamplesBE(samples, static_cast<u32>(num_samples),
sample_rate_divisor, volume.first, volume.second); sample_rate_divisor, volume.first, volume.second);
} }
@ -287,8 +286,7 @@ void Mixer::PushSkylanderPortalSamples(const u8* samples, std::size_t num_sample
{ {
for (std::size_t i = 0; i < num_samples; ++i) for (std::size_t i = 0; i < num_samples; ++i)
{ {
s16 const sample = s16 sample = static_cast<u16>(samples[i * 2 + 1]) << 8 | static_cast<u16>(samples[i * 2]);
static_cast<u16>(samples[i * 2 + 1]) << 8 | static_cast<u16>(samples[i * 2]);
samples_stereo[i * 2] = sample; samples_stereo[i * 2] = sample;
samples_stereo[i * 2 + 1] = sample; samples_stereo[i * 2 + 1] = sample;
} }
@ -337,8 +335,7 @@ void Mixer::StartLogDTKAudio(const std::string& filename)
{ {
if (!m_log_dtk_audio) if (!m_log_dtk_audio)
{ {
bool const success = bool success = m_wave_writer_dtk.Start(filename, m_streaming_mixer.GetInputSampleRateDivisor());
m_wave_writer_dtk.Start(filename, m_streaming_mixer.GetInputSampleRateDivisor());
if (success) if (success)
{ {
m_log_dtk_audio = true; m_log_dtk_audio = true;
@ -375,7 +372,7 @@ void Mixer::StartLogDSPAudio(const std::string& filename)
{ {
if (!m_log_dsp_audio) if (!m_log_dsp_audio)
{ {
bool const success = m_wave_writer_dsp.Start(filename, m_dma_mixer.GetInputSampleRateDivisor()); bool success = m_wave_writer_dsp.Start(filename, m_dma_mixer.GetInputSampleRateDivisor());
if (success) if (success)
{ {
m_log_dsp_audio = true; m_log_dsp_audio = true;
@ -497,10 +494,10 @@ void Mixer::MixerFifo::Enqueue()
0.0002984010f, 0.0002102045f, 0.0001443499f, 0.0000961509f, 0.0000616906f, 0.0000377350f, 0.0002984010f, 0.0002102045f, 0.0001443499f, 0.0000961509f, 0.0000616906f, 0.0000377350f,
0.0000216492f, 0.0000113187f, 0.0000050749f, 0.0000016272f}; 0.0000216492f, 0.0000113187f, 0.0000050749f, 0.0000016272f};
std::size_t const head = m_queue_head.load(std::memory_order_acquire); const std::size_t head = m_queue_head.load(std::memory_order_acquire);
// Check if we run out of space in the circular queue. (rare) // Check if we run out of space in the circular queue. (rare)
std::size_t const next_head = (head + 1) & GRANULE_QUEUE_MASK; std::size_t next_head = (head + 1) & GRANULE_QUEUE_MASK;
if (next_head == m_queue_tail.load(std::memory_order_acquire)) if (next_head == m_queue_tail.load(std::memory_order_acquire))
{ {
WARN_LOG_FMT(AUDIO, WARN_LOG_FMT(AUDIO,

View File

@ -3,9 +3,11 @@
#pragma once #pragma once
#include <algorithm>
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <bit> #include <bit>
#include <cmath>
#include "AudioCommon/SurroundDecoder.h" #include "AudioCommon/SurroundDecoder.h"
#include "AudioCommon/WaveFile.h" #include "AudioCommon/WaveFile.h"

View File

@ -76,7 +76,7 @@ static bool InitLibrary()
if (!InitFunctions()) if (!InitFunctions())
{ {
FreeLibrary(s_openal_dll); ::FreeLibrary(s_openal_dll);
s_openal_dll = nullptr; s_openal_dll = nullptr;
return false; return false;
} }
@ -168,7 +168,7 @@ bool OpenALStream::SetRunning(bool running)
static ALenum CheckALError(const char* desc) static ALenum CheckALError(const char* desc)
{ {
ALenum const err = palGetError(); ALenum err = palGetError();
if (err != AL_NO_ERROR) if (err != AL_NO_ERROR)
{ {
@ -211,16 +211,16 @@ void OpenALStream::SoundLoop()
{ {
Common::SetCurrentThreadName("Audio thread - openal"); Common::SetCurrentThreadName("Audio thread - openal");
bool const float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0; bool float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0;
bool const surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi(); bool surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi();
bool use_surround = Config::ShouldUseDPL2Decoder() && surround_capable; bool use_surround = Config::ShouldUseDPL2Decoder() && surround_capable;
// As there is no extension to check for 32-bit fixed point support // As there is no extension to check for 32-bit fixed point support
// and we know that only a X-Fi with hardware OpenAL supports it, // and we know that only a X-Fi with hardware OpenAL supports it,
// we just check if one is being used. // we just check if one is being used.
bool const fixed32_capable = IsCreativeXFi(); bool fixed32_capable = IsCreativeXFi();
u32 const frequency = m_mixer->GetSampleRate(); u32 frequency = m_mixer->GetSampleRate();
u32 frames_per_buffer; u32 frames_per_buffer;
// Can't have zero samples per buffer // Can't have zero samples per buffer
@ -288,12 +288,12 @@ void OpenALStream::SoundLoop()
num_buffers_queued -= num_buffers_processed; num_buffers_queued -= num_buffers_processed;
} }
unsigned int const min_frames = frames_per_buffer; unsigned int min_frames = frames_per_buffer;
if (use_surround) if (use_surround)
{ {
std::array<float, OAL_MAX_FRAMES * SURROUND_CHANNELS> dpl2; std::array<float, OAL_MAX_FRAMES * SURROUND_CHANNELS> dpl2;
u32 const rendered_frames = static_cast<u32>(m_mixer->MixSurround(dpl2.data(), min_frames)); u32 rendered_frames = static_cast<u32>(m_mixer->MixSurround(dpl2.data(), min_frames));
if (rendered_frames < min_frames) if (rendered_frames < min_frames)
continue; continue;
@ -351,8 +351,7 @@ void OpenALStream::SoundLoop()
} }
else else
{ {
u32 const rendered_frames = u32 rendered_frames = static_cast<u32>(m_mixer->Mix(m_realtime_buffer.data(), min_frames));
static_cast<u32>(m_mixer->Mix(m_realtime_buffer.data(), min_frames));
if (!rendered_frames) if (!rendered_frames)
continue; continue;

View File

@ -7,6 +7,9 @@
#include "AudioCommon/SoundStream.h" #include "AudioCommon/SoundStream.h"
#include "Common/Event.h" #include "Common/Event.h"
#include "Core/Core.h"
#include "Core/HW/AudioInterface.h"
#include "Core/HW/SystemTimers.h"
#ifdef _WIN32 #ifdef _WIN32
#include <al.h> #include <al.h>

View File

@ -8,6 +8,7 @@
#endif #endif
#include "AudioCommon/SoundStream.h" #include "AudioCommon/SoundStream.h"
#include "Common/CommonTypes.h"
#include "Common/Flag.h" #include "Common/Flag.h"
#include "Common/Thread.h" #include "Common/Thread.h"

View File

@ -32,7 +32,7 @@ size_t SurroundDecoder::QueryFramesNeededForSurroundOutput(const size_t output_f
if (m_decoded_fifo.size() < output_frames * SURROUND_CHANNELS) if (m_decoded_fifo.size() < output_frames * SURROUND_CHANNELS)
{ {
// Output stereo frames needed to have at least the desired number of surround frames // Output stereo frames needed to have at least the desired number of surround frames
size_t const frames_needed = output_frames - m_decoded_fifo.size() / SURROUND_CHANNELS; size_t frames_needed = output_frames - m_decoded_fifo.size() / SURROUND_CHANNELS;
return frames_needed + m_frame_block_size - frames_needed % m_frame_block_size; return frames_needed + m_frame_block_size - frames_needed % m_frame_block_size;
} }

View File

@ -8,6 +8,7 @@
// clang-format off // clang-format off
#include <Audioclient.h> #include <Audioclient.h>
#include <mmdeviceapi.h> #include <mmdeviceapi.h>
#include <devpkey.h>
#include <functiondiscoverykeys_devpkey.h> #include <functiondiscoverykeys_devpkey.h>
#include <wil/resource.h> #include <wil/resource.h>
// clang-format on // clang-format on
@ -158,9 +159,8 @@ ComPtr<IMMDevice> WASAPIStream::GetDeviceByName(std::string_view name)
bool WASAPIStream::Init() bool WASAPIStream::Init()
{ {
ASSERT(m_enumerator == nullptr); ASSERT(m_enumerator == nullptr);
HRESULT const result = HRESULT result = CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER,
CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(m_enumerator.GetAddressOf()));
IID_PPV_ARGS(m_enumerator.GetAddressOf()));
if (!HandleWinAPI("Failed to create MMDeviceEnumerator", result)) if (!HandleWinAPI("Failed to create MMDeviceEnumerator", result))
return false; return false;

View File

@ -32,7 +32,7 @@ class WASAPIStream final : public SoundStream
#ifdef _WIN32 #ifdef _WIN32
public: public:
explicit WASAPIStream(); explicit WASAPIStream();
~WASAPIStream() override; ~WASAPIStream();
bool Init() override; bool Init() override;
bool SetRunning(bool running) override; bool SetRunning(bool running) override;

View File

@ -31,7 +31,7 @@ public:
{ {
m_active_block = &m_output_result.blocks.emplace_back(base_addr); m_active_block = &m_output_result.blocks.emplace_back(base_addr);
} }
~GekkoIRPlugin() override = default; virtual ~GekkoIRPlugin() = default;
void OnDirectivePre(GekkoDirective directive) override; void OnDirectivePre(GekkoDirective directive) override;
void OnDirectivePost(GekkoDirective directive) override; void OnDirectivePost(GekkoDirective directive) override;

View File

@ -64,8 +64,6 @@ add_library(common
FatFsUtil.h FatFsUtil.h
FileSearch.cpp FileSearch.cpp
FileSearch.h FileSearch.h
FilesystemWatcher.cpp
FilesystemWatcher.h
FileUtil.cpp FileUtil.cpp
FileUtil.h FileUtil.h
FixedSizeQueue.h FixedSizeQueue.h
@ -186,7 +184,6 @@ PRIVATE
FatFs FatFs
Iconv::Iconv Iconv::Iconv
spng::spng spng::spng
watcher
${VTUNE_LIBRARIES} ${VTUNE_LIBRARIES}
) )

View File

@ -46,7 +46,8 @@ public:
ASSERT(!mbedtls_aes_setkey_dec(&ctx, key, 128)); ASSERT(!mbedtls_aes_setkey_dec(&ctx, key, 128));
} }
bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out, size_t len) const override virtual bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out,
size_t len) const override
{ {
std::array<u8, BLOCK_SIZE> iv_tmp{}; std::array<u8, BLOCK_SIZE> iv_tmp{};
if (iv) if (iv)
@ -205,7 +206,8 @@ public:
_mm_storeu_si128(&((__m128i*)buf_out)[d], block[d]); _mm_storeu_si128(&((__m128i*)buf_out)[d], block[d]);
} }
bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out, size_t len) const override virtual bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out,
size_t len) const override
{ {
if (len % BLOCK_SIZE) if (len % BLOCK_SIZE)
return false; return false;

View File

@ -41,18 +41,18 @@ public:
mbedtls_sha1_init(&ctx); mbedtls_sha1_init(&ctx);
ASSERT(!mbedtls_sha1_starts_ret(&ctx)); ASSERT(!mbedtls_sha1_starts_ret(&ctx));
} }
~ContextMbed() override { mbedtls_sha1_free(&ctx); } ~ContextMbed() { mbedtls_sha1_free(&ctx); }
void Update(const u8* msg, size_t len) override virtual void Update(const u8* msg, size_t len) override
{ {
ASSERT(!mbedtls_sha1_update_ret(&ctx, msg, len)); ASSERT(!mbedtls_sha1_update_ret(&ctx, msg, len));
} }
Digest Finish() override virtual Digest Finish() override
{ {
Digest digest; Digest digest;
ASSERT(!mbedtls_sha1_finish_ret(&ctx, digest.data())); ASSERT(!mbedtls_sha1_finish_ret(&ctx, digest.data()));
return digest; return digest;
} }
bool HwAccelerated() const override { return false; } virtual bool HwAccelerated() const override { return false; }
private: private:
mbedtls_sha1_context ctx{}; mbedtls_sha1_context ctx{};
@ -204,7 +204,7 @@ private:
} }
ATTRIBUTE_TARGET("sha") ATTRIBUTE_TARGET("sha")
void ProcessBlock(const u8* msg) override virtual void ProcessBlock(const u8* msg) override
{ {
// There are 80 rounds with 4 bytes per round, giving 0x140 byte work space, but we can keep // There are 80 rounds with 4 bytes per round, giving 0x140 byte work space, but we can keep
// active state in just 0x40 bytes. // active state in just 0x40 bytes.
@ -248,7 +248,7 @@ private:
// clang-format on // clang-format on
} }
Digest GetDigest() override virtual Digest GetDigest() override
{ {
Digest digest; Digest digest;
_mm_storeu_si128((__m128i*)&digest[0], byterev_16B(state[0])); _mm_storeu_si128((__m128i*)&digest[0], byterev_16B(state[0]));
@ -257,7 +257,7 @@ private:
return digest; return digest;
} }
bool HwAccelerated() const override { return true; } virtual bool HwAccelerated() const override { return true; }
std::array<XmmReg, 2> state{}; std::array<XmmReg, 2> state{};
}; };

View File

@ -1,67 +0,0 @@
// Copyright 2025 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "Common/FilesystemWatcher.h"
#include <wtr/watcher.hpp>
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"
namespace Common
{
FilesystemWatcher::FilesystemWatcher() = default;
FilesystemWatcher::~FilesystemWatcher() = default;
void FilesystemWatcher::Watch(const std::string& path)
{
const auto [iter, inserted] = m_watched_paths.try_emplace(path, nullptr);
if (inserted)
{
iter->second = std::make_unique<wtr::watch>(path, [this](wtr::event e) {
const auto watched_path = PathToString(e.path_name);
if (e.path_type == wtr::event::path_type::watcher)
{
if (watched_path.starts_with('e'))
ERROR_LOG_FMT(COMMON, "Filesystem watcher: '{}'", watched_path);
else if (watched_path.starts_with('w'))
WARN_LOG_FMT(COMMON, "Filesystem watcher: '{}'", watched_path);
return;
}
if (e.effect_type == wtr::event::effect_type::create)
{
const auto path = WithUnifiedPathSeparators(watched_path);
PathAdded(path);
}
else if (e.effect_type == wtr::event::effect_type::modify)
{
const auto path = WithUnifiedPathSeparators(watched_path);
PathModified(path);
}
else if (e.effect_type == wtr::event::effect_type::rename)
{
if (!e.associated)
{
WARN_LOG_FMT(COMMON, "Rename on path '{}' seen without association!", watched_path);
return;
}
const auto old_path = WithUnifiedPathSeparators(watched_path);
const auto new_path = WithUnifiedPathSeparators(PathToString(e.associated->path_name));
PathRenamed(old_path, new_path);
}
else if (e.effect_type == wtr::event::effect_type::destroy)
{
const auto path = WithUnifiedPathSeparators(watched_path);
PathDeleted(path);
}
});
}
}
void FilesystemWatcher::Unwatch(const std::string& path)
{
m_watched_paths.erase(path);
}
} // namespace Common

View File

@ -1,47 +0,0 @@
// Copyright 2025 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <map>
#include <memory>
#include <string>
#include <string_view>
namespace wtr
{
inline namespace watcher
{
class watch;
}
} // namespace wtr
namespace Common
{
// A class that can watch a path and receive callbacks
// when files or directories underneath that path receive events
class FilesystemWatcher
{
public:
FilesystemWatcher();
virtual ~FilesystemWatcher();
void Watch(const std::string& path);
void Unwatch(const std::string& path);
private:
// A new file or folder was added to one of the watched paths
virtual void PathAdded(std::string_view path) {}
// A file or folder was modified in one of the watched paths
virtual void PathModified(std::string_view path) {}
// A file or folder was renamed in one of the watched paths
virtual void PathRenamed(std::string_view old_path, std::string_view new_path) {}
// A file or folder was deleted in one of the watched paths
virtual void PathDeleted(std::string_view path) {}
std::map<std::string, std::unique_ptr<wtr::watch>> m_watched_paths;
};
} // namespace Common

View File

@ -10,9 +10,9 @@
class GLContextWGL final : public GLContext class GLContextWGL final : public GLContext
{ {
public: public:
~GLContextWGL() override; ~GLContextWGL();
bool IsHeadless() const override; bool IsHeadless() const;
std::unique_ptr<GLContext> CreateSharedContext() override; std::unique_ptr<GLContext> CreateSharedContext() override;

View File

@ -101,7 +101,7 @@ class HostDisassemblerBochs final : public HostDisassembler
{ {
public: public:
explicit HostDisassemblerBochs(); explicit HostDisassemblerBochs();
~HostDisassemblerBochs() override = default; ~HostDisassemblerBochs() = default;
private: private:
disassembler m_disasm; disassembler m_disasm;

View File

@ -9,7 +9,7 @@ class ConsoleListener : public Common::Log::LogListener
{ {
public: public:
ConsoleListener(); ConsoleListener();
~ConsoleListener() override; ~ConsoleListener();
void Log(Common::Log::LogLevel level, const char* text) override; void Log(Common::Log::LogLevel level, const char* text) override;

View File

@ -20,7 +20,7 @@ public:
explicit DolReader(const std::string& filename); explicit DolReader(const std::string& filename);
explicit DolReader(File::IOFile file); explicit DolReader(File::IOFile file);
explicit DolReader(std::vector<u8> buffer); explicit DolReader(std::vector<u8> buffer);
~DolReader() override; ~DolReader();
bool IsValid() const override { return m_is_valid; } bool IsValid() const override { return m_is_valid; }
bool IsWii() const override { return m_is_wii; } bool IsWii() const override { return m_is_wii; }

View File

@ -28,7 +28,7 @@ public:
explicit ElfReader(const std::string& filename); explicit ElfReader(const std::string& filename);
explicit ElfReader(File::IOFile file); explicit ElfReader(File::IOFile file);
explicit ElfReader(std::vector<u8> buffer); explicit ElfReader(std::vector<u8> buffer);
~ElfReader() override; ~ElfReader();
u32 Read32(int off) const { return base32[off >> 2]; } u32 Read32(int off) const { return base32[off >> 2]; }
// Quick accessors // Quick accessors
ElfType GetType() const { return (ElfType)(header->e_type); } ElfType GetType() const { return (ElfType)(header->e_type); }

View File

@ -45,7 +45,6 @@ const Info<bool> MAIN_ACCURATE_CPU_CACHE{{System::Main, "Core", "AccurateCPUCach
const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true}; const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true};
const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100}; const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100};
const Info<int> MAIN_TIMING_VARIANCE{{System::Main, "Core", "TimingVariance"}, 40}; const Info<int> MAIN_TIMING_VARIANCE{{System::Main, "Core", "TimingVariance"}, 40};
const Info<bool> MAIN_CORRECT_TIME_DRIFT{{System::Main, "Core", "CorrectTimeDrift"}, false};
const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, true}; const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, true};
const Info<bool> MAIN_SYNC_ON_SKIP_IDLE{{System::Main, "Core", "SyncOnSkipIdle"}, true}; const Info<bool> MAIN_SYNC_ON_SKIP_IDLE{{System::Main, "Core", "SyncOnSkipIdle"}, true};
const Info<std::string> MAIN_DEFAULT_ISO{{System::Main, "Core", "DefaultISO"}, ""}; const Info<std::string> MAIN_DEFAULT_ISO{{System::Main, "Core", "DefaultISO"}, ""};

View File

@ -63,7 +63,6 @@ extern const Info<bool> MAIN_ACCURATE_CPU_CACHE;
extern const Info<bool> MAIN_DSP_HLE; extern const Info<bool> MAIN_DSP_HLE;
extern const Info<int> MAIN_MAX_FALLBACK; extern const Info<int> MAIN_MAX_FALLBACK;
extern const Info<int> MAIN_TIMING_VARIANCE; extern const Info<int> MAIN_TIMING_VARIANCE;
extern const Info<bool> MAIN_CORRECT_TIME_DRIFT;
extern const Info<bool> MAIN_CPU_THREAD; extern const Info<bool> MAIN_CPU_THREAD;
extern const Info<bool> MAIN_SYNC_ON_SKIP_IDLE; extern const Info<bool> MAIN_SYNC_ON_SKIP_IDLE;
extern const Info<std::string> MAIN_DEFAULT_ISO; extern const Info<std::string> MAIN_DEFAULT_ISO;

View File

@ -82,6 +82,7 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h" #include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/GCAdapter.h" #include "InputCommon/GCAdapter.h"
#include "VideoCommon/Assets/CustomAssetLoader.h"
#include "VideoCommon/AsyncRequests.h" #include "VideoCommon/AsyncRequests.h"
#include "VideoCommon/Fifo.h" #include "VideoCommon/Fifo.h"
#include "VideoCommon/FrameDumper.h" #include "VideoCommon/FrameDumper.h"
@ -527,6 +528,9 @@ static void EmuThread(Core::System& system, std::unique_ptr<BootParameters> boot
FreeLook::LoadInputConfig(); FreeLook::LoadInputConfig();
system.GetCustomAssetLoader().Init();
Common::ScopeGuard asset_loader_guard([&system] { system.GetCustomAssetLoader().Shutdown(); });
system.GetMovie().Init(*boot); system.GetMovie().Init(*boot);
Common::ScopeGuard movie_guard([&system] { system.GetMovie().Shutdown(); }); Common::ScopeGuard movie_guard([&system] { system.GetMovie().Shutdown(); });

View File

@ -105,20 +105,10 @@ void CoreTimingManager::Init()
m_last_oc_factor = m_config_oc_factor; m_last_oc_factor = m_config_oc_factor;
m_globals.last_OC_factor_inverted = m_config_oc_inv_factor; m_globals.last_OC_factor_inverted = m_config_oc_inv_factor;
m_on_state_changed_handle = Core::AddOnStateChangedCallback([this](Core::State state) {
if (state == Core::State::Running)
{
// We don't want Throttle to attempt catch-up for all the time lost while paused.
ResetThrottle(GetTicks());
}
});
} }
void CoreTimingManager::Shutdown() void CoreTimingManager::Shutdown()
{ {
Core::RemoveOnStateChangedCallback(&m_on_state_changed_handle);
std::lock_guard lk(m_ts_write_lock); std::lock_guard lk(m_ts_write_lock);
MoveEvents(); MoveEvents();
ClearPendingEvents(); ClearPendingEvents();
@ -141,8 +131,6 @@ void CoreTimingManager::RefreshConfig()
m_max_variance = std::chrono::duration_cast<DT>(DT_ms(Config::Get(Config::MAIN_TIMING_VARIANCE))); m_max_variance = std::chrono::duration_cast<DT>(DT_ms(Config::Get(Config::MAIN_TIMING_VARIANCE)));
m_correct_time_drift = Config::Get(Config::MAIN_CORRECT_TIME_DRIFT);
if (AchievementManager::GetInstance().IsHardcoreModeActive() && if (AchievementManager::GetInstance().IsHardcoreModeActive() &&
Config::Get(Config::MAIN_EMULATION_SPEED) < 1.0f && Config::Get(Config::MAIN_EMULATION_SPEED) < 1.0f &&
Config::Get(Config::MAIN_EMULATION_SPEED) > 0.0f) Config::Get(Config::MAIN_EMULATION_SPEED) > 0.0f)
@ -440,9 +428,7 @@ void CoreTimingManager::Throttle(const s64 target_cycle)
const TimePoint time = Clock::now(); const TimePoint time = Clock::now();
const TimePoint min_target = time - m_max_fallback; const TimePoint min_target = time - m_max_fallback;
if (target_time < min_target)
// "Correct Time Drift" setting prevents timing relaxing.
if (!m_correct_time_drift && target_time < min_target)
{ {
// Core is running too slow.. i.e. CPU bottleneck. // Core is running too slow.. i.e. CPU bottleneck.
const DT adjustment = min_target - target_time; const DT adjustment = min_target - target_time;

View File

@ -211,7 +211,6 @@ private:
DT m_max_fallback = {}; DT m_max_fallback = {};
DT m_max_variance = {}; DT m_max_variance = {};
bool m_correct_time_drift = false;
double m_emulation_speed = 1.0; double m_emulation_speed = 1.0;
bool IsSpeedUnlimited() const; bool IsSpeedUnlimited() const;
@ -226,8 +225,6 @@ private:
std::atomic_bool m_use_precision_timer = false; std::atomic_bool m_use_precision_timer = false;
Common::PrecisionTimer m_precision_cpu_timer; Common::PrecisionTimer m_precision_cpu_timer;
Common::PrecisionTimer m_precision_gpu_timer; Common::PrecisionTimer m_precision_gpu_timer;
int m_on_state_changed_handle;
}; };
} // namespace CoreTiming } // namespace CoreTiming

View File

@ -132,7 +132,7 @@ class OSThreadView : public Common::Debug::ThreadView
{ {
public: public:
explicit OSThreadView(const Core::CPUThreadGuard& guard, u32 addr); explicit OSThreadView(const Core::CPUThreadGuard& guard, u32 addr);
~OSThreadView() override = default; ~OSThreadView() = default;
const OSThread& Data() const; const OSThread& Data() const;

View File

@ -220,7 +220,7 @@ class FifoPlayer::CPUCore final : public CPUCoreBase
public: public:
explicit CPUCore(FifoPlayer* parent) : m_parent(parent) {} explicit CPUCore(FifoPlayer* parent) : m_parent(parent) {}
CPUCore(const CPUCore&) = delete; CPUCore(const CPUCore&) = delete;
~CPUCore() override {} ~CPUCore() {}
CPUCore& operator=(const CPUCore&) = delete; CPUCore& operator=(const CPUCore&) = delete;
void Init() override void Init() override

View File

@ -157,7 +157,7 @@ class VAListStruct : public VAList
{ {
public: public:
explicit VAListStruct(const Core::CPUThreadGuard& guard, u32 address); explicit VAListStruct(const Core::CPUThreadGuard& guard, u32 address);
~VAListStruct() override = default; ~VAListStruct() = default;
private: private:
struct svr4_va_list struct svr4_va_list

View File

@ -28,7 +28,7 @@ public:
DSPHLE(DSPHLE&& other) = delete; DSPHLE(DSPHLE&& other) = delete;
DSPHLE& operator=(const DSPHLE& other) = delete; DSPHLE& operator=(const DSPHLE& other) = delete;
DSPHLE& operator=(DSPHLE&& other) = delete; DSPHLE& operator=(DSPHLE&& other) = delete;
~DSPHLE() override; ~DSPHLE();
bool Initialize(bool wii, bool dsp_thread) override; bool Initialize(bool wii, bool dsp_thread) override;
void Shutdown() override; void Shutdown() override;

View File

@ -27,7 +27,7 @@ public:
AESndAccelerator(AESndAccelerator&&) = delete; AESndAccelerator(AESndAccelerator&&) = delete;
AESndAccelerator& operator=(const AESndAccelerator&) = delete; AESndAccelerator& operator=(const AESndAccelerator&) = delete;
AESndAccelerator& operator=(AESndAccelerator&&) = delete; AESndAccelerator& operator=(AESndAccelerator&&) = delete;
~AESndAccelerator() override; ~AESndAccelerator();
protected: protected:
void OnRawReadEndException() override {} void OnRawReadEndException() override {}

View File

@ -129,7 +129,7 @@ public:
HLEAccelerator(HLEAccelerator&&) = delete; HLEAccelerator(HLEAccelerator&&) = delete;
HLEAccelerator& operator=(const HLEAccelerator&) = delete; HLEAccelerator& operator=(const HLEAccelerator&) = delete;
HLEAccelerator& operator=(HLEAccelerator&&) = delete; HLEAccelerator& operator=(HLEAccelerator&&) = delete;
~HLEAccelerator() override = default; ~HLEAccelerator() = default;
PB_TYPE* acc_pb = nullptr; PB_TYPE* acc_pb = nullptr;

View File

@ -20,7 +20,7 @@ class DSPLLE : public DSPEmulator
{ {
public: public:
DSPLLE(); DSPLLE();
~DSPLLE() override; ~DSPLLE();
bool Initialize(bool wii, bool dsp_thread) override; bool Initialize(bool wii, bool dsp_thread) override;
void Shutdown() override; void Shutdown() override;

View File

@ -18,7 +18,7 @@ class CEXIAgp : public IEXIDevice
{ {
public: public:
CEXIAgp(Core::System& system, const Slot slot); CEXIAgp(Core::System& system, const Slot slot);
~CEXIAgp() override; virtual ~CEXIAgp() override;
bool IsPresent() const override { return true; } bool IsPresent() const override { return true; }
void ImmWrite(u32 _uData, u32 _uSize) override; void ImmWrite(u32 _uData, u32 _uSize) override;
u32 ImmRead(u32 _uSize) override; u32 ImmRead(u32 _uSize) override;

View File

@ -216,7 +216,7 @@ class CEXIETHERNET : public IEXIDevice
{ {
public: public:
CEXIETHERNET(Core::System& system, BBADeviceType type); CEXIETHERNET(Core::System& system, BBADeviceType type);
~CEXIETHERNET() override; virtual ~CEXIETHERNET();
void SetCS(int cs) override; void SetCS(int cs) override;
bool IsPresent() const override; bool IsPresent() const override;
bool IsInterruptSet() override; bool IsInterruptSet() override;

View File

@ -18,7 +18,7 @@ class CEXIMic : public IEXIDevice
{ {
public: public:
CEXIMic(Core::System& system, const int index); CEXIMic(Core::System& system, const int index);
~CEXIMic() override; virtual ~CEXIMic();
void SetCS(int cs) override; void SetCS(int cs) override;
bool IsInterruptSet() override; bool IsInterruptSet() override;
bool IsPresent() const override; bool IsPresent() const override;

View File

@ -33,7 +33,7 @@ class CEXIModem : public IEXIDevice
{ {
public: public:
CEXIModem(Core::System& system, ModemDeviceType type); CEXIModem(Core::System& system, ModemDeviceType type);
~CEXIModem() override; virtual ~CEXIModem();
void SetCS(int cs) override; void SetCS(int cs) override;
bool IsPresent() const override; bool IsPresent() const override;
bool IsInterruptSet() override; bool IsInterruptSet() override;
@ -136,13 +136,13 @@ private:
TAPServerNetworkInterface(CEXIModem* modem_ref, const std::string& destination); TAPServerNetworkInterface(CEXIModem* modem_ref, const std::string& destination);
public: public:
bool Activate() override; virtual bool Activate() override;
void Deactivate() override; virtual void Deactivate() override;
bool IsActivated() override; virtual bool IsActivated() override;
bool SendAndRemoveAllHDLCFrames(std::string* send_buffer) override; virtual bool SendAndRemoveAllHDLCFrames(std::string* send_buffer) override;
bool RecvInit() override; virtual bool RecvInit() override;
void RecvStart() override; virtual void RecvStart() override;
void RecvStop() override; virtual void RecvStop() override;
private: private:
TAPServerConnection m_tapserver_if; TAPServerConnection m_tapserver_if;

View File

@ -24,7 +24,7 @@ class GCMemcardDirectory : public MemoryCardBase
public: public:
GCMemcardDirectory(const std::string& directory, ExpansionInterface::Slot slot, GCMemcardDirectory(const std::string& directory, ExpansionInterface::Slot slot,
const Memcard::HeaderData& header_data, u32 game_id); const Memcard::HeaderData& header_data, u32 game_id);
~GCMemcardDirectory() override; ~GCMemcardDirectory();
GCMemcardDirectory(const GCMemcardDirectory&) = delete; GCMemcardDirectory(const GCMemcardDirectory&) = delete;
GCMemcardDirectory& operator=(const GCMemcardDirectory&) = delete; GCMemcardDirectory& operator=(const GCMemcardDirectory&) = delete;

View File

@ -19,7 +19,7 @@ class MemoryCard : public MemoryCardBase
public: public:
MemoryCard(const std::string& filename, ExpansionInterface::Slot card_slot, MemoryCard(const std::string& filename, ExpansionInterface::Slot card_slot,
u16 size_mbits = Memcard::MBIT_SIZE_MEMORY_CARD_2043); u16 size_mbits = Memcard::MBIT_SIZE_MEMORY_CARD_2043);
~MemoryCard() override; ~MemoryCard();
void FlushThread(); void FlushThread();
void MakeDirty(); void MakeDirty();

View File

@ -39,7 +39,7 @@ class ConstantHandlingMethod : public ReadHandlingMethod<T>
{ {
public: public:
explicit ConstantHandlingMethod(T value) : value_(value) {} explicit ConstantHandlingMethod(T value) : value_(value) {}
~ConstantHandlingMethod() override = default; virtual ~ConstantHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{ {
v.VisitConstant(value_); v.VisitConstant(value_);
@ -62,7 +62,7 @@ class NopHandlingMethod : public WriteHandlingMethod<T>
{ {
public: public:
NopHandlingMethod() {} NopHandlingMethod() {}
~NopHandlingMethod() override = default; virtual ~NopHandlingMethod() = default;
void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const override { v.VisitNop(); } void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const override { v.VisitNop(); }
}; };
template <typename T> template <typename T>
@ -79,7 +79,7 @@ class DirectHandlingMethod : public ReadHandlingMethod<T>, public WriteHandlingM
{ {
public: public:
DirectHandlingMethod(T* addr, u32 mask) : addr_(addr), mask_(mask) {} DirectHandlingMethod(T* addr, u32 mask) : addr_(addr), mask_(mask) {}
~DirectHandlingMethod() override = default; virtual ~DirectHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{ {
v.VisitDirect(addr_, mask_); v.VisitDirect(addr_, mask_);
@ -122,7 +122,7 @@ public:
{ {
} }
~ComplexHandlingMethod() override = default; virtual ~ComplexHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{ {
v.VisitComplex(&read_lambda_); v.VisitComplex(&read_lambda_);

View File

@ -21,7 +21,7 @@ class CSIDevice_GBAEmu final : public ISIDevice
{ {
public: public:
CSIDevice_GBAEmu(Core::System& system, SIDevices device, int device_number); CSIDevice_GBAEmu(Core::System& system, SIDevices device, int device_number);
~CSIDevice_GBAEmu() override; ~CSIDevice_GBAEmu();
int RunBuffer(u8* buffer, int request_length) override; int RunBuffer(u8* buffer, int request_length) override;
int TransferInterval() override; int TransferInterval() override;

View File

@ -120,7 +120,7 @@ protected:
using EncryptedExtension::EncryptedExtension; using EncryptedExtension::EncryptedExtension;
private: private:
void UpdateEncryptionKey() final; void UpdateEncryptionKey() final override;
}; };
class Extension3rdParty : public EncryptedExtension class Extension3rdParty : public EncryptedExtension
@ -129,7 +129,7 @@ protected:
using EncryptedExtension::EncryptedExtension; using EncryptedExtension::EncryptedExtension;
private: private:
void UpdateEncryptionKey() final; void UpdateEncryptionKey() final override;
}; };
} // namespace WiimoteEmu } // namespace WiimoteEmu

View File

@ -137,7 +137,7 @@ public:
static constexpr const char* SIDEWAYS_OPTION = "Sideways Wiimote"; static constexpr const char* SIDEWAYS_OPTION = "Sideways Wiimote";
explicit Wiimote(unsigned int index); explicit Wiimote(unsigned int index);
~Wiimote() override; ~Wiimote();
std::string GetName() const override; std::string GetName() const override;

View File

@ -34,7 +34,7 @@ class WiimoteScannerHidapi final : public WiimoteScannerBackend
{ {
public: public:
WiimoteScannerHidapi(); WiimoteScannerHidapi();
~WiimoteScannerHidapi() override; ~WiimoteScannerHidapi();
bool IsReady() const override; bool IsReady() const override;
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override; void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
void Update() override {} // not needed for hidapi void Update() override {} // not needed for hidapi

View File

@ -233,7 +233,7 @@ class HotkeyManager : public ControllerEmu::EmulatedController
{ {
public: public:
HotkeyManager(); HotkeyManager();
~HotkeyManager() override; ~HotkeyManager();
void GetInput(HotkeyStatus* hk, bool ignore_focus); void GetInput(HotkeyStatus* hk, bool ignore_focus);
std::string GetName() const override; std::string GetName() const override;

View File

@ -234,7 +234,7 @@ public:
ESDevice(ESDevice&& other) = delete; ESDevice(ESDevice&& other) = delete;
ESDevice& operator=(const ESDevice& other) = delete; ESDevice& operator=(const ESDevice& other) = delete;
ESDevice& operator=(ESDevice&& other) = delete; ESDevice& operator=(ESDevice&& other) = delete;
~ESDevice() override; ~ESDevice();
static void InitializeEmulationState(CoreTiming::CoreTimingManager& core_timing); static void InitializeEmulationState(CoreTiming::CoreTimingManager& core_timing);
static void FinalizeEmulationState(); static void FinalizeEmulationState();

View File

@ -117,7 +117,7 @@ class FSDevice final : public EmulationDevice
{ {
public: public:
FSDevice(EmulationKernel& ios, FSCore& core, const std::string& device_name); FSDevice(EmulationKernel& ios, FSCore& core, const std::string& device_name);
~FSDevice() override; ~FSDevice();
void DoState(PointerWrap& p) override; void DoState(PointerWrap& p) override;

View File

@ -23,7 +23,7 @@ class HostFileSystem final : public FileSystem
{ {
public: public:
HostFileSystem(const std::string& root_path, std::vector<NandRedirect> nand_redirects = {}); HostFileSystem(const std::string& root_path, std::vector<NandRedirect> nand_redirects = {});
~HostFileSystem() override; ~HostFileSystem();
void DoState(PointerWrap& p) override; void DoState(PointerWrap& p) override;

View File

@ -153,7 +153,7 @@ class EmulationKernel final : public Kernel
{ {
public: public:
EmulationKernel(Core::System& system, u64 ios_title_id); EmulationKernel(Core::System& system, u64 ios_title_id);
~EmulationKernel() override; ~EmulationKernel();
// Get a resource manager by name. // Get a resource manager by name.
// This only works for devices which are part of the device map. // This only works for devices which are part of the device map.

View File

@ -84,7 +84,7 @@ class NetSSLDevice : public EmulationDevice
public: public:
NetSSLDevice(EmulationKernel& ios, const std::string& device_name); NetSSLDevice(EmulationKernel& ios, const std::string& device_name);
~NetSSLDevice() override; virtual ~NetSSLDevice();
std::optional<IPCReply> IOCtl(const IOCtlRequest& request) override; std::optional<IPCReply> IOCtl(const IOCtlRequest& request) override;
std::optional<IPCReply> IOCtlV(const IOCtlVRequest& request) override; std::optional<IPCReply> IOCtlV(const IOCtlVRequest& request) override;

View File

@ -41,7 +41,7 @@ class BluetoothEmuDevice final : public BluetoothBaseDevice
public: public:
BluetoothEmuDevice(EmulationKernel& ios, const std::string& device_name); BluetoothEmuDevice(EmulationKernel& ios, const std::string& device_name);
~BluetoothEmuDevice() override; virtual ~BluetoothEmuDevice();
std::optional<IPCReply> Close(u32 fd) override; std::optional<IPCReply> Close(u32 fd) override;
std::optional<IPCReply> IOCtlV(const IOCtlVRequest& request) override; std::optional<IPCReply> IOCtlV(const IOCtlVRequest& request) override;

View File

@ -73,7 +73,7 @@ class SkylanderUSB final : public Device
{ {
public: public:
SkylanderUSB(); SkylanderUSB();
~SkylanderUSB() override; ~SkylanderUSB();
DeviceDescriptor GetDeviceDescriptor() const override; DeviceDescriptor GetDeviceDescriptor() const override;
std::vector<ConfigDescriptor> GetConfigurations() const override; std::vector<ConfigDescriptor> GetConfigurations() const override;
std::vector<InterfaceDescriptor> GetInterfaces(u8 config) const override; std::vector<InterfaceDescriptor> GetInterfaces(u8 config) const override;

View File

@ -78,8 +78,8 @@ std::string USBHost::GetDeviceNameFromVIDPID(u16 vid, u16 pid)
libusb_get_string_descriptor_ascii(handle, desc.iProduct, buffer, sizeof(buffer)) > 0) libusb_get_string_descriptor_ascii(handle, desc.iProduct, buffer, sizeof(buffer)) > 0)
{ {
device_name = reinterpret_cast<char*>(buffer); device_name = reinterpret_cast<char*>(buffer);
libusb_close(handle);
} }
libusb_close(handle);
} }
return false; return false;
} }

View File

@ -25,7 +25,7 @@ class USBHost : public EmulationDevice
{ {
public: public:
USBHost(EmulationKernel& ios, const std::string& device_name); USBHost(EmulationKernel& ios, const std::string& device_name);
~USBHost() override; virtual ~USBHost();
std::optional<IPCReply> Open(const OpenRequest& request) override; std::optional<IPCReply> Open(const OpenRequest& request) override;

View File

@ -27,7 +27,7 @@ class LibusbDevice final : public Device
{ {
public: public:
LibusbDevice(libusb_device* device, const libusb_device_descriptor& device_descriptor); LibusbDevice(libusb_device* device, const libusb_device_descriptor& device_descriptor);
~LibusbDevice() override; ~LibusbDevice();
DeviceDescriptor GetDeviceDescriptor() const override; DeviceDescriptor GetDeviceDescriptor() const override;
std::vector<ConfigDescriptor> GetConfigurations() const override; std::vector<ConfigDescriptor> GetConfigurations() const override;
std::vector<InterfaceDescriptor> GetInterfaces(u8 config) const override; std::vector<InterfaceDescriptor> GetInterfaces(u8 config) const override;

View File

@ -116,7 +116,7 @@ public:
NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog, NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog,
const std::string& name, const NetTraversalConfig& traversal_config); const std::string& name, const NetTraversalConfig& traversal_config);
~NetPlayClient() override; ~NetPlayClient();
std::vector<const Player*> GetPlayers(); std::vector<const Player*> GetPlayers();
const NetSettings& GetNetSettings() const; const NetSettings& GetNetSettings() const;

View File

@ -44,7 +44,7 @@ public:
NetPlayServer(u16 port, bool forward_port, NetPlayUI* dialog, NetPlayServer(u16 port, bool forward_port, NetPlayUI* dialog,
const NetTraversalConfig& traversal_config); const NetTraversalConfig& traversal_config);
~NetPlayServer() override; ~NetPlayServer();
bool ChangeGame(const SyncIdentifier& sync_identifier, const std::string& netplay_name); bool ChangeGame(const SyncIdentifier& sync_identifier, const std::string& netplay_name);
bool ComputeGameDigest(const SyncIdentifier& sync_identifier); bool ComputeGameDigest(const SyncIdentifier& sync_identifier);

View File

@ -86,7 +86,7 @@ class PCAPSSLCaptureLogger final : public NetworkCaptureLogger
{ {
public: public:
PCAPSSLCaptureLogger(); PCAPSSLCaptureLogger();
~PCAPSSLCaptureLogger() override; ~PCAPSSLCaptureLogger();
void OnNewSocket(s32 socket) override; void OnNewSocket(s32 socket) override;

View File

@ -31,7 +31,7 @@ public:
CachedInterpreter(CachedInterpreter&&) = delete; CachedInterpreter(CachedInterpreter&&) = delete;
CachedInterpreter& operator=(const CachedInterpreter&) = delete; CachedInterpreter& operator=(const CachedInterpreter&) = delete;
CachedInterpreter& operator=(CachedInterpreter&&) = delete; CachedInterpreter& operator=(CachedInterpreter&&) = delete;
~CachedInterpreter() override; ~CachedInterpreter();
void Init() override; void Init() override;
void Shutdown() override; void Shutdown() override;

View File

@ -30,7 +30,7 @@ public:
Interpreter(Interpreter&&) = delete; Interpreter(Interpreter&&) = delete;
Interpreter& operator=(const Interpreter&) = delete; Interpreter& operator=(const Interpreter&) = delete;
Interpreter& operator=(Interpreter&&) = delete; Interpreter& operator=(Interpreter&&) = delete;
~Interpreter() override; ~Interpreter();
void Init() override; void Init() override;
void Shutdown() override; void Shutdown() override;

View File

@ -8,7 +8,7 @@
class CSVSignatureDB final : public HashSignatureDB class CSVSignatureDB final : public HashSignatureDB
{ {
public: public:
~CSVSignatureDB() override = default; ~CSVSignatureDB() = default;
bool Load(const std::string& file_path) override; bool Load(const std::string& file_path) override;
bool Save(const std::string& file_path) const override; bool Save(const std::string& file_path) const override;
}; };

View File

@ -8,7 +8,7 @@
class DSYSignatureDB final : public HashSignatureDB class DSYSignatureDB final : public HashSignatureDB
{ {
public: public:
~DSYSignatureDB() override = default; ~DSYSignatureDB() = default;
bool Load(const std::string& file_path) override; bool Load(const std::string& file_path) override;
bool Save(const std::string& file_path) const override; bool Save(const std::string& file_path) const override;
}; };

View File

@ -33,7 +33,7 @@
#include "IOS/USB/Emulated/Infinity.h" #include "IOS/USB/Emulated/Infinity.h"
#include "IOS/USB/Emulated/Skylanders/Skylander.h" #include "IOS/USB/Emulated/Skylanders/Skylander.h"
#include "IOS/USB/USBScanner.h" #include "IOS/USB/USBScanner.h"
#include "VideoCommon/Assets/CustomResourceManager.h" #include "VideoCommon/Assets/CustomAssetLoader.h"
#include "VideoCommon/CommandProcessor.h" #include "VideoCommon/CommandProcessor.h"
#include "VideoCommon/Fifo.h" #include "VideoCommon/Fifo.h"
#include "VideoCommon/GeometryShaderManager.h" #include "VideoCommon/GeometryShaderManager.h"
@ -96,7 +96,7 @@ struct System::Impl
VideoInterface::VideoInterfaceManager m_video_interface; VideoInterface::VideoInterfaceManager m_video_interface;
Interpreter m_interpreter; Interpreter m_interpreter;
JitInterface m_jit_interface; JitInterface m_jit_interface;
VideoCommon::CustomResourceManager m_custom_resource_manager; VideoCommon::CustomAssetLoader m_custom_asset_loader;
FifoPlayer m_fifo_player; FifoPlayer m_fifo_player;
FifoRecorder m_fifo_recorder; FifoRecorder m_fifo_recorder;
Movie::MovieManager m_movie; Movie::MovieManager m_movie;
@ -335,8 +335,8 @@ VideoInterface::VideoInterfaceManager& System::GetVideoInterface() const
return m_impl->m_video_interface; return m_impl->m_video_interface;
} }
VideoCommon::CustomResourceManager& System::GetCustomResourceManager() const VideoCommon::CustomAssetLoader& System::GetCustomAssetLoader() const
{ {
return m_impl->m_custom_resource_manager; return m_impl->m_custom_asset_loader;
} }
} // namespace Core } // namespace Core

View File

@ -108,8 +108,8 @@ class SystemTimersManager;
} }
namespace VideoCommon namespace VideoCommon
{ {
class CustomResourceManager; class CustomAssetLoader;
} // namespace VideoCommon }
namespace VideoInterface namespace VideoInterface
{ {
class VideoInterfaceManager; class VideoInterfaceManager;
@ -197,7 +197,7 @@ public:
VertexShaderManager& GetVertexShaderManager() const; VertexShaderManager& GetVertexShaderManager() const;
XFStateManager& GetXFStateManager() const; XFStateManager& GetXFStateManager() const;
VideoInterface::VideoInterfaceManager& GetVideoInterface() const; VideoInterface::VideoInterfaceManager& GetVideoInterface() const;
VideoCommon::CustomResourceManager& GetCustomResourceManager() const; VideoCommon::CustomAssetLoader& GetCustomAssetLoader() const;
private: private:
System(); System();

View File

@ -107,7 +107,7 @@ protected:
class SectorReader : public BlobReader class SectorReader : public BlobReader
{ {
public: public:
~SectorReader() override = 0; virtual ~SectorReader() = 0;
bool Read(u64 offset, u64 size, u8* out_ptr) override; bool Read(u64 offset, u64 size, u8* out_ptr) override;

View File

@ -45,7 +45,7 @@ class CompressedBlobReader final : public SectorReader
public: public:
static std::unique_ptr<CompressedBlobReader> Create(File::IOFile file, static std::unique_ptr<CompressedBlobReader> Create(File::IOFile file,
const std::string& filename); const std::string& filename);
~CompressedBlobReader() override; ~CompressedBlobReader();
const CompressedBlobHeader& GetHeader() const { return m_header; } const CompressedBlobHeader& GetHeader() const { return m_header; }

View File

@ -29,7 +29,7 @@ class VolumeGC final : public VolumeDisc
{ {
public: public:
VolumeGC(std::unique_ptr<BlobReader> reader); VolumeGC(std::unique_ptr<BlobReader> reader);
~VolumeGC() override; ~VolumeGC();
bool Read(u64 offset, u64 length, u8* buffer, bool Read(u64 offset, u64 length, u8* buffer,
const Partition& partition = PARTITION_NONE) const override; const Partition& partition = PARTITION_NONE) const override;
const FileSystem* GetFileSystem(const Partition& partition = PARTITION_NONE) const override; const FileSystem* GetFileSystem(const Partition& partition = PARTITION_NONE) const override;

View File

@ -58,7 +58,7 @@ public:
static_assert(sizeof(HashBlock) == BLOCK_HEADER_SIZE); static_assert(sizeof(HashBlock) == BLOCK_HEADER_SIZE);
VolumeWii(std::unique_ptr<BlobReader> reader); VolumeWii(std::unique_ptr<BlobReader> reader);
~VolumeWii() override; ~VolumeWii();
bool Read(u64 offset, u64 length, u8* buffer, const Partition& partition) const override; bool Read(u64 offset, u64 length, u8* buffer, const Partition& partition) const override;
bool HasWiiHashes() const override; bool HasWiiHashes() const override;
bool HasWiiEncryption() const override; bool HasWiiEncryption() const override;

View File

@ -44,7 +44,7 @@ template <bool RVZ>
class WIARVZFileReader final : public BlobReader class WIARVZFileReader final : public BlobReader
{ {
public: public:
~WIARVZFileReader() override; ~WIARVZFileReader();
static std::unique_ptr<WIARVZFileReader> Create(File::IOFile file, const std::string& path); static std::unique_ptr<WIARVZFileReader> Create(File::IOFile file, const std::string& path);

View File

@ -75,7 +75,7 @@ private:
class Bzip2Decompressor final : public Decompressor class Bzip2Decompressor final : public Decompressor
{ {
public: public:
~Bzip2Decompressor() override; ~Bzip2Decompressor();
bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out, bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out,
size_t* in_bytes_read) override; size_t* in_bytes_read) override;
@ -89,7 +89,7 @@ class LZMADecompressor final : public Decompressor
{ {
public: public:
LZMADecompressor(bool lzma2, const u8* filter_options, size_t filter_options_size); LZMADecompressor(bool lzma2, const u8* filter_options, size_t filter_options_size);
~LZMADecompressor() override; ~LZMADecompressor();
bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out, bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out,
size_t* in_bytes_read) override; size_t* in_bytes_read) override;
@ -106,7 +106,7 @@ class ZstdDecompressor final : public Decompressor
{ {
public: public:
ZstdDecompressor(); ZstdDecompressor();
~ZstdDecompressor() override; ~ZstdDecompressor();
bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out, bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out,
size_t* in_bytes_read) override; size_t* in_bytes_read) override;
@ -164,7 +164,7 @@ class PurgeCompressor final : public Compressor
{ {
public: public:
PurgeCompressor(); PurgeCompressor();
~PurgeCompressor() override; ~PurgeCompressor();
bool Start(std::optional<u64> size) override; bool Start(std::optional<u64> size) override;
bool AddPrecedingDataOnlyForPurgeHashing(const u8* data, size_t size) override; bool AddPrecedingDataOnlyForPurgeHashing(const u8* data, size_t size) override;
@ -184,7 +184,7 @@ class Bzip2Compressor final : public Compressor
{ {
public: public:
Bzip2Compressor(int compression_level); Bzip2Compressor(int compression_level);
~Bzip2Compressor() override; ~Bzip2Compressor();
bool Start(std::optional<u64> size) override; bool Start(std::optional<u64> size) override;
bool Compress(const u8* data, size_t size) override; bool Compress(const u8* data, size_t size) override;
@ -206,7 +206,7 @@ class LZMACompressor final : public Compressor
public: public:
LZMACompressor(bool lzma2, int compression_level, u8 compressor_data_out[7], LZMACompressor(bool lzma2, int compression_level, u8 compressor_data_out[7],
u8* compressor_data_size_out); u8* compressor_data_size_out);
~LZMACompressor() override; ~LZMACompressor();
bool Start(std::optional<u64> size) override; bool Start(std::optional<u64> size) override;
bool Compress(const u8* data, size_t size) override; bool Compress(const u8* data, size_t size) override;
@ -229,7 +229,7 @@ class ZstdCompressor final : public Compressor
{ {
public: public:
ZstdCompressor(int compression_level); ZstdCompressor(int compression_level);
~ZstdCompressor() override; ~ZstdCompressor();
bool Start(std::optional<u64> size) override; bool Start(std::optional<u64> size) override;
bool Compress(const u8* data, size_t size) override; bool Compress(const u8* data, size_t size) override;

View File

@ -18,7 +18,7 @@ static constexpr u32 WBFS_MAGIC = 0x53464257; // "WBFS" (byteswapped to little
class WbfsFileReader final : public BlobReader class WbfsFileReader final : public BlobReader
{ {
public: public:
~WbfsFileReader() override; ~WbfsFileReader();
static std::unique_ptr<WbfsFileReader> Create(File::IOFile file, const std::string& path); static std::unique_ptr<WbfsFileReader> Create(File::IOFile file, const std::string& path);

View File

@ -59,7 +59,6 @@
<ClInclude Include="Common\Event.h" /> <ClInclude Include="Common\Event.h" />
<ClInclude Include="Common\FatFsUtil.h" /> <ClInclude Include="Common\FatFsUtil.h" />
<ClInclude Include="Common\FileSearch.h" /> <ClInclude Include="Common\FileSearch.h" />
<ClInclude Include="Common\FilesystemWatcher.h" />
<ClInclude Include="Common\FileUtil.h" /> <ClInclude Include="Common\FileUtil.h" />
<ClInclude Include="Common\FixedSizeQueue.h" /> <ClInclude Include="Common\FixedSizeQueue.h" />
<ClInclude Include="Common\Flag.h" /> <ClInclude Include="Common\Flag.h" />
@ -672,16 +671,12 @@
<ClInclude Include="VideoCommon\Assets\CustomAsset.h" /> <ClInclude Include="VideoCommon\Assets\CustomAsset.h" />
<ClInclude Include="VideoCommon\Assets\CustomAssetLibrary.h" /> <ClInclude Include="VideoCommon\Assets\CustomAssetLibrary.h" />
<ClInclude Include="VideoCommon\Assets\CustomAssetLoader.h" /> <ClInclude Include="VideoCommon\Assets\CustomAssetLoader.h" />
<ClInclude Include="VideoCommon\Assets\CustomResourceManager.h" />
<ClInclude Include="VideoCommon\Assets\CustomTextureData.h" /> <ClInclude Include="VideoCommon\Assets\CustomTextureData.h" />
<ClInclude Include="VideoCommon\Assets\DirectFilesystemAssetLibrary.h" /> <ClInclude Include="VideoCommon\Assets\DirectFilesystemAssetLibrary.h" />
<ClInclude Include="VideoCommon\Assets\MaterialAsset.h" /> <ClInclude Include="VideoCommon\Assets\MaterialAsset.h" />
<ClInclude Include="VideoCommon\Assets\MeshAsset.h" /> <ClInclude Include="VideoCommon\Assets\MeshAsset.h" />
<ClInclude Include="VideoCommon\Assets\ShaderAsset.h" /> <ClInclude Include="VideoCommon\Assets\ShaderAsset.h" />
<ClInclude Include="VideoCommon\Assets\TextureAsset.h" /> <ClInclude Include="VideoCommon\Assets\TextureAsset.h" />
<ClInclude Include="VideoCommon\Assets\TextureAssetUtils.h" />
<ClInclude Include="VideoCommon\Assets\Types.h" />
<ClInclude Include="VideoCommon\Assets\WatchableFilesystemAssetLibrary.h" />
<ClInclude Include="VideoCommon\AsyncRequests.h" /> <ClInclude Include="VideoCommon\AsyncRequests.h" />
<ClInclude Include="VideoCommon\AsyncShaderCompiler.h" /> <ClInclude Include="VideoCommon\AsyncShaderCompiler.h" />
<ClInclude Include="VideoCommon\BoundingBox.h" /> <ClInclude Include="VideoCommon\BoundingBox.h" />
@ -821,7 +816,6 @@
<ClCompile Include="Common\ENet.cpp" /> <ClCompile Include="Common\ENet.cpp" />
<ClCompile Include="Common\FatFsUtil.cpp" /> <ClCompile Include="Common\FatFsUtil.cpp" />
<ClCompile Include="Common\FileSearch.cpp" /> <ClCompile Include="Common\FileSearch.cpp" />
<ClCompile Include="Common\FilesystemWatcher.cpp" />
<ClCompile Include="Common\FileUtil.cpp" /> <ClCompile Include="Common\FileUtil.cpp" />
<ClCompile Include="Common\FloatUtils.cpp" /> <ClCompile Include="Common\FloatUtils.cpp" />
<ClCompile Include="Common\GekkoDisassembler.cpp" /> <ClCompile Include="Common\GekkoDisassembler.cpp" />
@ -1329,15 +1323,14 @@
<ClCompile Include="VideoCommon\AbstractStagingTexture.cpp" /> <ClCompile Include="VideoCommon\AbstractStagingTexture.cpp" />
<ClCompile Include="VideoCommon\AbstractTexture.cpp" /> <ClCompile Include="VideoCommon\AbstractTexture.cpp" />
<ClCompile Include="VideoCommon\Assets\CustomAsset.cpp" /> <ClCompile Include="VideoCommon\Assets\CustomAsset.cpp" />
<ClCompile Include="VideoCommon\Assets\CustomAssetLibrary.cpp" />
<ClCompile Include="VideoCommon\Assets\CustomAssetLoader.cpp" /> <ClCompile Include="VideoCommon\Assets\CustomAssetLoader.cpp" />
<ClCompile Include="VideoCommon\Assets\CustomResourceManager.cpp" />
<ClCompile Include="VideoCommon\Assets\CustomTextureData.cpp" /> <ClCompile Include="VideoCommon\Assets\CustomTextureData.cpp" />
<ClCompile Include="VideoCommon\Assets\DirectFilesystemAssetLibrary.cpp" /> <ClCompile Include="VideoCommon\Assets\DirectFilesystemAssetLibrary.cpp" />
<ClCompile Include="VideoCommon\Assets\MaterialAsset.cpp" /> <ClCompile Include="VideoCommon\Assets\MaterialAsset.cpp" />
<ClCompile Include="VideoCommon\Assets\MeshAsset.cpp" /> <ClCompile Include="VideoCommon\Assets\MeshAsset.cpp" />
<ClCompile Include="VideoCommon\Assets\ShaderAsset.cpp" /> <ClCompile Include="VideoCommon\Assets\ShaderAsset.cpp" />
<ClCompile Include="VideoCommon\Assets\TextureAsset.cpp" /> <ClCompile Include="VideoCommon\Assets\TextureAsset.cpp" />
<ClCompile Include="VideoCommon\Assets\TextureAssetUtils.cpp" />
<ClCompile Include="VideoCommon\AsyncRequests.cpp" /> <ClCompile Include="VideoCommon\AsyncRequests.cpp" />
<ClCompile Include="VideoCommon\AsyncShaderCompiler.cpp" /> <ClCompile Include="VideoCommon\AsyncShaderCompiler.cpp" />
<ClCompile Include="VideoCommon\BoundingBox.cpp" /> <ClCompile Include="VideoCommon\BoundingBox.cpp" />

View File

@ -4,8 +4,10 @@
#include "DolphinNoGUI/Platform.h" #include "DolphinNoGUI/Platform.h"
#include <OptionParser.h> #include <OptionParser.h>
#include <csignal> #include <cstddef>
#include <cstdio> #include <cstdio>
#include <cstring>
#include <signal.h>
#include <string> #include <string>
#include <vector> #include <vector>
@ -30,13 +32,15 @@
#endif #endif
#include "UICommon/UICommon.h" #include "UICommon/UICommon.h"
#include "InputCommon/GCAdapter.h"
#include "VideoCommon/VideoBackendBase.h" #include "VideoCommon/VideoBackendBase.h"
static std::unique_ptr<Platform> s_platform; static std::unique_ptr<Platform> s_platform;
static void signal_handler(int) static void signal_handler(int)
{ {
constexpr char message[] = "A signal was received. A second signal will force Dolphin to stop.\n"; const char message[] = "A signal was received. A second signal will force Dolphin to stop.\n";
#ifdef _WIN32 #ifdef _WIN32
puts(message); puts(message);
#else #else
@ -71,7 +75,7 @@ bool Host_UIBlocksControllerState()
} }
static Common::Event s_update_main_frame_event; static Common::Event s_update_main_frame_event;
void Host_Message(const HostMessageID id) void Host_Message(HostMessageID id)
{ {
if (id == HostMessageID::WMUserStop) if (id == HostMessageID::WMUserStop)
s_platform->Stop(); s_platform->Stop();
@ -197,12 +201,11 @@ static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options)
#define main app_main #define main app_main
#endif #endif
int main(const int argc, char* argv[]) int main(int argc, char* argv[])
{ {
Core::DeclareAsHostThread(); Core::DeclareAsHostThread();
const auto parser = auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions);
CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions);
parser->add_option("-p", "--platform") parser->add_option("-p", "--platform")
.action("store") .action("store")
.help("Window platform to use [%choices]") .help("Window platform to use [%choices]")
@ -298,14 +301,14 @@ int main(const int argc, char* argv[])
return 1; return 1;
} }
Core::AddOnStateChangedCallback([](const Core::State state) { Core::AddOnStateChangedCallback([](Core::State state) {
if (state == Core::State::Uninitialized) if (state == Core::State::Uninitialized)
s_platform->Stop(); s_platform->Stop();
}); });
#ifdef _WIN32 #ifdef _WIN32
std::signal(SIGINT, signal_handler); signal(SIGINT, signal_handler);
std::signal(SIGTERM, signal_handler); signal(SIGTERM, signal_handler);
#else #else
// Shut down cleanly on SIGINT and SIGTERM // Shut down cleanly on SIGINT and SIGTERM
struct sigaction sa; struct sigaction sa;

View File

@ -6,6 +6,7 @@
#include "Core/HW/ProcessorInterface.h" #include "Core/HW/ProcessorInterface.h"
#include "Core/IOS/IOS.h" #include "Core/IOS/IOS.h"
#include "Core/IOS/STM/STM.h" #include "Core/IOS/STM/STM.h"
#include "Core/State.h"
#include "Core/System.h" #include "Core/System.h"
Platform::~Platform() = default; Platform::~Platform() = default;
@ -23,7 +24,7 @@ void Platform::UpdateRunningFlag()
{ {
if (m_shutdown_requested.TestAndClear()) if (m_shutdown_requested.TestAndClear())
{ {
const auto& system = Core::System::GetInstance(); auto& system = Core::System::GetInstance();
const auto ios = system.GetIOS(); const auto ios = system.GetIOS();
const auto stm = ios ? ios->GetDeviceByName("/dev/stm/eventhook") : nullptr; const auto stm = ios ? ios->GetDeviceByName("/dev/stm/eventhook") : nullptr;
if (!m_tried_graceful_shutdown.IsSet() && stm && if (!m_tried_graceful_shutdown.IsSet() && stm &&

View File

@ -10,7 +10,7 @@
namespace namespace
{ {
class PlatformHeadless final : public Platform class PlatformHeadless : public Platform
{ {
public: public:
void SetTitle(const std::string& title) override; void SetTitle(const std::string& title) override;

View File

@ -3,13 +3,16 @@
#include "DolphinNoGUI/Platform.h" #include "DolphinNoGUI/Platform.h"
#include "Common/MsgHandler.h"
#include "Core/Config/MainSettings.h" #include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/State.h"
#include "Core/System.h" #include "Core/System.h"
#include <Windows.h> #include <Windows.h>
#include <climits> #include <climits>
#include <cstdio>
#include <dwmapi.h> #include <dwmapi.h>
#include "VideoCommon/Present.h" #include "VideoCommon/Present.h"
@ -17,7 +20,7 @@
namespace namespace
{ {
class PlatformWin32 final : public Platform class PlatformWin32 : public Platform
{ {
public: public:
~PlatformWin32() override; ~PlatformWin32() override;
@ -26,14 +29,14 @@ public:
void SetTitle(const std::string& string) override; void SetTitle(const std::string& string) override;
void MainLoop() override; void MainLoop() override;
WindowSystemInfo GetWindowSystemInfo() const override; WindowSystemInfo GetWindowSystemInfo() const;
private: private:
static constexpr TCHAR WINDOW_CLASS_NAME[] = _T("DolphinNoGUI"); static constexpr TCHAR WINDOW_CLASS_NAME[] = _T("DolphinNoGUI");
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static bool RegisterRenderWindowClass(); bool RegisterRenderWindowClass();
bool CreateRenderWindow(); bool CreateRenderWindow();
void UpdateWindowPosition(); void UpdateWindowPosition();
void ProcessEvents(); void ProcessEvents();
@ -63,7 +66,7 @@ bool PlatformWin32::RegisterRenderWindowClass()
wc.hInstance = GetModuleHandle(nullptr); wc.hInstance = GetModuleHandle(nullptr);
wc.hIcon = LoadIcon(nullptr, IDI_ICON1); wc.hIcon = LoadIcon(nullptr, IDI_ICON1);
wc.hCursor = LoadCursor(nullptr, IDC_ARROW); wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
wc.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszMenuName = nullptr; wc.lpszMenuName = nullptr;
wc.lpszClassName = WINDOW_CLASS_NAME; wc.lpszClassName = WINDOW_CLASS_NAME;
wc.hIconSm = LoadIcon(nullptr, IDI_ICON1); wc.hIconSm = LoadIcon(nullptr, IDI_ICON1);
@ -165,8 +168,7 @@ void PlatformWin32::ProcessEvents()
} }
} }
LRESULT PlatformWin32::WndProc(const HWND hwnd, const UINT msg, const WPARAM wParam, LRESULT PlatformWin32::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
const LPARAM lParam)
{ {
PlatformWin32* platform = reinterpret_cast<PlatformWin32*>(GetWindowLongPtr(hwnd, GWLP_USERDATA)); PlatformWin32* platform = reinterpret_cast<PlatformWin32*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
switch (msg) switch (msg)
@ -183,7 +185,7 @@ LRESULT PlatformWin32::WndProc(const HWND hwnd, const UINT msg, const WPARAM wPa
if (hwnd) if (hwnd)
{ {
// Remove rounded corners from the render window on Windows 11 // Remove rounded corners from the render window on Windows 11
constexpr DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND; const DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND;
DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &corner_preference, DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &corner_preference,
sizeof(corner_preference)); sizeof(corner_preference));
} }

Some files were not shown because too many files have changed in this diff Show More