This commit is contained in:
brotenko@gmail.com 2021-02-13 17:46:09 +01:00
parent 709921c859
commit ecbf45bcbb
11 changed files with 41 additions and 239 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A1000_752450
/* 752450 802A1000 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 752454 802A1004 AFB00010 */ sw $s0, 0x10($sp)
/* 752458 802A1008 0080802D */ daddu $s0, $a0, $zero
/* 75245C 802A100C 2402000F */ addiu $v0, $zero, 0xf
/* 752460 802A1010 3C03800E */ lui $v1, %hi(gBattleStatus+0x83)
/* 752464 802A1014 8063C0F3 */ lb $v1, %lo(gBattleStatus+0x83)($v1)
/* 752468 802A1018 24040015 */ addiu $a0, $zero, 0x15
/* 75246C 802A101C AFBF0014 */ sw $ra, 0x14($sp)
/* 752470 802A1020 AE020088 */ sw $v0, 0x88($s0)
/* 752474 802A1024 0C03A752 */ jal is_ability_active
/* 752478 802A1028 AE030084 */ sw $v1, 0x84($s0)
/* 75247C 802A102C 10400003 */ beqz $v0, .L802A103C
/* 752480 802A1030 24020028 */ addiu $v0, $zero, 0x28
/* 752484 802A1034 AE000084 */ sw $zero, 0x84($s0)
/* 752488 802A1038 AE020088 */ sw $v0, 0x88($s0)
.L802A103C:
/* 75248C 802A103C 8FBF0014 */ lw $ra, 0x14($sp)
/* 752490 802A1040 8FB00010 */ lw $s0, 0x10($sp)
/* 752494 802A1044 24020002 */ addiu $v0, $zero, 2
/* 752498 802A1048 03E00008 */ jr $ra
/* 75249C 802A104C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,26 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A1050_7524A0
/* 7524A0 802A1050 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 7524A4 802A1054 AFB00010 */ sw $s0, 0x10($sp)
/* 7524A8 802A1058 0080802D */ daddu $s0, $a0, $zero
/* 7524AC 802A105C 24040016 */ addiu $a0, $zero, 0x16
/* 7524B0 802A1060 AFBF0014 */ sw $ra, 0x14($sp)
/* 7524B4 802A1064 0C03A752 */ jal is_ability_active
/* 7524B8 802A1068 AE000084 */ sw $zero, 0x84($s0)
/* 7524BC 802A106C 10400002 */ beqz $v0, .L802A1078
/* 7524C0 802A1070 24020001 */ addiu $v0, $zero, 1
/* 7524C4 802A1074 AE020084 */ sw $v0, 0x84($s0)
.L802A1078:
/* 7524C8 802A1078 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 7524CC 802A107C 8C42C070 */ lw $v0, %lo(gBattleStatus)($v0)
/* 7524D0 802A1080 30421000 */ andi $v0, $v0, 0x1000
/* 7524D4 802A1084 10400002 */ beqz $v0, .L802A1090
/* 7524D8 802A1088 24020001 */ addiu $v0, $zero, 1
/* 7524DC 802A108C AE020084 */ sw $v0, 0x84($s0)
.L802A1090:
/* 7524E0 802A1090 8FBF0014 */ lw $ra, 0x14($sp)
/* 7524E4 802A1094 8FB00010 */ lw $s0, 0x10($sp)
/* 7524E8 802A1098 24020002 */ addiu $v0, $zero, 2
/* 7524EC 802A109C 03E00008 */ jr $ra

View File

