From 18b1f9f51382fb80b28dc6497e4fb886ebdf9a81 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 28 May 2014 20:19:28 -0700 Subject: [PATCH] Fixing controller input. --- src/xenia/apu/audio_system.cc | 29 +++++++++++++---------------- src/xenia/hid/hid.cc | 10 +++++----- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/xenia/apu/audio_system.cc b/src/xenia/apu/audio_system.cc index 144d6bb15..efc762fc9 100644 --- a/src/xenia/apu/audio_system.cc +++ b/src/xenia/apu/audio_system.cc @@ -86,22 +86,19 @@ void AudioSystem::ThreadStart() { } size_t pumped = 0; - { - SCOPE_profile_cpu_i("apu", "Pump"); - if (result >= WAIT_OBJECT_0 && result <= WAIT_OBJECT_0 + (maximum_client_count_ - 1)) { - size_t index = result - WAIT_OBJECT_0; - do { - xe_mutex_lock(lock_); - uint32_t client_callback = clients_[index].callback; - uint32_t client_callback_arg = clients_[index].wrapped_callback_arg; - xe_mutex_unlock(lock_); - if (client_callback) { - processor->Execute(thread_state_, client_callback, client_callback_arg, 0); - } - pumped++; - index++; - } while (index < maximum_client_count_ && WaitForSingleObject(client_wait_handles_[index], 0) == WAIT_OBJECT_0); - } + if (result >= WAIT_OBJECT_0 && result <= WAIT_OBJECT_0 + (maximum_client_count_ - 1)) { + size_t index = result - WAIT_OBJECT_0; + do { + xe_mutex_lock(lock_); + uint32_t client_callback = clients_[index].callback; + uint32_t client_callback_arg = clients_[index].wrapped_callback_arg; + xe_mutex_unlock(lock_); + if (client_callback) { + processor->Execute(thread_state_, client_callback, client_callback_arg, 0); + } + pumped++; + index++; + } while (index < maximum_client_count_ && WaitForSingleObject(client_wait_handles_[index], 0) == WAIT_OBJECT_0); } if (!running_) { diff --git a/src/xenia/hid/hid.cc b/src/xenia/hid/hid.cc index fc3a3b9e6..fbd66630d 100644 --- a/src/xenia/hid/hid.cc +++ b/src/xenia/hid/hid.cc @@ -46,16 +46,16 @@ InputSystem* xe::hid::Create(Emulator* emulator) { // NOTE: in any mode we create as many as we can, falling back to nop. #if XE_PLATFORM_WIN32 - InputDriver* winkey_driver = xe::hid::winkey::Create(input_system); - if (winkey_driver) { - input_system->AddDriver(winkey_driver); - any_created = true; - } InputDriver* xinput_driver = xe::hid::xinput::Create(input_system); if (xinput_driver) { input_system->AddDriver(xinput_driver); any_created = true; } + InputDriver* winkey_driver = xe::hid::winkey::Create(input_system); + if (winkey_driver) { + input_system->AddDriver(winkey_driver); + any_created = true; + } #endif // WIN32 // Fallback to nop if none created.