Support Bluepad32 gamepads as native Joy-Con pair sources

This commit is contained in:
Joey Yakimowich-Payne 2026-09-12 23:03:15 -06:00
commit a17ca603aa
33 changed files with 2529 additions and 851 deletions

View file

@ -5,12 +5,17 @@ import subprocess
import sys
from pathlib import Path
import pytest
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
from prepare_bluepad32 import prepare_bluepad32
def test_wii_parser_native_motion_and_lifecycle(tmp_path: Path) -> None:
@pytest.mark.parametrize("full_input", [False, True])
def test_wii_parser_native_motion_and_lifecycle(
tmp_path: Path, full_input: bool
) -> None:
root = Path(__file__).resolve().parents[1]
compiler = shutil.which("cc") or shutil.which("gcc")
assert compiler is not None, "a host C compiler is required"
@ -32,11 +37,15 @@ def test_wii_parser_native_motion_and_lifecycle(tmp_path: Path) -> None:
"-fdata-sections",
"-DENABLE_BLE",
"-DENABLE_CLASSIC",
f"-DSWITCH2_BRIDGE_FULL_INPUT={int(full_input)}",
f"-I{root / 'tests' / 'switch_parser_native_stubs'}",
f"-I{root / 'bluepad32_config'}",
f"-I{component / 'include'}",
str(root / "tests" / "wii_parser_native_test.c"),
str(component / "parser" / "uni_hid_parser_wii.c"),
str(
root / "bluepad32_config" / "parser" / "uni_hid_parser_native_motion.c"
),
str(component / "controller" / "uni_gamepad.c"),
"-Wl,--gc-sections",
"-o",