diff --git a/libultraship/libultraship/Controller.cpp b/libultraship/libultraship/Controller.cpp index 5ecb84216..02dee6845 100644 --- a/libultraship/libultraship/Controller.cpp +++ b/libultraship/libultraship/Controller.cpp @@ -12,7 +12,7 @@ namespace Ship { Controller::Controller() : isRumbling(false) { Attachment = nullptr; - for(int virtualSlot = 0; virtualSlot < MAXCONTROLLERS; virtualSlot++) { + for(int32_t virtualSlot = 0; virtualSlot < MAXCONTROLLERS; virtualSlot++) { profiles[virtualSlot] = std::make_shared(); ButtonData[virtualSlot] = std::make_shared(); } diff --git a/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/controller.h b/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/controller.h index af95c4212..fbcbae674 100644 --- a/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/controller.h +++ b/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/controller.h @@ -108,15 +108,15 @@ typedef struct { } OSContStatus; // size = 0x04 typedef struct { - /* 0x00 */ u16 button; - /* 0x02 */ s8 stick_x; - /* 0x03 */ s8 stick_y; - /* 0x04 */ u8 err_no; - /* 0x05 */ f32 gyro_x; - /* 0x09 */ f32 gyro_y; - /* 0x1C */ f32 cam_x; - /* 0x20 */ f32 cam_y; -} OSContPad; // size = 0x24 + /* 0x00 */ uint16_t button; + /* 0x02 */ int8_t stick_x; + /* 0x03 */ int8_t stick_y; + /* 0x04 */ uint8_t err_no; + /* 0x05 */ float gyro_x; + /* 0x09 */ float gyro_y; + /* 0x1C */ int8_t right_stick_x; + /* 0x20 */ int8_t right_stick_y; +} OSContPad; // size = 0x22 typedef struct { /* 0x00 */ u8 rumble; diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index dcd70abbe..c0b70a904 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -1410,8 +1410,8 @@ s32 Camera_Noop(Camera* camera) { } s32 SetCameraManual(Camera* camera) { - f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x * 10.0f; - f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y * 10.0f; + f32 newCamX = -D_8015BD7C->state.input[0].cur.right_stick_x * 10.0f; + f32 newCamY = D_8015BD7C->state.input[0].cur.right_stick_y * 10.0f; if ((fabsf(newCamX) >= 15.0f || fabsf(newCamY) >= 15.0f) && camera->globalCtx->manualCamera == false) { camera->globalCtx->manualCamera = true; @@ -1479,8 +1479,8 @@ s32 Camera_Free(Camera* camera) { camera->animState = 1; - f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x * 10.0f; - f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y * 10.0f; + f32 newCamX = -D_8015BD7C->state.input[0].cur.right_stick_x * 10.0f; + f32 newCamY = D_8015BD7C->state.input[0].cur.right_stick_y * 10.0f; camera->globalCtx->camX += newCamX; camera->globalCtx->camY += newCamY; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 412767866..441b892de 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -128,8 +128,8 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { } else if ((AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT)) || (AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CRIGHT))) { link_kaleido_rot.y = link_kaleido_rot.y + RotationSpeed; - } else if(AllowStickRotation && input->cur.cam_x*10.0f != 0){ - link_kaleido_rot.y = link_kaleido_rot.y + (input->cur.cam_x*10.0f*(((f32)RotationSpeed)/600.0f)); + } else if (AllowStickRotation && input->cur.right_stick_x * 10.0f != 0) { + link_kaleido_rot.y = link_kaleido_rot.y + (input->cur.right_stick_x * 10.0f * (((f32)RotationSpeed) / 600.0f)); } if ((AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DUP)) || // reset rotation @@ -138,13 +138,13 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { } else if ((AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CUP)) || (AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CDOWN))) { link_kaleido_rot.y = 32300; - } else if (AllowStickRotation && input->cur.cam_y * 10.0f < -1200) { + } else if (AllowStickRotation && input->cur.right_stick_y * 10.0f < -1200) { link_kaleido_rot.y = 32300; } - if (AllowStickRotation && input->cur.cam_y * 10.0f > 0) { // Zoom in - scale = scale + input->cur.cam_y*10.0f*.00005f; - pos.y = pos.y - input->cur.cam_y*10.0f*0.25f; + if (AllowStickRotation && input->cur.right_stick_y * 10.0f > 0) { // Zoom in + scale = scale + input->cur.right_stick_y * 10.0f * .00005f; + pos.y = pos.y - input->cur.right_stick_y * 10.0f * 0.25f; }