From 5a85b3115d410229103972f20880a10993e173cd Mon Sep 17 00:00:00 2001 From: eperdew Date: Sun, 3 Oct 2021 18:20:11 -0700 Subject: [PATCH] Decompile mega_shock.c (#457) * parent d2721ed191cfbd8db21dc51d710cde830506fb6a author eperdew 1632807291 -0700 committer eperdew 1633221439 -0700 Decompile mega_shock.c. * Move common stuff to top of variable declaration blocks. * Address @ethteck's review comments on func_802A92A0_42DCB0. Also remove an unnecessary shift during a comparison. --- include/common_structs.h | 2 +- src/battle/action_cmd/0A.c | 4 +- src/battle/action_cmd/air_lift.c | 2 +- src/battle/action_cmd/body_slam.c | 4 +- src/battle/action_cmd/break_free.c | 2 +- src/battle/action_cmd/flee.c | 16 +- src/battle/action_cmd/mega_shock.c | 369 ++++++++++++++++- src/battle/action_cmd/power_shock.c | 10 +- src/battle/action_cmd/spook.c | 6 +- src/battle/action_cmd/squirt.c | 18 +- src/battle/action_cmd/stop_leech.c | 16 +- src/battle/action_cmd/tidal_wave.c | 10 +- src/battle/action_cmd/water_block.c | 2 +- src/battle/action_cmd/whirlwind.c | 2 +- src/common/MashActionCommandInit.inc.c | 2 +- .../asm/data/battle/action_cmd/42E330.data.s | 12 - .../mega_shock/func_802A9000_42DA10.s | 110 ----- .../mega_shock/func_802A91A0_42DBB0.s | 70 ---- .../mega_shock/func_802A92A0_42DCB0.s | 382 ------------------ .../mega_shock/func_802A97F8_42E208.s | 64 --- .../mega_shock/func_802A98E0_42E2F0.s | 20 - ver/us/splat.yaml | 2 +- 22 files changed, 413 insertions(+), 712 deletions(-) delete mode 100644 ver/us/asm/data/battle/action_cmd/42E330.data.s delete mode 100644 ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A9000_42DA10.s delete mode 100644 ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A91A0_42DBB0.s delete mode 100644 ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A92A0_42DCB0.s delete mode 100644 ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A97F8_42E208.s delete mode 100644 ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A98E0_42E2F0.s diff --git a/include/common_structs.h b/include/common_structs.h index 4f9101bf4f..f916b7043a 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -2164,7 +2164,7 @@ typedef struct ActionCommandStatus { /* 0x00 */ s32 unk_00; /* 0x04 */ s32 hudElements[15]; /* 0x40 */ char unk_40[0x4]; - /* 0x44 */ s16 unk_44; + /* 0x44 */ s16 barFillLevel; /* 0x46 */ s16 unk_46; /* 0x48 */ s16 unk_48; /* 0x4A */ s16 actionCommandID; // current action command id? diff --git a/src/battle/action_cmd/0A.c b/src/battle/action_cmd/0A.c index e16674f178..3c9bc0b7ba 100644 --- a/src/battle/action_cmd/0A.c +++ b/src/battle/action_cmd/0A.c @@ -19,9 +19,9 @@ void func_802A955C_42790C(void) { draw_hud_element_clipped(hudElementID); get_hud_element_render_pos(hudElementID, &renderPosX, &renderPosY); if (actionCommandStatus->unk_68 == 0) { - func_80268770(renderPosX, renderPosY, actionCommandStatus->unk_44 / 100); + func_80268770(renderPosX, renderPosY, actionCommandStatus->barFillLevel / 100); } else { - func_8026880C(renderPosX, renderPosY, actionCommandStatus->unk_44 / 100); + func_8026880C(renderPosX, renderPosY, actionCommandStatus->barFillLevel / 100); } draw_hud_element_clipped(actionCommandStatus->hudElements[2]); } diff --git a/src/battle/action_cmd/air_lift.c b/src/battle/action_cmd/air_lift.c index 87deaa4d38..4b0a26be57 100644 --- a/src/battle/action_cmd/air_lift.c +++ b/src/battle/action_cmd/air_lift.c @@ -23,7 +23,7 @@ ApiStatus func_802A9000_428A70(Evt* script, s32 isInitialCall) { actionCommandStatus->unk_61 = 1; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; actionCommandStatus->unk_68 = 0; battleStatus->actionSuccess = 0; diff --git a/src/battle/action_cmd/body_slam.c b/src/battle/action_cmd/body_slam.c index e079b14ea9..5e849e5ed0 100644 --- a/src/battle/action_cmd/body_slam.c +++ b/src/battle/action_cmd/body_slam.c @@ -26,7 +26,7 @@ ApiStatus N(CreateHudElements)(Evt* script, s32 isInitialCall) { actionCommandStatus->unk_61 = 1; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; actionCommandStatus->unk_68 = 0; battleStatus->actionSuccess = 0; @@ -72,7 +72,7 @@ void N(draw_hud_elements)(void) { draw_hud_element_clipped(hudElement); get_hud_element_render_pos(hudElement, &x, &y); draw_hud_element_clipped(gActionCommandStatus.hudElements[3]); - func_80268770(x, y, gActionCommandStatus.unk_44 / 100); + func_80268770(x, y, gActionCommandStatus.barFillLevel / 100); draw_hud_element_clipped(gActionCommandStatus.hudElements[2]); } diff --git a/src/battle/action_cmd/break_free.c b/src/battle/action_cmd/break_free.c index 1a213f50c5..3da7767fea 100644 --- a/src/battle/action_cmd/break_free.c +++ b/src/battle/action_cmd/break_free.c @@ -27,7 +27,7 @@ ApiStatus func_802A9000_4233F0(Evt* script, s32 isInitialCall) { actionCommandStatus->unk_61 = 1; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_46 = 0; actionCommandStatus->unk_48 = 0; battleStatus->actionSuccess = 0; diff --git a/src/battle/action_cmd/flee.c b/src/battle/action_cmd/flee.c index de241d17dc..371db6db7c 100644 --- a/src/battle/action_cmd/flee.c +++ b/src/battle/action_cmd/flee.c @@ -28,7 +28,7 @@ ApiStatus func_802A9000_422AD0(Evt* script, s32 isInitialCall) { actionCommandStatus->actionCommandID = ACTION_COMMAND_FLEE; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = actionCommandStatus->unk_5A * 100; + actionCommandStatus->barFillLevel = actionCommandStatus->unk_5A * 100; actionCommandStatus->unk_46 = rand_int(50); actionCommandStatus->unk_48 = 0; actionCommandStatus->unk_5C = 1; @@ -149,17 +149,17 @@ void func_802A9378_422E48(void) { actionCommandStatus->unk_54 = actionCommandStatus->unk_52; case 11: if ((battleStatus->unk_83 != 0) && ((battleStatus->currentButtonsPressed & 0x8000) != 0)) { - actionCommandStatus->unk_44 += (battleStatus->unk_434[actionCommandStatus->unk_50] * 180 / 100); + actionCommandStatus->barFillLevel += (battleStatus->unk_434[actionCommandStatus->unk_50] * 180 / 100); } - if (actionCommandStatus->unk_44 >= 10000) { + if (actionCommandStatus->barFillLevel >= 10000) { hudElement = actionCommandStatus->hudElements[4]; - actionCommandStatus->unk_44 = 10000; + actionCommandStatus->barFillLevel = 10000; actionCommandStatus->unk_68 = 1; set_hud_element_render_pos(hudElement, actionCommandStatus->hudElementX + 50, actionCommandStatus->hudElementY + 28); clear_hud_element_flags(hudElement, 2); } - battleStatus->actionSuccess = actionCommandStatus->unk_44 / 100; + battleStatus->actionSuccess = actionCommandStatus->barFillLevel / 100; if (actionCommandStatus->unk_54 == 0) { if (battleStatus->actionSuccess >= (100 - actionCommandStatus->unk_46)) { battleStatus->unk_86 = 1; @@ -230,12 +230,12 @@ void func_802A96F4_4231C4(void) { get_hud_element_render_pos(hudElement, &x, &y); if (D_802A9920 == 0) { - func_80268798(x, y, actionCommandStatus->unk_44 / 100, 1); + func_80268798(x, y, actionCommandStatus->barFillLevel / 100, 1); } else { if (actionCommandStatus->unk_68 == 0) { - func_80268798(x, y, actionCommandStatus->unk_44 / 100, 4); + func_80268798(x, y, actionCommandStatus->barFillLevel / 100, 4); } else { - func_8026880C(x, y, actionCommandStatus->unk_44 / 100, 4); + func_8026880C(x, y, actionCommandStatus->barFillLevel / 100, 4); } } diff --git a/src/battle/action_cmd/mega_shock.c b/src/battle/action_cmd/mega_shock.c index 8063fa57af..803bab0638 100644 --- a/src/battle/action_cmd/mega_shock.c +++ b/src/battle/action_cmd/mega_shock.c @@ -1,13 +1,372 @@ #include "common.h" +#include "hud_element.h" #define NAMESPACE action_command_mega_shock -INCLUDE_ASM(s32, "battle/action_cmd/mega_shock", func_802A9000_42DA10); +extern HudElementAnim D_80108AFC; +extern HudElementAnim D_80108B28; +extern HudElementAnim D_8029231C; +extern HudElementAnim D_80292974; +extern s32 D_802943C0; -INCLUDE_ASM(s32, "battle/action_cmd/mega_shock", func_802A91A0_42DBB0); +extern HudElementAnim D_80108B80; +extern HudElementAnim D_80292374; -INCLUDE_ASM(s32, "battle/action_cmd/mega_shock", func_802A92A0_42DCB0); +void btl_set_popup_duration(s32); +void func_80268C9C(void); +void func_80269160(void); +void sfx_adjust_env_sound_params(s32, s32, s32, s32); -INCLUDE_ASM(s32, "battle/action_cmd/mega_shock", func_802A97F8_42E208); +void func_80268770(s32, s32, s16); +void func_8026880C(s32, s32, s16); -INCLUDE_ASM(s32, "battle/action_cmd/mega_shock", func_802A98E0_42E2F0); +typedef struct structD_802A9930_42E340 { + /* 0x00 */ s16 unk_0; + /* 0x08 */ u16 unk_8; +} structD_802A9930_42E340; + +structD_802A9930_42E340 D_802A9930_42E340[] = { + { 0, 0, }, + { 0, 0x19 }, + { 0, 0x32 }, + { 0, 0x4B }, + { 0, 0x4B }, + { 0, 0 }, +}; + +ApiStatus func_802A9000_42DA10(Evt* script, s32 isInitialCall) { + BattleStatus* battleStatus = &gBattleStatus; + ActionCommandStatus* actionCommandStatus = &gActionCommandStatus; + s32 elementID; + + battleStatus->unk_82 = 5; + battleStatus->unk_434 = &D_802943C0; + if (battleStatus->unk_83 == 0) { + battleStatus->actionSuccess = 0; + return ApiStatus_DONE2; + } + func_80268858(); + + actionCommandStatus->actionCommandID = ACTION_COMMAND_MEGA_SHOCK; + actionCommandStatus->state = 0; + actionCommandStatus->unk_6C = 0x1E; + actionCommandStatus->unk_60 = 0; + actionCommandStatus->barFillLevel = 0; + actionCommandStatus->unk_48 = 0; + actionCommandStatus->unk_68 = 0; + actionCommandStatus->hudElementX = -0x30; + actionCommandStatus->hudElementY = 0x50; + + elementID = create_hud_element(&D_80108B28); + actionCommandStatus->hudElements[0] = elementID; + set_hud_element_flags(elementID, 0x82); + set_hud_element_render_pos(elementID, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY); + set_hud_element_render_depth(elementID, 0); + + elementID = create_hud_element(&D_8029231C); + actionCommandStatus->hudElements[2] = elementID; + set_hud_element_flags(elementID, 0x82); + set_hud_element_render_pos(elementID, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY); + set_hud_element_render_depth(elementID, 0); + + elementID = create_hud_element(&D_80108AFC); + actionCommandStatus->hudElements[1] = elementID; + set_hud_element_render_pos(elementID, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY + 0x1C); + set_hud_element_render_depth(elementID, 0); + set_hud_element_flags(elementID, 0x82); + + elementID = create_hud_element(&D_80292974); + actionCommandStatus->hudElements[4] = elementID; + set_hud_element_render_pos(elementID, actionCommandStatus->hudElementX, actionCommandStatus->hudElementY + 0x1C); + set_hud_element_render_depth(elementID, 0); + set_hud_element_flags(elementID, 0x82); + + return ApiStatus_DONE2; +} + +ApiStatus func_802A91A0_42DBB0(Evt* script, s32 isInitialCall) { + Bytecode* readPos = script->ptrReadPos; + ActionCommandStatus* actionCommandStatus = &gActionCommandStatus; + BattleStatus* battleStatus = &gBattleStatus; + + s16 arg; + ApiStatus result; + + if (battleStatus->unk_83 != 0) { + func_80268858(); + + actionCommandStatus->unk_4E = evt_get_variable(script, *readPos++); + actionCommandStatus->unk_52 = evt_get_variable(script, *readPos++); + arg = evt_get_variable(script, *readPos++); + + actionCommandStatus->unk_50 = arg; + actionCommandStatus->unk_50 = func_80268224(arg); + actionCommandStatus->unk_64 = evt_get_variable(script, *readPos++); + actionCommandStatus->unk_60 = 0; + actionCommandStatus->barFillLevel = 0; + actionCommandStatus->unk_48 = 0; + + battleStatus->actionSuccess = 0; + battleStatus->unk_86 = 0; + actionCommandStatus->state = 0xA; + battleStatus->flags1 &= ~0x8000; + + func_80269118(); + result = 2; + } else { + battleStatus->actionSuccess = 0; + result = 2; + } + + return result; +} + +void func_802A92A0_42DCB0(void) { + ActionCommandStatus* actionCommandStatus = &gActionCommandStatus; + BattleStatus* battleStatus = &gBattleStatus; + + s32 buttonsPushed; + s32 frameCount; + s32 buttonsAB; + s32 bufferPos; + s32 hudElement; + s32 mashMeterIndex; + s32 mashMeterCutoff; + s8 adjustedFillLevel; + + 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, 255); + + hudElement = actionCommandStatus->hudElements[2]; + if (actionCommandStatus->unk_61 != 0) { + clear_hud_element_flags(hudElement, 2); + } + set_hud_element_alpha(hudElement, 255); + + hudElement = actionCommandStatus->hudElements[1]; + set_hud_element_alpha(hudElement, 255); + 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--; + break; + } + + actionCommandStatus->hudElementX += 20; + if (actionCommandStatus->hudElementX > 50) { + actionCommandStatus->hudElementX = 50; + } + + set_hud_element_render_pos(actionCommandStatus->hudElements[0], actionCommandStatus->hudElementX - 17, + actionCommandStatus->hudElementY); + set_hud_element_render_pos(actionCommandStatus->hudElements[2], actionCommandStatus->hudElementX + 23, + actionCommandStatus->hudElementY); + set_hud_element_render_pos(actionCommandStatus->hudElements[1], actionCommandStatus->hudElementX, + actionCommandStatus->hudElementY + 28); + 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); + set_hud_element_anim(actionCommandStatus->hudElements[2], &D_80292374); + actionCommandStatus->barFillLevel = 0; + actionCommandStatus->unk_5C = 0; + actionCommandStatus->unk_54 = actionCommandStatus->unk_52; + sfx_play_sound_with_params(0x80000041, 0, 0, 0); + actionCommandStatus->state = 11; + case 11: + btl_set_popup_duration(99); + if (actionCommandStatus->unk_68 == 0) { + s16 newFillLevel; + + if (actionCommandStatus->unk_64 != 0) { + s8 mashMeterIntervals = actionCommandStatus->mashMeterIntervals; + s16* mashMeterCutoffs = actionCommandStatus->mashMeterCutoffs; + s32 index; + + mashMeterCutoff = mashMeterCutoffs[mashMeterIntervals]; + index = actionCommandStatus->barFillLevel / mashMeterCutoff / 20; + newFillLevel = actionCommandStatus->barFillLevel - D_802A9930_42E340[index].unk_8; + } else { + newFillLevel = actionCommandStatus->barFillLevel - 10; + } + + actionCommandStatus->barFillLevel = newFillLevel; + if (actionCommandStatus->barFillLevel < 0) { + actionCommandStatus->barFillLevel = 0; + } + } + + bufferPos = battleStatus->inputBufferPos; + bufferPos -= 2; + if (bufferPos < 0) { + bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer); + } + + buttonsPushed = 0; + frameCount = 1; + + while(frameCount >= 0) { + if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) { + bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer); + } + + buttonsPushed |= battleStatus->pushInputBuffer[bufferPos++]; + frameCount--; + } + + buttonsAB = BUTTON_A | BUTTON_B; + if ((buttonsPushed & buttonsAB) == buttonsAB) { + if (actionCommandStatus->unk_64 != 0) { + s32 fillLevel; + + fillLevel = actionCommandStatus->unk_64 * 780; + fillLevel = fillLevel / 100 * battleStatus->unk_434[actionCommandStatus->unk_50]; + + // Perplexing reuse of buttonsPushed here, but it fixes register allocation. Likely another + // subexpression from above can be put into a variable and reused instead. + // + // TODO: Find a way to avoid reusing buttonsPushed. + buttonsPushed = fillLevel / 100; + + actionCommandStatus->barFillLevel += buttonsPushed; + } else { + actionCommandStatus->barFillLevel += 100; + + if (actionCommandStatus->barFillLevel >= 500) { + actionCommandStatus->barFillLevel = 500; + } + } + + bufferPos = battleStatus->inputBufferPos; + bufferPos -= 2; + if (bufferPos < 0) { + bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer); + } + + frameCount = 1; + while (frameCount >= 0) { + if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) { + bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer); + } + + battleStatus->pushInputBuffer[bufferPos++] = 0; + frameCount--; + } + } + + if (actionCommandStatus->barFillLevel > 10000) { + hudElement = actionCommandStatus->hudElements[4]; + actionCommandStatus->barFillLevel = 10000; + actionCommandStatus->unk_68 = 1; + set_hud_element_render_pos(hudElement, actionCommandStatus->hudElementX + 50, + actionCommandStatus->hudElementY + 28); + clear_hud_element_flags(hudElement, 2); + } + + adjustedFillLevel = actionCommandStatus->barFillLevel / 100; + + battleStatus->unk_84 = adjustedFillLevel; + sfx_adjust_env_sound_params(0x80000041, 0, 0, adjustedFillLevel * 12); + + if (actionCommandStatus->unk_54 == 0) { + s16 threshold; + + // Again, reusing buttonsPushed specifically for reg-alloc. See above. + // + // TODO: Find a way to avoid reusing buttonsPushed. + buttonsPushed = actionCommandStatus->barFillLevel; + if (actionCommandStatus->unk_64 == 0) { + buttonsPushed = 0; + } + + if (buttonsPushed == 0) { + battleStatus->actionSuccess = -1; + } else { + battleStatus->actionSuccess = buttonsPushed / 100; + } + + mashMeterIndex = actionCommandStatus->mashMeterIntervals - 1; + mashMeterCutoff = actionCommandStatus->mashMeterCutoffs[mashMeterIndex]; + threshold = mashMeterCutoff / 2; + + if (battleStatus->unk_84 <= threshold) { + battleStatus->unk_86 = -4; + } else { + battleStatus->unk_86 = 1; + } + + if (battleStatus->actionSuccess == 100) { + func_80269160(); + } + + sfx_stop_sound(0x80000041); + btl_set_popup_duration(0); + actionCommandStatus->unk_54 = 5; + actionCommandStatus->state = 12; + } else { + actionCommandStatus->unk_54 -= 1; + } + break; + case 12: + if (actionCommandStatus->unk_64 == 0) { + actionCommandStatus->barFillLevel -= 100; + if (actionCommandStatus->barFillLevel < 0) { + actionCommandStatus->barFillLevel = 0; + } + } + + if (actionCommandStatus->unk_54 != 0) { + actionCommandStatus->unk_54 -= 1; + } else { + func_80268C9C(); + } + break; + } +} + +void func_802A97F8_42E208(void) { + ActionCommandStatus* actionCommandStatus = &gActionCommandStatus; + + s32 hudElement; + s32 hudElementX; + s32 hudElementY; + + draw_hud_element_clipped(actionCommandStatus->hudElements[0]); + draw_hud_element_clipped(actionCommandStatus->hudElements[2]); + + hudElement = actionCommandStatus->hudElements[1]; + draw_hud_element_clipped(hudElement); + get_hud_element_render_pos(hudElement, &hudElementX, &hudElementY); + + if (actionCommandStatus->unk_68 == 0) { + func_80268770(hudElementX, hudElementY, actionCommandStatus->barFillLevel / 100); + } else { + func_8026880C(hudElementX, hudElementY, actionCommandStatus->barFillLevel / 100); + } + + draw_hud_element_clipped(actionCommandStatus->hudElements[4]); +} + +void func_802A98E0_42E2F0(void) { + free_hud_element(gActionCommandStatus.hudElements[0]); + free_hud_element(gActionCommandStatus.hudElements[1]); + free_hud_element(gActionCommandStatus.hudElements[2]); + free_hud_element(gActionCommandStatus.hudElements[4]); +} diff --git a/src/battle/action_cmd/power_shock.c b/src/battle/action_cmd/power_shock.c index 4ca42b4c7c..8b56017cb2 100644 --- a/src/battle/action_cmd/power_shock.c +++ b/src/battle/action_cmd/power_shock.c @@ -38,7 +38,7 @@ ApiStatus N(CreateHudElements)(Evt* script, s32 isInitialCall) { actionCommandStatus->actionCommandID = ACTION_COMMAND_POWER_SHOCK; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; actionCommandStatus->unk_46 = rand_int(100); actionCommandStatus->unk_6C = 30; @@ -96,7 +96,7 @@ ApiStatus func_802A9210_42D120(Evt* script, s32 isInitialCall) { actionCommandStatus->unk_50 = func_80268224(actionCommandStatus->unk_50); actionCommandStatus->unk_64 = evt_get_variable(script, *args++); actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->actionSuccess = 0; battleStatus->unk_86 = 0; @@ -314,11 +314,11 @@ void N(draw_hud_elements)(void) { get_hud_element_render_pos(hudElement, &x, &y); if (D_802A9B00 == 0) { - func_80268798(x, y, actionCommandStatus->unk_44 / 100, 1); + func_80268798(x, y, actionCommandStatus->barFillLevel / 100, 1); } else if (actionCommandStatus->unk_68 == 0) { - func_80268798(x, y, actionCommandStatus->unk_44 / 100, 4); + func_80268798(x, y, actionCommandStatus->barFillLevel / 100, 4); } else { - func_80268834(x, y, actionCommandStatus->unk_44 / 100, 4); + func_80268834(x, y, actionCommandStatus->barFillLevel / 100, 4); } hudElement = actionCommandStatus->hudElements[3]; draw_hud_element_clipped(hudElement); diff --git a/src/battle/action_cmd/spook.c b/src/battle/action_cmd/spook.c index a5298737fe..88de246360 100644 --- a/src/battle/action_cmd/spook.c +++ b/src/battle/action_cmd/spook.c @@ -25,7 +25,7 @@ ApiStatus func_802A9000_430020(void) { actionCommandStatus->unk_6C = 30; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; actionCommandStatus->unk_68 = 0; battleStatus->actionSuccess = 0; @@ -70,9 +70,9 @@ void func_802A97FC_43081C(void) { draw_hud_element_clipped(hudElement); get_hud_element_render_pos(hudElement, &renderPosX, &renderPosY); if (actionCommandStatus->unk_68 == 0) { - func_80268770(renderPosX, renderPosY, actionCommandStatus->unk_44 / 100); + func_80268770(renderPosX, renderPosY, actionCommandStatus->barFillLevel / 100); } else { - func_8026880C(renderPosX, renderPosY, actionCommandStatus->unk_44 / 100); + func_8026880C(renderPosX, renderPosY, actionCommandStatus->barFillLevel / 100); } draw_hud_element_clipped(actionCommandStatus->hudElements[2]); } diff --git a/src/battle/action_cmd/squirt.c b/src/battle/action_cmd/squirt.c index 227305b65e..ab13f27924 100644 --- a/src/battle/action_cmd/squirt.c +++ b/src/battle/action_cmd/squirt.c @@ -17,12 +17,12 @@ ApiStatus func_802A9000_429D20(void) { battleStatus->actionSuccess = 0; return ApiStatus_DONE2; } - + func_80268858(); actionCommandStatus->actionCommandID = ACTION_COMMAND_SQUIRT; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->unk_84 = 0; actionCommandStatus->hudElementX = -48; @@ -35,10 +35,10 @@ ApiStatus func_802A9000_429D20(void) { 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); + 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); return ApiStatus_DONE2; @@ -60,7 +60,7 @@ ApiStatus func_802A911C_429E3C(Evt* script) { actionCommandStatus->unk_50 = evt_get_variable(script, *args++); actionCommandStatus->unk_50 = func_80268224(actionCommandStatus->unk_50); actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->actionSuccess = 0; battleStatus->unk_86 = 0; @@ -82,9 +82,9 @@ void func_802A9634_42A354(void) { draw_hud_element_clipped(hudElement); get_hud_element_render_pos(hudElement, &x, &y); if (actionCommandStatus->unk_5C == 0) { - func_80268798(x, y, actionCommandStatus->unk_44 / 100, 1); + func_80268798(x, y, actionCommandStatus->barFillLevel / 100, 1); } else { - func_802687E4(x, y, actionCommandStatus->unk_44 / 100, 1, 1); + func_802687E4(x, y, actionCommandStatus->barFillLevel / 100, 1, 1); } } diff --git a/src/battle/action_cmd/stop_leech.c b/src/battle/action_cmd/stop_leech.c index 6b9856b465..13b4d98e52 100644 --- a/src/battle/action_cmd/stop_leech.c +++ b/src/battle/action_cmd/stop_leech.c @@ -23,7 +23,7 @@ ApiStatus func_802A9000_425590(void) { actionCommandStatus->hudElementX = -48; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; actionCommandStatus->hudElementY = 80; @@ -57,7 +57,7 @@ ApiStatus func_802A9110_4256A0(Evt* script) { actionCommandStatus->unk_50 = evt_get_variable(script, *args++); actionCommandStatus->unk_50 = func_80268224(actionCommandStatus->unk_50); actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->actionSuccess = 0; battleStatus->unk_86 = 0; @@ -107,20 +107,20 @@ void func_802A91F8_425788(void) { break; } set_hud_element_anim(actionCommandStatus->hudElements[0], &D_80108B80); - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->state = 11; actionCommandStatus->unk_54 = actionCommandStatus->unk_52; case 11: btl_set_popup_duration(99); if (actionCommandStatus->unk_6A == 0) { if ((battleStatus->currentButtonsPressed & 0x8000) != 0) { - actionCommandStatus->unk_44 += battleStatus->unk_434[actionCommandStatus->unk_50]; + actionCommandStatus->barFillLevel += battleStatus->unk_434[actionCommandStatus->unk_50]; } } else { - actionCommandStatus->unk_44 += battleStatus->unk_434[actionCommandStatus->unk_50] / 6; - actionCommandStatus->unk_44 += rand_int((battleStatus->unk_434[actionCommandStatus->unk_50]) / 6); + actionCommandStatus->barFillLevel += battleStatus->unk_434[actionCommandStatus->unk_50] / 6; + actionCommandStatus->barFillLevel += rand_int((battleStatus->unk_434[actionCommandStatus->unk_50]) / 6); } - battleStatus->unk_84 = actionCommandStatus->unk_44 / 100; + battleStatus->unk_84 = actionCommandStatus->barFillLevel / 100; if (actionCommandStatus->mashMeterCutoffs[actionCommandStatus->mashMeterIntervals] <= battleStatus->unk_84) { actionCommandStatus->unk_54 = 0; } @@ -158,7 +158,7 @@ void func_802A94A4_425A34(void) { hudElement = actionCommandStatus->hudElements[1]; draw_hud_element_clipped(hudElement); get_hud_element_render_pos(hudElement, &x, &y); - func_80268798(x, y, actionCommandStatus->unk_44 / 100, 2); + func_80268798(x, y, actionCommandStatus->barFillLevel / 100, 2); } void func_802A9544_425AD4(void) { diff --git a/src/battle/action_cmd/tidal_wave.c b/src/battle/action_cmd/tidal_wave.c index 144eaf06fc..57fc8d114e 100644 --- a/src/battle/action_cmd/tidal_wave.c +++ b/src/battle/action_cmd/tidal_wave.c @@ -26,7 +26,7 @@ ApiStatus N(CreateHudElements)(Evt* script, s32 isInitialCall) { actionCommandStatus->actionCommandID = ACTION_COMMAND_TIDAL_WAVE; actionCommandStatus->state = 0; actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->unk_84 = 0; actionCommandStatus->hudElementX = -48; @@ -66,7 +66,7 @@ ApiStatus func_802A9138_42C828(Evt* script, s32 isInitialCall) { actionCommandStatus->unk_50 = evt_get_variable(script, *args++); actionCommandStatus->unk_50 = func_80268224(actionCommandStatus->unk_50); actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->actionSuccess = 0; battleStatus->unk_84 = 0; @@ -257,10 +257,10 @@ void N(update)(void) { actionCommandStatus->hudElementX + ((actionCommandStatus->unk_5D - 1) * 20), actionCommandStatus->hudElementY + 7); actionCommandStatus->unk_5D++; - actionCommandStatus->unk_44 += + actionCommandStatus->barFillLevel += battleStatus->unk_434[actionCommandStatus->unk_50] * 0x12; - if (actionCommandStatus->unk_44 > 10000) { - actionCommandStatus->unk_44 = 10000; + if (actionCommandStatus->barFillLevel > 10000) { + actionCommandStatus->barFillLevel = 10000; } actionCommandStatus->state = 11; battleStatus->unk_84++; diff --git a/src/battle/action_cmd/water_block.c b/src/battle/action_cmd/water_block.c index 6e664ea1f4..6b9be75674 100644 --- a/src/battle/action_cmd/water_block.c +++ b/src/battle/action_cmd/water_block.c @@ -21,7 +21,7 @@ ApiStatus func_802A9398_42A888(Evt* script, s32 isInitialCall) { actionCommandStatus->unk_50 = evt_get_variable(script, *args++); actionCommandStatus->unk_50 = func_80268224(actionCommandStatus->unk_50); actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->unk_84 = 1; battleStatus->actionSuccess = 0; diff --git a/src/battle/action_cmd/whirlwind.c b/src/battle/action_cmd/whirlwind.c index 21e9b5f3a1..816e704754 100644 --- a/src/battle/action_cmd/whirlwind.c +++ b/src/battle/action_cmd/whirlwind.c @@ -85,7 +85,7 @@ void func_802A9744_4243B4(void) { draw_hud_element_clipped(hudElement); get_hud_element_render_pos(hudElement, &x, &y); - func_80268798(x, y, (s16)actionCommandStatus->unk_44 / 100, 1); + func_80268798(x, y, (s16)actionCommandStatus->barFillLevel / 100, 1); draw_hud_element_clipped(actionCommandStatus->hudElements[3]); hudElement = actionCommandStatus->hudElements[2]; if (actionCommandStatus->unk_64 == 0) { diff --git a/src/common/MashActionCommandInit.inc.c b/src/common/MashActionCommandInit.inc.c index 29b973dbb6..1feda84dc5 100644 --- a/src/common/MashActionCommandInit.inc.c +++ b/src/common/MashActionCommandInit.inc.c @@ -17,7 +17,7 @@ ApiStatus N(MashActionCommandInit)(Evt* script, s32 isInitialCall) { actionCommandStatus->unk_50 = func_80268224(actionCommandStatus->unk_50); actionCommandStatus->unk_64 = evt_get_variable(script, *args++); actionCommandStatus->unk_60 = 0; - actionCommandStatus->unk_44 = 0; + actionCommandStatus->barFillLevel = 0; actionCommandStatus->unk_48 = 0; battleStatus->actionSuccess = 0; battleStatus->unk_86 = 127; diff --git a/ver/us/asm/data/battle/action_cmd/42E330.data.s b/ver/us/asm/data/battle/action_cmd/42E330.data.s deleted file mode 100644 index dd33fe7983..0000000000 --- a/ver/us/asm/data/battle/action_cmd/42E330.data.s +++ /dev/null @@ -1,12 +0,0 @@ -.include "macro.inc" - -.section .data - -glabel D_802A9920_42E330 -.short 0x27BD, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 - -glabel D_802A9932_42E342 -.short 0x0000, 0x0000, 0x0019, 0x0000, 0x0032, 0x0000, 0x004B, 0x0000, 0x004B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 - -glabel jtbl_802A9950_42E360 -.word L802A92E8_42DCF8, L802A9368_42DD78, L802A97E0_42E1F0, L802A97E0_42E1F0, L802A97E0_42E1F0, L802A97E0_42E1F0, L802A97E0_42E1F0, L802A97E0_42E1F0, L802A97E0_42E1F0, L802A97E0_42E1F0, L802A93F0_42DE00, L802A9468_42DE78, L802A979C_42E1AC, 0, 0, 0 diff --git a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A9000_42DA10.s b/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A9000_42DA10.s deleted file mode 100644 index c184eecfb2..0000000000 --- a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A9000_42DA10.s +++ /dev/null @@ -1,110 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802A9000_42DA10 -/* 42DA10 802A9000 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 42DA14 802A9004 3C03800E */ lui $v1, %hi(gBattleStatus) -/* 42DA18 802A9008 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus) -/* 42DA1C 802A900C 24020005 */ addiu $v0, $zero, 5 -/* 42DA20 802A9010 AFBF0018 */ sw $ra, 0x18($sp) -/* 42DA24 802A9014 AFB10014 */ sw $s1, 0x14($sp) -/* 42DA28 802A9018 AFB00010 */ sw $s0, 0x10($sp) -/* 42DA2C 802A901C A0620082 */ sb $v0, 0x82($v1) -/* 42DA30 802A9020 3C028029 */ lui $v0, %hi(D_802943C0) -/* 42DA34 802A9024 244243C0 */ addiu $v0, $v0, %lo(D_802943C0) -/* 42DA38 802A9028 AC620434 */ sw $v0, 0x434($v1) -/* 42DA3C 802A902C 80620083 */ lb $v0, 0x83($v1) -/* 42DA40 802A9030 3C11802A */ lui $s1, %hi(gActionCommandStatus) -/* 42DA44 802A9034 2631FBE0 */ addiu $s1, $s1, %lo(gActionCommandStatus) -/* 42DA48 802A9038 50400053 */ beql $v0, $zero, .L802A9188 -/* 42DA4C 802A903C A0600081 */ sb $zero, 0x81($v1) -/* 42DA50 802A9040 0C09A216 */ jal func_80268858 -/* 42DA54 802A9044 00000000 */ nop -/* 42DA58 802A9048 3C048011 */ lui $a0, %hi(D_80108B28) -/* 42DA5C 802A904C 24848B28 */ addiu $a0, $a0, %lo(D_80108B28) -/* 42DA60 802A9050 24020011 */ addiu $v0, $zero, 0x11 -/* 42DA64 802A9054 A622004A */ sh $v0, 0x4a($s1) -/* 42DA68 802A9058 2402001E */ addiu $v0, $zero, 0x1e -/* 42DA6C 802A905C A622006C */ sh $v0, 0x6c($s1) -/* 42DA70 802A9060 2402FFD0 */ addiu $v0, $zero, -0x30 -/* 42DA74 802A9064 A6220056 */ sh $v0, 0x56($s1) -/* 42DA78 802A9068 24020050 */ addiu $v0, $zero, 0x50 -/* 42DA7C 802A906C A620004C */ sh $zero, 0x4c($s1) -/* 42DA80 802A9070 A2200060 */ sb $zero, 0x60($s1) -/* 42DA84 802A9074 A6200044 */ sh $zero, 0x44($s1) -/* 42DA88 802A9078 A6200048 */ sh $zero, 0x48($s1) -/* 42DA8C 802A907C A6200068 */ sh $zero, 0x68($s1) -/* 42DA90 802A9080 0C050529 */ jal create_hud_element -/* 42DA94 802A9084 A6220058 */ sh $v0, 0x58($s1) -/* 42DA98 802A9088 0040802D */ daddu $s0, $v0, $zero -/* 42DA9C 802A908C 0200202D */ daddu $a0, $s0, $zero -/* 42DAA0 802A9090 24050082 */ addiu $a1, $zero, 0x82 -/* 42DAA4 802A9094 0C051280 */ jal set_hud_element_flags -/* 42DAA8 802A9098 AE300004 */ sw $s0, 4($s1) -/* 42DAAC 802A909C 86250056 */ lh $a1, 0x56($s1) -/* 42DAB0 802A90A0 86260058 */ lh $a2, 0x58($s1) -/* 42DAB4 802A90A4 0C051261 */ jal set_hud_element_render_pos -/* 42DAB8 802A90A8 0200202D */ daddu $a0, $s0, $zero -/* 42DABC 802A90AC 0200202D */ daddu $a0, $s0, $zero -/* 42DAC0 802A90B0 0C051277 */ jal set_hud_element_render_depth -/* 42DAC4 802A90B4 0000282D */ daddu $a1, $zero, $zero -/* 42DAC8 802A90B8 3C048029 */ lui $a0, %hi(D_8029231C) -/* 42DACC 802A90BC 2484231C */ addiu $a0, $a0, %lo(D_8029231C) -/* 42DAD0 802A90C0 0C050529 */ jal create_hud_element -/* 42DAD4 802A90C4 00000000 */ nop -/* 42DAD8 802A90C8 0040802D */ daddu $s0, $v0, $zero -/* 42DADC 802A90CC 0200202D */ daddu $a0, $s0, $zero -/* 42DAE0 802A90D0 24050082 */ addiu $a1, $zero, 0x82 -/* 42DAE4 802A90D4 0C051280 */ jal set_hud_element_flags -/* 42DAE8 802A90D8 AE30000C */ sw $s0, 0xc($s1) -/* 42DAEC 802A90DC 86250056 */ lh $a1, 0x56($s1) -/* 42DAF0 802A90E0 86260058 */ lh $a2, 0x58($s1) -/* 42DAF4 802A90E4 0C051261 */ jal set_hud_element_render_pos -/* 42DAF8 802A90E8 0200202D */ daddu $a0, $s0, $zero -/* 42DAFC 802A90EC 0200202D */ daddu $a0, $s0, $zero -/* 42DB00 802A90F0 0C051277 */ jal set_hud_element_render_depth -/* 42DB04 802A90F4 0000282D */ daddu $a1, $zero, $zero -/* 42DB08 802A90F8 3C048011 */ lui $a0, %hi(D_80108AFC) -/* 42DB0C 802A90FC 24848AFC */ addiu $a0, $a0, %lo(D_80108AFC) -/* 42DB10 802A9100 0C050529 */ jal create_hud_element -/* 42DB14 802A9104 00000000 */ nop -/* 42DB18 802A9108 0040802D */ daddu $s0, $v0, $zero -/* 42DB1C 802A910C 86250056 */ lh $a1, 0x56($s1) -/* 42DB20 802A9110 86260058 */ lh $a2, 0x58($s1) -/* 42DB24 802A9114 0200202D */ daddu $a0, $s0, $zero -/* 42DB28 802A9118 AE300008 */ sw $s0, 8($s1) -/* 42DB2C 802A911C 0C051261 */ jal set_hud_element_render_pos -/* 42DB30 802A9120 24C6001C */ addiu $a2, $a2, 0x1c -/* 42DB34 802A9124 0200202D */ daddu $a0, $s0, $zero -/* 42DB38 802A9128 0C051277 */ jal set_hud_element_render_depth -/* 42DB3C 802A912C 0000282D */ daddu $a1, $zero, $zero -/* 42DB40 802A9130 0200202D */ daddu $a0, $s0, $zero -/* 42DB44 802A9134 0C051280 */ jal set_hud_element_flags -/* 42DB48 802A9138 24050082 */ addiu $a1, $zero, 0x82 -/* 42DB4C 802A913C 3C048029 */ lui $a0, %hi(D_80292974) -/* 42DB50 802A9140 24842974 */ addiu $a0, $a0, %lo(D_80292974) -/* 42DB54 802A9144 0C050529 */ jal create_hud_element -/* 42DB58 802A9148 00000000 */ nop -/* 42DB5C 802A914C 0040802D */ daddu $s0, $v0, $zero -/* 42DB60 802A9150 86250056 */ lh $a1, 0x56($s1) -/* 42DB64 802A9154 86260058 */ lh $a2, 0x58($s1) -/* 42DB68 802A9158 0200202D */ daddu $a0, $s0, $zero -/* 42DB6C 802A915C AE300014 */ sw $s0, 0x14($s1) -/* 42DB70 802A9160 0C051261 */ jal set_hud_element_render_pos -/* 42DB74 802A9164 24C6001C */ addiu $a2, $a2, 0x1c -/* 42DB78 802A9168 0200202D */ daddu $a0, $s0, $zero -/* 42DB7C 802A916C 0C051277 */ jal set_hud_element_render_depth -/* 42DB80 802A9170 0000282D */ daddu $a1, $zero, $zero -/* 42DB84 802A9174 0200202D */ daddu $a0, $s0, $zero -/* 42DB88 802A9178 0C051280 */ jal set_hud_element_flags -/* 42DB8C 802A917C 24050082 */ addiu $a1, $zero, 0x82 -/* 42DB90 802A9180 080AA463 */ j .L802A918C -/* 42DB94 802A9184 24020002 */ addiu $v0, $zero, 2 -.L802A9188: -/* 42DB98 802A9188 24020002 */ addiu $v0, $zero, 2 -.L802A918C: -/* 42DB9C 802A918C 8FBF0018 */ lw $ra, 0x18($sp) -/* 42DBA0 802A9190 8FB10014 */ lw $s1, 0x14($sp) -/* 42DBA4 802A9194 8FB00010 */ lw $s0, 0x10($sp) -/* 42DBA8 802A9198 03E00008 */ jr $ra -/* 42DBAC 802A919C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A91A0_42DBB0.s b/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A91A0_42DBB0.s deleted file mode 100644 index 0ae0d9ce65..0000000000 --- a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A91A0_42DBB0.s +++ /dev/null @@ -1,70 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802A91A0_42DBB0 -/* 42DBB0 802A91A0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 42DBB4 802A91A4 AFB20018 */ sw $s2, 0x18($sp) -/* 42DBB8 802A91A8 0080902D */ daddu $s2, $a0, $zero -/* 42DBBC 802A91AC AFB10014 */ sw $s1, 0x14($sp) -/* 42DBC0 802A91B0 3C11802A */ lui $s1, %hi(gActionCommandStatus) -/* 42DBC4 802A91B4 2631FBE0 */ addiu $s1, $s1, %lo(gActionCommandStatus) -/* 42DBC8 802A91B8 AFB3001C */ sw $s3, 0x1c($sp) -/* 42DBCC 802A91BC 3C13800E */ lui $s3, %hi(gBattleStatus) -/* 42DBD0 802A91C0 2673C070 */ addiu $s3, $s3, %lo(gBattleStatus) -/* 42DBD4 802A91C4 AFBF0020 */ sw $ra, 0x20($sp) -/* 42DBD8 802A91C8 AFB00010 */ sw $s0, 0x10($sp) -/* 42DBDC 802A91CC 82620083 */ lb $v0, 0x83($s3) -/* 42DBE0 802A91D0 8E50000C */ lw $s0, 0xc($s2) -/* 42DBE4 802A91D4 10400029 */ beqz $v0, .L802A927C -/* 42DBE8 802A91D8 0260182D */ daddu $v1, $s3, $zero -/* 42DBEC 802A91DC 0C09A216 */ jal func_80268858 -/* 42DBF0 802A91E0 00000000 */ nop -/* 42DBF4 802A91E4 8E050000 */ lw $a1, ($s0) -/* 42DBF8 802A91E8 26100004 */ addiu $s0, $s0, 4 -/* 42DBFC 802A91EC 0C0B1EAF */ jal evt_get_variable -/* 42DC00 802A91F0 0240202D */ daddu $a0, $s2, $zero -/* 42DC04 802A91F4 A622004E */ sh $v0, 0x4e($s1) -/* 42DC08 802A91F8 8E050000 */ lw $a1, ($s0) -/* 42DC0C 802A91FC 26100004 */ addiu $s0, $s0, 4 -/* 42DC10 802A9200 0C0B1EAF */ jal evt_get_variable -/* 42DC14 802A9204 0240202D */ daddu $a0, $s2, $zero -/* 42DC18 802A9208 A6220052 */ sh $v0, 0x52($s1) -/* 42DC1C 802A920C 8E050000 */ lw $a1, ($s0) -/* 42DC20 802A9210 26100004 */ addiu $s0, $s0, 4 -/* 42DC24 802A9214 0C0B1EAF */ jal evt_get_variable -/* 42DC28 802A9218 0240202D */ daddu $a0, $s2, $zero -/* 42DC2C 802A921C 00022400 */ sll $a0, $v0, 0x10 -/* 42DC30 802A9220 00042403 */ sra $a0, $a0, 0x10 -/* 42DC34 802A9224 0C09A089 */ jal func_80268224 -/* 42DC38 802A9228 A6220050 */ sh $v0, 0x50($s1) -/* 42DC3C 802A922C A6220050 */ sh $v0, 0x50($s1) -/* 42DC40 802A9230 8E050000 */ lw $a1, ($s0) -/* 42DC44 802A9234 0C0B1EAF */ jal evt_get_variable -/* 42DC48 802A9238 0240202D */ daddu $a0, $s2, $zero -/* 42DC4C 802A923C 3C04FFFF */ lui $a0, 0xffff -/* 42DC50 802A9240 34847FFF */ ori $a0, $a0, 0x7fff -/* 42DC54 802A9244 A6220064 */ sh $v0, 0x64($s1) -/* 42DC58 802A9248 A2200060 */ sb $zero, 0x60($s1) -/* 42DC5C 802A924C A6200044 */ sh $zero, 0x44($s1) -/* 42DC60 802A9250 A6200048 */ sh $zero, 0x48($s1) -/* 42DC64 802A9254 8E620000 */ lw $v0, ($s3) -/* 42DC68 802A9258 2403000A */ addiu $v1, $zero, 0xa -/* 42DC6C 802A925C A2600081 */ sb $zero, 0x81($s3) -/* 42DC70 802A9260 A2600086 */ sb $zero, 0x86($s3) -/* 42DC74 802A9264 A623004C */ sh $v1, 0x4c($s1) -/* 42DC78 802A9268 00441024 */ and $v0, $v0, $a0 -/* 42DC7C 802A926C 0C09A446 */ jal func_80269118 -/* 42DC80 802A9270 AE620000 */ sw $v0, ($s3) -/* 42DC84 802A9274 080AA4A1 */ j .L802A9284 -/* 42DC88 802A9278 24020002 */ addiu $v0, $zero, 2 -.L802A927C: -/* 42DC8C 802A927C A0600081 */ sb $zero, 0x81($v1) -/* 42DC90 802A9280 24020002 */ addiu $v0, $zero, 2 -.L802A9284: -/* 42DC94 802A9284 8FBF0020 */ lw $ra, 0x20($sp) -/* 42DC98 802A9288 8FB3001C */ lw $s3, 0x1c($sp) -/* 42DC9C 802A928C 8FB20018 */ lw $s2, 0x18($sp) -/* 42DCA0 802A9290 8FB10014 */ lw $s1, 0x14($sp) -/* 42DCA4 802A9294 8FB00010 */ lw $s0, 0x10($sp) -/* 42DCA8 802A9298 03E00008 */ jr $ra -/* 42DCAC 802A929C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A92A0_42DCB0.s b/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A92A0_42DCB0.s deleted file mode 100644 index 7a2bcf0b37..0000000000 --- a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A92A0_42DCB0.s +++ /dev/null @@ -1,382 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802A92A0_42DCB0 -/* 42DCB0 802A92A0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 42DCB4 802A92A4 AFB10014 */ sw $s1, 0x14($sp) -/* 42DCB8 802A92A8 3C11802A */ lui $s1, %hi(gActionCommandStatus) -/* 42DCBC 802A92AC 2631FBE0 */ addiu $s1, $s1, %lo(gActionCommandStatus) -/* 42DCC0 802A92B0 AFBF001C */ sw $ra, 0x1c($sp) -/* 42DCC4 802A92B4 AFB20018 */ sw $s2, 0x18($sp) -/* 42DCC8 802A92B8 AFB00010 */ sw $s0, 0x10($sp) -/* 42DCCC 802A92BC 8623004C */ lh $v1, 0x4c($s1) -/* 42DCD0 802A92C0 3C12800E */ lui $s2, %hi(gBattleStatus) -/* 42DCD4 802A92C4 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus) -/* 42DCD8 802A92C8 2C62000D */ sltiu $v0, $v1, 0xd -/* 42DCDC 802A92CC 10400144 */ beqz $v0, L802A97E0_42E1F0 -/* 42DCE0 802A92D0 00031080 */ sll $v0, $v1, 2 -/* 42DCE4 802A92D4 3C01802B */ lui $at, %hi(jtbl_802A9950_42E360) -/* 42DCE8 802A92D8 00220821 */ addu $at, $at, $v0 -/* 42DCEC 802A92DC 8C229950 */ lw $v0, %lo(jtbl_802A9950_42E360)($at) -/* 42DCF0 802A92E0 00400008 */ jr $v0 -/* 42DCF4 802A92E4 00000000 */ nop -glabel L802A92E8_42DCF8 -/* 42DCF8 802A92E8 0C093EB1 */ jal btl_set_popup_duration -/* 42DCFC 802A92EC 24040063 */ addiu $a0, $zero, 0x63 -/* 42DD00 802A92F0 82220061 */ lb $v0, 0x61($s1) -/* 42DD04 802A92F4 8E300004 */ lw $s0, 4($s1) -/* 42DD08 802A92F8 10400003 */ beqz $v0, .L802A9308 -/* 42DD0C 802A92FC 0200202D */ daddu $a0, $s0, $zero -/* 42DD10 802A9300 0C05128B */ jal clear_hud_element_flags -/* 42DD14 802A9304 24050002 */ addiu $a1, $zero, 2 -.L802A9308: -/* 42DD18 802A9308 0200202D */ daddu $a0, $s0, $zero -/* 42DD1C 802A930C 0C0513AC */ jal set_hud_element_alpha -/* 42DD20 802A9310 240500FF */ addiu $a1, $zero, 0xff -/* 42DD24 802A9314 82220061 */ lb $v0, 0x61($s1) -/* 42DD28 802A9318 8E30000C */ lw $s0, 0xc($s1) -/* 42DD2C 802A931C 10400004 */ beqz $v0, .L802A9330 -/* 42DD30 802A9320 0200202D */ daddu $a0, $s0, $zero -/* 42DD34 802A9324 0C05128B */ jal clear_hud_element_flags -/* 42DD38 802A9328 24050002 */ addiu $a1, $zero, 2 -/* 42DD3C 802A932C 0200202D */ daddu $a0, $s0, $zero -.L802A9330: -/* 42DD40 802A9330 0C0513AC */ jal set_hud_element_alpha -/* 42DD44 802A9334 240500FF */ addiu $a1, $zero, 0xff -/* 42DD48 802A9338 8E300008 */ lw $s0, 8($s1) -/* 42DD4C 802A933C 240500FF */ addiu $a1, $zero, 0xff -/* 42DD50 802A9340 0C0513AC */ jal set_hud_element_alpha -/* 42DD54 802A9344 0200202D */ daddu $a0, $s0, $zero -/* 42DD58 802A9348 82220061 */ lb $v0, 0x61($s1) -/* 42DD5C 802A934C 10400003 */ beqz $v0, .L802A935C -/* 42DD60 802A9350 0200202D */ daddu $a0, $s0, $zero -/* 42DD64 802A9354 0C05128B */ jal clear_hud_element_flags -/* 42DD68 802A9358 24050002 */ addiu $a1, $zero, 2 -.L802A935C: -/* 42DD6C 802A935C 24020001 */ addiu $v0, $zero, 1 -/* 42DD70 802A9360 080AA5F8 */ j L802A97E0_42E1F0 -/* 42DD74 802A9364 A622004C */ sh $v0, 0x4c($s1) -glabel L802A9368_42DD78 -/* 42DD78 802A9368 0C093EB1 */ jal btl_set_popup_duration -/* 42DD7C 802A936C 24040063 */ addiu $a0, $zero, 0x63 -/* 42DD80 802A9370 8622006C */ lh $v0, 0x6c($s1) -/* 42DD84 802A9374 9623006C */ lhu $v1, 0x6c($s1) -/* 42DD88 802A9378 10400003 */ beqz $v0, .L802A9388 -/* 42DD8C 802A937C 2462FFFF */ addiu $v0, $v1, -1 -/* 42DD90 802A9380 080AA5F8 */ j L802A97E0_42E1F0 -/* 42DD94 802A9384 A622006C */ sh $v0, 0x6c($s1) -.L802A9388: -/* 42DD98 802A9388 96220056 */ lhu $v0, 0x56($s1) -/* 42DD9C 802A938C 24420014 */ addiu $v0, $v0, 0x14 -/* 42DDA0 802A9390 A6220056 */ sh $v0, 0x56($s1) -/* 42DDA4 802A9394 00021400 */ sll $v0, $v0, 0x10 -/* 42DDA8 802A9398 00021403 */ sra $v0, $v0, 0x10 -/* 42DDAC 802A939C 28420033 */ slti $v0, $v0, 0x33 -/* 42DDB0 802A93A0 14400002 */ bnez $v0, .L802A93AC -/* 42DDB4 802A93A4 24020032 */ addiu $v0, $zero, 0x32 -/* 42DDB8 802A93A8 A6220056 */ sh $v0, 0x56($s1) -.L802A93AC: -/* 42DDBC 802A93AC 8E240004 */ lw $a0, 4($s1) -/* 42DDC0 802A93B0 86250056 */ lh $a1, 0x56($s1) -/* 42DDC4 802A93B4 86260058 */ lh $a2, 0x58($s1) -/* 42DDC8 802A93B8 0C051261 */ jal set_hud_element_render_pos -/* 42DDCC 802A93BC 24A5FFEF */ addiu $a1, $a1, -0x11 -/* 42DDD0 802A93C0 8E24000C */ lw $a0, 0xc($s1) -/* 42DDD4 802A93C4 86250056 */ lh $a1, 0x56($s1) -/* 42DDD8 802A93C8 86260058 */ lh $a2, 0x58($s1) -/* 42DDDC 802A93CC 0C051261 */ jal set_hud_element_render_pos -/* 42DDE0 802A93D0 24A50017 */ addiu $a1, $a1, 0x17 -/* 42DDE4 802A93D4 8E240008 */ lw $a0, 8($s1) -/* 42DDE8 802A93D8 86260058 */ lh $a2, 0x58($s1) -/* 42DDEC 802A93DC 86250056 */ lh $a1, 0x56($s1) -/* 42DDF0 802A93E0 0C051261 */ jal set_hud_element_render_pos -/* 42DDF4 802A93E4 24C6001C */ addiu $a2, $a2, 0x1c -/* 42DDF8 802A93E8 080AA5F8 */ j L802A97E0_42E1F0 -/* 42DDFC 802A93EC 00000000 */ nop -glabel L802A93F0_42DE00 -/* 42DE00 802A93F0 0C093EB1 */ jal btl_set_popup_duration -/* 42DE04 802A93F4 24040063 */ addiu $a0, $zero, 0x63 -/* 42DE08 802A93F8 8622004E */ lh $v0, 0x4e($s1) -/* 42DE0C 802A93FC 9623004E */ lhu $v1, 0x4e($s1) -/* 42DE10 802A9400 10400003 */ beqz $v0, .L802A9410 -/* 42DE14 802A9404 2462FFFF */ addiu $v0, $v1, -1 -/* 42DE18 802A9408 080AA5F8 */ j L802A97E0_42E1F0 -/* 42DE1C 802A940C A622004E */ sh $v0, 0x4e($s1) -.L802A9410: -/* 42DE20 802A9410 8E240004 */ lw $a0, 4($s1) -/* 42DE24 802A9414 3C058011 */ lui $a1, %hi(D_80108B80) -/* 42DE28 802A9418 24A58B80 */ addiu $a1, $a1, %lo(D_80108B80) -/* 42DE2C 802A941C 0C0511FF */ jal set_hud_element_anim -/* 42DE30 802A9420 00000000 */ nop -/* 42DE34 802A9424 8E24000C */ lw $a0, 0xc($s1) -/* 42DE38 802A9428 3C058029 */ lui $a1, %hi(D_80292374) -/* 42DE3C 802A942C 24A52374 */ addiu $a1, $a1, %lo(D_80292374) -/* 42DE40 802A9430 0C0511FF */ jal set_hud_element_anim -/* 42DE44 802A9434 00000000 */ nop -/* 42DE48 802A9438 3C048000 */ lui $a0, 0x8000 -/* 42DE4C 802A943C 34840041 */ ori $a0, $a0, 0x41 -/* 42DE50 802A9440 0000282D */ daddu $a1, $zero, $zero -/* 42DE54 802A9444 00A0302D */ daddu $a2, $a1, $zero -/* 42DE58 802A9448 96220052 */ lhu $v0, 0x52($s1) -/* 42DE5C 802A944C 00A0382D */ daddu $a3, $a1, $zero -/* 42DE60 802A9450 A6200044 */ sh $zero, 0x44($s1) -/* 42DE64 802A9454 A220005C */ sb $zero, 0x5c($s1) -/* 42DE68 802A9458 0C0526AE */ jal sfx_play_sound_with_params -/* 42DE6C 802A945C A6220054 */ sh $v0, 0x54($s1) -/* 42DE70 802A9460 2402000B */ addiu $v0, $zero, 0xb -/* 42DE74 802A9464 A622004C */ sh $v0, 0x4c($s1) -glabel L802A9468_42DE78 -/* 42DE78 802A9468 0C093EB1 */ jal btl_set_popup_duration -/* 42DE7C 802A946C 24040063 */ addiu $a0, $zero, 0x63 -/* 42DE80 802A9470 86220068 */ lh $v0, 0x68($s1) -/* 42DE84 802A9474 14400027 */ bnez $v0, .L802A9514 -/* 42DE88 802A9478 00000000 */ nop -/* 42DE8C 802A947C 86220064 */ lh $v0, 0x64($s1) -/* 42DE90 802A9480 1040001E */ beqz $v0, .L802A94FC -/* 42DE94 802A9484 00000000 */ nop -/* 42DE98 802A9488 82220080 */ lb $v0, 0x80($s1) -/* 42DE9C 802A948C 00021040 */ sll $v0, $v0, 1 -/* 42DEA0 802A9490 02221021 */ addu $v0, $s1, $v0 -/* 42DEA4 802A9494 84430074 */ lh $v1, 0x74($v0) -/* 42DEA8 802A9498 86220044 */ lh $v0, 0x44($s1) -/* 42DEAC 802A949C 14600002 */ bnez $v1, .L802A94A8 -/* 42DEB0 802A94A0 0043001A */ div $zero, $v0, $v1 -/* 42DEB4 802A94A4 0007000D */ break 7 -.L802A94A8: -/* 42DEB8 802A94A8 2401FFFF */ addiu $at, $zero, -1 -/* 42DEBC 802A94AC 14610004 */ bne $v1, $at, .L802A94C0 -/* 42DEC0 802A94B0 3C018000 */ lui $at, 0x8000 -/* 42DEC4 802A94B4 14410002 */ bne $v0, $at, .L802A94C0 -/* 42DEC8 802A94B8 00000000 */ nop -/* 42DECC 802A94BC 0006000D */ break 6 -.L802A94C0: -/* 42DED0 802A94C0 00001012 */ mflo $v0 -/* 42DED4 802A94C4 3C036666 */ lui $v1, 0x6666 -/* 42DED8 802A94C8 34636667 */ ori $v1, $v1, 0x6667 -/* 42DEDC 802A94CC 00430018 */ mult $v0, $v1 -/* 42DEE0 802A94D0 000217C3 */ sra $v0, $v0, 0x1f -/* 42DEE4 802A94D4 00001810 */ mfhi $v1 -/* 42DEE8 802A94D8 000318C3 */ sra $v1, $v1, 3 -/* 42DEEC 802A94DC 00621823 */ subu $v1, $v1, $v0 -/* 42DEF0 802A94E0 00031880 */ sll $v1, $v1, 2 -/* 42DEF4 802A94E4 96220044 */ lhu $v0, 0x44($s1) -/* 42DEF8 802A94E8 3C01802B */ lui $at, %hi(D_802A9932_42E342) -/* 42DEFC 802A94EC 00230821 */ addu $at, $at, $v1 -/* 42DF00 802A94F0 94239932 */ lhu $v1, %lo(D_802A9932_42E342)($at) -/* 42DF04 802A94F4 080AA541 */ j .L802A9504 -/* 42DF08 802A94F8 00431023 */ subu $v0, $v0, $v1 -.L802A94FC: -/* 42DF0C 802A94FC 96220044 */ lhu $v0, 0x44($s1) -/* 42DF10 802A9500 2442FFF6 */ addiu $v0, $v0, -0xa -.L802A9504: -/* 42DF14 802A9504 A6220044 */ sh $v0, 0x44($s1) -/* 42DF18 802A9508 00021400 */ sll $v0, $v0, 0x10 -/* 42DF1C 802A950C 04420001 */ bltzl $v0, .L802A9514 -/* 42DF20 802A9510 A6200044 */ sh $zero, 0x44($s1) -.L802A9514: -/* 42DF24 802A9514 82430431 */ lb $v1, 0x431($s2) -/* 42DF28 802A9518 2463FFFE */ addiu $v1, $v1, -2 -/* 42DF2C 802A951C 04620001 */ bltzl $v1, .L802A9524 -/* 42DF30 802A9520 24630040 */ addiu $v1, $v1, 0x40 -.L802A9524: -/* 42DF34 802A9524 0000282D */ daddu $a1, $zero, $zero -/* 42DF38 802A9528 24040001 */ addiu $a0, $zero, 1 -.L802A952C: -/* 42DF3C 802A952C 28620040 */ slti $v0, $v1, 0x40 -/* 42DF40 802A9530 50400001 */ beql $v0, $zero, .L802A9538 -/* 42DF44 802A9534 2463FFC0 */ addiu $v1, $v1, -0x40 -.L802A9538: -/* 42DF48 802A9538 00031080 */ sll $v0, $v1, 2 -/* 42DF4C 802A953C 24630001 */ addiu $v1, $v1, 1 -/* 42DF50 802A9540 02421021 */ addu $v0, $s2, $v0 -/* 42DF54 802A9544 8C420330 */ lw $v0, 0x330($v0) -/* 42DF58 802A9548 2484FFFF */ addiu $a0, $a0, -1 -/* 42DF5C 802A954C 0481FFF7 */ bgez $a0, .L802A952C -/* 42DF60 802A9550 00A22825 */ or $a1, $a1, $v0 -/* 42DF64 802A9554 3403C000 */ ori $v1, $zero, 0xc000 -/* 42DF68 802A9558 00A31024 */ and $v0, $a1, $v1 -/* 42DF6C 802A955C 14430037 */ bne $v0, $v1, .L802A963C -/* 42DF70 802A9560 00000000 */ nop -/* 42DF74 802A9564 86220064 */ lh $v0, 0x64($s1) -/* 42DF78 802A9568 1040001D */ beqz $v0, .L802A95E0 -/* 42DF7C 802A956C 3C0651EB */ lui $a2, 0x51eb -/* 42DF80 802A9570 34C6851F */ ori $a2, $a2, 0x851f -/* 42DF84 802A9574 00021840 */ sll $v1, $v0, 1 -/* 42DF88 802A9578 00621821 */ addu $v1, $v1, $v0 -/* 42DF8C 802A957C 00031180 */ sll $v0, $v1, 6 -/* 42DF90 802A9580 00621821 */ addu $v1, $v1, $v0 -/* 42DF94 802A9584 00031880 */ sll $v1, $v1, 2 -/* 42DF98 802A9588 00660018 */ mult $v1, $a2 -/* 42DF9C 802A958C 00031FC3 */ sra $v1, $v1, 0x1f -/* 42DFA0 802A9590 00001010 */ mfhi $v0 -/* 42DFA4 802A9594 00022143 */ sra $a0, $v0, 5 -/* 42DFA8 802A9598 86220050 */ lh $v0, 0x50($s1) -/* 42DFAC 802A959C 8E450434 */ lw $a1, 0x434($s2) -/* 42DFB0 802A95A0 00021080 */ sll $v0, $v0, 2 -/* 42DFB4 802A95A4 00451021 */ addu $v0, $v0, $a1 -/* 42DFB8 802A95A8 8C420000 */ lw $v0, ($v0) -/* 42DFBC 802A95AC 00832023 */ subu $a0, $a0, $v1 -/* 42DFC0 802A95B0 00820018 */ mult $a0, $v0 -/* 42DFC4 802A95B4 00002012 */ mflo $a0 -/* 42DFC8 802A95B8 00000000 */ nop -/* 42DFCC 802A95BC 00000000 */ nop -/* 42DFD0 802A95C0 00860018 */ mult $a0, $a2 -/* 42DFD4 802A95C4 000427C3 */ sra $a0, $a0, 0x1f -/* 42DFD8 802A95C8 00001010 */ mfhi $v0 -/* 42DFDC 802A95CC 00021943 */ sra $v1, $v0, 5 -/* 42DFE0 802A95D0 96220044 */ lhu $v0, 0x44($s1) -/* 42DFE4 802A95D4 00642823 */ subu $a1, $v1, $a0 -/* 42DFE8 802A95D8 080AA580 */ j .L802A9600 -/* 42DFEC 802A95DC 00451021 */ addu $v0, $v0, $a1 -.L802A95E0: -/* 42DFF0 802A95E0 96220044 */ lhu $v0, 0x44($s1) -/* 42DFF4 802A95E4 24420064 */ addiu $v0, $v0, 0x64 -/* 42DFF8 802A95E8 A6220044 */ sh $v0, 0x44($s1) -/* 42DFFC 802A95EC 00021400 */ sll $v0, $v0, 0x10 -/* 42E000 802A95F0 00021403 */ sra $v0, $v0, 0x10 -/* 42E004 802A95F4 284201F4 */ slti $v0, $v0, 0x1f4 -/* 42E008 802A95F8 14400002 */ bnez $v0, .L802A9604 -/* 42E00C 802A95FC 240201F4 */ addiu $v0, $zero, 0x1f4 -.L802A9600: -/* 42E010 802A9600 A6220044 */ sh $v0, 0x44($s1) -.L802A9604: -/* 42E014 802A9604 82430431 */ lb $v1, 0x431($s2) -/* 42E018 802A9608 2463FFFE */ addiu $v1, $v1, -2 -/* 42E01C 802A960C 04620001 */ bltzl $v1, .L802A9614 -/* 42E020 802A9610 24630040 */ addiu $v1, $v1, 0x40 -.L802A9614: -/* 42E024 802A9614 24040001 */ addiu $a0, $zero, 1 -.L802A9618: -/* 42E028 802A9618 28620040 */ slti $v0, $v1, 0x40 -/* 42E02C 802A961C 50400001 */ beql $v0, $zero, .L802A9624 -/* 42E030 802A9620 2463FFC0 */ addiu $v1, $v1, -0x40 -.L802A9624: -/* 42E034 802A9624 00031080 */ sll $v0, $v1, 2 -/* 42E038 802A9628 02421021 */ addu $v0, $s2, $v0 -/* 42E03C 802A962C AC400330 */ sw $zero, 0x330($v0) -/* 42E040 802A9630 2484FFFF */ addiu $a0, $a0, -1 -/* 42E044 802A9634 0481FFF8 */ bgez $a0, .L802A9618 -/* 42E048 802A9638 24630001 */ addiu $v1, $v1, 1 -.L802A963C: -/* 42E04C 802A963C 86220044 */ lh $v0, 0x44($s1) -/* 42E050 802A9640 28422711 */ slti $v0, $v0, 0x2711 -/* 42E054 802A9644 14400010 */ bnez $v0, .L802A9688 -/* 42E058 802A9648 3C1051EB */ lui $s0, 0x51eb -/* 42E05C 802A964C 8E300014 */ lw $s0, 0x14($s1) -/* 42E060 802A9650 86250056 */ lh $a1, 0x56($s1) -/* 42E064 802A9654 86260058 */ lh $a2, 0x58($s1) -/* 42E068 802A9658 24022710 */ addiu $v0, $zero, 0x2710 -/* 42E06C 802A965C A6220044 */ sh $v0, 0x44($s1) -/* 42E070 802A9660 24020001 */ addiu $v0, $zero, 1 -/* 42E074 802A9664 A6220068 */ sh $v0, 0x68($s1) -/* 42E078 802A9668 0200202D */ daddu $a0, $s0, $zero -/* 42E07C 802A966C 24A50032 */ addiu $a1, $a1, 0x32 -/* 42E080 802A9670 0C051261 */ jal set_hud_element_render_pos -/* 42E084 802A9674 24C6001C */ addiu $a2, $a2, 0x1c -/* 42E088 802A9678 0200202D */ daddu $a0, $s0, $zero -/* 42E08C 802A967C 0C05128B */ jal clear_hud_element_flags -/* 42E090 802A9680 24050002 */ addiu $a1, $zero, 2 -/* 42E094 802A9684 3C1051EB */ lui $s0, 0x51eb -.L802A9688: -/* 42E098 802A9688 3610851F */ ori $s0, $s0, 0x851f -/* 42E09C 802A968C 96230044 */ lhu $v1, 0x44($s1) -/* 42E0A0 802A9690 3C048000 */ lui $a0, 0x8000 -/* 42E0A4 802A9694 00031C00 */ sll $v1, $v1, 0x10 -/* 42E0A8 802A9698 00031403 */ sra $v0, $v1, 0x10 -/* 42E0AC 802A969C 00500018 */ mult $v0, $s0 -/* 42E0B0 802A96A0 34840041 */ ori $a0, $a0, 0x41 -/* 42E0B4 802A96A4 0000282D */ daddu $a1, $zero, $zero -/* 42E0B8 802A96A8 00A0302D */ daddu $a2, $a1, $zero -/* 42E0BC 802A96AC 00031FC3 */ sra $v1, $v1, 0x1f -/* 42E0C0 802A96B0 00004810 */ mfhi $t1 -/* 42E0C4 802A96B4 00094143 */ sra $t0, $t1, 5 -/* 42E0C8 802A96B8 01034023 */ subu $t0, $t0, $v1 -/* 42E0CC 802A96BC 00081600 */ sll $v0, $t0, 0x18 -/* 42E0D0 802A96C0 00021603 */ sra $v0, $v0, 0x18 -/* 42E0D4 802A96C4 00023840 */ sll $a3, $v0, 1 -/* 42E0D8 802A96C8 00E23821 */ addu $a3, $a3, $v0 -/* 42E0DC 802A96CC 00073880 */ sll $a3, $a3, 2 -/* 42E0E0 802A96D0 0C0526F9 */ jal sfx_adjust_env_sound_params -/* 42E0E4 802A96D4 A2480084 */ sb $t0, 0x84($s2) -/* 42E0E8 802A96D8 86220054 */ lh $v0, 0x54($s1) -/* 42E0EC 802A96DC 96230054 */ lhu $v1, 0x54($s1) -/* 42E0F0 802A96E0 1440003B */ bnez $v0, .L802A97D0 -/* 42E0F4 802A96E4 2462FFFF */ addiu $v0, $v1, -1 -/* 42E0F8 802A96E8 86220064 */ lh $v0, 0x64($s1) -/* 42E0FC 802A96EC 86250044 */ lh $a1, 0x44($s1) -/* 42E100 802A96F0 50400001 */ beql $v0, $zero, .L802A96F8 -/* 42E104 802A96F4 0000282D */ daddu $a1, $zero, $zero -.L802A96F8: -/* 42E108 802A96F8 14A00003 */ bnez $a1, .L802A9708 -/* 42E10C 802A96FC 00B00018 */ mult $a1, $s0 -/* 42E110 802A9700 080AA5C6 */ j .L802A9718 -/* 42E114 802A9704 2402FFFF */ addiu $v0, $zero, -1 -.L802A9708: -/* 42E118 802A9708 00051FC3 */ sra $v1, $a1, 0x1f -/* 42E11C 802A970C 00004810 */ mfhi $t1 -/* 42E120 802A9710 00091143 */ sra $v0, $t1, 5 -/* 42E124 802A9714 00431023 */ subu $v0, $v0, $v1 -.L802A9718: -/* 42E128 802A9718 A2420081 */ sb $v0, 0x81($s2) -/* 42E12C 802A971C 82220080 */ lb $v0, 0x80($s1) -/* 42E130 802A9720 2442FFFF */ addiu $v0, $v0, -1 -/* 42E134 802A9724 00021040 */ sll $v0, $v0, 1 -/* 42E138 802A9728 02221021 */ addu $v0, $s1, $v0 -/* 42E13C 802A972C 94420074 */ lhu $v0, 0x74($v0) -/* 42E140 802A9730 00021400 */ sll $v0, $v0, 0x10 -/* 42E144 802A9734 00021C03 */ sra $v1, $v0, 0x10 -/* 42E148 802A9738 000217C2 */ srl $v0, $v0, 0x1f -/* 42E14C 802A973C 00621021 */ addu $v0, $v1, $v0 -/* 42E150 802A9740 82430084 */ lb $v1, 0x84($s2) -/* 42E154 802A9744 00021043 */ sra $v0, $v0, 1 -/* 42E158 802A9748 0043102A */ slt $v0, $v0, $v1 -/* 42E15C 802A974C 14400002 */ bnez $v0, .L802A9758 -/* 42E160 802A9750 24020001 */ addiu $v0, $zero, 1 -/* 42E164 802A9754 2402FFFC */ addiu $v0, $zero, -4 -.L802A9758: -/* 42E168 802A9758 A2420086 */ sb $v0, 0x86($s2) -/* 42E16C 802A975C 82430081 */ lb $v1, 0x81($s2) -/* 42E170 802A9760 24020064 */ addiu $v0, $zero, 0x64 -/* 42E174 802A9764 14620004 */ bne $v1, $v0, .L802A9778 -/* 42E178 802A9768 3C048000 */ lui $a0, 0x8000 -/* 42E17C 802A976C 0C09A458 */ jal func_80269160 -/* 42E180 802A9770 00000000 */ nop -/* 42E184 802A9774 3C048000 */ lui $a0, 0x8000 -.L802A9778: -/* 42E188 802A9778 0C05271B */ jal sfx_stop_sound -/* 42E18C 802A977C 34840041 */ ori $a0, $a0, 0x41 -/* 42E190 802A9780 0C093EB1 */ jal btl_set_popup_duration -/* 42E194 802A9784 0000202D */ daddu $a0, $zero, $zero -/* 42E198 802A9788 24020005 */ addiu $v0, $zero, 5 -/* 42E19C 802A978C A6220054 */ sh $v0, 0x54($s1) -/* 42E1A0 802A9790 2402000C */ addiu $v0, $zero, 0xc -/* 42E1A4 802A9794 080AA5F8 */ j L802A97E0_42E1F0 -/* 42E1A8 802A9798 A622004C */ sh $v0, 0x4c($s1) -glabel L802A979C_42E1AC -/* 42E1AC 802A979C 86220064 */ lh $v0, 0x64($s1) -/* 42E1B0 802A97A0 14400007 */ bnez $v0, .L802A97C0 -/* 42E1B4 802A97A4 00000000 */ nop -/* 42E1B8 802A97A8 96220044 */ lhu $v0, 0x44($s1) -/* 42E1BC 802A97AC 2442FF9C */ addiu $v0, $v0, -0x64 -/* 42E1C0 802A97B0 A6220044 */ sh $v0, 0x44($s1) -/* 42E1C4 802A97B4 00021400 */ sll $v0, $v0, 0x10 -/* 42E1C8 802A97B8 04420001 */ bltzl $v0, .L802A97C0 -/* 42E1CC 802A97BC A6200044 */ sh $zero, 0x44($s1) -.L802A97C0: -/* 42E1D0 802A97C0 86220054 */ lh $v0, 0x54($s1) -/* 42E1D4 802A97C4 96230054 */ lhu $v1, 0x54($s1) -/* 42E1D8 802A97C8 10400003 */ beqz $v0, .L802A97D8 -/* 42E1DC 802A97CC 2462FFFF */ addiu $v0, $v1, -1 -.L802A97D0: -/* 42E1E0 802A97D0 080AA5F8 */ j L802A97E0_42E1F0 -/* 42E1E4 802A97D4 A6220054 */ sh $v0, 0x54($s1) -.L802A97D8: -/* 42E1E8 802A97D8 0C09A327 */ jal func_80268C9C -/* 42E1EC 802A97DC 00000000 */ nop -glabel L802A97E0_42E1F0 -/* 42E1F0 802A97E0 8FBF001C */ lw $ra, 0x1c($sp) -/* 42E1F4 802A97E4 8FB20018 */ lw $s2, 0x18($sp) -/* 42E1F8 802A97E8 8FB10014 */ lw $s1, 0x14($sp) -/* 42E1FC 802A97EC 8FB00010 */ lw $s0, 0x10($sp) -/* 42E200 802A97F0 03E00008 */ jr $ra -/* 42E204 802A97F4 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A97F8_42E208.s b/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A97F8_42E208.s deleted file mode 100644 index e5eb5d2c7c..0000000000 --- a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A97F8_42E208.s +++ /dev/null @@ -1,64 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802A97F8_42E208 -/* 42E208 802A97F8 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 42E20C 802A97FC AFB1001C */ sw $s1, 0x1c($sp) -/* 42E210 802A9800 3C11802A */ lui $s1, %hi(gActionCommandStatus) -/* 42E214 802A9804 2631FBE0 */ addiu $s1, $s1, %lo(gActionCommandStatus) -/* 42E218 802A9808 AFBF0020 */ sw $ra, 0x20($sp) -/* 42E21C 802A980C AFB00018 */ sw $s0, 0x18($sp) -/* 42E220 802A9810 0C0511EA */ jal draw_hud_element_clipped -/* 42E224 802A9814 8E240004 */ lw $a0, 4($s1) -/* 42E228 802A9818 0C0511EA */ jal draw_hud_element_clipped -/* 42E22C 802A981C 8E24000C */ lw $a0, 0xc($s1) -/* 42E230 802A9820 8E300008 */ lw $s0, 8($s1) -/* 42E234 802A9824 0C0511EA */ jal draw_hud_element_clipped -/* 42E238 802A9828 0200202D */ daddu $a0, $s0, $zero -/* 42E23C 802A982C 0200202D */ daddu $a0, $s0, $zero -/* 42E240 802A9830 27A50010 */ addiu $a1, $sp, 0x10 -/* 42E244 802A9834 0C05126B */ jal get_hud_element_render_pos -/* 42E248 802A9838 27A60014 */ addiu $a2, $sp, 0x14 -/* 42E24C 802A983C 86220068 */ lh $v0, 0x68($s1) -/* 42E250 802A9840 14400011 */ bnez $v0, .L802A9888 -/* 42E254 802A9844 3C0451EB */ lui $a0, 0x51eb -/* 42E258 802A9848 96230044 */ lhu $v1, 0x44($s1) -/* 42E25C 802A984C 3484851F */ ori $a0, $a0, 0x851f -/* 42E260 802A9850 00031C00 */ sll $v1, $v1, 0x10 -/* 42E264 802A9854 00031403 */ sra $v0, $v1, 0x10 -/* 42E268 802A9858 00440018 */ mult $v0, $a0 -/* 42E26C 802A985C 8FA50014 */ lw $a1, 0x14($sp) -/* 42E270 802A9860 00031FC3 */ sra $v1, $v1, 0x1f -/* 42E274 802A9864 8FA40010 */ lw $a0, 0x10($sp) -/* 42E278 802A9868 00003810 */ mfhi $a3 -/* 42E27C 802A986C 00073143 */ sra $a2, $a3, 5 -/* 42E280 802A9870 00C33023 */ subu $a2, $a2, $v1 -/* 42E284 802A9874 00063400 */ sll $a2, $a2, 0x10 -/* 42E288 802A9878 0C09A1DC */ jal func_80268770 -/* 42E28C 802A987C 00063403 */ sra $a2, $a2, 0x10 -/* 42E290 802A9880 080AA630 */ j .L802A98C0 -/* 42E294 802A9884 00000000 */ nop -.L802A9888: -/* 42E298 802A9888 96230044 */ lhu $v1, 0x44($s1) -/* 42E29C 802A988C 3484851F */ ori $a0, $a0, 0x851f -/* 42E2A0 802A9890 00031C00 */ sll $v1, $v1, 0x10 -/* 42E2A4 802A9894 00031403 */ sra $v0, $v1, 0x10 -/* 42E2A8 802A9898 00440018 */ mult $v0, $a0 -/* 42E2AC 802A989C 8FA50014 */ lw $a1, 0x14($sp) -/* 42E2B0 802A98A0 00031FC3 */ sra $v1, $v1, 0x1f -/* 42E2B4 802A98A4 8FA40010 */ lw $a0, 0x10($sp) -/* 42E2B8 802A98A8 00003810 */ mfhi $a3 -/* 42E2BC 802A98AC 00073143 */ sra $a2, $a3, 5 -/* 42E2C0 802A98B0 00C33023 */ subu $a2, $a2, $v1 -/* 42E2C4 802A98B4 00063400 */ sll $a2, $a2, 0x10 -/* 42E2C8 802A98B8 0C09A203 */ jal func_8026880C -/* 42E2CC 802A98BC 00063403 */ sra $a2, $a2, 0x10 -.L802A98C0: -/* 42E2D0 802A98C0 8E240014 */ lw $a0, 0x14($s1) -/* 42E2D4 802A98C4 0C0511EA */ jal draw_hud_element_clipped -/* 42E2D8 802A98C8 00000000 */ nop -/* 42E2DC 802A98CC 8FBF0020 */ lw $ra, 0x20($sp) -/* 42E2E0 802A98D0 8FB1001C */ lw $s1, 0x1c($sp) -/* 42E2E4 802A98D4 8FB00018 */ lw $s0, 0x18($sp) -/* 42E2E8 802A98D8 03E00008 */ jr $ra -/* 42E2EC 802A98DC 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A98E0_42E2F0.s b/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A98E0_42E2F0.s deleted file mode 100644 index 27e5b71da8..0000000000 --- a/ver/us/asm/nonmatchings/battle/action_cmd/mega_shock/func_802A98E0_42E2F0.s +++ /dev/null @@ -1,20 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802A98E0_42E2F0 -/* 42E2F0 802A98E0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 42E2F4 802A98E4 AFB00010 */ sw $s0, 0x10($sp) -/* 42E2F8 802A98E8 3C10802A */ lui $s0, %hi(gActionCommandStatus) -/* 42E2FC 802A98EC 2610FBE0 */ addiu $s0, $s0, %lo(gActionCommandStatus) -/* 42E300 802A98F0 AFBF0014 */ sw $ra, 0x14($sp) -/* 42E304 802A98F4 0C05123D */ jal free_hud_element -/* 42E308 802A98F8 8E040004 */ lw $a0, 4($s0) -/* 42E30C 802A98FC 0C05123D */ jal free_hud_element -/* 42E310 802A9900 8E040008 */ lw $a0, 8($s0) -/* 42E314 802A9904 0C05123D */ jal free_hud_element -/* 42E318 802A9908 8E04000C */ lw $a0, 0xc($s0) -/* 42E31C 802A990C 0C05123D */ jal free_hud_element -/* 42E320 802A9910 8E040014 */ lw $a0, 0x14($s0) -/* 42E324 802A9914 8FBF0014 */ lw $ra, 0x14($sp) -/* 42E328 802A9918 8FB00010 */ lw $s0, 0x10($sp) -/* 42E32C 802A991C 03E00008 */ jr $ra diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index 495d5a6da9..db5bcb031a 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -3636,7 +3636,7 @@ segments: overlay: True subsegments: - [0x42DA10, c, mega_shock] - - [0x42E330, data] + - [0x42E342, .data, mega_shock] - type: code start: 0x42E3A0 vram: 0x802A9000