Decompile htGetIndexBySlot

This commit is contained in:
Ryan Dwyer 2020-04-12 11:35:47 +10:00
parent bf6a4cebb1
commit c641f0ee4a
3 changed files with 31 additions and 51 deletions

View File

@ -5296,7 +5296,7 @@ void htBegin(void)
chrUnsetStageFlag(NULL, STAGEFLAG_CI_HOLO_ABORTING); chrUnsetStageFlag(NULL, STAGEFLAG_CI_HOLO_ABORTING);
chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_SUCCESS); chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_SUCCESS);
chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_FAILURE); chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_FAILURE);
chrSetStageFlag(NULL, func0f1a25c0(func0f1a24dc(var80088bb4))); chrSetStageFlag(NULL, func0f1a25c0(htGetIndexBySlot(var80088bb4)));
func0f115a48(&setup00->unk200, &setup00->unk310); func0f115a48(&setup00->unk200, &setup00->unk310);
g_Vars.currentplayer->deadtimer = 1; g_Vars.currentplayer->deadtimer = 1;
playersSetPassiveMode(false); playersSetPassiveMode(false);
@ -5314,7 +5314,7 @@ void htEnd(void)
g_HoloTrainingData.intraining = false; g_HoloTrainingData.intraining = false;
chrSetStageFlag(NULL, STAGEFLAG_CI_HOLO_ABORTING); chrSetStageFlag(NULL, STAGEFLAG_CI_HOLO_ABORTING);
chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_FAILURE); chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_FAILURE);
chrUnsetStageFlag(NULL, func0f1a25c0(func0f1a24dc(var80088bb4))); chrUnsetStageFlag(NULL, func0f1a25c0(htGetIndexBySlot(var80088bb4)));
func0f115a78(&setup00->unk200, &setup00->unk310); func0f115a78(&setup00->unk200, &setup00->unk310);
g_Vars.currentplayer->deadtimer = 0; g_Vars.currentplayer->deadtimer = 0;
roomGetProps(rooms, propnums, 256); roomGetProps(rooms, propnums, 256);
@ -5341,7 +5341,7 @@ void htEnd(void)
g_Vars.currentplayer->bondhealth = 1; g_Vars.currentplayer->bondhealth = 1;
} }
bool func0f1a2450(u32 value) bool htIsUnlocked(u32 value)
{ {
switch (value) { switch (value) {
case 0: case 0:
@ -5357,13 +5357,13 @@ bool func0f1a2450(u32 value)
return false; return false;
} }
s32 func0f1a2484(void) s32 htGetNumUnlocked(void)
{ {
s32 count = 0; s32 count = 0;
s32 i; s32 i;
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
if (func0f1a2450(i)) { if (htIsUnlocked(i)) {
count++; count++;
} }
} }
@ -5371,43 +5371,23 @@ s32 func0f1a2484(void)
return count; return count;
} }
GLOBAL_ASM( s32 htGetIndexBySlot(s32 slot)
glabel func0f1a24dc {
/* f1a24dc: 27bdffd8 */ addiu $sp,$sp,-40 s32 index = -1;
/* f1a24e0: afb30020 */ sw $s3,0x20($sp) s32 i;
/* f1a24e4: afb2001c */ sw $s2,0x1c($sp)
/* f1a24e8: afb10018 */ sw $s1,0x18($sp) for (i = 0; i < 7; i++) {
/* f1a24ec: afb00014 */ sw $s0,0x14($sp) if (htIsUnlocked(i)) {
/* f1a24f0: 00809825 */ or $s3,$a0,$zero index++;
/* f1a24f4: afbf0024 */ sw $ra,0x24($sp) }
/* f1a24f8: 2411ffff */ addiu $s1,$zero,-1
/* f1a24fc: 00008025 */ or $s0,$zero,$zero if (index == slot) {
/* f1a2500: 24120007 */ addiu $s2,$zero,0x7 return i;
.L0f1a2504: }
/* f1a2504: 0fc68914 */ jal func0f1a2450 }
/* f1a2508: 02002025 */ or $a0,$s0,$zero
/* f1a250c: 10400002 */ beqz $v0,.L0f1a2518 return 0;
/* f1a2510: 00000000 */ sll $zero,$zero,0x0 }
/* f1a2514: 26310001 */ addiu $s1,$s1,0x1
.L0f1a2518:
/* f1a2518: 56330004 */ bnel $s1,$s3,.L0f1a252c
/* f1a251c: 26100001 */ addiu $s0,$s0,0x1
/* f1a2520: 10000005 */ beqz $zero,.L0f1a2538
/* f1a2524: 02001025 */ or $v0,$s0,$zero
/* f1a2528: 26100001 */ addiu $s0,$s0,0x1
.L0f1a252c:
/* f1a252c: 1612fff5 */ bne $s0,$s2,.L0f1a2504
/* f1a2530: 00000000 */ sll $zero,$zero,0x0
/* f1a2534: 00001025 */ or $v0,$zero,$zero
.L0f1a2538:
/* f1a2538: 8fbf0024 */ lw $ra,0x24($sp)
/* f1a253c: 8fb00014 */ lw $s0,0x14($sp)
/* f1a2540: 8fb10018 */ lw $s1,0x18($sp)
/* f1a2544: 8fb2001c */ lw $s2,0x1c($sp)
/* f1a2548: 8fb30020 */ lw $s3,0x20($sp)
/* f1a254c: 03e00008 */ jr $ra
/* f1a2550: 27bd0028 */ addiu $sp,$sp,0x28
);
char *htGetName(s32 index) char *htGetName(s32 index)
{ {
@ -5452,7 +5432,7 @@ char *htGetDescription(void)
L_MISC(342), L_MISC(342),
}; };
return langGet(texts[func0f1a24dc(var80088bb4)]); return langGet(texts[htGetIndexBySlot(var80088bb4)]);
} }
char *htGetTip1(void) char *htGetTip1(void)
@ -5467,7 +5447,7 @@ char *htGetTip1(void)
L_MISC(349), // "Go for the armed opponents..." L_MISC(349), // "Go for the armed opponents..."
}; };
return langGet(texts[func0f1a24dc(var80088bb4)]); return langGet(texts[htGetIndexBySlot(var80088bb4)]);
} }
char *htGetTip2(void) char *htGetTip2(void)
@ -5482,7 +5462,7 @@ char *htGetTip2(void)
L_MISC(356), // "Go for the armed opponents..." L_MISC(356), // "Go for the armed opponents..."
}; };
return langGet(texts[func0f1a24dc(var80088bb4)]); return langGet(texts[htGetIndexBySlot(var80088bb4)]);
} }
void frGetGoalTargetsText(char *buffer) void frGetGoalTargetsText(char *buffer)

