From 99d6788b2c8ed141613681089d7cbd7e3cd7a391 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Mon, 14 May 2018 14:09:13 -0500 Subject: [PATCH] [Qt] Initial Qt window initialization --- src/xenia/app/emulator_window.cc | 25 ++++++- src/xenia/app/emulator_window.h | 2 +- src/xenia/base/logging.cc | 14 ++-- src/xenia/debug/ui/debug_window.cc | 5 +- src/xenia/emulator.cc | 67 +++++-------------- src/xenia/emulator.h | 11 +-- src/xenia/gpu/command_processor.cc | 4 +- src/xenia/gpu/command_processor.h | 4 +- src/xenia/gpu/graphics_system.cc | 57 ++-------------- src/xenia/gpu/graphics_system.h | 3 +- src/xenia/gpu/null/null_graphics_system.cc | 12 ++-- src/xenia/gpu/null/null_graphics_system.h | 2 +- src/xenia/gpu/trace_dump.cc | 8 ++- src/xenia/gpu/trace_viewer.cc | 7 +- .../gpu/vulkan/vulkan_command_processor.cc | 2 +- .../gpu/vulkan/vulkan_graphics_system.cc | 19 ++---- src/xenia/gpu/vulkan/vulkan_graphics_system.h | 2 +- src/xenia/hid/input_system.cc | 2 +- src/xenia/hid/input_system.h | 6 +- src/xenia/kernel/xam/xam_ui.cc | 6 ++ 20 files changed, 97 insertions(+), 161 deletions(-) diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index 0860fc02c..905e3df75 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -10,6 +10,7 @@ #include #include "xenia/app/emulator_window.h" +#include "xenia/gpu/vulkan/vulkan_graphics_system.h" #include "xenia/ui/vulkan/vulkan_instance.h" #include "xenia/ui/vulkan/vulkan_provider.h" @@ -29,8 +30,28 @@ namespace app { EmulatorWindow::EmulatorWindow() {} bool EmulatorWindow::Setup() { - // TODO(DrChat): We own xe::Emulator. Create it and set it up. - return false; + // TODO(DrChat): Pass in command line arguments. + emulator_ = std::make_unique(L""); + + // Initialize the graphics backend. + // TODO(DrChat): Pick from gpu command line flag. + if (!InitializeVulkan()) { + return false; + } + + auto graphics_factory = [&](cpu::Processor* processor, + kernel::KernelState* kernel_state) { + auto graphics = std::make_unique(); + if (graphics->Setup(processor, kernel_state, + graphics_provider_->CreateOffscreenContext())) { + return std::unique_ptr(nullptr); + } + + return graphics; + }; + + X_STATUS result = emulator_->Setup(nullptr, graphics_factory, nullptr); + return result == X_STATUS_SUCCESS; } bool EmulatorWindow::InitializeVulkan() { diff --git a/src/xenia/app/emulator_window.h b/src/xenia/app/emulator_window.h index 45a57bf38..545aa9718 100644 --- a/src/xenia/app/emulator_window.h +++ b/src/xenia/app/emulator_window.h @@ -38,7 +38,7 @@ class EmulatorWindow : public QMainWindow { private: void CreateMenuBar(); - std::unique_ptr emulator_; + std::unique_ptr emulator_; std::unique_ptr graphics_window_; std::unique_ptr graphics_provider_; diff --git a/src/xenia/base/logging.cc b/src/xenia/base/logging.cc index 72b04a1f8..f659c9057 100644 --- a/src/xenia/base/logging.cc +++ b/src/xenia/base/logging.cc @@ -75,8 +75,10 @@ class Logger { ~Logger() { running_ = false; xe::threading::Wait(write_thread_.get(), true); - fflush(file_); - fclose(file_); + if (file_) { + fflush(file_); + fclose(file_); + } } void AppendLine(uint32_t thread_id, LogLevel level, const char prefix_char, @@ -92,8 +94,8 @@ class Logger { line.prefix_char = prefix_char; // First, run a check and see if we can increment write - // head without any problems. If so, cmpxchg it to reserve some space in the - // ring. If someone beats us, loop around. + // head without any problems. If so, cmpxchg it to reserve some space in + // the ring. If someone beats us, loop around. // // Once we have a reservation, write our data and then increment the write // tail. @@ -184,8 +186,8 @@ class Logger { line.thread_id); Write(prefix, sizeof(prefix) - 1); if (line.buffer_length) { - // Get access to the line data - which may be split in the ring buffer - // - and write it out in parts. + // Get access to the line data - which may be split in the ring + // buffer - and write it out in parts. auto line_range = rb.BeginRead(line.buffer_length); Write(reinterpret_cast(line_range.first), line_range.first_length); diff --git a/src/xenia/debug/ui/debug_window.cc b/src/xenia/debug/ui/debug_window.cc index 8db24092b..9920accf9 100644 --- a/src/xenia/debug/ui/debug_window.cc +++ b/src/xenia/debug/ui/debug_window.cc @@ -105,8 +105,9 @@ bool DebugWindow::Initialize() { window_->Resize(1500, 1000); // Create the graphics context used for drawing. - auto provider = emulator_->display_window()->context()->provider(); - window_->set_context(provider->CreateContext(window_.get())); + // TODO(DrChat): Refactor this. + // auto provider = emulator_->display_window()->context()->provider(); + // window_->set_context(provider->CreateContext(window_.get())); // Enable imgui input. window_->set_imgui_input_enabled(true); diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index 19a82a85e..97e7fc635 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -77,17 +77,15 @@ Emulator::~Emulator() { } X_STATUS Emulator::Setup( - ui::Window* display_window, std::function(cpu::Processor*)> audio_system_factory, - std::function()> + std::function(cpu::Processor*, + kernel::KernelState*)> graphics_system_factory, - std::function>(ui::Window*)> + std::function>()> input_driver_factory) { X_STATUS result = X_STATUS_UNSUCCESSFUL; - display_window_ = display_window; - // Initialize clock. // 360 uses a 50MHz clock. Clock::set_guest_tick_frequency(50000000); @@ -132,27 +130,34 @@ X_STATUS Emulator::Setup( return X_STATUS_UNSUCCESSFUL; } + // Bring up the virtual filesystem used by the kernel. + file_system_ = std::make_unique(); + + // Shared kernel state. + kernel_state_ = std::make_unique(this); + // Initialize the APU. if (audio_system_factory) { audio_system_ = audio_system_factory(processor_.get()); if (!audio_system_) { - return X_STATUS_NOT_IMPLEMENTED; + return X_STATUS_UNSUCCESSFUL; } } // Initialize the GPU. - graphics_system_ = graphics_system_factory(); + graphics_system_ = + graphics_system_factory(processor_.get(), kernel_state_.get()); if (!graphics_system_) { - return X_STATUS_NOT_IMPLEMENTED; + return X_STATUS_UNSUCCESSFUL; } - // Initialize the HID. - input_system_ = std::make_unique(display_window_); + // Initialize all HID drivers. + input_system_ = std::make_unique(); if (!input_system_) { return X_STATUS_NOT_IMPLEMENTED; } if (input_driver_factory) { - auto input_drivers = input_driver_factory(display_window_); + auto input_drivers = input_driver_factory(); for (size_t i = 0; i < input_drivers.size(); ++i) { input_system_->AddDriver(std::move(input_drivers[i])); } @@ -163,26 +168,6 @@ X_STATUS Emulator::Setup( return result; } - // Bring up the virtual filesystem used by the kernel. - file_system_ = std::make_unique(); - - // Shared kernel state. - kernel_state_ = std::make_unique(this); - - // Setup the core components. - result = graphics_system_->Setup(processor_.get(), kernel_state_.get(), - display_window_); - if (result) { - return result; - } - - if (audio_system_) { - result = audio_system_->Setup(kernel_state_.get()); - if (result) { - return result; - } - } - // HLE kernel modules. kernel_state_->LoadKernelModule(); kernel_state_->LoadKernelModule(); @@ -191,14 +176,6 @@ X_STATUS Emulator::Setup( // Initialize emulator fallback exception handling last. ExceptionHandler::Install(Emulator::ExceptionCallbackThunk, this); - if (display_window_) { - // Finish initializing the display. - display_window_->loop()->PostSynchronous([this]() { - xe::ui::GraphicsContextLock context_lock(display_window_->context()); - Profiler::set_window(display_window_); - }); - } - return result; } @@ -536,16 +513,6 @@ bool Emulator::ExceptionCallback(Exception* ex) { context->v[i].i32[1], context->v[i].i32[2], context->v[i].i32[3]); } - // Display a dialog telling the user the guest has crashed. - display_window()->loop()->PostSynchronous([&]() { - xe::ui::ImGuiDialog::ShowMessageBox( - display_window(), "Uh-oh!", - "The guest has crashed.\n\n" - "" - "Xenia has now paused itself.\n" - "A crash dump has been written into the log."); - }); - // Now suspend ourself (we should be a guest thread). current_thread->Suspend(nullptr); @@ -635,7 +602,7 @@ X_STATUS Emulator::CompleteLaunch(const std::wstring& path, game_title_ = xe::to_wstring(db.title()); auto icon_block = db.icon(); if (icon_block) { - display_window_->SetIcon(icon_block.buffer, icon_block.size); + // display_window_->SetIcon(icon_block.buffer, icon_block.size); } } } diff --git a/src/xenia/emulator.h b/src/xenia/emulator.h index 4492419e7..f59ae69d4 100644 --- a/src/xenia/emulator.h +++ b/src/xenia/emulator.h @@ -62,9 +62,6 @@ class Emulator { // Are we currently running a title? bool is_title_open() const { return title_id_ != 0; } - // Window used for displaying graphical output. - ui::Window* display_window() const { return display_window_; } - // Guest memory system modelling the RAM (both virtual and physical) of the // system. Memory* memory() const { return memory_.get(); } @@ -101,12 +98,12 @@ class Emulator { // Once this function returns a game can be launched using one of the Launch // functions. X_STATUS Setup( - ui::Window* display_window, std::function(cpu::Processor*)> audio_system_factory, - std::function()> + std::function(cpu::Processor*, + kernel::KernelState*)> graphics_system_factory, - std::function>(ui::Window*)> + std::function>()> input_driver_factory); // Terminates the currently running title. @@ -156,8 +153,6 @@ class Emulator { std::wstring command_line_; std::wstring game_title_; - ui::Window* display_window_; - std::unique_ptr memory_; std::unique_ptr processor_; diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index bdb66deb5..07dd4d729 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -46,7 +46,7 @@ CommandProcessor::CommandProcessor(GraphicsSystem* graphics_system, CommandProcessor::~CommandProcessor() = default; bool CommandProcessor::Initialize( - std::unique_ptr context) { + std::unique_ptr context) { context_ = std::move(context); worker_running_ = true; @@ -231,7 +231,7 @@ bool CommandProcessor::Restore(ByteStream* stream) { bool CommandProcessor::SetupContext() { return true; } -void CommandProcessor::ShutdownContext() { context_.reset(); } +void CommandProcessor::ShutdownContext() {} void CommandProcessor::InitializeRingBuffer(uint32_t ptr, uint32_t log2_size) { read_ptr_index_ = 0; diff --git a/src/xenia/gpu/command_processor.h b/src/xenia/gpu/command_processor.h index 1236e70a8..8385ac1bb 100644 --- a/src/xenia/gpu/command_processor.h +++ b/src/xenia/gpu/command_processor.h @@ -114,7 +114,7 @@ class CommandProcessor { Shader* active_vertex_shader() const { return active_vertex_shader_; } Shader* active_pixel_shader() const { return active_pixel_shader_; } - virtual bool Initialize(std::unique_ptr context); + virtual bool Initialize(std::unique_ptr context); virtual void Shutdown(); void CallInThread(std::function fn); @@ -255,7 +255,7 @@ class CommandProcessor { std::atomic worker_running_; kernel::object_ref worker_thread_; - std::unique_ptr context_; + std::unique_ptr context_; SwapMode swap_mode_ = SwapMode::kNormal; SwapState swap_state_; std::function swap_request_handler_; diff --git a/src/xenia/gpu/graphics_system.cc b/src/xenia/gpu/graphics_system.cc index 3a60bc939..894cb4252 100644 --- a/src/xenia/gpu/graphics_system.cc +++ b/src/xenia/gpu/graphics_system.cc @@ -39,69 +39,22 @@ GraphicsSystem::GraphicsSystem() : vsync_worker_running_(false) {} GraphicsSystem::~GraphicsSystem() = default; -X_STATUS GraphicsSystem::Setup(cpu::Processor* processor, - kernel::KernelState* kernel_state, - ui::Window* target_window) { +X_STATUS GraphicsSystem::Setup( + cpu::Processor* processor, kernel::KernelState* kernel_state, + std::unique_ptr graphics_context) { memory_ = processor->memory(); processor_ = processor; kernel_state_ = kernel_state; - target_window_ = target_window; - - // Initialize display and rendering context. - // This must happen on the UI thread. - std::unique_ptr processor_context = nullptr; - if (provider_) { - if (target_window_) { - target_window_->loop()->PostSynchronous([&]() { - // Create the context used for presentation. - assert_null(target_window->context()); - target_window_->set_context(provider_->CreateContext(target_window_)); - - // Setup the context the command processor will do all its drawing in. - // It's shared with the display context so that we can resolve - // framebuffers from it. - processor_context = provider()->CreateOffscreenContext(); - }); - } else { - processor_context = provider()->CreateOffscreenContext(); - } - - if (!processor_context) { - xe::FatalError( - "Unable to initialize graphics context. Xenia requires Vulkan " - "support.\n" - "\n" - "Ensure you have the latest drivers for your GPU and " - "that it supports Vulkan.\n" - "\n" - "See http://xenia.jp/faq/ for more information and a list of " - "supported GPUs."); - return X_STATUS_UNSUCCESSFUL; - } - } // Create command processor. This will spin up a thread to process all // incoming ringbuffer packets. command_processor_ = CreateCommandProcessor(); - if (!command_processor_->Initialize(std::move(processor_context))) { + if (!command_processor_->Initialize(std::move(graphics_context))) { XELOGE("Unable to initialize command processor"); return X_STATUS_UNSUCCESSFUL; } - if (target_window) { - command_processor_->set_swap_request_handler( - [this]() { target_window_->Invalidate(); }); - - // Watch for paint requests to do our swap. - target_window->on_painting.AddListener( - [this](xe::ui::UIEvent* e) { Swap(e); }); - - // Watch for context lost events. - target_window->on_context_lost.AddListener( - [this](xe::ui::UIEvent* e) { Reset(); }); - } else { - command_processor_->set_swap_request_handler([]() {}); - } + command_processor_->set_swap_request_handler([]() {}); // Let the processor know we want register access callbacks. memory_->AddVirtualMappedRange( diff --git a/src/xenia/gpu/graphics_system.h b/src/xenia/gpu/graphics_system.h index 459dd7d3f..f441e2f10 100644 --- a/src/xenia/gpu/graphics_system.h +++ b/src/xenia/gpu/graphics_system.h @@ -43,7 +43,7 @@ class GraphicsSystem { virtual X_STATUS Setup(cpu::Processor* processor, kernel::KernelState* kernel_state, - ui::Window* target_window); + std::unique_ptr graphics_context); virtual void Shutdown(); virtual void Reset(); @@ -91,7 +91,6 @@ class GraphicsSystem { Memory* memory_ = nullptr; cpu::Processor* processor_ = nullptr; kernel::KernelState* kernel_state_ = nullptr; - ui::Window* target_window_ = nullptr; std::unique_ptr provider_; uint32_t interrupt_callback_ = 0; diff --git a/src/xenia/gpu/null/null_graphics_system.cc b/src/xenia/gpu/null/null_graphics_system.cc index f1a88010f..5a6b62322 100644 --- a/src/xenia/gpu/null/null_graphics_system.cc +++ b/src/xenia/gpu/null/null_graphics_system.cc @@ -21,14 +21,10 @@ NullGraphicsSystem::NullGraphicsSystem() {} NullGraphicsSystem::~NullGraphicsSystem() {} -X_STATUS NullGraphicsSystem::Setup(cpu::Processor* processor, - kernel::KernelState* kernel_state, - ui::Window* target_window) { - // This is a null graphics system, but we still setup vulkan because UI needs - // it through us :| - provider_ = xe::ui::vulkan::VulkanProvider::Create(target_window); - - return GraphicsSystem::Setup(processor, kernel_state, target_window); +X_STATUS NullGraphicsSystem::Setup( + cpu::Processor* processor, kernel::KernelState* kernel_state, + std::unique_ptr context) { + return GraphicsSystem::Setup(processor, kernel_state, std::move(context)); } void NullGraphicsSystem::Shutdown() { GraphicsSystem::Shutdown(); } diff --git a/src/xenia/gpu/null/null_graphics_system.h b/src/xenia/gpu/null/null_graphics_system.h index 52ec94992..d96f5a15f 100644 --- a/src/xenia/gpu/null/null_graphics_system.h +++ b/src/xenia/gpu/null/null_graphics_system.h @@ -27,7 +27,7 @@ class NullGraphicsSystem : public GraphicsSystem { std::wstring name() const override { return L"null"; } X_STATUS Setup(cpu::Processor* processor, kernel::KernelState* kernel_state, - ui::Window* target_window) override; + std::unique_ptr context) override; void Shutdown() override; private: diff --git a/src/xenia/gpu/trace_dump.cc b/src/xenia/gpu/trace_dump.cc index 8c3de28be..6ca88673e 100644 --- a/src/xenia/gpu/trace_dump.cc +++ b/src/xenia/gpu/trace_dump.cc @@ -104,8 +104,12 @@ int TraceDump::Main(const std::vector& args) { bool TraceDump::Setup() { // Create the emulator but don't initialize so we can setup the window. emulator_ = std::make_unique(L""); - X_STATUS result = emulator_->Setup( - nullptr, nullptr, [this]() { return CreateGraphicsSystem(); }, nullptr); + X_STATUS result = + emulator_->Setup(nullptr, + [this](cpu::Processor*, kernel::KernelState*) { + return CreateGraphicsSystem(); + }, + nullptr); if (XFAILED(result)) { XELOGE("Failed to setup emulator: %.8X", result); return false; diff --git a/src/xenia/gpu/trace_viewer.cc b/src/xenia/gpu/trace_viewer.cc index 4e08e7081..4ed72c96b 100644 --- a/src/xenia/gpu/trace_viewer.cc +++ b/src/xenia/gpu/trace_viewer.cc @@ -124,8 +124,11 @@ bool TraceViewer::Setup() { // Create the emulator but don't initialize so we can setup the window. emulator_ = std::make_unique(L""); X_STATUS result = - emulator_->Setup(window_.get(), nullptr, - [this]() { return CreateGraphicsSystem(); }, nullptr); + emulator_->Setup(nullptr, + [this](cpu::Processor*, kernel::KernelState*) { + return CreateGraphicsSystem(); + }, + nullptr); if (XFAILED(result)) { XELOGE("Failed to setup emulator: %.8X", result); return false; diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index cf8ca2707..cce2ed3e6 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -60,7 +60,7 @@ bool VulkanCommandProcessor::SetupContext() { } // Acquire our device and queue. - auto context = static_cast(context_.get()); + auto context = static_cast(context_.get()); device_ = context->device(); queue_ = device_->AcquireQueue(device_->queue_family_index()); if (!queue_) { diff --git a/src/xenia/gpu/vulkan/vulkan_graphics_system.cc b/src/xenia/gpu/vulkan/vulkan_graphics_system.cc index 57c79912b..3637ab3e0 100644 --- a/src/xenia/gpu/vulkan/vulkan_graphics_system.cc +++ b/src/xenia/gpu/vulkan/vulkan_graphics_system.cc @@ -33,24 +33,17 @@ using xe::ui::vulkan::CheckResult; VulkanGraphicsSystem::VulkanGraphicsSystem() {} VulkanGraphicsSystem::~VulkanGraphicsSystem() = default; -X_STATUS VulkanGraphicsSystem::Setup(cpu::Processor* processor, - kernel::KernelState* kernel_state, - ui::Window* target_window) { - // Must create the provider so we can create contexts. - auto provider = xe::ui::vulkan::VulkanProvider::Create(target_window); - device_ = provider->device(); - provider_ = std::move(provider); +X_STATUS VulkanGraphicsSystem::Setup( + cpu::Processor* processor, kernel::KernelState* kernel_state, + std::unique_ptr context) { + device_ = static_cast(context.get())->device(); - auto result = GraphicsSystem::Setup(processor, kernel_state, target_window); + auto result = + GraphicsSystem::Setup(processor, kernel_state, std::move(context)); if (result) { return result; } - if (target_window) { - display_context_ = reinterpret_cast( - target_window->context()); - } - // Create our own command pool we can use for captures. VkCommandPoolCreateInfo create_info = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, diff --git a/src/xenia/gpu/vulkan/vulkan_graphics_system.h b/src/xenia/gpu/vulkan/vulkan_graphics_system.h index cd61fc181..33158dda5 100644 --- a/src/xenia/gpu/vulkan/vulkan_graphics_system.h +++ b/src/xenia/gpu/vulkan/vulkan_graphics_system.h @@ -27,7 +27,7 @@ class VulkanGraphicsSystem : public GraphicsSystem { std::wstring name() const override { return L"Vulkan"; } X_STATUS Setup(cpu::Processor* processor, kernel::KernelState* kernel_state, - ui::Window* target_window) override; + std::unique_ptr context) override; void Shutdown() override; std::unique_ptr Capture() override; diff --git a/src/xenia/hid/input_system.cc b/src/xenia/hid/input_system.cc index a77d5b548..f739a7c8b 100644 --- a/src/xenia/hid/input_system.cc +++ b/src/xenia/hid/input_system.cc @@ -16,7 +16,7 @@ namespace xe { namespace hid { -InputSystem::InputSystem(xe::ui::Window* window) : window_(window) {} +InputSystem::InputSystem() {} InputSystem::~InputSystem() = default; diff --git a/src/xenia/hid/input_system.h b/src/xenia/hid/input_system.h index 7f26e0663..7632d6d34 100644 --- a/src/xenia/hid/input_system.h +++ b/src/xenia/hid/input_system.h @@ -28,11 +28,9 @@ namespace hid { class InputSystem { public: - explicit InputSystem(xe::ui::Window* window); + explicit InputSystem(); ~InputSystem(); - xe::ui::Window* window() const { return window_; } - X_STATUS Setup(); void AddDriver(std::unique_ptr driver); @@ -45,8 +43,6 @@ class InputSystem { X_INPUT_KEYSTROKE* out_keystroke); private: - xe::ui::Window* window_ = nullptr; - std::vector> drivers_; }; diff --git a/src/xenia/kernel/xam/xam_ui.cc b/src/xenia/kernel/xam/xam_ui.cc index a8dd37d38..70a54ea2e 100644 --- a/src/xenia/kernel/xam/xam_ui.cc +++ b/src/xenia/kernel/xam/xam_ui.cc @@ -130,6 +130,7 @@ SHIM_CALL XamShowMessageBoxUI_shim(PPCContext* ppc_context, // Auto-pick the focused button. chosen_button = active_button; } else { + /* auto display_window = kernel_state->emulator()->display_window(); xe::threading::Fence fence; display_window->loop()->PostSynchronous([&]() { @@ -155,6 +156,7 @@ SHIM_CALL XamShowMessageBoxUI_shim(PPCContext* ppc_context, ++xam_dialogs_shown_; fence.Wait(); --xam_dialogs_shown_; + */ } SHIM_SET_MEM_32(result_ptr, chosen_button); @@ -258,6 +260,7 @@ dword_result_t XamShowKeyboardUI(dword_t user_index, dword_t flags, std::wstring out_text; + /* auto display_window = kernel_state()->emulator()->display_window(); xe::threading::Fence fence; display_window->loop()->PostSynchronous([&]() { @@ -270,6 +273,7 @@ dword_result_t XamShowKeyboardUI(dword_t user_index, dword_t flags, ++xam_dialogs_shown_; fence.Wait(); --xam_dialogs_shown_; + */ // Zero the output buffer. std::memset(buffer, 0, buffer_length * 2); @@ -330,6 +334,7 @@ SHIM_CALL XamShowDirtyDiscErrorUI_shim(PPCContext* ppc_context, return; } + /* auto display_window = kernel_state->emulator()->display_window(); xe::threading::Fence fence; display_window->loop()->PostSynchronous([&]() { @@ -342,6 +347,7 @@ SHIM_CALL XamShowDirtyDiscErrorUI_shim(PPCContext* ppc_context, ++xam_dialogs_shown_; fence.Wait(); --xam_dialogs_shown_; + */ // This is death, and should never return. // TODO(benvanik): cleaner exit.