diff --git a/src/game/game_0125a0.c b/src/game/game_0125a0.c index 4bee4bcff..8e8e7fa11 100644 --- a/src/game/game_0125a0.c +++ b/src/game/game_0125a0.c @@ -340,7 +340,7 @@ glabel func0f012684 /* f012a60: 8e240284 */ lw $a0,0x284($s1) /* f012a64: 3c057f11 */ lui $a1,%hi(currentPlayerFlipAnimation) /* f012a68: 24a53220 */ addiu $a1,$a1,%lo(currentPlayerFlipAnimation) -/* f012a6c: 0c0077a6 */ jal func0001de98 +/* f012a6c: 0c0077a6 */ jal modelSetAnimFlipFunction /* f012a70: 2484045c */ addiu $a0,$a0,0x45c /* f012a74: 0fc44c8f */ jal currentPlayerUpdateIdleHeadRoll /* f012a78: 00000000 */ nop diff --git a/src/game/game_113220.c b/src/game/game_113220.c index 752feda22..440d2c68d 100644 --- a/src/game/game_113220.c +++ b/src/game/game_113220.c @@ -678,7 +678,7 @@ glabel func0f113f10 /* f114028: 8c84a244 */ lw $a0,%lo(g_Vars+0x284)($a0) /* f11402c: 3c057f11 */ lui $a1,%hi(currentPlayerFlipAnimation) /* f114030: 24a53220 */ addiu $a1,$a1,%lo(currentPlayerFlipAnimation) -/* f114034: 0c0077a6 */ jal func0001de98 +/* f114034: 0c0077a6 */ jal modelSetAnimFlipFunction /* f114038: 2484045c */ addiu $a0,$a0,1116 /* f11403c: 3c0a800a */ lui $t2,%hi(g_Vars+0x284) /* f114040: 8fa20028 */ lw $v0,0x28($sp) diff --git a/src/include/lib/lib_1a500.h b/src/include/lib/lib_1a500.h index b8c81d4f4..9a251ae7d 100644 --- a/src/include/lib/lib_1a500.h +++ b/src/include/lib/lib_1a500.h @@ -66,7 +66,7 @@ void modelSetAnimation(struct model *model, s16 animnum, s32 flip, f32 fstartfra u32 func0001dd90(void); void modelSetAnimLooping(struct model *model, f32 loopframe, f32 loopmerge); void modelSetAnimEndFrame(struct model *model, f32 endframe); -u32 func0001de98(void); +void modelSetAnimFlipFunction(struct model *model, void *callback); void modelSetAnimSpeed(struct model *model, f32 speed, f32 startframe); void modelSetAnimSpeedAuto(struct model *model, f32 arg1, f32 startframe); void modelSetAnimPlaySpeed(struct model *model, f32 speed, f32 frame); diff --git a/src/include/types.h b/src/include/types.h index db7d757b5..cc51f37c1 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -138,7 +138,7 @@ struct anim { /*0x5c*/ f32 elapsemerge; /*0x60*/ f32 loopframe; /*0x64*/ f32 loopmerge; - /*0x68*/ u32 unk68; + /*0x68*/ void *flipfunc; /*0x6c*/ u32 unk6c; /*0x70*/ void *unk70; // pointer to function /*0x74*/ f32 playspeed; diff --git a/src/lib/lib_1a500.c b/src/lib/lib_1a500.c index 28b9ea742..fe8a7e71c 100644 --- a/src/lib/lib_1a500.c +++ b/src/lib/lib_1a500.c @@ -3989,16 +3989,12 @@ void modelSetAnimEndFrame(struct model *model, f32 endframe) } } -GLOBAL_ASM( -glabel func0001de98 -/* 1de98: 8c820020 */ lw $v0,0x20($a0) -/* 1de9c: 10400002 */ beqz $v0,.L0001dea8 -/* 1dea0: 00000000 */ nop -/* 1dea4: ac450068 */ sw $a1,0x68($v0) -.L0001dea8: -/* 1dea8: 03e00008 */ jr $ra -/* 1deac: 00000000 */ nop -); +void modelSetAnimFlipFunction(struct model *model, void *callback) +{ + if (model->anim) { + model->anim->flipfunc = callback; + } +} void modelSetAnimSpeed(struct model *model, f32 speed, f32 startframe) { @@ -9911,7 +9907,7 @@ void animInitialise(struct anim *anim) anim->animnum = 0; anim->animnum2 = 0; anim->looping = 0; - anim->unk68 = 0; + anim->flipfunc = NULL; anim->unk6c = 0; anim->unk70 = NULL; anim->average = 0;