add script dungeon constants

This commit is contained in:
DizzyEggg 2025-06-19 17:27:43 +02:00
parent beea0c5997
commit ebce57ce6a
25 changed files with 403 additions and 272 deletions

View File

@ -26,7 +26,7 @@ s16 sub_80A26B8(s16);
s16 sub_80A26CC(s16);
u8 sub_80A270C(s16 index);
u8 sub_80A2728(s16 index);
u8 sub_80A2740(s16 index);
u8 ScriptDungeonIdToDungeonId(s16 index);
s16 sub_80A2750(s16);
bool8 sub_80A27CC(s16);
bool8 sub_80A2824(u8 index);

View File

@ -0,0 +1,92 @@
#ifndef GUARD_CONSTANTS_SCRIPT_DUNGEON_ID_H
#define GUARD_CONSTANTS_SCRIPT_DUNGEON_ID_H
enum ScriptDungeonId
{
SCRIPT_DUNGEON_TINY_WOODS,
SCRIPT_DUNGEON_THUNDERWAVE_CAVE,
SCRIPT_DUNGEON_MT_STEEL,
SCRIPT_DUNGEON_3,
SCRIPT_DUNGEON_SINISTER_WOODS,
SCRIPT_DUNGEON_5,
SCRIPT_DUNGEON_SILENT_CHASM,
SCRIPT_DUNGEON_MT_THUNDER,
SCRIPT_DUNGEON_MT_THUNDER_PEAK,
SCRIPT_DUNGEON_GREAT_CANYON,
SCRIPT_DUNGEON_LAPIS_CAVE,
SCRIPT_DUNGEON_MT_BLAZE,
SCRIPT_DUNGEON_MT_BLAZE_PEAK,
SCRIPT_DUNGEON_FROSTY_FOREST,
SCRIPT_DUNGEON_FROSTY_GROTTO,
SCRIPT_DUNGEON_MT_FREEZE,
SCRIPT_DUNGEON_MT_FREEZE_PEAK,
SCRIPT_DUNGEON_MAGMA_CAVERN,
SCRIPT_DUNGEON_MAGMA_CAVERN_PIT,
SCRIPT_DUNGEON_SKY_TOWER,
SCRIPT_DUNGEON_SKY_TOWER_SUMMIT,
SCRIPT_DUNGEON_21,
SCRIPT_DUNGEON_UPROAR_FOREST,
SCRIPT_DUNGEON_HOWLING_FOREST,
SCRIPT_DUNGEON_STORMY_SEA,
SCRIPT_DUNGEON_SILVER_TRENCH,
SCRIPT_DUNGEON_METEOR_CAVE,
SCRIPT_DUNGEON_GREAT_CANYON_2,
SCRIPT_DUNGEON_FIERY_FIELD,
SCRIPT_DUNGEON_LIGHTNING_FIELD,
SCRIPT_DUNGEON_NORTHWIND_FIELD,
SCRIPT_DUNGEON_MT_FARAWAY,
SCRIPT_DUNGEON_WESTERN_CAVE,
SCRIPT_DUNGEON_NORTHERN_RANGE,
SCRIPT_DUNGEON_PITFALL_VALLEY,
SCRIPT_DUNGEON_BURIED_RELIC,
SCRIPT_DUNGEON_WISH_CAVE,
SCRIPT_DUNGEON_MT_FREEZE_2,
SCRIPT_DUNGEON_MT_FREEZE_PEAK_2,
SCRIPT_DUNGEON_MURKY_CAVE,
SCRIPT_DUNGEON_DESERT_REGION,
SCRIPT_DUNGEON_SOUTHERN_CAVERN,
SCRIPT_DUNGEON_WYVERN_HILL,
SCRIPT_DUNGEON_SOLAR_CAVE,
SCRIPT_DUNGEON_DARKNIGHT_RELIC,
SCRIPT_DUNGEON_GRAND_SEA,
SCRIPT_DUNGEON_WATERFALL_POND,
SCRIPT_DUNGEON_UNKNOWN_RELIC,
SCRIPT_DUNGEON_JOYOUS_TOWER,
SCRIPT_DUNGEON_FAR_OFF_SEA,
SCRIPT_DUNGEON_PURITY_FOREST,
SCRIPT_DUNGEON_ODDITY_CAVE,
SCRIPT_DUNGEON_REMAINS_ISLAND,
SCRIPT_DUNGEON_MARVELOUS_SEA,
SCRIPT_DUNGEON_FANTASY_STRAIT,
SCRIPT_DUNGEON_NORMAL_MAZE_2,
SCRIPT_DUNGEON_FIRE_MAZE,
SCRIPT_DUNGEON_WATER_MAZE,
SCRIPT_DUNGEON_GRASS_MAZE,
SCRIPT_DUNGEON_ELECTRIC_MAZE,
SCRIPT_DUNGEON_ICE_MAZE,
SCRIPT_DUNGEON_FIGHTING_MAZE,
SCRIPT_DUNGEON_GROUND_MAZE,
SCRIPT_DUNGEON_FLYING_MAZE,
SCRIPT_DUNGEON_PSYCHIC_MAZE,
SCRIPT_DUNGEON_POISON_MAZE_2,
SCRIPT_DUNGEON_BUG_MAZE,
SCRIPT_DUNGEON_ROCK_MAZE,
SCRIPT_DUNGEON_GHOST_MAZE,
SCRIPT_DUNGEON_DRAGON_MAZE,
SCRIPT_DUNGEON_DARK_MAZE,
SCRIPT_DUNGEON_STEEL_MAZE,
SCRIPT_DUNGEON_TEAM_SHIFTY,
SCRIPT_DUNGEON_TEAM_CONSTRICTOR,
SCRIPT_DUNGEON_TEAM_HYDRO,
SCRIPT_DUNGEON_TEAM_RUMBLEROCK,
SCRIPT_DUNGEON_RESCUE_TEAM_2,
SCRIPT_DUNGEON_RESCUE_TEAM_MAZE,
SCRIPT_DUNGEON_ROCK_PATH,
SCRIPT_DUNGEON_SNOW_PATH,
SCRIPT_DUNGEON_80,
SCRIPT_DUNGEON_81,
SCRIPT_DUNGEON_82,
SCRIPT_DUNGEON_COUNT,
};
#endif // GUARD_CONSTANTS_SCRIPT_DUNGEON_ID_H

