git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 36f084f474ab50bbe79ab44c1a7f377882fb22a7
parent a450ab2a8ecd438c43bdb429b3d57f5c57d7f562
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Fri, 28 Oct 2022 13:32:06 +0300

Explicitly enable vibration for Switch controllers, fixes rumble for Joy-Cons

Diffstat:
MJoyKit/JOYController.m6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/JoyKit/JOYController.m b/JoyKit/JOYController.m @@ -598,6 +598,12 @@ typedef union { _lastVendorSpecificOutput.switchPacket.command = 0x40; // Enable/disableIMU _lastVendorSpecificOutput.switchPacket.commandData[0] = 1; // Enabled [self sendReport:[NSData dataWithBytes:&_lastVendorSpecificOutput.switchPacket length:sizeof(_lastVendorSpecificOutput.switchPacket)]]; + + _lastVendorSpecificOutput.switchPacket.sequence++; + _lastVendorSpecificOutput.switchPacket.sequence &= 0xF; + _lastVendorSpecificOutput.switchPacket.command = 0x48; // Set vibration enabled + _lastVendorSpecificOutput.switchPacket.commandData[0] = 1; // enabled + [self sendReport:[NSData dataWithBytes:&_lastVendorSpecificOutput.switchPacket length:sizeof(_lastVendorSpecificOutput.switchPacket)]]; } if (_isDualShock3) {

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.