View File

@ -3395,12 +3395,12 @@ glabel var7f1b99b4
/* f1a6974: 8c2e999c */ lw $t6,%lo(var7f1b999c)($at) /* f1a6974: 8c2e999c */ lw $t6,%lo(var7f1b999c)($at)
/* f1a6978: 01c00008 */ jr $t6 /* f1a6978: 01c00008 */ jr $t6
/* f1a697c: 00000000 */ sll $zero,$zero,0x0 /* f1a697c: 00000000 */ sll $zero,$zero,0x0
/* f1a6980: 0fc68921 */ jal func0f1a2484 /* f1a6980: 0fc68921 */ jal htGetNumUnlocked
/* f1a6984: afa60020 */ sw $a2,0x20($sp) /* f1a6984: afa60020 */ sw $a2,0x20($sp)
/* f1a6988: 8fa60020 */ lw $a2,0x20($sp) /* f1a6988: 8fa60020 */ lw $a2,0x20($sp)
/* f1a698c: 10000018 */ beqz $zero,.L0f1a69f0 /* f1a698c: 10000018 */ beqz $zero,.L0f1a69f0
/* f1a6990: acc20000 */ sw $v0,0x0($a2) /* f1a6990: acc20000 */ sw $v0,0x0($a2)
/* f1a6994: 0fc68937 */ jal func0f1a24dc /* f1a6994: 0fc68937 */ jal htGetIndexBySlot
/* f1a6998: 8cc40000 */ lw $a0,0x0($a2) /* f1a6998: 8cc40000 */ lw $a0,0x0($a2)
/* f1a699c: 0fc68955 */ jal htGetName /* f1a699c: 0fc68955 */ jal htGetName
/* f1a69a0: 00402025 */ or $a0,$v0,$zero /* f1a69a0: 00402025 */ or $a0,$v0,$zero
@ -3439,7 +3439,7 @@ glabel func0f1a6a04
/* f1a6a08: afa40018 */ sw $a0,0x18($sp) /* f1a6a08: afa40018 */ sw $a0,0x18($sp)
/* f1a6a0c: afbf0014 */ sw $ra,0x14($sp) /* f1a6a0c: afbf0014 */ sw $ra,0x14($sp)
/* f1a6a10: 3c048009 */ lui $a0,%hi(var80088bb4) /* f1a6a10: 3c048009 */ lui $a0,%hi(var80088bb4)
/* f1a6a14: 0fc68937 */ jal func0f1a24dc /* f1a6a14: 0fc68937 */ jal htGetIndexBySlot
/* f1a6a18: 90848bb4 */ lbu $a0,%lo(var80088bb4)($a0) /* f1a6a18: 90848bb4 */ lbu $a0,%lo(var80088bb4)($a0)
/* f1a6a1c: 0fc68955 */ jal htGetName /* f1a6a1c: 0fc68955 */ jal htGetName
/* f1a6a20: 00402025 */ or $a0,$v0,$zero /* f1a6a20: 00402025 */ or $a0,$v0,$zero

View File

@ -99,9 +99,9 @@ void htTick(void);
void func0f1a2198(void); void func0f1a2198(void);
void htBegin(void); void htBegin(void);
void htEnd(void); void htEnd(void);
bool func0f1a2450(u32 value); bool htIsUnlocked(u32 value);
s32 func0f1a2484(void); s32 htGetNumUnlocked(void);
u32 func0f1a24dc(u32 arg0); s32 htGetIndexBySlot(s32 slot);
char *htGetName(s32 index); char *htGetName(s32 index);
u32 func0f1a25c0(s32 index); u32 func0f1a25c0(s32 index);
char *htGetDescription(void); char *htGetDescription(void);