mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-08 13:26:14 -04:00
z_map decompiled (#1032)
* First batch of functions * more ok * z_map_data OK * More OKs, MinimapList ZAPD breaking change * func_80103A58 improvements, more OK * func_80106D5C and func_801091F0 decomped * func_801031D0 decomped and some fixes * house cleaning, more OKs more decomp * Even more OKs * func_80105C40 almost OK, more OKs * func_80108AF8 OK and more * All functions attempted * func_8010534C OK * Start documentation, rename DoorCtx * More OKs, split map_data.data, more doc * incremental clean-up, more function names * more function names * func_801068FC OK * old uncommitted changes * minor tweaks * implement easy fixes * more fixes * z_map_disp OK, implement more suggestions * delete utility program * migrate data * TransiActor ->TransitionActor * Major documentation pass * first pass of changes * warning fix attempt, revert ZFile.cpp * Fix FAKE match * Easy fixes * implement gDPLoadTextureBlock_Runtime * z_demo bss patch * Extract white square texture * Implement more suggestions * rework MapIndex/DungeonIndex * revert dungeonSceneIndex -> mapIndex in some spots, implement suggestions * more suggestions * minor nits * fix #include
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
#ifndef GDP_LOADTEXTUREBLOCK_RUNTIME_INC_C
|
||||
#define GDP_LOADTEXTUREBLOCK_RUNTIME_INC_C
|
||||
|
||||
#include "gfx.h"
|
||||
|
||||
static u32 sLoadTextureBlock_siz[] = {
|
||||
G_IM_SIZ_4b,
|
||||
G_IM_SIZ_8b,
|
||||
G_IM_SIZ_16b,
|
||||
G_IM_SIZ_32b,
|
||||
};
|
||||
static u32 sLoadTextureBlock_siz_LOAD_BLOCK[] = {
|
||||
G_IM_SIZ_4b_LOAD_BLOCK,
|
||||
G_IM_SIZ_8b_LOAD_BLOCK,
|
||||
G_IM_SIZ_16b_LOAD_BLOCK,
|
||||
G_IM_SIZ_32b_LOAD_BLOCK,
|
||||
};
|
||||
static u32 sLoadTextureBlock_siz_INCR[] = {
|
||||
G_IM_SIZ_4b_INCR,
|
||||
G_IM_SIZ_8b_INCR,
|
||||
G_IM_SIZ_16b_INCR,
|
||||
G_IM_SIZ_32b_INCR,
|
||||
};
|
||||
static u32 sLoadTextureBlock_siz_SHIFT[] = {
|
||||
G_IM_SIZ_4b_SHIFT,
|
||||
G_IM_SIZ_8b_SHIFT,
|
||||
G_IM_SIZ_16b_SHIFT,
|
||||
G_IM_SIZ_32b_SHIFT,
|
||||
};
|
||||
static u32 sLoadTextureBlock_siz_BYTES[] = {
|
||||
G_IM_SIZ_4b_BYTES,
|
||||
G_IM_SIZ_8b_BYTES,
|
||||
G_IM_SIZ_16b_BYTES,
|
||||
G_IM_SIZ_32b_BYTES,
|
||||
};
|
||||
static u32 sLoadTextureBlock_siz_LINE_BYTES[] = {
|
||||
G_IM_SIZ_4b_LINE_BYTES,
|
||||
G_IM_SIZ_8b_LINE_BYTES,
|
||||
G_IM_SIZ_16b_LINE_BYTES,
|
||||
G_IM_SIZ_32b_LINE_BYTES,
|
||||
};
|
||||
|
||||
/**
|
||||
* Implements a version of gDPLoadTextureBlock using table lookups instead of token pasting, to allow values to be
|
||||
* passed into `siz` during runtime.
|
||||
*/
|
||||
#define gDPLoadTextureBlock_Runtime(pkt, timg, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
|
||||
_DW({ \
|
||||
gDPSetTextureImage(pkt, fmt, sLoadTextureBlock_siz_LOAD_BLOCK[siz], 1, timg); \
|
||||
gDPSetTile(pkt, fmt, sLoadTextureBlock_siz_LOAD_BLOCK[siz], 0, 0, G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, \
|
||||
masks, shifts); \
|
||||
gDPLoadSync(pkt); \
|
||||
gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
|
||||
(((width) * (height) + sLoadTextureBlock_siz_INCR[siz]) >> sLoadTextureBlock_siz_SHIFT[siz]) - 1, \
|
||||
CALC_DXT(width, sLoadTextureBlock_siz_BYTES[siz])); \
|
||||
gDPPipeSync(pkt); \
|
||||
gDPSetTile(pkt, fmt, sLoadTextureBlock_siz[siz], (((width)*sLoadTextureBlock_siz_LINE_BYTES[siz]) + 7) >> 3, \
|
||||
0, G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, shifts); \
|
||||
gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
|
||||
((height)-1) << G_TEXTURE_IMAGE_FRAC); \
|
||||
})
|
||||
#endif
|
||||
@@ -32,7 +32,7 @@ void Setup_InitRegs(void) {
|
||||
XREG(90) = 0x1C2;
|
||||
|
||||
R_STORY_FILL_SCREEN_ALPHA = 0;
|
||||
R_REVERSE_FLOOR_INDEX = 0;
|
||||
R_PLAYER_FLOOR_REVERSE_INDEX = 0;
|
||||
R_MINIMAP_DISABLED = false;
|
||||
|
||||
R_PICTO_FOCUS_BORDER_TOPLEFT_X = 80;
|
||||
|
||||
+3
-3
@@ -3413,9 +3413,9 @@ Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play
|
||||
}
|
||||
|
||||
void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
|
||||
TransitionActorEntry* transitionActorList = play->doorCtx.transitionActorList;
|
||||
TransitionActorEntry* transitionActorList = play->transitionActors.list;
|
||||
s32 i;
|
||||
s16 numTransitionActors = play->doorCtx.numTransitionActors;
|
||||
s16 numTransitionActors = play->transitionActors.count;
|
||||
|
||||
for (i = 0; i < numTransitionActors; transitionActorList++, i++) {
|
||||
if (transitionActorList->id >= 0) {
|
||||
@@ -3434,7 +3434,7 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
|
||||
transitionActorList->rotY & 0x7F, HALFDAYBIT_ALL, 0) != NULL) {
|
||||
transitionActorList->id = -transitionActorList->id;
|
||||
}
|
||||
numTransitionActors = play->doorCtx.numTransitionActors;
|
||||
numTransitionActors = play->transitionActors.count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,18 +160,18 @@ void KaleidoSetup_Init(PlayState* play) {
|
||||
pauseCtx->unk_20C = 936.0f;
|
||||
pauseCtx->roll = -314.0f;
|
||||
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = R_PLAYER_FLOOR_REVERSE_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);
|
||||
|
||||
pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_RIGHT;
|
||||
pauseCtx->pageSwitchInputTimer = 0;
|
||||
|
||||
pauseCtx->cursorItem[PAUSE_ITEM] = PAUSE_ITEM_NONE;
|
||||
pauseCtx->cursorItem[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);
|
||||
pauseCtx->cursorItem[PAUSE_MAP] = R_PLAYER_FLOOR_REVERSE_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);
|
||||
pauseCtx->cursorItem[PAUSE_QUEST] = PAUSE_ITEM_NONE;
|
||||
pauseCtx->cursorItem[PAUSE_MASK] = PAUSE_ITEM_NONE;
|
||||
|
||||
pauseCtx->cursorSlot[PAUSE_ITEM] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_PLAYER_FLOOR_REVERSE_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);
|
||||
|
||||
pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW;
|
||||
pauseCtx->ocarinaSongIndex = -1;
|
||||
|
||||
+582
-39
@@ -1,79 +1,622 @@
|
||||
#include "global.h"
|
||||
#include "z64map.h"
|
||||
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801094A0.s")
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 texWidth;
|
||||
/* 0x1 */ u8 texHeight;
|
||||
/* 0x2 */ s16 offsetX;
|
||||
/* 0x4 */ s16 offsetY;
|
||||
/* 0x6 */ u8 drawType;
|
||||
/* 0x7 */ u8 colorIndex;
|
||||
/* 0x8 */ s16 scale;
|
||||
} MapSpriteInfo; // size = 0xA
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801094C8.s")
|
||||
typedef struct {
|
||||
/* 0x0 */ TexturePtr spriteTex;
|
||||
/* 0x4 */ u8 width;
|
||||
/* 0x5 */ u8 height;
|
||||
/* 0x6 */ u8 offsetX;
|
||||
/* 0x7 */ u8 offsetY;
|
||||
/* 0x8 */ u8 drawType;
|
||||
/* 0x9 */ u8 colorIndex;
|
||||
/* 0xA */ s16 scale;
|
||||
} MapSpriteInfo2; // size = 0xC
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801094F8.s")
|
||||
static Color_RGBA8 sMapColorTable[] = {
|
||||
{ 255, 255, 255, 255 },
|
||||
{ 0, 255, 255, 160 }, // Blue
|
||||
{ 100, 255, 255, 255 },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109528.s")
|
||||
static MapSpriteInfo2 sGameplayDangeonKeepInfo[5] = {
|
||||
{ gameplay_dangeon_keep_Tex_0022C8, 96, 85, 48, 42, MAPDATA_DRAW_0, 0, 20 },
|
||||
{ gameplay_dangeon_keep_Tex_0042C8, 96, 85, 48, 62, MAPDATA_DRAW_0, 0, 20 },
|
||||
{ gameplay_dangeon_keep_Tex_0052C8, 96, 85, 68, 42, MAPDATA_DRAW_0, 0, 20 },
|
||||
{ gameplay_dangeon_keep_Tex_0032C8, 96, 85, 48, 62, MAPDATA_DRAW_0, 0, 20 },
|
||||
{ gameplay_dangeon_keep_Tex_0062C8, 96, 85, 68, 62, MAPDATA_DRAW_0, 0, 20 },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_8010954C.s")
|
||||
static MapSpriteInfo sMapGrandStaticInfo[98] = {
|
||||
{ 96, 85, 48, 42, MAPDATA_DRAW_0, 0, 20 }, { 96, 85, 48, 62, MAPDATA_DRAW_0, 0, 20 },
|
||||
{ 96, 85, 68, 42, MAPDATA_DRAW_0, 0, 20 }, { 96, 85, 48, 62, MAPDATA_DRAW_0, 0, 20 },
|
||||
{ 96, 85, 68, 62, MAPDATA_DRAW_0, 0, 20 }, { 80, 72, 40, 35, MAPDATA_DRAW_1, 1, 52 },
|
||||
{ 96, 85, 49, 43, MAPDATA_DRAW_3, 2, 20 }, { 96, 85, 49, 43, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 96, 85, 49, 43, MAPDATA_DRAW_3, 2, 20 }, { 96, 85, 49, 49, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 48, 44, 25, 23, MAPDATA_DRAW_3, 2, 20 }, { 96, 85, 49, 43, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 48, 46, 25, 24, MAPDATA_DRAW_3, 2, 20 }, { 64, 61, 32, 31, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 96, 85, 49, 50, MAPDATA_DRAW_3, 2, 20 }, { 96, 85, 49, 62, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 96, 85, 49, 43, MAPDATA_DRAW_3, 2, 20 }, { 48, 80, 21, 41, MAPDATA_DRAW_1, 1, 198 },
|
||||
{ 32, 128, 17, 87, MAPDATA_DRAW_1, 1, 138 }, { 80, 53, 40, 27, MAPDATA_DRAW_1, 1, 54 },
|
||||
{ 32, 81, 16, 15, MAPDATA_DRAW_3, 2, 20 }, { 80, 45, 35, 23, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 64, 87, 36, 44, MAPDATA_DRAW_3, 2, 20 }, { 64, 51, 31, 23, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 80, 79, 40, 40, MAPDATA_DRAW_3, 2, 20 }, { 96, 75, 36, 26, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 48, 41, 24, 20, MAPDATA_DRAW_3, 2, 20 }, { 64, 45, 31, 20, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 80, 52, 38, 28, MAPDATA_DRAW_3, 2, 20 }, { 48, 45, 23, 20, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 48, 59, 25, 37, MAPDATA_DRAW_3, 2, 20 }, { 48, 60, 21, 38, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 48, 81, 24, 40, MAPDATA_DRAW_3, 2, 20 }, { 48, 81, 24, 40, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 80, 89, 41, 26, MAPDATA_DRAW_3, 2, 20 }, { 80, 53, 39, 26, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 64, 78, 37, 36, MAPDATA_DRAW_3, 2, 20 }, { 64, 68, 33, 33, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 48, 68, 23, 35, MAPDATA_DRAW_3, 2, 20 }, { 48, 36, 25, 17, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 48, 25, 24, 12, MAPDATA_DRAW_3, 2, 20 }, { 64, 75, 24, 37, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 32, 53, 17, 26, MAPDATA_DRAW_3, 2, 20 }, { 80, 62, 35, 27, MAPDATA_DRAW_1, 1, 105 },
|
||||
{ 64, 76, 31, 31, MAPDATA_DRAW_1, 1, 133 }, { 96, 85, 47, 43, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 80, 71, 48, 33, MAPDATA_DRAW_1, 1, 180 }, { 80, 87, 44, 44, MAPDATA_DRAW_1, 1, 72 },
|
||||
{ 64, 65, 31, 36, MAPDATA_DRAW_1, 1, 57 }, { 48, 41, 28, 20, MAPDATA_DRAW_1, 1, 60 },
|
||||
{ 64, 76, 17, 36, MAPDATA_DRAW_1, 1, 58 }, { 80, 60, 27, 22, MAPDATA_DRAW_1, 1, 83 },
|
||||
{ 80, 47, 38, 23, MAPDATA_DRAW_1, 1, 69 }, { 80, 60, 40, 38, MAPDATA_DRAW_1, 1, 29 },
|
||||
{ 48, 19, 17, 8, MAPDATA_DRAW_1, 1, 25 }, { 32, 99, 17, 16, MAPDATA_DRAW_1, 1, 88 },
|
||||
{ 48, 69, 19, 28, MAPDATA_DRAW_1, 1, 76 }, { 48, 83, 34, 47, MAPDATA_DRAW_1, 1, 104 },
|
||||
{ 80, 54, 45, 27, MAPDATA_DRAW_1, 1, 61 }, { 80, 92, 35, 50, MAPDATA_DRAW_1, 1, 60 },
|
||||
{ 48, 75, 24, 37, MAPDATA_DRAW_3, 2, 20 }, { 64, 49, 32, 23, MAPDATA_DRAW_3, 2, 20 },
|
||||
{ 64, 49, 25, 24, MAPDATA_DRAW_3, 2, 20 }, { 64, 52, 32, 24, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 64, 49, 31, 24, MAPDATA_DRAW_3, 2, 34 }, { 32, 33, 18, 14, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 48, 50, 25, 25, MAPDATA_DRAW_3, 2, 34 }, { 64, 52, 32, 25, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 48, 35, 24, 18, MAPDATA_DRAW_3, 2, 34 }, { 64, 51, 32, 26, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 48, 35, 24, 18, MAPDATA_DRAW_3, 2, 34 }, { 48, 53, 24, 28, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 64, 53, 33, 25, MAPDATA_DRAW_3, 2, 34 }, { 64, 47, 31, 24, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 64, 52, 32, 35, MAPDATA_DRAW_3, 2, 34 }, { 48, 48, 24, 23, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 64, 87, 32, 26, MAPDATA_DRAW_3, 2, 34 }, { 48, 30, 24, 14, MAPDATA_DRAW_3, 2, 34 },
|
||||
{ 80, 74, 40, 36, MAPDATA_DRAW_1, 1, 50 }, { 80, 87, 6, 41, MAPDATA_DRAW_1, 1, 42 },
|
||||
{ 80, 56, 19, 27, MAPDATA_DRAW_1, 1, 40 }, { 80, 65, 25, 33, MAPDATA_DRAW_1, 1, 40 },
|
||||
{ 16, 38, 8, 12, MAPDATA_DRAW_1, 1, 47 }, { 80, 78, 46, 33, MAPDATA_DRAW_1, 1, 142 },
|
||||
{ 80, 55, 32, 29, MAPDATA_DRAW_1, 1, 155 }, { 80, 98, 67, 48, MAPDATA_DRAW_1, 1, 51 },
|
||||
{ 80, 62, 47, 19, MAPDATA_DRAW_1, 1, 55 }, { 32, 123, 15, 83, MAPDATA_DRAW_1, 1, 140 },
|
||||
{ 80, 60, 47, 14, MAPDATA_DRAW_1, 1, 170 }, { 48, 77, 18, 59, MAPDATA_DRAW_1, 1, 79 },
|
||||
{ 80, 64, 35, 30, MAPDATA_DRAW_1, 1, 33 }, { 64, 50, 29, 22, MAPDATA_DRAW_1, 1, 40 },
|
||||
{ 80, 65, 39, 5, MAPDATA_DRAW_1, 1, 37 }, { 32, 61, 8, 56, MAPDATA_DRAW_1, 1, 35 },
|
||||
{ 80, 83, 37, 42, MAPDATA_DRAW_1, 1, 95 }, { 80, 27, 30, 21, MAPDATA_DRAW_1, 1, 134 },
|
||||
{ 80, 23, 122, -18, MAPDATA_DRAW_1, 1, 53 }, { 80, 60, 27, 22, MAPDATA_DRAW_1, 1, 83 },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_8010956C.s")
|
||||
static s32 D_801BF15C[5] = {
|
||||
0x50, 0x50, 0x8D, 0x50, 0x50,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_8010958C.s")
|
||||
static MapSpriteInfo sMapIStaticInfo[MAPDATA_MAP_I_MAX] = {
|
||||
{ 96, 85, 73, 67, MAPDATA_DRAW_0, 0, 60 }, { 96, 85, 73, 74, MAPDATA_DRAW_0, 0, 60 },
|
||||
{ 96, 85, 80, 67, MAPDATA_DRAW_0, 0, 60 }, { 96, 85, 73, 67, MAPDATA_DRAW_0, 0, 60 },
|
||||
{ 96, 85, 80, 74, MAPDATA_DRAW_0, 0, 60 }, { 32, 29, 17, 14, MAPDATA_DRAW_2, 0, 50 },
|
||||
{ 32, 27, 16, 13, MAPDATA_DRAW_2, 0, 50 }, { 32, 30, 16, 15, MAPDATA_DRAW_2, 0, 50 },
|
||||
{ 16, 32, 8, 20, MAPDATA_DRAW_2, 0, 50 }, { 16, 12, 8, 6, MAPDATA_DRAW_2, 0, 50 },
|
||||
{ 32, 27, 16, 13, MAPDATA_DRAW_2, 0, 50 }, { 16, 14, 8, 7, MAPDATA_DRAW_2, 0, 50 },
|
||||
{ 32, 19, 16, 9, MAPDATA_DRAW_2, 0, 50 }, { 32, 26, 16, 16, MAPDATA_DRAW_2, 0, 50 },
|
||||
{ 16, 32, 8, 22, MAPDATA_DRAW_2, 0, 50 }, { 32, 27, 16, 13, MAPDATA_DRAW_2, 0, 50 },
|
||||
{ 16, 35, 9, 5, MAPDATA_DRAW_2, 0, 45 }, { 32, 18, 14, 9, MAPDATA_DRAW_2, 0, 45 },
|
||||
{ 32, 38, 18, 19, MAPDATA_DRAW_2, 0, 45 }, { 32, 21, 16, 9, MAPDATA_DRAW_2, 0, 45 },
|
||||
{ 32, 34, 16, 17, MAPDATA_DRAW_2, 0, 45 }, { 48, 32, 19, 11, MAPDATA_DRAW_2, 0, 45 },
|
||||
{ 32, 17, 16, 8, MAPDATA_DRAW_2, 0, 45 }, { 32, 17, 16, 7, MAPDATA_DRAW_2, 0, 45 },
|
||||
{ 32, 21, 16, 11, MAPDATA_DRAW_2, 0, 45 }, { 32, 18, 16, 8, MAPDATA_DRAW_2, 0, 45 },
|
||||
{ 16, 24, 9, 15, MAPDATA_DRAW_2, 0, 45 }, { 16, 25, 7, 16, MAPDATA_DRAW_2, 0, 45 },
|
||||
{ 32, 35, 16, 17, MAPDATA_DRAW_2, 0, 45 }, { 16, 19, 5, 9, MAPDATA_DRAW_2, 0, 80 },
|
||||
{ 32, 28, 17, 7, MAPDATA_DRAW_2, 0, 66 }, { 32, 16, 16, 8, MAPDATA_DRAW_2, 0, 66 },
|
||||
{ 32, 24, 18, 11, MAPDATA_DRAW_2, 0, 66 }, { 32, 21, 16, 10, MAPDATA_DRAW_2, 0, 66 },
|
||||
{ 16, 21, 8, 11, MAPDATA_DRAW_2, 0, 66 }, { 16, 10, 8, 4, MAPDATA_DRAW_2, 0, 66 },
|
||||
{ 16, 7, 8, 3, MAPDATA_DRAW_2, 0, 66 }, { 32, 23, 13, 11, MAPDATA_DRAW_2, 0, 66 },
|
||||
{ 16, 16, 8, 8, MAPDATA_DRAW_2, 0, 66 }, { 16, 17, 8, 7, MAPDATA_DRAW_2, 0, 50 },
|
||||
{ 16, 23, 9, 10, MAPDATA_DRAW_2, 0, 66 }, { 16, 15, 8, 7, MAPDATA_DRAW_2, 0, 66 },
|
||||
{ 32, 15, 15, 7, MAPDATA_DRAW_2, 0, 66 }, { 32, 17, 16, 8, MAPDATA_DRAW_2, 0, 90 },
|
||||
{ 32, 16, 16, 8, MAPDATA_DRAW_2, 0, 90 }, { 16, 10, 8, 5, MAPDATA_DRAW_2, 0, 90 },
|
||||
{ 16, 17, 8, 8, MAPDATA_DRAW_2, 0, 90 }, { 32, 17, 17, 8, MAPDATA_DRAW_2, 0, 90 },
|
||||
{ 16, 11, 8, 5, MAPDATA_DRAW_2, 0, 90 }, { 32, 17, 15, 9, MAPDATA_DRAW_2, 0, 90 },
|
||||
{ 16, 12, 8, 6, MAPDATA_DRAW_2, 0, 90 }, { 16, 18, 9, 9, MAPDATA_DRAW_2, 0, 90 },
|
||||
{ 32, 17, 17, 8, MAPDATA_DRAW_2, 0, 90 }, { 32, 15, 16, 8, MAPDATA_DRAW_2, 0, 90 },
|
||||
{ 16, 18, 9, 13, MAPDATA_DRAW_2, 0, 90 }, { 16, 16, 8, 7, MAPDATA_DRAW_2, 0, 90 },
|
||||
{ 16, 30, 9, 8, MAPDATA_DRAW_2, 0, 90 }, { 16, 9, 9, 4, MAPDATA_DRAW_2, 0, 90 },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801095AC.s")
|
||||
static s32 sMapIForGameplayDangeonKeep[5] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801095DC.s")
|
||||
static s32 sMapIForMapGrand[98] = {
|
||||
MAPDATA_MAP_I_MAX,
|
||||
0x01,
|
||||
0x02,
|
||||
0x03,
|
||||
0x04,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
0x05,
|
||||
0x06,
|
||||
0x07,
|
||||
0x08,
|
||||
0x09,
|
||||
0x0A,
|
||||
0x0B,
|
||||
0x0C,
|
||||
0x0D,
|
||||
0x0E,
|
||||
0x0F,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
0x10,
|
||||
0x11,
|
||||
0x12,
|
||||
0x13,
|
||||
0x14,
|
||||
0x15,
|
||||
0x16,
|
||||
0x17,
|
||||
0x18,
|
||||
0x19,
|
||||
0x1A,
|
||||
0x1B,
|
||||
0x1C,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
0x1E,
|
||||
0x1F,
|
||||
0x20,
|
||||
0x21,
|
||||
0x22,
|
||||
0x23,
|
||||
0x24,
|
||||
0x25,
|
||||
0x26,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
0x27,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
0x28,
|
||||
0x29,
|
||||
0x2A,
|
||||
0x2B,
|
||||
0x2C,
|
||||
0x2D,
|
||||
0x2E,
|
||||
0x2F,
|
||||
0x30,
|
||||
0x31,
|
||||
0x32,
|
||||
0x33,
|
||||
0x34,
|
||||
0x35,
|
||||
0x36,
|
||||
0x37,
|
||||
0x38,
|
||||
0x39,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
MAPDATA_MAP_I_MAX,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_8010960C.s")
|
||||
void MapData_GetMapColor(s32 colorIndex, Color_RGBA8* color) {
|
||||
*color = sMapColorTable[colorIndex];
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109630.s")
|
||||
void MapData_GetMapTexDimGameplayDangeonKeep(s32 mapId, s32* width, s32* height) {
|
||||
*width = sGameplayDangeonKeepInfo[mapId].width;
|
||||
*height = sGameplayDangeonKeepInfo[mapId].height;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109650.s")
|
||||
void MapData_GetMapTexOffsetGameplayDangeonKeep(s32 mapId, s32* offsetX, s32* offsetY) {
|
||||
*offsetX = sGameplayDangeonKeepInfo[mapId].offsetX;
|
||||
*offsetY = sGameplayDangeonKeepInfo[mapId].offsetY;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109670.s")
|
||||
void MapData_GetMapDrawTypeGameplayDangeonKeep(s32 mapId, s32* drawType) {
|
||||
*drawType = sGameplayDangeonKeepInfo[mapId].drawType;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801096D4.s")
|
||||
u8 MapData_GetMapColorIndexGameplayDangeonKeep(s32 mapId) {
|
||||
return sGameplayDangeonKeepInfo[mapId].colorIndex;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109714.s")
|
||||
s16 MapData_GetMapGameplayDangeonKeepScale(s32 mapId) {
|
||||
return sGameplayDangeonKeepInfo[mapId].scale;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109754.s")
|
||||
TexturePtr MapData_GetMapTexGameplayDangeonKeep(s32 mapId) {
|
||||
return sGameplayDangeonKeepInfo[mapId].spriteTex;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801097C8.s")
|
||||
void MapData_GetMapTexGameplayDangeonKeepDim(s32 mapId, s32* width, s32* height) {
|
||||
*width = sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].texWidth;
|
||||
*height = sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].texHeight;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_8010983C.s")
|
||||
void MapData_GetMapTexGameplayDangeonKeepOffset(s32 mapId, s32* offsetX, s32* offsetY) {
|
||||
*offsetX = sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].offsetX;
|
||||
*offsetY = sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].offsetY;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801098A0.s")
|
||||
void MapData_GetMapGrandDrawType(s32 mapId, s32* drawType) {
|
||||
*drawType = sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].drawType;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109908.s")
|
||||
u8 MapData_GetMapGrandColorIndex(s32 mapId) {
|
||||
return sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].colorIndex;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109964.s")
|
||||
s16 MapData_GetMapGrandScale(s32 mapId) {
|
||||
return sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].scale;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_8010997C.s")
|
||||
s32 MapData_MapGrandTexSizeTest(s32 mapId) {
|
||||
s32 endMap = mapId - MAPDATA_MAP_GRAND;
|
||||
s32 size = 0;
|
||||
s32 i;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801099AC.s")
|
||||
for (i = 1; i < endMap + 1; i++) {
|
||||
size += MapData_GetSizeOfMapGrandTex((i - 1) + MAPDATA_MAP_GRAND);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_801099DC.s")
|
||||
s32 MapData_GetSizeOfMapGrandTex(s32 mapId) {
|
||||
return (sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].texWidth *
|
||||
sMapGrandStaticInfo[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)].texHeight) /
|
||||
2;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109A00.s")
|
||||
s32 MapData_MID_GetType(s32 mapId) {
|
||||
if ((mapId >= 0) && (mapId < 5)) {
|
||||
return MAPDATA_MID_GAMEPLAY_DANGEON_KEEP;
|
||||
}
|
||||
if ((mapId >= 0x100) && (mapId < 0x162)) {
|
||||
return MAPDATA_MID_MAP_GRAND_STATIC;
|
||||
}
|
||||
return MAPDATA_MID_MAP_I_STATIC;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109A20.s")
|
||||
void MapData_GetMapTexDim(s32 mapId, s32* width, s32* height) {
|
||||
switch (MapData_MID_GetType(mapId)) {
|
||||
case MAPDATA_MID_GAMEPLAY_DANGEON_KEEP:
|
||||
MapData_GetMapTexDimGameplayDangeonKeep(mapId, width, height);
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109A40.s")
|
||||
case MAPDATA_MID_MAP_GRAND_STATIC:
|
||||
MapData_GetMapTexGameplayDangeonKeepDim(mapId, width, height);
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109A98.s")
|
||||
default:
|
||||
*width = *height = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109AD8.s")
|
||||
void MapData_GetMapTexOffset(s32 mapId, s32* offsetX, s32* offsetY) {
|
||||
switch (MapData_MID_GetType(mapId)) {
|
||||
case MAPDATA_MID_GAMEPLAY_DANGEON_KEEP:
|
||||
MapData_GetMapTexOffsetGameplayDangeonKeep(mapId, offsetX, offsetY);
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109B38.s")
|
||||
case MAPDATA_MID_MAP_GRAND_STATIC:
|
||||
MapData_GetMapTexGameplayDangeonKeepOffset(mapId, offsetX, offsetY);
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109BA0.s")
|
||||
default:
|
||||
*offsetX = *offsetY = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109BF4.s")
|
||||
void MapData_GetMapScale(s32 mapId, s32* scale) {
|
||||
switch (MapData_MID_GetType(mapId)) {
|
||||
default:
|
||||
*scale = 0;
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109C38.s")
|
||||
case MAPDATA_MID_GAMEPLAY_DANGEON_KEEP:
|
||||
*scale = MapData_GetMapGameplayDangeonKeepScale(mapId);
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109CBC.s")
|
||||
case MAPDATA_MID_MAP_GRAND_STATIC:
|
||||
*scale = MapData_GetMapGrandScale(mapId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109D40.s")
|
||||
void MapData_GetDrawType(s32 mapId, s32* drawType) {
|
||||
switch (MapData_MID_GetType(mapId)) {
|
||||
case MAPDATA_MID_GAMEPLAY_DANGEON_KEEP:
|
||||
MapData_GetMapDrawTypeGameplayDangeonKeep(mapId, drawType);
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109DD8.s")
|
||||
case MAPDATA_MID_MAP_GRAND_STATIC:
|
||||
MapData_GetMapGrandDrawType(mapId, drawType);
|
||||
return;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109E70.s")
|
||||
default:
|
||||
*drawType = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109EF8.s")
|
||||
s32 MapData_GetMapColorIndex(s32 mapId) {
|
||||
switch (MapData_MID_GetType(mapId)) {
|
||||
case MAPDATA_MID_GAMEPLAY_DANGEON_KEEP:
|
||||
return MapData_GetMapColorIndexGameplayDangeonKeep(mapId);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_data/func_80109F78.s")
|
||||
case MAPDATA_MID_MAP_GRAND_STATIC:
|
||||
return MapData_GetMapGrandColorIndex(mapId);
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80109964(s32 arg0) {
|
||||
return D_801BF15C[arg0];
|
||||
}
|
||||
|
||||
void MapData_GetMapITexDim(s32 mapId, s32* width, s32* height) {
|
||||
*width = sMapIStaticInfo[mapId].texWidth;
|
||||
*height = sMapIStaticInfo[mapId].texHeight;
|
||||
}
|
||||
|
||||
void MapData_GetMapITexOffset(s32 mapId, s32* offsetX, s32* offsetY) {
|
||||
*offsetX = sMapIStaticInfo[mapId].offsetX;
|
||||
*offsetY = sMapIStaticInfo[mapId].offsetY;
|
||||
}
|
||||
|
||||
void MapData_GetMapIDrawType(s32 mapId, s32* drawType) {
|
||||
*drawType = sMapIStaticInfo[mapId].drawType;
|
||||
}
|
||||
|
||||
u8 MapData_GetMapIColorIndex(s32 mapId) {
|
||||
return sMapIStaticInfo[mapId].colorIndex;
|
||||
}
|
||||
|
||||
s16 MapData_GetMapIScale(s32 mapId) {
|
||||
return sMapIStaticInfo[mapId].scale;
|
||||
}
|
||||
|
||||
s32 MapData_MapITexSizeTest(s32 mapId) {
|
||||
s32 i;
|
||||
s32 size = 0;
|
||||
|
||||
for (i = 1; i < mapId + 1; i++) {
|
||||
size += MapDisp_GetSizeOfMapITex(i - 1);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
s32 MapDisp_GetSizeOfMapITex(s32 mapCompactId) {
|
||||
return (sMapIStaticInfo[mapCompactId].texWidth * sMapIStaticInfo[mapCompactId].texHeight) / 2;
|
||||
}
|
||||
|
||||
s32 MapData_GetMapIId(s32 mapId) {
|
||||
switch (MapData_MID_GetType(mapId)) {
|
||||
case MAPDATA_MID_GAMEPLAY_DANGEON_KEEP:
|
||||
return sMapIForGameplayDangeonKeep[mapId];
|
||||
|
||||
case MAPDATA_MID_MAP_GRAND_STATIC:
|
||||
return sMapIForMapGrand[MAPDATA_GET_MAP_GRAND_ID_FROM_MAP_ID(mapId)];
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80109B38(s32 mapId) {
|
||||
if (MapData_GetMapIId(mapId) != MAPDATA_MAP_I_MAX) {
|
||||
return 1;
|
||||
}
|
||||
switch (MapData_MID_GetType(mapId)) {
|
||||
case MAPDATA_MID_GAMEPLAY_DANGEON_KEEP:
|
||||
return 2;
|
||||
|
||||
case MAPDATA_MID_MAP_GRAND_STATIC:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 MapData_GetMapCompactId(s32 mapId) {
|
||||
s32 mapI = MapData_GetMapIId(mapId);
|
||||
|
||||
if (mapI != MAPDATA_MAP_I_MAX) {
|
||||
return mapI;
|
||||
}
|
||||
if ((mapId >= 0x100) && (mapId < 0x162)) {
|
||||
return mapId - 0xC6;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 MapData_CPID_GetType(s32 mapCompactId) {
|
||||
if (mapCompactId == -1) {
|
||||
return MAPDATA_CPID_2;
|
||||
}
|
||||
if (mapCompactId < MAPDATA_MAP_I_MAX) {
|
||||
return MAPDATA_CPID_MAP_I_STATIC;
|
||||
}
|
||||
if (mapCompactId >= MAPDATA_MAP_I_MAX) {
|
||||
return MAPDATA_CPID_MAP_GRAND_STATIC;
|
||||
}
|
||||
return MAPDATA_CPID_2;
|
||||
}
|
||||
|
||||
// Unused
|
||||
s32 func_80109C38(s32 mapCompactId) {
|
||||
if (mapCompactId == -1) {
|
||||
return 0;
|
||||
}
|
||||
switch (MapData_CPID_GetType(mapCompactId)) {
|
||||
case MAPDATA_CPID_MAP_GRAND_STATIC:
|
||||
return MapData_MapGrandTexSizeTest(MAPDATA_GET_MAP_GRAND_ID_FROM_COMPACT_ID(mapCompactId));
|
||||
|
||||
case MAPDATA_CPID_MAP_I_STATIC:
|
||||
return MapData_MapITexSizeTest(mapCompactId);
|
||||
|
||||
case MAPDATA_CPID_2:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 MapData_CPID_GetSizeOfMapTex(s32 mapCompactId) {
|
||||
if (mapCompactId == -1) {
|
||||
return 0;
|
||||
}
|
||||
switch (MapData_CPID_GetType(mapCompactId)) {
|
||||
case MAPDATA_CPID_MAP_GRAND_STATIC:
|
||||
return MapData_GetSizeOfMapGrandTex(MAPDATA_GET_MAP_GRAND_ID_FROM_COMPACT_ID(mapCompactId));
|
||||
|
||||
case MAPDATA_CPID_MAP_I_STATIC:
|
||||
return MapDisp_GetSizeOfMapITex(mapCompactId);
|
||||
|
||||
case MAPDATA_CPID_2:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void MapData_CPID_GetTexDim(s32 mapCompactId, s32* width, s32* height) {
|
||||
if (mapCompactId == -1) {
|
||||
*width = *height = 0;
|
||||
return;
|
||||
}
|
||||
switch (MapData_CPID_GetType(mapCompactId)) {
|
||||
case MAPDATA_CPID_MAP_GRAND_STATIC:
|
||||
MapData_GetMapTexGameplayDangeonKeepDim(MAPDATA_GET_MAP_GRAND_ID_FROM_COMPACT_ID(mapCompactId), width,
|
||||
height);
|
||||
return;
|
||||
|
||||
case MAPDATA_CPID_MAP_I_STATIC:
|
||||
MapData_GetMapITexDim(mapCompactId, width, height);
|
||||
return;
|
||||
|
||||
case MAPDATA_CPID_2:
|
||||
default:
|
||||
*width = *height = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void MapData_CPID_GetTexOffset(s32 mapCompactId, s32* offsetX, s32* offsetY) {
|
||||
if (mapCompactId == -1) {
|
||||
*offsetX = *offsetY = 0;
|
||||
return;
|
||||
}
|
||||
switch (MapData_CPID_GetType(mapCompactId)) {
|
||||
case MAPDATA_CPID_MAP_GRAND_STATIC:
|
||||
MapData_GetMapTexGameplayDangeonKeepOffset(MAPDATA_GET_MAP_GRAND_ID_FROM_COMPACT_ID(mapCompactId), offsetX,
|
||||
offsetY);
|
||||
return;
|
||||
|
||||
case MAPDATA_CPID_MAP_I_STATIC:
|
||||
MapData_GetMapITexOffset(mapCompactId, offsetX, offsetY);
|
||||
return;
|
||||
|
||||
case MAPDATA_CPID_2:
|
||||
default:
|
||||
*offsetX = *offsetY = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
void MapData_CPID_GetDrawType(s32 mapCompactId, s32* drawType) {
|
||||
if (mapCompactId == -1) {
|
||||
*drawType = MAPDATA_DRAW_0;
|
||||
return;
|
||||
}
|
||||
switch (MapData_CPID_GetType(mapCompactId)) {
|
||||
case MAPDATA_CPID_MAP_GRAND_STATIC:
|
||||
MapData_GetMapGrandDrawType(MAPDATA_GET_MAP_GRAND_ID_FROM_COMPACT_ID(mapCompactId), drawType);
|
||||
return;
|
||||
|
||||
case MAPDATA_CPID_MAP_I_STATIC:
|
||||
MapData_GetMapIDrawType(mapCompactId, drawType);
|
||||
return;
|
||||
|
||||
case MAPDATA_CPID_2:
|
||||
default:
|
||||
*drawType = MAPDATA_DRAW_0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Unused
|
||||
u8 MapData_CPID_GetMapColorIndex(s32 mapCompactId) {
|
||||
if (mapCompactId == -1) {
|
||||
return 0;
|
||||
}
|
||||
switch (MapData_CPID_GetType(mapCompactId)) {
|
||||
case MAPDATA_CPID_MAP_GRAND_STATIC:
|
||||
return MapData_GetMapGrandColorIndex(MAPDATA_GET_MAP_GRAND_ID_FROM_COMPACT_ID(mapCompactId));
|
||||
|
||||
case MAPDATA_CPID_MAP_I_STATIC:
|
||||
return MapData_GetMapIColorIndex(mapCompactId);
|
||||
|
||||
case MAPDATA_CPID_2:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s16 MapData_CPID_GetMapScale(s32 mapCompactId) {
|
||||
if (mapCompactId == -1) {
|
||||
return 0;
|
||||
}
|
||||
switch (MapData_CPID_GetType(mapCompactId)) {
|
||||
case MAPDATA_CPID_MAP_GRAND_STATIC:
|
||||
return MapData_GetMapGrandScale(MAPDATA_GET_MAP_GRAND_ID_FROM_COMPACT_ID(mapCompactId));
|
||||
|
||||
case MAPDATA_CPID_MAP_I_STATIC:
|
||||
return MapData_GetMapIScale(mapCompactId);
|
||||
|
||||
case MAPDATA_CPID_2:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+1773
-54
File diff suppressed because it is too large
Load Diff
+127
-102
@@ -1,19 +1,26 @@
|
||||
#include "global.h"
|
||||
|
||||
s16 sMinimapInitPosX = 0;
|
||||
s16 sMinimapInitPosZ = 0;
|
||||
s16 sMinimapInitDir = 0;
|
||||
|
||||
s32 sDungeonAndBossSceneIds[] = {
|
||||
SCENE_MITURIN, SCENE_HAKUGIN, SCENE_SEA, SCENE_INISIE_N, SCENE_INISIE_R,
|
||||
SCENE_MITURIN_BS, SCENE_HAKUGIN_BS, SCENE_SEA_BS, SCENE_INISIE_BS,
|
||||
};
|
||||
s16 sPlayerInitPosX = 0;
|
||||
s16 sPlayerInitPosZ = 0;
|
||||
s16 sPlayerInitDir = 0;
|
||||
|
||||
/**
|
||||
* If the current scene is a dungeon or boss scene, this function returns an index
|
||||
* indicating which one it is. Otherwise, it returns -1.
|
||||
* Gets the mapIndex for the current dungeon scene
|
||||
* @return the current scene's DungeonSceneIndex, or -1 if it isn't a dungeon or boss scene.
|
||||
*/
|
||||
s32 Map_GetDungeonOrBossAreaIndex(PlayState* play) {
|
||||
s32 Map_GetDungeonSceneIndex(PlayState* play) {
|
||||
static s32 sDungeonAndBossSceneIds[] = {
|
||||
SCENE_MITURIN, // DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE
|
||||
SCENE_HAKUGIN, // DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE
|
||||
SCENE_SEA, // DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE
|
||||
SCENE_INISIE_N, // DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
SCENE_INISIE_R, // Play_GetOriginalSceneId converts play->sceneId to SCENE_INISIE_N, returning
|
||||
// DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
SCENE_MITURIN_BS, // DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE_BOSS
|
||||
SCENE_HAKUGIN_BS, // DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE_BOSS
|
||||
SCENE_SEA_BS, // DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE_BOSS
|
||||
SCENE_INISIE_BS, // DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE_BOSS
|
||||
};
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sDungeonAndBossSceneIds); i++) {
|
||||
@@ -26,33 +33,38 @@ s32 Map_GetDungeonOrBossAreaIndex(PlayState* play) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current scene is a dungeon or boss scene, false otherwise.
|
||||
* Tests if the current scene is in a dungeon or boss scene.
|
||||
* @return true if the current scene is a dungeon or boss scene, false otherwise.
|
||||
*/
|
||||
s32 Map_IsInDungeonOrBossArea(PlayState* play) {
|
||||
if (Map_GetDungeonOrBossAreaIndex(play) == -1) {
|
||||
s32 Map_IsInDungeonOrBossScene(PlayState* play) {
|
||||
if (Map_GetDungeonSceneIndex(play) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 func_8010A0A4(PlayState* play) {
|
||||
if ((Map_GetDungeonOrBossAreaIndex(play) == -1) || !func_80102EF0(play)) {
|
||||
s32 Map_CurRoomHasMapI(PlayState* play) {
|
||||
if ((Map_GetDungeonSceneIndex(play) == -1) || !MapDisp_CurRoomHasMapI(play)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 sDungeonSceneIds[] = {
|
||||
SCENE_MITURIN, SCENE_HAKUGIN, SCENE_SEA, SCENE_INISIE_N, SCENE_INISIE_R,
|
||||
};
|
||||
|
||||
/**
|
||||
* If the current scene is a dungeon scene, this function returns an index
|
||||
* indicating which one it is. Otherwise, it returns -1.
|
||||
* Tests if the current scene is a dungeon scene, excluding boss scenes.
|
||||
* @return -1 if not a dungeon scene, else returns the DungeonSceneIndex of the dungeon scene
|
||||
*/
|
||||
s32 Map_GetDungeonAreaIndex(PlayState* play) {
|
||||
s32 Map_GetDungeonSceneIndexForDungeon(PlayState* play) {
|
||||
static s32 sDungeonSceneIds[] = {
|
||||
SCENE_MITURIN, // DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE
|
||||
SCENE_HAKUGIN, // DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE
|
||||
SCENE_SEA, // DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE
|
||||
SCENE_INISIE_N, // DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
SCENE_INISIE_R, // Play_GetOriginalSceneId converts play->sceneId to SCENE_INISIE_N, returning
|
||||
// DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
};
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sDungeonSceneIds); i++) {
|
||||
@@ -65,28 +77,29 @@ s32 Map_GetDungeonAreaIndex(PlayState* play) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current scene is a dungeon scene, false otherwise.
|
||||
* Test if the current scene is a dungeon scene, excluding boss rooms
|
||||
* @return true if the current scene is a dungeon scene, false otherwise.
|
||||
*/
|
||||
s32 Map_IsInDungeonArea(PlayState* play) {
|
||||
if (Map_GetDungeonAreaIndex(play) == -1) {
|
||||
s32 Map_IsInDungeonScene(PlayState* play) {
|
||||
if (Map_GetDungeonSceneIndexForDungeon(play) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 sBossSceneIds[] = {
|
||||
SCENE_MITURIN_BS, // DUNGEON_INDEX_WOODFALL_TEMPLE
|
||||
SCENE_HAKUGIN_BS, // DUNGEON_INDEX_SNOWHEAD_TEMPLE
|
||||
SCENE_SEA_BS, // DUNGEON_INDEX_GREAT_BAY_TEMPLE
|
||||
SCENE_INISIE_BS, // DUNGEON_INDEX_STONE_TOWER_TEMPLE
|
||||
};
|
||||
|
||||
/**
|
||||
* If the current scene is a boss scene, this function returns an index
|
||||
* indicating which one it is. Otherwise, it returns -1.
|
||||
* Tests if the current scene is a boss scene.
|
||||
* @return -1 if not a boss scene, else returns the DungeonSceneIndex corresponding to that boss scene's primary dungeon
|
||||
* scene
|
||||
*/
|
||||
s32 Map_GetBossAreaIndex(PlayState* play) {
|
||||
s32 Map_GetDungeonSceneIndexForBoss(PlayState* play) {
|
||||
static s32 sBossSceneIds[] = {
|
||||
SCENE_MITURIN_BS, // DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE
|
||||
SCENE_HAKUGIN_BS, // DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE
|
||||
SCENE_SEA_BS, // DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE
|
||||
SCENE_INISIE_BS, // DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
};
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sBossSceneIds); i++) {
|
||||
@@ -99,36 +112,11 @@ s32 Map_GetBossAreaIndex(PlayState* play) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current scene is a boss scene, false otherwise.
|
||||
* Checks if the current scene is a boss scene.
|
||||
* @return true if the current scene is a boss scene, false otherwise.
|
||||
*/
|
||||
s32 Map_IsInBossArea(PlayState* play) {
|
||||
if (Map_GetBossAreaIndex(play) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 D_801BF5A4[] = {
|
||||
SCENE_22DEKUCITY,
|
||||
SCENE_KOEPONARACE,
|
||||
SCENE_F01,
|
||||
};
|
||||
|
||||
s32 func_8010A238(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_801BF5A4); i++) {
|
||||
if (Play_GetOriginalSceneId(play->sceneId) == D_801BF5A4[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 func_8010A2AC(PlayState* play) {
|
||||
if (func_8010A238(play) == -1) {
|
||||
s32 Map_IsInBossScene(PlayState* play) {
|
||||
if (Map_GetDungeonSceneIndexForBoss(play) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -136,29 +124,65 @@ s32 func_8010A2AC(PlayState* play) {
|
||||
}
|
||||
|
||||
/**
|
||||
* When a room is loaded, this function is used to save the player's position and rotation
|
||||
* so that the red arrow on the minimap can be drawn correctly.
|
||||
* Intended to check if the current scene is an overworld scene with a minimap.
|
||||
* The implementation is incomplete due to a complete rewrite of z_map_exp.c and other map systems, making the function
|
||||
* obsolete.
|
||||
* @return -1 if not in the list, else returns the MapIndex for the overworld scene
|
||||
*/
|
||||
void Minimap_SavePlayerRoomInitInfo(PlayState* play) {
|
||||
s32 Map_GetMapIndexForOverworld(PlayState* play) {
|
||||
static s32 sSceneIds[] = {
|
||||
SCENE_22DEKUCITY,
|
||||
SCENE_KOEPONARACE,
|
||||
SCENE_F01,
|
||||
};
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sSceneIds); i++) {
|
||||
if (Play_GetOriginalSceneId(play->sceneId) == sSceneIds[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intended to check if the current scene is an overworld scene with a minimap.
|
||||
* The implementation is incomplete due to a complete rewrite of z_map_exp.c and other map systems, making the function
|
||||
* obsolete.
|
||||
* @return true if the current scene is in the set, false otherwise.
|
||||
*/
|
||||
s32 Map_IsInOverworldSceneWithMapIndex(PlayState* play) {
|
||||
if (Map_GetMapIndexForOverworld(play) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position and rotation of where the player has entered the area.
|
||||
* Used to draw the red marker on the minimap.
|
||||
*/
|
||||
void Map_SetAreaEntrypoint(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
sMinimapInitPosX = player->actor.world.pos.x;
|
||||
sMinimapInitPosZ = player->actor.world.pos.z;
|
||||
sMinimapInitDir = (0x7FFF - player->actor.shape.rot.y) / 0x400;
|
||||
sPlayerInitPosX = player->actor.world.pos.x;
|
||||
sPlayerInitPosZ = player->actor.world.pos.z;
|
||||
sPlayerInitDir = (0x7FFF - player->actor.shape.rot.y) / 0x400;
|
||||
}
|
||||
|
||||
void Map_InitRoomData(PlayState* play, s16 room) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
func_80105C40(room);
|
||||
MapDisp_SwapRooms(room);
|
||||
|
||||
if (room >= 0) {
|
||||
if (Map_IsInDungeonOrBossArea(play)) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[Play_GetOriginalSceneId(play->sceneId)].rooms |=
|
||||
gBitFlags[room];
|
||||
if (Map_IsInDungeonOrBossScene(play)) {
|
||||
SET_ROOM_VISITED(Play_GetOriginalSceneId(play->sceneId), room);
|
||||
interfaceCtx->mapRoomNum = room;
|
||||
interfaceCtx->dungeonOrBossAreaMapIndex = mapIndex;
|
||||
interfaceCtx->dungeonSceneIndex = mapIndex;
|
||||
}
|
||||
} else {
|
||||
interfaceCtx->mapRoomNum = 0;
|
||||
@@ -170,50 +194,52 @@ void Map_InitRoomData(PlayState* play, s16 room) {
|
||||
}
|
||||
|
||||
void Map_Destroy(PlayState* play) {
|
||||
func_80105A40(play);
|
||||
MapDisp_Destroy(play);
|
||||
}
|
||||
|
||||
void Map_Init(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s32 dungeonIndex;
|
||||
s32 dungeonSceneSharedIndex;
|
||||
|
||||
func_80105C40(play->roomCtx.curRoom.num);
|
||||
MapDisp_SwapRooms(play->roomCtx.curRoom.num);
|
||||
interfaceCtx->unk_278 = -1;
|
||||
interfaceCtx->dungeonOrBossAreaMapIndex = -1;
|
||||
interfaceCtx->dungeonSceneIndex = -1;
|
||||
interfaceCtx->mapSegment = THA_AllocTailAlign16(&play->state.tha, 0x1000);
|
||||
if (func_8010A2AC(play)) {
|
||||
gSaveContext.mapIndex = func_8010A238(play);
|
||||
|
||||
//! This block does pretty much nothing, as z_map_exp.c and other map systems were heavily rewritten after OoT to no
|
||||
//! longer need mapIndex to retrieve minimap data.
|
||||
if (Map_IsInOverworldSceneWithMapIndex(play)) {
|
||||
gSaveContext.mapIndex = Map_GetMapIndexForOverworld(play);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Map_IsInDungeonOrBossArea(play)) {
|
||||
dungeonIndex = Map_GetDungeonOrBossAreaIndex(play);
|
||||
gSaveContext.mapIndex = dungeonIndex;
|
||||
if (Map_IsInDungeonOrBossScene(play)) {
|
||||
gSaveContext.mapIndex = dungeonSceneSharedIndex = Map_GetDungeonSceneIndex(play);
|
||||
switch (play->sceneId) {
|
||||
case SCENE_MITURIN_BS:
|
||||
dungeonIndex = DUNGEON_INDEX_WOODFALL_TEMPLE;
|
||||
dungeonSceneSharedIndex = DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE;
|
||||
break;
|
||||
|
||||
case SCENE_HAKUGIN_BS:
|
||||
dungeonIndex = DUNGEON_INDEX_SNOWHEAD_TEMPLE;
|
||||
dungeonSceneSharedIndex = DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE;
|
||||
break;
|
||||
|
||||
case SCENE_SEA_BS:
|
||||
dungeonIndex = DUNGEON_INDEX_GREAT_BAY_TEMPLE;
|
||||
dungeonSceneSharedIndex = DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE;
|
||||
break;
|
||||
|
||||
case SCENE_INISIE_BS:
|
||||
dungeonIndex = DUNGEON_INDEX_STONE_TOWER_TEMPLE;
|
||||
dungeonSceneSharedIndex = DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE;
|
||||
break;
|
||||
}
|
||||
|
||||
gSaveContext.dungeonIndex = dungeonIndex;
|
||||
gSaveContext.dungeonSceneSharedIndex = dungeonSceneSharedIndex;
|
||||
Map_InitRoomData(play, play->roomCtx.curRoom.num);
|
||||
}
|
||||
}
|
||||
|
||||
void Minimap_Draw(PlayState* play) {
|
||||
func_80106644(play, sMinimapInitPosX, sMinimapInitPosZ, sMinimapInitDir);
|
||||
void Map_DrawMinimap(PlayState* play) {
|
||||
MapDisp_DrawMinimap(play, sPlayerInitPosX, sPlayerInitPosZ, sPlayerInitDir);
|
||||
}
|
||||
|
||||
s16 sLastRoomNum = 99;
|
||||
@@ -227,7 +253,7 @@ void Map_Update(PlayState* play) {
|
||||
s32 pad2;
|
||||
|
||||
if ((play->pauseCtx.state <= PAUSE_STATE_OPENING_2) && (CHECK_BTN_ALL(controller->press.button, BTN_L)) &&
|
||||
!Play_InCsMode(play) && !func_80106530(play)) {
|
||||
!Play_InCsMode(play) && !MapDisp_IsMinimapToggleBlocked(play)) {
|
||||
if (!R_MINIMAP_DISABLED) {
|
||||
Audio_PlaySfx(NA_SE_SY_CAMERA_ZOOM_UP);
|
||||
} else {
|
||||
@@ -237,22 +263,21 @@ void Map_Update(PlayState* play) {
|
||||
R_MINIMAP_DISABLED ^= 1;
|
||||
}
|
||||
|
||||
func_80105B34(play);
|
||||
MapDisp_Update(play);
|
||||
|
||||
if (!IS_PAUSED(&play->pauseCtx)) {
|
||||
if (Map_IsInDungeonArea(play)) {
|
||||
floor = func_80109124(player->actor.world.pos.y);
|
||||
if (Map_IsInDungeonScene(play)) {
|
||||
floor = MapDisp_GetPlayerStorey(player->actor.world.pos.y);
|
||||
if (floor != -1) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[Play_GetOriginalSceneId(play->sceneId)].unk_14 |=
|
||||
gBitFlags[FLOOR_INDEX_MAX - floor];
|
||||
R_REVERSE_FLOOR_INDEX = FLOOR_INDEX_MAX - floor;
|
||||
SET_DUNGEON_FLOOR_VISITED(Play_GetOriginalSceneId(play->sceneId), FLOOR_INDEX_MAX - floor);
|
||||
R_PLAYER_FLOOR_REVERSE_INDEX = FLOOR_INDEX_MAX - floor;
|
||||
if (interfaceCtx->mapRoomNum != sLastRoomNum) {
|
||||
sLastRoomNum = interfaceCtx->mapRoomNum;
|
||||
}
|
||||
}
|
||||
} else if (Map_IsInBossArea(play)) {
|
||||
func_80105294();
|
||||
R_REVERSE_FLOOR_INDEX = FLOOR_INDEX_MAX - func_80105318();
|
||||
} else if (Map_IsInBossScene(play)) {
|
||||
MapDisp_GetBossIconY();
|
||||
R_PLAYER_FLOOR_REVERSE_INDEX = FLOOR_INDEX_MAX - MapDisp_GetBossRoomStorey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-13
@@ -930,21 +930,22 @@ void Message_DrawItemIcon(PlayState* play, Gfx** gfxP) {
|
||||
} else if (msgCtx->itemId == ITEM_STRAY_FAIRIES) {
|
||||
msgCtx->unk12016 = 0x18;
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetPrimColor(gfx++, 0, 0, sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonIndex)].r,
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonIndex)].g,
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonIndex)].b, msgCtx->textColorAlpha);
|
||||
gDPSetEnvColor(gfx++, sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonIndex)].r,
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonIndex)].g,
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonIndex)].b, 0);
|
||||
gDPSetPrimColor(gfx++, 0, 0, sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonSceneSharedIndex)].r,
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonSceneSharedIndex)].g,
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonSceneSharedIndex)].b,
|
||||
msgCtx->textColorAlpha);
|
||||
gDPSetEnvColor(gfx++, sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonSceneSharedIndex)].r,
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonSceneSharedIndex)].g,
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonSceneSharedIndex)].b, 0);
|
||||
gDPLoadTextureBlock_4b(gfx++, gStrayFairyGlowingCircleIconTex, G_IM_FMT_I, 32, 24, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPTextureRectangle(gfx++, msgCtx->unk12010 << 2, msgCtx->unk12012 << 2,
|
||||
(msgCtx->unk12010 + msgCtx->unk12014) << 2, (msgCtx->unk12012 + msgCtx->unk12016) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, msgCtx->textColorAlpha);
|
||||
gDPLoadTextureBlock(gfx++, sStrayFairyIconTextures[((void)0, gSaveContext.dungeonIndex)], G_IM_FMT_RGBA,
|
||||
G_IM_SIZ_32b, 32, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock(gfx++, sStrayFairyIconTextures[((void)0, gSaveContext.dungeonSceneSharedIndex)],
|
||||
G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 24, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
} else if ((msgCtx->itemId >= ITEM_SONG_SONATA) && (msgCtx->itemId <= ITEM_SONG_SUN)) {
|
||||
index = msgCtx->itemId - ITEM_SONG_SONATA;
|
||||
gDPSetPrimColor(gfx++, 0, 0, D_801CFE04[index], D_801CFE1C[index], D_801CFE34[index], msgCtx->textColorAlpha);
|
||||
@@ -2134,7 +2135,7 @@ void Message_LoadOwlWarpText(PlayState* play, s32* offset, f32* arg2, s16* decod
|
||||
s16 owlWarpId;
|
||||
s16 i;
|
||||
|
||||
if (func_8010A0A4(play) || (play->sceneId == SCENE_SECOM)) {
|
||||
if (Map_CurRoomHasMapI(play) || (play->sceneId == SCENE_SECOM)) {
|
||||
owlWarpId = OWL_WARP_ENTRANCE;
|
||||
} else {
|
||||
owlWarpId = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
|
||||
@@ -2463,7 +2464,8 @@ void Message_Decode(PlayState* play) {
|
||||
Message_LoadTime(play, curChar, &charTexIndex, &spC0, &decodedBufPos);
|
||||
} else if (curChar == 0x21C) {
|
||||
digits[0] = digits[1] = 0;
|
||||
digits[2] = gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex];
|
||||
digits[2] =
|
||||
gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex];
|
||||
|
||||
while (digits[2] >= 100) {
|
||||
digits[0]++;
|
||||
@@ -3121,7 +3123,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
|
||||
if (msgCtx) {}
|
||||
textId = 0xC9;
|
||||
} else if (textId == 0x11) {
|
||||
if (gSaveContext.save.saveInfo.inventory.strayFairies[((void)0, gSaveContext.dungeonIndex)] == 0xF) {
|
||||
if (gSaveContext.save.saveInfo.inventory.strayFairies[((void)0, gSaveContext.dungeonSceneSharedIndex)] == 0xF) {
|
||||
textId = 0xF3;
|
||||
}
|
||||
} else if ((textId == 0x92) && (play->sceneId == SCENE_KOEPONARACE)) {
|
||||
@@ -5687,7 +5689,7 @@ void Message_Update(PlayState* play) {
|
||||
|
||||
if (sLastPlayedSong == OCARINA_SONG_SOARING) {
|
||||
if (interfaceCtx->restrictions.songOfSoaring == 0) {
|
||||
if (func_8010A0A4(play) || (play->sceneId == SCENE_SECOM)) {
|
||||
if (Map_CurRoomHasMapI(play) || (play->sceneId == SCENE_SECOM)) {
|
||||
Message_StartTextbox(play, 0x1B93, NULL);
|
||||
play->msgCtx.ocarinaMode = OCARINA_MODE_1B;
|
||||
sLastPlayedSong = 0xFF;
|
||||
|
||||
@@ -280,7 +280,7 @@ void Message_LoadOwlWarpTextNES(PlayState* play, s32* offset, f32* arg2, s16* de
|
||||
s16 owlWarpId;
|
||||
s16 stringLimit;
|
||||
|
||||
if (func_8010A0A4(play) || (play->sceneId == SCENE_SECOM)) {
|
||||
if (Map_CurRoomHasMapI(play) || (play->sceneId == SCENE_SECOM)) {
|
||||
owlWarpId = OWL_WARP_ENTRANCE;
|
||||
} else {
|
||||
owlWarpId = play->pauseCtx.cursorPoint[PAUSE_WORLD_MAP];
|
||||
@@ -1310,7 +1310,8 @@ void Message_DecodeNES(PlayState* play) {
|
||||
Message_LoadTimeNES(play, curChar, &charTexIndex, &spA4, &decodedBufPos);
|
||||
} else if (curChar == MESSAGE_STRAY_FAIRIES) {
|
||||
digits[0] = digits[1] = 0;
|
||||
digits[2] = gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex];
|
||||
digits[2] =
|
||||
gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex];
|
||||
|
||||
while (digits[2] >= 100) {
|
||||
digits[0]++;
|
||||
@@ -1332,18 +1333,24 @@ void Message_DecodeNES(PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] == 1) ||
|
||||
(gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] == 21)) {
|
||||
if ((gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex] ==
|
||||
1) ||
|
||||
(gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex] ==
|
||||
21)) {
|
||||
Message_LoadCharNES(play, 's', &charTexIndex, &spA4, decodedBufPos);
|
||||
decodedBufPos++;
|
||||
Message_LoadCharNES(play, 't', &charTexIndex, &spA4, decodedBufPos);
|
||||
} else if ((gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] == 2) ||
|
||||
(gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] == 22)) {
|
||||
} else if ((gSaveContext.save.saveInfo.inventory
|
||||
.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex] == 2) ||
|
||||
(gSaveContext.save.saveInfo.inventory
|
||||
.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex] == 22)) {
|
||||
Message_LoadCharNES(play, 'n', &charTexIndex, &spA4, decodedBufPos);
|
||||
decodedBufPos++;
|
||||
Message_LoadCharNES(play, 'd', &charTexIndex, &spA4, decodedBufPos);
|
||||
} else if ((gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] == 3) ||
|
||||
(gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] == 23)) {
|
||||
} else if ((gSaveContext.save.saveInfo.inventory
|
||||
.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex] == 3) ||
|
||||
(gSaveContext.save.saveInfo.inventory
|
||||
.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex] == 23)) {
|
||||
Message_LoadCharNES(play, 'r', &charTexIndex, &spA4, decodedBufPos);
|
||||
decodedBufPos++;
|
||||
Message_LoadCharNES(play, 'd', &charTexIndex, &spA4, decodedBufPos);
|
||||
|
||||
@@ -6428,7 +6428,7 @@ void Interface_Draw(PlayState* play) {
|
||||
}
|
||||
|
||||
Magic_DrawMeter(play);
|
||||
Minimap_Draw(play);
|
||||
Map_DrawMinimap(play);
|
||||
|
||||
if ((R_PAUSE_BG_PRERENDER_STATE != 2) && (R_PAUSE_BG_PRERENDER_STATE != 3)) {
|
||||
Target_Draw(&play->actorCtx.targetCtx, play);
|
||||
|
||||
+2
-2
@@ -1575,7 +1575,7 @@ void Play_InitScene(PlayState* this, s32 spawn) {
|
||||
this->numSetupActors = 0;
|
||||
Object_InitContext(&this->state, &this->objectCtx);
|
||||
LightContext_Init(this, &this->lightCtx);
|
||||
Door_InitContext(&this->state, &this->doorCtx);
|
||||
Scene_ResetTransitionActorList(&this->state, &this->transitionActors);
|
||||
Room_Init(this, &this->roomCtx);
|
||||
gSaveContext.worldMapArea = 0;
|
||||
Scene_ExecuteCommands(this, this->sceneSegment);
|
||||
@@ -1975,7 +1975,7 @@ s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw) {
|
||||
return false;
|
||||
}
|
||||
|
||||
transitionActor = &this->doorCtx.transitionActorList[(u16)actor->params >> 10];
|
||||
transitionActor = &this->transitionActors.list[(u16)actor->params >> 10];
|
||||
frontRoom = transitionActor->sides[0].room;
|
||||
if (frontRoom == transitionActor->sides[1].room) {
|
||||
return false;
|
||||
|
||||
+4
-4
@@ -502,11 +502,11 @@ size_t Room_AllocateAndLoad(PlayState* play, RoomContext* roomCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((u32)play->doorCtx.numTransitionActors != 0) {
|
||||
if ((u32)play->transitionActors.count != 0) {
|
||||
RomFile* roomList = play->roomList;
|
||||
TransitionActorEntry* transitionActor = &play->doorCtx.transitionActorList[0];
|
||||
TransitionActorEntry* transitionActor = &play->transitionActors.list[0];
|
||||
|
||||
for (j = 0; j < play->doorCtx.numTransitionActors; j++) {
|
||||
for (j = 0; j < play->transitionActors.count; j++) {
|
||||
frontRoom = transitionActor->sides[0].room;
|
||||
backRoom = transitionActor->sides[1].room;
|
||||
frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart;
|
||||
@@ -620,7 +620,7 @@ void func_8012EBF8(PlayState* play, RoomContext* roomCtx) {
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
if (roomCtx->curRoom.num > -1) {
|
||||
Map_InitRoomData(play, roomCtx->curRoom.num);
|
||||
Minimap_SavePlayerRoomInitInfo(play);
|
||||
Map_SetAreaEntrypoint(play);
|
||||
}
|
||||
Audio_SetEnvReverb(play->roomCtx.curRoom.echo);
|
||||
}
|
||||
|
||||
+16
-16
@@ -334,15 +334,15 @@ void Scene_CommandPathList(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0E: Transition Actor List
|
||||
void Scene_CommandTransiActorList(PlayState* play, SceneCmd* cmd) {
|
||||
play->doorCtx.numTransitionActors = cmd->transiActorList.num;
|
||||
play->doorCtx.transitionActorList = Lib_SegmentedToVirtual(cmd->transiActorList.segment);
|
||||
func_80105818(play, play->doorCtx.numTransitionActors, play->doorCtx.transitionActorList);
|
||||
void Scene_CommandTransitionActorList(PlayState* play, SceneCmd* cmd) {
|
||||
play->transitionActors.count = cmd->transitionActorList.num;
|
||||
play->transitionActors.list = Lib_SegmentedToVirtual(cmd->transitionActorList.segment);
|
||||
MapDisp_InitTransitionActorData(play, play->transitionActors.count, play->transitionActors.list);
|
||||
}
|
||||
|
||||
// Init function for the transition system.
|
||||
void Door_InitContext(GameState* state, DoorContext* doorCtx) {
|
||||
doorCtx->numTransitionActors = 0;
|
||||
void Scene_ResetTransitionActorList(GameState* state, TransitionActorList* transitionActors) {
|
||||
transitionActors->count = 0;
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0F: Environment Light Settings List
|
||||
@@ -495,19 +495,19 @@ void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd) {
|
||||
CutsceneManager_Init(play, Lib_SegmentedToVirtual(cmd->cutsceneList.segment), cmd->cutsceneList.num);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1C: Mini Maps
|
||||
void Scene_CommandMiniMap(PlayState* play, SceneCmd* cmd) {
|
||||
func_80104CF4(play);
|
||||
func_8010549C(play, cmd->minimapSettings.segment);
|
||||
// SceneTableEntry Header Command 0x1C: Map Data
|
||||
void Scene_CommandMapData(PlayState* play, SceneCmd* cmd) {
|
||||
MapDisp_Init(play);
|
||||
MapDisp_InitMapData(play, cmd->mapData.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1D: Undefined
|
||||
void Scene_Command1D(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1E: Minimap Compass Icon Info
|
||||
void Scene_CommandMiniMapCompassInfo(PlayState* play, SceneCmd* cmd) {
|
||||
func_8010565C(play, cmd->minimapChests.num, cmd->minimapChests.segment);
|
||||
// SceneTableEntry Header Command 0x1E: Map Data Chests
|
||||
void Scene_CommandMapDataChests(PlayState* play, SceneCmd* cmd) {
|
||||
MapDisp_InitChestData(play, cmd->mapDataChests.num, cmd->mapDataChests.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x19: Sets Region Visited Flag
|
||||
@@ -565,7 +565,7 @@ void (*sSceneCmdHandlers[SCENE_CMD_MAX])(PlayState*, SceneCmd*) = {
|
||||
Scene_CommandObjectList, // SCENE_CMD_ID_OBJECT_LIST
|
||||
Scene_CommandLightList, // SCENE_CMD_ID_LIGHT_LIST
|
||||
Scene_CommandPathList, // SCENE_CMD_ID_PATH_LIST
|
||||
Scene_CommandTransiActorList, // SCENE_CMD_ID_TRANSI_ACTOR_LIST
|
||||
Scene_CommandTransitionActorList, // SCENE_CMD_ID_TRANSI_ACTOR_LIST
|
||||
Scene_CommandEnvLightSettings, // SCENE_CMD_ID_ENV_LIGHT_SETTINGS
|
||||
Scene_CommandTimeSettings, // SCENE_CMD_ID_TIME_SETTINGS
|
||||
Scene_CommandSkyboxSettings, // SCENE_CMD_ID_SKYBOX_SETTINGS
|
||||
@@ -579,9 +579,9 @@ void (*sSceneCmdHandlers[SCENE_CMD_MAX])(PlayState*, SceneCmd*) = {
|
||||
Scene_CommandSetRegionVisitedFlag, // SCENE_CMD_ID_SET_REGION_VISITED
|
||||
Scene_CommandAnimatedMaterials, // SCENE_CMD_ID_ANIMATED_MATERIAL_LIST
|
||||
Scene_CommandCutsceneList, // SCENE_CMD_ID_ACTOR_CUTSCENE_LIST
|
||||
Scene_CommandMiniMap, // SCENE_CMD_ID_MINIMAP_INFO
|
||||
Scene_CommandMapData, // SCENE_CMD_ID_MAP_DATA
|
||||
Scene_Command1D, // SCENE_CMD_ID_UNUSED_1D
|
||||
Scene_CommandMiniMapCompassInfo, // SCENE_CMD_ID_MINIMAP_COMPASS_ICON_INFO
|
||||
Scene_CommandMapDataChests, // SCENE_CMD_ID_MAP_DATA_CHESTS
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,7 +101,7 @@ void BgOpenShutter_Destroy(Actor* thisx, PlayState* play) {
|
||||
BgOpenShutter* this = THIS;
|
||||
s32 transition = DOOR_GET_TRANSITION_ID(thisx);
|
||||
|
||||
play->doorCtx.transitionActorList[transition].id = -play->doorCtx.transitionActorList[transition].id;
|
||||
play->transitionActors.list[transition].id = -play->transitionActors.list[transition].id;
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->slidingDoor.dyna.bgId);
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc
|
||||
|
||||
s32 func_808A0900(DoorShutter* this, PlayState* play) {
|
||||
TransitionActorEntry* transitionEntry =
|
||||
&play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)];
|
||||
&play->transitionActors.list[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)];
|
||||
s8 frontRoom = transitionEntry->sides[0].room;
|
||||
|
||||
if (frontRoom == transitionEntry->sides[1].room) {
|
||||
@@ -156,31 +156,31 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) {
|
||||
ShutterObjectInfo* sp24 = &D_808A2180[this->unk_163];
|
||||
s32 doorType = this->doorType;
|
||||
|
||||
if (doorType != 4) {
|
||||
if (doorType != DOORSHUTTER_TYPE_4) {
|
||||
if (func_808A0900(this, play)) {
|
||||
if ((doorType == 7) || (doorType == 6)) {
|
||||
doorType = 1;
|
||||
} else if (doorType == 5) {
|
||||
doorType = 3;
|
||||
if ((doorType == DOORSHUTTER_TYPE_7) || (doorType == DOORSHUTTER_TYPE_6)) {
|
||||
doorType = DOORSHUTTER_TYPE_1;
|
||||
} else if (doorType == DOORSHUTTER_TYPE_BOSS_DOOR) {
|
||||
doorType = DOORSHUTTER_TYPE_3;
|
||||
} else {
|
||||
doorType = 0;
|
||||
doorType = DOORSHUTTER_TYPE_0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doorType == 0) {
|
||||
if (doorType == DOORSHUTTER_TYPE_0) {
|
||||
this->unk_164 = sp24->index1;
|
||||
} else {
|
||||
this->unk_164 = sp24->index2;
|
||||
}
|
||||
|
||||
if (doorType == 1) {
|
||||
if (doorType == DOORSHUTTER_TYPE_1) {
|
||||
if (!Flags_GetClear(play, this->slidingDoor.dyna.actor.room)) {
|
||||
DoorShutter_SetupAction(this, func_808A0F88);
|
||||
this->unk_168 = 1.0f;
|
||||
return true;
|
||||
}
|
||||
} else if ((doorType == 2) || (doorType == 7)) {
|
||||
} else if ((doorType == DOORSHUTTER_TYPE_2) || (doorType == DOORSHUTTER_TYPE_7)) {
|
||||
if (!Flags_GetSwitch(play, DOORSHUTTER_GET_SWITCH_FLAG(&this->slidingDoor.dyna.actor))) {
|
||||
DoorShutter_SetupAction(this, func_808A1548);
|
||||
this->unk_168 = 1.0f;
|
||||
@@ -188,7 +188,7 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) {
|
||||
}
|
||||
DoorShutter_SetupAction(this, func_808A1618);
|
||||
return false;
|
||||
} else if (doorType == 3) {
|
||||
} else if (doorType == DOORSHUTTER_TYPE_3) {
|
||||
DoorShutter_SetupAction(this, func_808A1080);
|
||||
this->unk_168 = 1.0f;
|
||||
return false;
|
||||
@@ -204,7 +204,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
||||
s32 i;
|
||||
|
||||
Actor_ProcessInitChain(&this->slidingDoor.dyna.actor, sInitChain);
|
||||
this->doorType = DOORSHUTTER_GET_380(&this->slidingDoor.dyna.actor);
|
||||
this->doorType = DOORSHUTTER_GET_TYPE(&this->slidingDoor.dyna.actor);
|
||||
sp24 = D_808A2240[this->doorType];
|
||||
|
||||
if (sp24 < 0) {
|
||||
@@ -242,7 +242,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
||||
DoorShutter_SetupAction(this, DoorShutter_SetupType);
|
||||
this->unk_163 = sp24;
|
||||
|
||||
if ((this->doorType == 4) || (this->doorType == 5)) {
|
||||
if ((this->doorType == DOORSHUTTER_TYPE_4) || (this->doorType == DOORSHUTTER_TYPE_BOSS_DOOR)) {
|
||||
if (!Flags_GetSwitch(play, DOORSHUTTER_GET_SWITCH_FLAG(&this->slidingDoor.dyna.actor))) {
|
||||
this->unk_166 = 10;
|
||||
}
|
||||
@@ -257,8 +257,7 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) {
|
||||
if (this->slidingDoor.dyna.actor.room >= 0) {
|
||||
s32 transitionActorId = DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor);
|
||||
|
||||
play->doorCtx.transitionActorList[transitionActorId].id =
|
||||
-play->doorCtx.transitionActorList[transitionActorId].id;
|
||||
play->transitionActors.list[transitionActorId].id = -play->transitionActors.list[transitionActorId].id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +313,7 @@ void func_808A0F88(DoorShutter* this, PlayState* play) {
|
||||
if (Flags_GetClear(play, this->slidingDoor.dyna.actor.room) ||
|
||||
Flags_GetClearTemp(play, this->slidingDoor.dyna.actor.room)) {
|
||||
this->csId = this->slidingDoor.dyna.actor.csId;
|
||||
if (this->doorType == 7) {
|
||||
if (this->doorType == DOORSHUTTER_TYPE_7) {
|
||||
if (this->csId != CS_ID_NONE) {
|
||||
this->csId = CutsceneManager_GetAdditionalCsId(this->csId);
|
||||
}
|
||||
@@ -347,7 +346,7 @@ void func_808A1090(DoorShutter* this, PlayState* play) {
|
||||
this->slidingDoor.dyna.actor.velocity.y = 0.0f;
|
||||
if (this->unk_166 != 0) {
|
||||
Flags_SetSwitch(play, DOORSHUTTER_GET_SWITCH_FLAG(&this->slidingDoor.dyna.actor));
|
||||
if (this->doorType != 5) {
|
||||
if (this->doorType != DOORSHUTTER_TYPE_BOSS_DOOR) {
|
||||
DUNGEON_KEY_COUNT(gSaveContext.mapIndex) = DUNGEON_KEY_COUNT(gSaveContext.mapIndex) - 1;
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
|
||||
} else {
|
||||
@@ -370,14 +369,14 @@ void func_808A1090(DoorShutter* this, PlayState* play) {
|
||||
player->doorTimer = 0;
|
||||
}
|
||||
|
||||
if (this->doorType == 6) {
|
||||
if (this->doorType == DOORSHUTTER_TYPE_6) {
|
||||
if (gSaveContext.save.saveInfo.playerData.healthCapacity <
|
||||
(DOORSHUTTER_GET_1F(&this->slidingDoor.dyna.actor) * 0x10)) {
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->slidingDoor.dyna.actor.textId = 0x14FC;
|
||||
}
|
||||
} else if (this->unk_166 != 0) {
|
||||
if (this->doorType == 5) {
|
||||
if (this->doorType == DOORSHUTTER_TYPE_BOSS_DOOR) {
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_BOSS_KEY, gSaveContext.mapIndex)) {
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->slidingDoor.dyna.actor.textId = 0x1803;
|
||||
@@ -507,7 +506,7 @@ void func_808A1684(DoorShutter* this, PlayState* play) {
|
||||
f32 phi_f0;
|
||||
|
||||
if ((DECR(this->unk_166) == 0) && (play->roomCtx.status == 0) && func_808A1340(this, play)) {
|
||||
if (this->doorType == 5) {
|
||||
if (this->doorType == DOORSHUTTER_TYPE_BOSS_DOOR) {
|
||||
phi_f0 = 20.0f;
|
||||
} else {
|
||||
phi_f0 = 50.0f;
|
||||
@@ -541,8 +540,8 @@ void func_808A1784(DoorShutter* this, PlayState* play) {
|
||||
} else if (func_808A1478(this, play, 0.0f)) {
|
||||
u8 doorType = this->doorType;
|
||||
|
||||
if ((doorType != 0) && (doorType != 1) &&
|
||||
(((doorType != 7) && (doorType != 6)) || !func_808A0900(this, play))) {
|
||||
if ((doorType != DOORSHUTTER_TYPE_0) && (doorType != DOORSHUTTER_TYPE_1) &&
|
||||
(((doorType != DOORSHUTTER_TYPE_7) && (doorType != DOORSHUTTER_TYPE_6)) || !func_808A0900(this, play))) {
|
||||
DoorShutter_SetupAction(this, func_808A1618);
|
||||
} else {
|
||||
DoorShutter_SetupAction(this, func_808A1090);
|
||||
@@ -560,7 +559,7 @@ void func_808A1884(DoorShutter* this, PlayState* play) {
|
||||
Actor_OffsetOfPointInActorCoords(&this->slidingDoor.dyna.actor, &sp44, &player->actor.world.pos);
|
||||
|
||||
this->slidingDoor.dyna.actor.room =
|
||||
play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)]
|
||||
play->transitionActors.list[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)]
|
||||
.sides[(sp44.z < 0.0f) ? 0 : 1]
|
||||
.room;
|
||||
|
||||
@@ -700,7 +699,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
|
||||
|
||||
if (sp44->unk_04 != 0) {
|
||||
TransitionActorEntry* transitionEntry =
|
||||
&play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)];
|
||||
&play->transitionActors.list[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)];
|
||||
|
||||
if ((play->roomCtx.prevRoom.num >= 0) ||
|
||||
(transitionEntry->sides[0].room == transitionEntry->sides[1].room)) {
|
||||
@@ -713,7 +712,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
|
||||
} else if (this->slidingDoor.dyna.actor.room == transitionEntry->sides[0].room) {
|
||||
Matrix_RotateYF(M_PIf, MTXMODE_APPLY);
|
||||
}
|
||||
} else if (this->doorType == 5) {
|
||||
} else if (this->doorType == DOORSHUTTER_TYPE_BOSS_DOOR) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_808A22DC[this->slidingDoor.unk_15E]));
|
||||
}
|
||||
|
||||
@@ -729,7 +728,8 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
|
||||
|
||||
if (this->unk_166 != 0) {
|
||||
Matrix_Scale(0.01f, 0.01f, 0.025f, MTXMODE_APPLY);
|
||||
Actor_DrawDoorLock(play, this->unk_166, (this->doorType == 5) ? DOORLOCK_BOSS : DOORLOCK_NORMAL);
|
||||
Actor_DrawDoorLock(play, this->unk_166,
|
||||
(this->doorType == DOORSHUTTER_TYPE_BOSS_DOOR) ? DOORLOCK_BOSS : DOORLOCK_NORMAL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
|
||||
@@ -8,9 +8,21 @@ struct DoorShutter;
|
||||
|
||||
typedef void (*DoorShutterActionFunc)(struct DoorShutter*, PlayState*);
|
||||
|
||||
typedef enum DoorShutterType {
|
||||
/* 0 */ DOORSHUTTER_TYPE_0,
|
||||
/* 1 */ DOORSHUTTER_TYPE_1,
|
||||
/* 2 */ DOORSHUTTER_TYPE_2,
|
||||
/* 3 */ DOORSHUTTER_TYPE_3,
|
||||
/* 4 */ DOORSHUTTER_TYPE_4,
|
||||
/* 5 */ DOORSHUTTER_TYPE_BOSS_DOOR,
|
||||
/* 6 */ DOORSHUTTER_TYPE_6,
|
||||
/* 7 */ DOORSHUTTER_TYPE_7
|
||||
} DoorShutterType;
|
||||
|
||||
#define DOORSHUTTER_GET_1F(thisx) ((thisx)->params & 0x1F)
|
||||
#define DOORSHUTTER_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F)
|
||||
#define DOORSHUTTER_GET_380(thisx) (((thisx)->params >> 7) & 7)
|
||||
#define DOORSHUTTER_GET_TYPE(thisx) (((thisx)->params >> 7) & 7)
|
||||
#define DOORSHUTTER_PARAMS_GET_TYPE(params) (((params) >> 7) & 7)
|
||||
|
||||
typedef struct DoorShutter {
|
||||
/* 0x000 */ SlidingDoorActor slidingDoor;
|
||||
|
||||
@@ -133,7 +133,7 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) {
|
||||
s32 transitionId = DOOR_GET_TRANSITION_ID(thisx);
|
||||
s8 objectSlot;
|
||||
|
||||
if (this->actor.room != play->doorCtx.transitionActorList[transitionId].sides[0].room) {
|
||||
if (this->actor.room != play->transitionActors.list[transitionId].sides[0].room) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) {
|
||||
void DoorSpiral_Destroy(Actor* thisx, PlayState* play) {
|
||||
s32 transitionId = DOOR_GET_TRANSITION_ID(thisx);
|
||||
|
||||
play->doorCtx.transitionActorList[transitionId].id = -play->doorCtx.transitionActorList[transitionId].id;
|
||||
play->transitionActors.list[transitionId].id = -play->transitionActors.list[transitionId].id;
|
||||
}
|
||||
|
||||
void func_809A2DB0(DoorSpiral* this, PlayState* play) {
|
||||
@@ -215,7 +215,7 @@ void func_809A2FF8(DoorSpiral* this, PlayState* play) {
|
||||
player->doorDirection = this->direction;
|
||||
player->doorActor = &this->actor;
|
||||
transitionId = DOOR_GET_TRANSITION_ID(&this->actor);
|
||||
player->doorNext = (play->doorCtx.transitionActorList[transitionId].params >> 0xA);
|
||||
player->doorNext = (play->transitionActors.list[transitionId].params >> 0xA);
|
||||
func_80122F28(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ void EnDoor_Destroy(Actor* thisx, PlayState* play) {
|
||||
|
||||
if (this->doorType != ENDOOR_TYPE_FRAMED) {
|
||||
TransitionActorEntry* transitionEntry =
|
||||
&play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->knobDoor.dyna.actor)];
|
||||
&play->transitionActors.list[DOOR_GET_TRANSITION_ID(&this->knobDoor.dyna.actor)];
|
||||
|
||||
if (transitionEntry->id < 0) {
|
||||
transitionEntry->id = -transitionEntry->id;
|
||||
@@ -646,7 +646,7 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
|
||||
transitionEntry = NULL;
|
||||
if (this->doorType != ENDOOR_TYPE_FRAMED) {
|
||||
transitionEntry = &play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->knobDoor.dyna.actor)];
|
||||
transitionEntry = &play->transitionActors.list[DOOR_GET_TRANSITION_ID(&this->knobDoor.dyna.actor)];
|
||||
}
|
||||
|
||||
rot->z += this->knobDoor.dyna.actor.world.rot.y;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* | |
|
||||
* | Text offset | Half day bit index
|
||||
* |-------------|--------------------
|
||||
* | 0 0 0 0 | 0 0 0
|
||||
* | 0 0 0 0 | 0 0 0
|
||||
* | 4 | 3
|
||||
* |
|
||||
*
|
||||
|
||||
@@ -107,8 +107,8 @@ void EnElforg_Init(Actor* thisx, PlayState* play) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Map_IsInDungeonOrBossArea(play)) {
|
||||
this->area = gSaveContext.dungeonIndex + STRAY_FAIRY_AREA_WOODFALL;
|
||||
if (Map_IsInDungeonOrBossScene(play)) {
|
||||
this->area = gSaveContext.dungeonSceneSharedIndex + STRAY_FAIRY_AREA_WOODFALL;
|
||||
} else {
|
||||
this->area = STRAY_FAIRY_GET_NON_DUNGEON_AREA(thisx);
|
||||
}
|
||||
@@ -497,11 +497,11 @@ void EnElforg_FreeFloating(EnElforg* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Map_IsInDungeonOrBossArea(play)) {
|
||||
gSaveContext.save.saveInfo.inventory.strayFairies[gSaveContext.dungeonIndex]++;
|
||||
if (Map_IsInDungeonOrBossScene(play)) {
|
||||
gSaveContext.save.saveInfo.inventory.strayFairies[gSaveContext.dungeonSceneSharedIndex]++;
|
||||
// You found a Stray Fairy!
|
||||
Message_StartTextbox(play, 0x11, NULL);
|
||||
if (gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] >=
|
||||
if (gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex] >=
|
||||
STRAY_FAIRY_SCATTERED_TOTAL) {
|
||||
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void EnHoll_Destroy(Actor* thisx, PlayState* play) {
|
||||
if (!EN_HOLL_IS_SCENE_CHANGER(this)) {
|
||||
u32 enHollId = EN_HOLL_GET_ID(&this->actor);
|
||||
|
||||
play->doorCtx.transitionActorList[enHollId].id = -play->doorCtx.transitionActorList[enHollId].id;
|
||||
play->transitionActors.list[enHollId].id = -play->transitionActors.list[enHollId].id;
|
||||
if (this == sInstancePlayingSound) {
|
||||
sInstancePlayingSound = NULL;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) {
|
||||
|
||||
if (sLoadingPlaneDistance < playerDistFromCentralPlane) {
|
||||
if ((play->roomCtx.prevRoom.num >= 0) && (play->roomCtx.status == 0)) {
|
||||
this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[this->playerSide].room;
|
||||
this->actor.room = play->transitionActors.list[enHollId].sides[this->playerSide].room;
|
||||
if (play->roomCtx.prevRoom.num == this->actor.room) {
|
||||
EnHoll_ChangeRooms(play);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) {
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
play->unk_1878C(play);
|
||||
} else {
|
||||
this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[this->playerSide ^ 1].room;
|
||||
this->actor.room = play->transitionActors.list[enHollId].sides[this->playerSide ^ 1].room;
|
||||
if (play->roomCtx.prevRoom.num < 0) {
|
||||
Room_StartRoomTransition(play, &play->roomCtx, this->actor.room);
|
||||
if (this == sInstancePlayingSound) {
|
||||
@@ -236,7 +236,7 @@ void EnHoll_TransparentIdle(EnHoll* this, PlayState* play) {
|
||||
playerDistFromCentralPlane > EN_HOLL_LOADING_PLANE_DISTANCE) {
|
||||
s32 enHollId = EN_HOLL_GET_ID(&this->actor);
|
||||
s32 playerSide = (transformedPlayerPos.z < 0.0f) ? EN_HOLL_BEHIND : EN_HOLL_BEFORE;
|
||||
TransitionActorEntry* transitionActorEntry = &play->doorCtx.transitionActorList[enHollId];
|
||||
TransitionActorEntry* transitionActorEntry = &play->transitionActors.list[enHollId];
|
||||
s8 room = transitionActorEntry->sides[playerSide].room;
|
||||
|
||||
this->actor.room = room;
|
||||
@@ -264,7 +264,7 @@ void EnHoll_VerticalBgCoverIdle(EnHoll* this, PlayState* play) {
|
||||
s32 enHollId = EN_HOLL_GET_ID(&this->actor);
|
||||
s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
|
||||
|
||||
this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[playerSide].room;
|
||||
this->actor.room = play->transitionActors.list[enHollId].sides[playerSide].room;
|
||||
|
||||
if ((this->actor.room != play->roomCtx.curRoom.num) &&
|
||||
Room_StartRoomTransition(play, &play->roomCtx, this->actor.room)) {
|
||||
@@ -288,7 +288,7 @@ void EnHoll_VerticalIdle(EnHoll* this, PlayState* play) {
|
||||
s32 enHollId = EN_HOLL_GET_ID(&this->actor);
|
||||
s32 playerSide = (this->actor.playerHeightRel > 0.0f) ? EN_HOLL_ABOVE : EN_HOLL_BELOW;
|
||||
|
||||
this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[playerSide].room;
|
||||
this->actor.room = play->transitionActors.list[enHollId].sides[playerSide].room;
|
||||
if ((this->actor.room != play->roomCtx.curRoom.num) &&
|
||||
Room_StartRoomTransition(play, &play->roomCtx, this->actor.room)) {
|
||||
this->actionFunc = EnHoll_RoomTransitionIdle;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Overlay: ovl_En_Kusa
|
||||
* Description: Grass / Bush
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_en_kusa.h"
|
||||
#include "objects/object_kusa/object_kusa.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* Description: Switch-Activated Geyser
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_obj_hunsui.h"
|
||||
#include "objects/object_hunsui/object_hunsui.h"
|
||||
|
||||
|
||||
@@ -6336,7 +6336,7 @@ void Player_Door_Staircase(PlayState* play, Player* this, Actor* door) {
|
||||
|
||||
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_SCENE0);
|
||||
this->cv.doorBgCamIndex =
|
||||
play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&doorStaircase->actor)].sides[0].bgCamIndex;
|
||||
play->transitionActors.list[DOOR_GET_TRANSITION_ID(&doorStaircase->actor)].sides[0].bgCamIndex;
|
||||
Actor_DeactivateLens(play);
|
||||
this->floorSfxOffset = NA_SE_PL_WALK_CONCRETE - SFX_FLAG;
|
||||
}
|
||||
@@ -6382,7 +6382,7 @@ void Player_Door_Sliding(PlayState* play, Player* this, Actor* door) {
|
||||
}
|
||||
|
||||
if (doorSliding->dyna.actor.category == ACTORCAT_DOOR) {
|
||||
this->cv.doorBgCamIndex = play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&doorSliding->dyna.actor)]
|
||||
this->cv.doorBgCamIndex = play->transitionActors.list[DOOR_GET_TRANSITION_ID(&doorSliding->dyna.actor)]
|
||||
.sides[this->doorDirection > 0 ? 0 : 1]
|
||||
.bgCamIndex;
|
||||
Actor_DeactivateLens(play);
|
||||
@@ -6481,7 +6481,7 @@ void Player_Door_Knob(PlayState* play, Player* this, Actor* door) {
|
||||
mainCam = Play_GetCamera(play, CAM_ID_MAIN);
|
||||
|
||||
Camera_ChangeDoorCam(mainCam, &knobDoor->dyna.actor,
|
||||
play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&knobDoor->dyna.actor)]
|
||||
play->transitionActors.list[DOOR_GET_TRANSITION_ID(&knobDoor->dyna.actor)]
|
||||
.sides[(this->doorDirection > 0) ? 0 : 1]
|
||||
.bgCamIndex,
|
||||
0.0f, this->av1.actionVar1, 26.0f * D_8085C3E8, 10.0f * D_8085C3E8);
|
||||
@@ -6529,7 +6529,7 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) {
|
||||
if ((this->doorType < PLAYER_DOORTYPE_FAKE) && (doorActor->category == ACTORCAT_DOOR) &&
|
||||
((this->doorType != PLAYER_DOORTYPE_HANDLE) ||
|
||||
(ENDOOR_GET_TYPE(doorActor) != ENDOOR_TYPE_FRAMED))) {
|
||||
s8 roomNum = play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(doorActor)]
|
||||
s8 roomNum = play->transitionActors.list[DOOR_GET_TRANSITION_ID(doorActor)]
|
||||
.sides[(this->doorDirection > 0) ? 0 : 1]
|
||||
.room;
|
||||
|
||||
@@ -10904,7 +10904,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
Minimap_SavePlayerRoomInitInfo(play);
|
||||
Map_SetAreaEntrypoint(play);
|
||||
func_80841A50(play, this);
|
||||
this->unk_3CF = 0;
|
||||
R_PLAY_FILL_SCREEN_ON = 0;
|
||||
@@ -13747,7 +13747,7 @@ void Player_Action_1(Player* this, PlayState* play) {
|
||||
} else if (this->av2.actionVar2 < 0) {
|
||||
if (Room_StartRoomTransition(play, &play->roomCtx, this->av1.actionVar1)) {
|
||||
Map_InitRoomData(play, play->roomCtx.curRoom.num);
|
||||
Minimap_SavePlayerRoomInitInfo(play);
|
||||
Map_SetAreaEntrypoint(play);
|
||||
this->av2.actionVar2 = 5;
|
||||
}
|
||||
} else if (this->av2.actionVar2 > 0) {
|
||||
@@ -15211,7 +15211,7 @@ void Player_Action_35(Player* this, PlayState* play) {
|
||||
TransitionActorEntry* temp_v1_4; // sp50
|
||||
s32 roomNum;
|
||||
|
||||
temp_v1_4 = &play->doorCtx.transitionActorList[this->doorNext];
|
||||
temp_v1_4 = &play->transitionActors.list[this->doorNext];
|
||||
roomNum = temp_v1_4->sides[0].room;
|
||||
R_PLAY_FILL_SCREEN_ALPHA = 255;
|
||||
|
||||
@@ -15279,7 +15279,7 @@ void Player_Action_35(Player* this, PlayState* play) {
|
||||
(Play_GetCamera(play, CAM_ID_MAIN)->stateFlags & CAM_STATE_4))) {
|
||||
if (this->unk_397 == 4) {
|
||||
Map_InitRoomData(play, play->roomCtx.curRoom.num);
|
||||
Minimap_SavePlayerRoomInitInfo(play);
|
||||
Map_SetAreaEntrypoint(play);
|
||||
}
|
||||
|
||||
R_PLAY_FILL_SCREEN_ON = 0;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Description: Entering name on a new file, selecting options from the options menu
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_file_select.h"
|
||||
#include "z64rumble.h"
|
||||
#include "misc/title_static/title_static.h"
|
||||
|
||||
@@ -52,7 +52,7 @@ void KaleidoScope_DrawDungeonStrayFairyCount(PlayState* play) {
|
||||
1 << 10);
|
||||
|
||||
// Get digits for current number of stray fairies collected
|
||||
counterDigits[1] = gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex];
|
||||
counterDigits[1] = gSaveContext.save.saveInfo.inventory.strayFairies[(void)0, gSaveContext.dungeonSceneSharedIndex];
|
||||
counterDigits[0] = counterDigits[1] / 10;
|
||||
counterDigits[1] -= (s16)(counterDigits[0] * 10);
|
||||
|
||||
@@ -81,10 +81,10 @@ TexturePtr sDungeonItemTextures[] = {
|
||||
};
|
||||
|
||||
TexturePtr sDungeonTitleTextures[] = {
|
||||
gPauseWoodfallTitleENGTex, // DUNGEON_INDEX_WOODFALL_TEMPLE
|
||||
gPauseSnowheadTitleENGTex, // DUNGEON_INDEX_SNOWHEAD_TEMPLE
|
||||
gPauseGreatBayTitleENGTex, // DUNGEON_INDEX_GREAT_BAY_TEMPLE
|
||||
gPauseStoneTowerTitleENGTex, // DUNGEON_INDEX_STONE_TOWER_TEMPLE
|
||||
gPauseWoodfallTitleENGTex, // DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE
|
||||
gPauseSnowheadTitleENGTex, // DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE
|
||||
gPauseGreatBayTitleENGTex, // DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE
|
||||
gPauseStoneTowerTitleENGTex, // DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
};
|
||||
|
||||
s16 sDungeonMapFloorIconPosY[] = { 67, 81, 95, 109, 123 };
|
||||
@@ -97,30 +97,30 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
|
||||
static s16 sStrayFairyIconAlpha = 255;
|
||||
static f32 sStrayFairyIconScale = 100.0f;
|
||||
static TexturePtr sStrayFairyIconTextures[][4] = {
|
||||
// DUNGEON_INDEX_WOODFALL_TEMPLE
|
||||
// DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE
|
||||
{ gStrayFairyWoodfallIconTex, gDungeonStrayFairyWoodfallIconTex, gStrayFairyWoodfallIconTex,
|
||||
gDungeonStrayFairyWoodfallIconTex },
|
||||
// DUNGEON_INDEX_SNOWHEAD_TEMPLE
|
||||
// DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE
|
||||
{ gStrayFairySnowheadIconTex, gDungeonStrayFairySnowheadIconTex, gStrayFairySnowheadIconTex,
|
||||
gDungeonStrayFairySnowheadIconTex },
|
||||
// DUNGEON_INDEX_GREAT_BAY_TEMPLE
|
||||
// DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE
|
||||
{ gStrayFairyGreatBayIconTex, gDungeonStrayFairyGreatBayIconTex, gStrayFairyGreatBayIconTex,
|
||||
gDungeonStrayFairyGreatBayIconTex },
|
||||
// DUNGEON_INDEX_STONE_TOWER_TEMPLE
|
||||
// DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
{ gStrayFairyStoneTowerIconTex, gDungeonStrayFairyStoneTowerIconTex, gStrayFairyStoneTowerIconTex,
|
||||
gDungeonStrayFairyStoneTowerIconTex },
|
||||
};
|
||||
static u8 sStrayFairyIconPrimColors[][3] = {
|
||||
{ 255, 110, 160 }, // DUNGEON_INDEX_WOODFALL_TEMPLE
|
||||
{ 90, 255, 100 }, // DUNGEON_INDEX_SNOWHEAD_TEMPLE
|
||||
{ 120, 255, 255 }, // DUNGEON_INDEX_GREAT_BAY_TEMPLE
|
||||
{ 245, 245, 90 }, // DUNGEON_INDEX_STONE_TOWER_TEMPLE
|
||||
{ 255, 110, 160 }, // DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE
|
||||
{ 90, 255, 100 }, // DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE
|
||||
{ 120, 255, 255 }, // DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE
|
||||
{ 245, 245, 90 }, // DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
};
|
||||
static u8 sStrayFairyIconEnvColors[][3] = {
|
||||
{ 255, 255, 255 }, // DUNGEON_INDEX_WOODFALL_TEMPLE
|
||||
{ 255, 255, 255 }, // DUNGEON_INDEX_SNOWHEAD_TEMPLE
|
||||
{ 255, 255, 255 }, // DUNGEON_INDEX_GREAT_BAY_TEMPLE
|
||||
{ 225, 170, 0 }, // DUNGEON_INDEX_STONE_TOWER_TEMPLE
|
||||
{ 255, 255, 255 }, // DUNGEON_SCENE_INDEX_WOODFALL_TEMPLE
|
||||
{ 255, 255, 255 }, // DUNGEON_SCENE_INDEX_SNOWHEAD_TEMPLE
|
||||
{ 255, 255, 255 }, // DUNGEON_SCENE_INDEX_GREAT_BAY_TEMPLE
|
||||
{ 225, 170, 0 }, // DUNGEON_SCENE_INDEX_STONE_TOWER_TEMPLE
|
||||
};
|
||||
static s32 sStrayFairyIconRectS[] = {
|
||||
1 << 10, // mirror texture horizontally
|
||||
@@ -159,8 +159,8 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
|
||||
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
|
||||
// QUAD_MAP_PAGE_DUNGEON_TITLE
|
||||
POLY_OPA_DISP =
|
||||
Gfx_DrawTexQuadIA8(POLY_OPA_DISP, sDungeonTitleTextures[((void)0, gSaveContext.dungeonIndex)], 128, 16, 0);
|
||||
POLY_OPA_DISP = Gfx_DrawTexQuadIA8(
|
||||
POLY_OPA_DISP, sDungeonTitleTextures[((void)0, gSaveContext.dungeonSceneSharedIndex)], 128, 16, 0);
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
@@ -196,13 +196,15 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
|
||||
PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
|
||||
0);
|
||||
|
||||
gDPSetPrimColor(
|
||||
POLY_OPA_DISP++, 0, 0, sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonIndex)][0],
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonIndex)][1],
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonIndex)][2], sStrayFairyIconAlpha);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonIndex)][0],
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonIndex)][1],
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonIndex)][2], 0);
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0,
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonSceneSharedIndex)][0],
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonSceneSharedIndex)][1],
|
||||
sStrayFairyIconPrimColors[((void)0, gSaveContext.dungeonSceneSharedIndex)][2],
|
||||
sStrayFairyIconAlpha);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++,
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonSceneSharedIndex)][0],
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonSceneSharedIndex)][1],
|
||||
sStrayFairyIconEnvColors[((void)0, gSaveContext.dungeonSceneSharedIndex)][2], 0);
|
||||
|
||||
scale = sStrayFairyIconScale / 100.0f;
|
||||
|
||||
@@ -246,7 +248,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
|
||||
|
||||
gDPLoadTextureBlock(
|
||||
POLY_OPA_DISP++,
|
||||
sStrayFairyIconTextures[((void)0, gSaveContext.dungeonIndex)][sStrayFairyIconIndex],
|
||||
sStrayFairyIconTextures[((void)0, gSaveContext.dungeonSceneSharedIndex)][sStrayFairyIconIndex],
|
||||
G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 24, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPTextureRectangle(POLY_OPA_DISP++, 54 << 2, 140 << 2, 86 << 2, 164 << 2, G_TX_RENDERTILE,
|
||||
@@ -256,7 +258,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
|
||||
Gfx_SetupDL42_Opa(play->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
} else if (CHECK_DUNGEON_ITEM(i, gSaveContext.dungeonIndex)) {
|
||||
} else if (CHECK_DUNGEON_ITEM(i, gSaveContext.dungeonSceneSharedIndex)) {
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, sDungeonItemTextures[i], G_IM_FMT_RGBA, G_IM_SIZ_32b, 24, 24, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
@@ -268,7 +270,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
func_80108AF8(play);
|
||||
MapDisp_DrawDungeonFloorSelect(play);
|
||||
|
||||
if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE)) {
|
||||
// If (pauseCtx->state == PAUSE_STATE_MAIN), then the other conditions are redundant and always return
|
||||
@@ -283,12 +285,13 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
|
||||
// Draw Player's face next to the dungeon floor icon currently in.
|
||||
POLY_OPA_DISP =
|
||||
Gfx_DrawTexRectRGBA16(POLY_OPA_DISP, gQuestIconLinkHumanFaceTex, 16, 16, 62,
|
||||
sDungeonMapFloorIconPosY[R_REVERSE_FLOOR_INDEX], 16, 16, 1 << 10, 1 << 10);
|
||||
sDungeonMapFloorIconPosY[R_PLAYER_FLOOR_REVERSE_INDEX], 16, 16, 1 << 10, 1 << 10);
|
||||
|
||||
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.dungeonIndex)) {
|
||||
POLY_OPA_DISP = Gfx_DrawTexRectRGBA16(POLY_OPA_DISP, gDungeonMapSkullTex, 16, 16, 108,
|
||||
sDungeonMapFloorIconPosY[FLOOR_INDEX_MAX - func_80105318()], 16,
|
||||
16, 1 << 10, 1 << 10);
|
||||
// Draw skull face next to the dungeon floor icon the boss is located at.
|
||||
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.dungeonSceneSharedIndex)) {
|
||||
POLY_OPA_DISP = Gfx_DrawTexRectRGBA16(
|
||||
POLY_OPA_DISP, gDungeonMapSkullTex, 16, 16, 108,
|
||||
sDungeonMapFloorIconPosY[FLOOR_INDEX_MAX - MapDisp_GetBossRoomStorey()], 16, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
|
||||
@@ -320,8 +323,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
|
||||
KaleidoScope_MoveCursorFromSpecialPos(play);
|
||||
pauseCtx->cursorXIndex[PAUSE_MAP] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->unk_256;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->unk_256;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem;
|
||||
} else if (pauseCtx->cursorSpecialPos == 0) {
|
||||
if (pauseCtx->cursorXIndex[PAUSE_MAP] == 0) {
|
||||
pauseCtx->cursorXIndex[PAUSE_MAP] = 1;
|
||||
@@ -337,7 +340,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
|
||||
break;
|
||||
}
|
||||
if (CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP], gSaveContext.dungeonIndex)) {
|
||||
if (CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP],
|
||||
gSaveContext.dungeonSceneSharedIndex)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -349,11 +353,11 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
KaleidoScope_MoveCursorFromSpecialPos(play);
|
||||
pauseCtx->cursorXIndex[PAUSE_MAP] = 1;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = DUNGEON_MAP;
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_MAP, gSaveContext.dungeonIndex)) {
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_MAP, gSaveContext.dungeonSceneSharedIndex)) {
|
||||
pauseCtx->cursorPoint[PAUSE_MAP]--; // DUNGEON_COMPASS
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.dungeonIndex)) {
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.dungeonSceneSharedIndex)) {
|
||||
pauseCtx->cursorPoint[PAUSE_MAP]--; // DUNGEON_BOSS_KEY
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_BOSS_KEY, gSaveContext.dungeonIndex)) {
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_BOSS_KEY, gSaveContext.dungeonSceneSharedIndex)) {
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = DUNGEON_STRAY_FAIRIES;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = DUNGEON_STRAY_FAIRIES;
|
||||
}
|
||||
@@ -366,8 +370,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
|
||||
} else if (pauseCtx->cursorPoint[PAUSE_MAP] == DUNGEON_STRAY_FAIRIES) {
|
||||
pauseCtx->cursorXIndex[PAUSE_MAP] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->unk_256;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->unk_256;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem;
|
||||
} else {
|
||||
while (true) {
|
||||
pauseCtx->cursorPoint[PAUSE_MAP]--;
|
||||
@@ -376,7 +380,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = DUNGEON_STRAY_FAIRIES;
|
||||
break;
|
||||
}
|
||||
if (CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP], gSaveContext.dungeonIndex)) {
|
||||
if (CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP],
|
||||
gSaveContext.dungeonSceneSharedIndex)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -385,9 +390,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
} else if ((pauseCtx->cursorSpecialPos == 0) && (pauseCtx->stickAdjY > 30)) {
|
||||
if (pauseCtx->cursorPoint[PAUSE_MAP] >= DUNGEON_FLOOR_INDEX_4) {
|
||||
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - (DUNGEON_FLOOR_INDEX_4 + 1); i >= 0; i--) {
|
||||
if ((gSaveContext.save.saveInfo.permanentSceneFlags[(void)0, gSaveContext.dungeonIndex].unk_14 &
|
||||
gBitFlags[i]) ||
|
||||
func_801090B0(FLOOR_INDEX_MAX - i)) {
|
||||
if (GET_DUNGEON_FLOOR_VISITED(((void)0, gSaveContext.dungeonSceneSharedIndex), i) ||
|
||||
MapDisp_IsValidStorey(FLOOR_INDEX_MAX - i)) {
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = i + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorShrinkRate = 4.0f;
|
||||
break;
|
||||
@@ -395,8 +399,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
}
|
||||
} else if (pauseCtx->cursorPoint[PAUSE_MAP] == DUNGEON_STRAY_FAIRIES) {
|
||||
pauseCtx->cursorXIndex[PAUSE_MAP] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->unk_256;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->unk_256;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem;
|
||||
} else {
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = DUNGEON_STRAY_FAIRIES;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = DUNGEON_STRAY_FAIRIES;
|
||||
@@ -406,9 +410,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
(pauseCtx->cursorPoint[PAUSE_MAP] <= DUNGEON_FLOOR_INDEX_1)) {
|
||||
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - (DUNGEON_FLOOR_INDEX_4 - 1); i <= DUNGEON_FLOOR_INDEX_0;
|
||||
i++) {
|
||||
if ((gSaveContext.save.saveInfo.permanentSceneFlags[(void)0, gSaveContext.dungeonIndex].unk_14 &
|
||||
gBitFlags[i]) ||
|
||||
func_801090B0(FLOOR_INDEX_MAX - i)) {
|
||||
if (GET_DUNGEON_FLOOR_VISITED(((void)0, gSaveContext.dungeonSceneSharedIndex), i) ||
|
||||
MapDisp_IsValidStorey(FLOOR_INDEX_MAX - i)) {
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = i + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorShrinkRate = 4.0f;
|
||||
break;
|
||||
@@ -429,7 +432,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
|
||||
break;
|
||||
}
|
||||
if (CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP], gSaveContext.dungeonIndex)) {
|
||||
if (CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP],
|
||||
gSaveContext.dungeonSceneSharedIndex)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -448,7 +452,7 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
}
|
||||
|
||||
if ((pauseCtx->cursorXIndex[PAUSE_MAP] == 0) && (pauseCtx->cursorSpecialPos == 0)) {
|
||||
pauseCtx->unk_256 = pauseCtx->cursorPoint[PAUSE_MAP];
|
||||
pauseCtx->cursorMapDungeonItem = pauseCtx->cursorPoint[PAUSE_MAP];
|
||||
}
|
||||
|
||||
if (pauseCtx->cursorSpecialPos == 0) {
|
||||
@@ -457,7 +461,7 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) {
|
||||
pauseCtx->itemDescriptionOn = true;
|
||||
func_801514B0(play, 0x17AF, 1);
|
||||
} else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && (msgCtx->msgLength == 0) &&
|
||||
CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP], gSaveContext.dungeonIndex)) {
|
||||
CHECK_DUNGEON_ITEM(pauseCtx->cursorPoint[PAUSE_MAP], gSaveContext.dungeonSceneSharedIndex)) {
|
||||
pauseCtx->itemDescriptionOn = true;
|
||||
func_801514B0(play, 0x17AC + pauseCtx->cursorPoint[PAUSE_MAP], 1);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "z_kaleido_scope.h"
|
||||
|
||||
#include "sys_cmpdma.h"
|
||||
#include "z64map.h"
|
||||
#include "z64skybox.h"
|
||||
#include "z64view.h"
|
||||
|
||||
@@ -565,7 +566,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
|
||||
KaleidoScope_DrawDungeonMap(play);
|
||||
Gfx_SetupDL42_Opa(gfxCtx);
|
||||
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
func_801091F0(play);
|
||||
MapDisp_DrawDungeonMap(play);
|
||||
} else {
|
||||
KaleidoScope_DrawWorldMap(play);
|
||||
}
|
||||
@@ -662,7 +663,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
|
||||
|
||||
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
|
||||
func_801091F0(play);
|
||||
MapDisp_DrawDungeonMap(play);
|
||||
} else {
|
||||
Matrix_RotateYF(R_PAUSE_WORLD_MAP_YAW / 1000.0f, MTXMODE_NEW);
|
||||
|
||||
@@ -2837,7 +2838,7 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
s16 stepA;
|
||||
s16 stickAdjX = input->rel.stick_x;
|
||||
|
||||
func_80109428(play);
|
||||
MapDisp_UpdateDungeonMap(play);
|
||||
|
||||
pauseCtx->stickAdjX = input->rel.stick_x;
|
||||
pauseCtx->stickAdjY = input->rel.stick_y;
|
||||
@@ -2854,8 +2855,9 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
sUnpausedButtonStatus[EQUIP_SLOT_A] = gSaveContext.buttonStatus[EQUIP_SLOT_A];
|
||||
|
||||
pauseCtx->cursorXIndex[PAUSE_MAP] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->unk_256 = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_PLAYER_FLOOR_REVERSE_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem =
|
||||
R_PLAYER_FLOOR_REVERSE_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
|
||||
sPauseCursorLeftX = -175;
|
||||
sPauseCursorRightX = 155;
|
||||
@@ -2878,12 +2880,12 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
CmpDma_LoadAllFiles(SEGMENT_ROM_START(icon_item_24_static_yar), pauseCtx->iconItem24Segment, size1);
|
||||
|
||||
pauseCtx->iconItemAltSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItem24Segment + size1);
|
||||
if (func_8010A0A4(play)) {
|
||||
if (Map_CurRoomHasMapI(play)) {
|
||||
size_t size = SEGMENT_ROM_SIZE(icon_item_dungeon_static);
|
||||
|
||||
DmaMgr_RequestSync(pauseCtx->iconItemAltSegment, SEGMENT_ROM_START(icon_item_dungeon_static), size);
|
||||
iconItemLangSegment =
|
||||
func_801068FC(play, (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size), size);
|
||||
MapDisp_AllocDungeonMap(play, (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size));
|
||||
sInDungeonScene = true;
|
||||
} else {
|
||||
size_t size;
|
||||
@@ -3181,8 +3183,8 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
break;
|
||||
|
||||
case PAUSE_STATE_GAMEOVER_2:
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_PLAYER_FLOOR_REVERSE_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = R_PLAYER_FLOOR_REVERSE_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
sPauseCursorLeftX = -175;
|
||||
sPauseCursorRightX = 155;
|
||||
pauseCtx->roll = -434.0f;
|
||||
@@ -3431,8 +3433,9 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
sUnpausedButtonStatus[EQUIP_SLOT_A] = gSaveContext.buttonStatus[EQUIP_SLOT_A];
|
||||
|
||||
pauseCtx->cursorXIndex[PAUSE_MAP] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->unk_256 = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = R_PLAYER_FLOOR_REVERSE_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->cursorMapDungeonItem =
|
||||
R_PLAYER_FLOOR_REVERSE_INDEX + DUNGEON_FLOOR_INDEX_4;
|
||||
|
||||
sPauseCursorLeftX = -175;
|
||||
sPauseCursorRightX = 155;
|
||||
|
||||
Reference in New Issue
Block a user