From 81092cf7e43f9e4cb33fd93aeba2a9f1f9383ce4 Mon Sep 17 00:00:00 2001 From: Filoppi Date: Tue, 4 May 2021 23:37:06 +0300 Subject: [PATCH] InputCommon: replace SerialInterface log with ControllerInterface where appropriate. SerialInterface was a leftover from the past, and makes no sense to be used on actual/real controllers. --- Source/Core/Common/Logging/Log.h | 1 + Source/Core/Common/Logging/LogManager.cpp | 1 + .../ControllerInterface.cpp | 4 +- .../DualShockUDPClient/DualShockUDPClient.cpp | 12 +++--- .../DualShockUDPClient/DualShockUDPProto.h | 2 +- .../ControllerInterface/OSX/OSX.mm | 8 ++-- .../ControllerInterface/OSX/OSXJoystick.mm | 5 ++- .../ControllerInterface/SDL/SDL.cpp | 6 +-- .../ControllerInterface/Win32/Win32.cpp | 18 ++++----- .../ControllerInterface/evdev/evdev.cpp | 6 +-- Source/Core/InputCommon/GCAdapter.cpp | 38 ++++++++++--------- Source/Core/InputCommon/GCAdapter_Android.cpp | 24 ++++++------ 12 files changed, 65 insertions(+), 60 deletions(-) diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index ce136b2c0b..9e45881b1c 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -20,6 +20,7 @@ enum LOG_TYPE COMMANDPROCESSOR, COMMON, CONSOLE, + CONTROLLERINTERFACE, CORE, DISCIO, DSPHLE, diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index b03255ca9e..2c58148fb2 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -123,6 +123,7 @@ LogManager::LogManager() m_log[COMMANDPROCESSOR] = {"CP", "Command Processor"}; m_log[COMMON] = {"COMMON", "Common"}; m_log[CONSOLE] = {"CONSOLE", "Dolphin Console"}; + m_log[CONTROLLERINTERFACE] = {"CI", "Controller Interface"}; m_log[CORE] = {"CORE", "Core"}; m_log[DISCIO] = {"DIO", "Disc IO"}; m_log[DSPHLE] = {"DSPHLE", "DSP HLE"}; diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index fe176ce7f7..0cae47c741 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -237,7 +237,7 @@ void ControllerInterface::AddDevice(std::shared_ptr device device->SetId(id); } - NOTICE_LOG_FMT(SERIALINTERFACE, "Added device: {}", device->GetQualifiedName()); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "Added device: {}", device->GetQualifiedName()); m_devices.emplace_back(std::move(device)); } @@ -252,7 +252,7 @@ void ControllerInterface::RemoveDevice(std::functionGetQualifiedName()); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "Removed device: {}", dev->GetQualifiedName()); return true; } return false; diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp index 99767dee4c..ea855632c9 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp @@ -205,7 +205,7 @@ static bool IsSameController(const Proto::MessageType::PortInfo& a, static void HotplugThreadFunc() { Common::SetCurrentThreadName("DualShockUDPClient Hotplug Thread"); - INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient hotplug thread started"); + INFO_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient hotplug thread started"); while (s_hotplug_thread_running.IsSet()) { @@ -225,7 +225,7 @@ static void HotplugThreadFunc() if (server.m_socket.send(&list_ports, sizeof list_ports, server.m_address, server.m_port) != sf::Socket::Status::Done) { - ERROR_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); } } } @@ -277,7 +277,7 @@ static void HotplugThreadFunc() } } } - INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient hotplug thread stopped"); + INFO_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient hotplug thread stopped"); } static void StartHotplugThread() @@ -310,7 +310,7 @@ static void StopHotplugThread() static void Restart() { - INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient Restart"); + INFO_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient Restart"); StopHotplugThread(); @@ -394,7 +394,7 @@ void Init() void PopulateDevices() { - INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient PopulateDevices"); + INFO_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient PopulateDevices"); // s_servers has already been updated so we can't use it to know which devices we removed, // also it's good to remove all of them before adding new ones so that their id will be set @@ -510,7 +510,7 @@ void Device::UpdateInput() if (m_socket.send(&data_req, sizeof(data_req), m_server_address, m_server_port) != sf::Socket::Status::Done) { - ERROR_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient UpdateInput send failed"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient UpdateInput send failed"); } } diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h index 582b483555..5d445e11da 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h @@ -249,7 +249,7 @@ struct Message if (crc32_in_header != crc32_calculated) { NOTICE_LOG_FMT( - SERIALINTERFACE, + CONTROLLERINTERFACE, "DualShockUDPClient Received message with bad CRC in header: got {:08x}, expected {:08x}", crc32_in_header, crc32_calculated); return std::nullopt; diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm index de878b6a3e..63bddf499e 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm @@ -178,11 +178,11 @@ void Init(void* window) HIDManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); if (!HIDManager) - ERROR_LOG_FMT(SERIALINTERFACE, "Failed to create HID Manager reference"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "Failed to create HID Manager reference"); IOHIDManagerSetDeviceMatching(HIDManager, nullptr); if (IOHIDManagerOpen(HIDManager, kIOHIDOptionsTypeNone) != kIOReturnSuccess) - ERROR_LOG_FMT(SERIALINTERFACE, "Failed to open HID Manager"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "Failed to open HID Manager"); // Callbacks for acquisition or loss of a matching device IOHIDManagerRegisterDeviceMatchingCallback(HIDManager, DeviceMatchingCallback, nullptr); @@ -198,7 +198,7 @@ void Init(void* window) // Enable hotplugging s_hotplug_thread = std::thread([] { Common::SetCurrentThreadName("IOHIDManager Hotplug Thread"); - NOTICE_LOG_FMT(SERIALINTERFACE, "IOHIDManager hotplug thread started"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "IOHIDManager hotplug thread started"); IOHIDManagerScheduleWithRunLoop(HIDManager, CFRunLoopGetCurrent(), OurRunLoop); s_stopper.AddToRunLoop(CFRunLoopGetCurrent(), OurRunLoop); @@ -206,7 +206,7 @@ void Init(void* window) s_stopper.RemoveFromRunLoop(CFRunLoopGetCurrent(), OurRunLoop); IOHIDManagerUnscheduleFromRunLoop(HIDManager, CFRunLoopGetCurrent(), OurRunLoop); - NOTICE_LOG_FMT(SERIALINTERFACE, "IOHIDManager hotplug thread stopped"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "IOHIDManager hotplug thread stopped"); }); } diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm index 39794426a8..f08f704275 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm @@ -109,8 +109,9 @@ void Joystick::AddElements(CFArrayRef elements, std::set& co break; } - NOTICE_LOG_FMT(SERIALINTERFACE, "Unknown IOHIDElement, ignoring (Usage: {:x}, Type: {:x})", - usage, IOHIDElementGetType(e)); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, + "Unknown IOHIDElement, ignoring (Usage: {:x}, Type: {:x})", usage, + IOHIDElementGetType(e)); break; } diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index e232fd6ee7..f908181c8d 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -81,7 +81,7 @@ void Init() { #if !SDL_VERSION_ATLEAST(2, 0, 0) if (SDL_Init(SDL_INIT_JOYSTICK) != 0) - ERROR_LOG_FMT(SERIALINTERFACE, "SDL failed to initialize"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "SDL failed to initialize"); return; #else s_hotplug_thread = std::thread([] { @@ -95,14 +95,14 @@ void Init() if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC) != 0) { - ERROR_LOG_FMT(SERIALINTERFACE, "SDL failed to initialize"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "SDL failed to initialize"); return; } const Uint32 custom_events_start = SDL_RegisterEvents(2); if (custom_events_start == static_cast(-1)) { - ERROR_LOG_FMT(SERIALINTERFACE, "SDL failed to register custom events"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "SDL failed to register custom events"); return; } s_stop_event_type = custom_events_start; diff --git a/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp b/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp index 096ad31827..b7cf19a13d 100644 --- a/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp @@ -53,7 +53,7 @@ void ciface::Win32::Init(void* hwnd) if (FAILED(CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED))) { - ERROR_LOG_FMT(SERIALINTERFACE, "CoInitializeEx failed: {}", GetLastError()); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "CoInitializeEx failed: {}", GetLastError()); return; } Common::ScopeGuard uninit([] { CoUninitialize(); }); @@ -67,12 +67,12 @@ void ciface::Win32::Init(void* hwnd) ATOM window_class = RegisterClassEx(&window_class_info); if (!window_class) { - NOTICE_LOG_FMT(SERIALINTERFACE, "RegisterClassEx failed: {}", GetLastError()); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "RegisterClassEx failed: {}", GetLastError()); return; } Common::ScopeGuard unregister([&window_class] { if (!UnregisterClass(MAKEINTATOM(window_class), GetModuleHandle(nullptr))) - ERROR_LOG_FMT(SERIALINTERFACE, "UnregisterClass failed: {}", GetLastError()); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "UnregisterClass failed: {}", GetLastError()); }); message_window = CreateWindowEx(0, L"Message", nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, @@ -80,12 +80,12 @@ void ciface::Win32::Init(void* hwnd) promise_guard.Exit(); if (!message_window) { - ERROR_LOG_FMT(SERIALINTERFACE, "CreateWindowEx failed: {}", GetLastError()); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "CreateWindowEx failed: {}", GetLastError()); return; } Common::ScopeGuard destroy([&] { if (!DestroyWindow(message_window)) - ERROR_LOG_FMT(SERIALINTERFACE, "DestroyWindow failed: {}", GetLastError()); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "DestroyWindow failed: {}", GetLastError()); }); std::array devices; @@ -103,7 +103,7 @@ void ciface::Win32::Init(void* hwnd) if (!RegisterRawInputDevices(devices.data(), static_cast(devices.size()), static_cast(sizeof(decltype(devices)::value_type)))) { - ERROR_LOG_FMT(SERIALINTERFACE, "RegisterRawInputDevices failed: {}", GetLastError()); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "RegisterRawInputDevices failed: {}", GetLastError()); return; } @@ -128,18 +128,18 @@ void ciface::Win32::PopulateDevices(void* hwnd) s_done_populating.Reset(); PostMessage(s_message_window, WM_INPUT_DEVICE_CHANGE, 0, 0); if (!s_done_populating.WaitFor(std::chrono::seconds(10))) - ERROR_LOG_FMT(SERIALINTERFACE, "win32 timed out when trying to populate devices"); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "win32 timed out when trying to populate devices"); } else { - ERROR_LOG_FMT(SERIALINTERFACE, + ERROR_LOG_FMT(CONTROLLERINTERFACE, "win32 asked to populate devices, but device thread isn't running"); } } void ciface::Win32::DeInit() { - NOTICE_LOG_FMT(SERIALINTERFACE, "win32 DeInit"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "win32 DeInit"); if (s_thread.joinable()) { PostMessage(s_message_window, WM_DOLPHIN_STOP, 0, 0); diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp index 214dd323ac..265d81ad40 100644 --- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp +++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp @@ -253,7 +253,7 @@ static void AddDeviceNode(const char* devnode) auto evdev_device = FindDeviceWithUniqueIDAndPhysicalLocation(uniq, phys); if (evdev_device) { - NOTICE_LOG_FMT(SERIALINTERFACE, + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "evdev combining devices with unique id: {}, physical location: {}", uniq, phys); evdev_device->AddNode(devnode, fd, dev); @@ -282,7 +282,7 @@ static void AddDeviceNode(const char* devnode) static void HotplugThreadFunc() { Common::SetCurrentThreadName("evdev Hotplug Thread"); - NOTICE_LOG_FMT(SERIALINTERFACE, "evdev hotplug thread started"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "evdev hotplug thread started"); udev* const udev = udev_new(); Common::ScopeGuard udev_guard([udev] { udev_unref(udev); }); @@ -337,7 +337,7 @@ static void HotplugThreadFunc() AddDeviceNode(devnode); } } - NOTICE_LOG_FMT(SERIALINTERFACE, "evdev hotplug thread stopped"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "evdev hotplug thread stopped"); } static void StartHotplugThread() diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index cf16d06b0c..6041defaa3 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -88,7 +88,8 @@ static void Read() int err = libusb_interrupt_transfer(s_handle, s_endpoint_in, s_controller_payload_swap, sizeof(s_controller_payload_swap), &payload_size, 16); if (err) - ERROR_LOG_FMT(SERIALINTERFACE, "adapter libusb read failed: err={}", libusb_error_name(err)); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "adapter libusb read failed: err={}", + libusb_error_name(err)); { std::lock_guard lk(s_mutex); @@ -121,7 +122,8 @@ static void Write() const int err = libusb_interrupt_transfer(s_handle, s_endpoint_out, payload, sizeof(payload), &size, 16); if (err != 0) - ERROR_LOG_FMT(SERIALINTERFACE, "adapter libusb write failed: err={}", libusb_error_name(err)); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "adapter libusb write failed: err={}", + libusb_error_name(err)); } } @@ -154,7 +156,7 @@ static int HotplugCallback(libusb_context* ctx, libusb_device* dev, libusb_hotpl static void ScanThreadFunc() { Common::SetCurrentThreadName("GC Adapter Scanning Thread"); - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread started"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter scanning thread started"); #if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 #ifndef __FreeBSD__ @@ -170,7 +172,7 @@ static void ScanThreadFunc() nullptr, &s_hotplug_handle) != LIBUSB_SUCCESS) s_libusb_hotplug_enabled = false; if (s_libusb_hotplug_enabled) - NOTICE_LOG_FMT(SERIALINTERFACE, "Using libUSB hotplug detection"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "Using libUSB hotplug detection"); } #endif @@ -187,7 +189,7 @@ static void ScanThreadFunc() else Common::SleepCurrentThread(500); } - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread stopped"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter scanning thread stopped"); } void SetAdapterCallback(std::function func) @@ -265,7 +267,7 @@ static bool CheckDeviceAccess(libusb_device* device) if (ret != 0) { // could not acquire the descriptor, no point in trying to use it. - ERROR_LOG_FMT(SERIALINTERFACE, "libusb_get_device_descriptor failed with error: {}", ret); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "libusb_get_device_descriptor failed with error: {}", ret); return false; } @@ -275,7 +277,7 @@ static bool CheckDeviceAccess(libusb_device* device) return false; } - NOTICE_LOG_FMT(SERIALINTERFACE, "Found GC Adapter with Vendor: {:X} Product: {:X} Devnum: {}", + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "Found GC Adapter with Vendor: {:X} Product: {:X} Devnum: {}", desc.idVendor, desc.idProduct, 1); // In case of failure, capture the libusb error code into the adapter status @@ -287,14 +289,14 @@ static bool CheckDeviceAccess(libusb_device* device) if (ret == LIBUSB_ERROR_ACCESS) { ERROR_LOG_FMT( - SERIALINTERFACE, + CONTROLLERINTERFACE, "Dolphin does not have access to this device: Bus {:03d} Device {:03d}: ID {:04X}:{:04X}.", bus, port, desc.idVendor, desc.idProduct); return false; } if (ret != 0) { - ERROR_LOG_FMT(SERIALINTERFACE, "libusb_open failed to open device with error = {}", ret); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "libusb_open failed to open device with error = {}", ret); return false; } @@ -303,14 +305,14 @@ static bool CheckDeviceAccess(libusb_device* device) { ret = libusb_detach_kernel_driver(s_handle, 0); if (ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED) - ERROR_LOG_FMT(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: {}", ret); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "libusb_detach_kernel_driver failed with error: {}", ret); } // This call makes Nyko-brand (and perhaps other) adapters work. // However it returns LIBUSB_ERROR_PIPE with Mayflash adapters. const int transfer = libusb_control_transfer(s_handle, 0x21, 11, 0x0001, 0, nullptr, 0, 1000); if (transfer < 0) - WARN_LOG_FMT(SERIALINTERFACE, "libusb_control_transfer failed with error: {}", transfer); + WARN_LOG_FMT(CONTROLLERINTERFACE, "libusb_control_transfer failed with error: {}", transfer); // this split is needed so that we don't avoid claiming the interface when // detaching the kernel driver is successful @@ -324,7 +326,7 @@ static bool CheckDeviceAccess(libusb_device* device) ret = libusb_claim_interface(s_handle, 0); if (ret != 0) { - ERROR_LOG_FMT(SERIALINTERFACE, "libusb_claim_interface failed with error: {}", ret); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "libusb_claim_interface failed with error: {}", ret); libusb_close(s_handle); s_handle = nullptr; return false; @@ -410,7 +412,7 @@ static void Reset() } if (s_detect_callback != nullptr) s_detect_callback(); - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter detached"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter detached"); } GCPadStatus Input(int chan) @@ -436,8 +438,8 @@ GCPadStatus Input(int chan) controller_payload_copy[0] != LIBUSB_DT_HID) { // This can occur for a few frames on initialization. - ERROR_LOG_FMT(SERIALINTERFACE, "error reading payload (size: {}, type: {:02x})", payload_size, - controller_payload_copy[0]); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "error reading payload (size: {}, type: {:02x})", + payload_size, controller_payload_copy[0]); } else { @@ -446,8 +448,8 @@ GCPadStatus Input(int chan) if (type != ControllerTypes::CONTROLLER_NONE && s_controller_type[chan] == ControllerTypes::CONTROLLER_NONE) { - NOTICE_LOG_FMT(SERIALINTERFACE, "New device connected to Port {} of Type: {:02x}", chan + 1, - controller_payload_copy[1 + (9 * chan)]); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "New device connected to Port {} of Type: {:02x}", + chan + 1, controller_payload_copy[1 + (9 * chan)]); get_origin = true; } @@ -551,7 +553,7 @@ static void ResetRumbleLockNeeded() int size = 0; libusb_interrupt_transfer(s_handle, s_endpoint_out, rumble, sizeof(rumble), &size, 16); - INFO_LOG_FMT(SERIALINTERFACE, "Rumble state reset"); + INFO_LOG_FMT(CONTROLLERINTERFACE, "Rumble state reset"); } void Output(int chan, u8 rumble_command) diff --git a/Source/Core/InputCommon/GCAdapter_Android.cpp b/Source/Core/InputCommon/GCAdapter_Android.cpp index a2b169abda..88888b345a 100644 --- a/Source/Core/InputCommon/GCAdapter_Android.cpp +++ b/Source/Core/InputCommon/GCAdapter_Android.cpp @@ -64,7 +64,7 @@ static u64 s_last_init = 0; static void ScanThreadFunc() { Common::SetCurrentThreadName("GC Adapter Scanning Thread"); - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread started"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter scanning thread started"); JNIEnv* env = IDCache::GetEnvForThread(); @@ -78,13 +78,13 @@ static void ScanThreadFunc() Common::SleepCurrentThread(1000); } - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread stopped"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter scanning thread stopped"); } static void Write() { Common::SetCurrentThreadName("GC Adapter Write Thread"); - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter write thread started"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter write thread started"); JNIEnv* env = IDCache::GetEnvForThread(); jmethodID output_func = env->GetStaticMethodID(s_adapter_class, "Output", "([B)I"); @@ -108,7 +108,7 @@ static void Write() // Netplay sends invalid data which results in size = 0x00. Ignore it. if (size != write_size && size != 0x00) { - ERROR_LOG_FMT(SERIALINTERFACE, "error writing rumble (size: {})", size); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "error writing rumble (size: {})", size); Reset(); } } @@ -116,13 +116,13 @@ static void Write() Common::YieldCPU(); } - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter write thread stopped"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter write thread stopped"); } static void Read() { Common::SetCurrentThreadName("GC Adapter Read Thread"); - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter read thread started"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter read thread started"); bool first_read = true; JNIEnv* env = IDCache::GetEnvForThread(); @@ -179,7 +179,7 @@ static void Read() s_fd = 0; s_detected = false; - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter read thread stopped"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter read thread stopped"); } void Init() @@ -229,7 +229,7 @@ static void Reset() s_detected = false; s_fd = 0; - NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter detached"); + NOTICE_LOG_FMT(CONTROLLERINTERFACE, "GC Adapter detached"); } void Shutdown() @@ -270,8 +270,8 @@ GCPadStatus Input(int chan) GCPadStatus pad = {}; if (payload_size != controller_payload_copy.size()) { - ERROR_LOG_FMT(SERIALINTERFACE, "error reading payload (size: {}, type: {:02x})", payload_size, - controller_payload_copy[0]); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "error reading payload (size: {}, type: {:02x})", + payload_size, controller_payload_copy[0]); Reset(); } else @@ -281,8 +281,8 @@ GCPadStatus Input(int chan) if (type != ControllerTypes::CONTROLLER_NONE && s_controller_type[chan] == ControllerTypes::CONTROLLER_NONE) { - ERROR_LOG_FMT(SERIALINTERFACE, "New device connected to Port {} of Type: {:02x}", chan + 1, - controller_payload_copy[1 + (9 * chan)]); + ERROR_LOG_FMT(CONTROLLERINTERFACE, "New device connected to Port {} of Type: {:02x}", + chan + 1, controller_payload_copy[1 + (9 * chan)]); get_origin = true; }