From 0b574613b95479d5937076547fafac8332242c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 1 Apr 2023 09:01:27 +0200 Subject: [PATCH] Address assorted feedback --- Core/ControlMapper.cpp | 10 +++++----- Core/Debugger/WebSocket/InputSubscriber.cpp | 2 -- UI/EmuScreen.cpp | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Core/ControlMapper.cpp b/Core/ControlMapper.cpp index a97fac9358..56be689b24 100644 --- a/Core/ControlMapper.cpp +++ b/Core/ControlMapper.cpp @@ -125,7 +125,7 @@ void ControlMapper::SetPSPAxis(int device, int stick, char axis, float value) { bool ignore = false; if (inDeadZone && lastNonDeadzoneDeviceID_[stick] != device) { // Ignore this event! See issue #15465 - ignore = true; + ignore = true; } if (!inDeadZone) { @@ -325,10 +325,10 @@ bool ControlMapper::Key(const KeyInput &key, bool *pauseTrigger) { } // TODO: See if this can be simplified further somehow. - bool mappingFound = KeyMap::InputMappingToPspButton(mapping, nullptr); - DEBUG_LOG(SYSTEM, "Key: %d DeviceId: %d", key.keyCode, key.deviceId); - if (!mappingFound || key.deviceId == DEVICE_ID_DEFAULT) { - if ((key.flags & KEY_DOWN) && key.keyCode == NKCODE_BACK) { + if ((key.flags & KEY_DOWN) && key.keyCode == NKCODE_BACK) { + bool mappingFound = KeyMap::InputMappingToPspButton(mapping, nullptr); + DEBUG_LOG(SYSTEM, "Key: %d DeviceId: %d", key.keyCode, key.deviceId); + if (!mappingFound || key.deviceId == DEVICE_ID_DEFAULT) { *pauseTrigger = true; return true; } diff --git a/Core/Debugger/WebSocket/InputSubscriber.cpp b/Core/Debugger/WebSocket/InputSubscriber.cpp index 3b2f5c5733..1ef9260686 100644 --- a/Core/Debugger/WebSocket/InputSubscriber.cpp +++ b/Core/Debugger/WebSocket/InputSubscriber.cpp @@ -187,7 +187,6 @@ void WebSocketInputState::ButtonsPress(DebuggerRequest &req) { } press.button = info->second; - // TODO: Route into the control mapper's PSPKey function instead. __CtrlUpdateButtons(press.button, 0); pressTickets_.push_back(press); } @@ -201,7 +200,6 @@ void WebSocketInputState::Broadcast(net::WebSocketServer *ws) { for (PressInfo &press : pressTickets_) { press.duration--; if (press.duration == -1) { - // TODO: Route into the control mapper's PSPKey function instead. __CtrlUpdateButtons(0, press.button); ws->Send(press.Event()); } diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 3f3ac85ef2..22bf7bf768 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1319,6 +1319,7 @@ Invalid / Unknown (%d) static void DrawAudioDebugStats(UIContext *ctx, const Bounds &bounds) { FontID ubuntu24("UBUNTU24"); + char statbuf[4096] = { 0 }; System_AudioGetDebugStats(statbuf, sizeof(statbuf)); @@ -1337,7 +1338,6 @@ static void DrawControlDebug(UIContext *ctx, const ControlMapper &mapper, const char statbuf[4096] = { 0 }; mapper.GetDebugString(statbuf, sizeof(statbuf)); - // System_AudioGetDebugStats(statbuf, sizeof(statbuf)); ctx->Flush(); ctx->BindFontTexture();