This commit is contained in:
Ethan Roseman 2020-09-25 22:49:59 -04:00
parent 9878841eb8
commit 677ec4f4e5
16 changed files with 58 additions and 191 deletions

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetBattleOutcome
/* 1F97C 8004457C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1F980 80044580 AFBF0010 */ sw $ra, 0x10($sp)
/* 1F984 80044584 8C82000C */ lw $v0, 0xc($a0)
/* 1F988 80044588 3C06800B */ lui $a2, 0x800b
/* 1F98C 8004458C 80C60F19 */ lb $a2, 0xf19($a2)
/* 1F990 80044590 0C0B2026 */ jal set_variable
/* 1F994 80044594 8C450000 */ lw $a1, ($v0)
/* 1F998 80044598 8FBF0010 */ lw $ra, 0x10($sp)
/* 1F99C 8004459C 24020002 */ addiu $v0, $zero, 2
/* 1F9A0 800445A0 03E00008 */ jr $ra
/* 1F9A4 800445A4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,22 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800441F0
/* 1F5F0 800441F0 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1F5F4 800441F4 AFB00010 */ sw $s0, 0x10($sp)
/* 1F5F8 800441F8 0080802D */ daddu $s0, $a0, $zero
/* 1F5FC 800441FC AFBF0018 */ sw $ra, 0x18($sp)
/* 1F600 80044200 AFB10014 */ sw $s1, 0x14($sp)
/* 1F604 80044204 8E02000C */ lw $v0, 0xc($s0)
/* 1F608 80044208 0C011052 */ jal func_80044148
/* 1F60C 8004420C 8C510000 */ lw $s1, ($v0)
/* 1F610 80044210 0200202D */ daddu $a0, $s0, $zero
/* 1F614 80044214 0040302D */ daddu $a2, $v0, $zero
/* 1F618 80044218 0C0B2026 */ jal set_variable
/* 1F61C 8004421C 0220282D */ daddu $a1, $s1, $zero
/* 1F620 80044220 8FBF0018 */ lw $ra, 0x18($sp)
/* 1F624 80044224 8FB10014 */ lw $s1, 0x14($sp)
/* 1F628 80044228 8FB00010 */ lw $s0, 0x10($sp)
/* 1F62C 8004422C 24020002 */ addiu $v0, $zero, 2
/* 1F630 80044230 03E00008 */ jr $ra
/* 1F634 80044234 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80044238
/* 1F638 80044238 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1F63C 8004423C AFBF0010 */ sw $ra, 0x10($sp)
/* 1F640 80044240 8C82000C */ lw $v0, 0xc($a0)
/* 1F644 80044244 0C0B1EAF */ jal get_variable
/* 1F648 80044248 8C450000 */ lw $a1, ($v0)
/* 1F64C 8004424C 0C01CAF3 */ jal func_80072BCC
/* 1F650 80044250 0040202D */ daddu $a0, $v0, $zero
/* 1F654 80044254 8FBF0010 */ lw $ra, 0x10($sp)
/* 1F658 80044258 24020002 */ addiu $v0, $zero, 2
/* 1F65C 8004425C 03E00008 */ jr $ra
/* 1F660 80044260 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800445A8
/* 1F9A8 800445A8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1F9AC 800445AC AFBF0010 */ sw $ra, 0x10($sp)
/* 1F9B0 800445B0 8C82000C */ lw $v0, 0xc($a0)
/* 1F9B4 800445B4 8C830148 */ lw $v1, 0x148($a0)
/* 1F9B8 800445B8 8C450000 */ lw $a1, ($v0)
/* 1F9BC 800445BC 0C0B2026 */ jal set_variable
/* 1F9C0 800445C0 8C6600C4 */ lw $a2, 0xc4($v1)
/* 1F9C4 800445C4 8FBF0010 */ lw $ra, 0x10($sp)
/* 1F9C8 800445C8 24020002 */ addiu $v0, $zero, 2
/* 1F9CC 800445CC 03E00008 */ jr $ra
/* 1F9D0 800445D0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800445D4
/* 1F9D4 800445D4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1F9D8 800445D8 AFBF0010 */ sw $ra, 0x10($sp)
/* 1F9DC 800445DC 8C82000C */ lw $v0, 0xc($a0)
/* 1F9E0 800445E0 8C830148 */ lw $v1, 0x148($a0)
/* 1F9E4 800445E4 8C450000 */ lw $a1, ($v0)
/* 1F9E8 800445E8 0C0B2026 */ jal set_variable
/* 1F9EC 800445EC 8C6600C8 */ lw $a2, 0xc8($v1)
/* 1F9F0 800445F0 8FBF0010 */ lw $ra, 0x10($sp)
/* 1F9F4 800445F4 24020002 */ addiu $v0, $zero, 2
/* 1F9F8 800445F8 03E00008 */ jr $ra
/* 1F9FC 800445FC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,6 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8004572C
/* 20B2C 8004572C 03E00008 */ jr $ra
/* 20B30 80045730 24020002 */ addiu $v0, $zero, 2

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80045798
/* 20B98 80045798 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 20B9C 8004579C AFBF0010 */ sw $ra, 0x10($sp)
/* 20BA0 800457A0 8C82000C */ lw $v0, 0xc($a0)
/* 20BA4 800457A4 0C0B1EAF */ jal get_variable
/* 20BA8 800457A8 8C450000 */ lw $a1, ($v0)
/* 20BAC 800457AC 8FBF0010 */ lw $ra, 0x10($sp)
/* 20BB0 800457B0 3C018011 */ lui $at, 0x8011
/* 20BB4 800457B4 AC22EF08 */ sw $v0, -0x10f8($at)
/* 20BB8 800457B8 24020002 */ addiu $v0, $zero, 2
/* 20BBC 800457BC 03E00008 */ jr $ra
/* 20BC0 800457C0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800457C4
/* 20BC4 800457C4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 20BC8 800457C8 AFBF0014 */ sw $ra, 0x14($sp)
/* 20BCC 800457CC AFB00010 */ sw $s0, 0x10($sp)
/* 20BD0 800457D0 8C82000C */ lw $v0, 0xc($a0)
/* 20BD4 800457D4 8C450000 */ lw $a1, ($v0)
/* 20BD8 800457D8 0C0B1EAF */ jal get_variable
/* 20BDC 800457DC 8C900148 */ lw $s0, 0x148($a0)
/* 20BE0 800457E0 A20200B5 */ sb $v0, 0xb5($s0)
/* 20BE4 800457E4 8FBF0014 */ lw $ra, 0x14($sp)
/* 20BE8 800457E8 8FB00010 */ lw $s0, 0x10($sp)
/* 20BEC 800457EC 24020002 */ addiu $v0, $zero, 2
/* 20BF0 800457F0 03E00008 */ jr $ra
/* 20BF4 800457F4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,9 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800457F8
/* 20BF8 800457F8 24020001 */ addiu $v0, $zero, 1
/* 20BFC 800457FC 3C01800B */ lui $at, 0x800b
/* 20C00 80045800 A0220F22 */ sb $v0, 0xf22($at)
/* 20C04 80045804 03E00008 */ jr $ra
/* 20C08 80045808 24020002 */ addiu $v0, $zero, 2

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8004580C
/* 20C0C 8004580C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 20C10 80045810 AFBF0010 */ sw $ra, 0x10($sp)
/* 20C14 80045814 8C82000C */ lw $v0, 0xc($a0)
/* 20C18 80045818 3C06800B */ lui $a2, 0x800b
/* 20C1C 8004581C 80C60F16 */ lb $a2, 0xf16($a2)
/* 20C20 80045820 0C0B2026 */ jal set_variable
/* 20C24 80045824 8C450000 */ lw $a1, ($v0)
/* 20C28 80045828 8FBF0010 */ lw $ra, 0x10($sp)
/* 20C2C 8004582C 24020002 */ addiu $v0, $zero, 2
/* 20C30 80045830 03E00008 */ jr $ra
/* 20C34 80045834 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800458CC
/* 20CCC 800458CC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 20CD0 800458D0 AFBF0010 */ sw $ra, 0x10($sp)
/* 20CD4 800458D4 8C820148 */ lw $v0, 0x148($a0)
/* 20CD8 800458D8 8C420018 */ lw $v0, 0x18($v0)
/* 20CDC 800458DC 8C83000C */ lw $v1, 0xc($a0)
/* 20CE0 800458E0 9446002A */ lhu $a2, 0x2a($v0)
/* 20CE4 800458E4 8C650000 */ lw $a1, ($v1)
/* 20CE8 800458E8 0C0B2026 */ jal set_variable
/* 20CEC 800458EC 30C60008 */ andi $a2, $a2, 8
/* 20CF0 800458F0 8FBF0010 */ lw $ra, 0x10($sp)
/* 20CF4 800458F4 24020002 */ addiu $v0, $zero, 2
/* 20CF8 800458F8 03E00008 */ jr $ra
/* 20CFC 800458FC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -197,9 +197,13 @@ typedef struct Enemy {
/* 0x60 */ s32 defeatScriptID; /* 0x60 */ s32 defeatScriptID;
/* 0x64 */ char unk_64[8]; /* 0x64 */ char unk_64[8];
/* 0x6C */ s32 varTable[16]; /* 0x6C */ s32 varTable[16];
/* 0xAC */ char unk_AC[12]; /* 0xAC */ char unk_AC[9];
/* 0xB5 */ s8 unk_B5;
/* 0xB6 */ char unk_B6[2];
/* 0xB8 */ s32 unkSettings24; /* 0xB8 */ s32 unkSettings24;
/* 0xBC */ char unk_BC[16]; /* 0xBC */ char unk_BC[8];
/* 0xC4 */ s32 unk_C4;
/* 0xC8 */ s32 unk_C8;
/* 0xCC */ UNK_PTR animList; /* 0xCC */ UNK_PTR animList;
/* 0xD0 */ UNK_PTR territoryData; /* 0xD0 */ UNK_PTR territoryData;
/* 0xD4 */ UNK_PTR dropTables; /* 0xD4 */ UNK_PTR dropTables;
@ -1406,9 +1410,9 @@ typedef struct EncounterStatus {
/* 0x00 */ s32 flags; /* 0x00 */ s32 flags;
/* 0x04 */ u8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */ /* 0x04 */ u8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */
/* 0x05 */ s8 hitType; /* 1 = none/enemy, 2 = jump */ /* 0x05 */ s8 hitType; /* 1 = none/enemy, 2 = jump */
/* 0x06 */ u8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */ /* 0x06 */ s8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */
/* 0x07 */ char unk_07[2]; /* 0x07 */ char unk_07[2];
/* 0x09 */ u8 battleOutcome; /* 0 = won, 1 = lost */ /* 0x09 */ s8 battleOutcome; /* 0 = won, 1 = lost */
/* 0x0A */ char unk_0A; /* 0x0A */ char unk_0A;
/* 0x0B */ u8 merleeCoinBonus; /* triple coins when != 0 */ /* 0x0B */ u8 merleeCoinBonus; /* triple coins when != 0 */
/* 0x0C */ u8 damageTaken; /* valid after battle */ /* 0x0C */ u8 damageTaken; /* valid after battle */
@ -1416,7 +1420,7 @@ typedef struct EncounterStatus {
/* 0x0E */ s16 coinsEarned; /* valid after battle */ /* 0x0E */ s16 coinsEarned; /* valid after battle */
/* 0x10 */ char unk_10; /* 0x10 */ char unk_10;
/* 0x11 */ u8 allowFleeing; /* 0x11 */ u8 allowFleeing;
/* 0x12 */ char unk_12; /* 0x12 */ s8 unk_12;
/* 0x13 */ u8 dropWhackaBump; /* 0x13 */ u8 dropWhackaBump;
/* 0x14 */ s32 songID; /* 0x14 */ s32 songID;
/* 0x18 */ s32 unk_18; /* 0x18 */ s32 unk_18;

View File

@ -66,6 +66,7 @@ extern s16* D_80151328;
extern s16 D_8010CD10; extern s16 D_8010CD10;
extern s16 D_8010CD12; extern s16 D_8010CD12;
extern s32 D_8010CD20; extern s32 D_8010CD20;
extern s32 D_8010EF08;
extern s32 D_8010F094; // player shadow index? extern s32 D_8010F094; // player shadow index?
extern s32 D_801595A0; extern s32 D_801595A0;
extern s16 D_80159AE2; extern s16 D_80159AE2;

View File

@ -2,16 +2,23 @@
INCLUDE_ASM(s32, "code_1f580_len_1940", SetEncounterStatusFlags, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_1f580_len_1940", SetEncounterStatusFlags, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800441F0); ApiStatus func_800441F0(ScriptInstance* script, s32 isInitialCall) {
Bytecode arg1 = *script->ptrReadPos;
INCLUDE_ASM(s32, "code_1f580_len_1940", func_80044238); set_variable(script, arg1, func_80044148());
return ApiStatus_DONE2;
}
ApiStatus func_80044238(ScriptInstance* script, s32 isInitialCall) {
func_80072BCC(get_variable(script, *script->ptrReadPos));
return ApiStatus_DONE2;
}
ApiStatus LoadDemoBattle(ScriptInstance* script, s32 isInitialCall) { ApiStatus LoadDemoBattle(ScriptInstance* script, s32 isInitialCall) {
load_demo_battle(get_variable(script, *script->ptrReadPos)); load_demo_battle(get_variable(script, *script->ptrReadPos));
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
// ???
ApiStatus func_80044290(ScriptInstance* script, s32 isInitialCall) { ApiStatus func_80044290(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -22,11 +29,20 @@ INCLUDE_ASM(s32, "code_1f580_len_1940", RemoveNpc, ScriptInstance* script, s32 i
INCLUDE_ASM(s32, "code_1f580_len_1940", RemoveEncounter, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_1f580_len_1940", RemoveEncounter, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", GetBattleOutcome, ScriptInstance* script, s32 isInitialCall); ApiStatus GetBattleOutcome(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, gCurrentEncounter.battleOutcome);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800445A8); ApiStatus func_800445A8(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, script->ownerActorID->unk_C4);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800445D4); ApiStatus func_800445D4(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, script->ownerActorID->unk_C8);
return ApiStatus_DONE2;
}
ApiStatus GetOwnerEncounterTrigger(ScriptInstance* script, s32 isInitialCall) { ApiStatus GetOwnerEncounterTrigger(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, script->ownerActorID->encountered); set_variable(script, *script->ptrReadPos, script->ownerActorID->encountered);
@ -109,21 +125,40 @@ INCLUDE_ASM(s32, "code_1f580_len_1940", ClearDefeatedEnemies, ScriptInstance* sc
INCLUDE_ASM(s32, "code_1f580_len_1940", SetEnemyFlagBits, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_1f580_len_1940", SetEnemyFlagBits, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_8004572C); ApiStatus func_8004572C(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1f580_len_1940", GetSelfAnimationFromTable, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_1f580_len_1940", GetSelfAnimationFromTable, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045798); ApiStatus func_80045798(ScriptInstance* script, s32 isInitialCall) {
D_8010EF08 = get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800457C4); ApiStatus func_800457C4(ScriptInstance* script, s32 isInitialCall) {
Enemy* ownerActor = script->ownerActorID;
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800457F8); ownerActor->unk_B5 = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(s32, "code_1f580_len_1940", func_8004580C); ApiStatus func_800457F8(ScriptInstance* script, s32 isInitialCall) {
gCurrentEncounter.unk_12 = 1;
return ApiStatus_DONE2;
}
ApiStatus func_8004580C(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, gCurrentEncounter.hitTier);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045838); INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045838);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800458CC); ApiStatus func_800458CC(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, script->ownerActorID->npcSettings->unkFlags & 8);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045900); INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045900);

View File

@ -25,19 +25,6 @@ INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowMessageAtScreenPos, ScriptInstance*
INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowMessageAtWorldPos, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowMessageAtWorldPos, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_f4c60_len_4300", CloseMessage, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_f4c60_len_4300", CloseMessage, ScriptInstance* script, s32 isInitialCall);
/*s32 CloseMessage(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall) {
close_message(gCurrentPrintContext);
}
if (!(gCurrentPrintContext->stateFlags & 0x40)) {
if (D_802DB264 == 1) {
script->varTable[0] = gCurrentPrintContext->unk_4E8;
}
return 0;
}
return 1;
}*/
INCLUDE_ASM(s32, "code_f4c60_len_4300", SwitchMessage, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_f4c60_len_4300", SwitchMessage, ScriptInstance* script, s32 isInitialCall);

View File

@ -28,6 +28,7 @@ D_800A0944 = 0x800A0944;
D_8010CD10 = 0x8010CD10; D_8010CD10 = 0x8010CD10;
D_8010CD12 = 0x8010CD12; D_8010CD12 = 0x8010CD12;
D_8010CD20 = 0x8010CD20; D_8010CD20 = 0x8010CD20;
D_8010EF08 = 0x8010EF08;
D_8010F094 = 0x8010F094; D_8010F094 = 0x8010F094;
gBattleStatus = 0x800DC070; gBattleStatus = 0x800DC070;