From 5a5981ae85ed4245c076b61672b77d2469a5c9dc Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 29 Jun 2020 22:42:50 +1000 Subject: [PATCH] Decompile modelSetAnim70 --- src/game/chr/chr.c | 2 +- src/include/lib/lib_1a500.h | 2 +- src/include/types.h | 2 +- src/lib/lib_1a500.c | 16 ++++++---------- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 6cbb17040..b59ad39a6 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -2533,7 +2533,7 @@ struct prop *func0f020b14(struct prop *prop, struct model *model, chr = prop->chr; - func0001e000(model, func0f01f378); + modelSetAnim70(model, func0f01f378); model->chr = chr; model->unk01 = 1; chr->model = model; diff --git a/src/include/lib/lib_1a500.h b/src/include/lib/lib_1a500.h index 91c4a7587..66dc1ec1f 100644 --- a/src/include/lib/lib_1a500.h +++ b/src/include/lib/lib_1a500.h @@ -70,7 +70,7 @@ u32 func0001de98(void); void func0001deb0(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 func0001e000(struct model *model, void *callback); +void modelSetAnim70(struct model *model, void *callback); u32 func0001e018(void); u32 func0001e14c(void); u32 func0001e29c(void); diff --git a/src/include/types.h b/src/include/types.h index 8cee3ac7f..b15b16d4c 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -140,7 +140,7 @@ struct anim { /*0x64*/ u32 loopmerge; /*0x68*/ u32 unk68; /*0x6c*/ u32 unk6c; - /*0x70*/ u32 unk70; + /*0x70*/ void *unk70; // pointer to function /*0x74*/ f32 playspeed; /*0x78*/ u32 newplay; /*0x7c*/ u32 oldplay; diff --git a/src/lib/lib_1a500.c b/src/lib/lib_1a500.c index 05133e1be..d16f44535 100644 --- a/src/lib/lib_1a500.c +++ b/src/lib/lib_1a500.c @@ -4514,16 +4514,12 @@ glabel func0001dfac /* 1dffc: 00000000 */ nop ); -GLOBAL_ASM( -glabel func0001e000 -/* 1e000: 8c820020 */ lw $v0,0x20($a0) -/* 1e004: 10400002 */ beqz $v0,.L0001e010 -/* 1e008: 00000000 */ nop -/* 1e00c: ac450070 */ sw $a1,0x70($v0) -.L0001e010: -/* 1e010: 03e00008 */ jr $ra -/* 1e014: 00000000 */ nop -); +void modelSetAnim70(struct model *model, void *callback) +{ + if (model->anim) { + model->anim->unk70 = callback; + } +} GLOBAL_ASM( glabel func0001e018