decomp funcs in code_13870_len_6980.c & code_1A1F0_len_5390.c (#245)

* decomp funcs in code_13870_len_6980.c & code_1A1F0_len_5390.c

* fix pr comments

* fix for loops to not be hardcoded
This commit is contained in:
Rainchus 2021-03-30 12:39:44 -05:00 committed by GitHub
parent f2dfd435d9
commit 0a96011cfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 212 additions and 339 deletions

View File

@ -1268,8 +1268,8 @@ typedef struct Encounter {
/* 0x44 */ s16 battle;
/* 0x46 */ s16 stage;
/* 0x48 */ s16 encounterID;
/* 0x4A */ char unk_4A[2];
} Encounter; // size = 0x4C
/* 0x4A */ char unk_4C[0x12];
} Encounter; // size = 0x5C
typedef struct PlayerPathElement {
/* 0x00 */ char unk_00[4];
@ -1571,40 +1571,44 @@ typedef struct AnimatedModelNode {
} AnimatedModelNode; // size = 0x2C
typedef struct EncounterStatus {
/* 0x00 */ s32 flags;
/* 0x04 */ u8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */
/* 0x05 */ s8 hitType; /* 1 = none/enemy, 2 = jump */
/* 0x06 */ s8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */
/* 0x07 */ char unk_07;
/* 0x08 */ s8 unk_08;
/* 0x09 */ s8 battleOutcome; /* 0 = won, 1 = lost */
/* 0x0A */ char unk_0A;
/* 0x0B */ s8 merleeCoinBonus; /* triple coins when != 0 */
/* 0x0C */ u8 damageTaken; /* valid after battle */
/* 0x0D */ char unk_0D;
/* 0x0E */ s16 coinsEarned; /* valid after battle */
/* 0x10 */ char unk_10;
/* 0x11 */ u8 allowFleeing;
/* 0x12 */ s8 unk_12;
/* 0x13 */ u8 dropWhackaBump;
/* 0x14 */ s32 songID;
/* 0x18 */ s32 unk_18;
/* 0x1C */ s8 numEncounters; /* number of encounters for current map (in list) */
/* 0x1D */ s8 currentAreaIndex;
/* 0x1E */ u8 currentMapIndex;
/* 0x1F */ u8 currentEntryIndex;
/* 0x20 */ u8 mapID;
/* 0x21 */ char unk_21[3];
/* 0x24 */ s32* npcGroupList;
/* 0x28 */ struct Encounter* enounterList[24];
/* 0x88 */ struct Encounter* currentEncounter;
/* 0x8C */ struct Enemy* currentEnemy;
/* 0x90 */ s32 unk_90;
/* 0x94 */ s32 unk_94;
/* 0x98 */ s32 unk_98;
/* 0x9C */ char unk_9C[20];
/* 0xB0 */ s32 defeatFlags[60][12];
} EncounterStatus; // size = 0xE0
/* 0x000 */ s32 flags;
/* 0x004 */ u8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */
/* 0x005 */ s8 hitType; /* 1 = none/enemy, 2 = jump */
/* 0x006 */ s8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */
/* 0x007 */ char unk_07;
/* 0x008 */ s8 unk_08;
/* 0x009 */ s8 battleOutcome; /* 0 = won, 1 = lost */
/* 0x00A */ s8 unk_0A;
/* 0x00B */ s8 merleeCoinBonus; /* triple coins when != 0 */
/* 0x00C */ u8 damageTaken; /* valid after battle */
/* 0x00D */ char unk_0D;
/* 0x00E */ s16 coinsEarned; /* valid after battle */
/* 0x010 */ char unk_10;
/* 0x011 */ u8 allowFleeing;
/* 0x012 */ s8 unk_12;
/* 0x013 */ u8 dropWhackaBump;
/* 0x014 */ s32 songID;
/* 0x018 */ s32 unk_18;
/* 0x01C */ s8 numEncounters; /* number of encounters for current map (in list) */
/* 0x01D */ s8 currentAreaIndex;
/* 0x01E */ u8 currentMapIndex;
/* 0x01F */ u8 currentEntryIndex;
/* 0x020 */ u8 mapID;
/* 0x021 */ s8 resetMapEncounterFlags;
/* 0x021 */ char unk_22[2];
/* 0x024 */ s32* npcGroupList;
/* 0x028 */ struct Encounter* encounterList[24];
/* 0x088 */ struct Encounter* currentEncounter;
/* 0x08C */ struct Enemy* currentEnemy;
/* 0x090 */ s32 fadeOutAmount;
/* 0x094 */ s32 unk_94;
/* 0x098 */ s32 fadeOutAccel;
/* 0x09C */ s32 battleStartCountdown;
/* 0x0A0 */ char unk_A0[16];
/* 0x0B0 */ s32 defeatFlags[60][12];
/* 0xFB0 */ s16 recentMaps[2];
/* 0xFB4 */ char unk_FB4[4];
} EncounterStatus; // size = 0xFB8
typedef struct SaveData {
/* 0x0000 */ char magicString[16]; /* "Mario Story 006" string */

View File

@ -257,7 +257,9 @@ extern u32 gBattleMapVars[MAX_MAPVARS];
extern u32 gWorldMapFlags[MAX_MAPFLAGS];
extern u32 gBattleMapFlags[MAX_MAPFLAGS];
extern s32 D_8009A5D0;
extern s32 D_8009A5D8;
extern s32 D_8009A678;
extern u8 D_800779B0;
extern u32 D_80078174;

View File

@ -1,6 +1,8 @@
#include "common.h"
#include "map.h"
void func_8003E670(void);
void NOP_npc_callback(void) {
}
@ -288,27 +290,183 @@ INCLUDE_ASM(s32, "code_13870_len_6980", func_8003E0D4);
INCLUDE_ASM(s32, "code_13870_len_6980", func_8003E1D0);
INCLUDE_ASM(s32, "code_13870_len_6980", COPY_set_defeated);
void COPY_set_defeated(s32 mapID, s32 encounterID) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
s32 encounterIdx = encounterID / 32;
s32 encounterShift;
s32 flag;
INCLUDE_ASM(s32, "code_13870_len_6980", func_8003E338);
flag = encounterID % 32;
encounterShift = flag;
flag = currentEncounter->defeatFlags[mapID][encounterIdx];
currentEncounter->defeatFlags[mapID][encounterIdx] = flag | (1 << encounterShift);
}
INCLUDE_ASM(s32, "code_13870_len_6980", clear_encounter_status);
void func_8003E338(void) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
s32 i;
s32 j;
for (i = 0; i < ARRAY_COUNT(currentEncounter->encounterList); i++) {
currentEncounter->encounterList[i] = 0;
}
currentEncounter->flags = 0;
currentEncounter->numEncounters = 0;
currentEncounter->eFirstStrike = 0;
currentEncounter->hitType = 0;
currentEncounter->unk_0A = 0;
currentEncounter->npcGroupList = 0;
currentEncounter->unk_08 = 0;
currentEncounter->dropWhackaBump = 0;
for (i = 0; i < ARRAY_COUNT(currentEncounter->defeatFlags); i++) {
for (j = 0; j < ARRAY_COUNT(currentEncounter->defeatFlags[i]); j++) {
currentEncounter->defeatFlags[i][j] = 0;
}
}
for (i = 0; i < ARRAY_COUNT(currentEncounter->recentMaps); i++) {
currentEncounter->recentMaps[i] = -1;
}
func_80045AC0();
gGameState = 0;
bind_dynamic_entity_3(0, func_8003E670);
}
void clear_encounter_status(void) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
GameStatus** gameStatus;
s32 i;
s32 j;
for (i = 0; i < ARRAY_COUNT(currentEncounter->encounterList); i++) {
currentEncounter->encounterList[i] = 0;
}
if (gGameStatusPtr->changedArea != 0) {
for (i = 0; i < ARRAY_COUNT(currentEncounter->defeatFlags); i++) {
for (j = 0; j < ARRAY_COUNT(currentEncounter->defeatFlags[i]); j++) {
currentEncounter->defeatFlags[i][j] = 0;
}
}
if (gGameStatusPtr->changedArea != 0) {
for (i = 0; i < ARRAY_COUNT(currentEncounter->recentMaps); i++) {
currentEncounter->recentMaps[i] = -1;
}
}
}
gameStatus = &gGameStatusPtr;
currentEncounter->numEncounters = 0;
currentEncounter->eFirstStrike = 0;
currentEncounter->hitType = 0;
currentEncounter->unk_0A = 0;
currentEncounter->currentAreaIndex = (*gameStatus)->areaID;
currentEncounter->currentMapIndex = (*gameStatus)->mapID;
currentEncounter->currentEntryIndex = (*gameStatus)->entryID;
currentEncounter->npcGroupList = 0;
currentEncounter->unk_08 = 0;
currentEncounter->unk_12 = 0;
func_80045AC0();
gGameState = 0;
bind_dynamic_entity_3(0, func_8003E670);
}
void func_8003E50C(void) {
}
INCLUDE_ASM(s32, "code_13870_len_6980", func_8003E514);
void func_8003E514(s8 arg0) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
currentEncounter->unk_08 = arg0;
}
INCLUDE_ASM(s32, "code_13870_len_6980", update_counters);
void update_counters(void) {
switch (gGameState) {
case 0:
break;
case 1:
create_encounters();
break;
case 2:
update_encounters_neutral();
break;
case 3:
update_encounters_pre_battle();
break;
case 4:
update_encounters_conversation();
break;
case 5:
update_encounters_post_battle();
break;
}
update_merlee_messages();
}
INCLUDE_ASM(s32, "code_13870_len_6980", draw_encounter_ui);
void draw_encounter_ui(void) {
switch (gGameState) {
case 0:
break;
case 1:
init_encounters_ui();
break;
case 2:
draw_encounters_neutral();
break;
case 3:
draw_encounters_pre_battle();
break;
case 4:
draw_encounters_conversation();
break;
case 5:
draw_encounters_post_battle();
break;
}
draw_merlee_messages();
}
INCLUDE_ASM(s32, "code_13870_len_6980", draw_first_strike_ui);
void draw_first_strike_ui(void) {
if (gGameState != 0) {
if (gGameState == 3) {
show_first_strike_message();
}
}
}
void func_8003E670(void) {
}
INCLUDE_ASM(s32, "code_13870_len_6980", make_npcs);
void make_npcs(s8 flags, s8 mapID, s32* NpcGroupList) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
s32 i;
s32 j;
currentEncounter->resetMapEncounterFlags = flags;
currentEncounter->mapID = mapID;
currentEncounter->npcGroupList = NpcGroupList;
if (gGameStatusPtr->changedArea != 0) {
for (i = 0; i < ARRAY_COUNT(currentEncounter->defeatFlags); i++) {
for (j = 0; j < ARRAY_COUNT(currentEncounter->defeatFlags[i]); j++) {
currentEncounter->defeatFlags[i][j] = 0;
}
}
if (gGameStatusPtr->changedArea != 0) {
for (i = 0; i < ARRAY_COUNT(currentEncounter->recentMaps); i++) {
currentEncounter->recentMaps[i] = -1;
}
}
}
if (NpcGroupList != NULL) {
gGameState = 1;
D_8009A678 = 1;
D_8009A5D0 = 0;
}
}
INCLUDE_ASM(s32, "code_13870_len_6980", kill_encounter);

