2
0
Fork 0
mirror of https://github.com/ndeadly/MissionControl synced 2025-03-02 06:07:10 +00:00

mc.mitm: remove all void arguments

This commit is contained in:
ndeadly 2022-04-09 01:12:59 +10:00
parent 44e85a60e0
commit 4f6a142a93
51 changed files with 180 additions and 180 deletions

@ -1 +1 @@
Subproject commit a1d6b3be4322efcc0b92d61e68bba6e6f3fe534e
Subproject commit 9865dbf92177c358b88fa7542b628d8a8a2a9d74

View file

@ -45,7 +45,7 @@ namespace ams::async {
}
Result Initialize(void) {
Result Initialize() {
os::InitializeMessageQueue(&g_work_queue, g_message_buffer, MessageBufferSize);
for (unsigned int i = 0; i < ThreadCount; ++i) {
@ -64,7 +64,7 @@ namespace ams::async {
return ams::ResultSuccess();
}
void Finalize(void) {
void Finalize() {
os::FinalizeMessageQueue(&g_work_queue);
for (unsigned int i = 0; i < ThreadCount; ++i) {

View file

@ -21,8 +21,8 @@ namespace ams::async {
using AsyncFunction = std::function<Result(void)>;
Result Initialize(void);
void Finalize(void);
Result Initialize();
void Finalize();
void QueueWork(AsyncFunction *function);

View file

@ -50,11 +50,11 @@ namespace ams {
return m_user_data;
}
void Wait(void) {
void Wait() {
os::WaitEvent(&m_ready_event);
}
bool TryWait(void) {
bool TryWait() {
return os::TryWaitEvent(&m_ready_event);
}

View file

@ -38,23 +38,23 @@ namespace ams::bluetooth::ble {
return g_init_event.TryWait();
}
void SignalInitialized(void) {
void SignalInitialized() {
g_init_event.Signal();
}
void WaitInitialized(void) {
void WaitInitialized() {
g_init_event.Wait();
}
os::SystemEvent *GetSystemEvent(void) {
os::SystemEvent *GetSystemEvent() {
return &g_system_event;
}
os::SystemEvent *GetForwardEvent(void) {
os::SystemEvent *GetForwardEvent() {
return &g_system_event_fwd;
}
os::SystemEvent *GetUserForwardEvent(void) {
os::SystemEvent *GetUserForwardEvent() {
return &g_system_event_user_fwd;
}
@ -69,7 +69,7 @@ namespace ams::bluetooth::ble {
return ams::ResultSuccess();
}
void HandleEvent(void) {
void HandleEvent() {
{
std::scoped_lock lk(g_event_data_lock);
R_ABORT_UNLESS(btdrvGetBleManagedEventInfo(&g_event_info, sizeof(bluetooth::BleEventInfo), &g_current_event_type));

View file

@ -20,15 +20,15 @@
namespace ams::bluetooth::ble {
bool IsInitialized(void);
void SignalInitialized(void);
void WaitInitialized(void);
bool IsInitialized();
void SignalInitialized();
void WaitInitialized();
os::SystemEvent *GetSystemEvent(void);
os::SystemEvent *GetForwardEvent(void);
os::SystemEvent *GetUserForwardEvent(void);
os::SystemEvent *GetSystemEvent();
os::SystemEvent *GetForwardEvent();
os::SystemEvent *GetUserForwardEvent();
Result GetEventInfo(bluetooth::BleEventType *type, void *buffer, size_t size);
void HandleEvent(void);
void HandleEvent();
}

View file

@ -19,7 +19,7 @@
namespace ams::bluetooth {
CircularBuffer::CircularBuffer(void) {
CircularBuffer::CircularBuffer() {
this->readOffset = 0;
this->writeOffset = 0;
this->isInitialized = false;
@ -38,7 +38,7 @@ namespace ams::bluetooth {
this->isInitialized = true;
}
void CircularBuffer::Finalize(void) {
void CircularBuffer::Finalize() {
if (!this->isInitialized)
fatalThrow(-1);
@ -46,11 +46,11 @@ namespace ams::bluetooth {
this->event = nullptr;
}
bool CircularBuffer::IsInitialized(void) {
bool CircularBuffer::IsInitialized() {
return this->isInitialized;
}
u64 CircularBuffer::GetWriteableSize(void) {
u64 CircularBuffer::GetWriteableSize() {
u32 readOffset = this->readOffset;
u32 writeOffset = this->writeOffset;
@ -128,11 +128,11 @@ namespace ams::bluetooth {
}
}
CircularBufferPacket *CircularBuffer::Read(void) {
CircularBufferPacket *CircularBuffer::Read() {
return this->_read();
}
u64 CircularBuffer::Free(void) {
u64 CircularBuffer::Free() {
if (!this->isInitialized)
return -1;
@ -167,11 +167,11 @@ namespace ams::bluetooth {
this->writeOffset = offset;
}
u32 CircularBuffer::_getWriteOffset(void) {
u32 CircularBuffer::_getWriteOffset() {
return this->writeOffset;
}
u32 CircularBuffer::_getReadOffset(void) {
u32 CircularBuffer::_getReadOffset() {
return this->readOffset;
}
@ -200,14 +200,14 @@ namespace ams::bluetooth {
return 0;
}
void CircularBuffer::_updateUtilization(void) {
void CircularBuffer::_updateUtilization() {
u32 newCapacity = this->isInitialized ? this->GetWriteableSize() : 0;
if (this->size > newCapacity + 1000)
this->size = newCapacity;
}
CircularBufferPacket *CircularBuffer::_read(void) {
CircularBufferPacket *CircularBuffer::_read() {
if (this->isInitialized) {
CircularBufferPacket *packet;
u32 newOffset;

View file

@ -46,26 +46,26 @@ namespace ams::bluetooth {
class CircularBuffer {
public:
CircularBuffer(void);
CircularBuffer();
void Initialize(const char *name); // 10.0.0+, previously took event argument
void Finalize(void);
bool IsInitialized(void);
u64 GetWriteableSize(void);
void Finalize();
bool IsInitialized();
u64 GetWriteableSize();
void SetWriteCompleteEvent(os::EventType *event);
u64 Write(u8 type, void *data, size_t size);
void DiscardOldPackets(u8 type, u32 ageLimit);
CircularBufferPacket *Read(void);
u64 Free(void);
CircularBufferPacket *Read();
u64 Free();
private:
void _setReadOffset(u32 offset);
void _setWriteOffset(u32 offset);
u32 _getWriteOffset(void);
u32 _getReadOffset(void);
u32 _getWriteOffset();
u32 _getReadOffset();
u64 _write(u8 type, void *data, size_t size);
void _updateUtilization(void);
CircularBufferPacket *_read(void);
void _updateUtilization();
CircularBufferPacket *_read();
os::SdkMutex mutex;
os::EventType *event;

View file

@ -46,31 +46,31 @@ namespace ams::bluetooth::core {
return g_init_event.TryWait();
}
void SignalInitialized(void) {
void SignalInitialized() {
g_init_event.Signal();
}
void WaitInitialized(void) {
void WaitInitialized() {
g_init_event.Wait();
}
void SignalEnabled(void) {
void SignalEnabled() {
g_enable_event.Signal();
}
void WaitEnabled(void) {
void WaitEnabled() {
g_enable_event.Wait();
}
os::SystemEvent *GetSystemEvent(void) {
os::SystemEvent *GetSystemEvent() {
return &g_system_event;
}
os::SystemEvent *GetForwardEvent(void) {
os::SystemEvent *GetForwardEvent() {
return &g_system_event_fwd;
}
os::SystemEvent *GetUserForwardEvent(void) {
os::SystemEvent *GetUserForwardEvent() {
return &g_system_event_user_fwd;
}
@ -184,7 +184,7 @@ namespace ams::bluetooth::core {
R_ABORT_UNLESS(btdrvRespondToPinRequest(event_info->pairing_pin_code_request.addr, &pin));
}
void HandleEvent(void) {
void HandleEvent() {
{
std::scoped_lock lk(g_event_info_lock);
R_ABORT_UNLESS(btdrvGetEventInfo(&g_event_info, sizeof(bluetooth::EventInfo), &g_current_event_type));

View file

@ -20,18 +20,18 @@
namespace ams::bluetooth::core {
bool IsInitialized(void);
void SignalInitialized(void);
void WaitInitialized(void);
void SignalEnabled(void);
void WaitEnabled(void);
bool IsInitialized();
void SignalInitialized();
void WaitInitialized();
void SignalEnabled();
void WaitEnabled();
os::SystemEvent *GetSystemEvent(void);
os::SystemEvent *GetForwardEvent(void);
os::SystemEvent *GetUserForwardEvent(void);
os::SystemEvent *GetSystemEvent();
os::SystemEvent *GetForwardEvent();
os::SystemEvent *GetUserForwardEvent();
void SignalFakeEvent(bluetooth::EventType type, const void *data, size_t size);
Result GetEventInfo(ncm::ProgramId program_id, bluetooth::EventType *type, void *buffer, size_t size);
void HandleEvent(void);
void HandleEvent();
}

View file

@ -76,7 +76,7 @@ namespace ams::bluetooth::events {
}
Result Initialize(void) {
Result Initialize() {
R_TRY(os::CreateThread(&g_thread,
EventHandlerThreadFunc,
nullptr,
@ -91,7 +91,7 @@ namespace ams::bluetooth::events {
return ams::ResultSuccess();
}
void Finalize(void) {
void Finalize() {
os::DestroyThread(&g_thread);
}

View file

@ -24,7 +24,7 @@ namespace ams::bluetooth::events {
BtdrvEventType_BluetoothBle,
};
Result Initialize(void);
void Finalize(void);
Result Initialize();
void Finalize();
}

View file

@ -40,23 +40,23 @@ namespace ams::bluetooth::hid {
return g_init_event.TryWait();
}
void SignalInitialized(void) {
void SignalInitialized() {
g_init_event.Signal();
}
void WaitInitialized(void) {
void WaitInitialized() {
g_init_event.Wait();
}
os::SystemEvent *GetSystemEvent(void) {
os::SystemEvent *GetSystemEvent() {
return &g_system_event;
}
os::SystemEvent *GetForwardEvent(void) {
os::SystemEvent *GetForwardEvent() {
return &g_system_event_fwd;
}
os::SystemEvent *GetUserForwardEvent(void) {
os::SystemEvent *GetUserForwardEvent() {
return &g_system_event_user_fwd;
}
@ -104,7 +104,7 @@ namespace ams::bluetooth::hid {
}
}
void HandleEvent(void) {
void HandleEvent() {
{
std::scoped_lock lk(g_event_info_lock);
R_ABORT_UNLESS(btdrvGetHidEventInfo(&g_event_info, sizeof(bluetooth::HidEventInfo), &g_current_event_type));

View file

@ -20,16 +20,16 @@
namespace ams::bluetooth::hid {
bool IsInitialized(void);
void SignalInitialized(void);
void WaitInitialized(void);
bool IsInitialized();
void SignalInitialized();
void WaitInitialized();
os::SystemEvent *GetSystemEvent(void);
os::SystemEvent *GetForwardEvent(void);
os::SystemEvent *GetUserForwardEvent(void);
os::SystemEvent *GetSystemEvent();
os::SystemEvent *GetForwardEvent();
os::SystemEvent *GetUserForwardEvent();
void SignalFakeEvent(bluetooth::HidEventType type, const void *data, size_t size);
Result GetEventInfo(bluetooth::HidEventType *type, void *buffer, size_t size);
void HandleEvent(void);
void HandleEvent();
}

View file

@ -67,42 +67,42 @@ namespace ams::bluetooth::hid::report {
return g_init_event.TryWait();
}
void WaitInitialized(void) {
void WaitInitialized() {
g_init_event.Wait();
}
void SignalInitialized(void) {
void SignalInitialized() {
g_init_event.Signal();
}
void SignalReportRead(void) {
void SignalReportRead() {
g_report_read_event.Signal();
}
os::SharedMemory *GetRealSharedMemory(void) {
os::SharedMemory *GetRealSharedMemory() {
if (hos::GetVersion() < hos::Version_7_0_0)
return nullptr;
return &g_real_bt_shmem;
}
os::SharedMemory *GetFakeSharedMemory(void) {
os::SharedMemory *GetFakeSharedMemory() {
return &g_fake_bt_shmem;
}
os::SystemEvent *GetSystemEvent(void) {
os::SystemEvent *GetSystemEvent() {
return &g_system_event;
}
os::SystemEvent *GetForwardEvent(void) {
os::SystemEvent *GetForwardEvent() {
return &g_system_event_fwd;
}
os::SystemEvent *GetUserForwardEvent(void) {
os::SystemEvent *GetUserForwardEvent() {
return &g_system_event_user_fwd;
}
Result Initialize(void) {
Result Initialize() {
R_TRY(os::CreateThread(&g_thread,
EventThreadFunc,
nullptr,
@ -117,7 +117,7 @@ namespace ams::bluetooth::hid::report {
return ams::ResultSuccess();
}
void Finalize(void) {
void Finalize() {
os::DestroyThread(&g_thread);
}
@ -129,7 +129,7 @@ namespace ams::bluetooth::hid::report {
return ams::ResultSuccess();
}
Result InitializeReportBuffer(void) {
Result InitializeReportBuffer() {
g_fake_bt_shmem.Map(os::MemoryPermission_ReadWrite);
g_fake_buffer = reinterpret_cast<bluetooth::CircularBuffer *>(g_fake_bt_shmem.GetMappedAddress());
g_fake_buffer->Initialize("HID Report");
@ -226,7 +226,7 @@ namespace ams::bluetooth::hid::report {
return ams::ResultSuccess();
}
inline void HandleHidReportEventV1(void) {
inline void HandleHidReportEventV1() {
R_ABORT_UNLESS(btdrvGetHidReportEventInfo(&g_event_info, sizeof(bluetooth::HidReportEventInfo), &g_current_event_type));
switch (g_current_event_type) {
@ -259,7 +259,7 @@ namespace ams::bluetooth::hid::report {
}
}
inline void HandleHidReportEventV7(void) {
inline void HandleHidReportEventV7() {
while (true) {
auto real_packet = g_real_buffer->Read();
if (!real_packet)
@ -300,7 +300,7 @@ namespace ams::bluetooth::hid::report {
}
}
inline void HandleHidReportEventV12(void) {
inline void HandleHidReportEventV12() {
while (true) {
auto real_packet = g_real_buffer->Read();
if (!real_packet)
@ -341,7 +341,7 @@ namespace ams::bluetooth::hid::report {
}
}
void HandleEvent(void) {
void HandleEvent() {
if (g_redirect_hid_report_events) {
g_system_event_user_fwd.Signal();
g_report_read_event.Wait();

View file

@ -20,29 +20,29 @@
namespace ams::bluetooth::hid::report {
bool IsInitialized(void);
void WaitInitialized(void);
void SignalInitialized(void);
void SignalReportRead(void);
bool IsInitialized();
void WaitInitialized();
void SignalInitialized();
void SignalReportRead();
os::SharedMemory *GetRealSharedMemory(void);
os::SharedMemory *GetFakeSharedMemory(void);
os::SharedMemory *GetRealSharedMemory();
os::SharedMemory *GetFakeSharedMemory();
os::SystemEvent *GetSystemEvent(void);
os::SystemEvent *GetForwardEvent(void);
os::SystemEvent *GetUserForwardEvent(void);
os::SystemEvent *GetSystemEvent();
os::SystemEvent *GetForwardEvent();
os::SystemEvent *GetUserForwardEvent();
Result Initialize(void);
void Finalize(void);
Result Initialize();
void Finalize();
Result MapRemoteSharedMemory(os::NativeHandle handle);
Result InitializeReportBuffer(void);
Result InitializeReportBuffer();
Result WriteHidDataReport(const bluetooth::Address address, const bluetooth::HidReport *report);
Result WriteHidSetReport(const bluetooth::Address address, uint32_t status);
Result WriteHidGetReport(const bluetooth::Address address, const bluetooth::HidReport *report);
Result GetEventInfo(bluetooth::HidEventType *type, void *buffer, size_t size);
void HandleEvent(void);
void HandleEvent();
}

View file

@ -70,7 +70,7 @@ namespace ams::mitm::bluetooth {
}
Result Launch(void) {
Result Launch() {
R_TRY(os::CreateThread(&g_thread,
BtdrvMitmThreadFunction,
nullptr,
@ -85,7 +85,7 @@ namespace ams::mitm::bluetooth {
return ams::ResultSuccess();
}
void WaitFinished(void) {
void WaitFinished() {
os::WaitThread(&g_thread);
}

View file

@ -18,7 +18,7 @@
namespace ams::mitm::bluetooth {
Result Launch(void);
void WaitFinished(void);
Result Launch();
void WaitFinished();
}

View file

@ -50,7 +50,7 @@ namespace ams::mitm::bluetooth {
return ams::ResultSuccess();
}
Result BtdrvMitmService::EnableBluetooth(void) {
Result BtdrvMitmService::EnableBluetooth() {
R_TRY(btdrvEnableBluetoothFwd(m_forward_service.get()));
ams::bluetooth::core::SignalEnabled();
@ -276,7 +276,7 @@ namespace ams::mitm::bluetooth {
g_redirect_ble_events = redirect;
}
void BtdrvMitmService::SignalHidReportRead(void) {
void BtdrvMitmService::SignalHidReportRead() {
ams::bluetooth::hid::report::SignalReportRead();
}

View file

@ -19,7 +19,7 @@
#define AMS_BTDRV_MITM_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 1, Result, InitializeBluetooth, (sf::OutCopyHandle out_handle), (out_handle)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, EnableBluetooth, (void), ()) \
AMS_SF_METHOD_INFO(C, H, 2, Result, EnableBluetooth, (), ()) \
AMS_SF_METHOD_INFO(C, H, 15, Result, GetEventInfo, (sf::Out<ams::bluetooth::EventType> out_type, const sf::OutPointerBuffer &out_buffer), (out_type, out_buffer)) \
AMS_SF_METHOD_INFO(C, H, 16, Result, InitializeHid, (sf::OutCopyHandle out_handle, u16 version), (out_handle, version)) \
AMS_SF_METHOD_INFO(C, H, 19, Result, WriteHidData, (ams::bluetooth::Address address, const sf::InPointerBuffer &buffer), (address, buffer)) \
@ -39,7 +39,7 @@
AMS_SF_METHOD_INFO(C, H, 65003, void, RedirectHidEvents, (bool redirect), (redirect)) \
AMS_SF_METHOD_INFO(C, H, 65004, void, RedirectHidReportEvents, (bool redirect), (redirect)) \
AMS_SF_METHOD_INFO(C, H, 65005, void, RedirectBleEvents, (bool redirect), (redirect)) \
AMS_SF_METHOD_INFO(C, H, 65006, void, SignalHidReportRead, (void), ()) \
AMS_SF_METHOD_INFO(C, H, 65006, void, SignalHidReportRead, (), ()) \
AMS_SF_DEFINE_MITM_INTERFACE(ams::mitm::bluetooth, IBtdrvMitmInterface, AMS_BTDRV_MITM_INTERFACE_INFO, 0xAACFC9A7)
@ -58,7 +58,7 @@ namespace ams::mitm::bluetooth {
public:
Result InitializeBluetooth(sf::OutCopyHandle out_handle);
Result EnableBluetooth(void);
Result EnableBluetooth();
Result GetEventInfo(sf::Out<ams::bluetooth::EventType> out_type, const sf::OutPointerBuffer &out_buffer);
Result InitializeHid(sf::OutCopyHandle out_handle, u16 version);
Result WriteHidData(ams::bluetooth::Address address, const sf::InPointerBuffer &buffer);
@ -81,7 +81,7 @@ namespace ams::mitm::bluetooth {
void RedirectHidEvents(bool redirect);
void RedirectHidReportEvents(bool redirect);
void RedirectBleEvents(bool redirect);
void SignalHidReportRead(void);
void SignalHidReportRead();
};
static_assert(IsIBtdrvMitmInterface<BtdrvMitmService>);

View file

@ -70,7 +70,7 @@ namespace ams::mitm::btm {
}
Result Launch(void) {
Result Launch() {
R_TRY(os::CreateThread(&g_thread,
BtmMitmThreadFunction,
nullptr,
@ -85,7 +85,7 @@ namespace ams::mitm::btm {
return ams::ResultSuccess();
}
void WaitFinished(void) {
void WaitFinished() {
os::WaitThread(&g_thread);
}

View file

@ -18,7 +18,7 @@
namespace ams::mitm::btm {
Result Launch(void);
void WaitFinished(void);
Result Launch();
void WaitFinished();
}

View file

@ -147,7 +147,7 @@ namespace ams::controller {
EightBitDoController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return !((m_id.vid == 0x05a0) && (m_id.pid == 0x3232)); }
bool SupportsSetTsiCommand() { return !((m_id.vid == 0x05a0) && (m_id.pid == 0x3232)); }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -55,7 +55,7 @@ namespace ams::controller {
}
Result DualsenseController::Initialize(void) {
Result DualsenseController::Initialize() {
R_TRY(this->PushRumbleLedState());
R_TRY(EmulatedSwitchController::Initialize());
@ -71,7 +71,7 @@ namespace ams::controller {
return this->PushRumbleLedState();
}
Result DualsenseController::CancelVibration(void) {
Result DualsenseController::CancelVibration() {
m_rumble_state.amp_motor_left = 0;
m_rumble_state.amp_motor_right = 0;
return this->PushRumbleLedState();
@ -223,7 +223,7 @@ namespace ams::controller {
return ams::ResultSuccess();
}
Result DualsenseController::PushRumbleLedState(void) {
Result DualsenseController::PushRumbleLedState() {
DualsenseOutputReport0x31 report = {0xa2, 0x31, 0x02, 0x03, 0x14, m_rumble_state.amp_motor_right, m_rumble_state.amp_motor_left};
report.data[41] = 0x02;
report.data[44] = 0x02;

View file

@ -151,9 +151,9 @@ namespace ams::controller {
, m_led_colour({0, 0, 0})
, m_rumble_state({0, 0}) { }
Result Initialize(void);
Result Initialize();
Result SetVibration(const SwitchRumbleData *rumble_data);
Result CancelVibration(void);
Result CancelVibration();
Result SetPlayerLed(uint8_t led_mask);
Result SetLightbarColour(RGBColour colour);
@ -166,7 +166,7 @@ namespace ams::controller {
void MapButtons(const DualsenseButtonData *buttons);
Result GetCalibrationData(DualsenseImuCalibrationData *calibration);
Result PushRumbleLedState(void);
Result PushRumbleLedState();
uint8_t m_led_flags;
RGBColour m_led_colour;

View file

@ -46,7 +46,7 @@ namespace ams::controller {
}
Result Dualshock4Controller::Initialize(void) {
Result Dualshock4Controller::Initialize() {
R_TRY(this->PushRumbleLedState());
R_TRY(EmulatedSwitchController::Initialize());
@ -62,7 +62,7 @@ namespace ams::controller {
return this->PushRumbleLedState();
}
Result Dualshock4Controller::CancelVibration(void) {
Result Dualshock4Controller::CancelVibration() {
m_rumble_state.amp_motor_left = 0;
m_rumble_state.amp_motor_right = 0;
return this->PushRumbleLedState();
@ -223,7 +223,7 @@ namespace ams::controller {
return ams::ResultSuccess();
}
Result Dualshock4Controller::PushRumbleLedState(void) {
Result Dualshock4Controller::PushRumbleLedState() {
Dualshock4OutputReport0x11 report = {0xa2, 0x11, static_cast<uint8_t>(0xc0 | (m_report_rate & 0xff)), 0x20, 0xf3, 0x04, 0x00,
m_rumble_state.amp_motor_right, m_rumble_state.amp_motor_left,
m_led_colour.r, m_led_colour.g, m_led_colour.b

View file

@ -201,9 +201,9 @@ namespace ams::controller {
, m_led_colour({0, 0, 0})
, m_rumble_state({0, 0}) { }
Result Initialize(void);
Result Initialize();
Result SetVibration(const SwitchRumbleData *rumble_data);
Result CancelVibration(void);
Result CancelVibration();
Result SetPlayerLed(uint8_t led_mask);
Result SetLightbarColour(RGBColour colour);
@ -217,7 +217,7 @@ namespace ams::controller {
Result GetVersionInfo(Dualshock4VersionInfo *version_info);
Result GetCalibrationData(Dualshock4ImuCalibrationData *calibration);
Result PushRumbleLedState(void);
Result PushRumbleLedState();
Dualshock4ReportRate m_report_rate;
RGBColour m_led_colour;

View file

@ -166,7 +166,7 @@ namespace ams::controller {
fs::CloseFile(m_spi_flash_file);
}
Result EmulatedSwitchController::Initialize(void) {
Result EmulatedSwitchController::Initialize() {
SwitchController::Initialize();
// Ensure config directory for this controller exists
@ -213,7 +213,7 @@ namespace ams::controller {
return ams::ResultSuccess();
}
void EmulatedSwitchController::ClearControllerState(void) {
void EmulatedSwitchController::ClearControllerState() {
std::memset(&m_buttons, 0, sizeof(m_buttons));
m_left_stick.SetData(STICK_ZERO, STICK_ZERO);
m_right_stick.SetData(STICK_ZERO, STICK_ZERO);

View file

@ -28,16 +28,16 @@ namespace ams::controller {
EmulatedSwitchController(const bluetooth::Address *address, HardwareID id);
virtual ~EmulatedSwitchController();
virtual Result Initialize(void);
bool IsOfficialController(void) { return false; }
virtual Result Initialize();
bool IsOfficialController() { return false; }
//Result HandleDataReportEvent(const bluetooth::HidReportEventInfo *event_info) override;
Result HandleOutputDataReport(const bluetooth::HidReport *report) override;
protected:
void ClearControllerState(void);
void ClearControllerState();
virtual Result SetVibration(const SwitchRumbleData *rumble_data) { AMS_UNUSED(rumble_data); return ams::ResultSuccess(); }
virtual Result CancelVibration(void) { return ams::ResultSuccess(); }
virtual Result CancelVibration() { return ams::ResultSuccess(); }
virtual Result SetPlayerLed(uint8_t led_mask) { AMS_UNUSED(led_mask); return ams::ResultSuccess(); }
void UpdateControllerState(const bluetooth::HidReport *report) override;

View file

@ -118,7 +118,7 @@ namespace ams::controller {
GamesirController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -75,7 +75,7 @@ namespace ams::controller {
HyperkinController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -82,7 +82,7 @@ namespace ams::controller {
LanShenController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -90,7 +90,7 @@ namespace ams::controller {
MocuteController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -74,7 +74,7 @@ namespace ams::controller {
OuyaController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -80,7 +80,7 @@ namespace ams::controller {
PowerAController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -162,7 +162,7 @@ namespace ams::controller {
SteelseriesController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return !(m_id.pid == 0x1412); }
bool SupportsSetTsiCommand() { return !(m_id.pid == 0x1412); }
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -33,20 +33,20 @@ namespace ams::controller {
m_xy[2] = (y >> 4) & 0xff;
}
uint16_t SwitchAnalogStick::GetX(void) {
uint16_t SwitchAnalogStick::GetX() {
return m_xy[0] | ((m_xy[1] & 0xf) << 8);
}
uint16_t SwitchAnalogStick::GetY(void) {
uint16_t SwitchAnalogStick::GetY() {
return (m_xy[1] >> 4) | (m_xy[2] << 4);
}
void SwitchAnalogStick::InvertX(void) {
void SwitchAnalogStick::InvertX() {
m_xy[0] ^= 0xff;
m_xy[1] ^= 0x0f;
}
void SwitchAnalogStick::InvertY(void) {
void SwitchAnalogStick::InvertY() {
m_xy[1] ^= 0xf0;
m_xy[2] ^= 0xff;
}

View file

@ -25,10 +25,10 @@ namespace ams::controller {
void SetData(uint16_t x, uint16_t y);
void SetX(uint16_t x);
void SetY(uint16_t y);
uint16_t GetX(void);
uint16_t GetY(void);
void InvertX(void);
void InvertY(void);
uint16_t GetX();
uint16_t GetY();
void InvertX();
void InvertY();
uint8_t m_xy[3];
};

View file

@ -64,14 +64,14 @@ namespace ams::controller {
return path;
}
Result SwitchController::Initialize(void) {
Result SwitchController::Initialize() {
if (this->HasSetTsiDisableFlag())
m_settsi_supported = false;
return ams::ResultSuccess();
}
bool SwitchController::HasSetTsiDisableFlag(void) {
bool SwitchController::HasSetTsiDisableFlag() {
std::string flag_file = GetControllerDirectory(&m_address) + "/settsi_disable.flag";
bool file_exists;

View file

@ -355,19 +355,19 @@ namespace ams::controller {
virtual ~SwitchController() { };
const bluetooth::Address& Address(void) const { return m_address; }
const bluetooth::Address& Address() const { return m_address; }
virtual bool IsOfficialController(void) { return true; }
virtual bool SupportsSetTsiCommand(void) { return m_settsi_supported; }
virtual bool IsOfficialController() { return true; }
virtual bool SupportsSetTsiCommand() { return m_settsi_supported; }
virtual Result Initialize(void);
virtual Result Initialize();
virtual Result HandleDataReportEvent(const bluetooth::HidReportEventInfo *event_info);
virtual Result HandleSetReportEvent(const bluetooth::HidReportEventInfo *event_info);
virtual Result HandleGetReportEvent(const bluetooth::HidReportEventInfo *event_info);
virtual Result HandleOutputDataReport(const bluetooth::HidReport *report);
private:
bool HasSetTsiDisableFlag(void);
bool HasSetTsiDisableFlag();
protected:
Result WriteDataReport(const bluetooth::HidReport *report);

View file

@ -665,7 +665,7 @@ namespace ams::controller {
return ams::ResultSuccess();
}
Result WiiController::QueryStatus(void) {
Result WiiController::QueryStatus() {
m_output_report.size = sizeof(WiiOutputReport0x15) + 1;
auto report_data = reinterpret_cast<WiiReportData *>(m_output_report.data);
report_data->id = 0x15;
@ -835,7 +835,7 @@ namespace ams::controller {
return this->WriteDataReport(&m_output_report);
}
Result WiiController::CancelVibration(void) {
Result WiiController::CancelVibration() {
m_rumble_state = 0;
m_output_report.size = sizeof(WiiOutputReport0x10) + 1;

View file

@ -471,9 +471,9 @@ namespace ams::controller {
, m_mp_extension_flag(false)
, m_mp_state_changing(false) { }
Result Initialize(void);
Result Initialize();
Result SetVibration(const SwitchRumbleData *rumble_data);
Result CancelVibration(void);
Result CancelVibration();
Result SetPlayerLed(uint8_t led_mask);
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -146,7 +146,7 @@ namespace ams::controller {
XboxOneController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
Result SetVibration(const SwitchRumbleData *rumble_data);
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -27,7 +27,7 @@ namespace ams::controller {
}
Result XiaomiController::Initialize(void) {
Result XiaomiController::Initialize() {
R_TRY(EmulatedSwitchController::Initialize());
m_output_report.size = sizeof(init_packet);
std::memcpy(m_output_report.data, init_packet, sizeof(init_packet));

View file

@ -91,9 +91,9 @@ namespace ams::controller {
XiaomiController(const bluetooth::Address *address, HardwareID id)
: EmulatedSwitchController(address, id) { }
bool SupportsSetTsiCommand(void) { return false; }
bool SupportsSetTsiCommand() { return false; }
Result Initialize(void);
Result Initialize();
void ProcessInputData(const bluetooth::HidReport *report) override;

View file

@ -61,7 +61,7 @@ namespace ams::mitm::mc {
}
Result Launch(void) {
Result Launch() {
R_TRY(os::CreateThread(&g_thread,
MissionControlThreadFunction,
nullptr,
@ -76,7 +76,7 @@ namespace ams::mitm::mc {
return ams::ResultSuccess();
}
void WaitFinished(void) {
void WaitFinished() {
os::WaitThread(&g_thread);
}

View file

@ -18,7 +18,7 @@
namespace ams::mitm::mc {
Result Launch(void);
void WaitFinished(void);
Result Launch();
void WaitFinished();
}

View file

@ -90,7 +90,7 @@ namespace ams::mitm {
}
void ParseIniConfig(void) {
void ParseIniConfig() {
/* Open the file. */
fs::FileHandle file;
{
@ -114,7 +114,7 @@ namespace ams::mitm {
R_ABORT_UNLESS(setMakeLanguage(language_code, &g_system_language));
}
MissionControlConfig *GetGlobalConfig(void) {
MissionControlConfig *GetGlobalConfig() {
return &g_global_config;
}

View file

@ -34,7 +34,7 @@ namespace ams::mitm {
};
void InitializeConfig();
MissionControlConfig *GetGlobalConfig(void);
MissionControlConfig *GetGlobalConfig();
SetLanguage GetSystemLanguage();
}

View file

@ -92,7 +92,7 @@ namespace ams::mitm {
}
void StartInitialize(void) {
void StartInitialize() {
R_ABORT_UNLESS(os::CreateThread(&g_thread,
InitializeThreadFunc,
nullptr,
@ -105,17 +105,17 @@ namespace ams::mitm {
os::StartThread(&g_thread);
}
void WaitInitialized(void) {
void WaitInitialized() {
g_init_event.Wait();
}
void LaunchModules(void) {
void LaunchModules() {
R_ABORT_UNLESS(ams::mitm::bluetooth::Launch());
R_ABORT_UNLESS(ams::mitm::btm::Launch());
R_ABORT_UNLESS(ams::mitm::mc::Launch());
}
void WaitModules(void) {
void WaitModules() {
ams::mitm::mc::WaitFinished();
ams::mitm::btm::WaitFinished();
ams::mitm::bluetooth::WaitFinished();

View file

@ -17,8 +17,8 @@
namespace ams::mitm {
void StartInitialize(void);
void WaitInitialized(void);
void LaunchModules(void);
void WaitModules(void);
void StartInitialize();
void WaitInitialized();
void LaunchModules();
void WaitModules();
}