@ -1,65 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel EnemyFollowupAfflictTarget
/* 1AB7B4 8027CED4 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 1AB7B8 8027CED8 AFB20018 */ sw $s2, 0x18($sp)
/* 1AB7BC 8027CEDC 0080902D */ daddu $s2, $a0, $zero
/* 1AB7C0 8027CEE0 AFBF0020 */ sw $ra, 0x20($sp)
/* 1AB7C4 8027CEE4 AFB3001C */ sw $s3, 0x1c($sp)
/* 1AB7C8 8027CEE8 AFB10014 */ sw $s1, 0x14($sp)
/* 1AB7CC 8027CEEC AFB00010 */ sw $s0, 0x10($sp)
/* 1AB7D0 8027CEF0 8E50000C */ lw $s0, 0xc($s2)
/* 1AB7D4 8027CEF4 8E050000 */ lw $a1, ($s0)
/* 1AB7D8 8027CEF8 0C0B1EAF */ jal get_variable
/* 1AB7DC 8027CEFC 26100004 */ addiu $s0, $s0, 4
/* 1AB7E0 8027CF00 0040202D */ daddu $a0, $v0, $zero
/* 1AB7E4 8027CF04 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 1AB7E8 8027CF08 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 1AB7EC 8027CF0C 2402FF81 */ addiu $v0, $zero, -0x7f
/* 1AB7F0 8027CF10 14820002 */ bne $a0, $v0, .L8027CF1C
/* 1AB7F4 8027CF14 0220982D */ daddu $s3, $s1, $zero
/* 1AB7F8 8027CF18 8E440148 */ lw $a0, 0x148($s2)
.L8027CF1C:
/* 1AB7FC 8027CF1C 0C09A75B */ jal get_actor
/* 1AB800 8027CF20 00000000 */ nop
/* 1AB804 8027CF24 0040202D */ daddu $a0, $v0, $zero
/* 1AB808 8027CF28 94820428 */ lhu $v0, 0x428($a0)
/* 1AB80C 8027CF2C 8E100000 */ lw $s0, ($s0)
/* 1AB810 8027CF30 92230193 */ lbu $v1, 0x193($s1)
/* 1AB814 8027CF34 A62201A0 */ sh $v0, 0x1a0($s1)
/* 1AB818 8027CF38 90820426 */ lbu $v0, 0x426($a0)
/* 1AB81C 8027CF3C A2230194 */ sb $v1, 0x194($s1)
/* 1AB820 8027CF40 306300FF */ andi $v1, $v1, 0xff
/* 1AB824 8027CF44 A22201A2 */ sb $v0, 0x1a2($s1)
/* 1AB828 8027CF48 240200FF */ addiu $v0, $zero, 0xff
/* 1AB82C 8027CF4C 50620001 */ beql $v1, $v0, .L8027CF54
/* 1AB830 8027CF50 A2200194 */ sb $zero, 0x194($s1)
.L8027CF54:
/* 1AB834 8027CF54 8E620190 */ lw $v0, 0x190($s3)
/* 1AB838 8027CF58 30420F00 */ andi $v0, $v0, 0xf00
/* 1AB83C 8027CF5C 00021203 */ sra $v0, $v0, 8
/* 1AB840 8027CF60 0C09DD0B */ jal calc_enemy_damage_target
/* 1AB844 8027CF64 A2620195 */ sb $v0, 0x195($s3)
/* 1AB848 8027CF68 0440000B */ bltz $v0, .L8027CF98
/* 1AB84C 8027CF6C 0240202D */ daddu $a0, $s2, $zero
/* 1AB850 8027CF70 0200282D */ daddu $a1, $s0, $zero
/* 1AB854 8027CF74 0C0B2026 */ jal set_variable
/* 1AB858 8027CF78 0040302D */ daddu $a2, $v0, $zero
/* 1AB85C 8027CF7C 0C0B1069 */ jal does_script_exist_by_ref
/* 1AB860 8027CF80 0240202D */ daddu $a0, $s2, $zero
/* 1AB864 8027CF84 0040182D */ daddu $v1, $v0, $zero
/* 1AB868 8027CF88 10600004 */ beqz $v1, .L8027CF9C
/* 1AB86C 8027CF8C 240200FF */ addiu $v0, $zero, 0xff
/* 1AB870 8027CF90 0809F3E7 */ j .L8027CF9C
/* 1AB874 8027CF94 24020002 */ addiu $v0, $zero, 2
.L8027CF98:
/* 1AB878 8027CF98 240200FF */ addiu $v0, $zero, 0xff
.L8027CF9C:
/* 1AB87C 8027CF9C 8FBF0020 */ lw $ra, 0x20($sp)
/* 1AB880 8027CFA0 8FB3001C */ lw $s3, 0x1c($sp)
/* 1AB884 8027CFA4 8FB20018 */ lw $s2, 0x18($sp)
/* 1AB888 8027CFA8 8FB10014 */ lw $s1, 0x14($sp)
/* 1AB88C 8027CFAC 8FB00010 */ lw $s0, 0x10($sp)
/* 1AB890 8027CFB0 03E00008 */ jr $ra
/* 1AB894 8027CFB4 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,51 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetActorHP
/* 1AAF80 8027C6A0 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1AAF84 8027C6A4 AFB20018 */ sw $s2, 0x18($sp)
/* 1AAF88 8027C6A8 0080902D */ daddu $s2, $a0, $zero
/* 1AAF8C 8027C6AC AFBF001C */ sw $ra, 0x1c($sp)
/* 1AAF90 8027C6B0 AFB10014 */ sw $s1, 0x14($sp)
/* 1AAF94 8027C6B4 AFB00010 */ sw $s0, 0x10($sp)
/* 1AAF98 8027C6B8 8E51000C */ lw $s1, 0xc($s2)
/* 1AAF9C 8027C6BC 8E250000 */ lw $a1, ($s1)
/* 1AAFA0 8027C6C0 0C0B1EAF */ jal get_variable
/* 1AAFA4 8027C6C4 26310004 */ addiu $s1, $s1, 4
/* 1AAFA8 8027C6C8 0040802D */ daddu $s0, $v0, $zero
/* 1AAFAC 8027C6CC 2402FF81 */ addiu $v0, $zero, -0x7f
/* 1AAFB0 8027C6D0 16020002 */ bne $s0, $v0, .L8027C6DC
/* 1AAFB4 8027C6D4 00000000 */ nop
/* 1AAFB8 8027C6D8 8E500148 */ lw $s0, 0x148($s2)
.L8027C6DC:
/* 1AAFBC 8027C6DC 8E310000 */ lw $s1, ($s1)
/* 1AAFC0 8027C6E0 0C09A75B */ jal get_actor
/* 1AAFC4 8027C6E4 0200202D */ daddu $a0, $s0, $zero
/* 1AAFC8 8027C6E8 32040700 */ andi $a0, $s0, 0x700
/* 1AAFCC 8027C6EC 10800006 */ beqz $a0, .L8027C708
/* 1AAFD0 8027C6F0 0040302D */ daddu $a2, $v0, $zero
/* 1AAFD4 8027C6F4 24020100 */ addiu $v0, $zero, 0x100
/* 1AAFD8 8027C6F8 50820009 */ beql $a0, $v0, .L8027C720
/* 1AAFDC 8027C6FC 24060063 */ addiu $a2, $zero, 0x63
/* 1AAFE0 8027C700 0809F1C7 */ j .L8027C71C
/* 1AAFE4 8027C704 00000000 */ nop
.L8027C708:
/* 1AAFE8 8027C708 3C028011 */ lui $v0, %hi(gPlayerData)
/* 1AAFEC 8027C70C 2442F290 */ addiu $v0, $v0, %lo(gPlayerData)
/* 1AAFF0 8027C710 80460002 */ lb $a2, 2($v0)
/* 1AAFF4 8027C714 0809F1C9 */ j .L8027C724
/* 1AAFF8 8027C718 0240202D */ daddu $a0, $s2, $zero
.L8027C71C:
/* 1AAFFC 8027C71C 80C601B8 */ lb $a2, 0x1b8($a2)
.L8027C720:
/* 1AB000 8027C720 0240202D */ daddu $a0, $s2, $zero
.L8027C724:
/* 1AB004 8027C724 0C0B2026 */ jal set_variable
/* 1AB008 8027C728 0220282D */ daddu $a1, $s1, $zero
/* 1AB00C 8027C72C 8FBF001C */ lw $ra, 0x1c($sp)
/* 1AB010 8027C730 8FB20018 */ lw $s2, 0x18($sp)
/* 1AB014 8027C734 8FB10014 */ lw $s1, 0x14($sp)
/* 1AB018 8027C738 8FB00010 */ lw $s0, 0x10($sp)
/* 1AB01C 8027C73C 24020002 */ addiu $v0, $zero, 2
/* 1AB020 8027C740 03E00008 */ jr $ra
/* 1AB024 8027C744 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A1000_752450
/* 752450 802A1000 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 752454 802A1004 AFB00010 */ sw $s0, 0x10($sp)
/* 752458 802A1008 0080802D */ daddu $s0, $a0, $zero
/* 75245C 802A100C 2402000F */ addiu $v0, $zero, 0xf
/* 752460 802A1010 3C03800E */ lui $v1, %hi(gBattleStatus+0x83)
/* 752464 802A1014 8063C0F3 */ lb $v1, %lo(gBattleStatus+0x83)($v1)
/* 752468 802A1018 24040015 */ addiu $a0, $zero, 0x15
/* 75246C 802A101C AFBF0014 */ sw $ra, 0x14($sp)
/* 752470 802A1020 AE020088 */ sw $v0, 0x88($s0)
/* 752474 802A1024 0C03A752 */ jal is_ability_active
/* 752478 802A1028 AE030084 */ sw $v1, 0x84($s0)
/* 75247C 802A102C 10400003 */ beqz $v0, .L802A103C
/* 752480 802A1030 24020028 */ addiu $v0, $zero, 0x28
/* 752484 802A1034 AE000084 */ sw $zero, 0x84($s0)
/* 752488 802A1038 AE020088 */ sw $v0, 0x88($s0)
.L802A103C:
/* 75248C 802A103C 8FBF0014 */ lw $ra, 0x14($sp)
/* 752490 802A1040 8FB00010 */ lw $s0, 0x10($sp)
/* 752494 802A1044 24020002 */ addiu $v0, $zero, 2
/* 752498 802A1048 03E00008 */ jr $ra
/* 75249C 802A104C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,26 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A1050_7524A0
/* 7524A0 802A1050 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 7524A4 802A1054 AFB00010 */ sw $s0, 0x10($sp)
/* 7524A8 802A1058 0080802D */ daddu $s0, $a0, $zero
/* 7524AC 802A105C 24040016 */ addiu $a0, $zero, 0x16
/* 7524B0 802A1060 AFBF0014 */ sw $ra, 0x14($sp)
/* 7524B4 802A1064 0C03A752 */ jal is_ability_active
/* 7524B8 802A1068 AE000084 */ sw $zero, 0x84($s0)
/* 7524BC 802A106C 10400002 */ beqz $v0, .L802A1078
/* 7524C0 802A1070 24020001 */ addiu $v0, $zero, 1
/* 7524C4 802A1074 AE020084 */ sw $v0, 0x84($s0)
.L802A1078:
/* 7524C8 802A1078 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 7524CC 802A107C 8C42C070 */ lw $v0, %lo(gBattleStatus)($v0)
/* 7524D0 802A1080 30421000 */ andi $v0, $v0, 0x1000
/* 7524D4 802A1084 10400002 */ beqz $v0, .L802A1090
/* 7524D8 802A1088 24020001 */ addiu $v0, $zero, 1
/* 7524DC 802A108C AE020084 */ sw $v0, 0x84($s0)
.L802A1090:
/* 7524E0 802A1090 8FBF0014 */ lw $ra, 0x14($sp)
/* 7524E4 802A1094 8FB00010 */ lw $s0, 0x10($sp)
/* 7524E8 802A1098 24020002 */ addiu $v0, $zero, 2
/* 7524EC 802A109C 03E00008 */ jr $ra

