`map_static_name` docs (#1298)

* map static docs

* adjust comment

* improve comments

* PR Suggestions

* map point

* adjust comments
This commit is contained in:
engineer124 2023-07-04 17:58:02 +10:00 committed by GitHub
parent 0c4f2524d8
commit 0f572acbda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 36 deletions

View File

@ -1,20 +1,29 @@
<Root> <Root>
<!-- Map Point Names. Must be ia4 128x16 and continguous with `ItemId` starting from `ITEM_MAP_POINT_GREAT_BAY` -->
<File Name="map_name_static.unarchive"> <File Name="map_name_static.unarchive">
<Blob Name="map_name_static_Blob_000000" Size="0x0400" Offset="0x0" /> <!-- First entries must be continguous with `RegionId` -->
<Blob Name="map_name_static_Blob_000400" Size="0x0400" Offset="0x400" /> <Texture Name="gMapPointGreatBayENGTex" OutName="map_point_great_bay_eng" Format="ia4" Width="128" Height="16" Offset="0x0" /> <!-- ITEM_MAP_POINT_GREAT_BAY -->
<Blob Name="map_name_static_Blob_000800" Size="0x0400" Offset="0x800" /> <Texture Name="gMapPointZoraHallENGTex" OutName="map_point_zora_hall_eng" Format="ia4" Width="128" Height="16" Offset="0x400" /> <!-- ITEM_MAP_POINT_ZORA_HALL -->
<Blob Name="map_name_static_Blob_000C00" Size="0x0400" Offset="0xC00" /> <Texture Name="gMapPointRomaniRanchENGTex" OutName="map_point_romani_ranch_eng" Format="ia4" Width="128" Height="16" Offset="0x800" /> <!-- ITEM_MAP_POINT_ROMANI_RANCH -->
<Blob Name="map_name_static_Blob_001000" Size="0x0400" Offset="0x1000" /> <Texture Name="gMapPointDekuPalaceENGTex" OutName="map_point_deku_palace_eng" Format="ia4" Width="128" Height="16" Offset="0xC00" /> <!-- ITEM_MAP_POINT_DEKU_PALACE -->
<Blob Name="map_name_static_Blob_001400" Size="0x0400" Offset="0x1400" /> <!-- Reused for both region and owl warp map point -->
<Blob Name="map_name_static_Blob_001800" Size="0x0400" Offset="0x1800" /> <Texture Name="gMapPointWoodfallENGTex" OutName="map_point_woodfall_eng" Format="ia4" Width="128" Height="16" Offset="0x1000" /> <!-- ITEM_MAP_POINT_WOODFALL -->
<Blob Name="map_name_static_Blob_001C00" Size="0x0400" Offset="0x1C00" /> <!-- Reused for both region and owl warp map point -->
<Blob Name="map_name_static_Blob_002000" Size="0x0400" Offset="0x2000" /> <Texture Name="gMapPointClockTownENGTex" OutName="map_point_clock_town_eng" Format="ia4" Width="128" Height="16" Offset="0x1400" /> <!-- ITEM_MAP_POINT_CLOCK_TOWN -->
<Blob Name="map_name_static_Blob_002400" Size="0x0400" Offset="0x2400" /> <!-- Reused for both region and owl warp map point -->
<Blob Name="map_name_static_Blob_002800" Size="0x0400" Offset="0x2800" /> <Texture Name="gMapPointSnowheadENGTex" OutName="map_point_snowhead_eng" Format="ia4" Width="128" Height="16" Offset="0x1800" /> <!-- ITEM_MAP_POINT_SNOWHEAD -->
<Blob Name="map_name_static_Blob_002C00" Size="0x0400" Offset="0x2C00" /> <Texture Name="gMapPointIkanaGraveyardENGTex" OutName="map_point_ikana_graveyard_eng" Format="ia4" Width="128" Height="16" Offset="0x1C00" /> <!-- ITEM_MAP_POINT_IKANA_GRAVEYARD -->
<Blob Name="map_name_static_Blob_003000" Size="0x0400" Offset="0x3000" /> <!-- Reused for both region and owl warp map point -->
<Blob Name="map_name_static_Blob_003400" Size="0x0400" Offset="0x3400" /> <Texture Name="gMapPointIkanaCanyonENGTex" OutName="map_point_ikana_canyon_eng" Format="ia4" Width="128" Height="16" Offset="0x2000" /> <!-- ITEM_MAP_POINT_IKANA_CANYON -->
<Blob Name="map_name_static_Blob_003800" Size="0x0400" Offset="0x3800" /> <Texture Name="gMapPointGoronVillageENGTex" OutName="map_point_goron_village_eng" Format="ia4" Width="128" Height="16" Offset="0x2400" /> <!-- ITEM_MAP_POINT_GORON_VILLAGE -->
<Blob Name="map_name_static_Blob_003C00" Size="0x0400" Offset="0x3C00" /> <!-- Reused for both region and owl warp map point -->
<Texture Name="gMapPointStoneTowerENGTex" OutName="map_point_stone_tower_eng" Format="ia4" Width="128" Height="16" Offset="0x2800" /> <!-- ITEM_MAP_POINT_STONE_TOWER -->
<!-- Unique Owl Warp Map Points -->
<Texture Name="gMapPointGreatBayCoastENGTex" OutName="map_point_great_bay_coast_eng" Format="ia4" Width="128" Height="16" Offset="0x2C00" /> <!-- ITEM_MAP_POINT_GREAT_BAY_COAST -->
<Texture Name="gMapPointSouthernSwampENGTex" OutName="map_point_southern_swamp_eng" Format="ia4" Width="128" Height="16" Offset="0x3000" /> <!-- ITEM_MAP_POINT_SOUTHERN_SWAMP -->
<Texture Name="gMapPointMountainVillageENGTex" OutName="map_point_mountain_village_eng" Format="ia4" Width="128" Height="16" Offset="0x3400" /> <!-- ITEM_MAP_POINT_MOUNTAIN_VILLAGE -->
<Texture Name="gMapPointMilkRoadENGTex" OutName="map_point_milk_road_eng" Format="ia4" Width="128" Height="16" Offset="0x3800" /> <!-- ITEM_MAP_POINT_MILK_ROAD -->
<Texture Name="gMapPointZoraCapeENGTex" OutName="map_point_zora_cape_eng" Format="ia4" Width="128" Height="16" Offset="0x3C00" /> <!-- ITEM_MAP_POINT_ZORA_CAPE -->
</File> </File>
</Root> </Root>

View File

@ -308,6 +308,24 @@ typedef enum ItemId {
/* 0xA1 */ ITEM_GOLD_DUST_2, /* 0xA1 */ ITEM_GOLD_DUST_2,
/* 0xA2 */ ITEM_HYLIAN_LOACH_2, /* 0xA2 */ ITEM_HYLIAN_LOACH_2,
/* 0xA3 */ ITEM_SEAHORSE_CAUGHT, /* 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 /* 0xF0 */ ITEM_F0 = 0xF0, // PLAYER_MASK_BLAST
/* 0xF1 */ ITEM_F1, // PLAYER_MASK_BREMEN /* 0xF1 */ ITEM_F1, // PLAYER_MASK_BREMEN
/* 0xF2 */ ITEM_F2, // PLAYER_MASK_KAMARO /* 0xF2 */ ITEM_F2, // PLAYER_MASK_KAMARO

View File

@ -559,6 +559,7 @@ typedef union {
// Sets cursor point options on the world map // Sets cursor point options on the world map
typedef enum { typedef enum {
/* -1 */ REGION_NONE = -1,
/* 0x0 */ REGION_GREAT_BAY, /* 0x0 */ REGION_GREAT_BAY,
/* 0x1 */ REGION_ZORA_HALL, /* 0x1 */ REGION_ZORA_HALL,
/* 0x2 */ REGION_ROMANI_RANCH, /* 0x2 */ REGION_ROMANI_RANCH,

View File

@ -764,8 +764,8 @@ void KaleidoScope_DrawWorldMap(PlayState* play) {
} }
} }
// Find the regionId that player is currently in // Find the region that player is currently in
// Loop over regionId (n) and regionIdIndex (j) // Loop over region (n) and regionIndex (j)
while (true) { while (true) {
if ((gSceneIdsPerRegion[n][j] == 0xFFFF)) { if ((gSceneIdsPerRegion[n][j] == 0xFFFF)) {
n++; n++;
@ -824,16 +824,16 @@ void KaleidoScope_DrawWorldMap(PlayState* play) {
} }
u16 sOwlWarpPauseItems[] = { u16 sOwlWarpPauseItems[] = {
0xAF, // OWL_WARP_GREAT_BAY_COAST ITEM_MAP_POINT_GREAT_BAY_COAST, // OWL_WARP_GREAT_BAY_COAST
0xB3, // OWL_WARP_ZORA_CAPE ITEM_MAP_POINT_ZORA_CAPE, // OWL_WARP_ZORA_CAPE
0xAA, // OWL_WARP_SNOWHEAD ITEM_MAP_POINT_SNOWHEAD, // OWL_WARP_SNOWHEAD
0xB1, // OWL_WARP_MOUNTAIN_VILLAGE ITEM_MAP_POINT_MOUNTAIN_VILLAGE, // OWL_WARP_MOUNTAIN_VILLAGE
0xA9, // OWL_WARP_CLOCK_TOWN ITEM_MAP_POINT_CLOCK_TOWN, // OWL_WARP_CLOCK_TOWN
0xB2, // OWL_WARP_MILK_ROAD ITEM_MAP_POINT_MILK_ROAD, // OWL_WARP_MILK_ROAD
0xA8, // OWL_WARP_WOODFALL ITEM_MAP_POINT_WOODFALL, // OWL_WARP_WOODFALL
0xB0, // OWL_WARP_SOUTHERN_SWAMP ITEM_MAP_POINT_SOUTHERN_SWAMP, // OWL_WARP_SOUTHERN_SWAMP
0xAC, // OWL_WARP_IKANA_CANYON ITEM_MAP_POINT_IKANA_CANYON, // OWL_WARP_IKANA_CANYON
0xAE, // OWL_WARP_STONE_TOWER ITEM_MAP_POINT_STONE_TOWER, // OWL_WARP_STONE_TOWER
}; };
void KaleidoScope_UpdateWorldMapCursor(PlayState* play) { void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
@ -874,7 +874,7 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
while (true) { while (true) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP]--; 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); KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE; pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
break; break;
@ -896,13 +896,13 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE; pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickAdjX > 30) { if (pauseCtx->stickAdjX > 30) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = -1; pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = REGION_NONE;
pauseCtx->cursorSpecialPos = 0; pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorShrinkRate = 4.0f; pauseCtx->cursorShrinkRate = 4.0f;
while (true) { while (true) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP]++; 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); KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE; pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
break; break;
@ -921,13 +921,13 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
sStickAdjTimer = 0; sStickAdjTimer = 0;
} }
} else if (pauseCtx->stickAdjX < -30) { } else if (pauseCtx->stickAdjX < -30) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11; pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = REGION_MAX;
pauseCtx->cursorSpecialPos = 0; pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorShrinkRate = 4.0f; pauseCtx->cursorShrinkRate = 4.0f;
while (true) { while (true) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP]--; 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); KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE; pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE;
break; break;
@ -979,8 +979,9 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
sStickAdjTimer++; sStickAdjTimer++;
} }
//! TODO: Is the `0xA4` here related to `0xA3` being the last recored item in the `ItemId` enum? // 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]] - 0xA4; pauseCtx->cursorItem[PAUSE_MAP] =
sOwlWarpPauseItems[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] - ITEM_MAP_POINT_GREAT_BAY;
// Used as cursor vtxIndex // Used as cursor vtxIndex
pauseCtx->cursorSlot[PAUSE_MAP] = 31 + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; pauseCtx->cursorSlot[PAUSE_MAP] = 31 + pauseCtx->cursorPoint[PAUSE_WORLD_MAP];

View File

@ -246,6 +246,7 @@ void Kaleido_LoadMapNameStatic(void* segment, u32 texIndex) {
CmpDma_LoadFile(SEGMENT_ROM_START(map_name_static), texIndex, segment, 0x400); 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) { void Kaleido_LoadMapNameStaticLarge(void* segment, u32 texIndex) {
CmpDma_LoadFile(SEGMENT_ROM_START(map_name_static), texIndex, segment, 0xA00); 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); pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2);
func_8011552C(play, DO_ACTION_INFO); 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)); Kaleido_LoadMapNameStaticLarge(pauseCtx->nameSegment + 0x400, ((void)0, gSaveContext.worldMapArea));
} }