Decompile weaponGetShortName

This commit is contained in:
Ryan Dwyer 2020-03-12 22:25:02 +10:00
parent f4c957bdbf
commit bff65e8a06
6 changed files with 29 additions and 41 deletions

View File

@ -8,6 +8,7 @@
#include "game/data/data_0160b0.h"
#include "game/data/data_01a3a0.h"
#include "game/data/data_020df0.h"
#include "game/data/inventory.h"
#include "game/game_005fd0.h"
#include "game/game_01e250.h"
#include "game/game_0601b0.h"
@ -116,11 +117,6 @@ const char var7f1ac0ec[] = "Gun : TotalUsed %d, Free %d\n";
const char var7f1ac10c[] = "BriGun: Set Master State: MASTER_GUN_LOADSTATE_LOADED\n";
const char var7f1ac144[] = "GunLockTimer: %d\n";
const char var7f1ac158[] = "** error\n";
const char var7f1ac164[] = "** error\n";
const char var7f1ac170[] = "wantedfn %d tiggle %d\n";
const char var7f1ac188[] = "%d\n";
const char var7f1ac18c[] = "%02d:%02d:%02d\n";
const char var7f1ac19c[] = "%02d:%02d\n";
GLOBAL_ASM(
glabel func0f097ba0
@ -12758,29 +12754,21 @@ glabel func0f0a21a4
/* f0a21cc: 00000000 */ sll $zero,$zero,0x0
);
GLOBAL_ASM(
glabel weaponGetName
/* f0a21d0: 00047080 */ sll $t6,$a0,0x2
/* f0a21d4: 3c028007 */ lui $v0,%hi(g_Weapons)
/* f0a21d8: 004e1021 */ addu $v0,$v0,$t6
/* f0a21dc: 8c42ff18 */ lw $v0,%lo(g_Weapons)($v0)
/* f0a21e0: 27bdffe8 */ addiu $sp,$sp,-24
/* f0a21e4: afbf0014 */ sw $ra,0x14($sp)
/* f0a21e8: 10400005 */ beqz $v0,.L0f0a2200
/* f0a21ec: 00000000 */ sll $zero,$zero,0x0
/* f0a21f0: 0fc5b9f1 */ jal langGet
/* f0a21f4: 94440044 */ lhu $a0,0x44($v0)
/* f0a21f8: 10000004 */ beqz $zero,.L0f0a220c
/* f0a21fc: 8fbf0014 */ lw $ra,0x14($sp)
.L0f0a2200:
/* f0a2200: 3c027f1b */ lui $v0,%hi(var7f1ac164)
/* f0a2204: 2442c164 */ addiu $v0,$v0,%lo(var7f1ac164)
/* f0a2208: 8fbf0014 */ lw $ra,0x14($sp)
.L0f0a220c:
/* f0a220c: 27bd0018 */ addiu $sp,$sp,0x18
/* f0a2210: 03e00008 */ jr $ra
/* f0a2214: 00000000 */ sll $zero,$zero,0x0
);
char *weaponGetShortName(s32 weaponnum)
{
struct weapon *weapon = g_Weapons[weaponnum];
if (weapon) {
return langGet(weapon->shortname);
}
return "** error\n";
}
const char var7f1ac170[] = "wantedfn %d tiggle %d\n";
const char var7f1ac188[] = "%d\n";
const char var7f1ac18c[] = "%02d:%02d:%02d\n";
const char var7f1ac19c[] = "%02d:%02d\n";
GLOBAL_ASM(
glabel func0f0a2218

View File

@ -1893,7 +1893,7 @@ glabel var7f1b2ce0
/* f0ffa38: 10000004 */ beqz $zero,.L0f0ffa4c
/* f0ffa3c: afa20080 */ sw $v0,0x80($sp)
.L0f0ffa40:
/* f0ffa40: 0fc28874 */ jal weaponGetName
/* f0ffa40: 0fc28874 */ jal weaponGetShortName
/* f0ffa44: 00000000 */ sll $zero,$zero,0x0
/* f0ffa48: afa20080 */ sw $v0,0x80($sp)
.L0f0ffa4c:

View File

@ -1425,11 +1425,11 @@ char *currentPlayerGetInvShortNameByIndex(s32 index)
} else if (g_Vars.currentplayer->equipallguns) {
if (index < WEAPON_PSYCHOSISGUN - currentStageForbidsSlayer()) {
index++;
return weaponGetName(func0f111b88(index));
return weaponGetShortName(func0f111b88(index));
}
}
return weaponGetName(weaponnum);
return weaponGetShortName(weaponnum);
}
void textoverrideInsert(struct textoverride *override)

View File

