Decompile modelSetAnimPlaySpeed

This commit is contained in:
Ryan Dwyer 2020-06-30 08:21:37 +10:00
parent 9e222f63ad
commit 939c609195
5 changed files with 24 additions and 34 deletions

View File

@ -2538,7 +2538,7 @@ struct prop *func0f020b14(struct prop *prop, struct model *model,
model->unk01 = 1;
chr->model = model;
func0f03e538(chr, arg4);
func0001dfac(model, var80062968, 0);
modelSetAnimPlaySpeed(model, var80062968, 0);
testpos.x = pos->x;
testpos.y = pos->y + 100;
@ -2788,7 +2788,7 @@ void func0f0211a8(f32 arg0)
for (i = 0; i < g_NumChrsA; i++) {
if (g_ChrsA[i].model) {
func0001dfac(g_ChrsA[i].model, var80062968, 600);
modelSetAnimPlaySpeed(g_ChrsA[i].model, var80062968, 600);
}
}
}

View File

@ -120,7 +120,7 @@ glabel func0f012684
/* f0126f8: 8e240284 */ lw $a0,0x284($s1)
/* f0126fc: 44050000 */ mfc1 $a1,$f0
/* f012700: 4406a000 */ mfc1 $a2,$f20
/* f012704: 0c0077eb */ jal func0001dfac
/* f012704: 0c0077eb */ jal modelSetAnimPlaySpeed
/* f012708: 2484045c */ addiu $a0,$a0,0x45c
/* f01270c: 3c013f80 */ lui $at,0x3f80
/* f012710: 44810000 */ mtc1 $at,$f0

View File

@ -69,7 +69,7 @@ void func0001de1c(struct model *model, f32 speed);
u32 func0001de98(void);
void modelSetAnimSpeed(struct model *model, f32 speed, f32 startframe);
void func0001df04(struct model *model, f32 arg1, f32 arg2);
void func0001dfac(struct model *model, f32 arg1, f32 arg2);
void modelSetAnimPlaySpeed(struct model *model, f32 speed, f32 frame);
void modelSetAnim70(struct model *model, void *callback);
u32 func0001e018(void);
u32 func0001e14c(void);

View File

@ -142,10 +142,10 @@ struct anim {
/*0x6c*/ u32 unk6c;
/*0x70*/ void *unk70; // pointer to function
/*0x74*/ f32 playspeed;
/*0x78*/ u32 newplay;
/*0x7c*/ u32 oldplay;
/*0x80*/ u32 timeplay;
/*0x84*/ u32 elapseplay;
/*0x78*/ f32 newplay;
/*0x7c*/ f32 oldplay;
/*0x80*/ f32 timeplay;
/*0x84*/ f32 elapseplay;
/*0x88*/ f32 animscale;
};

View File

@ -4397,32 +4397,22 @@ glabel func0001df04
/* 1dfa8: 00000000 */ nop
);
GLOBAL_ASM(
glabel func0001dfac
/* 1dfac: 8c820020 */ lw $v0,0x20($a0)
/* 1dfb0: 44857000 */ mtc1 $a1,$f14
/* 1dfb4: 44866000 */ mtc1 $a2,$f12
/* 1dfb8: 1040000f */ beqz $v0,.L0001dff8
/* 1dfbc: 00000000 */ nop
/* 1dfc0: 44800000 */ mtc1 $zero,$f0
/* 1dfc4: 00000000 */ nop
/* 1dfc8: 460c003c */ c.lt.s $f0,$f12
/* 1dfcc: 00000000 */ nop
/* 1dfd0: 45020008 */ bc1fl .L0001dff4
/* 1dfd4: e44e0074 */ swc1 $f14,0x74($v0)
/* 1dfd8: c4440074 */ lwc1 $f4,0x74($v0)
/* 1dfdc: e44c0080 */ swc1 $f12,0x80($v0)
/* 1dfe0: e44e0078 */ swc1 $f14,0x78($v0)
/* 1dfe4: e4400084 */ swc1 $f0,0x84($v0)
/* 1dfe8: 03e00008 */ jr $ra
/* 1dfec: e444007c */ swc1 $f4,0x7c($v0)
/* 1dff0: e44e0074 */ swc1 $f14,0x74($v0)
.L0001dff4:
/* 1dff4: e4400080 */ swc1 $f0,0x80($v0)
.L0001dff8:
/* 1dff8: 03e00008 */ jr $ra
/* 1dffc: 00000000 */ nop
);
void modelSetAnimPlaySpeed(struct model *model, f32 speed, f32 startframe)
{
struct anim *anim = model->anim;
if (anim) {
if (startframe > 0) {
anim->timeplay = startframe;
anim->newplay = speed;
anim->elapseplay = 0;
anim->oldplay = anim->playspeed;
} else {
anim->playspeed = speed;
anim->timeplay = 0;
}
}
}
void modelSetAnim70(struct model *model, void *callback)
{