View File

@ -1,9 +1,6 @@
#include "common.h"
#include "map.h"
extern s32 D_8009A5D0;
extern s32 D_8009A678;
s32 get_defeated(s32 mapID, s32 encounterID) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
s32 encounterIdx = encounterID / 32;
@ -228,10 +225,10 @@ INCLUDE_ASM(s32, "code_1a1f0_len_5390", update_encounters_post_battle);
s32 draw_encounters_post_battle(void) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
s32 ret = currentEncounter->unk_98;
s32 ret = currentEncounter->fadeOutAccel;
if (ret != 0) {
set_transition_stencil_zoom_0(0, currentEncounter->unk_90);
set_transition_stencil_zoom_0(0, currentEncounter->fadeOutAmount);
ret = set_transition_stencil_color(0, 0, 0, 0);
}

View File

@ -73,7 +73,7 @@ s32 func_80048F0C(void) {
s32 j;
for (i = 0; i < currentEncounter->numEncounters; i++) {
Encounter* encounter = currentEncounter->enounterList[i];
Encounter* encounter = currentEncounter->encounterList[i];
if (encounter != NULL) {
for (j = 0; j < encounter->count; j++) {

View File

@ -31,7 +31,7 @@ ApiStatus N(func_802408B4_97BEE4)(ScriptInstance* script, s32 isInitialCall) {
}
if (npc->flags & 0x1000) {
currentEncounter->enounterList[enemy->encounterIndex]->battle = enemy->varTable[0];
currentEncounter->encounterList[enemy->encounterIndex]->battle = enemy->varTable[0];
return ApiStatus_DONE2;
}

View File

@ -1,27 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel COPY_set_defeated
/* 196E0 8003E2E0 0080182D */ daddu $v1, $a0, $zero
/* 196E4 8003E2E4 00A0102D */ daddu $v0, $a1, $zero
/* 196E8 8003E2E8 04410002 */ bgez $v0, .L8003E2F4
/* 196EC 8003E2EC 0040202D */ daddu $a0, $v0, $zero
/* 196F0 8003E2F0 2444001F */ addiu $a0, $v0, 0x1f
.L8003E2F4:
/* 196F4 8003E2F4 00042143 */ sra $a0, $a0, 5
/* 196F8 8003E2F8 00042940 */ sll $a1, $a0, 5
/* 196FC 8003E2FC 00452823 */ subu $a1, $v0, $a1
/* 19700 8003E300 00042080 */ sll $a0, $a0, 2
/* 19704 8003E304 00031040 */ sll $v0, $v1, 1
/* 19708 8003E308 00431021 */ addu $v0, $v0, $v1
/* 1970C 8003E30C 00021100 */ sll $v0, $v0, 4
/* 19710 8003E310 00822021 */ addu $a0, $a0, $v0
/* 19714 8003E314 3C02800B */ lui $v0, %hi(gCurrentEncounter)
/* 19718 8003E318 24420F10 */ addiu $v0, $v0, %lo(gCurrentEncounter)
/* 1971C 8003E31C 00822021 */ addu $a0, $a0, $v0
/* 19720 8003E320 24030001 */ addiu $v1, $zero, 1
/* 19724 8003E324 8C8200B0 */ lw $v0, 0xb0($a0)
/* 19728 8003E328 00A31804 */ sllv $v1, $v1, $a1
/* 1972C 8003E32C 00431025 */ or $v0, $v0, $v1
/* 19730 8003E330 03E00008 */ jr $ra
/* 19734 8003E334 AC8200B0 */ sw $v0, 0xb0($a0)

View File

@ -1,76 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel clear_encounter_status
/* 19800 8003E400 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 19804 8003E404 AFBF0010 */ sw $ra, 0x10($sp)
/* 19808 8003E408 24050017 */ addiu $a1, $zero, 0x17
/* 1980C 8003E40C 3C07800B */ lui $a3, %hi(gCurrentEncounter)
/* 19810 8003E410 24E70F10 */ addiu $a3, $a3, %lo(gCurrentEncounter)
/* 19814 8003E414 24E2005C */ addiu $v0, $a3, 0x5c
.L8003E418:
/* 19818 8003E418 AC400028 */ sw $zero, 0x28($v0)
/* 1981C 8003E41C 24A5FFFF */ addiu $a1, $a1, -1
/* 19820 8003E420 04A1FFFD */ bgez $a1, .L8003E418
/* 19824 8003E424 2442FFFC */ addiu $v0, $v0, -4
/* 19828 8003E428 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 1982C 8003E42C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 19830 8003E430 8442008A */ lh $v0, 0x8a($v0)
/* 19834 8003E434 10400019 */ beqz $v0, .L8003E49C
/* 19838 8003E438 0000282D */ daddu $a1, $zero, $zero
/* 1983C 8003E43C 00A0302D */ daddu $a2, $a1, $zero
.L8003E440:
/* 19840 8003E440 0000202D */ daddu $a0, $zero, $zero
/* 19844 8003E444 00C0182D */ daddu $v1, $a2, $zero
.L8003E448:
/* 19848 8003E448 00E31021 */ addu $v0, $a3, $v1
/* 1984C 8003E44C AC4000B0 */ sw $zero, 0xb0($v0)
/* 19850 8003E450 24840001 */ addiu $a0, $a0, 1
/* 19854 8003E454 2882000C */ slti $v0, $a0, 0xc
/* 19858 8003E458 1440FFFB */ bnez $v0, .L8003E448
/* 1985C 8003E45C 24630004 */ addiu $v1, $v1, 4
/* 19860 8003E460 24A50001 */ addiu $a1, $a1, 1
/* 19864 8003E464 28A2003C */ slti $v0, $a1, 0x3c
/* 19868 8003E468 1440FFF5 */ bnez $v0, .L8003E440
/* 1986C 8003E46C 24C60030 */ addiu $a2, $a2, 0x30
/* 19870 8003E470 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 19874 8003E474 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 19878 8003E478 8442008A */ lh $v0, 0x8a($v0)
/* 1987C 8003E47C 10400007 */ beqz $v0, .L8003E49C
/* 19880 8003E480 2403FFFF */ addiu $v1, $zero, -1
/* 19884 8003E484 24050001 */ addiu $a1, $zero, 1
/* 19888 8003E488 24E20002 */ addiu $v0, $a3, 2
.L8003E48C:
/* 1988C 8003E48C A4430BF0 */ sh $v1, 0xbf0($v0)
/* 19890 8003E490 24A5FFFF */ addiu $a1, $a1, -1
/* 19894 8003E494 04A1FFFD */ bgez $a1, .L8003E48C
/* 19898 8003E498 2442FFFE */ addiu $v0, $v0, -2
.L8003E49C:
/* 1989C 8003E49C 3C048007 */ lui $a0, %hi(gGameStatusPtr)
/* 198A0 8003E4A0 2484419C */ addiu $a0, $a0, %lo(gGameStatusPtr)
/* 198A4 8003E4A4 8C820000 */ lw $v0, ($a0)
/* 198A8 8003E4A8 A0E0001C */ sb $zero, 0x1c($a3)
/* 198AC 8003E4AC A0E00004 */ sb $zero, 4($a3)
/* 198B0 8003E4B0 A0E00005 */ sb $zero, 5($a3)
/* 198B4 8003E4B4 A0E0000A */ sb $zero, 0xa($a3)
/* 198B8 8003E4B8 8C830000 */ lw $v1, ($a0)
/* 198BC 8003E4BC 90420087 */ lbu $v0, 0x87($v0)
/* 198C0 8003E4C0 A0E2001D */ sb $v0, 0x1d($a3)
/* 198C4 8003E4C4 9062008D */ lbu $v0, 0x8d($v1)
/* 198C8 8003E4C8 8C830000 */ lw $v1, ($a0)
/* 198CC 8003E4CC A0E2001E */ sb $v0, 0x1e($a3)
/* 198D0 8003E4D0 9062008F */ lbu $v0, 0x8f($v1)
/* 198D4 8003E4D4 ACE00024 */ sw $zero, 0x24($a3)
/* 198D8 8003E4D8 A0E00008 */ sb $zero, 8($a3)
/* 198DC 8003E4DC A0E00012 */ sb $zero, 0x12($a3)
/* 198E0 8003E4E0 0C0116B0 */ jal func_80045AC0
/* 198E4 8003E4E4 A0E2001F */ sb $v0, 0x1f($a3)
/* 198E8 8003E4E8 3C058004 */ lui $a1, %hi(func_8003E670)
/* 198EC 8003E4EC 24A5E670 */ addiu $a1, $a1, %lo(func_8003E670)
/* 198F0 8003E4F0 3C01800A */ lui $at, %hi(gGameState)
/* 198F4 8003E4F4 AC20A600 */ sw $zero, %lo(gGameState)($at)
/* 198F8 8003E4F8 0C048C56 */ jal bind_dynamic_entity_3
/* 198FC 8003E4FC 0000202D */ daddu $a0, $zero, $zero
/* 19900 8003E500 8FBF0010 */ lw $ra, 0x10($sp)
/* 19904 8003E504 03E00008 */ jr $ra
/* 19908 8003E508 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,52 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel jtbl_800985D8
.word L8003E628_19A28, L8003E5E0_199E0, L8003E5F0_199F0, L8003E600_19A00, L8003E610_19A10, L8003E620_19A20
.section .text
glabel draw_encounter_ui
/* 199B0 8003E5B0 3C03800A */ lui $v1, %hi(gGameState)
/* 199B4 8003E5B4 8C63A600 */ lw $v1, %lo(gGameState)($v1)
/* 199B8 8003E5B8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 199BC 8003E5BC 2C620006 */ sltiu $v0, $v1, 6
/* 199C0 8003E5C0 10400019 */ beqz $v0, L8003E628_19A28
/* 199C4 8003E5C4 AFBF0010 */ sw $ra, 0x10($sp)
/* 199C8 8003E5C8 00031080 */ sll $v0, $v1, 2
/* 199CC 8003E5CC 3C01800A */ lui $at, %hi(jtbl_800985D8)
/* 199D0 8003E5D0 00220821 */ addu $at, $at, $v0
/* 199D4 8003E5D4 8C2285D8 */ lw $v0, %lo(jtbl_800985D8)($at)
/* 199D8 8003E5D8 00400008 */ jr $v0
/* 199DC 8003E5DC 00000000 */ nop
glabel L8003E5E0_199E0
/* 199E0 8003E5E0 0C011050 */ jal init_encounters_ui
/* 199E4 8003E5E4 00000000 */ nop
/* 199E8 8003E5E8 0800F98A */ j L8003E628_19A28
/* 199EC 8003E5EC 00000000 */ nop
glabel L8003E5F0_199F0
/* 199F0 8003E5F0 0C0104D7 */ jal draw_encounters_neutral
/* 199F4 8003E5F4 00000000 */ nop
/* 199F8 8003E5F8 0800F98A */ j L8003E628_19A28
/* 199FC 8003E5FC 00000000 */ nop
glabel L8003E600_19A00
/* 19A00 8003E600 0C010659 */ jal draw_encounters_pre_battle
/* 19A04 8003E604 00000000 */ nop
/* 19A08 8003E608 0800F98A */ j L8003E628_19A28
/* 19A0C 8003E60C 00000000 */ nop
glabel L8003E610_19A10
/* 19A10 8003E610 0C010C75 */ jal draw_encounters_conversation
/* 19A14 8003E614 00000000 */ nop
/* 19A18 8003E618 0800F98A */ j L8003E628_19A28
/* 19A1C 8003E61C 00000000 */ nop
glabel L8003E620_19A20
/* 19A20 8003E620 0C010C13 */ jal draw_encounters_post_battle
/* 19A24 8003E624 00000000 */ nop
glabel L8003E628_19A28
/* 19A28 8003E628 0C01170A */ jal draw_merlee_messages
/* 19A2C 8003E62C 00000000 */ nop
/* 19A30 8003E630 8FBF0010 */ lw $ra, 0x10($sp)
/* 19A34 8003E634 03E00008 */ jr $ra
/* 19A38 8003E638 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel draw_first_strike_ui
/* 19A3C 8003E63C 3C03800A */ lui $v1, %hi(gGameState)
/* 19A40 8003E640 8C63A600 */ lw $v1, %lo(gGameState)($v1)
/* 19A44 8003E644 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 19A48 8003E648 10600006 */ beqz $v1, .L8003E664
/* 19A4C 8003E64C AFBF0010 */ sw $ra, 0x10($sp)
/* 19A50 8003E650 24020003 */ addiu $v0, $zero, 3
/* 19A54 8003E654 14620003 */ bne $v1, $v0, .L8003E664
/* 19A58 8003E658 00000000 */ nop
/* 19A5C 8003E65C 0C010717 */ jal show_first_strike_message
/* 19A60 8003E660 00000000 */ nop
.L8003E664:
/* 19A64 8003E664 8FBF0010 */ lw $ra, 0x10($sp)
/* 19A68 8003E668 03E00008 */ jr $ra
/* 19A6C 8003E66C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003E514
/* 19914 8003E514 3C01800B */ lui $at, %hi(gCurrentEncounter+0x8)
/* 19918 8003E518 A0240F18 */ sb $a0, %lo(gCurrentEncounter+0x8)($at)
/* 1991C 8003E51C 03E00008 */ jr $ra
/* 19920 8003E520 00000000 */ nop

View File

@ -1,55 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel make_npcs
/* 19A78 8003E678 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 19A7C 8003E67C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 19A80 8003E680 3C08800B */ lui $t0, %hi(gCurrentEncounter)
/* 19A84 8003E684 25080F10 */ addiu $t0, $t0, %lo(gCurrentEncounter)
/* 19A88 8003E688 A1040021 */ sb $a0, 0x21($t0)
/* 19A8C 8003E68C A1050020 */ sb $a1, 0x20($t0)
/* 19A90 8003E690 AD060024 */ sw $a2, 0x24($t0)
/* 19A94 8003E694 8442008A */ lh $v0, 0x8a($v0)
/* 19A98 8003E698 1040001B */ beqz $v0, .L8003E708
/* 19A9C 8003E69C 00000000 */ nop
/* 19AA0 8003E6A0 0000282D */ daddu $a1, $zero, $zero
/* 19AA4 8003E6A4 00A0382D */ daddu $a3, $a1, $zero
.L8003E6A8:
/* 19AA8 8003E6A8 0000202D */ daddu $a0, $zero, $zero
/* 19AAC 8003E6AC 00E0182D */ daddu $v1, $a3, $zero
.L8003E6B0:
/* 19AB0 8003E6B0 01031021 */ addu $v0, $t0, $v1
/* 19AB4 8003E6B4 AC4000B0 */ sw $zero, 0xb0($v0)
/* 19AB8 8003E6B8 24840001 */ addiu $a0, $a0, 1
/* 19ABC 8003E6BC 2882000C */ slti $v0, $a0, 0xc
/* 19AC0 8003E6C0 1440FFFB */ bnez $v0, .L8003E6B0
/* 19AC4 8003E6C4 24630004 */ addiu $v1, $v1, 4
/* 19AC8 8003E6C8 24A50001 */ addiu $a1, $a1, 1
/* 19ACC 8003E6CC 28A2003C */ slti $v0, $a1, 0x3c
/* 19AD0 8003E6D0 1440FFF5 */ bnez $v0, .L8003E6A8
/* 19AD4 8003E6D4 24E70030 */ addiu $a3, $a3, 0x30
/* 19AD8 8003E6D8 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 19ADC 8003E6DC 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 19AE0 8003E6E0 8442008A */ lh $v0, 0x8a($v0)
/* 19AE4 8003E6E4 10400008 */ beqz $v0, .L8003E708
/* 19AE8 8003E6E8 00000000 */ nop
/* 19AEC 8003E6EC 2403FFFF */ addiu $v1, $zero, -1
/* 19AF0 8003E6F0 24050001 */ addiu $a1, $zero, 1
/* 19AF4 8003E6F4 25020002 */ addiu $v0, $t0, 2
.L8003E6F8:
/* 19AF8 8003E6F8 A4430BF0 */ sh $v1, 0xbf0($v0)
/* 19AFC 8003E6FC 24A5FFFF */ addiu $a1, $a1, -1
/* 19B00 8003E700 04A1FFFD */ bgez $a1, .L8003E6F8
/* 19B04 8003E704 2442FFFE */ addiu $v0, $v0, -2
.L8003E708:
/* 19B08 8003E708 10C00007 */ beqz $a2, .L8003E728
/* 19B0C 8003E70C 24020001 */ addiu $v0, $zero, 1
/* 19B10 8003E710 3C01800A */ lui $at, %hi(gGameState)
/* 19B14 8003E714 AC22A600 */ sw $v0, %lo(gGameState)($at)
/* 19B18 8003E718 3C01800A */ lui $at, %hi(D_8009A678)
/* 19B1C 8003E71C AC22A678 */ sw $v0, %lo(D_8009A678)($at)
/* 19B20 8003E720 3C01800A */ lui $at, %hi(D_8009A5D0)
/* 19B24 8003E724 AC20A5D0 */ sw $zero, %lo(D_8009A5D0)($at)
.L8003E728:
/* 19B28 8003E728 03E00008 */ jr $ra
/* 19B2C 8003E72C 00000000 */ nop

View File

@ -1,52 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel jtbl_800985C0
.word L8003E59C_1999C, L8003E554_19954, L8003E564_19964, L8003E574_19974, L8003E584_19984, L8003E594_19994
.section .text
glabel update_counters
/* 19924 8003E524 3C03800A */ lui $v1, %hi(gGameState)
/* 19928 8003E528 8C63A600 */ lw $v1, %lo(gGameState)($v1)
/* 1992C 8003E52C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 19930 8003E530 2C620006 */ sltiu $v0, $v1, 6
/* 19934 8003E534 10400019 */ beqz $v0, L8003E59C_1999C
/* 19938 8003E538 AFBF0010 */ sw $ra, 0x10($sp)
/* 1993C 8003E53C 00031080 */ sll $v0, $v1, 2
/* 19940 8003E540 3C01800A */ lui $at, %hi(jtbl_800985C0)
/* 19944 8003E544 00220821 */ addu $at, $at, $v0
/* 19948 8003E548 8C2285C0 */ lw $v0, %lo(jtbl_800985C0)($at)
/* 1994C 8003E54C 00400008 */ jr $v0
/* 19950 8003E550 00000000 */ nop
glabel L8003E554_19954
/* 19954 8003E554 0C010DAC */ jal create_encounters
/* 19958 8003E558 00000000 */ nop
/* 1995C 8003E55C 0800F967 */ j L8003E59C_1999C
/* 19960 8003E560 00000000 */ nop
glabel L8003E564_19964
/* 19964 8003E564 0C00FDF3 */ jal update_encounters_neutral
/* 19968 8003E568 00000000 */ nop
/* 1996C 8003E56C 0800F967 */ j L8003E59C_1999C
/* 19970 8003E570 00000000 */ nop
glabel L8003E574_19974
/* 19974 8003E574 0C0104D9 */ jal update_encounters_pre_battle
/* 19978 8003E578 00000000 */ nop
/* 1997C 8003E57C 0800F967 */ j L8003E59C_1999C
/* 19980 8003E580 00000000 */ nop
glabel L8003E584_19984
/* 19984 8003E584 0C010C27 */ jal update_encounters_conversation
/* 19988 8003E588 00000000 */ nop
/* 1998C 8003E58C 0800F967 */ j L8003E59C_1999C
/* 19990 8003E590 00000000 */ nop
glabel L8003E594_19994
/* 19994 8003E594 0C0107C4 */ jal update_encounters_post_battle
/* 19998 8003E598 00000000 */ nop
glabel L8003E59C_1999C
/* 1999C 8003E59C 0C0116DA */ jal update_merlee_messages
/* 199A0 8003E5A0 00000000 */ nop
/* 199A4 8003E5A4 8FBF0010 */ lw $ra, 0x10($sp)
/* 199A8 8003E5A8 03E00008 */ jr $ra
/* 199AC 8003E5AC 27BD0018 */ addiu $sp, $sp, 0x18