summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-07-04 17:58:02 +1000
committerGitHub <noreply@github.com>2023-07-04 17:58:02 +1000
commit0f572acbda00bb46cf0079ea851ef1d2fa17290b (patch)
tree63639e2dbfdd3b2eb07e9b1a1eabdbffa687f48b /src
parent0c4f2524d83a9bdb74a34cb507fae16318006948 (diff)
`map_static_name` docs (#1298)
* map static docs * adjust comment * improve comments * PR Suggestions * map point * adjust comments
Diffstat (limited to 'src')
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c39
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c5
2 files changed, 24 insertions, 20 deletions
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
index 6f6b000e7..b4ed531f8 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
@@ -764,8 +764,8 @@ void KaleidoScope_DrawWorldMap(PlayState* play) {
}
}
- // Find the regionId that player is currently in
- // Loop over regionId (n) and regionIdIndex (j)
+ // Find the region that player is currently in
+ // Loop over region (n) and regionIndex (j)
while (true) {
if ((gSceneIdsPerRegion[n][j] == 0xFFFF)) {
n++;
@@ -824,16 +824,16 @@ void KaleidoScope_DrawWorldMap(PlayState* play) {
}
u16 sOwlWarpPauseItems[] = {
- 0xAF, // OWL_WARP_GREAT_BAY_COAST
- 0xB3, // OWL_WARP_ZORA_CAPE
- 0xAA, // OWL_WARP_SNOWHEAD
- 0xB1, // OWL_WARP_MOUNTAIN_VILLAGE
- 0xA9, // OWL_WARP_CLOCK_TOWN
- 0xB2, // OWL_WARP_MILK_ROAD
- 0xA8, // OWL_WARP_WOODFALL
- 0xB0, // OWL_WARP_SOUTHERN_SWAMP
- 0xAC, // OWL_WARP_IKANA_CANYON
- 0xAE, // OWL_WARP_STONE_TOWER
+ ITEM_MAP_POINT_GREAT_BAY_COAST, // OWL_WARP_GREAT_BAY_COAST
+ ITEM_MAP_POINT_ZORA_CAPE, // OWL_WARP_ZORA_CAPE
+ ITEM_MAP_POINT_SNOWHEAD, // OWL_WARP_SNOWHEAD
+ ITEM_MAP_POINT_MOUNTAIN_VILLAGE, // OWL_WARP_MOUNTAIN_VILLAGE
+ ITEM_MAP_POINT_CLOCK_TOWN, // OWL_WARP_CLOCK_TOWN
+ ITEM_MAP_POINT_MILK_ROAD, // OWL_WARP_MILK_ROAD
+ ITEM_MAP_POINT_WOODFALL, // OWL_WARP_WOODFALL
+ ITEM_MAP_POINT_SOUTHERN_SWAMP, // OWL_WARP_SOUTHERN_SWAMP
+ ITEM_MAP_POINT_IKANA_CANYON, // OWL_WARP_IKANA_CANYON
+ ITEM_MAP_POINT_STONE_TOWER, // OWL_WARP_STONE_TOWER
};
void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
@@ -874,7 +874,7 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
while (true) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP]--;
- if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] < REGION_GREAT_BAY) {
+ if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] <= REGION_NONE) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
break;
@@ -896,13 +896,13 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickAdjX > 30) {
- pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = -1;
+ pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = REGION_NONE;
pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorShrinkRate = 4.0f;
while (true) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP]++;
- if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] > REGION_STONE_TOWER) {
+ if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] >= REGION_MAX) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
break;
@@ -921,13 +921,13 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
sStickAdjTimer = 0;
}
} else if (pauseCtx->stickAdjX < -30) {
- pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11;
+ pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = REGION_MAX;
pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorShrinkRate = 4.0f;
while (true) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP]--;
- if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] < 0) {
+ if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] <= REGION_NONE) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
break;
@@ -979,8 +979,9 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
sStickAdjTimer++;
}
- //! TODO: Is the `0xA4` here related to `0xA3` being the last recored item in the `ItemId` enum?
- pauseCtx->cursorItem[PAUSE_MAP] = sOwlWarpPauseItems[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] - 0xA4;
+ // Offset from `ITEM_MAP_POINT_GREAT_BAY` is to get the correct ordering in `map_name_static`
+ pauseCtx->cursorItem[PAUSE_MAP] =
+ sOwlWarpPauseItems[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] - ITEM_MAP_POINT_GREAT_BAY;
// Used as cursor vtxIndex
pauseCtx->cursorSlot[PAUSE_MAP] = 31 + pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
index 7f891ca35..5915c9fbe 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
@@ -246,6 +246,7 @@ void Kaleido_LoadMapNameStatic(void* segment, u32 texIndex) {
CmpDma_LoadFile(SEGMENT_ROM_START(map_name_static), texIndex, segment, 0x400);
}
+//! note: nothing from `map_name_static` is of size `0xA00` in US 1.0
void Kaleido_LoadMapNameStaticLarge(void* segment, u32 texIndex) {
CmpDma_LoadFile(SEGMENT_ROM_START(map_name_static), texIndex, segment, 0xA00);
}
@@ -2890,7 +2891,9 @@ void KaleidoScope_Update(PlayState* play) {
pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2);
func_8011552C(play, DO_ACTION_INFO);
- if (((void)0, gSaveContext.worldMapArea) < 0x16) {
+
+ //! note: `worldMapArea` never set to a value other than 0
+ if (((void)0, gSaveContext.worldMapArea) < 22) {
Kaleido_LoadMapNameStaticLarge(pauseCtx->nameSegment + 0x400, ((void)0, gSaveContext.worldMapArea));
}