Emulate up to four controllers on the UART firmware
UART protocol v3 adds a slot byte to input frames (v2 still accepted as slot 0) and slot-tagged BB 03 rumble frames. The regular firmware exposes SWITCH_PICO_UART_CONTROLLERS (default 4) Switch Pro interfaces like the AIO build. The bridge shares one serial port across controllers, maps index:port[:slot], and demuxes rumble by slot.
This commit is contained in:
parent
883eba193c
commit
b6a017eb06
14 changed files with 737 additions and 411 deletions
|
|
@ -564,8 +564,14 @@ if(SWITCH_PICO_INPUT_BACKEND STREQUAL "BLUEPAD32")
|
|||
target_compile_definitions(switch-pico PRIVATE SWITCH_PICO_HD_RUMBLE=1)
|
||||
endif()
|
||||
else()
|
||||
set(SWITCH_PICO_UART_CONTROLLERS 4 CACHE STRING
|
||||
"Switch Pro controllers exposed by the UART firmware (1-4, one USB interface each)")
|
||||
if(NOT SWITCH_PICO_UART_CONTROLLERS MATCHES "^[1-4]$")
|
||||
message(FATAL_ERROR
|
||||
"SWITCH_PICO_UART_CONTROLLERS must be 1, 2, 3 or 4 (got '${SWITCH_PICO_UART_CONTROLLERS}')")
|
||||
endif()
|
||||
target_compile_definitions(switch-pico PRIVATE
|
||||
SWITCH_PICO_HID_INSTANCE_COUNT=1
|
||||
SWITCH_PICO_HID_INSTANCE_COUNT=${SWITCH_PICO_UART_CONTROLLERS}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue