From ac1bbdac3124b363a360922df2ca8d42fa87b453 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 1 Mar 2020 23:44:57 +1000 Subject: [PATCH] Decompile currentPlayerUpdatePrevPosGrab --- src/game/bondgrab.c | 47 ++++++++++--------------------------- src/game/bondwalk.c | 4 ++-- src/include/game/bondgrab.h | 2 +- src/include/game/bondwalk.h | 2 +- src/include/types.h | 6 ++--- 5 files changed, 19 insertions(+), 42 deletions(-) diff --git a/src/game/bondgrab.c b/src/game/bondgrab.c index bd6b47db2..c2af93b0d 100644 --- a/src/game/bondgrab.c +++ b/src/game/bondgrab.c @@ -1899,39 +1899,18 @@ glabel func0f0ce0bc /* f0ce0fc: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f0ce100 -/* f0ce100: 3c03800a */ lui $v1,%hi(g_Vars) -/* f0ce104: 24639fc0 */ addiu $v1,$v1,%lo(g_Vars) -/* f0ce108: 8c620284 */ lw $v0,0x284($v1) -/* f0ce10c: 8c4e00bc */ lw $t6,0xbc($v0) -/* f0ce110: c5c40008 */ lwc1 $f4,0x8($t6) -/* f0ce114: e4440310 */ swc1 $f4,0x310($v0) -/* f0ce118: 8c620284 */ lw $v0,0x284($v1) -/* f0ce11c: 8c4f00bc */ lw $t7,0xbc($v0) -/* f0ce120: c5e6000c */ lwc1 $f6,0xc($t7) -/* f0ce124: e4460314 */ swc1 $f6,0x314($v0) -/* f0ce128: 8c620284 */ lw $v0,0x284($v1) -/* f0ce12c: 8c5800bc */ lw $t8,0xbc($v0) -/* f0ce130: c7080010 */ lwc1 $f8,0x10($t8) -/* f0ce134: e4480318 */ swc1 $f8,0x318($v0) -/* f0ce138: 8c620284 */ lw $v0,0x284($v1) -/* f0ce13c: c44a0144 */ lwc1 $f10,0x144($v0) -/* f0ce140: e44a19fc */ swc1 $f10,0x19fc($v0) -/* f0ce144: 8c620284 */ lw $v0,0x284($v1) -/* f0ce148: 8c591b5c */ lw $t9,0x1b5c($v0) -/* f0ce14c: c7300008 */ lwc1 $f16,0x8($t9) -/* f0ce150: e4501a00 */ swc1 $f16,0x1a00($v0) -/* f0ce154: 8c620284 */ lw $v0,0x284($v1) -/* f0ce158: 8c481b5c */ lw $t0,0x1b5c($v0) -/* f0ce15c: c512000c */ lwc1 $f18,0xc($t0) -/* f0ce160: e4521a04 */ swc1 $f18,0x1a04($v0) -/* f0ce164: 8c620284 */ lw $v0,0x284($v1) -/* f0ce168: 8c491b5c */ lw $t1,0x1b5c($v0) -/* f0ce16c: c5240010 */ lwc1 $f4,0x10($t1) -/* f0ce170: 03e00008 */ jr $ra -/* f0ce174: e4441a08 */ swc1 $f4,0x1a08($v0) -); +void currentPlayerUpdatePrevPosGrab(void) +{ + g_Vars.currentplayer->bondprevpos.x = g_Vars.currentplayer->prop->pos.x; + g_Vars.currentplayer->bondprevpos.y = g_Vars.currentplayer->prop->pos.y; + g_Vars.currentplayer->bondprevpos.z = g_Vars.currentplayer->prop->pos.z; + + g_Vars.currentplayer->bondprevtheta = g_Vars.currentplayer->vv_theta; + + g_Vars.currentplayer->grabbedprevpos.x = g_Vars.currentplayer->grabbedprop->pos.x; + g_Vars.currentplayer->grabbedprevpos.y = g_Vars.currentplayer->grabbedprop->pos.y; + g_Vars.currentplayer->grabbedprevpos.z = g_Vars.currentplayer->grabbedprop->pos.z; +} GLOBAL_ASM( glabel func0f0ce178 @@ -2876,7 +2855,7 @@ GLOBAL_ASM( glabel func0f0ceec4 /* f0ceec4: 27bdffb8 */ addiu $sp,$sp,-72 /* f0ceec8: afbf0024 */ sw $ra,0x24($sp) -/* f0ceecc: 0fc33840 */ jal func0f0ce100 +/* f0ceecc: 0fc33840 */ jal currentPlayerUpdatePrevPosGrab /* f0ceed0: afb00020 */ sw $s0,0x20($sp) /* f0ceed4: 0fc337bc */ jal func0f0cdef0 /* f0ceed8: 00000000 */ sll $zero,$zero,0x0 diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index 6715c7300..ab1eece64 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -3165,7 +3165,7 @@ glabel func0f0c63bc /* f0c6540: 00000000 */ sll $zero,$zero,0x0 ); -void currentPlayerUpdatePrevPos(void) +void currentPlayerUpdatePrevPosWalk(void) { g_Vars.currentplayer->bondprevpos.x = g_Vars.currentplayer->prop->pos.x; g_Vars.currentplayer->bondprevpos.y = g_Vars.currentplayer->prop->pos.y; @@ -4513,7 +4513,7 @@ GLOBAL_ASM( glabel func0f0c785c /* f0c785c: 27bdffc0 */ addiu $sp,$sp,-64 /* f0c7860: afbf0014 */ sw $ra,0x14($sp) -/* f0c7864: 0fc31951 */ jal currentPlayerUpdatePrevPos +/* f0c7864: 0fc31951 */ jal currentPlayerUpdatePrevPosWalk /* f0c7868: 00000000 */ sll $zero,$zero,0x0 /* f0c786c: 0fc318c6 */ jal func0f0c6318 /* f0c7870: 00000000 */ sll $zero,$zero,0x0 diff --git a/src/include/game/bondgrab.h b/src/include/game/bondgrab.h index f721fca70..214e4803b 100644 --- a/src/include/game/bondgrab.h +++ b/src/include/game/bondgrab.h @@ -15,7 +15,7 @@ u32 func0f0cdef0(void); u32 func0f0cdf64(void); u32 func0f0cdfbc(void); u32 func0f0ce0bc(void); -u32 func0f0ce100(void); +void currentPlayerUpdatePrevPosGrab(void); u32 func0f0ce178(void); u32 func0f0ce1ac(void); u32 func0f0ce450(void); diff --git a/src/include/game/bondwalk.h b/src/include/game/bondwalk.h index 74a67a345..39baa1ea4 100644 --- a/src/include/game/bondwalk.h +++ b/src/include/game/bondwalk.h @@ -23,7 +23,7 @@ u32 func0f0c6080(void); u32 func0f0c6180(void); u32 func0f0c6318(void); u32 func0f0c63bc(void); -void currentPlayerUpdatePrevPos(void); +void currentPlayerUpdatePrevPosWalk(void); void func0f0c65a8(void); u32 func0f0c65c8(void); void currentPlayerApplyCrouchSpeedTheta(void); diff --git a/src/include/types.h b/src/include/types.h index 32cb4c960..31e81a32b 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2604,10 +2604,8 @@ struct player { /*0x19f0*/ u32 unk19f0; /*0x19f4*/ u32 unk19f4; /*0x19f8*/ u32 unk19f8; - /*0x19fc*/ u32 unk19fc; - /*0x1a00*/ u32 unk1a00; - /*0x1a04*/ u32 unk1a04; - /*0x1a08*/ u32 unk1a08; + /*0x19fc*/ f32 bondprevtheta; + /*0x1a00*/ struct coord grabbedprevpos; /*0x1a0c*/ u32 unk1a0c; /*0x1a10*/ u32 unk1a10; /*0x1a14*/ u32 unk1a14;