Implement Rumble
Build libsm64 / Build libsm64 for linux (push) Successful in 31s
Build libsm64 / Build libsm64 for web (push) Successful in 32s
Build libsm64 / Build libsm64 for windows (push) Successful in 24s

This commit is contained in:
2026-05-25 12:34:52 -05:00
parent bd3dd8f523
commit a499b4f032
19 changed files with 317 additions and 139 deletions
+17 -16
View File
@@ -20,6 +20,7 @@
#include "../include/mario_animation_ids.h"
#include "../include/object_fields.h"
#include "../include/mario_geo_switch_case_ids.h"
#include "../../rumble.h"
static Vec3f gVec3fZero = {0.0f, 0.0f, 0.0f};
@@ -198,9 +199,9 @@ s32 act_holding_pole(struct MarioState *m)
// }
// }
play_climbing_sounds(m, 2);
#ifdef VERSION_SH
// #ifdef VERSION_SH
reset_rumble_timers();
#endif
// #endif
func_80320A4C(1, marioObj->oMarioPoleYawVel / 0x100 * 2);
}
else
@@ -446,14 +447,14 @@ void update_hang_stationary(struct MarioState *m)
s32 act_start_hanging(struct MarioState *m)
{
#ifdef VERSION_SH
// #ifdef VERSION_SH
if (m->actionTimer++ == 0)
{
queue_rumble_data(5, 80);
}
#else
m->actionTimer++;
#endif
// #else
// m->actionTimer++;
// #endif
if (m->input & INPUT_NONZERO_ANALOG && m->actionTimer >= 31)
{
@@ -552,9 +553,9 @@ s32 act_hang_moving(struct MarioState *m)
if (m->marioObj->header.gfx.animInfo.animFrame == 12)
{
play_sound(SOUND_ACTION_HANGING_STEP, m->marioObj->header.gfx.cameraToObject);
#ifdef VERSION_SH
// #ifdef VERSION_SH
queue_rumble_data(5, 30);
#endif
// #endif
}
if (is_anim_past_end(m))
@@ -782,9 +783,9 @@ s32 act_grabbed(struct MarioState *m)
m->faceAngle[1] = m->usedObj->oMoveAngleYaw;
vec3f_copy(m->pos, m->marioObj->header.gfx.pos);
#ifdef VERSION_SH
// #ifdef VERSION_SH
queue_rumble_data(5, 60);
#endif
// #endif
return set_mario_action(m, m->forwardVel >= 0.0f ? ACT_THROWN_FORWARD : ACT_THROWN_BACKWARD,
thrown);
@@ -872,18 +873,18 @@ s32 act_in_cannon(struct MarioState *m)
m->marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
set_mario_action(m, ACT_SHOT_FROM_CANNON, 0);
#ifdef VERSION_SH
// #ifdef VERSION_SH
queue_rumble_data(60, 70);
#endif
// #endif
m->usedObj->oAction = 2;
return FALSE;
}
else if (m->faceAngle[0] != startFacePitch || m->faceAngle[1] != startFaceYaw)
{
play_sound(SOUND_MOVING_AIM_CANNON, m->marioObj->header.gfx.cameraToObject);
#ifdef VERSION_SH
// #ifdef VERSION_SH
reset_rumble_timers_2(0);
#endif
// #endif
}
}
@@ -980,9 +981,9 @@ s32 act_tornado_twirling(struct MarioState *m)
vec3f_copy(m->marioObj->header.gfx.pos, m->pos);
vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1] + m->twirlYaw, 0);
#ifdef VERSION_SH
// #ifdef VERSION_SH
reset_rumble_timers();
#endif
// #endif
return FALSE;
}