summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2023-01-17 16:45:59 -0500
committerGitHub <noreply@github.com>2023-01-17 16:45:59 -0500
commit6be1f28d7b785db206efead641a9ad8e6c359106 (patch)
tree21929fb9d964497bffb763e090f989a6d857ab5d /soh/src/code
parentba13e6b2c40d17adef064c2022ceeef260622981 (diff)
parent15a65686070488815e102ee4a61b2992a8e17486 (diff)
brad -> dev
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/game.c2
-rw-r--r--soh/src/code/graph.c10
-rw-r--r--soh/src/code/irqmgr.c2
-rw-r--r--soh/src/code/z_map_exp.c15
-rw-r--r--soh/src/code/z_sram.c30
5 files changed, 38 insertions, 21 deletions
diff --git a/soh/src/code/game.c b/soh/src/code/game.c
index 1e75779a8..cdb36787e 100644
--- a/soh/src/code/game.c
+++ b/soh/src/code/game.c
@@ -491,7 +491,7 @@ void GameState_Realloc(GameState* gameState, size_t size) {
osSyncPrintf("ハイラル一時解放!!\n"); // "Hyrule temporarily released!!"
SystemArena_GetSizes(&systemMaxFree, &systemFree, &systemAlloc);
if ((systemMaxFree - 0x10) < size) {
- osSyncPrintf("%c", 7);
+ osSyncPrintf("%c", BEL);
osSyncPrintf(VT_FGCOL(RED));
// "Not enough memory. Change the hyral size to the largest possible value"
diff --git a/soh/src/code/graph.c b/soh/src/code/graph.c
index b8cd4bba0..4271955f2 100644
--- a/soh/src/code/graph.c
+++ b/soh/src/code/graph.c
@@ -337,14 +337,14 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
if (pool->headMagic != GFXPOOL_HEAD_MAGIC) {
//! @bug (?) : "problem = true;" may be missing
- osSyncPrintf("%c", 7);
+ osSyncPrintf("%c", BEL);
// "Dynamic area head is destroyed"
osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域先頭が破壊されています\n" VT_RST);
Fault_AddHungupAndCrash(__FILE__, __LINE__);
}
if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) {
problem = true;
- osSyncPrintf("%c", 7);
+ osSyncPrintf("%c", BEL);
// "Dynamic region tail is destroyed"
osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域末尾が破壊されています\n" VT_RST);
Fault_AddHungupAndCrash(__FILE__, __LINE__);
@@ -353,19 +353,19 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
if (THGA_IsCrash(&gfxCtx->polyOpa)) {
problem = true;
- osSyncPrintf("%c", 7);
+ osSyncPrintf("%c", BEL);
// "Zelda 0 is dead"
osSyncPrintf(VT_COL(RED, WHITE) "ゼルダ0は死んでしまった(graph_alloc is empty)\n" VT_RST);
}
if (THGA_IsCrash(&gfxCtx->polyXlu)) {
problem = true;
- osSyncPrintf("%c", 7);
+ osSyncPrintf("%c", BEL);
// "Zelda 1 is dead"
osSyncPrintf(VT_COL(RED, WHITE) "ゼルダ1は死んでしまった(graph_alloc is empty)\n" VT_RST);
}
if (THGA_IsCrash(&gfxCtx->overlay)) {
problem = true;
- osSyncPrintf("%c", 7);
+ osSyncPrintf("%c", BEL);
// "Zelda 4 is dead"
osSyncPrintf(VT_COL(RED, WHITE) "ゼルダ4は死んでしまった(graph_alloc is empty)\n" VT_RST);
}
diff --git a/soh/src/code/irqmgr.c b/soh/src/code/irqmgr.c
index 41b432e91..df036d5ea 100644
--- a/soh/src/code/irqmgr.c
+++ b/soh/src/code/irqmgr.c
@@ -116,7 +116,7 @@ void IrqMgr_CheckStack() {
if (StackCheck_Check(NULL) == 0) {
osSyncPrintf("スタックは大丈夫みたいです\n"); // "The stack looks ok"
} else {
- osSyncPrintf("%c", 7);
+ osSyncPrintf("%c", BEL);
osSyncPrintf(VT_FGCOL(RED));
// "Stack overflow or dangerous"
osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n");
diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c
index 8e130bad1..690c81e21 100644
--- a/soh/src/code/z_map_exp.c
+++ b/soh/src/code/z_map_exp.c
@@ -897,21 +897,18 @@ void Minimap_Draw(PlayState* play) {
//No idea why and how Original value work but this does actually fix them all.
PosY = PosY+1024;
}
- if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) ||
- ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) &&
- (gSaveContext.infTable[26] & gBitFlags[gMapData->owEntranceFlag[mapIndex]]))) {
+
+ if (((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) ||
+ ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) &&
+ (gSaveContext.infTable[26] & gBitFlags[gMapData->owEntranceFlag[mapIndex]])
+ )) || CVarGetInteger("gAlwaysShowDungeonMinimapIcon", 0)) {
if (!Map0 || !CVarGetInteger("gFixDungeonMinimapIcon", 0)) {
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b,
IconSize, IconSize, 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);
gSPWideTextureRectangle(OVERLAY_DISP++, TopLeftX, TopLeftY, TopLeftW, TopLeftH, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
- } else if (CVarGetInteger("gAlwaysShowDungeonMinimapIcon", 0) != 0){ //Ability to show entrance Before beating the dungeon itself
- gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b,
- IconSize, IconSize, 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);
- gSPWideTextureRectangle(OVERLAY_DISP++, TopLeftX, TopLeftY, TopLeftW, TopLeftH, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
- }
+ }
}
s16 entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap);
diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c
index 106f81ddc..7bb34766d 100644
--- a/soh/src/code/z_sram.c
+++ b/soh/src/code/z_sram.c
@@ -470,8 +470,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
GiveLinkRupees(9001);
}
- if(Randomizer_GetSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_STARTWITH) {
- // TODO: If master quest there are different key counts
+ if (Randomizer_GetSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_STARTWITH) {
gSaveContext.inventory.dungeonKeys[SCENE_BMORI1] = FOREST_TEMPLE_SMALL_KEY_MAX; // Forest
gSaveContext.sohStats.dungeonKeys[SCENE_BMORI1] = FOREST_TEMPLE_SMALL_KEY_MAX; // Forest
gSaveContext.inventory.dungeonKeys[SCENE_HIDAN] = FIRE_TEMPLE_SMALL_KEY_MAX; // Fire
@@ -488,6 +487,16 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
gSaveContext.sohStats.dungeonKeys[SCENE_MEN] = GERUDO_TRAINING_GROUNDS_SMALL_KEY_MAX; // GTG
gSaveContext.inventory.dungeonKeys[SCENE_GANONTIKA] = GANONS_CASTLE_SMALL_KEY_MAX; // Ganon
gSaveContext.sohStats.dungeonKeys[SCENE_GANONTIKA] = GANONS_CASTLE_SMALL_KEY_MAX; // Ganon
+ } else if (Randomizer_GetSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_VANILLA) {
+ // Logic cannot handle vanilla key layout in some dungeons
+ // this is because vanilla expects the dungeon major item to be
+ // locked behind the keys, which is not always true in rando.
+ // We can resolve this by starting with some extra keys
+ if (ResourceMgr_IsSceneMasterQuest(SCENE_JYASINZOU)) {
+ // MQ Spirit needs 3 keys
+ gSaveContext.inventory.dungeonKeys[SCENE_JYASINZOU] = 3;
+ gSaveContext.sohStats.dungeonKeys[SCENE_JYASINZOU] = 3;
+ }
}
if(Randomizer_GetSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_STARTWITH) {
@@ -516,12 +525,23 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
gSaveContext.infTable[20] |= 4;
// Go away ruto (water temple first cutscene)
- gSaveContext.sceneFlags[05].swch |= (1 << 0x10);
+ gSaveContext.sceneFlags[SCENE_MIZUSIN].swch |= (1 << 0x10);
+
+ // Open lowest Vanilla Fire Temple locked door (to prevent key logic lockouts)
+ // Not done on keysanity since this lockout is a non issue when Fire keys can be found outside the temple
+ u8 keysanity = Randomizer_GetSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_ANYWHERE ||
+ Randomizer_GetSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_OVERWORLD ||
+ Randomizer_GetSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_ANY_DUNGEON;
+ if (!ResourceMgr_IsSceneMasterQuest(SCENE_HIDAN) && !keysanity) {
+ gSaveContext.sceneFlags[SCENE_HIDAN].swch |= (1 << 0x17);
+ }
- // Opens locked Water Temple door to prevent softlocks
+ // Opens locked Water Temple door in vanilla to prevent softlocks
// West door on the middle level that leads to the water raising thing
// Happens in 3DS rando and N64 rando as well
- gSaveContext.sceneFlags[05].swch |= (1 << 0x15);
+ if (!ResourceMgr_IsSceneMasterQuest(SCENE_MIZUSIN)) {
+ gSaveContext.sceneFlags[SCENE_MIZUSIN].swch |= (1 << 0x15);
+ }
// Skip intro cutscene when bombing mud wall in Dodongo's cavern
// this also makes the lower jaw render, and the eyes react to explosives