mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
3da61df355
This reverts commit b836f2198c.
27 lines
668 B
C
27 lines
668 B
C
#ifndef PSX_STICK_H
|
|
#define PSX_STICK_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
* Convert one SDL stick vector to the two unsigned DualShock axis bytes.
|
|
*
|
|
* deadzone and anti_deadzone use SDL's 0..32767 radial magnitude scale.
|
|
* Values inside deadzone are centred. Outside it, magnitude is remapped from
|
|
* anti_deadzone to full travel while direction is preserved. anti_deadzone=0
|
|
* is an ordinary rescaled radial deadzone.
|
|
*/
|
|
void psx_stick_to_dualshock(int16_t x, int16_t y,
|
|
int deadzone, int anti_deadzone,
|
|
uint8_t *out_x, uint8_t *out_y);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|