View File

@ -1,7 +1,7 @@
#include "constants/event_flag.h"
#include "constants/item.h"
#include "constants/ground_map.h"
#include "constants/dungeon.h"
#include "constants/script_dungeon_id.h"
#include "portrait_placement.h"
#include "structs/str_ground_script.h"
#define LPARRAY(x) (ARRAY_COUNT(x)), x
@ -10,7 +10,7 @@
#define CPOS_CURRENT 0x4
// 01..07: complex map/dungeon selection/check commands
#define NEXT_DUNGEON(u, d) { 0x02, 0, u, d, 0, NULL } // Seems to be a general command for setting up which dungeon to enter next. First argument is unknown.
#define NEXT_DUNGEON(u, d) { 0x02, 0, u, d, 0, NULL } // Seems to be a general command for setting up which dungeon to enter next. First argument is unknown. The second argument is script dungeon id(not the one in dungeon/constants.h). There's a different ordering and a table with the proper dungeon id.
#define SELECT_MAP(m) { 0x08, 0, 0, m, 0, NULL }
#define SELECT_GROUND(m) { 0x09, 0, 0, m, 0, NULL }

File diff suppressed because it is too large Load Diff

View File

@ -64,7 +64,7 @@ static const struct ScriptCommand s_gs178_g1_s0_station_sref_script[] = { /* 0x8
{ 0x3b, 0x39, 0x0004, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
BGM_FADEOUT(30),
NEXT_DUNGEON(30, DUNGEON_TINY_WOODS),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_TINY_WOODS),
RET,
};
@ -369,7 +369,7 @@ static const struct ScriptCommand s_gs178_g2_s0_station_sref_script[] = { /* 0x8
{ 0x22, 0x01, 0x003c, 0x00000000, 0x00000000, NULL },
{ 0x3b, 0x39, 0x0004, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(30, DUNGEON_TINY_WOODS),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_TINY_WOODS),
RET,
};

View File

@ -26,7 +26,7 @@ static const struct ScriptCommand s_gs180_g1_s0_station_sref_script[] = { /* 0x8
BGM_SWITCH(14),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, DUNGEON_THUNDERWAVE_CAVE),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_THUNDERWAVE_CAVE),
RET,
};
@ -140,7 +140,7 @@ static const struct ScriptCommand s_gs180_g2_s0_station_sref_script[] = { /* 0x8
BGM_SWITCH(14),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, DUNGEON_THUNDERWAVE_CAVE),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_THUNDERWAVE_CAVE),
RET,
};

View File

@ -10,7 +10,7 @@
static const struct ScriptCommand s_gs184_g0_s0_station_sref_script[] = { /* 0x82342f4 */
DEBUGINFO,
SELECT_MAP(184),
SELECT_MAP(MAP_SINISTER_WOODS_ENTRY),
BGM_STOP,
JUMP_SCRIPT(COMMON_ENTER),
};
@ -19,12 +19,12 @@ static const struct ScriptRef s_gs184_g0_s0_station_sref = { 404, 1, NULL /* ENT
static const struct ScriptCommand s_gs184_g1_s0_station_sref_script[] = { /* 0x823436c */
DEBUGINFO,
SELECT_MAP(184),
SELECT_MAP(MAP_SINISTER_WOODS_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(15),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(30, 0x00000004),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_SINISTER_WOODS),
RET,
};
@ -76,12 +76,12 @@ static const struct ScriptCommand s_gs184_g1_s0_lives1_dlg0[] = { /* 0x8234714 *
static const struct ScriptCommand s_gs184_g2_s0_station_sref_script[] = { /* 0x82347a4 */
DEBUGINFO,
SELECT_MAP(184),
SELECT_MAP(MAP_SINISTER_WOODS_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(15),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(30, 0x00000004),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_SINISTER_WOODS),
RET,
};

