From ea57468cbd825365e8a23dcf415a6e9a383109ef Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 30 Jan 2020 19:53:30 +1000 Subject: [PATCH] Decompile currentPlayerSetGlobalDrawCameraOffset --- src/game/game_0b28d0.c | 37 +++++++---------------------- src/include/game/game_0b28d0.h | 6 ++--- src/include/library/library_159b0.h | 2 +- src/include/types.h | 12 ++++------ 4 files changed, 17 insertions(+), 40 deletions(-) diff --git a/src/game/game_0b28d0.c b/src/game/game_0b28d0.c index fa35daeaa..10475e2ae 100644 --- a/src/game/game_0b28d0.c +++ b/src/game/game_0b28d0.c @@ -15116,33 +15116,14 @@ glabel func0f0bfbb8 /* f0bfc18: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f0bfc1c -/* f0bfc1c: 3c03800a */ lui $v1,%hi(g_Vars) -/* f0bfc20: 24639fc0 */ addiu $v1,$v1,%lo(g_Vars) -/* f0bfc24: 8c620284 */ lw $v0,0x284($v1) -/* f0bfc28: 27bdffe8 */ addiu $sp,$sp,-24 -/* f0bfc2c: afbf0014 */ sw $ra,0x14($sp) -/* f0bfc30: c4440038 */ lwc1 $f4,0x38($v0) -/* f0bfc34: e4440044 */ swc1 $f4,0x44($v0) -/* f0bfc38: 8c620284 */ lw $v0,0x284($v1) -/* f0bfc3c: c446003c */ lwc1 $f6,0x3c($v0) -/* f0bfc40: e4460048 */ swc1 $f6,0x48($v0) -/* f0bfc44: 8c620284 */ lw $v0,0x284($v1) -/* f0bfc48: c4480040 */ lwc1 $f8,0x40($v0) -/* f0bfc4c: 0fc2d5be */ jal func0f0b56f8 -/* f0bfc50: e448004c */ swc1 $f8,0x4c($v0) -/* f0bfc54: 3c03800a */ lui $v1,%hi(g_Vars) -/* f0bfc58: 24639fc0 */ addiu $v1,$v1,%lo(g_Vars) -/* f0bfc5c: 8c650284 */ lw $a1,0x284($v1) -/* f0bfc60: 00402025 */ or $a0,$v0,$zero -/* f0bfc64: 0c0056c4 */ jal func00015b10 -/* f0bfc68: 24a50044 */ addiu $a1,$a1,0x44 -/* f0bfc6c: 8fbf0014 */ lw $ra,0x14($sp) -/* f0bfc70: 27bd0018 */ addiu $sp,$sp,0x18 -/* f0bfc74: 03e00008 */ jr $ra -/* f0bfc78: 00000000 */ sll $zero,$zero,0x0 -); +void currentPlayerSetGlobalDrawCameraOffset(void) +{ + g_Vars.currentplayer->globaldrawcameraoffset.x = g_Vars.currentplayer->globaldrawworldoffset.x; + g_Vars.currentplayer->globaldrawcameraoffset.y = g_Vars.currentplayer->globaldrawworldoffset.y; + g_Vars.currentplayer->globaldrawcameraoffset.z = g_Vars.currentplayer->globaldrawworldoffset.z; + + func00015b10(func0f0b56f8(), &g_Vars.currentplayer->globaldrawcameraoffset); +} GLOBAL_ASM( glabel func0f0bfc7c @@ -15354,7 +15335,7 @@ glabel func0f0bfc7c /* f0bffa0: 8fa400cc */ lw $a0,0xcc($sp) /* f0bffa4: 0fc2d60e */ jal func0f0b5838 /* f0bffa8: 00000000 */ sll $zero,$zero,0x0 -/* f0bffac: 0fc2ff07 */ jal func0f0bfc1c +/* f0bffac: 0fc2ff07 */ jal currentPlayerSetGlobalDrawCameraOffset /* f0bffb0: 00000000 */ sll $zero,$zero,0x0 /* f0bffb4: 8fbf0044 */ lw $ra,0x44($sp) /* f0bffb8: 8fb00038 */ lw $s0,0x38($sp) diff --git a/src/include/game/game_0b28d0.h b/src/include/game/game_0b28d0.h index 7773d7e1b..49196ce1d 100644 --- a/src/include/game/game_0b28d0.h +++ b/src/include/game/game_0b28d0.h @@ -135,14 +135,14 @@ u32 func0f0bd4e4(void); u32 func0f0bd764(void); u32 func0f0bd904(void); u32 func0f0bfbb8(void); -u32 func0f0bfc1c(void); +void currentPlayerSetGlobalDrawCameraOffset(void); u32 func0f0bfc7c(void); u32 func0f0bffcc(void); u32 func0f0c00cc(void); u32 func0f0c0190(void); u32 func0f0c07c8(void); -u32 func0f0c13a8(void); -u32 func0f0c1404(void); +void func0f0c13a8(s32 arg0); +void func0f0c1404(s32 shooter, s32 arg1); u32 func0f0c160c(void); u32 func0f0c16f4(void); bool currentPlayerGet00fc(void); diff --git a/src/include/library/library_159b0.h b/src/include/library/library_159b0.h index c52139fa3..b1a6d66ea 100644 --- a/src/include/library/library_159b0.h +++ b/src/include/library/library_159b0.h @@ -5,7 +5,7 @@ void func000159b0(u32 *obj48_20); u32 func000159fc(void); -u32 func00015b10(void); +void func00015b10(struct coord *globaldrawcameraoffset); u32 func00015b64(void); u32 func00015be0(void); u32 func00015be4(void); diff --git a/src/include/types.h b/src/include/types.h index 7b9a5cd21..8ec664f1c 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -525,8 +525,8 @@ struct chrdata { /*0x0e0*/ s32 lastseetarget60; /*0x0e4*/ s32 lastvisibletarget60; /*0x0e8*/ void *unk0e8; - /*0x0ec*/ u16 lastshooter; - /*0x0ee*/ u16 timeshooter; + /*0x0ec*/ s16 lastshooter; + /*0x0ee*/ s16 timeshooter; /*0x0f0*/ f32 hearingscale; /*0x0f4*/ s32 lastheartarget60; /*0x0f8*/ u32 shadecol; @@ -967,12 +967,8 @@ struct player { /*0x002c*/ u32 unk002c; /*0x0030*/ u32 unk0030; /*0x0034*/ u32 unk0034; - /*0x0038*/ u32 unk0038; - /*0x003c*/ u32 unk003c; - /*0x0040*/ u32 unk0040; - /*0x0044*/ u32 unk0044; - /*0x0048*/ u32 unk0048; - /*0x004c*/ u32 unk004c; + /*0x0038*/ struct coord globaldrawworldoffset; + /*0x0044*/ struct coord globaldrawcameraoffset; /*0x0050*/ u32 unk0050; /*0x0054*/ u32 unk0054; /*0x0058*/ u32 unk0058;