@ -6935,7 +6935,7 @@ glabel chrGiveBriefcase
/* f1869bc: 0fc5b9f1 */ jal langGet
/* f1869c0: 24045400 */ addiu $a0,$zero,0x5400
/* f1869c4: 24040057 */ addiu $a0,$zero,0x57
/* f1869c8: 0fc28874 */ jal weaponGetName
/* f1869c8: 0fc28874 */ jal weaponGetShortName
/* f1869cc: afa20048 */ sw $v0,0x48($sp)
/* f1869d0: 8fa50048 */ lw $a1,0x48($sp)
/* f1869d4: 27a400d4 */ addiu $a0,$sp,0xd4
@ -7174,7 +7174,7 @@ glabel chrGiveBriefcase
/* f186d14: 0fc5b9f1 */ jal langGet
/* f186d18: 24045404 */ addiu $a0,$zero,0x5404
/* f186d1c: 24040057 */ addiu $a0,$zero,0x57
/* f186d20: 0fc28874 */ jal weaponGetName
/* f186d20: 0fc28874 */ jal weaponGetShortName
/* f186d24: afa20048 */ sw $v0,0x48($sp)
/* f186d28: 00106880 */ sll $t5,$s0,0x2
/* f186d2c: 01b06823 */ subu $t5,$t5,$s0
@ -7190,7 +7190,7 @@ glabel chrGiveBriefcase
/* f186d54: 0fc5b9f1 */ jal langGet
/* f186d58: 24045405 */ addiu $a0,$zero,0x5405
/* f186d5c: 24040057 */ addiu $a0,$zero,0x57
/* f186d60: 0fc28874 */ jal weaponGetName
/* f186d60: 0fc28874 */ jal weaponGetShortName
/* f186d64: afa20048 */ sw $v0,0x48($sp)
/* f186d68: 8fa50048 */ lw $a1,0x48($sp)
/* f186d6c: 27a40094 */ addiu $a0,$sp,0x94
@ -7200,7 +7200,7 @@ glabel chrGiveBriefcase
/* f186d7c: 0fc5b9f1 */ jal langGet
/* f186d80: 24045406 */ addiu $a0,$zero,0x5406
/* f186d84: 24040057 */ addiu $a0,$zero,0x57
/* f186d88: 0fc28874 */ jal weaponGetName
/* f186d88: 0fc28874 */ jal weaponGetShortName
/* f186d8c: afa20048 */ sw $v0,0x48($sp)
/* f186d90: 8fa50048 */ lw $a1,0x48($sp)
/* f186d94: 27a40054 */ addiu $a0,$sp,0x54
@ -7364,7 +7364,7 @@ glabel chrGiveBriefcase
/* f186fbc: 0fc5b9f1 */ jal langGet
/* f186fc0: ac39c168 */ sw $t9,%lo(g_ScenarioData+0x58)($at)
/* f186fc4: 24040057 */ addiu $a0,$zero,0x57
/* f186fc8: 0fc28874 */ jal weaponGetName
/* f186fc8: 0fc28874 */ jal weaponGetShortName
/* f186fcc: afa20048 */ sw $v0,0x48($sp)
/* f186fd0: 8fb80120 */ lw $t8,0x120($sp)
/* f186fd4: 3c10800b */ lui $s0,%hi(g_MpSetup+0x28)
@ -7382,7 +7382,7 @@ glabel chrGiveBriefcase
/* f187004: 0fc5b9f1 */ jal langGet
/* f187008: 24045402 */ addiu $a0,$zero,0x5402
/* f18700c: 24040057 */ addiu $a0,$zero,0x57
/* f187010: 0fc28874 */ jal weaponGetName
/* f187010: 0fc28874 */ jal weaponGetShortName
/* f187014: afa20048 */ sw $v0,0x48($sp)
/* f187018: 8fa50048 */ lw $a1,0x48($sp)
/* f18701c: 27a40094 */ addiu $a0,$sp,0x94
@ -7392,7 +7392,7 @@ glabel chrGiveBriefcase
/* f18702c: 0fc5b9f1 */ jal langGet
/* f187030: 24045403 */ addiu $a0,$zero,0x5403
/* f187034: 24040057 */ addiu $a0,$zero,0x57
/* f187038: 0fc28874 */ jal weaponGetName
/* f187038: 0fc28874 */ jal weaponGetShortName
/* f18703c: afa20048 */ sw $v0,0x48($sp)
/* f187040: 8fae0120 */ lw $t6,0x120($sp)
/* f187044: 8fa50048 */ lw $a1,0x48($sp)
@ -7694,7 +7694,7 @@ bool chrGiveUplink(struct chrdata *chr, struct prop *prop)
}
// "%shas the\n%s"
sprintf(message, langGet(L_MPWEAPONS(0)), mpchr->name, weaponGetName(WEAPON_DATAUPLINK));
sprintf(message, langGet(L_MPWEAPONS(0)), mpchr->name, weaponGetShortName(WEAPON_DATAUPLINK));
playernum = g_Vars.currentplayernum;
for (i = 0; i < PLAYERCOUNT(); i++) {

View File

@ -39523,7 +39523,7 @@ glabel func0f08841c
/* f08868c: 10000009 */ beqz $zero,.L0f0886b4
/* f088690: 00000000 */ sll $zero,$zero,0x0
.L0f088694:
/* f088694: 0fc28874 */ jal weaponGetName
/* f088694: 0fc28874 */ jal weaponGetShortName
/* f088698: 8fa40024 */ lw $a0,0x24($sp)
/* f08869c: 8fa40020 */ lw $a0,0x20($sp)
/* f0886a0: 0c004c89 */ jal strcat

View File

@ -102,7 +102,7 @@ u32 func0f0a20fc(void);
u32 func0f0a212c(void);
u32 func0f0a215c(void);
u16 func0f0a21a4(s32 arg0);
char *weaponGetName(s32 arg0);
char *weaponGetShortName(s32 arg0);
u32 func0f0a2218(void);
u32 func0f0a2290(void);
u32 func0f0a2308(void);