View File

@ -1,5 +1,27 @@
#include "common.h"
INCLUDE_ASM(s32, "battle/move/hammer_throw_752450", func_802A1000_752450);
ApiStatus func_802A1000_752450(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = *(&gBattleStatus.unk_83);
script->varTable[1] = 15;
INCLUDE_ASM(s32, "battle/move/hammer_throw_752450", func_802A1050_7524A0);
if (is_ability_active(Ability_BERSERKER) != FALSE) {
script->varTable[0] = 0;
script->varTable[1] = 40;
}
return ApiStatus_DONE2;
}
ApiStatus func_802A1050_7524A0(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = 0;
if (is_ability_active(Ability_RIGHT_ON) != FALSE) {
script->varTable[0] = 1;
}
if ((gBattleStatus.flags1 & 0x1000) != FALSE) {
script->varTable[0] = 1;
}
return ApiStatus_DONE2;
}

View File

@ -85,7 +85,7 @@ ApiStatus BindTakeTurn(ScriptInstance* script, s32 isInitialCall) {
var1 = get_variable(script, *args++);
get_actor(actorID)->takeTurnCode = var1;
return ApiStatus_FINISH;
return ApiStatus_DONE2;
}
ApiStatus PauseTakeTurn(ScriptInstance* script, s32 isInitialCall) {
@ -286,10 +286,9 @@ ApiStatus SetEnemyHP(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
#ifdef NON_MATCHING
ApiStatus GetActorHP(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
Bytecode* args = script->ptrReadPos;
PlayerData* playerData = PLAYER_DATA;
ActorID actorID = get_variable(script, *args++);
Actor* actor;
s32 outVar;
@ -302,22 +301,21 @@ ApiStatus GetActorHP(ScriptInstance* script, s32 isInitialCall) {
actor = get_actor(actorID);
if (actorID & 0x700) {
if (actorID == ActorID_PARTNER) {
switch (actorID & 0x700) {
case ActorID_PLAYER:
outVal = playerData->curHP;
break;
case ActorID_PARTNER:
outVal = 99;
} else {
break;
default:
outVal = actor->currentHP;
}
} else {
outVal = playerData->curHP;
break;
}
set_variable(script, outVar, outVal);
return ApiStatus_DONE2;
}
#else
INCLUDE_ASM(s32, "code_1A5830", GetActorHP);
#endif
ApiStatus GetEnemyMaxHP(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;

View File

@ -2504,7 +2504,7 @@ segments:
overlay: True
subsections:
- [0x752450, c]
- [0x7524F0, data]
- [0x752500, data]
- name: battle/move/mega_quake
type: code
start: 0x756780