N64: Map fly/speed to dpad

This commit is contained in:
UnknownShadow200 2024-04-26 17:00:48 +10:00
parent dcf3a1be3a
commit 715307f06f
2 changed files with 13 additions and 2 deletions

View file

@ -209,8 +209,6 @@ void Window_UpdateRawMouse(void) { }
*-------------------------------------------------------Gamepads----------------------------------------------------------*
*#########################################################################################################################*/
static void HandleButtons(int port, int mods) {
// TODO CONT_Z
Gamepad_SetButton(port, CCPAD_A, mods & CONT_A);
Gamepad_SetButton(port, CCPAD_B, mods & CONT_B);
Gamepad_SetButton(port, CCPAD_X, mods & CONT_X);
@ -223,6 +221,13 @@ static void HandleButtons(int port, int mods) {
Gamepad_SetButton(port, CCPAD_RIGHT, mods & CONT_DPAD_RIGHT);
Gamepad_SetButton(port, CCPAD_UP, mods & CONT_DPAD_UP);
Gamepad_SetButton(port, CCPAD_DOWN, mods & CONT_DPAD_DOWN);
// Buttons not on standard controller (todo C)
Gamepad_SetButton(port, CCPAD_Z, mods & CONT_Z);
Gamepad_SetButton(port, CCPAD_CLEFT, mods & CONT_DPAD2_LEFT);
Gamepad_SetButton(port, CCPAD_CRIGHT, mods & CONT_DPAD2_RIGHT);
Gamepad_SetButton(port, CCPAD_CUP, mods & CONT_DPAD2_UP);
Gamepad_SetButton(port, CCPAD_CDOWN, mods & CONT_DPAD2_DOWN);
}
#define AXIS_SCALE 8.0f

View file

@ -38,6 +38,7 @@ void Window_Init(void) {
// change defaults to make more sense for N64
cc_uint8* binds = (cc_uint8*)KeyBind_GamepadDefaults;
binds[KEYBIND_JUMP] = CCPAD_A;
binds[KEYBIND_INVENTORY] = CCPAD_B;
binds[KEYBIND_PLACE_BLOCK] = CCPAD_Z;
binds[KEYBIND_HOTBAR_RIGHT] = CCPAD_L;
@ -47,6 +48,11 @@ void Window_Init(void) {
binds[KEYBIND_BACK] = CCPAD_CDOWN;
binds[KEYBIND_LEFT] = CCPAD_CLEFT;
binds[KEYBIND_RIGHT] = CCPAD_CRIGHT;
binds[KEYBIND_FLY_UP] = CCPAD_UP;
binds[KEYBIND_FLY_DOWN] = CCPAD_DOWN;
binds[KEYBIND_SPEED] = CCPAD_LEFT;
binds[KEYBIND_FLY] = CCPAD_RIGHT;
}
void Window_Free(void) { }