View File

@ -11,7 +11,7 @@
static const struct ScriptCommand s_gs186_g0_s0_station_sref_script[] = { /* 0x8235a04 */
DEBUGINFO,
SELECT_MAP(186),
SELECT_MAP(MAP_SILENT_CHASM_ENTRY),
BGM_STOP,
JUMP_SCRIPT(COMMON_ENTER),
};
@ -20,13 +20,13 @@ static const struct ScriptRef s_gs186_g0_s0_station_sref = { 404, 1, NULL /* ENT
static const struct ScriptCommand s_gs186_g1_s0_station_sref_script[] = { /* 0x8235a7c */
DEBUGINFO,
SELECT_MAP(186),
SELECT_MAP(MAP_SILENT_CHASM_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(113),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
{ 0x23, 0x01, 0x0001, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, 0x00000006),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_SILENT_CHASM),
RET,
};

View File

@ -11,7 +11,7 @@
static const struct ScriptCommand s_gs188_g0_s0_station_sref_script[] = { /* 0x8239178 */
DEBUGINFO,
SELECT_MAP(188),
SELECT_MAP(MAP_MT_THUNDER_ENTRY),
BGM_STOP,
JUMP_SCRIPT(COMMON_ENTER),
};
@ -20,13 +20,13 @@ static const struct ScriptRef s_gs188_g0_s0_station_sref = { 404, 1, NULL /* ENT
static const struct ScriptCommand s_gs188_g1_s0_station_sref_script[] = { /* 0x82391f0 */
DEBUGINFO,
SELECT_MAP(188),
SELECT_MAP(MAP_MT_THUNDER_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(111),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
{ 0x23, 0x01, 0x0001, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, 0x00000007),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_MT_THUNDER),
RET,
};
@ -114,13 +114,13 @@ static const struct ScriptCommand s_gs188_g1_s0_lives1_dlg0[] = { /* 0x8239824 *
static const struct ScriptCommand s_gs188_g2_s0_station_sref_script[] = { /* 0x8239954 */
DEBUGINFO,
SELECT_MAP(188),
SELECT_MAP(MAP_MT_THUNDER_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(111),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
{ 0x23, 0x01, 0x0001, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, 0x00000007),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_MT_THUNDER),
RET,
};

View File

@ -52,7 +52,7 @@ static const struct ScriptCommand s_gs189_g0_s0_evt0_sref_script[] = { /* 0x823a
LABEL(0), /* = 0x00 */
TEXTBOX_CLEAR,
BGM_FADEOUT(60),
NEXT_DUNGEON(30, 0x00000008),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_MT_THUNDER_PEAK),
COND_EQUAL(-1, /* to label */ 1),
HALT,
};

View File

@ -13,7 +13,7 @@
static const struct ScriptCommand s_gs191_g0_s0_station_sref_script[] = { /* 0x823d7dc */
DEBUGINFO,
SELECT_MAP(191),
SELECT_MAP(MAP_GREAT_CANYON_ENTRY),
BGM_STOP,
JUMP_SCRIPT(COMMON_ENTER),
};
@ -22,12 +22,12 @@ static const struct ScriptRef s_gs191_g0_s0_station_sref = { 404, 1, NULL /* ENT
static const struct ScriptCommand s_gs191_g1_s0_station_sref_script[] = { /* 0x823d854 */
DEBUGINFO,
SELECT_MAP(191),
SELECT_MAP(MAP_GREAT_CANYON_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(20),
{ 0x22, 0x01, 0x003c, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, 0x00000009),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_GREAT_CANYON),
RET,
};
@ -89,12 +89,12 @@ static const struct ScriptCommand s_gs191_g1_s0_lives1_dlg0[] = { /* 0x823dc10 *
static const struct ScriptCommand s_gs191_g2_s0_station_sref_script[] = { /* 0x823dd20 */
DEBUGINFO,
SELECT_MAP(191),
SELECT_MAP(MAP_GREAT_CANYON_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(20),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, 0x00000009),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_GREAT_CANYON),
RET,
};

