mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-19 14:13:40 -04:00
Merge pull request #338 from HarbourMasters/develop-zhora
zhora -> rando-next
This commit is contained in:
@@ -1035,15 +1035,9 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
break;
|
||||
} else {
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
this->actor.shape.yOffset = 430.0f;
|
||||
this->actor.shape.shadowScale = 0.03f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
if (this->unk_15A < 0) {
|
||||
if (this->unk_15A == -1) {
|
||||
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
|
||||
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
|
||||
this->actor.objBankIndex = bankIndex;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
@@ -1056,7 +1050,16 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
//Big hearts workaround
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
this->actor.shape.yOffset = 430.0f;
|
||||
this->actor.shape.shadowScale = 6.0f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
EnItem00_DrawCollectible(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM00_BOMBS_A:
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
|
||||
@@ -520,12 +520,12 @@ void Message_DrawTextboxIcon(GlobalContext* globalCtx, Gfx** p, s16 x, s16 y) {
|
||||
sIconEnvColors[1][1] = 255;
|
||||
sIconEnvColors[1][2] = 130;
|
||||
} else if (CVar_GetS32("gHudColors", 1) == 2) {
|
||||
sIconPrimColors[0][0] = (CVar_GetS32("gCCABtnPrimR", 50)/255)*95;
|
||||
sIconPrimColors[0][1] = (CVar_GetS32("gCCABtnPrimG", 255)/255)*95;
|
||||
sIconPrimColors[0][2] = (CVar_GetS32("gCCABtnPrimB", 130)/255)*95;
|
||||
sIconPrimColors[1][0] = CVar_GetS32("gCCABtnPrimR", 50);
|
||||
sIconPrimColors[1][1] = CVar_GetS32("gCCABtnPrimG", 255);
|
||||
sIconPrimColors[1][2] = CVar_GetS32("gCCABtnPrimB", 130);
|
||||
sIconPrimColors[0][0] = (CVar_GetS32("gCCABtnPrimR", 0)/255)*95;
|
||||
sIconPrimColors[0][1] = (CVar_GetS32("gCCABtnPrimG", 200)/255)*95;
|
||||
sIconPrimColors[0][2] = (CVar_GetS32("gCCABtnPrimB", 80)/255)*95;
|
||||
sIconPrimColors[1][0] = CVar_GetS32("gCCABtnPrimR", 0);
|
||||
sIconPrimColors[1][1] = CVar_GetS32("gCCABtnPrimG", 200);
|
||||
sIconPrimColors[1][2] = CVar_GetS32("gCCABtnPrimB", 80);
|
||||
sIconEnvColors[0][0] = 0;
|
||||
sIconEnvColors[0][1] = 0;
|
||||
sIconEnvColors[0][2] = 0;
|
||||
@@ -3320,13 +3320,13 @@ void Message_Update(GlobalContext* globalCtx) {
|
||||
static s16 sTextboxXPositions[] = {
|
||||
34, 34, 34, 34, 34, 34,
|
||||
};
|
||||
static s16 sTextboxMidYPositions[] = {
|
||||
static s16 sTextboxLowerYPositions[] = {
|
||||
142, 142, 142, 142, 174, 142,
|
||||
};
|
||||
static s16 sTextboxUpperYPositions[] = {
|
||||
38, 38, 38, 38, 174, 38,
|
||||
};
|
||||
static s16 sTextboxLowerYPositions[] = {
|
||||
static s16 sTextboxMidYPositions[] = {
|
||||
90, 90, 90, 90, 174, 90,
|
||||
};
|
||||
static s16 sTextboxEndIconYOffset[] = {
|
||||
@@ -3420,20 +3420,20 @@ void Message_Update(GlobalContext* globalCtx) {
|
||||
if (!msgCtx->textBoxPos) { // variable position
|
||||
if (YREG(15) != 0 || globalCtx->sceneNum == SCENE_HAIRAL_NIWA) {
|
||||
if (averageY < XREG(92)) {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
|
||||
R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
|
||||
} else {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_MARKET_DAY || globalCtx->sceneNum == SCENE_MARKET_NIGHT ||
|
||||
globalCtx->sceneNum == SCENE_MARKET_RUINS) {
|
||||
if (averageY < XREG(93)) {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
|
||||
R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
|
||||
} else {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
|
||||
}
|
||||
} else {
|
||||
if (averageY < XREG(94)) {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
|
||||
R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
|
||||
} else {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
|
||||
}
|
||||
|
||||
@@ -1676,13 +1676,15 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
||||
if (item == ITEM_SWORD_BGS) {
|
||||
gSaveContext.swordHealth = 8;
|
||||
|
||||
if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) {
|
||||
gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD];
|
||||
if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF
|
||||
||(gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) { // In rando, when buying Giant's Knife, also check
|
||||
gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; // for 0xE in case we don't have Kokiri Sword
|
||||
if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) {
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS;
|
||||
Interface_LoadItemIcon1(globalCtx, 0);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (item == ITEM_SWORD_MASTER) {
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER;
|
||||
gSaveContext.equips.equipment &= 0xFFF0;
|
||||
@@ -4796,10 +4798,11 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
||||
PosY_BtnA = CVar_GetS32("gABtnPosY", 0)+Y_Margins_BtnA;
|
||||
rAIconY = 98.0f - PosY_BtnA;
|
||||
if (CVar_GetS32("gABtnPosType", 0) == 1) {//Anchor Left
|
||||
if (CVar_GetS32("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Left_HUD_Margin;};
|
||||
PosX_BtnA = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
rAIconX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
} else if (CVar_GetS32("gABtnPosType", 0) == 2) {//Anchor Right
|
||||
X_Margins_BtnA = Right_HUD_Margin;
|
||||
if (CVar_GetS32("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Right_HUD_Margin;};
|
||||
PosX_BtnA = OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
rAIconX= OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
} else if (CVar_GetS32("gABtnPosType", 0) == 3) {//Anchor None
|
||||
|
||||
@@ -402,6 +402,12 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
|
||||
camera = GET_ACTIVE_CAM(globalCtx);
|
||||
camId = camera->camDataIdx;
|
||||
if (camId == -1 && CVar_GetS32("gNoRestrictItems", 0)) {
|
||||
// This prevents a crash when using items that change the
|
||||
// camera (such as din's fire) on scenes with prerendered backgrounds
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// jfifid
|
||||
camId2 = func_80041C10(&globalCtx->colCtx, camId, BGCHECK_SCENE)[2].y;
|
||||
if (camId2 >= 0) {
|
||||
|
||||
@@ -34,6 +34,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Draw(Actor* this, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Reset(void);
|
||||
|
||||
void BgHakaGate_DoNothing(BgHakaGate* this, GlobalContext* globalCtx);
|
||||
void BgHakaGate_StatueInactive(BgHakaGate* this, GlobalContext* globalCtx);
|
||||
@@ -62,7 +63,7 @@ const ActorInit Bg_Haka_Gate_InitVars = {
|
||||
(ActorFunc)BgHakaGate_Destroy,
|
||||
(ActorFunc)BgHakaGate_Update,
|
||||
(ActorFunc)BgHakaGate_Draw,
|
||||
NULL,
|
||||
(ActorResetFunc)BgHakaGate_Reset,
|
||||
};
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
@@ -378,3 +379,7 @@ void BgHakaGate_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgHakaGate_DrawFlame(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void BgHakaGate_Reset(void) {
|
||||
sStatueRotY = 0;
|
||||
}
|
||||
|
||||
@@ -228,8 +228,8 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) {
|
||||
this->colliderCylinder.dim.pos.z = this->dyna.actor.world.pos.z + sp28.x * sine + sp28.z * cosine;
|
||||
}
|
||||
|
||||
static UNK_TYPE D_80881018 = 0;
|
||||
void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) {
|
||||
static UNK_TYPE D_80881018 = 0;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((D_80880F30 == 0) && (!Player_InCsMode(globalCtx))) {
|
||||
@@ -553,4 +553,5 @@ void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void BgHakaTrap_Reset(void) {
|
||||
D_80880F30 = 0;
|
||||
D_80881014 = 0;
|
||||
D_80881018 = 0;
|
||||
}
|
||||
@@ -929,7 +929,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f);
|
||||
for (indS1 = 0; indS1 < 40; indS1++) {
|
||||
if (sMorphaTent2->tentSpawnPos) {}
|
||||
if (sMorphaTent2 && sMorphaTent2->tentSpawnPos) {}
|
||||
indT5 = Rand_ZeroFloat(20.9f);
|
||||
indS0 = sTentSpawnIndex[indT5];
|
||||
spFC.x = 0;
|
||||
@@ -3604,4 +3604,4 @@ void BossMo_Reset(void) {
|
||||
sBossGanonSeed1 = 0;
|
||||
sBossGanonSeed2 = 0;
|
||||
sBossGanonSeed3 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,8 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.targetMode = 6;
|
||||
this->unk_1E8.unk_00 = 0;
|
||||
|
||||
if (!(gSaveContext.eventChkInf[1] & 0x10) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag)) {
|
||||
if (!(gSaveContext.eventChkInf[1] & 0x10) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag) ||
|
||||
(gSaveContext.n64ddFlag && Flags_GetTreasure(globalCtx, 0x1F))) {
|
||||
this->actionFunc = func_80AA0D88;
|
||||
EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
|
||||
} else {
|
||||
|
||||
@@ -5183,7 +5183,7 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) {
|
||||
this->stateFlags2 |= PLAYER_STATE2_21;
|
||||
}
|
||||
|
||||
if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && !sp28) {
|
||||
if (!CHECK_BTN_ALL(sControlInput->press.button, CVar_GetS32("gNaviOnL", 0) ? BTN_L : BTN_CUP) && !sp28) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5239,7 +5239,8 @@ s32 func_8083B998(Player* this, GlobalContext* globalCtx) {
|
||||
(CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || (this->unk_664->naviEnemyId != 0xFF))) {
|
||||
this->stateFlags2 |= PLAYER_STATE2_21;
|
||||
}
|
||||
else if ((this->naviTextId == 0) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
|
||||
else if ((this->naviTextId == 0 || CVar_GetS32("gNaviOnL", 0)) &&
|
||||
!func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
|
||||
(YREG(15) != 0x10) && (YREG(15) != 0x20) && !func_8083B8F4(this, globalCtx)) {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
}
|
||||
@@ -7838,15 +7839,35 @@ s32 func_8084285C(Player* this, f32 arg1, f32 arg2, f32 arg3) {
|
||||
}
|
||||
|
||||
s32 func_808428D8(Player* this, GlobalContext* globalCtx) {
|
||||
if (!Player_IsChildWithHylianShield(this) && Player_GetSwordHeld(this) && D_80853614) {
|
||||
func_80832264(globalCtx, this, &gPlayerAnim_002EC8);
|
||||
this->unk_84F = 1;
|
||||
this->swordAnimation = 0xC;
|
||||
this->currentYaw = this->actor.shape.rot.y + this->unk_6BE;
|
||||
if (Player_IsChildWithHylianShield(this) || !Player_GetSwordHeld(this) || !D_80853614) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
func_80832264(globalCtx, this, &gPlayerAnim_002EC8);
|
||||
this->unk_84F = 1;
|
||||
this->swordAnimation = 0xC;
|
||||
this->currentYaw = this->actor.shape.rot.y + this->unk_6BE;
|
||||
|
||||
if (!CVar_GetS32("gCrouchStabHammerFix", 0)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
u32 swordId;
|
||||
if (Player_HoldsBrokenKnife(this)) {
|
||||
swordId = 1;
|
||||
} else {
|
||||
swordId = Player_GetSwordHeld(this) - 1;
|
||||
}
|
||||
|
||||
if (swordId != 4 && !CVar_GetS32("gCrouchStabFix", 0)) { // 4 = Megaton Hammer
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 flags = D_80854488[swordId][0];
|
||||
func_80837918(this, 0, flags);
|
||||
func_80837918(this, 1, flags);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_80842964(Player* this, GlobalContext* globalCtx) {
|
||||
@@ -9876,8 +9897,15 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) {
|
||||
this->unk_837 = 20;
|
||||
}
|
||||
else if (this->unk_837 != 0) {
|
||||
doAction = DO_ACTION_NONE;
|
||||
this->unk_837--;
|
||||
if (CVar_GetS32("gInstantPutaway", 0) != 0)
|
||||
{
|
||||
this->unk_837 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
doAction = DO_ACTION_NONE;
|
||||
this->unk_837--;
|
||||
}
|
||||
}
|
||||
|
||||
Interface_SetDoAction(globalCtx, doAction);
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#include "textures/nintendo_rogo_static/nintendo_rogo_static.h"
|
||||
#include <soh/Enhancements/bootcommands.h>
|
||||
#include "GameVersions.h"
|
||||
#include <soh/SaveManager.h>
|
||||
|
||||
const char* GetGameVersionString();
|
||||
|
||||
char* quote;
|
||||
|
||||
void Title_PrintBuildInfo(Gfx** gfxp) {
|
||||
@@ -224,72 +224,6 @@ void Title_Draw(TitleContext* this) {
|
||||
void Title_Main(GameState* thisx) {
|
||||
TitleContext* this = (TitleContext*)thisx;
|
||||
|
||||
if (CVar_GetS32("gSkipLogoTitle",0)!=0) {
|
||||
gSaveContext.language = CVar_GetS32("gLanguages", 0);
|
||||
Sram_InitSram(&this->state);
|
||||
s16 selectedfile = CVar_GetS32("gSaveFileID", 0);
|
||||
if (selectedfile == 4) {
|
||||
selectedfile = 0xFF;
|
||||
} else if(selectedfile == 0){
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
gSaveContext.gameMode = 0;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, SelectContext);
|
||||
return;
|
||||
} else {
|
||||
selectedfile--;
|
||||
if (selectedfile < 0) {
|
||||
selectedfile = 0xFF;
|
||||
}
|
||||
}
|
||||
if (selectedfile == 0xFF) {
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Select_Init, SelectContext);
|
||||
} else {
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
this->state.running = false;
|
||||
//return;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
}
|
||||
gSaveContext.respawn[0].entranceIndex = -1;
|
||||
gSaveContext.respawnFlag = 0;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.showTitleCard = true;
|
||||
gSaveContext.dogParams = 0;
|
||||
gSaveContext.timer1State = 0;
|
||||
gSaveContext.timer2State = 0;
|
||||
gSaveContext.eventInf[0] = 0;
|
||||
gSaveContext.eventInf[1] = 0;
|
||||
gSaveContext.eventInf[2] = 0;
|
||||
gSaveContext.eventInf[3] = 0;
|
||||
gSaveContext.unk_13EE = 0x32;
|
||||
gSaveContext.nayrusLoveTimer = 0;
|
||||
gSaveContext.healthAccumulator = 0;
|
||||
gSaveContext.unk_13F0 = 0;
|
||||
gSaveContext.unk_13F2 = 0;
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.nextTransition = 0xFF;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
gSaveContext.unk_13C3 = 0;
|
||||
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
||||
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = gSaveContext.unk_13F4 = 0;
|
||||
gSaveContext.unk_13F6 = gSaveContext.magic;
|
||||
gSaveContext.magic = 0;
|
||||
gSaveContext.magicLevel = gSaveContext.magic;
|
||||
gSaveContext.naviTimer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
OPEN_DISPS(this->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0, NULL);
|
||||
@@ -330,27 +264,94 @@ void Title_Destroy(GameState* thisx) {
|
||||
void Title_Init(GameState* thisx) {
|
||||
//u32 size = 0;
|
||||
TitleContext* this = (TitleContext*)thisx;
|
||||
FileChooseContext* FileChooseCtx = (FileChooseContext*)thisx;
|
||||
|
||||
quote = SetQuote();
|
||||
if (CVar_GetS32("gSkipLogoTitle",0)) {
|
||||
bool saveloading = false;
|
||||
Sram_InitSram(&this->state.init);
|
||||
gSaveContext.language = CVar_GetS32("gLanguages", 0);
|
||||
s32 selectedfile = CVar_GetS32("gSaveFileID", 0);
|
||||
if (selectedfile == 4) {
|
||||
if (CVar_GetS32("gDebugEnabled",0)) {
|
||||
selectedfile = 0xFF;
|
||||
} else {
|
||||
selectedfile = 3;
|
||||
}
|
||||
}
|
||||
if (selectedfile < 0) {
|
||||
selectedfile = 3; //If somehow the save file number under 0 revert back to 3 to prevent boot error
|
||||
}
|
||||
if(selectedfile == 3){
|
||||
saveloading = true;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.gameMode = 1;
|
||||
SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, FileChooseContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else if (selectedfile == 0xFF || selectedfile > 3) {
|
||||
saveloading = true;
|
||||
Sram_InitDebugSave();
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
SET_NEXT_GAMESTATE(&this->state, Select_Init, SelectContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else if (selectedfile >= 0 && selectedfile <= 2) {
|
||||
if (Save_Exist(selectedfile) == true) { //The file exist load it
|
||||
saveloading = true;
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
gSaveContext.magic = gSaveContext.magic;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else {
|
||||
if (CVar_GetS32("gCreateNewSave",0)) {
|
||||
//File do not exist create a new save file
|
||||
saveloading = true;
|
||||
Sram_InitSram(&FileChooseCtx->state.init);
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_InitSave(FileChooseCtx);
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else {
|
||||
//File do not exist but user do not wish to auto create a save file with blank name
|
||||
saveloading = true;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.gameMode = 1;
|
||||
SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, FileChooseContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
quote = SetQuote();
|
||||
|
||||
//this->staticSegment = GAMESTATE_ALLOC_MC(&this->state, size);
|
||||
osSyncPrintf("z_title.c\n");
|
||||
//ASSERT(this->staticSegment != NULL);
|
||||
//this->staticSegment = GAMESTATE_ALLOC_MC(&this->state, size);
|
||||
osSyncPrintf("z_title.c\n");
|
||||
//ASSERT(this->staticSegment != NULL);
|
||||
|
||||
//ResourceMgr_CacheDirectory("nintendo_rogo_static*");
|
||||
//ResourceMgr_CacheDirectory("nintendo_rogo_static*");
|
||||
|
||||
// Disable vismono
|
||||
D_801614B0.a = 0;
|
||||
R_UPDATE_RATE = 1;
|
||||
Matrix_Init(&this->state);
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Title_Main;
|
||||
this->state.destroy = Title_Destroy;
|
||||
this->exit = false;
|
||||
gSaveContext.fileNum = 0xFF;
|
||||
this->ult = 0;
|
||||
this->unk_1D4 = 0x14;
|
||||
this->coverAlpha = 255;
|
||||
this->addAlpha = -3;
|
||||
this->visibleDuration = 0x3C;
|
||||
// Disable vismono
|
||||
D_801614B0.a = 0;
|
||||
R_UPDATE_RATE = 1;
|
||||
Matrix_Init(&this->state);
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Title_Main;
|
||||
this->state.destroy = Title_Destroy;
|
||||
this->exit = false;
|
||||
gSaveContext.fileNum = 0xFF;
|
||||
this->ult = 0;
|
||||
this->unk_1D4 = 0x14;
|
||||
this->coverAlpha = 255;
|
||||
this->addAlpha = -3;
|
||||
this->visibleDuration = 0x3C;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,24 +637,23 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
|
||||
gItemIcons[sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1], 32, 32, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw inventory screen icons
|
||||
for (k = 0, bit = rowStart, point = 4; k < 3; k++, point += 4, temp++, bit++) {
|
||||
|
||||
int itemId = ITEM_SWORD_KOKIRI + temp;
|
||||
bool age_restricted = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge);
|
||||
if (age_restricted) {
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, true);
|
||||
}
|
||||
if (((u32)i == 0) && (k == 2) && (gSaveContext.bgsFlag != 0)) {
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gBiggoronSwordIconTex, 32, 32, point);
|
||||
} else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) {
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gBrokenGiantsKnifeIconTex, 32, 32, point);
|
||||
}
|
||||
if (gBitFlags[bit] & gSaveContext.inventory.equipment) {
|
||||
int itemId = ITEM_SWORD_KOKIRI + temp;
|
||||
bool not_acquired = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge);
|
||||
if (not_acquired) {
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, true);
|
||||
}
|
||||
} else if (gBitFlags[bit] & gSaveContext.inventory.equipment) {
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, false);
|
||||
}
|
||||
gsSPGrayscale(POLY_KAL_DISP++, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user