Power Shock - Adding 4/5 matching funcs (#389)

* Tidal Wave update function

* Tidal Wave merge issues, re-delete ASM

* action_cmd_tidal_wave_update (#379)

* Adding Power Shock 4/5 matching, NON_MATCHING update func

* Responses to comments

* disable ccache on Jenkins :(

* oops

* Fix type warnings for HUD scripts, add function declarations

* Fixing a couple more Power Shock warnings

* Change HudElements* to s32s in Power Shock code

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
This commit is contained in:
jdaster64 2021-08-25 14:08:35 -04:00 committed by GitHub
parent 109db7c43a
commit 3627d909fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 350 additions and 359 deletions

2
Jenkinsfile vendored
View File

@ -10,7 +10,7 @@ pipeline {
sh 'cp /usr/local/etc/roms/papermario.jp.z64 ver/jp/baserom.z64'
sh 'curl -L "https://github.com/pmret/gcc-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
sh 'curl -L "https://github.com/pmret/binutils-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
sh './configure'
sh './configure --no-ccache'
}
}
stage('Build') {

View File

@ -2,12 +2,331 @@
#define NAMESPACE action_command_power_shock
INCLUDE_ASM(s32, "battle/action_cmd/power_shock", func_802A9000_42CF10);
extern const HudElementAnim D_80108AFC;
extern const HudElementAnim D_80108B28;
extern const HudElementAnim D_80108B80;
extern const HudElementAnim D_80109244;
extern const HudElementAnim D_80292974;
extern s32 D_802943A0[];
extern s16 D_802A9AA2_42D9B2[];
extern s32 D_802A9B00;
INCLUDE_ASM(s32, "battle/action_cmd/power_shock", func_802A9210_42D120);
// Function declarations; should ideally be moved to functions.h / 196AA0.c header?
s32 func_80268224(s32);
void func_80268798(s32, s32, s32, s32);
void func_80268834(s32, s32, s32, s32);
void func_80268858(void);
void func_80268C9C(void);
void func_80269118(void);
void func_80269160(void);
INCLUDE_ASM(s32, "battle/action_cmd/power_shock", func_802A9310_42D220);
ApiStatus N(CreateHudElements)(Evt* script, s32 isInitialCall) {
ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
BattleStatus* battleStatus = &gBattleStatus;
s32 hudElement;
s32 temp_v1;
INCLUDE_ASM(s32, "battle/action_cmd/power_shock", func_802A98D0_42D7E0);
battleStatus->unk_82 = 0x64;
battleStatus->unk_434 = D_802943A0;
INCLUDE_ASM(s32, "battle/action_cmd/power_shock", func_802A9A54_42D964);
if (battleStatus->unk_83 == 0) {
battleStatus->actionSuccess = 0;
return ApiStatus_DONE2;
}
func_80268858();
actionCommandStatus->actionCommandID = ACTION_COMMAND_POWER_SHOCK;
actionCommandStatus->state = 0;
actionCommandStatus->unk_60 = 0;
actionCommandStatus->unk_44 = 0;
actionCommandStatus->unk_48 = 0;
actionCommandStatus->unk_46 = rand_int(100);
actionCommandStatus->unk_6C = 30;
actionCommandStatus->hudElementX = -48;
actionCommandStatus->unk_68 = 0;
actionCommandStatus->unk_66 = 0;
D_802A9B00 = 0;
actionCommandStatus->hudElementY = 80;
hudElement = create_hud_element(D_80108B28);
actionCommandStatus->hudElements[0] = hudElement;
set_hud_element_flags(hudElement, 0x82);
set_hud_element_render_pos(hudElement, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY);
set_hud_element_render_depth(hudElement, 0);
hudElement = create_hud_element(D_80108AFC);
actionCommandStatus->hudElements[1] = hudElement;
set_hud_element_render_pos(hudElement, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY + 28);
set_hud_element_render_depth(hudElement, 0);
set_hud_element_flags(hudElement, 0x82);
hudElement = create_hud_element(D_80292974);
actionCommandStatus->hudElements[3] = hudElement;
set_hud_element_render_pos(hudElement, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY + 28);
set_hud_element_render_depth(hudElement, 0);
set_hud_element_flags(hudElement, 0x82);
hudElement = create_hud_element(D_80109244);
actionCommandStatus->hudElements[4] = hudElement;
set_hud_element_render_pos(hudElement, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY + 28);
set_hud_element_render_depth(hudElement, 0);
set_hud_element_flags(hudElement, 0x82);
temp_v1 = (100 - actionCommandStatus->unk_46) * 60;
temp_v1 /= 100;
temp_v1 = 29 - temp_v1;
set_hud_element_render_pos(actionCommandStatus->hudElements[3], actionCommandStatus->hudElementX - temp_v1, actionCommandStatus->hudElementY + 17);
return ApiStatus_DONE2;
}
ApiStatus func_802A9210_42D120(Evt* script, s32 isInitialCall) {
ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
BattleStatus* battleStatus = &gBattleStatus;
Bytecode* args = script->ptrReadPos;
if (battleStatus->unk_83 == 0) {
battleStatus->actionSuccess = 0;
return ApiStatus_DONE2;
}
func_80268858();
actionCommandStatus->unk_4E = get_variable(script, *args++);
actionCommandStatus->unk_52 = get_variable(script, *args++);
actionCommandStatus->unk_50 = get_variable(script, *args++);
actionCommandStatus->unk_50 = func_80268224(actionCommandStatus->unk_50);
actionCommandStatus->unk_64 = get_variable(script, *args++);
actionCommandStatus->unk_60 = 0;
actionCommandStatus->unk_44 = 0;
actionCommandStatus->unk_48 = 0;
battleStatus->actionSuccess = 0;
battleStatus->unk_86 = 0;
actionCommandStatus->state = 10;
battleStatus->flags1 &= ~0x8000;
func_80269118();
return ApiStatus_DONE2;
}
#ifdef NON_MATCHING
void func_802A9310_42D220(void) {
ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
BattleStatus* battleStatus = &gBattleStatus;
s32 hudElement;
s32 temp_lo;
s32 temp_v0_2;
s16 phi_v0;
s32 phi_a1;
switch (actionCommandStatus->state) {
case 0:
btl_set_popup_duration(99);
hudElement = actionCommandStatus->hudElements[0];
if (actionCommandStatus->unk_61 != 0) {
clear_hud_element_flags(hudElement, 2);
}
set_hud_element_alpha(hudElement, 0xFF);
hudElement = actionCommandStatus->hudElements[1];
set_hud_element_alpha(hudElement, 0xFF);
if (actionCommandStatus->unk_61 != 0) {
clear_hud_element_flags(hudElement, 2);
}
hudElement = actionCommandStatus->hudElements[4];
set_hud_element_alpha(hudElement, 0xFF);
if (actionCommandStatus->unk_61 != 0) {
clear_hud_element_flags(hudElement, 2);
}
actionCommandStatus->state = 1;
break;
case 1:
btl_set_popup_duration(99);
if (actionCommandStatus->unk_6C != 0) {
actionCommandStatus->unk_6C--;
} else {
actionCommandStatus->hudElementX += 20;
if (actionCommandStatus->hudElementX > 50) {
actionCommandStatus->hudElementX = 50;
}
set_hud_element_render_pos(
actionCommandStatus->hudElements[0],
actionCommandStatus->hudElementX,
actionCommandStatus->hudElementY);
set_hud_element_render_pos(
actionCommandStatus->hudElements[1],
actionCommandStatus->hudElementX,
actionCommandStatus->hudElementY + 28);
temp_v0_2 = (((100 - actionCommandStatus->unk_46) * 60) / 100);
temp_v0_2 = 29 - temp_v0_2;
set_hud_element_render_pos(
actionCommandStatus->hudElements[4],
actionCommandStatus->hudElementX - temp_v0_2,
actionCommandStatus->hudElementY + 17);
}
break;
case 10:
btl_set_popup_duration(99);
if (actionCommandStatus->unk_4E != 0) {
actionCommandStatus->unk_4E--;
break;
}
set_hud_element_anim(actionCommandStatus->hudElements[0], D_80108B80);
actionCommandStatus->unk_44 = 0;
actionCommandStatus->unk_5C = 0;
D_802A9B00 = 1;
actionCommandStatus->unk_54 = actionCommandStatus->unk_52;
sfx_play_sound_with_params(0x80000041, 0U, 0U, 0U);
actionCommandStatus->state = 11;
// fallthrough
case 11:
btl_set_popup_duration(99);
if (actionCommandStatus->unk_68 == 0) {
if (actionCommandStatus->unk_64 != 0) {
temp_lo = actionCommandStatus->mashMeterCutoffs[actionCommandStatus->mashMeterIntervals];
temp_lo = actionCommandStatus->unk_44 / temp_lo;
phi_v0 = actionCommandStatus->unk_44 - D_802A9AA2_42D9B2[temp_lo / 20 * 2];
} else {
phi_v0 = actionCommandStatus->unk_44 - 10;
}
actionCommandStatus->unk_44 = phi_v0;
if (actionCommandStatus->unk_44 < 0) {
actionCommandStatus->unk_44 = 0;
}
}
if ((battleStatus->currentButtonsPressed & 0x8000) != 0) {
if (actionCommandStatus->unk_64 != 0) {
// unk_434 = array of scaling values based on attack difficulty (unk_50).
actionCommandStatus->unk_44 +=
battleStatus->unk_434[actionCommandStatus->unk_50] * 850 / 100 * actionCommandStatus->unk_64 / 100;
} else {
actionCommandStatus->unk_44 += 100;
if (actionCommandStatus->unk_44 >= 500) {
actionCommandStatus->unk_44 = 500;
}
}
}
if (actionCommandStatus->unk_44 > 10000) {
hudElement = actionCommandStatus->hudElements[3];
actionCommandStatus->unk_44 = 10000;
actionCommandStatus->unk_68 = 1;
set_hud_element_render_pos(
hudElement,
actionCommandStatus->hudElementX + 50,
actionCommandStatus->hudElementY + 28);
clear_hud_element_flags(hudElement, 2);
}
battleStatus->unk_84 = actionCommandStatus->unk_44 / 100;
sfx_adjust_env_sound_params(0x80000041, 0, 0, battleStatus->unk_84 * 12);
if (actionCommandStatus->unk_54 == 0) {
phi_a1 = actionCommandStatus->unk_44;
if (actionCommandStatus->unk_64 == 0) {
phi_a1 = 0;
}
battleStatus->unk_84 = phi_a1 / 100;
if (phi_a1 == 0) {
battleStatus->actionSuccess = -1;
} else if (battleStatus->unk_84 >= actionCommandStatus->unk_46) {
battleStatus->actionSuccess = 1;
} else {
battleStatus->actionSuccess = 0;
}
if ((actionCommandStatus->mashMeterCutoffs[actionCommandStatus->mashMeterIntervals - 1] / 2) < battleStatus->unk_84) {
battleStatus->unk_86 = 1;
} else {
battleStatus->unk_86 = -4;
}
if (battleStatus->actionSuccess == 1) {
func_80269160();
}
sfx_stop_sound(0x80000041);
btl_set_popup_duration(0);
actionCommandStatus->unk_54 = 5;
actionCommandStatus->state = 12;
} else {
actionCommandStatus->unk_54--;
}
break;
case 12:
if (actionCommandStatus->unk_64 == 0) {
actionCommandStatus->unk_44 -= 100;
if (actionCommandStatus->unk_44 < 0) {
actionCommandStatus->unk_44 = 0;
}
}
if (actionCommandStatus->unk_54 != 0) {
actionCommandStatus->unk_54--;
break;
}
func_80268C9C();
break;
}
// Invisible "run away"-like meter that determines success threshold.
// https://www.youtube.com/watch?v=FagUpV0c67s
switch (actionCommandStatus->state) {
case 1:
case 10:
case 11:
if (actionCommandStatus->unk_66 == 0) {
actionCommandStatus->unk_46 += 7;
if (actionCommandStatus->unk_46 >= 100) {
actionCommandStatus->unk_46 = 100;
actionCommandStatus->unk_66 = 1;
}
} else {
actionCommandStatus->unk_46 -= 7;
if (actionCommandStatus->unk_46 <= 0) {
actionCommandStatus->unk_46 = 0;
actionCommandStatus->unk_66 = 0;
}
}
}
}
#else
INCLUDE_ASM(s32, "battle/action_cmd/power_shock", func_802A9310_42D220, void);
#endif
void N(draw_hud_elements)(void) {
ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
s32 y;
s32 x;
s32 hudElement;
s32 temp_a1;
s32 temp_v0;
temp_v0 = actionCommandStatus->unk_46 * 60;
x = 60 - temp_v0 / 100;
temp_a1 = x - 31;
set_hud_element_render_pos(actionCommandStatus->hudElements[4], actionCommandStatus->hudElementX - temp_a1, actionCommandStatus->hudElementY + 17);
draw_hud_element_clipped(actionCommandStatus->hudElements[0]);
hudElement = actionCommandStatus->hudElements[1];
draw_hud_element_clipped(hudElement);
get_hud_element_render_pos(hudElement, &x, &y);
// Redundant call, but needed to match.
get_hud_element_render_pos(hudElement, &x, &y);
if (D_802A9B00 == 0) {
func_80268798(x, y, actionCommandStatus->unk_44 / 100, 1);
} else if (actionCommandStatus->unk_68 == 0) {
func_80268798(x, y, actionCommandStatus->unk_44 / 100, 4);
} else {
func_80268834(x, y, actionCommandStatus->unk_44 / 100, 4);
}
hudElement = actionCommandStatus->hudElements[3];
draw_hud_element_clipped(hudElement);
}
void N(free_hud_elements)(void) {
free_hud_element(gActionCommandStatus.hudElements[0]);
free_hud_element(gActionCommandStatus.hudElements[1]);
free_hud_element(gActionCommandStatus.hudElements[3]);
free_hud_element(gActionCommandStatus.hudElements[4]);
}

View File

@ -31,7 +31,7 @@ def exec_shell(command: List[str]) -> str:
ret = subprocess.run(command, stdout=subprocess.PIPE, text=True)
return ret.stdout
def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, cppflags: str, extra_cflags: str):
def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, cppflags: str, extra_cflags: str, use_ccache: bool):
# platform-specific
if sys.platform == "darwin":
iconv = "tools/iconv.py UTF-8 SHIFT-JIS"
@ -40,8 +40,10 @@ def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, cppflags: str, extra
else:
raise Exception(f"unsupported platform {sys.platform}")
ccache = "ccache "
ccache = ""
if use_ccache:
ccache = "ccache "
try:
subprocess.call(["ccache"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except FileNotFoundError:
@ -636,6 +638,7 @@ if __name__ == "__main__":
parser.add_argument("-d", "--debug", action="store_true", help="Generate debugging information")
parser.add_argument("-n", "--non-matching", action="store_true", help="Compile nonmatching code. Combine with --debug for more detailed debug info")
parser.add_argument("-w", "--no-warn", action="store_true", help="Inhibit compiler warnings")
parser.add_argument("--no-ccache", action="store_true", help="Don't use ccache")
args = parser.parse_args()
exec_shell(["make", "-C", str(ROOT / args.splat)])
@ -703,7 +706,7 @@ if __name__ == "__main__":
ninja = ninja_syntax.Writer(open(str(ROOT / "build.ninja"), "w"), width=9999)
write_ninja_rules(ninja, args.cpp or "cpp", cppflags, cflags)
write_ninja_rules(ninja, args.cpp or "cpp", cppflags, cflags, not args.no_ccache)
write_ninja_for_tools(ninja)
skip_files = set()

View File

@ -7,6 +7,3 @@ glabel D_802A9AA0_42D9B0
glabel D_802A9AA2_42D9B2
.short 0x0000, 0x0000, 0x0019, 0x0000, 0x0032, 0x0000, 0x004B, 0x0000, 0x004B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
glabel jtbl_802A9AC0_42D9D0
.word L802A9358_42D268, L802A93D8_42D2E8, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A949C_42D3AC, L802A950C_42D41C, L802A97F4_42D704, 0, 0, 0

View File

@ -97,7 +97,7 @@ glabel L80268C08_1974E8
/* 1974F0 80268C10 0809A324 */ j L80268C90_197570
/* 1974F4 80268C14 00000000 */ nop
glabel L80268C18_1974F8
/* 1974F8 80268C18 0C0AA634 */ jal func_802A98D0_42D7E0
/* 1974F8 80268C18 0C0AA634 */ jal action_command_power_shock_draw_hud_elements
/* 1974FC 80268C1C 00000000 */ nop
/* 197500 80268C20 0809A324 */ j L80268C90_197570
/* 197504 80268C24 00000000 */ nop

View File

@ -99,7 +99,7 @@ glabel L80268DB4_197694
/* 19769C 80268DBC 0809A390 */ j .L80268E40
/* 1976A0 80268DC0 3C05FFFF */ lui $a1, 0xffff
glabel L80268DC4_1976A4
/* 1976A4 80268DC4 0C0AA695 */ jal func_802A9A54_42D964
/* 1976A4 80268DC4 0C0AA695 */ jal action_command_power_shock_free_hud_elements
/* 1976A8 80268DC8 00000000 */ nop
/* 1976AC 80268DCC 0809A390 */ j .L80268E40
/* 1976B0 80268DD0 3C05FFFF */ lui $a1, 0xffff

View File

@ -1,138 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A9000_42CF10
/* 42CF10 802A9000 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 42CF14 802A9004 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 42CF18 802A9008 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 42CF1C 802A900C 24020064 */ addiu $v0, $zero, 0x64
/* 42CF20 802A9010 AFBF0018 */ sw $ra, 0x18($sp)
/* 42CF24 802A9014 AFB10014 */ sw $s1, 0x14($sp)
/* 42CF28 802A9018 AFB00010 */ sw $s0, 0x10($sp)
/* 42CF2C 802A901C A0620082 */ sb $v0, 0x82($v1)
/* 42CF30 802A9020 3C028029 */ lui $v0, %hi(D_802943A0)
/* 42CF34 802A9024 244243A0 */ addiu $v0, $v0, %lo(D_802943A0)
/* 42CF38 802A9028 AC620434 */ sw $v0, 0x434($v1)
/* 42CF3C 802A902C 80620083 */ lb $v0, 0x83($v1)
/* 42CF40 802A9030 3C11802A */ lui $s1, %hi(gActionCommandStatus)
/* 42CF44 802A9034 2631FBE0 */ addiu $s1, $s1, %lo(gActionCommandStatus)
/* 42CF48 802A9038 5040006F */ beql $v0, $zero, .L802A91F8
/* 42CF4C 802A903C A0600081 */ sb $zero, 0x81($v1)
/* 42CF50 802A9040 0C09A216 */ jal func_80268858
/* 42CF54 802A9044 00000000 */ nop
/* 42CF58 802A9048 24040064 */ addiu $a0, $zero, 0x64
/* 42CF5C 802A904C 24020010 */ addiu $v0, $zero, 0x10
/* 42CF60 802A9050 A622004A */ sh $v0, 0x4a($s1)
/* 42CF64 802A9054 A620004C */ sh $zero, 0x4c($s1)
/* 42CF68 802A9058 A2200060 */ sb $zero, 0x60($s1)
/* 42CF6C 802A905C A6200044 */ sh $zero, 0x44($s1)
/* 42CF70 802A9060 0C00A67F */ jal rand_int
/* 42CF74 802A9064 A6200048 */ sh $zero, 0x48($s1)
/* 42CF78 802A9068 3C048011 */ lui $a0, %hi(D_80108B28)
/* 42CF7C 802A906C 24848B28 */ addiu $a0, $a0, %lo(D_80108B28)
/* 42CF80 802A9070 A6220046 */ sh $v0, 0x46($s1)
/* 42CF84 802A9074 2402001E */ addiu $v0, $zero, 0x1e
/* 42CF88 802A9078 A622006C */ sh $v0, 0x6c($s1)
/* 42CF8C 802A907C 2402FFD0 */ addiu $v0, $zero, -0x30
/* 42CF90 802A9080 A6220056 */ sh $v0, 0x56($s1)
/* 42CF94 802A9084 24020050 */ addiu $v0, $zero, 0x50
/* 42CF98 802A9088 A6200068 */ sh $zero, 0x68($s1)
/* 42CF9C 802A908C A6200066 */ sh $zero, 0x66($s1)
/* 42CFA0 802A9090 3C01802B */ lui $at, %hi(D_802A9B00)
/* 42CFA4 802A9094 AC209B00 */ sw $zero, %lo(D_802A9B00)($at)
/* 42CFA8 802A9098 0C050529 */ jal create_hud_element
/* 42CFAC 802A909C A6220058 */ sh $v0, 0x58($s1)
/* 42CFB0 802A90A0 0040802D */ daddu $s0, $v0, $zero
/* 42CFB4 802A90A4 0200202D */ daddu $a0, $s0, $zero
/* 42CFB8 802A90A8 24050082 */ addiu $a1, $zero, 0x82
/* 42CFBC 802A90AC 0C051280 */ jal set_hud_element_flags
/* 42CFC0 802A90B0 AE300004 */ sw $s0, 4($s1)
/* 42CFC4 802A90B4 86250056 */ lh $a1, 0x56($s1)
/* 42CFC8 802A90B8 86260058 */ lh $a2, 0x58($s1)
/* 42CFCC 802A90BC 0C051261 */ jal set_hud_element_render_pos
/* 42CFD0 802A90C0 0200202D */ daddu $a0, $s0, $zero
/* 42CFD4 802A90C4 0200202D */ daddu $a0, $s0, $zero
/* 42CFD8 802A90C8 0C051277 */ jal set_hud_element_render_depth
/* 42CFDC 802A90CC 0000282D */ daddu $a1, $zero, $zero
/* 42CFE0 802A90D0 3C048011 */ lui $a0, %hi(D_80108AFC)
/* 42CFE4 802A90D4 24848AFC */ addiu $a0, $a0, %lo(D_80108AFC)
/* 42CFE8 802A90D8 0C050529 */ jal create_hud_element
/* 42CFEC 802A90DC 00000000 */ nop
/* 42CFF0 802A90E0 0040802D */ daddu $s0, $v0, $zero
/* 42CFF4 802A90E4 86250056 */ lh $a1, 0x56($s1)
/* 42CFF8 802A90E8 86260058 */ lh $a2, 0x58($s1)
/* 42CFFC 802A90EC 0200202D */ daddu $a0, $s0, $zero
/* 42D000 802A90F0 AE300008 */ sw $s0, 8($s1)
/* 42D004 802A90F4 0C051261 */ jal set_hud_element_render_pos
/* 42D008 802A90F8 24C6001C */ addiu $a2, $a2, 0x1c
/* 42D00C 802A90FC 0200202D */ daddu $a0, $s0, $zero
/* 42D010 802A9100 0C051277 */ jal set_hud_element_render_depth
/* 42D014 802A9104 0000282D */ daddu $a1, $zero, $zero
/* 42D018 802A9108 0200202D */ daddu $a0, $s0, $zero
/* 42D01C 802A910C 0C051280 */ jal set_hud_element_flags
/* 42D020 802A9110 24050082 */ addiu $a1, $zero, 0x82
/* 42D024 802A9114 3C048029 */ lui $a0, %hi(D_80292974)
/* 42D028 802A9118 24842974 */ addiu $a0, $a0, %lo(D_80292974)
/* 42D02C 802A911C 0C050529 */ jal create_hud_element
/* 42D030 802A9120 00000000 */ nop
/* 42D034 802A9124 0040802D */ daddu $s0, $v0, $zero
/* 42D038 802A9128 86250056 */ lh $a1, 0x56($s1)
/* 42D03C 802A912C 86260058 */ lh $a2, 0x58($s1)
/* 42D040 802A9130 0200202D */ daddu $a0, $s0, $zero
/* 42D044 802A9134 AE300010 */ sw $s0, 0x10($s1)
/* 42D048 802A9138 0C051261 */ jal set_hud_element_render_pos
/* 42D04C 802A913C 24C6001C */ addiu $a2, $a2, 0x1c
/* 42D050 802A9140 0200202D */ daddu $a0, $s0, $zero
/* 42D054 802A9144 0C051277 */ jal set_hud_element_render_depth
/* 42D058 802A9148 0000282D */ daddu $a1, $zero, $zero
/* 42D05C 802A914C 0200202D */ daddu $a0, $s0, $zero
/* 42D060 802A9150 0C051280 */ jal set_hud_element_flags
/* 42D064 802A9154 24050082 */ addiu $a1, $zero, 0x82
/* 42D068 802A9158 3C048011 */ lui $a0, %hi(D_80109244)
/* 42D06C 802A915C 24849244 */ addiu $a0, $a0, %lo(D_80109244)
/* 42D070 802A9160 0C050529 */ jal create_hud_element
/* 42D074 802A9164 00000000 */ nop
/* 42D078 802A9168 0040802D */ daddu $s0, $v0, $zero
/* 42D07C 802A916C 86250056 */ lh $a1, 0x56($s1)
/* 42D080 802A9170 86260058 */ lh $a2, 0x58($s1)
/* 42D084 802A9174 0200202D */ daddu $a0, $s0, $zero
/* 42D088 802A9178 AE300014 */ sw $s0, 0x14($s1)
/* 42D08C 802A917C 0C051261 */ jal set_hud_element_render_pos
/* 42D090 802A9180 24C6001C */ addiu $a2, $a2, 0x1c
/* 42D094 802A9184 0200202D */ daddu $a0, $s0, $zero
/* 42D098 802A9188 0C051277 */ jal set_hud_element_render_depth
/* 42D09C 802A918C 0000282D */ daddu $a1, $zero, $zero
/* 42D0A0 802A9190 0200202D */ daddu $a0, $s0, $zero
/* 42D0A4 802A9194 0C051280 */ jal set_hud_element_flags
/* 42D0A8 802A9198 24050082 */ addiu $a1, $zero, 0x82
/* 42D0AC 802A919C 3C0451EB */ lui $a0, 0x51eb
/* 42D0B0 802A91A0 3484851F */ ori $a0, $a0, 0x851f
/* 42D0B4 802A91A4 24020064 */ addiu $v0, $zero, 0x64
/* 42D0B8 802A91A8 86230046 */ lh $v1, 0x46($s1)
/* 42D0BC 802A91AC 86260058 */ lh $a2, 0x58($s1)
/* 42D0C0 802A91B0 00431023 */ subu $v0, $v0, $v1
/* 42D0C4 802A91B4 00021900 */ sll $v1, $v0, 4
/* 42D0C8 802A91B8 00621823 */ subu $v1, $v1, $v0
/* 42D0CC 802A91BC 00031880 */ sll $v1, $v1, 2
/* 42D0D0 802A91C0 00640018 */ mult $v1, $a0
/* 42D0D4 802A91C4 2405001D */ addiu $a1, $zero, 0x1d
/* 42D0D8 802A91C8 24C60011 */ addiu $a2, $a2, 0x11
/* 42D0DC 802A91CC 00031FC3 */ sra $v1, $v1, 0x1f
/* 42D0E0 802A91D0 8E240010 */ lw $a0, 0x10($s1)
/* 42D0E4 802A91D4 00003810 */ mfhi $a3
/* 42D0E8 802A91D8 00071143 */ sra $v0, $a3, 5
/* 42D0EC 802A91DC 00431023 */ subu $v0, $v0, $v1
/* 42D0F0 802A91E0 86230056 */ lh $v1, 0x56($s1)
/* 42D0F4 802A91E4 00A22823 */ subu $a1, $a1, $v0
/* 42D0F8 802A91E8 0C051261 */ jal set_hud_element_render_pos
/* 42D0FC 802A91EC 00652823 */ subu $a1, $v1, $a1
/* 42D100 802A91F0 080AA47F */ j .L802A91FC
/* 42D104 802A91F4 24020002 */ addiu $v0, $zero, 2
.L802A91F8:
/* 42D108 802A91F8 24020002 */ addiu $v0, $zero, 2
.L802A91FC:
/* 42D10C 802A91FC 8FBF0018 */ lw $ra, 0x18($sp)
/* 42D110 802A9200 8FB10014 */ lw $s1, 0x14($sp)
/* 42D114 802A9204 8FB00010 */ lw $s0, 0x10($sp)
/* 42D118 802A9208 03E00008 */ jr $ra
/* 42D11C 802A920C 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,70 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A9210_42D120
/* 42D120 802A9210 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 42D124 802A9214 AFB20018 */ sw $s2, 0x18($sp)
/* 42D128 802A9218 0080902D */ daddu $s2, $a0, $zero
/* 42D12C 802A921C AFB10014 */ sw $s1, 0x14($sp)
/* 42D130 802A9220 3C11802A */ lui $s1, %hi(gActionCommandStatus)
/* 42D134 802A9224 2631FBE0 */ addiu $s1, $s1, %lo(gActionCommandStatus)
/* 42D138 802A9228 AFB3001C */ sw $s3, 0x1c($sp)
/* 42D13C 802A922C 3C13800E */ lui $s3, %hi(gBattleStatus)
/* 42D140 802A9230 2673C070 */ addiu $s3, $s3, %lo(gBattleStatus)
/* 42D144 802A9234 AFBF0020 */ sw $ra, 0x20($sp)
/* 42D148 802A9238 AFB00010 */ sw $s0, 0x10($sp)
/* 42D14C 802A923C 82620083 */ lb $v0, 0x83($s3)
/* 42D150 802A9240 8E50000C */ lw $s0, 0xc($s2)
/* 42D154 802A9244 10400029 */ beqz $v0, .L802A92EC
/* 42D158 802A9248 0260182D */ daddu $v1, $s3, $zero
/* 42D15C 802A924C 0C09A216 */ jal func_80268858
/* 42D160 802A9250 00000000 */ nop
/* 42D164 802A9254 8E050000 */ lw $a1, ($s0)
/* 42D168 802A9258 26100004 */ addiu $s0, $s0, 4
/* 42D16C 802A925C 0C0B1EAF */ jal get_variable
/* 42D170 802A9260 0240202D */ daddu $a0, $s2, $zero
/* 42D174 802A9264 A622004E */ sh $v0, 0x4e($s1)
/* 42D178 802A9268 8E050000 */ lw $a1, ($s0)
/* 42D17C 802A926C 26100004 */ addiu $s0, $s0, 4
/* 42D180 802A9270 0C0B1EAF */ jal get_variable
/* 42D184 802A9274 0240202D */ daddu $a0, $s2, $zero
/* 42D188 802A9278 A6220052 */ sh $v0, 0x52($s1)
/* 42D18C 802A927C 8E050000 */ lw $a1, ($s0)
/* 42D190 802A9280 26100004 */ addiu $s0, $s0, 4
/* 42D194 802A9284 0C0B1EAF */ jal get_variable
/* 42D198 802A9288 0240202D */ daddu $a0, $s2, $zero
/* 42D19C 802A928C 00022400 */ sll $a0, $v0, 0x10
/* 42D1A0 802A9290 00042403 */ sra $a0, $a0, 0x10
/* 42D1A4 802A9294 0C09A089 */ jal func_80268224
/* 42D1A8 802A9298 A6220050 */ sh $v0, 0x50($s1)
/* 42D1AC 802A929C A6220050 */ sh $v0, 0x50($s1)
/* 42D1B0 802A92A0 8E050000 */ lw $a1, ($s0)
/* 42D1B4 802A92A4 0C0B1EAF */ jal get_variable
/* 42D1B8 802A92A8 0240202D */ daddu $a0, $s2, $zero
/* 42D1BC 802A92AC 3C04FFFF */ lui $a0, 0xffff
/* 42D1C0 802A92B0 34847FFF */ ori $a0, $a0, 0x7fff
/* 42D1C4 802A92B4 A6220064 */ sh $v0, 0x64($s1)
/* 42D1C8 802A92B8 A2200060 */ sb $zero, 0x60($s1)
/* 42D1CC 802A92BC A6200044 */ sh $zero, 0x44($s1)
/* 42D1D0 802A92C0 A6200048 */ sh $zero, 0x48($s1)
/* 42D1D4 802A92C4 8E620000 */ lw $v0, ($s3)
/* 42D1D8 802A92C8 2403000A */ addiu $v1, $zero, 0xa
/* 42D1DC 802A92CC A2600081 */ sb $zero, 0x81($s3)
/* 42D1E0 802A92D0 A2600086 */ sb $zero, 0x86($s3)
/* 42D1E4 802A92D4 A623004C */ sh $v1, 0x4c($s1)
/* 42D1E8 802A92D8 00441024 */ and $v0, $v0, $a0
/* 42D1EC 802A92DC 0C09A446 */ jal func_80269118
/* 42D1F0 802A92E0 AE620000 */ sw $v0, ($s3)
/* 42D1F4 802A92E4 080AA4BD */ j .L802A92F4
/* 42D1F8 802A92E8 24020002 */ addiu $v0, $zero, 2
.L802A92EC:
/* 42D1FC 802A92EC A0600081 */ sb $zero, 0x81($v1)
/* 42D200 802A92F0 24020002 */ addiu $v0, $zero, 2
.L802A92F4:
/* 42D204 802A92F4 8FBF0020 */ lw $ra, 0x20($sp)
/* 42D208 802A92F8 8FB3001C */ lw $s3, 0x1c($sp)
/* 42D20C 802A92FC 8FB20018 */ lw $s2, 0x18($sp)
/* 42D210 802A9300 8FB10014 */ lw $s1, 0x14($sp)
/* 42D214 802A9304 8FB00010 */ lw $s0, 0x10($sp)
/* 42D218 802A9308 03E00008 */ jr $ra
/* 42D21C 802A930C 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,6 +1,13 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel jtbl_802A9AC0_42D9D0
.word L802A9358_42D268, L802A93D8_42D2E8, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A9838_42D748, L802A949C_42D3AC, L802A950C_42D41C, L802A97F4_42D704, 0, 0, 0
.section .text
glabel func_802A9310_42D220
/* 42D220 802A9310 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 42D224 802A9314 AFB10014 */ sw $s1, 0x14($sp)

View File

@ -1,105 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A98D0_42D7E0
/* 42D7E0 802A98D0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 42D7E4 802A98D4 AFB40028 */ sw $s4, 0x28($sp)
/* 42D7E8 802A98D8 3C1451EB */ lui $s4, 0x51eb
/* 42D7EC 802A98DC AFB30024 */ sw $s3, 0x24($sp)
/* 42D7F0 802A98E0 3C13802A */ lui $s3, %hi(gActionCommandStatus)
/* 42D7F4 802A98E4 2673FBE0 */ addiu $s3, $s3, %lo(gActionCommandStatus)
/* 42D7F8 802A98E8 AFBF002C */ sw $ra, 0x2c($sp)
/* 42D7FC 802A98EC AFB20020 */ sw $s2, 0x20($sp)
/* 42D800 802A98F0 AFB1001C */ sw $s1, 0x1c($sp)
/* 42D804 802A98F4 AFB00018 */ sw $s0, 0x18($sp)
/* 42D808 802A98F8 86630046 */ lh $v1, 0x46($s3)
/* 42D80C 802A98FC 3694851F */ ori $s4, $s4, 0x851f
/* 42D810 802A9900 00031100 */ sll $v0, $v1, 4
/* 42D814 802A9904 00431023 */ subu $v0, $v0, $v1
/* 42D818 802A9908 00021080 */ sll $v0, $v0, 2
/* 42D81C 802A990C 00540018 */ mult $v0, $s4
/* 42D820 802A9910 86660058 */ lh $a2, 0x58($s3)
/* 42D824 802A9914 8E640014 */ lw $a0, 0x14($s3)
/* 42D828 802A9918 24C60011 */ addiu $a2, $a2, 0x11
/* 42D82C 802A991C 000217C3 */ sra $v0, $v0, 0x1f
/* 42D830 802A9920 00004010 */ mfhi $t0
/* 42D834 802A9924 00081943 */ sra $v1, $t0, 5
/* 42D838 802A9928 00621823 */ subu $v1, $v1, $v0
/* 42D83C 802A992C 2402003C */ addiu $v0, $zero, 0x3c
/* 42D840 802A9930 00431023 */ subu $v0, $v0, $v1
/* 42D844 802A9934 86630056 */ lh $v1, 0x56($s3)
/* 42D848 802A9938 2445FFE1 */ addiu $a1, $v0, -0x1f
/* 42D84C 802A993C AFA20010 */ sw $v0, 0x10($sp)
/* 42D850 802A9940 0C051261 */ jal set_hud_element_render_pos
/* 42D854 802A9944 00652823 */ subu $a1, $v1, $a1
/* 42D858 802A9948 8E640004 */ lw $a0, 4($s3)
/* 42D85C 802A994C 0C0511EA */ jal draw_hud_element_clipped
/* 42D860 802A9950 00000000 */ nop
/* 42D864 802A9954 8E720008 */ lw $s2, 8($s3)
/* 42D868 802A9958 0C0511EA */ jal draw_hud_element_clipped
/* 42D86C 802A995C 0240202D */ daddu $a0, $s2, $zero
/* 42D870 802A9960 0240202D */ daddu $a0, $s2, $zero
/* 42D874 802A9964 27B10010 */ addiu $s1, $sp, 0x10
/* 42D878 802A9968 0220282D */ daddu $a1, $s1, $zero
/* 42D87C 802A996C 27B00014 */ addiu $s0, $sp, 0x14
/* 42D880 802A9970 0C05126B */ jal get_hud_element_render_pos
/* 42D884 802A9974 0200302D */ daddu $a2, $s0, $zero
/* 42D888 802A9978 0240202D */ daddu $a0, $s2, $zero
/* 42D88C 802A997C 0220282D */ daddu $a1, $s1, $zero
/* 42D890 802A9980 0C05126B */ jal get_hud_element_render_pos
/* 42D894 802A9984 0200302D */ daddu $a2, $s0, $zero
/* 42D898 802A9988 3C02802B */ lui $v0, %hi(D_802A9B00)
/* 42D89C 802A998C 8C429B00 */ lw $v0, %lo(D_802A9B00)($v0)
/* 42D8A0 802A9990 14400006 */ bnez $v0, .L802A99AC
/* 42D8A4 802A9994 24070001 */ addiu $a3, $zero, 1
/* 42D8A8 802A9998 96630044 */ lhu $v1, 0x44($s3)
/* 42D8AC 802A999C 00031C00 */ sll $v1, $v1, 0x10
/* 42D8B0 802A99A0 00031403 */ sra $v0, $v1, 0x10
/* 42D8B4 802A99A4 080AA672 */ j .L802A99C8
/* 42D8B8 802A99A8 00540018 */ mult $v0, $s4
.L802A99AC:
/* 42D8BC 802A99AC 86620068 */ lh $v0, 0x68($s3)
/* 42D8C0 802A99B0 14400010 */ bnez $v0, .L802A99F4
/* 42D8C4 802A99B4 24070004 */ addiu $a3, $zero, 4
/* 42D8C8 802A99B8 96630044 */ lhu $v1, 0x44($s3)
/* 42D8CC 802A99BC 00031C00 */ sll $v1, $v1, 0x10
/* 42D8D0 802A99C0 00031403 */ sra $v0, $v1, 0x10
/* 42D8D4 802A99C4 00540018 */ mult $v0, $s4
.L802A99C8:
/* 42D8D8 802A99C8 8FA40010 */ lw $a0, 0x10($sp)
/* 42D8DC 802A99CC 8FA50014 */ lw $a1, 0x14($sp)
/* 42D8E0 802A99D0 00031FC3 */ sra $v1, $v1, 0x1f
/* 42D8E4 802A99D4 00004010 */ mfhi $t0
/* 42D8E8 802A99D8 00083143 */ sra $a2, $t0, 5
/* 42D8EC 802A99DC 00C33023 */ subu $a2, $a2, $v1
/* 42D8F0 802A99E0 00063400 */ sll $a2, $a2, 0x10
/* 42D8F4 802A99E4 0C09A1E6 */ jal func_80268798
/* 42D8F8 802A99E8 00063403 */ sra $a2, $a2, 0x10
/* 42D8FC 802A99EC 080AA68A */ j .L802A9A28
/* 42D900 802A99F0 00000000 */ nop
.L802A99F4:
/* 42D904 802A99F4 96630044 */ lhu $v1, 0x44($s3)
/* 42D908 802A99F8 00031C00 */ sll $v1, $v1, 0x10
/* 42D90C 802A99FC 00031403 */ sra $v0, $v1, 0x10
/* 42D910 802A9A00 00540018 */ mult $v0, $s4
/* 42D914 802A9A04 8FA40010 */ lw $a0, 0x10($sp)
/* 42D918 802A9A08 8FA50014 */ lw $a1, 0x14($sp)
/* 42D91C 802A9A0C 00031FC3 */ sra $v1, $v1, 0x1f
/* 42D920 802A9A10 00004010 */ mfhi $t0
/* 42D924 802A9A14 00083143 */ sra $a2, $t0, 5
/* 42D928 802A9A18 00C33023 */ subu $a2, $a2, $v1
/* 42D92C 802A9A1C 00063400 */ sll $a2, $a2, 0x10
/* 42D930 802A9A20 0C09A20D */ jal func_80268834
/* 42D934 802A9A24 00063403 */ sra $a2, $a2, 0x10
.L802A9A28:
/* 42D938 802A9A28 8E640010 */ lw $a0, 0x10($s3)
/* 42D93C 802A9A2C 0C0511EA */ jal draw_hud_element_clipped
/* 42D940 802A9A30 00000000 */ nop
/* 42D944 802A9A34 8FBF002C */ lw $ra, 0x2c($sp)
/* 42D948 802A9A38 8FB40028 */ lw $s4, 0x28($sp)
/* 42D94C 802A9A3C 8FB30024 */ lw $s3, 0x24($sp)
/* 42D950 802A9A40 8FB20020 */ lw $s2, 0x20($sp)
/* 42D954 802A9A44 8FB1001C */ lw $s1, 0x1c($sp)
/* 42D958 802A9A48 8FB00018 */ lw $s0, 0x18($sp)
/* 42D95C 802A9A4C 03E00008 */ jr $ra
/* 42D960 802A9A50 27BD0030 */ addiu $sp, $sp, 0x30

View File

@ -1,23 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A9A54_42D964
/* 42D964 802A9A54 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 42D968 802A9A58 AFB00010 */ sw $s0, 0x10($sp)
/* 42D96C 802A9A5C 3C10802A */ lui $s0, %hi(gActionCommandStatus)
/* 42D970 802A9A60 2610FBE0 */ addiu $s0, $s0, %lo(gActionCommandStatus)
/* 42D974 802A9A64 AFBF0014 */ sw $ra, 0x14($sp)
/* 42D978 802A9A68 0C05123D */ jal free_hud_element
/* 42D97C 802A9A6C 8E040004 */ lw $a0, 4($s0)
/* 42D980 802A9A70 0C05123D */ jal free_hud_element
/* 42D984 802A9A74 8E040008 */ lw $a0, 8($s0)
/* 42D988 802A9A78 0C05123D */ jal free_hud_element
/* 42D98C 802A9A7C 8E040010 */ lw $a0, 0x10($s0)
/* 42D990 802A9A80 0C05123D */ jal free_hud_element
/* 42D994 802A9A84 8E040014 */ lw $a0, 0x14($s0)
/* 42D998 802A9A88 8FBF0014 */ lw $ra, 0x14($sp)
/* 42D99C 802A9A8C 8FB00010 */ lw $s0, 0x10($sp)
/* 42D9A0 802A9A90 03E00008 */ jr $ra
/* 42D9A4 802A9A94 27BD0018 */ addiu $sp, $sp, 0x18
/* 42D9A8 802A9A98 00000000 */ nop
/* 42D9AC 802A9A9C 00000000 */ nop

View File

@ -3633,6 +3633,7 @@ segments:
subsegments:
- [0x42CF10, c, power_shock]
- [0x42D9B0, data]
- [0x42D9D0]
- type: code
start: 0x42DA10
vram: 0x802A9000

View File

@ -5782,16 +5782,16 @@ D_802AB180_42C670 = 0x802AB180; // type:data rom:0x42C670
D_802AB184_42C674 = 0x802AB184; // type:data rom:0x42C674
action_command_tidal_wave_CreateHudElements = 0x802A9000; // type:func rom:0x42C6F0
func_802A9138_42C828 = 0x802A9138; // type:func rom:0x42C828
func_802A9228_42C918 = 0x802A9228; // type:func rom:0x42C918
action_command_tidal_wave_update = 0x802A9228; // type:func rom:0x42C918
action_command_tidal_wave_draw_hud_elements = 0x802A9718; // type:func rom:0x42CE08
action_command_tidal_wave_free_hud_elements = 0x802A9764; // type:func rom:0x42CE54
D_802A97C0_42CEB0 = 0x802A97C0; // type:data rom:0x42CEB0
D_802A97CC_42CEBC = 0x802A97CC; // type:data rom:0x42CEBC
func_802A9000_42CF10 = 0x802A9000; // type:func rom:0x42CF10
action_command_power_shock_CreateHudElements = 0x802A9000; // type:func rom:0x42CF10
func_802A9210_42D120 = 0x802A9210; // type:func rom:0x42D120
func_802A9310_42D220 = 0x802A9310; // type:func rom:0x42D220
func_802A98D0_42D7E0 = 0x802A98D0; // type:func rom:0x42D7E0
func_802A9A54_42D964 = 0x802A9A54; // type:func rom:0x42D964
action_command_power_shock_update = 0x802A9310; // type:func rom:0x42D220
action_command_power_shock_draw_hud_elements = 0x802A98D0; // type:func rom:0x42D7E0
action_command_power_shock_free_hud_elements = 0x802A9A54; // type:func rom:0x42D964
D_802A9AA2_42D9B2 = 0x802A9AA2; // type:data rom:0x42D9B2
func_802A9000_42DA10 = 0x802A9000; // type:func rom:0x42DA10
func_802A91A0_42DBB0 = 0x802A91A0; // type:func rom:0x42DBB0