diff --git a/assets/xml/archives/map_name_static.xml b/assets/xml/archives/map_name_static.xml index 980eb890e2..fe392eb030 100644 --- a/assets/xml/archives/map_name_static.xml +++ b/assets/xml/archives/map_name_static.xml @@ -1,20 +1,29 @@ + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/z64item.h b/include/z64item.h index c37ba02c86..19c86f0a17 100644 --- a/include/z64item.h +++ b/include/z64item.h @@ -308,6 +308,24 @@ typedef enum ItemId { /* 0xA1 */ ITEM_GOLD_DUST_2, /* 0xA2 */ ITEM_HYLIAN_LOACH_2, /* 0xA3 */ ITEM_SEAHORSE_CAUGHT, + // First entries of `MAP_POINT` must be continguous with `RegionId` + /* 0xA4 */ ITEM_MAP_POINT_GREAT_BAY, + /* 0xA5 */ ITEM_MAP_POINT_ZORA_HALL, + /* 0xA6 */ ITEM_MAP_POINT_ROMANI_RANCH, + /* 0xA7 */ ITEM_MAP_POINT_DEKU_PALACE, + /* 0xA8 */ ITEM_MAP_POINT_WOODFALL, + /* 0xA9 */ ITEM_MAP_POINT_CLOCK_TOWN, + /* 0xAA */ ITEM_MAP_POINT_SNOWHEAD, + /* 0xAB */ ITEM_MAP_POINT_IKANA_GRAVEYARD, + /* 0xAC */ ITEM_MAP_POINT_IKANA_CANYON, + /* 0xAD */ ITEM_MAP_POINT_GORON_VILLAGE, + /* 0xAE */ ITEM_MAP_POINT_STONE_TOWER, + // Remaining map points are unique to owl warps + /* 0xAF */ ITEM_MAP_POINT_GREAT_BAY_COAST, + /* 0xBO */ ITEM_MAP_POINT_SOUTHERN_SWAMP, + /* 0xB1 */ ITEM_MAP_POINT_MOUNTAIN_VILLAGE, + /* 0xB2 */ ITEM_MAP_POINT_MILK_ROAD, + /* 0xB3 */ ITEM_MAP_POINT_ZORA_CAPE, /* 0xF0 */ ITEM_F0 = 0xF0, // PLAYER_MASK_BLAST /* 0xF1 */ ITEM_F1, // PLAYER_MASK_BREMEN /* 0xF2 */ ITEM_F2, // PLAYER_MASK_KAMARO diff --git a/include/z64scene.h b/include/z64scene.h index 55c959b31a..e0f186cd87 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -559,6 +559,7 @@ typedef union { // Sets cursor point options on the world map typedef enum { + /* -1 */ REGION_NONE = -1, /* 0x0 */ REGION_GREAT_BAY, /* 0x1 */ REGION_ZORA_HALL, /* 0x2 */ REGION_ROMANI_RANCH, 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 6f6b000e7f..b4ed531f82 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 7f891ca356..5915c9fbeb 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)); }