rename training maze rescue scenario files

This commit is contained in:
DizzyEggg 2025-10-27 16:21:39 +01:00
parent 25aaa28330
commit a3323f495f
34 changed files with 226 additions and 244 deletions

View File

@ -1,11 +1,9 @@
.section .rodata
@ ???
.string "pksdir0\0"
@ ???.c
.string "pksdir0\0"
@ 8109D30
#include "dungeon/dungeon_data.inc"
.align 2,0

View File

@ -70,6 +70,7 @@ u8 *sub_8096DD8(void);
u8 *sub_8096DE8(void);
u8 sub_8096E2C(void);
void sub_8096EEC(WonderMail *mail);
bool8 sub_8096F50(WonderMail *mail);
bool8 ValidateWonderMail(WonderMail *data);
void WriteWonderMailBits(DataSerializer *a, WonderMail *b);

View File

@ -1,26 +0,0 @@
#ifndef GUARD_CODE_80972F4_H
#define GUARD_CODE_80972F4_H
#include "structs/str_wonder_mail.h"
// size: 0x8
typedef struct MissionText
{
/* 0x0 */ const u8 *text;
u8 unk4;
u8 unk5;
u8 unk6;
u8 unk7;
} MissionText;
const u8 *GetCurrentMissionText(s16 index);
bool8 IsMazeCompleted(s16 mazeIndex);
bool8 sub_8096F50(WonderMail *mail);
void sub_8097418(s32 index, bool32);
bool8 sub_8097504(s16 mazeIndex);
const u8 *sub_80975DC(s16);
bool8 sub_8097384(s32 param_1);
bool8 RescueScenarioConquered(s32 param_1);
#endif // GUARD_CODE_80972F4_H

View File

@ -58,4 +58,6 @@ extern const s16 gVoltTackleIQReq;
extern const u8 gDungeonWaterType[76];
extern const struct ExclusivePokemon gExclusivePokemon[NUM_EXCLUSIVE_POKEMON];
bool8 IsWaterDungeon(u32 r0);
#endif // GUARD_DUNGEON_DATA_H

17
include/rescue_scenario.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef GUARD_RESCUE_SCENARIO_H
#define GUARD_RESCUE_SCENARIO_H
#include "structs/str_wonder_mail.h"
void sub_80972F4(void);
void nullsub_128(void);
bool8 sub_8097318(s16 param_1);
void sub_809733C(s16 param_1, u32 param_2);
bool8 sub_8097384(s32 param_1);
void sub_80973A8(s32 param_1, u32 param_2);
bool8 RescueScenarioConquered(s32 param_1);
void sub_8097418(s32 index, bool32);
const u8 *sub_80974A0(s16 index);
const u8 *GetCurrentMissionText(s16 index);
#endif // GUARD_RESCUE_SCENARIO_H

View File

@ -1,8 +1,8 @@
#ifndef GUARD_CODE_8097DD0_H
#define GUARD_CODE_8097DD0_H
#ifndef GUARD_STATUS_STRINGS_H
#define GUARD_STATUS_STRINGS_H
#include "structs/str_status_text.h"
s32 PrepareStatusStringArrays(const char *str, STATUSTEXTS(statuses));
#endif // GUARD_CODE_8097DD0_H
#endif // GUARD_STATUS_STRINGS_H

12
include/training_maze.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef GUARD_TRAINING_MAZE_H
#define GUARD_TRAINING_MAZE_H
void sub_80974E8(void);
bool8 sub_8097504(s16 mazeIndex);
bool8 IsMazeCompleted(s16 mazeIndex);
void sub_80975A8(s16 param_1,u8 param_2);
const u8 *sub_80975DC(s16 r0);
bool8 HasCompletedAllMazes(void);
bool8 sub_8097640(void);
#endif // GUARD_TRAINING_MAZE_H

View File