View File

@ -14,7 +14,7 @@ static const struct ScriptCommand s_gs193_g0_s0_station_sref_script[] = { /* 0x8
JUMPIF_SCENARIOCHECK(5, /* to label */ 0),
EXECUTE_STATION(12, 0, 0),
LABEL(0), /* = 0x00 */
SELECT_MAP(193),
SELECT_MAP(MAP_LAPIS_CAVE_ENTRY),
CJUMP_SCENARIO_0(SCENARIO_MAIN),
COND(JUDGE_EQ, 11, /* to label */ 1),
JUMP_LABEL(2),
@ -124,13 +124,13 @@ static const struct ScriptCommand s_gs193_g0_s5_obj1_dlg2[] = { /* 0x8243080 */
static const struct ScriptCommand s_gs193_g1_s0_station_sref_script[] = { /* 0x82430a0 */
DEBUGINFO,
SELECT_MAP(193),
SELECT_MAP(MAP_LAPIS_CAVE_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(24),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
{ 0x23, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(0, 0x0000000a),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_LAPIS_CAVE),
RET,
};
@ -233,7 +233,7 @@ static const struct ScriptCommand s_gs193_g1_s0_lives1_dlg0[] = { /* 0x824389c *
static const struct ScriptCommand s_gs193_g2_s0_station_sref_script[] = { /* 0x8243a1c */
DEBUGINFO,
SELECT_MAP(193),
SELECT_MAP(MAP_LAPIS_CAVE_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(102),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
@ -434,7 +434,7 @@ static const struct ScriptCommand s_gs193_g3_s1_lives1_dlg0[] = { /* 0x8244648 *
static const struct ScriptCommand s_gs193_g4_s0_station_sref_script[] = { /* 0x8244768 */
DEBUGINFO,
SELECT_MAP(193),
SELECT_MAP(MAP_LAPIS_CAVE_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(102),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
@ -501,7 +501,7 @@ static const struct ScriptCommand s_gs193_g4_s0_lives1_dlg0[] = { /* 0x8244bb4 *
static const struct ScriptCommand s_gs193_g5_s0_station_sref_script[] = { /* 0x8244c94 */
DEBUGINFO,
SELECT_MAP(193),
SELECT_MAP(MAP_LAPIS_CAVE_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(102),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },

View File

@ -57,7 +57,7 @@ static const struct ScriptCommand s_gs196_g0_s0_evt0_sref_script[] = { /* 0x8248
LABEL(0), /* = 0x00 */
TEXTBOX_CLEAR,
BGM_FADEOUT(60),
NEXT_DUNGEON(30, 0x0000000c),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_MT_BLAZE_PEAK),
COND_EQUAL(-1, /* to label */ 1),
HALT,
};

View File

@ -57,7 +57,7 @@ static const struct ScriptCommand s_gs199_g0_s0_evt0_sref_script[] = { /* 0x824e
LABEL(0), /* = 0x00 */
TEXTBOX_CLEAR,
BGM_FADEOUT(60),
NEXT_DUNGEON(30, 0x0000000e),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_FROSTY_GROTTO),
COND_EQUAL(-1, /* to label */ 1),
HALT,
};

View File

@ -60,11 +60,11 @@ static const struct ScriptCommand s_gs202_g0_s0_evt0_sref_script[] = { /* 0x8255
TEXTBOX_CLEAR,
BGM_FADEOUT(60),
JUMPIF_ARRAY(RESCUE_SCENARIO_JOB_LIST, 29, /* to label */ 2),
NEXT_DUNGEON(30, 0x00000010),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_MT_FREEZE_PEAK),
COND_EQUAL(-1, /* to label */ 1),
HALT,
LABEL(2), /* = 0x02 */
NEXT_DUNGEON(30, 0x00000026),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_MT_FREEZE_PEAK_2),
COND_EQUAL(-1, /* to label */ 1),
HALT,
};

View File

@ -12,7 +12,7 @@
static const struct ScriptCommand s_gs204_g0_s0_station_sref_script[] = { /* 0x825ce34 */
DEBUGINFO,
SELECT_MAP(204),
SELECT_MAP(MAP_MAGMA_CAVERN_ENTRY),
CJUMP_SCENARIO_0(SCENARIO_MAIN),
COND(JUDGE_EQ, 15, /* to label */ 0),
JUMP_LABEL(1),
@ -86,12 +86,12 @@ static const struct ScriptCommand s_gs204_g0_s4_lives1_dlg0[] = { /* 0x825d16c *
static const struct ScriptCommand s_gs204_g1_s0_station_sref_script[] = { /* 0x825d19c */
DEBUGINFO,
SELECT_MAP(204),
SELECT_MAP(MAP_MAGMA_CAVERN_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(108),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(30, 0x00000011),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_MAGMA_CAVERN),
RET,
};
@ -154,12 +154,12 @@ static const struct ScriptCommand s_gs204_g1_s0_lives1_dlg0[] = { /* 0x825d6dc *
static const struct ScriptCommand s_gs204_g2_s0_station_sref_script[] = { /* 0x825d78c */
DEBUGINFO,
SELECT_MAP(204),
SELECT_MAP(MAP_MAGMA_CAVERN_ENTRY),
SELECT_ENTITIES(-1, 0),
BGM_SWITCH(108),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(30, 0x00000011),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_MAGMA_CAVERN),
RET,
};

View File

@ -52,7 +52,7 @@ static const struct ScriptCommand s_gs205_g0_s0_evt0_sref_script[] = { /* 0x825d
LABEL(0), /* = 0x00 */
TEXTBOX_CLEAR,
BGM_FADEOUT(60),
NEXT_DUNGEON(30, 0x00000012),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_MAGMA_CAVERN_PIT),
COND_EQUAL(-1, /* to label */ 1),
HALT,
};

View File

@ -9,7 +9,7 @@
static const struct ScriptCommand s_gs207_g0_s0_station_sref_script[] = { /* 0x825ff68 */
DEBUGINFO,
SELECT_MAP(207),
SELECT_MAP(MAP_SKY_TOWER_ENTRY),
BGM_STOP,
JUMP_SCRIPT(COMMON_ENTER),
};
@ -20,7 +20,7 @@ static const struct ScriptCommand s_gs207_g1_s0_station_sref_script[] = { /* 0x8
DEBUGINFO,
BGM_FADEOUT(30),
WAIT(60),
SELECT_MAP(207),
SELECT_MAP(MAP_SKY_TOWER_ENTRY),
SELECT_ENTITIES(-1, -1),
BGM_SWITCH(22),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
@ -164,12 +164,12 @@ static const struct ScriptCommand s_gs207_g1_s0_lives2_dlg0[] = { /* 0x8260738 *
static const struct ScriptCommand s_gs207_g2_s0_station_sref_script[] = { /* 0x82608a8 */
DEBUGINFO,
SELECT_MAP(207),
SELECT_MAP(MAP_SKY_TOWER_ENTRY),
SELECT_ENTITIES(-1, -1),
BGM_SWITCH(22),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(30, 0x00000013),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_SKY_TOWER),
RET,
};
@ -230,12 +230,12 @@ static const struct ScriptCommand s_gs207_g2_s0_lives2_dlg0[] = { /* 0x8260c3c *
static const struct ScriptCommand s_gs207_g3_s0_station_sref_script[] = { /* 0x8260cac */
DEBUGINFO,
SELECT_MAP(207),
SELECT_MAP(MAP_SKY_TOWER_ENTRY),
SELECT_ENTITIES(-1, -1),
BGM_SWITCH(22),
{ 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL },
{ 0xe3, 0x00, 0x0003, 0x00000000, 0x00000000, NULL },
NEXT_DUNGEON(30, 0x00000013),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_SKY_TOWER),
RET,
};

