Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ C_TESTS = \
agent_slot_limit \
agent_slot_limit_oot \
hdr_auto \
dm_save_override
dm_save_override \
betop_ns
C_TEST_EXTRA_users = games/totk/runtime/account.c -Igames/totk/runtime
C_TEST_EXTRA_dm_save_override = games/totk/runtime/fs_host.c games/totk/runtime/account.c -Igames/totk/runtime
C_TEST_SRC_screenshot_botw = tests/test_screenshot.c
Expand Down
2 changes: 2 additions & 0 deletions games/totk/tests/dsu/native_motion.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
void runtime_motion_deadzone_default(double value) { deadzone = value; deadzoneChanges++; }
void runtime_motion_feed(const double a[3], const double g[3], uint64_t t) { (void)a; (void)g; (void)t; feeds++; }
int runtime_motion_axes(const char *axes) { (void)axes; return 0; }
void runtime_gamepad_switch_left_config(void *c, const SwitchStickCal *cal, int imm) { (void)c; (void)cal; (void)imm; }
void runtime_gamepad_switch_right_config(void *c, const SwitchStickCal *cal, int imm) { (void)c; (void)cal; (void)imm; }
void runtime_gamepad_switch_left(void *c, int x, int y) { if (!c) clears++; else { assert(x == 2048 && y == 2048); left++; } }
void runtime_gamepad_switch_right(void *c, int x, int y) { if (!c) clears++; else { assert(x == 2048 && y == 2048); right++; } }
void runtime_gamepad_switch_capture(void *c, int down) { if (!c) clears++; else if (down) capture++; }
Expand Down
14 changes: 13 additions & 1 deletion shared/runtime/gamepad_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,19 @@ void runtime_gamepad_switch_capture(void *controller, int pressed) {
static _Atomic int gamepadBackground, gamepadFocused = 1;
#endif

/* Called on the main run loop by the already-open Switch HID motion stream. */
/* Called on the main run loop by the already-open Switch HID stream (motion or Betop NS stick fallback). */
void runtime_gamepad_switch_left_config(void *source, const SwitchStickCal *cal, int immediate) {
GCController *controller = (__bridge GCController *)source;
if (rawLeftController != controller) rawLeft = (SwitchLeftFallback){0};
rawLeftController = controller;
switch_left_configure(&rawLeft, cal, immediate);
}
void runtime_gamepad_switch_right_config(void *source, const SwitchStickCal *cal, int immediate) {
GCController *controller = (__bridge GCController *)source;
if (rawRightController != controller) rawRight = (SwitchLeftFallback){0};
rawRightController = controller;
switch_left_configure(&rawRight, cal, immediate);
}
void runtime_gamepad_switch_left(void *source, int x, int y) {
GCController *controller = (__bridge GCController *)source;
if (rawLeftController != controller) rawLeft = (SwitchLeftFallback){0};
Expand Down
Loading