@ -325,12 +325,12 @@ SECTIONS {
src/play_time.o(.text);
src/code_8094F88.o(.text);
src/code_80958E8.o(.text);
src/code_80972F4.o(.text);
src/code_8097504.o(.text);
src/rescue_scenario.o(.text);
src/training_maze.o(.text);
src/adventure_info.o(.text);
src/adventure_save.o(.text);
src/code_8097DD0.o(.text);
src/code_8097F40.o(.text);
src/status_strings.o(.text);
src/dungeon_data.o(.text);
src/exclusive_pokemon.o(.text);
src/position_util.o(.text);
src/ground_main.o(.text);
@ -714,10 +714,11 @@ SECTIONS {
src/play_time.o(.rodata);
src/code_8094F88.o(.rodata);
src/code_80958E8.o(.rodata);
src/code_80972F4.o(.rodata);
src/code_8097504.o(.rodata);
src/rescue_scenario.o(.rodata);
src/training_maze.o(.rodata);
src/adventure_info.o(.rodata);
src/adventure_save.o(.rodata);
src/status_strings.o(.rodata);
data/data_8109D10.o(.rodata);
src/dungeon_data.o(.rodata);
src/exclusive_pokemon.o(.rodata);

View File

@ -5,6 +5,7 @@
#include "music_util.h"
#include "code_80958E8.h"
#include "code_80A26CC.h"
#include "rescue_scenario.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
@ -61,10 +62,8 @@ ALIGNED(4) const u8 gUnknown_80E0754[] = {0x83, 0xC0};
void sub_802F9C0(void);
void sub_802FA50(void);
const u8 *sub_80974A0(s16 index);
extern bool8 sub_802FCF0(void);
s32 sub_802FBF4(void);
extern u8 sub_8097384(s16);
u32 sub_802F73C(u32 r0, DungeonPos *r1, u32 r2, u8 r3)
{

View File

@ -3,6 +3,7 @@
#include "code_803C1D0.h"
#include "code_80958E8.h"
#include "code_80A26CC.h"
#include "rescue_scenario.h"
#include "constants/dungeon.h"
#include "constants/friend_area.h"
#include "constants/wonder_mail.h"
@ -19,8 +20,6 @@
extern void sub_803C37C(struct DungeonLocation *, u8, u8 *);
extern u8 sub_8097318(s16 param_1);
bool8 sub_8095E38(WonderMail *mail, u8 dungeon, u32 floor, u8 param_4);
u8 sub_8095F28(u8 param_1);
bool8 GenerateMailJobDungeonInfo(WonderMail *mail);

View File

@ -1,8 +0,0 @@
#include "global.h"
#include "dungeon_map_access.h"
#include "dungeon_data.h"
bool8 IsWaterDungeon(u32 r0)
{
return gDungeonWaterType[r0] == DUNGEON_WATER_TYPE_WATER;
}

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "globaldata.h"
#include "code_80972F4.h"
#include "rescue_scenario.h"
#include "code_80A26CC.h"
#include "event_flag.h"
#include "constants/dungeon.h"

View File

@ -1,35 +0,0 @@
static const MissionText sStoryMissionText[] = {
{ _("Rescue Caterpie."), -1, -1, 0, 0 },
{ _("Rescue Magnemite."), -1, -1, 0, 0 },
{ _("Rescue Diglett."), 0, 1, 0, 0 },
{ _("Rescue Metapod."), 2, 3, 0, 0 },
{ _("Rescue Jumpluff."), -1, -1, 0, 0 },
{ _("Rescue Shiftry."), 4, 5, 0, 0 },
{ _("Meet Xatu."), -1, -1, 0, 0 },
{ _("Fugitive"), -1, -1, 0, 0 },
{ _("Fugitive"), 6, 7, 0, 0 },
{ _("Fugitive"), 8, 9, 0, 0 },
{ _("Meet Ninetales."), -1, 10, 0, 0 },
{ _("Rescue Alakazam."), 11, 12, 0, 0 },
{ _("Seek Rayquaza's help."), 14, 15, 0, 0 },
{ _("{COLOR YELLOW_C}Scenario Progress Dummy{RESET}"), -1, -1, 0, 0 },
{ _("Punish bad Mankey."), 16, 17, 0, 0 },
{ _("Rescue Smeargle."), -1, 33, 0, 0 },
{ _("Explore seafloor."), -1, -1, 0, 0 },
{ _("Meet sea guardian."), -1, -1, 0, 0 },
{ _("Check mystery Pokémon."), -1, -1, 0, 0 },
{ _("Meet Xatu."), -1, -1, 0, 0 },
{ _("Mirage Pokémon 1"), 20, 21, 0, 0 },
{ _("Mirage Pokémon 2"), 22, 23, 0, 0 },
{ _("Mirage Pokémon 3"), 24, 25, 0, 0 },
{ _("Mirage Pokémon 4"), -1, 26, 0, 0 },
{ _("Meet toughest Pokémon."), 18, 19, 0, 0 },
{ _("Catch thief."), 27, 28, 0, 0 },
{ _("Rescue Latias."), -1, -1, 0, 0 },
{ _("Investigate Relic."), -1, -1, 0, 0 },
{ _("Rescue Medicham."), -1, 32, 0, 0 },
{ _("Meet Ninetales."), -1, -1, 0, 0 },
{ _("Break Gardevoir's curse."), -1, -1, 0, 0 },
{ NULL, -1, -1, 0, 0 },
};

View File

@ -4,6 +4,11 @@
#include "dungeon_map_access.h"
#include "constants/walkable_tile.h"
bool8 IsWaterDungeon(u32 r0)
{
return gDungeonWaterType[r0] == DUNGEON_WATER_TYPE_WATER;
}
// TODO: gDungeons from `dungeon/dungeon_data.inc`
const u8 gInvalidDungeonIDs[11] =

View File

@ -5,7 +5,7 @@
#include "dungeon_vram.h"
#include "dungeon_tilemap.h"
#include "dungeon_action.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "dungeon_info.h"
#include "dungeon_exit.h"
#include "dungeon_action.h"

View File

@ -3,7 +3,7 @@
#include "dungeon_vram.h"
#include "dungeon_tilemap.h"
#include "dungeon_action.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "dungeon_info.h"
#include "dungeon_action.h"
#include "dungeon_generation.h"

View File

@ -14,7 +14,7 @@
#include "dungeon_tilemap.h"
#include "dungeon_action.h"
#include "dungeon_mon_sprite_render.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "dungeon_action.h"
#include "dungeon_ai_movement.h"
#include "dungeon_items.h"

View File

@ -3,7 +3,7 @@
#include "dungeon_vram.h"
#include "dungeon_tilemap.h"
#include "dungeon_action.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "dungeon_info.h"
#include "dungeon_action.h"
#include "dungeon_engine.h"

View File

@ -11,24 +11,19 @@
#include "rescue_team_info.h"
#include "other_random.h"
#include "friend_area.h"
#include "code_80972F4.h"
#include "rescue_scenario.h"
#include "adventure_info.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "ground_place.h"
#include "ground_main.h"
#include "script_vars_info.h"
#include "training_maze.h"
EWRAM_DATA u8 gScriptVarBuffer[SCRIPT_VAR_BUFFER_LEN] = {0}; // NDS=020876DC
#include "data/event_flag.h"
extern bool8 HasCompletedAllMazes(void);
extern void sub_809733C(u32, u32);
extern void sub_80973A8(u32, u32);
extern void sub_80972F4(void);
extern void nullsub_128(void);
// arm9.bin::0200FF68
void ThoroughlyResetScriptVars(void)
{
@ -556,95 +551,96 @@ bool8 ScriptVarScenarioAfter(s16 varId,u32 pMain,s32 pSub)
// arm9.bin::0200ECE0
void sub_8001D88(void)
{
u32 local_c;
u32 auStack8;
u32 local_c;
u32 auStack8;
GetScriptVarScenario(3, &auStack8, &local_c);
if (auStack8 < 1 || auStack8 > 0x1b)
return;
GetScriptVarScenario(3, &auStack8, &local_c);
if (auStack8 - 1 < 0x1b) {
if (ScriptVarScenarioBefore(SCENARIO_SUB1,0x1f,0) != 0) {
if (ScriptVarScenarioAfter(SCENARIO_MAIN,0xf,7) != 0) {
ScenarioCalc(SCENARIO_SUB1,0x1f,0);
sub_8097418(0xe,1);
SetScriptVarValue(NULL,BASE_LEVEL,2);
}
else {
if ((ScriptVarScenarioEqual(SCENARIO_SUB1,0,0)) && (ScriptVarScenarioAfter(SCENARIO_MAIN,0xf,3))) {
ScenarioCalc(SCENARIO_SUB1,0x1d,1);
if (ScriptVarScenarioAfter(SCENARIO_MAIN,0xf,7) != 0) {
ScenarioCalc(SCENARIO_SUB1,0x1f,0);
sub_8097418(0xe,1);
SetScriptVarValue(NULL,BASE_LEVEL,2);
}
else {
if ((ScriptVarScenarioEqual(SCENARIO_SUB1,0,0)) && (ScriptVarScenarioAfter(SCENARIO_MAIN,0xf,3))) {
ScenarioCalc(SCENARIO_SUB1,0x1d,1);
}
}
}
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB1,0x1f,0)) && (GetFriendAreaStatus(SKY_BLUE_PLAINS))) {
ScenarioCalc(SCENARIO_SUB1,0x1f,1);
sub_809733C(0xf,1);
ScenarioCalc(SCENARIO_SUB1,0x1f,1);
sub_809733C(0xf,1);
}
if (auStack8 > 0x11) {
sub_80973A8(0x25,1);
if (((FindItemInInventory(ITEM_HM_DIVE) != -1) || (gTeamInventoryRef->teamStorage[ITEM_HM_DIVE] != 0)) ||
(ScriptVarScenarioAfter(SCENARIO_SUB2,0x21,3) != 0)) {
sub_80973A8(0x22,1);
}
if (GetFriendAreaStatus(FURNACE_DESERT) != 0) {
sub_80973A8(0x1f,1);
}
if (GetFriendAreaStatus(BOULDER_CAVE)) {
sub_80973A8(0x20,1);
}
if (GetFriendAreaStatus(DRAGON_CAVE)) {
sub_80973A8(0x21,1);
}
if (GetFriendAreaStatus(SECRETIVE_FOREST)) {
sub_80973A8(0x23,1);
}
if (GetFriendAreaStatus(SERENE_SEA)) {
sub_80973A8(0x24,1);
sub_80973A8(0x28,1);
}
if ((GetFriendAreaStatus(AGED_CHAMBER_AN)) && (GetFriendAreaStatus(AGED_CHAMBER_O_EXCLAIM))) {
sub_80973A8(0x26,1);
}
if (ScriptVarScenarioEqual(SCENARIO_SUB2,0,0)) {
ScenarioCalc(SCENARIO_SUB2,0x21,1);
}
if ((FindItemInInventory(ITEM_HM_SURF) != -1) || (gTeamInventoryRef->teamStorage[ITEM_HM_SURF] != 0)) {
if (ScriptVarScenarioEqual(SCENARIO_SUB4,0,0)) {
ScenarioCalc(SCENARIO_SUB4,0x26,1);
sub_80973A8(0x25,1);
if (((FindItemInInventory(ITEM_HM_DIVE) != -1) || (gTeamInventoryRef->teamStorage[ITEM_HM_DIVE] != 0)) ||
(ScriptVarScenarioAfter(SCENARIO_SUB2,0x21,3) != 0)) {
sub_80973A8(0x22,1);
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB6,0,0)) && (GetFriendAreaStatus(SOUTHERN_ISLAND))) {
ScenarioCalc(SCENARIO_SUB6,0x2e,1);
if (GetFriendAreaStatus(FURNACE_DESERT) != 0) {
sub_80973A8(0x1f,1);
}
}
if (!ScriptVarScenarioBefore(SCENARIO_SUB6,0x30,0)) {
if ((ScriptVarScenarioEqual(SCENARIO_SUB2,0x22,0)) && HasRecruitedMon(MONSTER_ARTICUNO) && HasRecruitedMon(MONSTER_ZAPDOS) && HasRecruitedMon(MONSTER_MOLTRES)) {
ScenarioCalc(SCENARIO_SUB2,0x22,1);
if (GetFriendAreaStatus(BOULDER_CAVE)) {
sub_80973A8(0x20,1);
}
if (((ScriptVarScenarioEqual(SCENARIO_SUB8,0,0)) && (ScriptVarScenarioAfter(SCENARIO_SUB2,0x21,3) != 0)) &&
(GetFriendAreaStatus(SKY_BLUE_PLAINS))) {
ScenarioCalc(SCENARIO_SUB8,0x33,1);
if (GetFriendAreaStatus(DRAGON_CAVE)) {
sub_80973A8(0x21,1);
}
if (GetFriendAreaStatus(SKY_BLUE_PLAINS)) {
sub_80973A8(0x27,1);
if (GetFriendAreaStatus(SECRETIVE_FOREST)) {
sub_80973A8(0x23,1);
}
if (GetFriendAreaStatus(SKY_BLUE_PLAINS)) {
sub_80973A8(0x29,1);
if (GetFriendAreaStatus(SERENE_SEA)) {
sub_80973A8(0x24,1);
sub_80973A8(0x28,1);
}
}
if (!ScriptVarScenarioBefore(SCENARIO_SUB2,0x22,0)) {
if (ScriptVarScenarioEqual(SCENARIO_SUB7,0,0)) {
ScenarioCalc(SCENARIO_SUB7,0x31,1);
sub_809733C(0x1b,1);
if ((GetFriendAreaStatus(AGED_CHAMBER_AN)) && (GetFriendAreaStatus(AGED_CHAMBER_O_EXCLAIM))) {
sub_80973A8(0x26,1);
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB9,0,0)) && (!ScriptVarScenarioBefore(SCENARIO_SUB8,0x34,0))) {
ScenarioCalc(SCENARIO_SUB9,0x35,1);
if (ScriptVarScenarioEqual(SCENARIO_SUB2,0,0)) {
ScenarioCalc(SCENARIO_SUB2,0x21,1);
}
if ((FindItemInInventory(ITEM_HM_SURF) != -1) || (gTeamInventoryRef->teamStorage[ITEM_HM_SURF] != 0)) {
if (ScriptVarScenarioEqual(SCENARIO_SUB4,0,0)) {
ScenarioCalc(SCENARIO_SUB4,0x26,1);
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB6,0,0)) && (GetFriendAreaStatus(SOUTHERN_ISLAND))) {
ScenarioCalc(SCENARIO_SUB6,0x2e,1);
}
}
if (!ScriptVarScenarioBefore(SCENARIO_SUB6,0x30,0)) {
if ((ScriptVarScenarioEqual(SCENARIO_SUB2,0x22,0)) && HasRecruitedMon(MONSTER_ARTICUNO) && HasRecruitedMon(MONSTER_ZAPDOS) && HasRecruitedMon(MONSTER_MOLTRES)) {
ScenarioCalc(SCENARIO_SUB2,0x22,1);
}
if (((ScriptVarScenarioEqual(SCENARIO_SUB8,0,0)) && (ScriptVarScenarioAfter(SCENARIO_SUB2,0x21,3) != 0)) &&
(GetFriendAreaStatus(SKY_BLUE_PLAINS))) {
ScenarioCalc(SCENARIO_SUB8,0x33,1);
}
if (GetFriendAreaStatus(SKY_BLUE_PLAINS)) {
sub_80973A8(0x27,1);
}
if (GetFriendAreaStatus(SKY_BLUE_PLAINS)) {
sub_80973A8(0x29,1);
}
}
if (!ScriptVarScenarioBefore(SCENARIO_SUB2,0x22,0)) {
if (ScriptVarScenarioEqual(SCENARIO_SUB7,0,0)) {
ScenarioCalc(SCENARIO_SUB7,0x31,1);
sub_809733C(0x1b,1);
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB9,0,0)) && (!ScriptVarScenarioBefore(SCENARIO_SUB8,0x34,0))) {
ScenarioCalc(SCENARIO_SUB9,0x35,1);
}
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB3,0,0)) && (HasRecruitedMon(MONSTER_LUGIA))) {
ScenarioCalc(SCENARIO_SUB3,0x24,1);
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB5,0,0)) && (HasRecruitedMon(MONSTER_HO_OH))) {
ScenarioCalc(SCENARIO_SUB5,0x2c,1);
}
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB3,0,0)) && (HasRecruitedMon(MONSTER_LUGIA))) {
ScenarioCalc(SCENARIO_SUB3,0x24,1);
}
if ((ScriptVarScenarioEqual(SCENARIO_SUB5,0,0)) && (HasRecruitedMon(MONSTER_HO_OH))) {
ScenarioCalc(SCENARIO_SUB5,0x2c,1);
}
}
}
}
// arm9.bin::0200EC08

