From 3a847c82d118afd58bf3c1319a6637bc93ed0a82 Mon Sep 17 00:00:00 2001 From: ndeadly <24677491+ndeadly@users.noreply.github.com> Date: Fri, 7 Aug 2020 23:30:27 +0200 Subject: [PATCH] btdrv-mitm: set dualshock4 state on initialize to make sure the controller is recognised quickly --- btdrv-mitm/source/controllers/dualshock4.cpp | 7 +++++++ btdrv-mitm/source/controllers/dualshock4.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/btdrv-mitm/source/controllers/dualshock4.cpp b/btdrv-mitm/source/controllers/dualshock4.cpp index f042f12..95d04bb 100644 --- a/btdrv-mitm/source/controllers/dualshock4.cpp +++ b/btdrv-mitm/source/controllers/dualshock4.cpp @@ -20,6 +20,13 @@ namespace ams::controller { } + Result Dualshock4Controller::initialize(void) { + R_TRY(FakeSwitchController::initialize()); + R_TRY(this->updateControllerState()); + + return ams::ResultSuccess(); + } + Result Dualshock4Controller::setPlayerLed(u8 led_mask) { u8 i = 0; while (led_mask >>= 1) { ++i; } diff --git a/btdrv-mitm/source/controllers/dualshock4.hpp b/btdrv-mitm/source/controllers/dualshock4.hpp index 3e74d54..cf325de 100644 --- a/btdrv-mitm/source/controllers/dualshock4.hpp +++ b/btdrv-mitm/source/controllers/dualshock4.hpp @@ -116,6 +116,7 @@ namespace ams::controller { Dualshock4Controller(const bluetooth::Address *address) : FakeSwitchController(ControllerType_Dualshock4, address), m_ledColour({0, 0, 0}) { }; + Result initialize(void); Result setPlayerLed(u8 led_mask); Result setLightbarColour(Dualshock4LedColour colour);