early-access version 3158

This commit is contained in:
pineappleEA 2022-11-27 02:38:07 +01:00
parent b2cb15f351
commit 8715f21bc6
8 changed files with 31 additions and 14 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 3157. This is the source code for early-access 3158.
## Legal Notice ## Legal Notice

View File

@ -266,19 +266,18 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
} }
void SinkStream::Stall() { void SinkStream::Stall() {
if (stalled) { if (IsStalled()) {
return; return;
} }
stalled = true; stalled_lock = system.StallProcesses();
system.StallProcesses();
} }
void SinkStream::Unstall() { void SinkStream::Unstall() {
if (!stalled) { if (!IsStalled()) {
return; return;
} }
system.UnstallProcesses(); system.UnstallProcesses();
stalled = false; stalled_lock.unlock();
} }
} // namespace AudioCore::Sink } // namespace AudioCore::Sink

View File

@ -6,6 +6,7 @@
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <memory> #include <memory>
#include <mutex>
#include <span> #include <span>
#include <vector> #include <vector>
@ -209,6 +210,11 @@ public:
*/ */
void Unstall(); void Unstall();
private:
[[nodiscard]] bool IsStalled() const {
return stalled_lock.owns_lock();
}
protected: protected:
/// Core system /// Core system
Core::System& system; Core::System& system;
@ -241,7 +247,7 @@ private:
/// Set via IAudioDevice service calls /// Set via IAudioDevice service calls
f32 device_volume{1.0f}; f32 device_volume{1.0f};
/// True if coretiming has been stalled /// True if coretiming has been stalled
bool stalled{false}; std::unique_lock<std::mutex> stalled_lock;
}; };
using SinkStreamPtr = std::unique_ptr<SinkStream>; using SinkStreamPtr = std::unique_ptr<SinkStream>;

View File

@ -443,7 +443,7 @@ struct Values {
SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"};
SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"}; SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"};
SwitchableSetting<bool> use_vsync{true, "use_vsync"}; SwitchableSetting<bool> use_vsync{true, "use_vsync"};
SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLASM, ShaderBackend::GLSL, SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLSL, ShaderBackend::GLSL,
ShaderBackend::SPIRV, "shader_backend"}; ShaderBackend::SPIRV, "shader_backend"};
SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"};
SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"};

View File

@ -189,7 +189,7 @@ struct System::Impl {
kernel.Suspend(false); kernel.Suspend(false);
core_timing.SyncPause(false); core_timing.SyncPause(false);
is_paused = false; is_paused.store(false, std::memory_order_relaxed);
return status; return status;
} }
@ -200,14 +200,13 @@ struct System::Impl {
core_timing.SyncPause(true); core_timing.SyncPause(true);
kernel.Suspend(true); kernel.Suspend(true);
is_paused = true; is_paused.store(true, std::memory_order_relaxed);
return status; return status;
} }
bool IsPaused() const { bool IsPaused() const {
std::unique_lock lk(suspend_guard); return is_paused.load(std::memory_order_relaxed);
return is_paused;
} }
std::unique_lock<std::mutex> StallProcesses() { std::unique_lock<std::mutex> StallProcesses() {
@ -218,7 +217,7 @@ struct System::Impl {
} }
void UnstallProcesses() { void UnstallProcesses() {
if (!is_paused) { if (!IsPaused()) {
core_timing.SyncPause(false); core_timing.SyncPause(false);
kernel.Suspend(false); kernel.Suspend(false);
} }
@ -465,7 +464,7 @@ struct System::Impl {
} }
mutable std::mutex suspend_guard; mutable std::mutex suspend_guard;
bool is_paused{}; std::atomic_bool is_paused{};
std::atomic<bool> is_shutting_down{}; std::atomic<bool> is_shutting_down{};
Timing::CoreTiming core_timing; Timing::CoreTiming core_timing;

View File

@ -145,6 +145,7 @@ void EmulatedDevices::UnloadInput() {
for (auto& button : keyboard_modifier_devices) { for (auto& button : keyboard_modifier_devices) {
button.reset(); button.reset();
} }
ring_analog_device.reset();
} }
void EmulatedDevices::EnableConfiguration() { void EmulatedDevices::EnableConfiguration() {

View File

@ -138,6 +138,16 @@ struct InputSubsystem::Impl {
Common::Input::UnregisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName()); Common::Input::UnregisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName());
tas_input.reset(); tas_input.reset();
Common::Input::UnregisterFactory<Common::Input::InputDevice>(camera->GetEngineName());
Common::Input::UnregisterFactory<Common::Input::OutputDevice>(camera->GetEngineName());
camera.reset();
Common::Input::UnregisterFactory<Common::Input::InputDevice>(
virtual_amiibo->GetEngineName());
Common::Input::UnregisterFactory<Common::Input::OutputDevice>(
virtual_amiibo->GetEngineName());
virtual_amiibo.reset();
#ifdef HAVE_SDL2 #ifdef HAVE_SDL2
Common::Input::UnregisterFactory<Common::Input::InputDevice>(sdl->GetEngineName()); Common::Input::UnregisterFactory<Common::Input::InputDevice>(sdl->GetEngineName());
Common::Input::UnregisterFactory<Common::Input::OutputDevice>(sdl->GetEngineName()); Common::Input::UnregisterFactory<Common::Input::OutputDevice>(sdl->GetEngineName());

View File

@ -7,6 +7,7 @@
#include "common/scm_rev.h" #include "common/scm_rev.h"
#include "common/settings.h" #include "common/settings.h"
#include "core/core.h" #include "core/core.h"
#include "core/hid/hid_core.h"
#include "core/perf_stats.h" #include "core/perf_stats.h"
#include "input_common/drivers/keyboard.h" #include "input_common/drivers/keyboard.h"
#include "input_common/drivers/mouse.h" #include "input_common/drivers/mouse.h"
@ -26,6 +27,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, Co
} }
EmuWindow_SDL2::~EmuWindow_SDL2() { EmuWindow_SDL2::~EmuWindow_SDL2() {
system.HIDCore().UnloadInputDevices();
input_subsystem->Shutdown(); input_subsystem->Shutdown();
SDL_Quit(); SDL_Quit();
} }