From 1a692d0c488bb2c95a5d58ab7659f5a9eadd690f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 30 Jul 2020 19:13:18 +1000 Subject: [PATCH] Decompile currentPlayerGetCrossPos --- src/game/game_0601b0.c | 4 ++-- src/game/game_097ba0.c | 17 +++++++---------- src/include/game/game_097ba0.h | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index b180ddeb2..02d54fcf6 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -2501,7 +2501,7 @@ glabel var7f1a9ec4 /* f0623e4: 00000000 */ nop /* f0623e8: c4560018 */ lwc1 $f22,0x18($v0) .L0f0623ec: -/* f0623ec: 0fc282fb */ jal func0f0a0bec +/* f0623ec: 0fc282fb */ jal currentPlayerGetCrossPos /* f0623f0: 27a50104 */ addiu $a1,$sp,0x104 /* f0623f4: 0fc2d5fe */ jal currentPlayerGetScreenLeft /* f0623f8: 00000000 */ nop @@ -4978,7 +4978,7 @@ glabel var7f1a9f54 /* f0645c8: 27a5006c */ addiu $a1,$sp,0x6c /* f0645cc: 45020111 */ bc1fl .L0f064a14 /* f0645d0: c7a00058 */ lwc1 $f0,0x58($sp) -/* f0645d4: 0fc282fb */ jal func0f0a0bec +/* f0645d4: 0fc282fb */ jal currentPlayerGetCrossPos /* f0645d8: afa0004c */ sw $zero,0x4c($sp) /* f0645dc: 0fc25e24 */ jal floorf /* f0645e0: c7ac008c */ lwc1 $f12,0x8c($sp) diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index 457628ee3..8fe785cb9 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -11293,16 +11293,13 @@ glabel func0f0a0b98 /* f0a0be8: 00000000 */ nop ); -GLOBAL_ASM( -glabel func0f0a0bec -/* f0a0bec: 3c02800a */ lui $v0,%hi(g_Vars+0x284) -/* f0a0bf0: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) -/* f0a0bf4: c4441660 */ lwc1 $f4,0x1660($v0) -/* f0a0bf8: e4840000 */ swc1 $f4,0x0($a0) -/* f0a0bfc: c4461664 */ lwc1 $f6,0x1664($v0) -/* f0a0c00: 03e00008 */ jr $ra -/* f0a0c04: e4a60000 */ swc1 $f6,0x0($a1) -); +void currentPlayerGetCrossPos(f32 *x, f32 *y) +{ + struct player *player = g_Vars.currentplayer; + + *x = player->crosspos[0]; + *y = player->crosspos[1]; +} void func0f0a0c08(struct coord *arg0, struct coord *arg1) { diff --git a/src/include/game/game_097ba0.h b/src/include/game/game_097ba0.h index 9ee3d97ca..eb35468c5 100644 --- a/src/include/game/game_097ba0.h +++ b/src/include/game/game_097ba0.h @@ -79,7 +79,7 @@ u32 func0f09fa84(void); void func0f0a0394(void); void func0f0a0b30(f32 autoaimx, f32 autoaimy); u32 func0f0a0b98(void); -u32 func0f0a0bec(void); +void currentPlayerGetCrossPos(f32 *x, f32 *y); void func0f0a0c08(struct coord *arg0, struct coord *arg1); u32 func0f0a0c44(void); u32 func0f0a0cb0(void);