View File

@ -52,7 +52,7 @@ static const struct ScriptCommand s_gs208_g0_s0_evt0_sref_script[] = { /* 0x8261
LABEL(0), /* = 0x00 */
TEXTBOX_CLEAR,
BGM_FADEOUT(60),
NEXT_DUNGEON(30, 0x00000014),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_SKY_TOWER_SUMMIT),
COND_EQUAL(-1, /* to label */ 1),
HALT,
};

View File

@ -1995,7 +1995,7 @@ static const struct ScriptCommand s_script_EVENT_M01E02B_L004B[] = { /* 0x81256f
static const struct ScriptCommand s_script_EVENT_M01E02B_L005[] = { /* 0x8125730 */
DEBUGINFO,
EXECUTE_SUBSTATION(182, 1, 0),
NEXT_DUNGEON(0, 0x00000002),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_MT_STEEL),
RET,
};
@ -2008,7 +2008,7 @@ static const struct ScriptCommand s_script_EVENT_M01E02B_L006[] = { /* 0x8125770
static const struct ScriptCommand s_script_EVENT_M01E02B_L007[] = { /* 0x81257a0 */
DEBUGINFO,
EXECUTE_SUBSTATION(182, 2, 0),
NEXT_DUNGEON(0, 0x00000002),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_MT_STEEL),
RET,
};
@ -2168,7 +2168,7 @@ static const struct ScriptCommand s_script_EVENT_M01E04A_L004[] = { /* 0x8125de0
static const struct ScriptCommand s_script_EVENT_M01E04A_L005[] = { /* 0x8125e20 */
DEBUGINFO,
NEXT_DUNGEON(30, 0x00000006),
NEXT_DUNGEON(30, SCRIPT_DUNGEON_SILENT_CHASM),
RET,
};
@ -3842,7 +3842,7 @@ static const struct ScriptCommand s_script_EVENT_S09E01A_L004[] = { /* 0x812a2f4
static const struct ScriptCommand s_script_EVENT_S09E01A_L004B[] = { /* 0x812a344 */
DEBUGINFO,
EXECUTE_SUBSTATION(201, 6, 0),
NEXT_DUNGEON(0, 0x00000025),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_MT_FREEZE_2),
RET,
};
@ -3876,7 +3876,7 @@ static const struct ScriptCommand s_script_EVENT_S09E01B_L001[] = { /* 0x812a454
static const struct ScriptCommand s_script_EVENT_S09E01B_L001B[] = { /* 0x812a4a4 */
DEBUGINFO,
EXECUTE_SUBSTATION(221, 1, 0),
NEXT_DUNGEON(0, 0x00000027),
NEXT_DUNGEON(0, SCRIPT_DUNGEON_MURKY_CAVE),
RET,
};
@ -4026,7 +4026,7 @@ static const struct ScriptCommand s_script_GETOUT_M01E02B[] = { /* 0x812ab34 */
JUMPIF_EQUAL(START_MODE, 10, /* to label */ 3),
JUMP_SCRIPT(EVENT_M01E02B_L006),
LABEL(6), /* = 0x06 */
NEXT_DUNGEON(-1, 3),
NEXT_DUNGEON(-1, SCRIPT_DUNGEON_3),
HALT,
LABEL(1), /* = 0x01 */
JUMPIF_EQUAL(SCENARIO_MAIN, 4, /* to label */ 7),
@ -4050,7 +4050,7 @@ static const struct ScriptCommand s_script_GETOUT_M01E02B[] = { /* 0x812ab34 */
LABEL(11), /* = 0x0b */
JUMP_SCRIPT(GETOUT_R00E01A),
LABEL(12), /* = 0x0c */
NEXT_DUNGEON(-1, 3),
NEXT_DUNGEON(-1, SCRIPT_DUNGEON_3),
HALT,
LABEL(3), /* = 0x03 */
JUMP_SCRIPT(EVENT_DIVIDE),
@ -4074,7 +4074,7 @@ static const struct ScriptCommand s_script_GETOUT_M01E03A[] = { /* 0x812ae04 */
JUMPIF_EQUAL(START_MODE, 10, /* to label */ 3),
JUMP_SCRIPT(EVENT_M01E03A_L009),
LABEL(6), /* = 0x06 */
NEXT_DUNGEON(-1, 5),
NEXT_DUNGEON(-1, SCRIPT_DUNGEON_5),
HALT,
LABEL(1), /* = 0x01 */
JUMPIF_EQUAL(SCENARIO_MAIN, 5, /* to label */ 7),
@ -4098,7 +4098,7 @@ static const struct ScriptCommand s_script_GETOUT_M01E03A[] = { /* 0x812ae04 */
LABEL(11), /* = 0x0b */
JUMP_SCRIPT(GETOUT_R00E01A),
LABEL(12), /* = 0x0c */
NEXT_DUNGEON(-1, 5),
NEXT_DUNGEON(-1, SCRIPT_DUNGEON_5),
HALT,
LABEL(3), /* = 0x03 */
JUMP_SCRIPT(EVENT_DIVIDE),

View File

@ -1918,7 +1918,7 @@ s32 ExecuteScriptCommand(Action *action)
break;
}
case 10: {
u8 a = sub_80A2740((s16)curCmd.arg1);
u8 a = ScriptDungeonIdToDungeonId((s16)curCmd.arg1);
s32 o = 0;
switch ((s16)curCmd.arg1) {
case 0: o = 1; break;
@ -3146,7 +3146,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
}
return 0;
case 0xB:
return (CountJobsinDungeon(sub_80A2740(GetScriptVarValue(0, DUNGEON_ENTER_INDEX))) > 0);
return (CountJobsinDungeon(ScriptDungeonIdToDungeonId(GetScriptVarValue(0, DUNGEON_ENTER_INDEX))) > 0);
case 0xC:
{
u8 sp_104;

View File

@ -618,23 +618,23 @@ static u32 RunGameMode_Async(u32 a0)
else if (mode == MODE_DUNGEON_FROM_WORLD_MAP) {
s32 i;
s32 dungId = (s16) GetScriptVarValue(NULL, DUNGEON_SELECT);
u8 r6 = sub_80A2740(dungId);
s32 scriptDungeonId = (s16) GetScriptVarValue(NULL, DUNGEON_SELECT);
u8 dungeonId = ScriptDungeonIdToDungeonId(scriptDungeonId);
for (i = 0; i < WORLD_MAP_UNK_6D_COUNT; i++) {
worldMapSetup.info.unk6D[i] = sub_80A28F0(i);
}
if (r6 == 99) {
if (dungeonId == DUNGEON_INVALID) {
mode = MODE_GROUND;
continue;
}
worldMapSetup.info.startLocation.id = DUNGEON_OUT_ON_RESCUE;
sub_80011CC(&worldMapSetup.info.unk4, r6);
sub_80011CC(&worldMapSetup.info.unk4, dungeonId);
worldMapSetup.info.unk6C = worldMapSetup.info.unk4.unk5;
switch ((s16) sub_80A2750(dungId)) {
switch ((s16) sub_80A2750(scriptDungeonId)) {
case 1:
if (sub_80990EC(&dungeonSetup.info, dungId)) {
if (sub_80990EC(&dungeonSetup.info, scriptDungeonId)) {
worldMapSetup.info.unk4.unkC = dungeonSetup.info.sub0.unkC;
worldMapSetup.info.mon = dungeonSetup.info.mon;
}
@ -656,7 +656,7 @@ static u32 RunGameMode_Async(u32 a0)
mode = MODE_GROUND;
continue;
}
SetScriptVarValue(NULL, DUNGEON_ENTER, dungId);
SetScriptVarValue(NULL, DUNGEON_ENTER, scriptDungeonId);
sUnknown_203B03C = 2;
sub_800A8F8(4);
r5 = xxx_script_related_8001334(5);
@ -1025,7 +1025,7 @@ static u8 sub_8001170(void)
u8 dungeonID = NUM_DUNGEONS + 1;
if (sub_80992E0(&local_10, &auStack_e))
dungeonID = sub_80A2740(local_10);
dungeonID = ScriptDungeonIdToDungeonId(local_10);
else if (!sub_8099328(&dungeonID) && !sub_8099360(&dungeonID) && sub_8099394(&auStack_b))
dungeonID = DUNGEON_OUT_ON_RESCUE;

View File

@ -193,7 +193,7 @@ static void MakuhitaDojo_UpdateDialogue(void)
break;
case 5:
sMakuhitaDojoWork1->fallbackState = 13;
dLoc.id = sub_80A2740(sMakuhitaDojoWork1->unk10);
dLoc.id = ScriptDungeonIdToDungeonId(sMakuhitaDojoWork1->unk10);
dLoc.floor = 1;
PrintYellowDungeonNametoBuffer(gFormatBuffer_Monsters[0], &dLoc);
CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_4], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D);

View File

@ -127,7 +127,7 @@ static void MakuhitaDojo_DrawCourseList(void)
for (i = 0; i < sMakuhitaDojoWork2->s30.m.input.currPageEntries; i++) {
iVar6 = sMakuhitaDojoWork2->unk0[sMakuhitaDojoWork2->s30.m.input.currPage * sMakuhitaDojoWork2->s30.m.input.entriesPerPage + i];
dungeonIndex = sub_80A2740(iVar6);
dungeonIndex = ScriptDungeonIdToDungeonId(iVar6);
mazeIndex = sub_80A2668(iVar6);

View File

@ -9,6 +9,7 @@
#include "code_80A26CC.h"
#include "constants/ground_map.h"
#include "constants/friend_area.h"
#include "constants/dungeon.h"
// This file effectively does nothing on GBA. If I were to guess I'd say it's bottom/top screen related.
@ -25,7 +26,7 @@ struct unkStruct_3001B68
s16 mapId;
s16 groundPlaceId;
u8 friendAreaId;
u8 unk19;
u8 dungeonId;
u32 unk1C;
u8 unk20;
};
@ -58,7 +59,7 @@ void sub_809C5C4(void)
sUnknown_3001B68->mapId = -1;
sUnknown_3001B68->groundPlaceId = GROUND_PLACE_DIRECTION;
sUnknown_3001B68->friendAreaId = 0;
sUnknown_3001B68->unk19 = 0x3f;
sUnknown_3001B68->dungeonId = DUNGEON_OUT_ON_RESCUE;
sUnknown_3001B68->unk1C = 0;
sUnknown_3001B68->unk20 = 0;
nullsub_107();
@ -164,8 +165,8 @@ void sub_809C760(void)
void sub_809C770(s16 mapId_, s16 groundPlaceId_)
{
u8 friendAreaId;
u8 uVar3;
s32 iVar5;
u8 dungeonId;
s32 scriptDungeonId;
u32 uVar6;
s32 mapId = mapId_;
s32 groundPlaceId = groundPlaceId_;
@ -178,7 +179,7 @@ void sub_809C770(s16 mapId_, s16 groundPlaceId_)
sub_809C6EC();
}
friendAreaId = sUnknown_3001B68->friendAreaId;
uVar3 = sUnknown_3001B68->unk19;
dungeonId = sUnknown_3001B68->dungeonId;
switch (groundPlaceId) {
case GROUND_PLACE_FRIEND_AREAS:
friendAreaId = MapIdToFriendAreaId(mapId);
@ -226,52 +227,52 @@ void sub_809C770(s16 mapId_, s16 groundPlaceId_)
default:
switch((s16)(groundPlaceId)) {
case GROUND_PLACE_TINY_WOODS:
iVar5 = 0;
scriptDungeonId = 0;
break;
case GROUND_PLACE_MT_THUNDER:
case GROUND_PLACE_MT_THUNDER_MID:
iVar5 = 7;
scriptDungeonId = 7;
break;
case GROUND_PLACE_GREAT_CANYON:
case GROUND_PLACE_HILL_OF_THE_ANCIENTS:
iVar5 = 9;
scriptDungeonId = 9;
break;
case GROUND_PLACE_LAPIS_CAVE:
iVar5 = 10;
scriptDungeonId = 10;
break;
case GROUND_PLACE_MT_BLAZE:
case GROUND_PLACE_MT_BLAZE_MID:
iVar5 = 0xb;
scriptDungeonId = 0xb;
break;
case GROUND_PLACE_FROSTY_FOREST:
case GROUND_PLACE_FROSTY_CLEARING:
iVar5 = 0xd;
scriptDungeonId = 0xd;
break;
case GROUND_PLACE_MT_FREEZE:
case GROUND_PLACE_MT_FREEZE_MID:
iVar5 = 0xf;
scriptDungeonId = 0xf;
break;
case GROUND_PLACE_MAGMA_CAVERN:
case GROUND_PLACE_MAGMA_CAVERN_MID:
iVar5 = 0x11;
scriptDungeonId = 0x11;
break;
case GROUND_PLACE_SKY_TOWER:
case GROUND_PLACE_SKY_TOWER_MID:
iVar5 = 0x13;
scriptDungeonId = 0x13;
break;
case GROUND_PLACE_WESTERN_CAVE:
iVar5 = 0x20;
scriptDungeonId = 0x20;
break;
case GROUND_PLACE_DUNGEON:
default:
iVar5 = (s16)GetScriptVarValue(NULL,DUNGEON_ENTER);
scriptDungeonId = (s16)GetScriptVarValue(NULL,DUNGEON_ENTER);
break;
}
if (iVar5 == -1) {
if (scriptDungeonId == -1) {
return;
}
uVar3 = sub_80A2740(iVar5);
dungeonId = ScriptDungeonIdToDungeonId(scriptDungeonId);
uVar6 = 2;
break;
}
@ -294,7 +295,7 @@ void sub_809C770(s16 mapId_, s16 groundPlaceId_)
}
}
else if (uVar6 == 2 &&
(uVar3 != sUnknown_3001B68->unk19 || (sUnknown_3001B68->groundPlaceId != groundPlaceId)))
(dungeonId != sUnknown_3001B68->dungeonId || (sUnknown_3001B68->groundPlaceId != groundPlaceId)))
{
sUnknown_3001B68->unkC = 1;
sUnknown_3001B68->unk20 = 1;
@ -306,7 +307,7 @@ void sub_809C770(s16 mapId_, s16 groundPlaceId_)
sUnknown_3001B68->mapId = mapId;
sUnknown_3001B68->groundPlaceId = groundPlaceId;
sUnknown_3001B68->friendAreaId = friendAreaId;
sUnknown_3001B68->unk19 = uVar3;
sUnknown_3001B68->dungeonId = dungeonId;
if (sUnknown_3001B68->unk8 != 4) {
sUnknown_3001B68->unkC = 0;
sUnknown_3001B68->unk20 = 0;