View File

@ -1,16 +1,8 @@
#include "global.h"
#include "globaldata.h"
#include "exclusive_pokemon.h"
#include "dungeon_data.h"
const u8 filler_ex0[8] =
{
'p', 'k', 's', 'd', 'i', 'r', '0', 0
};
const u8 filler_ex1[8] =
{
'p', 'k', 's', 'd', 'i', 'r', '0', 0
};
EWRAM_INIT struct ExclusivePokemonData *gUnknown_203B498 = {0};
EWRAM_DATA struct ExclusivePokemonData gExclusivePokemonInfo = {0};
@ -170,7 +162,6 @@ void WriteExclusivePokemon(DataSerializer *r0)
neg_1 = -1;
zero = 0;
WriteBits(r0, gUnknown_203B498, 1);
for(index = 0; index < MONSTER_MAX; index++)
{

View File

@ -11,7 +11,7 @@
#include "code_8099360.h"
#include "code_8094F88.h"
#include "code_80958E8.h"
#include "code_80972F4.h"
#include "rescue_scenario.h"
#include "adventure_info.h"
#include "code_80A26CC.h"
#include "debug.h"
@ -54,15 +54,12 @@
#include "ground_object.h"
#include "ground_weather.h"
#include "code_809D148.h"
#include "training_maze.h"
// Beware of the declarations without specified arguments, returning u32 or s32, these were quickly hacked in to get the code to compile and link
// The return values are almost certainly NOT correct and will need to be rechecked when moving to header files
char sub_8002984(s32, u8);
bool8 sub_802FCF0(void);
void sub_809733C(s16, bool8);
void sub_80973A8(s16, bool8);
void sub_80975A8(s16, bool8);
void GroundScriptLockJumpZero(s16);
bool8 sub_8099B94(void);
PixelPos SetVecFromDirectionSpeed(s8, s32);
bool8 sub_80961D8(void);
@ -70,7 +67,6 @@ void ResetMailbox(void);
void sub_80963FC(void);
void sub_8096488(void);
bool8 sub_80964B4(void);
bool8 sub_8097640();
u8 sub_80964E4();
// For gScriptLocks, gScriptLockConds, gUnlockBranchLabels

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "globaldata.h"
#include "music_util.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "input.h"
#include "iq_skill_info_menu.h"
#include "memory.h"

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "globaldata.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "constants/colors.h"
#include "constants/type.h"
#include "code_800D090.h"

View File

@ -4,7 +4,7 @@
#include "constants/input.h"
#include "code_800D090.h"
#include "music_util.h"
#include "code_80972F4.h"
#include "training_maze.h"
#include "code_80A26CC.h"
#include "dungeon_info.h"
#include "input.h"

View File

@ -4,7 +4,7 @@
#include "constants/monster.h"
#include "code_800D090.h"
#include "data_serializer.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "def_filearchives.h"
#include "memory.h"
#include "moves.h"

View File

@ -5,7 +5,7 @@
#include "constants/monster.h"
#include "constants/tactic.h"
#include "code_800D090.h"
#include "code_8097DD0.h"
#include "status_strings.h"
#include "cpu.h"
#include "decompress_at.h"
#include "def_filearchives.h"

View File

@ -6,7 +6,7 @@
#include "music_util.h"
#include "code_8094F88.h"
#include "code_80958E8.h"
#include "code_80972F4.h"
#include "rescue_scenario.h"
#include "code_8099360.h"
#include "code_80A26CC.h"
#include "input.h"
@ -19,6 +19,7 @@
#include "text_1.h"
#include "text_3.h"
#include "ground_main.h"
#include "training_maze.h"
static EWRAM_INIT unkStruct_203B330 *sUnknown_203B330 = {NULL};

View File

@ -1,13 +1,56 @@
#include "global.h"
#include "globaldata.h"
#include "rescue_scenario.h"
#include "dungeon_info.h"
#include "event_flag.h"
#include "exclusive_pokemon.h"
#include "code_80958E8.h"
#include "code_80972F4.h"
#include "code_80A26CC.h"
#include "data/story_missions.h"
// size: 0x8
typedef struct MissionText
{
/* 0x0 */ const u8 *text;
u8 unk4;
u8 unk5;
u8 unk6;
u8 unk7;
} MissionText;
static const MissionText sStoryMissionText[] = {
{ _("Rescue Caterpie."), -1, -1, 0, 0 },
{ _("Rescue Magnemite."), -1, -1, 0, 0 },
{ _("Rescue Diglett."), 0, 1, 0, 0 },
{ _("Rescue Metapod."), 2, 3, 0, 0 },
{ _("Rescue Jumpluff."), -1, -1, 0, 0 },
{ _("Rescue Shiftry."), 4, 5, 0, 0 },
{ _("Meet Xatu."), -1, -1, 0, 0 },
{ _("Fugitive"), -1, -1, 0, 0 },
{ _("Fugitive"), 6, 7, 0, 0 },
{ _("Fugitive"), 8, 9, 0, 0 },
{ _("Meet Ninetales."), -1, 10, 0, 0 },
{ _("Rescue Alakazam."), 11, 12, 0, 0 },
{ _("Seek Rayquaza's help."), 14, 15, 0, 0 },
{ _("{COLOR YELLOW_C}Scenario Progress Dummy{RESET}"), -1, -1, 0, 0 },
{ _("Punish bad Mankey."), 16, 17, 0, 0 },
{ _("Rescue Smeargle."), -1, 33, 0, 0 },
{ _("Explore seafloor."), -1, -1, 0, 0 },
{ _("Meet sea guardian."), -1, -1, 0, 0 },
{ _("Check mystery Pokémon."), -1, -1, 0, 0 },
{ _("Meet Xatu."), -1, -1, 0, 0 },
{ _("Mirage Pokémon 1"), 20, 21, 0, 0 },
{ _("Mirage Pokémon 2"), 22, 23, 0, 0 },
{ _("Mirage Pokémon 3"), 24, 25, 0, 0 },
{ _("Mirage Pokémon 4"), -1, 26, 0, 0 },
{ _("Meet toughest Pokémon."), 18, 19, 0, 0 },
{ _("Catch thief."), 27, 28, 0, 0 },
{ _("Rescue Latias."), -1, -1, 0, 0 },
{ _("Investigate Relic."), -1, -1, 0, 0 },
{ _("Rescue Medicham."), -1, 32, 0, 0 },
{ _("Meet Ninetales."), -1, -1, 0, 0 },
{ _("Break Gardevoir's curse."), -1, -1, 0, 0 },
{ NULL, -1, -1, 0, 0 },
};
ALIGNED(4) const u8 gDummyScenarioText[] = _("{COLOR YELLOW_C}Scenario try dummy{RESET}");
ALIGNED(4) const u8 gBlankMission[] = _("{COLOR RED_W}???{RESET}");
@ -23,26 +66,17 @@ void sub_80972F4(void)
void nullsub_128(void)
{}
s32 sub_8097318(s16 param_1)
bool8 sub_8097318(s16 param_1)
{
s32 iVar1;
s32 param_1_s32;
s32 param_1_s32 = param_1;
param_1_s32 = param_1;
if (param_1_s32 == 0xd)
return FALSE;
if (param_1_s32 == 0xd) {
iVar1 = 0;
}
else {
iVar1 = GetScriptVarArrayValue(NULL,RESCUE_SCENARIO_ORDER_LIST, (u16) param_1_s32);
if (iVar1 != 0) {
iVar1 = 1;
}
}
return iVar1;
return GetScriptVarArrayValue(NULL,RESCUE_SCENARIO_ORDER_LIST, (u16) param_1_s32) != 0;
}
void sub_809733C(s16 param_1,u32 param_2)
void sub_809733C(s16 param_1, u32 param_2)
{
s32 uVar2;
u8 param_2_u8;
@ -81,7 +115,7 @@ bool8 sub_8097384(s32 param_1)
}
}
void sub_80973A8(s32 param_1,u32 param_2)
void sub_80973A8(s32 param_1, u32 param_2)
{
s32 sVar1;
s32 param_1_s32 = (s16)param_1;
@ -111,7 +145,7 @@ bool8 RescueScenarioConquered(s32 param_1)
}
}
void sub_8097418(s32 index,bool32 param_2)
void sub_8097418(s32 index, bool32 param_2)
{
int index_s32 = (s16)index;
bool8 param_2_u8 = param_2;
@ -133,7 +167,7 @@ void sub_8097418(s32 index,bool32 param_2)
}
}
const u8 *sub_809747C(s16 index)
UNUSED static const u8 *sub_809747C(s16 index)
{
if(index == 0xD)
{
@ -169,13 +203,3 @@ const u8 *GetCurrentMissionText(s16 index)
return gBlankMission;
}
}
void sub_80974E8(void)
{
ClearScriptVarArray(NULL, TRAINING_CONQUEST_LIST);
ClearScriptVarArray(NULL, TRAINING_PRESENT_LIST);
}
void nullsub_208(void)
{
}

