mirror of
https://github.com/sub0x00001/pad2c.git
synced 2026-10-23 21:03:48 +02:00
* Rumble research: log what the console asks of each virtual pad
scePadVirtualDeviceGetRemoteSetting read every 16 ms per live pad and
logged when it changes (at most 20 lines a second). On the PS5 with a
virtual DualSense: [0] update flag, [5..7] light bar RGB (Hades asked
for ba 01 13), [56] a user is assigned. [3] and [4], the motors on a
PS4, stayed 0 in Hades and Hollow Knight (PS5 games). Not for release.
* Rumble: what the console asks of a virtual pad reaches XInput pads
scePadVirtualDeviceGetRemoteSetting, read every 16 ms per live pad,
holds the motors as a DualShock 4 output report does: [3] the large
motor, [4] the small one (seen in Crash Bandicoot N. Sane Trilogy, a PS4
game: 23/47/6b/8e ramps on [3], 3f/8c on [4]). PS5 games (Hades, Hollow
Knight) send DualSense haptics as audio instead and leave them at 0.
- usbpad_rumble(): XInput rumble (00 08 00 <large> <small> 00 00 00) on
the OUT endpoint, started without waiting; a newer value replaces one
not sent yet.
- Rumble stopped when the console turns a pad off and when padbridge
stops, so no controller is left rumbling.
- The research log now covers all 256 bytes.
Tested on the PS5: the Ultimate 2C on its dongle in XInput mode rumbles
on Crash's TNT/Nitro boxes and deaths.
* View + Menu as the touchpad on XInput pads; research logs
XInput pads have no touchpad and no spare button for it: the Ultimate 2C
sends no L4/R4 in XInput mode, and its Star and Mapping buttons never
reach the console in either mode (checked on raw reports). Pressing View
and Menu together is now the touchpad click on XInput pads.
- src/combo.c: View or Menu alone is held back for 60 ms, so the console
does not see a Create press on the way to the touchpad; held longer
they go through as they are, and a shorter tap is sent when it ends.
The touchpad stays until both are released. tests/test_combo.c.
- The settings page shows what the virtual pad is given (the touchpad
lit, not View and Menu).
- Research only, to be trimmed before a release: raw XInput reports are
logged when they change.
The 2C receiver in DInput mode does not rumble: report 1 (8 bytes) and
the 8BitDo-style 05 report, by interrupt OUT and by SET_REPORT, are
accepted and ignored; 8BitDo documents rumble for XInput only.
Tested on the PS5: View + Menu lights the touchpad, each alone stays
Create or Options; XInput and DInput.
* padbridge 1.3.0: rumble in PS4 games, View + Menu as the touchpad
- Rumble: the large and small motors a game asks of the virtual
DualSense (scePadVirtualDeviceGetRemoteSetting [3], [4]) go to
controllers in XInput mode as XInput rumble. PS4 games fill them; PS5
games turn rumble into DualSense haptics inside the console and leave
them at 0. The log says when a controller's rumble starts and stops,
and whether that controller can rumble.
- The research logging (all remote setting bytes, raw XInput reports)
is gone.
- The log line for a device padbridge does not read says so plainly
("not read by padbridge"): a DualSense on its cable is one.
- README: a Vibration section, the 2C's modes with what each gives,
Star and Mapping, View + Menu in the button map, the 60 ms wait.
- Version 1.3.0, CHANGELOG.
Tested on the PS5: the Ultimate 2C in XInput rumbles in Crash Bandicoot
N. Sane Trilogy; View + Menu lights the touchpad.
* Switch Pro Controller over USB: the adapter's Switch mode, with rumble
The 8BitDo USB Wireless Adapter 2 passes rumble on in XInput mode to
PlayStation controllers only. In its Switch mode it is a Switch Pro
Controller (057e:2009) and passes rumble to Switch-type controllers (a
GameSir G8 in Switch mode, Switch Pro, Joy-Con). As documented by
dekuNukem's Switch reverse engineering notes and done by SDL:
- usbdesc: 057e:2009's HID interface is USBPAD_SWITCH (the choice now
takes the product id).
- usbpad: at connection the USB handshake (80 02, 80 03, 80 02, 80 04)
and subcommands on report 01: full input report 0x30, vibration on,
player 1's light; each with a 100 ms wait and three tries. Without it
the pad only sends a status and enumerates again every few seconds.
- mapswitch.c: report 0x30 (and 0x21) by position, as on a DualSense:
B cross, A circle, Y square, X triangle, ZL/ZR as full L2/R2, Capture
as the touchpad; sticks centred on the first report, reach learnt.
Rumble as SDL encodes it (its tables, zlib licence), report 0x10, sent
again every 50 ms while on.
- Fixed before it shipped: the mode name looked up past the end of its
table for the new kind and crashed; the lookup is now guarded.
- tests/test_switch.c.
Tested on the PS5: the adapter locked in Switch mode with a GameSir G8
(Switch mode): setup answered in 150 ms; buttons, sticks, Capture as
the touchpad; rumble in Crash Bandicoot N. Sane Trilogy. The G8 sends
its buttons by label, so it needs the Nintendo layout switch.
* README and CHANGELOG: the adapter's Switch mode, rumble per controller, credits
* README, CHANGELOG: a DualSense through the adapter rumbles (tested)
* Switch rumble: felt on third-party pads too
Crash Bandicoot's spin asks the small motor alone at 63 (25%). Through
the adapter's Switch mode the GameSir G8 felt nothing: the small motor
went to the high band, which it hardly feels, and 25% is below what its
motor starts at. Now, for Switch Pro pads only:
- the low band takes the stronger of the two motors;
- any rumble is lifted to start at 100 (about 40%), up to 255
(switch_rumble_boost).
Tested on the PS5: the G8 through the adapter in Switch mode rumbles
lightly on each spin, and harder on boxes and enemies.
* README: the GameSir G8 through the adapter (its Switch mode, Nintendo layout, rumble)
46 lines
1.7 KiB
Makefile
46 lines
1.7 KiB
Makefile
# padbridge: the 8BitDo dongle as a second DualSense on a jailbroken PS5.
|
|
#
|
|
# make test the mapping test, on this machine
|
|
# make the payloads into dist/ (needs PS5_PAYLOAD_SDK)
|
|
|
|
VERSION := $(shell sed -n 's/^\#define PADBRIDGE_VERSION "\(.*\)"/\1/p' src/version.h)
|
|
|
|
all: dist/padbridge-$(VERSION).elf dist/padbridge-probe.elf
|
|
|
|
test:
|
|
@mkdir -p build
|
|
cc -std=c11 -Wall -Wextra -Werror -Isrc -o build/test_map src/map8bitdo.c tests/test_map.c
|
|
./build/test_map
|
|
cc -std=c11 -Wall -Wextra -Werror -Isrc -o build/test_usb src/usbdesc.c src/mapxinput.c tests/test_usb.c
|
|
./build/test_usb
|
|
cc -std=c11 -Wall -Wextra -Werror -Isrc -o build/test_config src/config.c tests/test_config.c
|
|
./build/test_config
|
|
cc -std=c11 -Wall -Wextra -Werror -D_DEFAULT_SOURCE -Isrc -o build/test_web src/web.c src/log.c src/util.c tests/test_web.c
|
|
./build/test_web
|
|
cc -std=c11 -Wall -Wextra -Werror -Isrc -o build/test_combo src/combo.c tests/test_combo.c
|
|
./build/test_combo
|
|
cc -std=c11 -Wall -Wextra -Werror -Isrc -o build/test_switch src/mapswitch.c src/usbdesc.c tests/test_switch.c
|
|
./build/test_switch
|
|
|
|
ifdef PS5_PAYLOAD_SDK
|
|
include $(PS5_PAYLOAD_SDK)/toolchain/prospero.mk
|
|
endif
|
|
|
|
CFLAGS := -std=gnu11 -Wall -Wextra -O2 -Isrc
|
|
LDLIBS := -lScePad -lSceUserService -ldl
|
|
|
|
SRCS := src/main.c src/usbpad.c src/usbdesc.c src/map8bitdo.c src/mapxinput.c src/mapswitch.c src/config.c src/combo.c src/web.c src/ps5_vpad.c src/ps5_power.c src/lock.c src/log.c src/util.c
|
|
|
|
dist/padbridge-$(VERSION).elf: $(SRCS) $(wildcard src/*.h)
|
|
@mkdir -p dist
|
|
$(CC) $(CFLAGS) -o $@ $(SRCS) $(LDLIBS)
|
|
|
|
dist/padbridge-probe.elf: src/probe.c src/usbdesc.c src/usbdesc.h
|
|
@mkdir -p dist
|
|
$(CC) $(CFLAGS) -o $@ src/probe.c src/usbdesc.c
|
|
|
|
clean:
|
|
rm -rf dist build
|
|
|
|
.PHONY: all test clean
|