From 9360aecceeaa9ae3fb2778fdf88cecd934b4f839 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 29 Nov 2019 22:25:42 +1000 Subject: [PATCH] Decompile func0f0bb57c --- src/game/game_0b28d0.c | 44 +++++++++------------------------- src/include/game/game_0b28d0.h | 2 +- src/include/types.h | 8 +++---- 3 files changed, 16 insertions(+), 38 deletions(-) diff --git a/src/game/game_0b28d0.c b/src/game/game_0b28d0.c index 2d2b7aa07..1b4d9a595 100644 --- a/src/game/game_0b28d0.c +++ b/src/game/game_0b28d0.c @@ -10218,39 +10218,17 @@ glabel func0f0bb42c /* f0bb578: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f0bb57c -/* f0bb57c: 3c04800a */ lui $a0,%hi(g_Vars) -/* f0bb580: 24849fc0 */ addiu $a0,$a0,%lo(g_Vars) -/* f0bb584: 8c830284 */ lw $v1,0x284($a0) -/* f0bb588: 8c6e00bc */ lw $t6,0xbc($v1) -/* f0bb58c: 8dc20004 */ lw $v0,0x4($t6) -/* f0bb590: 10400014 */ beqz $v0,.L0f0bb5e4 -/* f0bb594: 00000000 */ sll $zero,$zero,0x0 -/* f0bb598: 44802000 */ mtc1 $zero,$f4 -/* f0bb59c: 3c014f80 */ lui $at,0x4f80 -/* f0bb5a0: e4640188 */ swc1 $f4,0x188($v1) -/* f0bb5a4: 8c8f0284 */ lw $t7,0x284($a0) -/* f0bb5a8: e5ec018c */ swc1 $f12,0x18c($t7) -/* f0bb5ac: 9058000c */ lbu $t8,0xc($v0) -/* f0bb5b0: 44983000 */ mtc1 $t8,$f6 -/* f0bb5b4: 07010004 */ bgez $t8,.L0f0bb5c8 -/* f0bb5b8: 46803220 */ cvt.s.w $f8,$f6 -/* f0bb5bc: 44815000 */ mtc1 $at,$f10 -/* f0bb5c0: 00000000 */ sll $zero,$zero,0x0 -/* f0bb5c4: 460a4200 */ add.s $f8,$f8,$f10 -.L0f0bb5c8: -/* f0bb5c8: 3c01437f */ lui $at,0x437f -/* f0bb5cc: 44818000 */ mtc1 $at,$f16 -/* f0bb5d0: 8c990284 */ lw $t9,0x284($a0) -/* f0bb5d4: 46104483 */ div.s $f18,$f8,$f16 -/* f0bb5d8: e7320190 */ swc1 $f18,0x190($t9) -/* f0bb5dc: 8c880284 */ lw $t0,0x284($a0) -/* f0bb5e0: e50e0194 */ swc1 $f14,0x194($t0) -.L0f0bb5e4: -/* f0bb5e4: 03e00008 */ jr $ra -/* f0bb5e8: 00000000 */ sll $zero,$zero,0x0 -); +void func0f0bb57c(float arg0, float arg1) +{ + struct chrdata *chr = g_Vars.currentplayer->targetpos->entity; + + if (chr) { + g_Vars.currentplayer->unk0188 = 0; + g_Vars.currentplayer->unk018c = arg0; + g_Vars.currentplayer->unk0190 = chr->fadealpha / 255.0f; + g_Vars.currentplayer->unk0194 = arg1; + } +} GLOBAL_ASM( glabel func0f0bb5ec diff --git a/src/include/game/game_0b28d0.h b/src/include/game/game_0b28d0.h index b5f3ecf97..20cd09d1b 100644 --- a/src/include/game/game_0b28d0.h +++ b/src/include/game/game_0b28d0.h @@ -110,7 +110,7 @@ void func0f0bb350(float arg0, s32 arg1, s32 arg2, s32 arg3, float arg4); void func0f0bb3c8(float arg0, float arg1); bool func0f0bb3fc(void); u32 func0f0bb42c(void); -u32 func0f0bb57c(void); +void func0f0bb57c(float arg0, float arg1); u32 func0f0bb5ec(void); u32 func0f0bb69c(void); u32 func0f0bb814(void); diff --git a/src/include/types.h b/src/include/types.h index 71c1810c8..4ba75cd8c 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -569,10 +569,10 @@ struct player { /*0x017c*/ u32 unk017c; /*0x0180*/ u32 unk0180; /*0x0184*/ u32 unk0184; - /*0x0188*/ u32 unk0188; - /*0x018c*/ u32 unk018c; - /*0x0190*/ u32 unk0190; - /*0x0194*/ u32 unk0194; + /*0x0188*/ float unk0188; + /*0x018c*/ float unk018c; + /*0x0190*/ float unk0190; + /*0x0194*/ float unk0194; /*0x0198*/ u32 unk0198; /*0x019c*/ u32 unk019c; /*0x01a0*/ u32 unk01a0;