Skip to content
Merged
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
10 changes: 10 additions & 0 deletions include/joybus/target/n64_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,14 @@ void joybus_target_n64_controller_detach_pak(struct joybus_target_n64_controller
* @param controller the controller to calibrate
*/
void joybus_target_n64_controller_calibrate(struct joybus_target_n64_controller *controller);

/**
* Set the stick origin the console's reads are relative to.
*
* @param controller the controller to set the origin of
* @param stick_x the stick X position at rest
* @param stick_y the stick Y position at rest
*/
void joybus_target_n64_controller_set_origin(struct joybus_target_n64_controller *controller, int8_t stick_x,
int8_t stick_y);
/** @} */
7 changes: 7 additions & 0 deletions src/target/n64_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,10 @@ void joybus_target_n64_controller_calibrate(struct joybus_target_n64_controller
{
n64_controller_recalibrate(controller);
}

void joybus_target_n64_controller_set_origin(struct joybus_target_n64_controller *controller, int8_t stick_x,
int8_t stick_y)
{
controller->origin.stick_x = stick_x;
controller->origin.stick_y = stick_y;
}
Loading