From 2653cf7aabacea05381dadce5f7f4e4c8252fd95 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sat, 8 Aug 2020 23:38:42 -0400 Subject: [PATCH] 7 more --- .../status_menu_start_blinking_coins.s | 26 ------- .../status_menu_start_blinking_fp.s | 26 ------- .../status_menu_start_blinking_hp.s | 26 ------- .../status_menu_start_blinking_sp.s | 21 ------ .../status_menu_start_blinking_sp_bars.s | 19 ----- .../status_menu_start_blinking_starpoints.s | 18 ----- .../status_menu_stop_blinking_coins.s | 18 ----- papermario/src/code_80850_len_3060.c | 75 +++++++++++++++++-- 8 files changed, 69 insertions(+), 160 deletions(-) delete mode 100644 papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_coins.s delete mode 100644 papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_fp.s delete mode 100644 papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_hp.s delete mode 100644 papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp.s delete mode 100644 papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp_bars.s delete mode 100644 papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_starpoints.s delete mode 100644 papermario/asm/nonmatchings/code_80850_len_3060/status_menu_stop_blinking_coins.s diff --git a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_coins.s b/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_coins.s deleted file mode 100644 index 5de139d90d..0000000000 --- a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_coins.s +++ /dev/null @@ -1,26 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.include "include/macro.inc" - -glabel status_menu_start_blinking_coins -/* 082EA4 800E99F4 3C028007 */ lui $v0, 0x8007 -/* 082EA8 800E99F8 8C42419C */ lw $v0, 0x419c($v0) -/* 082EAC 800E99FC 3C038011 */ lui $v1, 0x8011 -/* 082EB0 800E9A00 2463EF58 */ addiu $v1, $v1, -0x10a8 -/* 082EB4 800E9A04 80420070 */ lb $v0, 0x70($v0) -/* 082EB8 800E9A08 14400003 */ bnez $v0, .L800E9A18 -/* 082EBC 800E9A0C 0060202D */ daddu $a0, $v1, $zero -/* 082EC0 800E9A10 24020078 */ addiu $v0, $zero, 0x78 -/* 082EC4 800E9A14 A0620056 */ sb $v0, 0x56($v1) -.L800E9A18: -/* 082EC8 800E9A18 80820054 */ lb $v0, 0x54($a0) -/* 082ECC 800E9A1C 24030001 */ addiu $v1, $zero, 1 -/* 082ED0 800E9A20 10430003 */ beq $v0, $v1, .L800E9A30 -/* 082ED4 800E9A24 00000000 */ nop -/* 082ED8 800E9A28 A0830054 */ sb $v1, 0x54($a0) -/* 082EDC 800E9A2C A0800055 */ sb $zero, 0x55($a0) -.L800E9A30: -/* 082EE0 800E9A30 03E00008 */ jr $ra -/* 082EE4 800E9A34 00000000 */ nop - diff --git a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_fp.s b/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_fp.s deleted file mode 100644 index e06c216fad..0000000000 --- a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_fp.s +++ /dev/null @@ -1,26 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.include "include/macro.inc" - -glabel status_menu_start_blinking_fp -/* 082E3C 800E998C 3C028007 */ lui $v0, 0x8007 -/* 082E40 800E9990 8C42419C */ lw $v0, 0x419c($v0) -/* 082E44 800E9994 3C038011 */ lui $v1, 0x8011 -/* 082E48 800E9998 2463EF58 */ addiu $v1, $v1, -0x10a8 -/* 082E4C 800E999C 80420070 */ lb $v0, 0x70($v0) -/* 082E50 800E99A0 14400003 */ bnez $v0, .L800E99B0 -/* 082E54 800E99A4 0060202D */ daddu $a0, $v1, $zero -/* 082E58 800E99A8 24020078 */ addiu $v0, $zero, 0x78 -/* 082E5C 800E99AC A062004F */ sb $v0, 0x4f($v1) -.L800E99B0: -/* 082E60 800E99B0 8082004D */ lb $v0, 0x4d($a0) -/* 082E64 800E99B4 24030001 */ addiu $v1, $zero, 1 -/* 082E68 800E99B8 10430003 */ beq $v0, $v1, .L800E99C8 -/* 082E6C 800E99BC 00000000 */ nop -/* 082E70 800E99C0 A083004D */ sb $v1, 0x4d($a0) -/* 082E74 800E99C4 A080004E */ sb $zero, 0x4e($a0) -.L800E99C8: -/* 082E78 800E99C8 03E00008 */ jr $ra -/* 082E7C 800E99CC 00000000 */ nop - diff --git a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_hp.s b/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_hp.s deleted file mode 100644 index 9ca1a8c583..0000000000 --- a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_hp.s +++ /dev/null @@ -1,26 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.include "include/macro.inc" - -glabel status_menu_start_blinking_hp -/* 082DD0 800E9920 3C028007 */ lui $v0, 0x8007 -/* 082DD4 800E9924 8C42419C */ lw $v0, 0x419c($v0) -/* 082DD8 800E9928 3C038011 */ lui $v1, 0x8011 -/* 082DDC 800E992C 2463EF58 */ addiu $v1, $v1, -0x10a8 -/* 082DE0 800E9930 80420070 */ lb $v0, 0x70($v0) -/* 082DE4 800E9934 14400003 */ bnez $v0, .L800E9944 -/* 082DE8 800E9938 0060202D */ daddu $a0, $v1, $zero -/* 082DEC 800E993C 24020078 */ addiu $v0, $zero, 0x78 -/* 082DF0 800E9940 A062004C */ sb $v0, 0x4c($v1) -.L800E9944: -/* 082DF4 800E9944 8082004A */ lb $v0, 0x4a($a0) -/* 082DF8 800E9948 24030001 */ addiu $v1, $zero, 1 -/* 082DFC 800E994C 10430003 */ beq $v0, $v1, .L800E995C -/* 082E00 800E9950 00000000 */ nop -/* 082E04 800E9954 A083004A */ sb $v1, 0x4a($a0) -/* 082E08 800E9958 A080004B */ sb $zero, 0x4b($a0) -.L800E995C: -/* 082E0C 800E995C 03E00008 */ jr $ra -/* 082E10 800E9960 00000000 */ nop - diff --git a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp.s b/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp.s deleted file mode 100644 index abb4f20124..0000000000 --- a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp.s +++ /dev/null @@ -1,21 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.include "include/macro.inc" - -glabel status_menu_start_blinking_sp -/* 082F10 800E9A60 3C028011 */ lui $v0, 0x8011 -/* 082F14 800E9A64 9042F51E */ lbu $v0, -0xae2($v0) -/* 082F18 800E9A68 3C038011 */ lui $v1, 0x8011 -/* 082F1C 800E9A6C 2463EF58 */ addiu $v1, $v1, -0x10a8 -/* 082F20 800E9A70 A062005A */ sb $v0, 0x5a($v1) -/* 082F24 800E9A74 80620050 */ lb $v0, 0x50($v1) -/* 082F28 800E9A78 24040001 */ addiu $a0, $zero, 1 -/* 082F2C 800E9A7C 10440003 */ beq $v0, $a0, .L800E9A8C -/* 082F30 800E9A80 00000000 */ nop -/* 082F34 800E9A84 A0640050 */ sb $a0, 0x50($v1) -/* 082F38 800E9A88 A0600051 */ sb $zero, 0x51($v1) -.L800E9A8C: -/* 082F3C 800E9A8C 03E00008 */ jr $ra -/* 082F40 800E9A90 00000000 */ nop - diff --git a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp_bars.s b/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp_bars.s deleted file mode 100644 index 826ba82710..0000000000 --- a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_sp_bars.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.include "include/macro.inc" - -glabel status_menu_start_blinking_sp_bars -/* 082F68 800E9AB8 3C038011 */ lui $v1, 0x8011 -/* 082F6C 800E9ABC 2463EF58 */ addiu $v1, $v1, -0x10a8 -/* 082F70 800E9AC0 80620050 */ lb $v0, 0x50($v1) -/* 082F74 800E9AC4 A064005A */ sb $a0, 0x5a($v1) -/* 082F78 800E9AC8 24040001 */ addiu $a0, $zero, 1 -/* 082F7C 800E9ACC 10440003 */ beq $v0, $a0, .L800E9ADC -/* 082F80 800E9AD0 00000000 */ nop -/* 082F84 800E9AD4 A0640050 */ sb $a0, 0x50($v1) -/* 082F88 800E9AD8 A0600051 */ sb $zero, 0x51($v1) -.L800E9ADC: -/* 082F8C 800E9ADC 03E00008 */ jr $ra -/* 082F90 800E9AE0 00000000 */ nop - diff --git a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_starpoints.s b/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_starpoints.s deleted file mode 100644 index 5e49f89816..0000000000 --- a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_start_blinking_starpoints.s +++ /dev/null @@ -1,18 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.include "include/macro.inc" - -glabel status_menu_start_blinking_starpoints -/* 082F94 800E9AE4 3C038011 */ lui $v1, 0x8011 -/* 082F98 800E9AE8 2463EF58 */ addiu $v1, $v1, -0x10a8 -/* 082F9C 800E9AEC 80620052 */ lb $v0, 0x52($v1) -/* 082FA0 800E9AF0 24040001 */ addiu $a0, $zero, 1 -/* 082FA4 800E9AF4 10440003 */ beq $v0, $a0, .L800E9B04 -/* 082FA8 800E9AF8 00000000 */ nop -/* 082FAC 800E9AFC A0640052 */ sb $a0, 0x52($v1) -/* 082FB0 800E9B00 A0600053 */ sb $zero, 0x53($v1) -.L800E9B04: -/* 082FB4 800E9B04 03E00008 */ jr $ra -/* 082FB8 800E9B08 00000000 */ nop - diff --git a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_stop_blinking_coins.s b/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_stop_blinking_coins.s deleted file mode 100644 index dc038d676d..0000000000 --- a/papermario/asm/nonmatchings/code_80850_len_3060/status_menu_stop_blinking_coins.s +++ /dev/null @@ -1,18 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.include "include/macro.inc" - -glabel status_menu_stop_blinking_coins -/* 082EE8 800E9A38 3C038011 */ lui $v1, 0x8011 -/* 082EEC 800E9A3C 2463EF58 */ addiu $v1, $v1, -0x10a8 -/* 082EF0 800E9A40 80620054 */ lb $v0, 0x54($v1) -/* 082EF4 800E9A44 10400004 */ beqz $v0, .L800E9A58 -/* 082EF8 800E9A48 00000000 */ nop -/* 082EFC 800E9A4C A0600054 */ sb $zero, 0x54($v1) -/* 082F00 800E9A50 A0600055 */ sb $zero, 0x55($v1) -/* 082F04 800E9A54 A0600056 */ sb $zero, 0x56($v1) -.L800E9A58: -/* 082F08 800E9A58 03E00008 */ jr $ra -/* 082F0C 800E9A5C 00000000 */ nop - diff --git a/papermario/src/code_80850_len_3060.c b/papermario/src/code_80850_len_3060.c index a9803777f6..29dd80edd0 100644 --- a/papermario/src/code_80850_len_3060.c +++ b/papermario/src/code_80850_len_3060.c @@ -139,7 +139,20 @@ INCLUDE_ASM(code_80850_len_3060, func_800E9900); INCLUDE_ASM(code_80850_len_3060, is_status_menu_visible); -INCLUDE_ASM(code_80850_len_3060, status_menu_start_blinking_hp); +void status_menu_start_blinking_hp(void) { + game_status* gameStatus = (*gGameStatusPtr); + ui_status* uiStatus = &gUIStatus; + ui_status* uiStatus2 = &gUIStatus; + + if (gameStatus->unk_70 == 0) { + uiStatus->hpBlinkTimer = 120; + } + + if (uiStatus2->hpBlinking != 1) { + uiStatus2->hpBlinking = 1; + uiStatus2->hpBlinkCounter = 0; + } +} void status_menu_stop_blinking_hp(void) { ui_status* uiStatus = &gUIStatus; @@ -151,7 +164,20 @@ void status_menu_stop_blinking_hp(void) { } } -INCLUDE_ASM(code_80850_len_3060, status_menu_start_blinking_fp); +void status_menu_start_blinking_fp(void) { + game_status* gameStatus = (*gGameStatusPtr); + ui_status* uiStatus = &gUIStatus; + ui_status* uiStatus2 = &gUIStatus; + + if (gameStatus->unk_70 == 0) { + uiStatus->fpBlinkTimer = 120; + } + + if (uiStatus2->fpBlinking != 1) { + uiStatus2->fpBlinking = 1; + uiStatus2->fpBlinkCounter = 0; + } +} void status_menu_stop_blinking_fp(void) { ui_status* uiStatus = &gUIStatus; @@ -162,7 +188,20 @@ void status_menu_stop_blinking_fp(void) { } } -INCLUDE_ASM(code_80850_len_3060, status_menu_start_blinking_coins); +void status_menu_start_blinking_coins(void) { + game_status* gameStatus = (*gGameStatusPtr); + ui_status* uiStatus = &gUIStatus; + ui_status* uiStatus2 = &gUIStatus; + + if (gameStatus->unk_70 == 0) { + uiStatus->coinsBlinkTimer = 120; + } + + if (uiStatus2->coinsBlinking != 1) { + uiStatus2->coinsBlinking = 1; + uiStatus2->coinsBlinkCounter = 0; + } +} void status_menu_stop_blinking_coins(void) { ui_status* uiStatus = &gUIStatus; @@ -174,7 +213,16 @@ void status_menu_stop_blinking_coins(void) { } } -INCLUDE_ASM(code_80850_len_3060, status_menu_start_blinking_sp); +void status_menu_start_blinking_sp(void) { + player_data *playerData = &gPlayerData; + ui_status* uiStatus = &gUIStatus; + + uiStatus->spBarsToBlink = playerData->maxStarPower; + if (uiStatus->spBlinking != 1) { + uiStatus->spBlinking = 1; + uiStatus->spBlinkCounter = 0; + } +} void status_menu_stop_blinking_sp(void) { ui_status* uiStatus = &gUIStatus; @@ -185,9 +233,24 @@ void status_menu_stop_blinking_sp(void) { } } -INCLUDE_ASM(code_80850_len_3060, status_menu_start_blinking_sp_bars); +void status_menu_start_blinking_sp_bars(s8 numBarsToBlink) { + ui_status* uiStatus = &gUIStatus; -INCLUDE_ASM(code_80850_len_3060, status_menu_start_blinking_starpoints); + uiStatus->spBarsToBlink = numBarsToBlink; + if (uiStatus->spBlinking != 1) { + uiStatus->spBlinking = 1; + uiStatus->spBlinkCounter = 0; + } +} + +void status_menu_start_blinking_starpoints(void) { + ui_status* uiStatus = &gUIStatus; + + if (uiStatus->starpointsBlinking != 1) { + uiStatus->starpointsBlinking = 1; + uiStatus->starpointsBlinkCounter = 0; + } +} void status_menu_stop_blinking_starpoints(void) { ui_status* uiStatus = &gUIStatus;