From ee55a92e79ef6c4357f0941918416b78f19213c0 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 19 Jan 2020 22:30:52 +1000 Subject: [PATCH] Identify mpGetNumPresets --- src/game/game_00b200.c | 8 ++++---- src/game/game_187770.c | 8 ++++---- src/include/constants.h | 1 + src/include/game/game_187770.h | 2 +- src/include/setup/setup_020df0.h | 2 +- src/include/types.h | 9 +++++++++ src/setup/setup_020df0.c | 30 +++++++++++++++--------------- 7 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/game/game_00b200.c b/src/game/game_00b200.c index 8563c1c49..9e8df8fe4 100644 --- a/src/game/game_00b200.c +++ b/src/game/game_00b200.c @@ -54,13 +54,13 @@ glabel func0f00b210 /* f00b280: 2610001a */ addiu $s0,$s0,0x1a /* f00b284: 1420ffee */ bnez $at,.L0f00b240 /* f00b288: 2652001a */ addiu $s2,$s2,0x1a -/* f00b28c: 0fc636df */ jal func0f18db7c +/* f00b28c: 0fc636df */ jal mpGetNumPresets /* f00b290: 00008825 */ or $s1,$zero,$zero /* f00b294: 18400017 */ blez $v0,.L0f00b2f4 /* f00b298: 00117080 */ sll $t6,$s1,0x2 /* f00b29c: 01d17023 */ subu $t6,$t6,$s1 -/* f00b2a0: 3c0f8008 */ lui $t7,%hi(mppresets) -/* f00b2a4: 25ef7b6c */ addiu $t7,$t7,%lo(mppresets) +/* f00b2a0: 3c0f8008 */ lui $t7,%hi(g_MpPresets) +/* f00b2a4: 25ef7b6c */ addiu $t7,$t7,%lo(g_MpPresets) /* f00b2a8: 000e70c0 */ sll $t6,$t6,0x3 /* f00b2ac: 01cf8021 */ addu $s0,$t6,$t7 /* f00b2b0: 26120008 */ addiu $s2,$s0,0x8 @@ -76,7 +76,7 @@ glabel func0f00b210 /* f00b2d4: 2407ffff */ addiu $a3,$zero,-1 /* f00b2d8: 26310001 */ addiu $s1,$s1,0x1 /* f00b2dc: 26100018 */ addiu $s0,$s0,0x18 -/* f00b2e0: 0fc636df */ jal func0f18db7c +/* f00b2e0: 0fc636df */ jal mpGetNumPresets /* f00b2e4: 26520018 */ addiu $s2,$s2,%lo(var80090018) /* f00b2e8: 0222082a */ slt $at,$s1,$v0 /* f00b2ec: 5420fff2 */ bnezl $at,.L0f00b2b8 diff --git a/src/game/game_187770.c b/src/game/game_187770.c index 875fbdabf..b826386c9 100644 --- a/src/game/game_187770.c +++ b/src/game/game_187770.c @@ -7419,9 +7419,9 @@ glabel func0f18dac0 /* f18db78: 00000000 */ sll $zero,$zero,0x0 ); -u32 func0f18db7c(void) +u32 mpGetNumPresets(void) { - return 14; + return NUM_MPPRESETS; } GLOBAL_ASM( @@ -7429,12 +7429,12 @@ glabel func0f18db84 /* f18db84: 27bdffd8 */ addiu $sp,$sp,-40 /* f18db88: 00047080 */ sll $t6,$a0,0x2 /* f18db8c: 01c47023 */ subu $t6,$t6,$a0 -/* f18db90: 3c0f8008 */ lui $t7,%hi(mppresets) +/* f18db90: 3c0f8008 */ lui $t7,%hi(g_MpPresets) /* f18db94: afb30020 */ sw $s3,0x20($sp) /* f18db98: afb2001c */ sw $s2,0x1c($sp) /* f18db9c: afb10018 */ sw $s1,0x18($sp) /* f18dba0: afb00014 */ sw $s0,0x14($sp) -/* f18dba4: 25ef7b6c */ addiu $t7,$t7,%lo(mppresets) +/* f18dba4: 25ef7b6c */ addiu $t7,$t7,%lo(g_MpPresets) /* f18dba8: 000e70c0 */ sll $t6,$t6,0x3 /* f18dbac: afbf0024 */ sw $ra,0x24($sp) /* f18dbb0: 01cf8021 */ addu $s0,$t6,$t7 diff --git a/src/include/constants.h b/src/include/constants.h index cea5c63eb..da73559b0 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -589,6 +589,7 @@ #define NUM_MPBOTCOMMANDS 14 #define NUM_MPBODIES 61 #define NUM_MPHEADS 75 +#define NUM_MPPRESETS 14 #define NUM_MPTRACKS 42 #define NUM_SOLONORMALSTAGES 17 #define NUM_SOLOSTAGES 21 diff --git a/src/include/game/game_187770.h b/src/include/game/game_187770.h index d3c136295..0db4d10c0 100644 --- a/src/include/game/game_187770.h +++ b/src/include/game/game_187770.h @@ -103,7 +103,7 @@ u32 func0f18d5c4(void); u32 func0f18d9a4(void); u32 func0f18d9fc(void); u32 func0f18dac0(void); -u32 func0f18db7c(void); +u32 mpGetNumPresets(void); u32 func0f18db84(void); u32 func0f18dc0c(void); u32 func0f18dc64(void); diff --git a/src/include/setup/setup_020df0.h b/src/include/setup/setup_020df0.h index 64e7594aa..efdc283c5 100644 --- a/src/include/setup/setup_020df0.h +++ b/src/include/setup/setup_020df0.h @@ -305,7 +305,7 @@ extern struct mpsimulant g_MpGeneralSimulants[]; extern struct mpsimulant mpspecialsimulants[]; extern struct mpbody g_MpBodies[NUM_MPBODIES]; extern struct mptrack g_MpTracks[NUM_MPTRACKS]; -extern u32 mppresets[]; +extern struct mppreset g_MpPresets[NUM_MPPRESETS]; extern u32 g_TeamColours[MAX_TEAMS]; extern u32 var80087d10; extern u32 var80087d14[]; diff --git a/src/include/types.h b/src/include/types.h index e728c385c..8fbf5a406 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -4681,4 +4681,13 @@ struct criteria_holograph { struct criteria_holograph *next; }; +struct mppreset { + u16 name; + u32 unk04; + u32 unk08; + u32 unk0c; + u32 unk10; + u32 unk14; +}; + #endif diff --git a/src/setup/setup_020df0.c b/src/setup/setup_020df0.c index b06218bb1..2cb97f91f 100644 --- a/src/setup/setup_020df0.c +++ b/src/setup/setup_020df0.c @@ -12219,21 +12219,21 @@ struct mptrack g_MpTracks[NUM_MPTRACKS] = { }; // 2db8c -u32 mppresets[] = { - 0x54190000, 0x07, 0, 0, 0, 0, // "No Shield" - 0x541a0000, 0x0c, 0, 0, 0, 0, // "Automatics" - 0x541b0000, 0x0d, 0, 0, 0, 0, // "Rocket Launcher" - 0x541c0000, 0x0b, 0, 0, 0, 0, // "Simulants" - 0x541d0000, 0x09, 0, 0, 0, 0, // "King of the Hill" - 0x541e0000, 0x02, 0, 0, 0, 0, // "Complex FarSight" - 0x541f0000, 0x08, 0, 0, 0, 0, // "Hold the Briefcase" - 0x54200000, 0x01, 0, 0, 0, 0, // "Pistol One-Hit Kills" - 0x54210000, 0x0a, 0, 0, 0, 0, // "Capture the Case" - 0x54220000, 0x05, 0, 0, 0, 0, // "Cloaking" - 0x54230000, 0x00, 0, 0, 0, 0, // "Temple Explosives" - 0x54240000, 0x04, 0, 0, 0, 0, // "Slayer" - 0x54250000, 0x03, 0, 0, 0, 0, // "Tranquilizr" - 0x54260000, 0x06, 0, 0, 0, 0, // "Slow Motion" +struct mppreset g_MpPresets[NUM_MPPRESETS] = { + { 0x5419, 0x07, 0, 0, 0, 0 }, // "No Shield" + { 0x541a, 0x0c, 0, 0, 0, 0 }, // "Automatics" + { 0x541b, 0x0d, 0, 0, 0, 0 }, // "Rocket Launcher" + { 0x541c, 0x0b, 0, 0, 0, 0 }, // "Simulants" + { 0x541d, 0x09, 0, 0, 0, 0 }, // "King of the Hill" + { 0x541e, 0x02, 0, 0, 0, 0 }, // "Complex FarSight" + { 0x541f, 0x08, 0, 0, 0, 0 }, // "Hold the Briefcase" + { 0x5420, 0x01, 0, 0, 0, 0 }, // "Pistol One-Hit Kills" + { 0x5421, 0x0a, 0, 0, 0, 0 }, // "Capture the Case" + { 0x5422, 0x05, 0, 0, 0, 0 }, // "Cloaking" + { 0x5423, 0x00, 0, 0, 0, 0 }, // "Temple Explosives" + { 0x5424, 0x04, 0, 0, 0, 0 }, // "Slayer" + { 0x5425, 0x03, 0, 0, 0, 0 }, // "Tranquilizr" + { 0x5426, 0x06, 0, 0, 0, 0 }, // "Slow Motion" }; u32 var80087cbc = 0x00000000;