papermario/src/ebd0_len_6a0.c

162 lines
4.1 KiB
C
Raw Normal View History

#include "common.h"
#include "nu/nusys.h"
#include "ld_addrs.h"
void intro_logos_set_fade_alpha(s16 alpha);
void intro_logos_set_fade_color(s16 color);
s16 intro_logos_fade_in(s16 subtractAlpha);
s16 intro_logos_fade_out(s16 addAlpha);
void intro_logos_update_fade(void);
extern s32 D_800A0904;
extern s32 D_800A0908;
extern s16** D_800778A0;
2020-08-04 08:49:11 +02:00
void intro_logos_set_fade_alpha(s16 alpha) {
gGameStatusPtr->bootAlpha = alpha;
}
2020-08-04 08:49:11 +02:00
void intro_logos_set_fade_color(s16 color) {
gGameStatusPtr->bootRed = color;
gGameStatusPtr->bootGreen = color;
gGameStatusPtr->bootBlue = color;
}
2020-08-04 08:49:11 +02:00
s16 intro_logos_fade_in(s16 subtractAlpha) {
if (gGameStatusPtr->bootAlpha != 0) {
gGameStatusPtr->bootAlpha -= subtractAlpha;
if (gGameStatusPtr->bootAlpha << 16 < 0) {
gGameStatusPtr->bootAlpha = 0;
}
2020-08-12 23:13:09 +02:00
} else {
return 1;
}
return 0;
}
2020-08-04 08:49:11 +02:00
s16 intro_logos_fade_out(s16 addAlpha) {
if (gGameStatusPtr->bootAlpha != 255) {
gGameStatusPtr->bootAlpha += addAlpha;
if (gGameStatusPtr->bootAlpha > 255) {
gGameStatusPtr->bootAlpha = 255;
}
2020-08-12 23:13:09 +02:00
} else {
return 1;
}
return 0;
}
2020-08-04 08:49:11 +02:00
2020-09-24 05:16:13 +02:00
void intro_logos_update_fade(void) {
GameStatus** gameStatus = &gGameStatusPtr;
set_transition_stencil_zoom_0(0, (*gameStatus)->bootAlpha);
set_transition_stencil_color(0, (*gameStatus)->bootBlue, (*gameStatus)->bootGreen, (*gameStatus)->bootRed);
}
2020-09-24 05:16:13 +02:00
void begin_state_battle(void) {
D_800A0900 = 5;
}
2020-08-04 08:49:11 +02:00
#ifdef NON_MATCHING
void step_battle(void) {
s32 phi_a0;
if (D_800A0900 == 5) {
if (D_8009A658[1] != D_8009A64C) {
return;
}
(D_800A0900)--;
gOverrideFlags |= 0x8;
nuContRmbForceStop();
}
if (D_800A0900 >= 0) {
if (D_800A0900 > 0) {
(D_800A0900)--;
} else {
D_800A0900 = -1;
nuGfxSetCfb(&D_800778A0, 2);
nuContRmbForceStopEnd();
sfx_stop_env_sounds();
func_8003B1A8();
gGameStatusPtr->isBattle = TRUE;
allocate_hit_tables();
func_8002D160();
func_802B20B4();
func_80149670(0);
// This part sucks
if ((gGameStatusPtr->peachFlags & 1)) {
if (gBattleStatus.currentBattleSection != 0x26 || gBattleStatus.unk_47B != 0) {
phi_a0 = 5;
} else {
gGameStatusPtr->peachFlags |= 1;
phi_a0 = 6;
}
} else {
gGameStatusPtr->peachFlags |= 1;
phi_a0 = 6;
}
spr_init_sprites(phi_a0);
clear_model_data();
func_80148040();
use_default_background_settings();
clear_entity_models();
func_8011E224();
clear_dynamic_entity_list();
func_801452E8(0, 0);
func_80141100();
reset_status_menu();
clear_item_entity_data();
clear_script_list();
Splat refactor (#257) * all non-world rodata migrated * data disasm * kinda working * updated yaml * bloop * linker header * configure 2.0 * bin * mass rename to remove code_ * pause rename * battle partner stuff * whew * more renames * more renames * more renaming * it builds! * updates * remove main prefix * one more thing * crc, yay0 * .data, .rodata, .bss * img * dead_atan2 * it buildsgit add -A * split battle/partner/6FAD10 * rm &s on sleepy_sheep syms * sha1sum ninja rule description * OK but commented out PaperMarioMapFS and PaperMarioNpcSprites * uncomment * fix mapfs * match func_8003CFB4 * . * clean up and name npc_iter_no_op * npc.c * enable cc warnings * name npc_find_near * use singular options.asset_path * smores * cc_dsl only when needed * kinda fix configure for splat refactor2 * ok! * new msg format * remove old msg format docs * slight bug fixes, splat adjustment * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "cfc140bb76" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "cfc140bb76" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "85349befcd" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "85349befcd" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Update symbol addrs * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "a44631e194" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "a44631e194" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" Co-authored-by: Alex Bates <hi@imalex.xyz>
2021-04-13 09:47:52 +02:00
npc_list_clear();
clear_entity_data(1);
clear_trigger_data();
dma_copy(&_16C8E0_ROM_START, &_16C8E0_ROM_END, &_16C8E0_VRAM);
initialize_battle();
func_802409F4();
load_battle_section();
D_800A0904 = gPlayerStatusPtr->animFlags;
gPlayerStatusPtr->animFlags &= ~0x40;
D_800A0908 = get_time_freeze_mode();
set_time_freeze_mode(0);
gOverrideFlags &= ~0x8;
if (D_800A0900 >= 0) {
return;
}
}
}
update_counters();
update_battle_state();
Splat refactor (#257) * all non-world rodata migrated * data disasm * kinda working * updated yaml * bloop * linker header * configure 2.0 * bin * mass rename to remove code_ * pause rename * battle partner stuff * whew * more renames * more renames * more renaming * it builds! * updates * remove main prefix * one more thing * crc, yay0 * .data, .rodata, .bss * img * dead_atan2 * it buildsgit add -A * split battle/partner/6FAD10 * rm &s on sleepy_sheep syms * sha1sum ninja rule description * OK but commented out PaperMarioMapFS and PaperMarioNpcSprites * uncomment * fix mapfs * match func_8003CFB4 * . * clean up and name npc_iter_no_op * npc.c * enable cc warnings * name npc_find_near * use singular options.asset_path * smores * cc_dsl only when needed * kinda fix configure for splat refactor2 * ok! * new msg format * remove old msg format docs * slight bug fixes, splat adjustment * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "cfc140bb76" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "cfc140bb76" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "85349befcd" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "85349befcd" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Update symbol addrs * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "a44631e194" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "a44631e194" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" Co-authored-by: Alex Bates <hi@imalex.xyz>
2021-04-13 09:47:52 +02:00
npc_list_update();
update_item_entities();
update_effects();
func_80116674();
update_cameras();
}
#else
Splat refactor (#257) * all non-world rodata migrated * data disasm * kinda working * updated yaml * bloop * linker header * configure 2.0 * bin * mass rename to remove code_ * pause rename * battle partner stuff * whew * more renames * more renames * more renaming * it builds! * updates * remove main prefix * one more thing * crc, yay0 * .data, .rodata, .bss * img * dead_atan2 * it buildsgit add -A * split battle/partner/6FAD10 * rm &s on sleepy_sheep syms * sha1sum ninja rule description * OK but commented out PaperMarioMapFS and PaperMarioNpcSprites * uncomment * fix mapfs * match func_8003CFB4 * . * clean up and name npc_iter_no_op * npc.c * enable cc warnings * name npc_find_near * use singular options.asset_path * smores * cc_dsl only when needed * kinda fix configure for splat refactor2 * ok! * new msg format * remove old msg format docs * slight bug fixes, splat adjustment * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "cfc140bb76" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "cfc140bb76" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "85349befcd" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "85349befcd" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Update symbol addrs * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "a44631e194" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "a44631e194" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" Co-authored-by: Alex Bates <hi@imalex.xyz>
2021-04-13 09:47:52 +02:00
INCLUDE_ASM(s32, "ebd0_len_6a0", step_battle);
#endif
2020-08-15 09:01:33 +02:00
void func_80033B54(void) {
2021-02-06 16:20:35 +01:00
draw_encounter_ui();
2020-08-15 09:01:33 +02:00
if (D_800A0900 < 0) {
draw_main_battle_ui();
}
}
void func_80033B88(void) {
gOverrideFlags |= 0x8;
2020-08-15 09:01:33 +02:00
nuContRmbForceStop();
D_800A0900 = 5;
}
Splat refactor (#257) * all non-world rodata migrated * data disasm * kinda working * updated yaml * bloop * linker header * configure 2.0 * bin * mass rename to remove code_ * pause rename * battle partner stuff * whew * more renames * more renames * more renaming * it builds! * updates * remove main prefix * one more thing * crc, yay0 * .data, .rodata, .bss * img * dead_atan2 * it buildsgit add -A * split battle/partner/6FAD10 * rm &s on sleepy_sheep syms * sha1sum ninja rule description * OK but commented out PaperMarioMapFS and PaperMarioNpcSprites * uncomment * fix mapfs * match func_8003CFB4 * . * clean up and name npc_iter_no_op * npc.c * enable cc warnings * name npc_find_near * use singular options.asset_path * smores * cc_dsl only when needed * kinda fix configure for splat refactor2 * ok! * new msg format * remove old msg format docs * slight bug fixes, splat adjustment * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "cfc140bb76" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "cfc140bb76" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "85349befcd" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "85349befcd" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Update symbol addrs * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "a44631e194" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "a44631e194" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" Co-authored-by: Alex Bates <hi@imalex.xyz>
2021-04-13 09:47:52 +02:00
INCLUDE_ASM(s32, "ebd0_len_6a0", func_80033BC0);
2020-08-15 09:01:33 +02:00
void func_80033E64(void) {
2020-08-18 18:43:55 +02:00
}