From c06f7bda75979116d4d490c0cd2404c81ca03b8d Mon Sep 17 00:00:00 2001 From: aMannus Date: Wed, 2 Jul 2025 15:11:07 +0200 Subject: [PATCH] Implement archi and hide rando hash in archi save --- .../gFileSelArchiButtonTex.ia16.png | Bin 0 -> 3057 bytes soh/assets/soh_assets.h | 3 +++ soh/soh/SaveManager.cpp | 6 ++++- soh/soh/SaveManager.h | 1 + .../ovl_file_choose/z_file_choose.c | 21 +++++++++++++++--- 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 soh/assets/custom/textures/title_static/gFileSelArchiButtonTex.ia16.png diff --git a/soh/assets/custom/textures/title_static/gFileSelArchiButtonTex.ia16.png b/soh/assets/custom/textures/title_static/gFileSelArchiButtonTex.ia16.png new file mode 100644 index 0000000000000000000000000000000000000000..e6b80d6c54a14f17989c2490a64447cd0cfe272d GIT binary patch literal 3057 zcmd5;SxBTu5dMBgoz-!4F&;5_&=-y98pI<)6piAlW1Pj95E9tvMosc0vub=1L=Ev+ z32I1VO}G@iyvsZn}E6fByCNATPlh`tLfstE;Q3=UL*T zSiS8BwgB{oxacG{KVakjJ!|&O2&kQiqRfv zaY;rX*9$246*yt6f>j{LA6S0^eEJ-4efpy3i!dgzPW?PK8fN-E>o7Mmj?L4!Z?gg2 zdo(1}ym+56wLcq-54CGr$@ycym!FuvW3mqo(UD)p>81O+?SCYuf}EV3?4qKg-_Fm^ ziM(^Lwzh`M%*=w;*49Eza&q$Hs;a8z8jS{LXJ>cLS#qeoy&c}(-k(X51ZjSL{wY7y#r{lxU&JN`0 z?(QyzhK69dv$KQ4!$Y*SwZY1Y@=^^B4i0?LCdtz(+?%?^xU0+oQ3u5&Qf5;5(h1P_^6+-QC?ND=XuQJv}{qqlAQn z+YPVKsI9GqhldApb8}VF!oor>tEs8M%E}6tld}Z>DKzEf<=iMWHI=6i(Zb=bt}Y(! z@$qp`gxuWR5Fa0pv9U1~-`}5g5e8J`bYnu_*VmWx^Yf`Afk%`hijT_SzP>)bkc*28 zXaocVaP`5#LC{SkCMJRvDcs%NK?@T(r)7+4KHa9l~D$h!N z!4#c}+U8ZDayUFZT<*ctj|mzY8u(mYUCkp!d1o{lc|QC3`N?vwbj4?HZx6Gxv;2VD z+uMkViMc}S4U3|F6Q~@%PMLbKC>Es-@s&lTlo3vHs*9AA6fUBhy9p?LZUXM`!NI{z zI>^e(;(2XjW24ez|3k2~wS}3P83YFhgQBSfl21-fVtsub^lF8Kgm5w4kW!!c)OiR@ zCKFs;T{(XFBMlD^zwYhr1vyPh;^`I7vyvuU(EsPt+}zwO2SQ>w_?R{SmvoZ;{{G7c zx>NMx;$ne@UDX)-)3L{1n^^i!aaVz*+}G@xuB!bA9;Sx;A?Bz358oJmWSQl|@Oy9l T9{chS!VC`|MgJM~hashIconIndexes[i]; } - fileMetaInfo[fileNum].randoSave = IS_RANDO; + fileMetaInfo[fileNum].randoSave = IS_RANDO && !IS_ARCHIPELAGO; + fileMetaInfo[fileNum].archiSave = IS_ARCHIPELAGO; // If the file is marked as a Master Quest file or if we're randomized and have at least one master quest dungeon, // we need the mq otr. fileMetaInfo[fileNum].requiresMasterQuest = @@ -2345,6 +2347,7 @@ void SaveManager::CopyZeldaFile(int from, int to) { fileMetaInfo[to].defense = fileMetaInfo[from].defense; fileMetaInfo[to].health = fileMetaInfo[from].health; fileMetaInfo[to].randoSave = fileMetaInfo[from].randoSave; + fileMetaInfo[to].archiSave = fileMetaInfo[from].archiSave; fileMetaInfo[to].requiresMasterQuest = fileMetaInfo[from].requiresMasterQuest; fileMetaInfo[to].requiresOriginal = fileMetaInfo[from].requiresOriginal; fileMetaInfo[to].buildVersionMajor = fileMetaInfo[from].buildVersionMajor; @@ -2361,6 +2364,7 @@ void SaveManager::DeleteZeldaFile(int fileNum) { } fileMetaInfo[fileNum].valid = false; fileMetaInfo[fileNum].randoSave = false; + fileMetaInfo[fileNum].archiSave = false; fileMetaInfo[fileNum].requiresMasterQuest = false; fileMetaInfo[fileNum].requiresOriginal = false; GameInteractor::Instance->ExecuteHooks(fileNum); diff --git a/soh/soh/SaveManager.h b/soh/soh/SaveManager.h index 6d7ef3b33..8cdb16a91 100644 --- a/soh/soh/SaveManager.h +++ b/soh/soh/SaveManager.h @@ -16,6 +16,7 @@ typedef struct { u32 requiresOriginal; u8 seedHash[5]; u8 randoSave; + u8 archiSave; char buildVersion[50]; s16 buildVersionMajor; s16 buildVersionMinor; diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 6ec8fbe48..ebc2e1a4a 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -452,7 +452,7 @@ u8 ShouldRenderItem(s16 fileIndex, u8 item) { // greg if (item == ITEM_RUPEE_GREEN) { - return Save_GetSaveMetaInfo(fileIndex)->randoSave; + return Save_GetSaveMetaInfo(fileIndex)->randoSave || Save_GetSaveMetaInfo(fileIndex)->archiSave; } return 1; @@ -3018,7 +3018,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); } - // draw rando label + // Draw rando label if (Save_GetSaveMetaInfo(i)->randoSave) { if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], @@ -3049,6 +3049,21 @@ void FileChoose_DrawWindowContents(GameState* thisx) { G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); } + // Draw archipelago label + if (Save_GetSaveMetaInfo(i)->archiSave) { + if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], + sWindowContentColors[1][2], this->nameBoxAlpha[i]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], + sWindowContentColors[isActive][1], sWindowContentColors[isActive][2], + this->nameAlpha[i]); + } + gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelArchiButtonTex, G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 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); + gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); + } // draw connectors if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i)) && Save_GetSaveMetaInfo(i)->valid) { @@ -3064,7 +3079,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 12, 14, 15, 13, 0); - if (this->n64ddFlags[i] || Save_GetSaveMetaInfo(i)->randoSave || + if (this->n64ddFlags[i] || Save_GetSaveMetaInfo(i)->randoSave || Save_GetSaveMetaInfo(i)->archiSave || Save_GetSaveMetaInfo(i)->requiresMasterQuest) { gSP1Quadrangle(POLY_OPA_DISP++, 16, 18, 19, 17, 0); }