From ec430567c3347ce4a7133946306f98e78291cf0d Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 22 Mar 2022 10:54:58 -0700 Subject: [PATCH] Correct tab usage --- NESEmulator/CNESEmulator.cpp | 2 +- Runtime/AutoMapper/CAutoMapper.cpp | 6 ++-- Runtime/MP1/CFrontEndUI.cpp | 2 +- Runtime/MP1/CMFGame.cpp | 7 ++-- aurora/include/aurora/aurora.hpp | 55 +++++++++++++++--------------- 5 files changed, 37 insertions(+), 35 deletions(-) diff --git a/NESEmulator/CNESEmulator.cpp b/NESEmulator/CNESEmulator.cpp index fccae5b0f..09cfa0fe9 100644 --- a/NESEmulator/CNESEmulator.cpp +++ b/NESEmulator/CNESEmulator.cpp @@ -617,7 +617,7 @@ void CNESEmulator::ProcessUserInput(const CFinalInput& input, int) { inValReads[BUTTON_DOWN] = input.DDPDown() || input.DLADown(); inValReads[BUTTON_LEFT] = input.DDPLeft() || input.DLALeft(); inValReads[BUTTON_RIGHT] = input.DDPRight() || input.DLARight(); - inValReads[BUTTON_SELECT] = input.DZ() || input.DKey('\t'); + inValReads[BUTTON_SELECT] = input.DZ() || input.DSpecialKey(aurora::SpecialKey::Tab); inValReads[BUTTON_START] = input.DStart() || input.DSpecialKey(aurora::SpecialKey::Esc); } diff --git a/Runtime/AutoMapper/CAutoMapper.cpp b/Runtime/AutoMapper/CAutoMapper.cpp index ce34f08a9..453c209f6 100644 --- a/Runtime/AutoMapper/CAutoMapper.cpp +++ b/Runtime/AutoMapper/CAutoMapper.cpp @@ -662,8 +662,7 @@ void CAutoMapper::ProcessMapPanInput(const CFinalInput& input, const CStateManag bool mouseHeld = false; if (const auto& kbm = input.GetKBM()) { - if (kbm->m_mouseButtons[size_t(EMouseButton::Middle)] || - kbm->m_mouseButtons[size_t(EMouseButton::Secondary)]) { + if (kbm->m_mouseButtons[size_t(EMouseButton::Middle)] || kbm->m_mouseButtons[size_t(EMouseButton::Secondary)]) { mouseHeld = true; if (float(m_mouseDelta.x()) < 0.f) right += -m_mouseDelta.x(); @@ -1084,7 +1083,8 @@ void CAutoMapper::ProcessControllerInput(const CFinalInput& input, CStateManager } } - if (input.PZ() || input.PKey('\t') || input.PB() || input.PSpecialKey(aurora::SpecialKey::Esc)) { + if (input.PZ() || input.PSpecialKey(aurora::SpecialKey::Tab) || input.PB() || + input.PSpecialKey(aurora::SpecialKey::Esc)) { if (x328_ == 0) { if (CanLeaveMapScreenInternal(mgr)) { LeaveMapScreen(mgr); diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index f6b3ecd2d..f509e930d 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -981,7 +981,7 @@ CFrontEndUI::SFusionBonusFrame::EAction CFrontEndUI::SFusionBonusFrame::ProcessU } } else if (x24_loadedFrame) { CFinalInput useInput = input; - if (input.PZ() || input.PKey('\t')) { + if (input.PZ() || input.PSpecialKey(aurora::SpecialKey::Tab)) { useInput.x2d_b28_PA = true; m_gbaOverride = true; } diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index e83515080..2ef70e538 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -134,7 +134,8 @@ CIOWin::EMessageReturn CMFGame::OnMessage(const CArchitectureMessage& msg, CArch } else if (!cineCam) { x14_stateManager->DeferStateTransition(EStateManagerTransition::PauseGame); } - } else if ((input.PZ() || input.PKey('\t')) && !cineCam && x14_stateManager->CanShowMapScreen()) { + } else if ((input.PZ() || input.PSpecialKey(aurora::SpecialKey::Tab)) && !cineCam && + x14_stateManager->CanShowMapScreen()) { x14_stateManager->DeferStateTransition(EStateManagerTransition::MapScreen); } } @@ -347,8 +348,8 @@ CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg, x1c_loadList.clear(); -// if (!CGraphics::g_BooFactory->areShadersReady()) -// return EMessageReturn::Exit; + // if (!CGraphics::g_BooFactory->areShadersReady()) + // return EMessageReturn::Exit; wtMgr->StartTextFadeOut(); x2c_25_transitionFinished = wtMgr->IsTransitionFinished(); diff --git a/aurora/include/aurora/aurora.hpp b/aurora/include/aurora/aurora.hpp index ed8686d72..d29e7a4d1 100644 --- a/aurora/include/aurora/aurora.hpp +++ b/aurora/include/aurora/aurora.hpp @@ -93,32 +93,32 @@ enum class SpecialKey : uint8_t { KpEnter = 47, KpNum0 = 48, KpNum1 = 49, - KpNum2 = 51, - KpNum3 = 52, - KpNum4 = 53, - KpNum5 = 54, - KpNum6 = 55, - KpNum7 = 56, - KpNum8 = 57, - KpNum9 = 58, - KpPercent = 59, - KpPeriod = 60, - KpComma = 61, - KpEquals = 62, - Application = 63, - Power = 64, - Execute = 65, - Help = 66, - Menu = 67, - Select = 68, - Stop = 69, - Again = 70, - Undo = 71, - Cut = 72, - Paste = 73, - Find = 74, - VolumeUp = 75, - VolumeDown = 76, + KpNum2 = 50, + KpNum3 = 51, + KpNum4 = 52, + KpNum5 = 53, + KpNum6 = 54, + KpNum7 = 55, + KpNum8 = 56, + KpNum9 = 57, + KpPercent = 58, + KpPeriod = 59, + KpComma = 60, + KpEquals = 61, + Application = 62, + Power = 63, + Execute = 64, + Help = 65, + Menu = 66, + Select = 67, + Stop = 68, + Again = 69, + Undo = 70, + Cut = 71, + Paste = 72, + Find = 73, + VolumeUp = 74, + VolumeDown = 75, MAX, }; enum class ModifierKey : uint16_t { @@ -253,6 +253,7 @@ void set_fullscreen(bool fullscreen) noexcept; void set_controller_player_index(uint32_t which, int32_t index) noexcept; [[nodiscard]] bool is_controller_gamecube(uint32_t which) noexcept; [[nodiscard]] bool controller_has_rumble(uint32_t which) noexcept; -void controller_rumble(uint32_t which, uint16_t low_freq_intensity, uint16_t high_freq_intensity, uint32_t duration_ms = 0) noexcept; +void controller_rumble(uint32_t which, uint16_t low_freq_intensity, uint16_t high_freq_intensity, + uint32_t duration_ms = 0) noexcept; [[nodiscard]] std::string get_controller_name(uint32_t which) noexcept; } // namespace aurora