From 9206b49f3f291fcc54b9402e57f26061a474af9a Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 17 Oct 2020 14:59:18 +1000 Subject: [PATCH] Decompile setupHov --- src/game/game_00c490.c | 50 +++++++++++++++--------------------------- src/include/types.h | 13 +++++------ 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index 3ff315855..26bb9eab7 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -2452,38 +2452,24 @@ glabel var7f1a8064 /* f00e908: 00000000 */ nop ); -GLOBAL_ASM( -glabel setupHov -/* f00e90c: 44801000 */ mtc1 $zero,$f2 -/* f00e910: 27bdffe8 */ addiu $sp,$sp,-24 -/* f00e914: afbf0014 */ sw $ra,0x14($sp) -/* f00e918: e4a20004 */ swc1 $f2,0x4($a1) -/* f00e91c: e4a20008 */ swc1 $f2,0x8($a1) -/* f00e920: e4a2000c */ swc1 $f2,0xc($a1) -/* f00e924: c48e003c */ lwc1 $f14,0x3c($a0) -/* f00e928: c48c0034 */ lwc1 $f12,0x34($a0) -/* f00e92c: 0fc259d4 */ jal func0f096750 -/* f00e930: afa5001c */ sw $a1,0x1c($sp) -/* f00e934: 8fa5001c */ lw $a1,0x1c($sp) -/* f00e938: 44801000 */ mtc1 $zero,$f2 -/* f00e93c: 2402ffff */ addiu $v0,$zero,-1 -/* f00e940: e4a00010 */ swc1 $f0,0x10($a1) -/* f00e944: aca20038 */ sw $v0,0x38($a1) -/* f00e948: aca2003c */ sw $v0,0x3c($a1) -/* f00e94c: e4a20014 */ swc1 $f2,0x14($a1) -/* f00e950: e4a20018 */ swc1 $f2,0x18($a1) -/* f00e954: e4a2001c */ swc1 $f2,0x1c($a1) -/* f00e958: e4a20020 */ swc1 $f2,0x20($a1) -/* f00e95c: e4a20024 */ swc1 $f2,0x24($a1) -/* f00e960: e4a20028 */ swc1 $f2,0x28($a1) -/* f00e964: e4a2002c */ swc1 $f2,0x2c($a1) -/* f00e968: e4a20030 */ swc1 $f2,0x30($a1) -/* f00e96c: e4a20034 */ swc1 $f2,0x34($a1) -/* f00e970: 8fbf0014 */ lw $ra,0x14($sp) -/* f00e974: 27bd0018 */ addiu $sp,$sp,0x18 -/* f00e978: 03e00008 */ jr $ra -/* f00e97c: 00000000 */ nop -); +void setupHov(struct defaultobj *obj, struct hov *hov) +{ + hov->unk04 = 0; + hov->unk08 = 0; + hov->unk0c = 0; + hov->unk10 = func0f096750(obj->realrot[6], obj->realrot[8]); + hov->unk14 = 0; + hov->unk18 = 0; + hov->unk1c = 0; + hov->unk20 = 0; + hov->unk24 = 0; + hov->unk28 = 0; + hov->unk2c = 0; + hov->unk30 = 0; + hov->unk34 = 0; + hov->unk38 = -1; + hov->unk3c = -1; +} GLOBAL_ASM( glabel func0f00e980 diff --git a/src/include/types.h b/src/include/types.h index c4f00bdd7..756a0efcf 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -1116,24 +1116,23 @@ struct image { /*0x14*/ u32 unk14; }; -// I get the feeling this struct might be a regular f32 matrix... struct hov { /*0x00*/ u32 unk00; /*0x04*/ f32 unk04; - /*0x08*/ u32 unk08; + /*0x08*/ f32 unk08; /*0x0c*/ f32 unk0c; /*0x10*/ f32 unk10; /*0x14*/ f32 unk14; - /*0x18*/ u32 unk18; + /*0x18*/ f32 unk18; /*0x1c*/ f32 unk1c; /*0x20*/ f32 unk20; - /*0x24*/ u32 unk24; + /*0x24*/ f32 unk24; /*0x28*/ f32 unk28; - /*0x2c*/ u32 unk2c; + /*0x2c*/ f32 unk2c; /*0x30*/ f32 unk30; /*0x34*/ f32 unk34; - /*0x38*/ u32 unk38; - /*0x3c*/ u32 unk3c; + /*0x38*/ s32 unk38; + /*0x3c*/ s32 unk3c; }; struct defaultobj {