View File

@ -13,6 +13,8 @@
#include "pokemon_3.h"
#include "random.h"
#include "adventure_save.h"
#include "training_maze.h"
#include "rescue_scenario.h"
// size: 0x800
struct unk_struct
@ -44,8 +46,6 @@ extern u32 sub_8095624(u8 *, u32);
extern u32 RestoreMailInfo(void* a, s32 b);
extern u32 SaveMailInfo(u8 *, u32);
extern void sub_80958E4(u32 *a, u32 b);
extern void sub_80972F4(void);
extern void sub_80974E8(void);
u32 sub_8011C1C(void)
{

View File

@ -1,4 +1,6 @@
#include "global.h"
#include "globaldata.h"
#include "status_strings.h"
#include "structs/str_status_text.h"
#include "strings.h"
#include "decompress_3.h"
@ -27,7 +29,7 @@ s32 PrepareStatusStringArrays(const char *str, STATUSTEXTS(statuses))
if (gStatusDescriptions[i].name == NULL)
break;
for (j = 0; j < 100; j++) {
for (j = 0; j < ARRAY_COUNT_INT(formattedStatusString); j++) {
if (gStatusDescriptions[i].name[j] == '#' && gStatusDescriptions[i].name[j + 1] == 'r') {
formattedStatusString[j++] = '#';
formattedStatusString[j++] = 'r';

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "globaldata.h"
#include "strings.h"
#include "constants/friend_area.h"
#include "constants/tactic.h"

View File

@ -1,14 +1,25 @@
#include "global.h"
#include "globaldata.h"
#include "training_maze.h"
#include "constants/dungeon.h"
#include "dungeon_info.h"
#include "event_flag.h"
#include "code_80A26CC.h"
#include "code_80972F4.h"
#include "rescue_scenario.h"
ALIGNED(4) const char gMeetNinetalesText[] = "Meet Ninetales.";
ALIGNED(4) const char gAvoidCaptureText[] = "Avoid capture.";
ALIGNED(4) const char gFinalScenarioText[] = _("Defeat the final Pokémon.");
ALIGNED(4) static const char gMeetNinetalesText[] = "Meet Ninetales.";
ALIGNED(4) static const char gAvoidCaptureText[] = "Avoid capture.";
ALIGNED(4) static const char gFinalScenarioText[] = _("Defeat the final Pokémon.");
void sub_80974E8(void)
{
ClearScriptVarArray(NULL, TRAINING_CONQUEST_LIST);
ClearScriptVarArray(NULL, TRAINING_PRESENT_LIST);
}
UNUSED static void nullsub_208(void)
{
}
bool8 sub_8097504(s16 mazeIndex)
{
@ -68,15 +79,15 @@ void sub_80975A8(s16 param_1,u8 param_2)
SetScriptVarArrayValue(NULL,TRAINING_CONQUEST_LIST,param_1_u16,param_2);
}
const u8 *sub_80975C4(s16 index)
UNUSED static const u8 *sub_80975C4(s16 index)
{
return GetDungeonName1(sub_80A2728(index));
}
const u8 *sub_80975DC(s16 r0)
{
if(r0 == 23 || r0 == 24) {
if(ScriptVarScenarioEqual(SCENARIO_MAIN, 0xE, -1))
if (r0 == 23 || r0 == 24) {
if (ScriptVarScenarioEqual(SCENARIO_MAIN, 0xE, -1))
return gMeetNinetalesText;
else
return gAvoidCaptureText;
@ -88,9 +99,8 @@ const u8 *sub_80975DC(s16 r0)
bool8 HasCompletedAllMazes(void)
{
s32 index;
for(index = 0; index < NUM_BASIC_DUNGEON_MAZE; index++)
{
if(!(bool8)IsMazeCompleted(index))
for (index = 0; index < NUM_BASIC_DUNGEON_MAZE; index++) {
if(!IsMazeCompleted(index))
return FALSE;
}
return TRUE;
@ -98,14 +108,11 @@ bool8 HasCompletedAllMazes(void)
bool8 sub_8097640(void)
{
if(GetScriptVarArrayValue(NULL, TRAINING_CONQUEST_LIST, 0x1F) == 0 && HasCompletedAllMazes())
{
if (GetScriptVarArrayValue(NULL, TRAINING_CONQUEST_LIST, 0x1F) == 0 && HasCompletedAllMazes()) {
SetScriptVarArrayValue(NULL, TRAINING_CONQUEST_LIST, 0x1F, 1);
return TRUE;
}
else
{
else {
return FALSE;
}
}

View File

@ -3,14 +3,13 @@
#include "unk_dungeon_load.h"
#include "memory.h"
#include "dungeon_info.h"
#include "dungeon_data.h"
#include "decompress_at.h"
#include "def_filearchives.h"
#include "file_system.h"
#include "constants/dungeon.h"
#include "structs/dungeon_mapparam.h"
extern bool8 IsWaterDungeon(u32 r0);
static s32 sub_80ADFB8(s32 a0, s32 a1, s32 a2, s32 a3, u16 *a4, s32 a5, u8 *a6, s32 a7);
// This function is called when loading a transition between a dungeon and its summit, where the player can continue, save, or go back.

View File

@ -4,7 +4,7 @@
#include "code_802DE84.h"
#include "code_803B050.h"
#include "code_80958E8.h"
#include "code_80972F4.h"
#include "rescue_scenario.h"
#include "code_8099360.h"
#include "common_strings.h"
#include "input.h"