1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-02 22:14:33 +00:00

Split SaveContext into sub-structs (#1393)

* Split SaveContext struct

* run formatter

* Remove temporary-until-split stuff in z_sram

* .

* run formatter
This commit is contained in:
Dragorn421 2023-08-13 21:24:26 +02:00 committed by GitHub
parent e272186b5f
commit 6e7a6d4181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
107 changed files with 1819 additions and 1751 deletions

View file

@ -181,12 +181,12 @@ void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, PlayState* play) {
if (Flags_GetSwitch(play, 0x38)) {
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
if (play->sceneId == SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) {
if (!gSaveContext.isMagicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) {
if (!gSaveContext.save.info.playerData.isMagicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) {
Actor_Kill(&this->actor);
return;
}
} else {
if (!gSaveContext.isMagicAcquired) {
if (!gSaveContext.save.info.playerData.isMagicAcquired) {
Actor_Kill(&this->actor);
return;
}
@ -225,7 +225,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
} else {
switch (this->fountainType) {
case FAIRY_UPGRADE_MAGIC:
if (!gSaveContext.isMagicAcquired || BREG(2)) {
if (!gSaveContext.save.info.playerData.isMagicAcquired || BREG(2)) {
// "Spin Attack speed UP"
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 回転切り速度UP ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
@ -233,7 +233,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
}
break;
case FAIRY_UPGRADE_DOUBLE_MAGIC:
if (!gSaveContext.isDoubleMagicAcquired) {
if (!gSaveContext.save.info.playerData.isDoubleMagicAcquired) {
// "Magic Meter doubled"
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 魔法ゲージメーター倍増 ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
@ -241,7 +241,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
}
break;
case FAIRY_UPGRADE_DOUBLE_DEFENSE:
if (!gSaveContext.isDoubleDefenseAcquired) {
if (!gSaveContext.save.info.playerData.isDoubleDefenseAcquired) {
// "Damage halved"
osSyncPrintf(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ ダメージ半減 ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
@ -466,7 +466,8 @@ void BgDyYoseizo_HealPlayer_NoReward(BgDyYoseizo* this, PlayState* play) {
this->refillTimer = 200;
}
if (((gSaveContext.healthCapacity == gSaveContext.health) && (gSaveContext.magic == gSaveContext.magicCapacity)) ||
if (((gSaveContext.save.info.playerData.healthCapacity == gSaveContext.save.info.playerData.health) &&
(gSaveContext.save.info.playerData.magic == gSaveContext.magicCapacity)) ||
(this->refillTimer == 1)) {
this->healingTimer--;
if (this->healingTimer == 90) {
@ -710,23 +711,23 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
switch (cueIdTemp) {
case FAIRY_UPGRADE_MAGIC:
gSaveContext.isMagicAcquired = true;
gSaveContext.save.info.playerData.isMagicAcquired = true;
gSaveContext.magicFillTarget = MAGIC_NORMAL_METER;
// magicLevel is already 0, setting isMagicAcquired to true triggers magicCapacity to grow
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
break;
case FAIRY_UPGRADE_DOUBLE_MAGIC:
if (!gSaveContext.isMagicAcquired) {
gSaveContext.isMagicAcquired = true;
if (!gSaveContext.save.info.playerData.isMagicAcquired) {
gSaveContext.save.info.playerData.isMagicAcquired = true;
}
gSaveContext.isDoubleMagicAcquired = true;
gSaveContext.save.info.playerData.isDoubleMagicAcquired = true;
gSaveContext.magicFillTarget = MAGIC_DOUBLE_METER;
// Setting magicLevel to 0 triggers magicCapacity to grow
gSaveContext.magicLevel = 0;
gSaveContext.save.info.playerData.magicLevel = 0;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
break;
case FAIRY_UPGRADE_DOUBLE_DEFENSE:
gSaveContext.isDoubleDefenseAcquired = true;
gSaveContext.save.info.playerData.isDoubleDefenseAcquired = true;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
break;
}
@ -753,8 +754,8 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
itemPos.y, itemPos.z, 0, 0, 0, sExItemTypes[cueIdTemp]);
if (this->item != NULL) {
if (!gSaveContext.isMagicAcquired) {
gSaveContext.isMagicAcquired = true;
if (!gSaveContext.save.info.playerData.isMagicAcquired) {
gSaveContext.save.info.playerData.isMagicAcquired = true;
} else {
Magic_Fill(play);
}
@ -762,7 +763,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
this->itemSpawned = true;
gSaveContext.healthAccumulator = 0x140;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
gSaveContext.itemGetInf[ITEMGETINF_18_19_1A_INDEX] |= sItemGetFlags[cueIdTemp];
gSaveContext.save.info.itemGetInf[ITEMGETINF_18_19_1A_INDEX] |= sItemGetFlags[cueIdTemp];
Item_Give(play, sItemIds[cueIdTemp]);
}
} else {
@ -785,8 +786,8 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
}
if (this->giveDefenseHearts) {
if (gSaveContext.inventory.defenseHearts < 20) {
gSaveContext.inventory.defenseHearts++;
if (gSaveContext.save.info.inventory.defenseHearts < 20) {
gSaveContext.save.info.inventory.defenseHearts++;
}
}

View file

@ -45,7 +45,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if ((play->sceneId != SCENE_LON_LON_RANCH || !LINK_IS_ADULT) ||
(GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED) && (gSaveContext.cutsceneIndex != 0xFFF0))) {
(GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED) && (gSaveContext.save.cutsceneIndex != 0xFFF0))) {
Actor_Kill(&this->dyna.actor);
return;
}

View file

@ -108,7 +108,7 @@ void BgRelayObjects_Destroy(Actor* thisx, PlayState* play) {
BgRelayObjects* this = (BgRelayObjects*)thisx;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
if ((this->dyna.actor.params == WINDMILL_ROTATING_GEAR) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
if ((this->dyna.actor.params == WINDMILL_ROTATING_GEAR) && (gSaveContext.save.cutsceneIndex < 0xFFF0)) {
CLEAR_EVENTCHKINF(EVENTCHKINF_65);
}
}

View file

@ -236,14 +236,14 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) {
if (gTimeSpeed == 50) {
tmp = CLOCK_TIME(20, 0) + 1;
if (gSaveContext.dayTime > CLOCK_TIME(20, 0) + 1) {
if (gSaveContext.save.dayTime > CLOCK_TIME(20, 0) + 1) {
tmp = CLOCK_TIME(20, 0) + 1 + 0x10000;
}
gTimeSpeed = (tmp - gSaveContext.dayTime) * (1.0f / 350.0f);
gTimeSpeed = (tmp - gSaveContext.save.dayTime) * (1.0f / 350.0f);
}
dayTime = gSaveContext.dayTime;
dayTime = gSaveContext.save.dayTime;
if ((dayTime > CLOCK_TIME(4, 0)) && (dayTime < CLOCK_TIME(4, 30)) && (gSaveContext.sceneLayer == 5)) {
gTimeSpeed = 0;

View file

@ -138,7 +138,8 @@ void BgSpot09Obj_Init(Actor* thisx, PlayState* play) {
BgSpot09Obj* this = (BgSpot09Obj*)thisx;
osSyncPrintf("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params,
gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] & EVENTCHKINF_CARPENTERS_FREE_MASK_ALL);
gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
EVENTCHKINF_CARPENTERS_FREE_MASK_ALL);
this->dyna.actor.params &= 0xFF;
if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) {
osSyncPrintf("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n",

View file

@ -1190,8 +1190,8 @@ void BossGanon_SetupTowerCutscene(BossGanon* this, PlayState* play) {
this->csTimer = 0;
this->csState = 100;
this->unk_198 = 1;
gSaveContext.magic = gSaveContext.magicCapacity;
gSaveContext.health = gSaveContext.healthCapacity;
gSaveContext.save.info.playerData.magic = gSaveContext.magicCapacity;
gSaveContext.save.info.playerData.health = gSaveContext.save.info.playerData.healthCapacity;
} else {
this->actionFunc = BossGanon_SetupTowerCutscene;
}

View file

@ -315,7 +315,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) {
break;
case DEMO_EFFECT_GOD_LGT_NAYRU:
if (gSaveContext.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_0) {
if (gSaveContext.save.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_0) {
Actor_SetScale(&this->actor, 1.0f);
} else {
Actor_SetScale(&this->actor, 0.1f);
@ -336,7 +336,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) {
break;
case DEMO_EFFECT_GOD_LGT_FARORE:
if (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0) {
if (gSaveContext.save.entranceIndex == ENTR_KOKIRI_FOREST_0) {
Actor_SetScale(&this->actor, 2.4f);
} else {
Actor_SetScale(&this->actor, 0.1f);
@ -612,7 +612,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) {
Actor_SetScale(thisx, 0.20f);
if (gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
if (gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
switch (play->csCtx.actorCues[this->cueChannel]->id) {
case 2:
DemoEffect_MedalSparkle(this, play, 0);
@ -624,7 +624,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) {
}
switch (play->csCtx.actorCues[this->cueChannel]->id) {
case 2:
if (gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
if (gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
Actor_PlaySfx(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG);
} else {
func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG);
@ -639,7 +639,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) {
if (this->getItem.drawId != GID_ARROW_LIGHT) {
this->actor.shape.rot.y += this->getItem.rotation;
}
if (gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
if (gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
Actor_PlaySfx(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG);
} else {
func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG);
@ -678,7 +678,7 @@ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) {
Actor_SetScale(&this->actor, 84 * 0.001f);
}
} else if (gSaveContext.sceneLayer == 5 || gSaveContext.sceneLayer == 4 ||
(gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_4 && !GET_EVENTCHKINF(EVENTCHKINF_C9))) {
(gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_4 && !GET_EVENTCHKINF(EVENTCHKINF_C9))) {
SkelCurve_SetAnim(&this->skelCurve, &gTimeWarpAnim, 1.0f, 59.0f, 59.0f, 0.0f);
SkelCurve_Update(play, &this->skelCurve);
this->updateFunc = DemoEffect_UpdateTimeWarpReturnFromChamberOfSages;
@ -741,7 +741,7 @@ void DemoEffect_UpdateTimeWarpReturnFromChamberOfSages(DemoEffect* this, PlaySta
this->timeWarp.shrinkTimer++;
if (this->timeWarp.shrinkTimer > 250) {
if (gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_4) {
if (gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_4) {
SET_EVENTCHKINF(EVENTCHKINF_C9);
}
@ -833,7 +833,7 @@ void DemoEffect_UpdateTriforceSpot(DemoEffect* this, PlayState* play) {
}
}
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0 && gSaveContext.sceneLayer == 6 &&
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0 && gSaveContext.sceneLayer == 6 &&
play->csCtx.curFrame == 143) {
Actor_PlaySfx(&this->actor, NA_SE_IT_DM_RING_EXPLOSION);
}
@ -1131,7 +1131,7 @@ void DemoEffect_UpdateGodLgtDin(DemoEffect* this, PlayState* play) {
}
}
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) {
switch (gSaveContext.sceneLayer) {
case 4:
if (play->csCtx.curFrame == 288) {
@ -1186,7 +1186,7 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, PlayState* play) {
}
}
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) {
switch (gSaveContext.sceneLayer) {
case 4:
if (play->csCtx.curFrame == 298) {
@ -1208,7 +1208,7 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, PlayState* play) {
}
}
if (gSaveContext.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_0 && gSaveContext.sceneLayer == 4) {
if (gSaveContext.save.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_0 && gSaveContext.sceneLayer == 4) {
if (play->csCtx.curFrame == 72) {
Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH);
}
@ -1246,7 +1246,7 @@ void DemoEffect_UpdateGodLgtFarore(DemoEffect* this, PlayState* play) {
Audio_PlayCutsceneEffectsSequence(SEQ_CS_EFFECTS_FARORE_MAGIC);
}
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) {
switch (gSaveContext.sceneLayer) {
case 4:
if (play->csCtx.curFrame == 315) {
@ -1556,14 +1556,14 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, PlayState* play) {
return;
default:
DemoEffect_SetPosRotFromCue(this, play, this->cueChannel, 0);
if (gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
if (gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
DemoEffect_MoveJewelSplit(&thisx->world, this);
}
break;
}
}
if (gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
if (gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_0) {
if (!GET_EVENTCHKINF(EVENTCHKINF_4B)) {
hasCue = (play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[this->cueChannel] != NULL);
@ -1758,7 +1758,7 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2737);
if (!DemoEffect_CheckForCue(this, play, 2)) {
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.sceneLayer == 4) {
if (play->csCtx.curFrame <= 680) {
func_80078914(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG);
@ -1907,7 +1907,7 @@ void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) {
u32 frames = play->gameplayFrames;
OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2994);
if (gSaveContext.entranceIndex != ENTR_CASTLE_COURTYARD_ZELDA_0 || play->csCtx.curFrame < 885) {
if (gSaveContext.save.entranceIndex != ENTR_CASTLE_COURTYARD_ZELDA_0 || play->csCtx.curFrame < 885) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
if (this->triforceSpot.lightColumnOpacity > 0) {
@ -2009,7 +2009,7 @@ void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) {
u8 effectType = (this->actor.params & 0x00FF);
if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL ||
CutsceneFlags_Get(play, 1) || IS_CUTSCENE_LAYER || gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_4) {
CutsceneFlags_Get(play, 1) || IS_CUTSCENE_LAYER || gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_4) {
OPEN_DISPS(gfxCtx, "../z_demo_effect.c", 3201);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_25);

View file

@ -544,7 +544,7 @@ void DemoKankyo_DrawRain(Actor* thisx, PlayState* play) {
switch (this->unk_150[i].unk_22) {
case 0:
func_80989B54(thisx, play, i);
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) {
this->unk_150[i].unk_0.y = Rand_ZeroOne() * 500.0f;
} else {
this->unk_150[i].unk_0.y = Rand_ZeroOne() * -500.0f;
@ -553,16 +553,16 @@ void DemoKankyo_DrawRain(Actor* thisx, PlayState* play) {
break;
case 1:
temp_f12_2 = play->view.eye.y + (dy / norm) * 150.0f;
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) {
this->unk_150[i].unk_0.y -= this->unk_150[i].unk_18;
} else {
this->unk_150[i].unk_0.y += this->unk_150[i].unk_18;
}
if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) {
if (this->unk_150[i].unk_C.y + this->unk_150[i].unk_0.y < temp_f12_2 - 300.0f) {
this->unk_150[i].unk_22++;
}
} else if (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_0) {
} else if (gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_0) {
if (temp_f12_2 + 300.0f < this->unk_150[i].unk_C.y + this->unk_150[i].unk_0.y) {
this->unk_150[i].unk_22++;
}
@ -582,13 +582,13 @@ void DemoKankyo_DrawRain(Actor* thisx, PlayState* play) {
this->unk_150[i].unk_C.y + this->unk_150[i].unk_0.y,
this->unk_150[i].unk_C.z + this->unk_150[i].unk_0.z, MTXMODE_NEW);
if (gSaveContext.entranceIndex != ENTR_CUTSCENE_MAP_0) {
if (gSaveContext.save.entranceIndex != ENTR_CUTSCENE_MAP_0) {
Matrix_RotateX(M_PI, MTXMODE_APPLY);
}
gDPPipeSync(POLY_XLU_DISP++);
if (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_0) {
if (gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_0) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 255);
} else {
@ -777,7 +777,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
f32 translateY;
f32 translateZ;
PosRot posRot;
u8 linkAge = gSaveContext.linkAge;
u8 linkAge = gSaveContext.save.linkAge;
OPEN_DISPS(play->state.gfxCtx, "../z_demo_kankyo.c", 1824);

View file

@ -85,8 +85,9 @@ void func_809937B4(DemoTreLgt* this, PlayState* play, f32 currentFrame) {
this->action = DEMO_TRE_LGT_ACTION_ANIMATE;
SkelCurve_SetAnim(skelCurve, sAnimations[gSaveContext.linkAge], 1.0f,
sDemoTreLgtInfo[gSaveContext.linkAge].endFrame + sDemoTreLgtInfo[gSaveContext.linkAge].unk_08,
SkelCurve_SetAnim(skelCurve, sAnimations[gSaveContext.save.linkAge], 1.0f,
sDemoTreLgtInfo[gSaveContext.save.linkAge].endFrame +
sDemoTreLgtInfo[gSaveContext.save.linkAge].unk_08,
currentFrame, 1.0f);
SkelCurve_Update(play, skelCurve);
}
@ -94,24 +95,25 @@ void func_809937B4(DemoTreLgt* this, PlayState* play, f32 currentFrame) {
void func_80993848(DemoTreLgt* this, PlayState* play) {
f32 currentFrame = this->skelCurve.curFrame;
if (currentFrame < sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].endFrame) {
if (currentFrame < sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].endFrame) {
this->unk_170 = 255;
} else {
if (currentFrame <= (sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].endFrame +
sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_08)) {
this->unk_170 = ((((sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].endFrame - currentFrame) /
sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_08) *
if (currentFrame <= (sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].endFrame +
sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].unk_08)) {
this->unk_170 = ((((sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].endFrame - currentFrame) /
sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].unk_08) *
255.0f) +
255.0f);
} else {
this->unk_170 = 0;
}
}
if (currentFrame < sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_0C) {
if (currentFrame < sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].unk_0C) {
this->unk_174 = 255;
} else if (currentFrame < (sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_0C + 10.0f)) {
} else if (currentFrame < (sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].unk_0C + 10.0f)) {
this->unk_174 =
((((sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_0C - currentFrame) / 10.0f) * 255.0f) + 255.0f);
((((sDemoTreLgtInfo[((void)0, gSaveContext.save.linkAge)].unk_0C - currentFrame) / 10.0f) * 255.0f) +
255.0f);
} else {
this->unk_174 = 0;
}

View file

@ -99,7 +99,7 @@ s32 func_80994750(DoorGerudo* this, PlayState* play) {
void func_8099485C(DoorGerudo* this, PlayState* play) {
if (this->isActive) {
this->actionFunc = func_8099496C;
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1;
gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1;
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
} else {
@ -108,7 +108,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) {
if (direction != 0) {
Player* player = GET_PLAYER(play);
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
if (gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
player->naviTextId = -0x203;
} else if (!Flags_GetCollectible(play, (this->dyna.actor.params >> 8) & 0x1F)) {
player->naviTextId = -0x225;

View file

@ -591,7 +591,7 @@ void DoorShutter_Idle(DoorShutter* this, PlayState* play) {
if (this->unlockTimer != 0) {
Flags_SetSwitch(play, DOORSHUTTER_GET_SWITCH_FLAG(&this->dyna.actor));
if (this->doorType != SHUTTER_BOSS) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1;
gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1;
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
} else {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B);
@ -609,7 +609,7 @@ void DoorShutter_Idle(DoorShutter* this, PlayState* play) {
player->naviTextId = -0x204;
return;
}
} else if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
} else if (gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
player->naviTextId = -0x203;
return;
}

View file

@ -161,11 +161,11 @@ void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) {
DoorWarp1_SetupAction(this, DoorWarp1_AwaitClearFlag);
break;
case WARP_DESTINATION:
if ((!(gSaveContext.entranceIndex == ENTR_SACRED_FOREST_MEADOW_3 ||
gSaveContext.entranceIndex == ENTR_DEATH_MOUNTAIN_CRATER_5 ||
gSaveContext.entranceIndex == ENTR_LAKE_HYLIA_9 ||
gSaveContext.entranceIndex == ENTR_DESERT_COLOSSUS_8 ||
gSaveContext.entranceIndex == ENTR_GRAVEYARD_8) &&
if ((!(gSaveContext.save.entranceIndex == ENTR_SACRED_FOREST_MEADOW_3 ||
gSaveContext.save.entranceIndex == ENTR_DEATH_MOUNTAIN_CRATER_5 ||
gSaveContext.save.entranceIndex == ENTR_LAKE_HYLIA_9 ||
gSaveContext.save.entranceIndex == ENTR_DESERT_COLOSSUS_8 ||
gSaveContext.save.entranceIndex == ENTR_GRAVEYARD_8) &&
!IS_CUTSCENE_LAYER) ||
(GET_PLAYER(play)->actor.params & 0xF00) != 0x200) {
Actor_Kill(&this->actor);
@ -261,7 +261,7 @@ void DoorWarp1_SetupPurpleCrystal(DoorWarp1* this, PlayState* play) {
this->unk_1BC = 1.f;
this->actor.shape.yOffset = 800.0f;
if (gSaveContext.entranceIndex != ENTR_TEMPLE_OF_TIME_0) {
if (gSaveContext.save.entranceIndex != ENTR_TEMPLE_OF_TIME_0) {
this->actor.scale.x = 0.0499f;
this->actor.scale.y = 0.077f;
this->actor.scale.z = 0.09f;

View file

@ -290,7 +290,7 @@ void EnBomBowlMan_HandlePlayChoice(EnBomBowlMan* this, PlayState* play) {
switch (play->msgCtx.choiceIndex) {
case 0: // Yes
if (gSaveContext.rupees >= 30) {
if (gSaveContext.save.info.playerData.rupees >= 30) {
Rupees_ChangeBy(-30);
this->minigamePlayStatus = 1;
this->wallStatus[0] = this->wallStatus[1] = 0;

View file

@ -98,7 +98,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) {
f32 endFrame;
animFrameStart = 0.0f;
anim = sAnimations[((void)0, gSaveContext.linkAge)];
anim = sAnimations[((void)0, gSaveContext.save.linkAge)];
colHeader = NULL;
endFrame = Animation_GetLastFrame(anim);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
@ -397,7 +397,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) {
this->alpha = 255;
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
if (this->unk_1F4 != 0) { // unk_1F4 is modified by player code
linkAge = gSaveContext.linkAge;
linkAge = gSaveContext.save.linkAge;
anim = sAnimations[(this->unk_1F4 < 0 ? 2 : 0) + linkAge];
frameCount = Animation_GetLastFrame(anim);
Animation_Change(&this->skelanime, anim, 1.5f, 0, frameCount, ANIMMODE_ONCE, 0.0f);

View file

@ -270,7 +270,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) {
if (this->stateFlags & ENDAIKU_STATEFLAG_GERUDODEFEATED) {
freedCount = 0;
for (carpenterType = 0; carpenterType < 4; carpenterType++) {
if (gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
EVENTCHKINF_CARPENTERS_FREE_MASK(carpenterType)) {
freedCount++;
}
@ -399,7 +399,7 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) {
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_RUN, &this->currentAnimIndex);
this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2);
gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |=
gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |=
EVENTCHKINF_CARPENTERS_FREE_MASK(this->actor.params & 3);
this->actor.gravity = -1.0f;

View file

@ -235,7 +235,7 @@ void EnDivingGame_HandlePlayChoice(EnDivingGame* this, PlayState* play) {
Message_ShouldAdvance(play)) { // Did the player select an answer?
switch (play->msgCtx.choiceIndex) {
case 0: // Yes
if (gSaveContext.rupees >= 20) {
if (gSaveContext.save.info.playerData.rupees >= 20) {
Rupees_ChangeBy(-20);
this->actor.textId = 0x4054;
} else {

View file

@ -188,7 +188,7 @@ u32 func_809EF5A4(EnDns* this) {
if ((CUR_CAPACITY(UPG_DEKU_NUTS) != 0) && (AMMO(ITEM_DEKU_NUT) >= CUR_CAPACITY(UPG_DEKU_NUTS))) {
return 1;
}
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
if (Item_CheckObtainability(ITEM_DEKU_NUT) == ITEM_NONE) {
@ -201,7 +201,7 @@ u32 func_809EF658(EnDns* this) {
if ((CUR_CAPACITY(UPG_DEKU_STICKS) != 0) && (AMMO(ITEM_DEKU_STICK) >= CUR_CAPACITY(UPG_DEKU_STICKS))) {
return 1;
}
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
if (Item_CheckObtainability(ITEM_DEKU_STICK) == ITEM_NONE) {
@ -211,7 +211,7 @@ u32 func_809EF658(EnDns* this) {
}
u32 func_809EF70C(EnDns* this) {
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
return 4;
@ -224,7 +224,7 @@ u32 func_809EF73C(EnDns* this) {
if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG)) {
return 1;
}
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
if (Item_CheckObtainability(ITEM_DEKU_SEEDS) == ITEM_NONE) {
@ -237,7 +237,7 @@ u32 func_809EF800(EnDns* this) {
if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SHIELD, EQUIP_INV_SHIELD_DEKU)) {
return 1;
}
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
return 4;
@ -250,7 +250,7 @@ u32 func_809EF854(EnDns* this) {
if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) {
return 1;
}
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
return 4;
@ -263,7 +263,7 @@ u32 func_809EF8F4(EnDns* this) {
if (AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) {
return 1;
}
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
return 4;
@ -273,7 +273,7 @@ u32 func_809EF9A4(EnDns* this) {
if (!Inventory_HasEmptyBottle()) {
return 1;
}
if (gSaveContext.rupees < this->dnsItemEntry->itemPrice) {
if (gSaveContext.save.info.playerData.rupees < this->dnsItemEntry->itemPrice) {
return 0;
}
return 4;

View file

@ -181,7 +181,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) {
this->actor.objBankIndex = this->requiredObjBankIndex;
this->actionFunc = EnDoor_Idle;
if (doorType == DOOR_EVENING) {
doorType = (gSaveContext.dayTime > CLOCK_TIME(18, 0) && gSaveContext.dayTime < CLOCK_TIME(21, 0))
doorType = (gSaveContext.save.dayTime > CLOCK_TIME(18, 0) && gSaveContext.save.dayTime < CLOCK_TIME(21, 0))
? DOOR_SCENEEXIT
: DOOR_CHECKABLE;
}
@ -226,7 +226,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) {
Animation_PlayOnceSetSpeed(&this->skelAnime, sDoorAnims[this->openAnim],
(player->stateFlags1 & PLAYER_STATE1_27) ? 0.75f : 1.5f);
if (this->lockTimer != 0) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1;
gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1;
Flags_SetSwitch(play, ENDOOR_GET_LOCKED_SWITCH_FLAG(&this->actor));
Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
}
@ -239,7 +239,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) {
}
if (ABS(yawDiff) < 0x3000) {
if (this->lockTimer != 0) {
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
if (gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
Player* player2 = GET_PLAYER(play);
player2->naviTextId = -0x203;

View file

@ -156,7 +156,7 @@ void EnDs_OfferOddPotion(EnDs* this, PlayState* play) {
}
s32 EnDs_CheckRupeesAndBottle(void) {
if (gSaveContext.rupees < 100) {
if (gSaveContext.save.info.playerData.rupees < 100) {
return 0;
} else if (Inventory_HasEmptyBottle() == 0) {
return 1;

View file

@ -294,7 +294,7 @@ void EnDu_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = 1;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
if (gSaveContext.save.cutsceneIndex >= 0xFFF0) {
play->csCtx.script = SEGMENTED_TO_VIRTUAL(gGoronCityDarunia01Cs);
gSaveContext.cutsceneTrigger = 1;
EnDu_SetupAction(this, func_809FE890);

View file

@ -346,8 +346,9 @@ void EnElf_Init(Actor* thisx, PlayState* play) {
this->elfMsg = NULL;
this->unk_2C7 = 0x14;
if ((gSaveContext.naviTimer >= 25800) || (gSaveContext.naviTimer < 3000)) {
gSaveContext.naviTimer = 0;
if ((gSaveContext.save.info.playerData.naviTimer >= 25800) ||
(gSaveContext.save.info.playerData.naviTimer < 3000)) {
gSaveContext.save.info.playerData.naviTimer = 0;
}
break;
case FAIRY_REVIVE_BOTTLE:
@ -1378,7 +1379,9 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
if (player->naviTextId == 0) {
if (player->unk_664 == NULL) {
if (((gSaveContext.naviTimer >= 600) && (gSaveContext.naviTimer <= 3000)) || (nREG(89) != 0)) {
if (((gSaveContext.save.info.playerData.naviTimer >= 600) &&
(gSaveContext.save.info.playerData.naviTimer <= 3000)) ||
(nREG(89) != 0)) {
player->naviTextId = QuestHint_GetNaviTextId(play);
if (player->naviTextId == 0x15F) {
@ -1397,7 +1400,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
if (thisx->textId == QuestHint_GetNaviTextId(play)) {
this->fairyFlags |= 0x80;
gSaveContext.naviTimer = 3001;
gSaveContext.save.info.playerData.naviTimer = 3001;
}
this->fairyFlags |= 0x10;
@ -1414,22 +1417,21 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
thisx->shape.rot.y = this->unk_2BC;
// `gSaveContext.sceneFlags[127].chest` (like in the debug string) instead of `HIGH_SCORE(HS_HBA)` matches too,
// but, with how the `SaveContext` struct is currently defined, it is an out-of-bounds read in the `sceneFlags`
// array.
// It is theorized the original `room_inf` (currently `sceneFlags`) was an array of length 128, not broken up
// like currently into structs. Structs are currently used because they're easier to work with and still match.
// There is another occurrence of this elsewhere.
// `gSaveContext.save.info.sceneFlags[127].chest` (like in the debug string) instead of `HIGH_SCORE(HS_HBA)`
// matches too, but, with how the `SaveContext` struct is currently defined, it is an out-of-bounds read in the
// `sceneFlags` array. It is theorized the original `room_inf` (currently `sceneFlags`) was an array of length
// 128, not broken up like currently into structs. Structs are currently used because they're easier to work
// with and still match. There is another occurrence of this elsewhere.
nREG(80) = HIGH_SCORE(HS_HBA);
if ((nREG(81) != 0) && (HIGH_SCORE(HS_HBA) != 0)) {
LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", HIGH_SCORE(HS_HBA), "../z_en_elf.c", 2595);
}
if (!Play_InCsMode(play)) {
if (gSaveContext.naviTimer < 25800) {
gSaveContext.naviTimer++;
if (gSaveContext.save.info.playerData.naviTimer < 25800) {
gSaveContext.save.info.playerData.naviTimer++;
} else if (!(this->fairyFlags & 0x80)) {
gSaveContext.naviTimer = 0;
gSaveContext.save.info.playerData.naviTimer = 0;
}
}
}

View file

@ -105,12 +105,12 @@ static EnFrPointers sEnFrPointers = {
},
};
#define FROG_HAS_SONG_BEEN_PLAYED(frogSongIndex) \
(gSaveContext.eventChkInf[EVENTCHKINF_SONGS_FOR_FROGS_INDEX] & \
#define FROG_HAS_SONG_BEEN_PLAYED(frogSongIndex) \
(gSaveContext.save.info.eventChkInf[EVENTCHKINF_SONGS_FOR_FROGS_INDEX] & \
sFrogSongIndexToEventChkInfSongsForFrogsMask[frogSongIndex])
#define FROG_SET_SONG_PLAYED(frogSongIndex) \
gSaveContext.eventChkInf[EVENTCHKINF_SONGS_FOR_FROGS_INDEX] |= \
#define FROG_SET_SONG_PLAYED(frogSongIndex) \
gSaveContext.save.info.eventChkInf[EVENTCHKINF_SONGS_FOR_FROGS_INDEX] |= \
sFrogSongIndexToEventChkInfSongsForFrogsMask[frogSongIndex];
static u16 sFrogSongIndexToEventChkInfSongsForFrogsMask[] = {

View file

@ -362,7 +362,7 @@ void EnGe1_OfferOpen_GTGGuard(EnGe1* this, PlayState* play) {
switch (play->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees < 10) {
if (gSaveContext.save.info.playerData.rupees < 10) {
Message_ContinueTextbox(play, 0x6016);
this->actionFunc = EnGe1_RefuseEntryTooPoor_GTGGuard;
} else {
@ -573,7 +573,7 @@ void EnGe1_BeginGame_Archery(EnGe1* this, PlayState* play) {
switch (play->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees < 20) {
if (gSaveContext.save.info.playerData.rupees < 20) {
Message_ContinueTextbox(play, 0x85);
this->actionFunc = EnGe1_TalkTooPoor_Archery;
} else {

View file

@ -223,7 +223,7 @@ s32 Ge2_DetectPlayerInUpdate(PlayState* play, EnGe2* this, Vec3f* pos, s16 yRot,
}
s32 EnGe2_CheckCarpentersFreed(void) {
if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
if (CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
(EVENTCHKINF_CARPENTERS_FREE_MASK_ALL | 0xF0),
EVENTCHKINF_CARPENTERS_FREE_MASK_ALL)) {
return 1;

View file

@ -425,7 +425,7 @@ s32 EnGirlA_CanBuy_Arrows(PlayState* play, EnGirlA* this) {
if (AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS;
@ -438,7 +438,7 @@ s32 EnGirlA_CanBuy_Bombs(PlayState* play, EnGirlA* this) {
if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS;
@ -448,7 +448,7 @@ s32 EnGirlA_CanBuy_DekuNuts(PlayState* play, EnGirlA* this) {
if ((CUR_CAPACITY(UPG_DEKU_NUTS) != 0) && (AMMO(ITEM_DEKU_NUT) >= CUR_CAPACITY(UPG_DEKU_NUTS))) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_DEKU_NUT) == ITEM_NONE) {
@ -461,7 +461,7 @@ s32 EnGirlA_CanBuy_DekuSticks(PlayState* play, EnGirlA* this) {
if ((CUR_CAPACITY(UPG_DEKU_STICKS) != 0) && (AMMO(ITEM_DEKU_STICK) >= CUR_CAPACITY(UPG_DEKU_STICKS))) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_DEKU_STICK) == ITEM_NONE) {
@ -474,7 +474,7 @@ s32 EnGirlA_CanBuy_Fish(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_FISH) == ITEM_NONE) {
@ -487,7 +487,7 @@ s32 EnGirlA_CanBuy_RedPotion(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_POTION_RED) == ITEM_NONE) {
@ -500,7 +500,7 @@ s32 EnGirlA_CanBuy_GreenPotion(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_POTION_GREEN) == ITEM_NONE) {
@ -513,7 +513,7 @@ s32 EnGirlA_CanBuy_BluePotion(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_POTION_BLUE) == ITEM_NONE) {
@ -527,7 +527,7 @@ s32 EnGirlA_CanBuy_Longsword(PlayState* play, EnGirlA* this) {
!CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_SWORD_BIGGORON) == ITEM_NONE) {
@ -540,7 +540,7 @@ s32 EnGirlA_CanBuy_HylianShield(PlayState* play, EnGirlA* this) {
if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SHIELD, EQUIP_INV_SHIELD_HYLIAN)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_SHIELD_HYLIAN) == ITEM_NONE) {
@ -553,7 +553,7 @@ s32 EnGirlA_CanBuy_DekuShield(PlayState* play, EnGirlA* this) {
if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SHIELD, EQUIP_INV_SHIELD_DEKU)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_SHIELD_DEKU) == ITEM_NONE) {
@ -569,7 +569,7 @@ s32 EnGirlA_CanBuy_GoronTunic(PlayState* play, EnGirlA* this) {
if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_TUNIC_GORON) == ITEM_NONE) {
@ -585,7 +585,7 @@ s32 EnGirlA_CanBuy_ZoraTunic(PlayState* play, EnGirlA* this) {
if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_ZORA)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_TUNIC_ZORA) == ITEM_NONE) {
@ -595,17 +595,17 @@ s32 EnGirlA_CanBuy_ZoraTunic(PlayState* play, EnGirlA* this) {
}
s32 EnGirlA_CanBuy_RecoveryHeart(PlayState* play, EnGirlA* this) {
if (gSaveContext.healthCapacity == gSaveContext.health) {
if (gSaveContext.save.info.playerData.healthCapacity == gSaveContext.save.info.playerData.health) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS;
}
s32 EnGirlA_CanBuy_MilkBottle(PlayState* play, EnGirlA* this) {
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_MILK_FULL) == ITEM_NONE) {
@ -615,7 +615,7 @@ s32 EnGirlA_CanBuy_MilkBottle(PlayState* play, EnGirlA* this) {
}
s32 EnGirlA_CanBuy_WeirdEgg(PlayState* play, EnGirlA* this) {
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_ZELDAS_LETTER) == ITEM_NONE) {
@ -636,7 +636,7 @@ s32 EnGirlA_CanBuy_Bombchus(PlayState* play, EnGirlA* this) {
if (AMMO(ITEM_BOMBCHU) >= 50) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOMBCHU) == ITEM_NONE) {
@ -649,7 +649,7 @@ s32 EnGirlA_CanBuy_DekuSeeds(PlayState* play, EnGirlA* this) {
if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_DEKU_SEEDS) == ITEM_NONE) {
@ -666,7 +666,7 @@ s32 EnGirlA_CanBuy_BlueFire(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_BLUE_FIRE) == ITEM_NONE) {
@ -679,7 +679,7 @@ s32 EnGirlA_CanBuy_Bugs(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_BUG) == ITEM_NONE) {
@ -692,7 +692,7 @@ s32 EnGirlA_CanBuy_Poe(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_POE) == ITEM_NONE) {
@ -705,7 +705,7 @@ s32 EnGirlA_CanBuy_Fairy(PlayState* play, EnGirlA* this) {
if (!Inventory_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_BOTTLE;
}
if (gSaveContext.rupees < this->basePrice) {
if (gSaveContext.save.info.playerData.rupees < this->basePrice) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (Item_CheckObtainability(ITEM_BOTTLE_FAIRY) == ITEM_NONE) {
@ -756,7 +756,7 @@ void EnGirlA_ItemGive_DekuSticks(PlayState* play, EnGirlA* this) {
void EnGirlA_ItemGive_Longsword(PlayState* play, EnGirlA* this) {
func_800849EC(play);
gSaveContext.swordHealth = 8;
gSaveContext.save.info.playerData.swordHealth = 8;
Rupees_ChangeBy(-this->basePrice);
}

View file

@ -241,7 +241,7 @@ void EnGm_ProcessChoiceIndex(EnGm* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0: // yes
if (gSaveContext.rupees < 200) {
if (gSaveContext.save.info.playerData.rupees < 200) {
Message_ContinueTextbox(play, 0xC8);
this->actionFunc = func_80A3DD7C;
} else {

View file

@ -93,7 +93,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) {
switch (thisx->params & 0xF0) {
case 0x90:
if (gSaveContext.bgsFlag) {
if (gSaveContext.save.info.playerData.bgsFlag) {
return 0x305E;
} else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) {
if (Environment_GetBgsDayCount() >= 3) {
@ -857,7 +857,7 @@ void func_80A405CC(EnGo* this, PlayState* play) {
void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) {
if (((this->actor.params & 0xF0) == 0x90) && (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) {
if (gSaveContext.bgsFlag) {
if (gSaveContext.save.info.playerData.bgsFlag) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
} else {
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYE_DROPS) {
@ -983,7 +983,7 @@ void func_80A40C78(EnGo* this, PlayState* play) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
} else if (this->unk_20C) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
gSaveContext.bgsFlag = true;
gSaveContext.save.info.playerData.bgsFlag = true;
} else if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_PRESCRIPTION) {
this->actor.textId = 0x3058;
Message_ContinueTextbox(play, this->actor.textId);

View file

@ -562,7 +562,7 @@ s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) {
u16 EnGo2_GetTextIdGoronDmtBiggoron(PlayState* play, EnGo2* this) {
Player* player = GET_PLAYER(play);
if (gSaveContext.bgsFlag) {
if (gSaveContext.save.info.playerData.bgsFlag) {
player->exchangeItemId = EXCH_ITEM_CLAIM_CHECK;
return 0x305E;
} else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) {
@ -584,7 +584,7 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) {
switch (EnGo2_GetDialogState(this, play)) {
case TEXT_STATE_DONE:
if (this->actor.textId == 0x305E) {
if (!gSaveContext.bgsFlag) {
if (!gSaveContext.save.info.playerData.bgsFlag) {
EnGo2_GetItem(this, play, GI_SWORD_BIGGORON);
this->actionFunc = EnGo2_SetupGetItem;
return NPC_TALK_STATE_ACTION;
@ -1028,7 +1028,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) {
u16 textId;
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
if (gSaveContext.bgsFlag) {
if (gSaveContext.save.info.playerData.bgsFlag) {
if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) {
this->actor.textId = 0x3003;
} else {
@ -1036,7 +1036,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) {
}
player->actor.textId = this->actor.textId;
} else if (!gSaveContext.bgsFlag && (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK)) {
} else if (!gSaveContext.save.info.playerData.bgsFlag && (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK)) {
if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) {
if (Environment_GetBgsDayCount() >= 3) {
textId = 0x305E;
@ -1091,7 +1091,7 @@ void func_80A45288(EnGo2* this, PlayState* play) {
if (this->actionFunc != EnGo2_GoronFireGenericAction) {
this->interactInfo.trackPos = player->actor.world.pos;
this->interactInfo.yOffset =
sPlayerTrackingYOffsets[this->actor.params & 0x1F][((void)0, gSaveContext.linkAge)];
sPlayerTrackingYOffsets[this->actor.params & 0x1F][((void)0, gSaveContext.save.linkAge)];
Npc_TrackPoint(&this->actor, &this->interactInfo, 4, this->trackingMode);
}
if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) {
@ -1809,7 +1809,7 @@ void EnGo2_SetGetItem(EnGo2* this, PlayState* play) {
EnGo2_GetItemAnimation(this, play);
return;
case GI_SWORD_BIGGORON:
gSaveContext.bgsFlag = true;
gSaveContext.save.info.playerData.bgsFlag = true;
break;
case GI_BOMB_BAG_30:
case GI_BOMB_BAG_40:

View file

@ -98,8 +98,8 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) {
osSyncPrintf(VT_FGCOL(MAGENTA) " (頭)反転アングルスピード加算値 %f\n" VT_RST, this->headTurnSpeedScale);
// "(head) maximum turning angle speed"
osSyncPrintf(VT_FGCOL(MAGENTA) " (頭)反転アングルスピード最大☆ %f\n" VT_RST, this->headTurnSpeedMax);
osSyncPrintf(VT_FGCOL(GREEN) " 今時間 %d\n" VT_RST, ((void)0, gSaveContext.dayTime)); // "current time"
osSyncPrintf(VT_FGCOL(YELLOW) " チェック時間 %d\n" VT_RST, CLOCK_TIME(17, 30) - 1); // "check time"
osSyncPrintf(VT_FGCOL(GREEN) " 今時間 %d\n" VT_RST, ((void)0, gSaveContext.save.dayTime)); // "current time"
osSyncPrintf(VT_FGCOL(YELLOW) " チェック時間 %d\n" VT_RST, CLOCK_TIME(17, 30) - 1); // "check time"
osSyncPrintf("\n\n");
if (this->path == 3) {
@ -111,13 +111,13 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) {
}
if (this->type != 5) {
if (((gSaveContext.dayTime < CLOCK_TIME(17, 18) - 1) || IS_DAY) && !GET_EVENTCHKINF(EVENTCHKINF_80)) {
if (((gSaveContext.save.dayTime < CLOCK_TIME(17, 18) - 1) || IS_DAY) && !GET_EVENTCHKINF(EVENTCHKINF_80)) {
this->actionFunc = EnHeishi1_SetupWalk;
} else {
Actor_Kill(&this->actor);
}
} else {
if ((gSaveContext.dayTime > CLOCK_TIME(17, 18) - 1) || !IS_DAY || GET_EVENTCHKINF(EVENTCHKINF_80)) {
if ((gSaveContext.save.dayTime > CLOCK_TIME(17, 18) - 1) || !IS_DAY || GET_EVENTCHKINF(EVENTCHKINF_80)) {
this->actionFunc = EnHeishi1_SetupWaitNight;
} else {
Actor_Kill(&this->actor);

View file

@ -237,7 +237,7 @@ void func_80A5344C(EnHeishi2* this, PlayState* play) {
this->unk_300 = TEXT_STATE_EVENT;
switch (play->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees >= 10) {
if (gSaveContext.save.info.playerData.rupees >= 10) {
Rupees_ChangeBy(-10);
this->actor.textId = 0x7098;
this->actionFunc = func_80A53538;

View file

@ -109,7 +109,7 @@ void EnHoll_SetupAction(EnHoll* this, EnHollActionFunc func) {
}
s32 EnHoll_IsKokiriLayer8(void) {
return gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0 && gSaveContext.sceneLayer == 8;
return gSaveContext.save.entranceIndex == ENTR_KOKIRI_FOREST_0 && gSaveContext.sceneLayer == 8;
}
void EnHoll_ChooseAction(EnHoll* this) {

View file

@ -1741,7 +1741,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) {
Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->stateFlags &= ~ENHORSE_INACTIVE;
gSaveContext.horseData.sceneId = play->sceneId;
gSaveContext.save.info.horseData.sceneId = play->sceneId;
// Focus the camera on Epona
Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor);
@ -2530,7 +2530,7 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) {
EnHorse_UpdateHbaRaceInfo(this, play, &sHbaInfo);
if ((this->hbaFlags & 1) || (this->hbaTimer >= 46)) {
if ((isFanfarePlaying != true) && (gSaveContext.minigameState != 3)) {
gSaveContext.cutsceneIndex = 0;
gSaveContext.save.cutsceneIndex = 0;
play->nextEntranceIndex = ENTR_GERUDOS_FORTRESS_16;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST);
@ -3604,7 +3604,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
this->cyl1.base.atFlags &= ~AT_ON;
}
if (gSaveContext.entranceIndex != ENTR_LON_LON_RANCH_0 || gSaveContext.sceneLayer != 9) {
if (gSaveContext.save.entranceIndex != ENTR_LON_LON_RANCH_0 || gSaveContext.sceneLayer != 9) {
if (this->dustFlags & 1) {
this->dustFlags &= ~1;
func_800287AC(play, &this->frontRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200,

View file

@ -106,7 +106,7 @@ s32 EnHorseGameCheck_DestroyIngoRace(EnHorseGameCheckBase* base, PlayState* play
}
void EnHorseGameCheck_FinishIngoRace(EnHorseGameCheckIngoRace* this, PlayState* play) {
gSaveContext.cutsceneIndex = 0;
gSaveContext.save.cutsceneIndex = 0;
if (this->result == INGORACE_PLAYER_WIN) {
play->nextEntranceIndex = ENTR_LON_LON_RANCH_7;
if (GET_EVENTINF(EVENTINF_HORSES_06)) {
@ -293,21 +293,21 @@ s32 EnHorseGameCheck_DestroyMalonRace(EnHorseGameCheckBase* base, PlayState* pla
void EnHorseGameCheck_FinishMalonRace(EnHorseGameCheckMalonRace* this, PlayState* play) {
if ((this->result == MALONRACE_SUCCESS) || (this->result == MALONRACE_TIME_UP)) {
gSaveContext.cutsceneIndex = 0;
gSaveContext.save.cutsceneIndex = 0;
play->nextEntranceIndex = ENTR_LON_LON_RANCH_7;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
} else if (this->result == MALONRACE_FAILURE) {
gSaveContext.timerSeconds = 240;
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
gSaveContext.cutsceneIndex = 0;
gSaveContext.save.cutsceneIndex = 0;
play->nextEntranceIndex = ENTR_LON_LON_RANCH_7;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
} else {
// "not supported"
osSyncPrintf("En_HGC_Spot20_Ta_end():対応せず\n");
gSaveContext.cutsceneIndex = 0;
gSaveContext.save.cutsceneIndex = 0;
play->nextEntranceIndex = ENTR_LON_LON_RANCH_0;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;

View file

@ -351,7 +351,7 @@ void func_80A6A068(EnHorseLinkChild* this, PlayState* play) {
player = GET_PLAYER(play);
distFromLink = Actor_WorldDistXZToActor(&this->actor, &player->actor);
if (gSaveContext.entranceIndex == ENTR_LON_LON_RANCH_1) {
if (gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_1) {
Audio_PlaySfxGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
func_80A6A724(this);
@ -359,7 +359,7 @@ void func_80A6A068(EnHorseLinkChild* this, PlayState* play) {
}
if ((GET_EVENTCHKINF(EVENTCHKINF_16) && (DREG(53) != 0)) ||
((play->sceneId == SCENE_LON_LON_RANCH) && (gSaveContext.cutsceneIndex == 0xFFF1))) {
((play->sceneId == SCENE_LON_LON_RANCH) && (gSaveContext.save.cutsceneIndex == 0xFFF1))) {
func_80A6A4DC(this);
} else {
this->unk_2A0 = GET_EVENTCHKINF(EVENTCHKINF_16);

View file

@ -917,7 +917,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) {
}
if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) {
this->unk_330 = gSaveContext.eventChkInf[EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX];
this->unk_330 = gSaveContext.save.info.eventChkInf[EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX];
}
EnHy_InitSetProperties(this);

View file

@ -217,7 +217,7 @@ s16 EnIn_UpdateTalkStateOnChoice(PlayState* play, Actor* thisx) {
case 0x2031:
if (play->msgCtx.choiceIndex == 1) {
this->actor.textId = 0x2032;
} else if (gSaveContext.rupees < 10) {
} else if (gSaveContext.save.info.playerData.rupees < 10) {
this->actor.textId = 0x2033;
} else {
this->actor.textId = 0x2034;
@ -244,7 +244,7 @@ s16 EnIn_UpdateTalkStateOnChoice(PlayState* play, Actor* thisx) {
}
break;
case 0x2038:
if (play->msgCtx.choiceIndex == 0 && gSaveContext.rupees >= 50) {
if (play->msgCtx.choiceIndex == 0 && gSaveContext.save.info.playerData.rupees >= 50) {
talkState = NPC_TALK_STATE_ACTION;
} else {
this->actor.textId = 0x2039;
@ -253,7 +253,7 @@ s16 EnIn_UpdateTalkStateOnChoice(PlayState* play, Actor* thisx) {
}
break;
case 0x205B:
if (play->msgCtx.choiceIndex == 0 && gSaveContext.rupees >= 50) {
if (play->msgCtx.choiceIndex == 0 && gSaveContext.save.info.playerData.rupees >= 50) {
talkState = NPC_TALK_STATE_ACTION;
} else {
Message_ContinueTextbox(play, this->actor.textId = 0x2039);
@ -264,7 +264,7 @@ s16 EnIn_UpdateTalkStateOnChoice(PlayState* play, Actor* thisx) {
}
break;
}
if (!gSaveContext.rupees) {}
if (!gSaveContext.save.info.playerData.rupees) {}
return talkState;
}
@ -665,7 +665,7 @@ void func_80A7A568(EnIn* this, PlayState* play) {
gSaveContext.timerState = TIMER_STATE_OFF;
} else if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
if (play->msgCtx.choiceIndex == 0) {
if (gSaveContext.rupees < 50) {
if (gSaveContext.save.info.playerData.rupees < 50) {
play->msgCtx.stateTimer = 4;
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
@ -717,7 +717,8 @@ void func_80A7A770(EnIn* this, PlayState* play) {
void func_80A7A848(EnIn* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
if ((play->msgCtx.choiceIndex == 0 && gSaveContext.rupees < 50) || play->msgCtx.choiceIndex == 1) {
if ((play->msgCtx.choiceIndex == 0 && gSaveContext.save.info.playerData.rupees < 50) ||
play->msgCtx.choiceIndex == 1) {
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
this->actionFunc = func_80A7A4C8;
} else {

View file

@ -136,7 +136,7 @@ void func_80A891C4(EnJs* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0: // yes
if (gSaveContext.rupees < 200) {
if (gSaveContext.save.info.playerData.rupees < 200) {
Message_ContinueTextbox(play, 0x6075);
func_80A89008(this);
} else {

View file

@ -147,7 +147,7 @@ void func_80A89A6C(EnJsjutan* this, PlayState* play) {
i = 1;
// Credits scene. The magic carpet man is friends with the bean guy and the lakeside professor.
if ((gSaveContext.entranceIndex == ENTR_LON_LON_RANCH_0) && (gSaveContext.sceneLayer == 8)) {
if ((gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_0) && (gSaveContext.sceneLayer == 8)) {
isInCreditsScene = true;
actorProfessor = play->actorCtx.actorLists[ACTORCAT_NPC].head;
@ -297,7 +297,7 @@ void func_80A89A6C(EnJsjutan* this, PlayState* play) {
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.world.pos.y = this->unk_168;
dayTime = gSaveContext.dayTime;
dayTime = gSaveContext.save.dayTime;
if (dayTime >= CLOCK_TIME(12, 0)) {
dayTime = 0xFFFF - dayTime;

View file

@ -178,13 +178,13 @@ void func_80A8F660(EnKakasi* this, PlayState* play) {
this->unk_196 = TEXT_STATE_DONE;
if (!LINK_IS_ADULT) {
this->unk_194 = false;
if (gSaveContext.scarecrowLongSongSet) {
if (gSaveContext.save.info.scarecrowLongSongSet) {
this->actor.textId = 0x407A;
this->unk_196 = TEXT_STATE_EVENT;
}
} else {
this->unk_194 = true;
if (gSaveContext.scarecrowLongSongSet) {
if (gSaveContext.save.info.scarecrowLongSongSet) {
this->actor.textId = 0x4079;
this->unk_196 = TEXT_STATE_EVENT;
}
@ -341,7 +341,7 @@ void EnKakasi_Draw(Actor* thisx, PlayState* play) {
if (BREG(3) != 0) {
osSyncPrintf("\n\n");
// "flag!"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowLongSongSet);
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.save.info.scarecrowLongSongSet);
}
Gfx_SetupDL_25Opa(play->state.gfxCtx);
SkelAnime_DrawFlexOpa(play, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount, NULL,

View file

@ -188,14 +188,14 @@ void func_80A91284(EnKakasi3* this, PlayState* play) {
if (!LINK_IS_ADULT) {
this->unk_194 = false;
if (gSaveContext.scarecrowSpawnSongSet) {
if (gSaveContext.save.info.scarecrowSpawnSongSet) {
this->actor.textId = 0x40A0;
this->dialogState = TEXT_STATE_EVENT;
this->unk_1A8 = 1;
}
} else {
this->unk_194 = true;
if (gSaveContext.scarecrowSpawnSongSet) {
if (gSaveContext.save.info.scarecrowSpawnSongSet) {
if (this->unk_195) {
this->actor.textId = 0x40A2;
} else {
@ -244,7 +244,7 @@ void func_80A91348(EnKakasi3* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 80.0f) {
player->stateFlags2 |= PLAYER_STATE2_23;
}
} else if (gSaveContext.scarecrowSpawnSongSet && !this->unk_195) {
} else if (gSaveContext.save.info.scarecrowSpawnSongSet && !this->unk_195) {
if (player->stateFlags2 & PLAYER_STATE2_24) {
this->subCamId = OnePointCutscene_Init(play, 2260, -99, &this->actor, CAM_ID_MAIN);
@ -411,7 +411,7 @@ void EnKakasi3_Update(Actor* thisx, PlayState* play) {
if (BREG(2) != 0) {
osSyncPrintf("\n\n");
// "flag!"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowSpawnSongSet);
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.save.info.scarecrowSpawnSongSet);
}
this->unk_198++;

View file

@ -863,7 +863,7 @@ void EnKanban_Draw(Actor* thisx, PlayState* play) {
if ((this->actor.projectedPos.z <= 400.0f) && (this->actor.projectedPos.z > 0.0f) &&
(this->actor.floorHeight > -3000.0f)) {
if ((this->bounceX != 0) || (this->bounceZ != 0)) {
u16 dayTime = gSaveContext.dayTime;
u16 dayTime = gSaveContext.save.dayTime;
f32 shadowAlpha;
if (dayTime >= CLOCK_TIME(12, 0)) {

View file

@ -84,7 +84,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
this->unk_1CA = 0;
if (player->stateFlags2 & PLAYER_STATE2_17) {
if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) ||
if (!gSaveContext.save.info.playerData.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) ||
(((this->actor.params & 0xFF00) >> 8) &&
!(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_NOW)))) {
Audio_PlaySfxGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,

View file

@ -574,7 +574,7 @@ void func_80AAB158(EnMd* this, PlayState* play) {
trackingMode = NPC_TRACKING_HEAD_AND_TORSO;
} else {
this->interactInfo.trackPos = player->actor.world.pos;
this->interactInfo.yOffset = (gSaveContext.linkAge > 0) ? 0.0f : -18.0f;
this->interactInfo.yOffset = (gSaveContext.save.linkAge > 0) ? 0.0f : -18.0f;
}
Npc_TrackPoint(&this->actor, &this->interactInfo, 2, trackingMode);

View file

@ -202,7 +202,7 @@ void EnMm_Destroy(Actor* thisx, PlayState* play) {
s32 func_80AADA70(void) {
s32 isDay = false;
if ((gSaveContext.dayTime > CLOCK_TIME(5, 0)) && (gSaveContext.dayTime <= CLOCK_TIME(20, 0) + 1)) {
if ((gSaveContext.save.dayTime > CLOCK_TIME(5, 0)) && (gSaveContext.save.dayTime <= CLOCK_TIME(20, 0) + 1)) {
isDay = true;
}

View file

@ -124,7 +124,7 @@ void EnMs_Talk(EnMs* this, PlayState* play) {
} else if (Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0: // yes
if (gSaveContext.rupees < sPrices[BEANS_BOUGHT]) {
if (gSaveContext.save.info.playerData.rupees < sPrices[BEANS_BOUGHT]) {
Message_ContinueTextbox(play, 0x4069); // not enough rupees text
return;
}
@ -168,7 +168,7 @@ void EnMs_Update(Actor* thisx, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
this->actionFunc(this, play);
if (gSaveContext.entranceIndex == ENTR_LON_LON_RANCH_0 &&
if (gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_0 &&
gSaveContext.sceneLayer == 8) { // ride carpet if in credits
Actor_MoveXZGravity(&this->actor);
osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y);

View file

@ -161,7 +161,8 @@ void EnNiw_Init(Actor* thisx, PlayState* play) {
fabsf(this->actor.world.pos.z - sKakarikoPosList[i].z) < 40.0f) {
this->unk_2AA = i;
osSyncPrintf(VT_FGCOL(YELLOW) " 通常鶏index %d\n" VT_RST, this->unk_2AA);
if (gSaveContext.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] & sKakarikoFlagList[i]) {
if (gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] &
sKakarikoFlagList[i]) {
this->actor.world.pos.x = 300.0f;
this->actor.world.pos.y = 100.0f;
this->actor.world.pos.z = 1530.0f;

View file

@ -208,7 +208,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) {
if ((fabsf(currentCucco->actor.world.pos.x - 330.0f) < 90.0f) &&
(fabsf(currentCucco->actor.world.pos.z - 1610.0f) < 190.0f)) {
if (this->unk_26C == 0) {
gSaveContext.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] |=
gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] |=
D_80ABB3B4[currentCucco->unk_2AA];
if (BREG(1) != 0) {
// "GET inside the chicken fence!"
@ -218,7 +218,8 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) {
}
this->cuccosInPen++;
} else if (this->unk_26C == 0) {
gSaveContext.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] &= ~D_80ABB3B4[currentCucco->unk_2AA];
gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] &=
~D_80ABB3B4[currentCucco->unk_2AA];
}
}
currentCucco = (EnNiw*)currentCucco->actor.next;
@ -272,12 +273,12 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) {
this->unk_262 = TEXT_STATE_EVENT;
this->unk_26A = this->cuccosInPen;
osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更前 ☆☆ %x\n" VT_RST,
gSaveContext.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX]);
gSaveContext.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] &=
gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX]);
gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] &=
(u16) ~(INFTABLE_199_MASK | INFTABLE_19A_MASK | INFTABLE_19B_MASK | INFTABLE_19C_MASK |
INFTABLE_19D_MASK | INFTABLE_19E_MASK | INFTABLE_19F_MASK);
osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更後 ☆☆ %x\n" VT_RST,
gSaveContext.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX]);
gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX]);
osSyncPrintf("\n\n");
this->actionFunc = func_80ABA654;
return;

View file

@ -114,7 +114,7 @@ void func_80ABEF2C(EnOkarinaTag* this, PlayState* play) {
if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) {
this->actor.flags &= ~ACTOR_FLAG_0;
} else {
if ((this->ocarinaSong != 6) || (gSaveContext.scarecrowSpawnSongSet)) {
if ((this->ocarinaSong != 6) || (gSaveContext.save.info.scarecrowSpawnSongSet)) {
if (player->stateFlags2 & PLAYER_STATE2_24) {
// "North! ! ! ! !"
osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToPlayer);
@ -187,7 +187,7 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) {
Player* player = GET_PLAYER(play);
this->unk_15A++;
if ((this->ocarinaSong != 6) || (gSaveContext.scarecrowSpawnSongSet)) {
if ((this->ocarinaSong != 6) || (gSaveContext.save.info.scarecrowSpawnSongSet)) {
if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) {
this->actor.flags &= ~ACTOR_FLAG_0;
} else if (((this->type != 4) || !GET_EVENTCHKINF(EVENTCHKINF_4B)) &&

View file

@ -855,7 +855,7 @@ u8 EnOssan_CursorLeft(EnOssan* this, u8 cursorIndex, u8 shelfSlotMax) {
void EnOssan_TryPaybackMask(EnOssan* this, PlayState* play) {
s16 price = sMaskPaymentPrice[this->happyMaskShopState];
if (gSaveContext.rupees < price) {
if (gSaveContext.save.info.playerData.rupees < price) {
Message_ContinueTextbox(play, 0x70A8);
this->happyMaskShopkeeperEyeIdx = 1;
this->happyMaskShopState = OSSAN_HAPPY_STATE_ANGRY;

View file

@ -616,7 +616,7 @@ void func_80ACB274(EnOwl* this, PlayState* play) {
void EnOwl_WaitDeathMountainShortcut(EnOwl* this, PlayState* play) {
EnOwl_LookAtLink(this, play);
if (!gSaveContext.isMagicAcquired) {
if (!gSaveContext.save.info.playerData.isMagicAcquired) {
if (func_80ACA558(this, play, 0x3062)) {
Audio_PlayFanfare(NA_BGM_OWL);
this->actionFunc = func_80ACB274;

View file

@ -381,7 +381,7 @@ void EnSa_ChangeAnim(EnSa* this, s32 index) {
}
s32 func_80AF5DFC(EnSa* this, PlayState* play) {
if (gSaveContext.cutsceneIndex >= 0xFFF0 && gSaveContext.cutsceneIndex != 0xFFFD) {
if (gSaveContext.save.cutsceneIndex >= 0xFFF0 && gSaveContext.save.cutsceneIndex != 0xFFFD) {
if (play->sceneId == SCENE_KOKIRI_FOREST) {
return 4;
}

View file

@ -1529,7 +1529,8 @@ void EnSkj_WonOcarinaMiniGame(EnSkj* this, PlayState* play) {
void EnSkj_WaitToGiveReward(EnSkj* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
Actor_OfferGetItem(&this->actor, play, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
Actor_OfferGetItem(&this->actor, play,
sOcarinaGameRewards[gSaveContext.save.info.playerData.ocarinaGameRoundNum], 26.0f, 26.0f);
this->actionFunc = EnSkj_GiveOcarinaGameReward;
}
}
@ -1539,16 +1540,17 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, PlayState* play) {
this->actor.parent = NULL;
this->actionFunc = EnSkj_FinishOcarinaGameRound;
} else {
Actor_OfferGetItem(&this->actor, play, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
Actor_OfferGetItem(&this->actor, play,
sOcarinaGameRewards[gSaveContext.save.info.playerData.ocarinaGameRoundNum], 26.0f, 26.0f);
}
}
void EnSkj_FinishOcarinaGameRound(EnSkj* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
s32 ocarinaGameRoundNum = gSaveContext.ocarinaGameRoundNum;
s32 ocarinaGameRoundNum = gSaveContext.save.info.playerData.ocarinaGameRoundNum;
if (gSaveContext.ocarinaGameRoundNum < 3) {
gSaveContext.ocarinaGameRoundNum++;
if (gSaveContext.save.info.playerData.ocarinaGameRoundNum < 3) {
gSaveContext.save.info.playerData.ocarinaGameRoundNum++;
}
if (ocarinaGameRoundNum == 2) {

View file

@ -610,11 +610,11 @@ void EnSsh_Init(Actor* thisx, PlayState* play) {
frameCount = Animation_GetLastFrame(&object_ssh_Anim_000304);
if (this->actor.params == ENSSH_FATHER) {
if (gSaveContext.inventory.gsTokens >= 100) {
if (gSaveContext.save.info.inventory.gsTokens >= 100) {
Actor_Kill(&this->actor);
return;
}
} else if (gSaveContext.inventory.gsTokens >= (this->actor.params * 10)) {
} else if (gSaveContext.save.info.inventory.gsTokens >= (this->actor.params * 10)) {
Actor_Kill(&this->actor);
return;
}
@ -697,9 +697,9 @@ void EnSsh_Idle(EnSsh* this, PlayState* play) {
this->actor.textId = Text_GetFaceReaction(play, 0xD);
if (this->actor.textId == 0) {
if (this->actor.params == ENSSH_FATHER) {
if (gSaveContext.inventory.gsTokens >= 50) {
if (gSaveContext.save.info.inventory.gsTokens >= 50) {
this->actor.textId = 0x29;
} else if (gSaveContext.inventory.gsTokens >= 10) {
} else if (gSaveContext.save.info.inventory.gsTokens >= 10) {
if (GET_INFTABLE(INFTABLE_197)) {
this->actor.textId = 0x24;
} else {

View file

@ -101,13 +101,13 @@ void EnSth_Init(Actor* thisx, PlayState* play) {
osSyncPrintf(VT_FGCOL(BLUE) "金スタル屋 no = %d\n" VT_RST, params); // "Gold Skulltula Shop"
if (this->actor.params == 0) {
if (gSaveContext.inventory.gsTokens < 100) {
if (gSaveContext.save.info.inventory.gsTokens < 100) {
Actor_Kill(&this->actor);
// "Gold Skulltula Shop I still can't be a human"
osSyncPrintf("金スタル屋 まだ 人間に戻れない \n");
return;
}
} else if (gSaveContext.inventory.gsTokens < (this->actor.params * 10)) {
} else if (gSaveContext.save.info.inventory.gsTokens < (this->actor.params * 10)) {
Actor_Kill(&this->actor);
// "Gold Skulltula Shop I still can't be a human"
osSyncPrintf(VT_FGCOL(BLUE) "金スタル屋 まだ 人間に戻れない \n" VT_RST);
@ -157,7 +157,7 @@ void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) {
this->eventFlag = sEventFlags[this->actor.params];
params = &this->actor.params;
if (gSaveContext.eventChkInf[EVENTCHKINF_DA_DB_DC_DD_DE_INDEX] & this->eventFlag) {
if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_DA_DB_DC_DD_DE_INDEX] & this->eventFlag) {
EnSth_SetupAction(this, sRewardObtainedWaitActions[*params]);
} else {
EnSth_SetupAction(this, EnSth_RewardUnobtainedWait);
@ -257,7 +257,7 @@ void EnSth_GiveReward(EnSth* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
this->actor.parent = NULL;
EnSth_SetupAction(this, EnSth_RewardObtainedTalk);
gSaveContext.eventChkInf[EVENTCHKINF_DA_DB_DC_DD_DE_INDEX] |= this->eventFlag;
gSaveContext.save.info.eventChkInf[EVENTCHKINF_DA_DB_DC_DD_DE_INDEX] |= this->eventFlag;
} else {
EnSth_GivePlayerItem(this, play);
}
@ -293,7 +293,7 @@ void EnSth_ChildRewardObtainedWait(EnSth* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
EnSth_SetupAction(this, EnSth_RewardObtainedTalk);
} else {
if (gSaveContext.inventory.gsTokens < 50) {
if (gSaveContext.save.info.inventory.gsTokens < 50) {
this->actor.textId = 0x20;
} else {
this->actor.textId = 0x1F;

View file

@ -210,7 +210,7 @@ void EnSyatekiMan_Talk(EnSyatekiMan* this, PlayState* play) {
if (this->textIdx == SYATEKI_TEXT_CHOICE) {
switch (play->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees >= 20) {
if (gSaveContext.save.info.playerData.rupees >= 20) {
Rupees_ChangeBy(-20);
this->textIdx = SYATEKI_TEXT_START_GAME;
nextState = 1;

View file

@ -464,7 +464,7 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
case 6:
if (this->unk_25E == 1) {
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntranceIndex = gSaveContext.entranceIndex;
play->nextEntranceIndex = gSaveContext.save.entranceIndex;
play->shootingGalleryStatus = 0;
player->actor.freezeTimer = 20;
this->unk_25E = 0x14;

View file

@ -560,7 +560,7 @@ void EnTa_IdleAtRanch(EnTa* this, PlayState* play) {
}
s32 EnTa_CheckCanBuyMilk(void) {
if (gSaveContext.rupees < 30) {
if (gSaveContext.save.info.playerData.rupees < 30) {
return TALON_CANBUYMILK_NOT_ENOUGH_RUPEES;
} else if (!Inventory_HasEmptyBottle()) {
return TALON_CANBUYMILK_NO_EMPTY_BOTTLE;
@ -986,7 +986,7 @@ void EnTa_WaitBuyMilkOrPlayCuccoGameResponse(EnTa* this, PlayState* play) {
break;
case 1: // Play cucco game
if (gSaveContext.rupees < 10) {
if (gSaveContext.save.info.playerData.rupees < 10) {
Message_ContinueTextbox(play, 0x85);
EnTa_SetupAction(this, EnTa_TalkNotEnoughRupees, EnTa_AnimRunToEnd);
} else {
@ -1020,7 +1020,7 @@ void EnTa_WaitForPlayCuccoGameResponse(EnTa* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees < price) {
if (gSaveContext.save.info.playerData.rupees < price) {
Message_ContinueTextbox(play, 0x85);
EnTa_SetupAction(this, EnTa_TalkNotEnoughRupees, EnTa_AnimRunToEnd);
} else {

View file

@ -53,7 +53,7 @@ void EnTakaraMan_Init(Actor* thisx, PlayState* play) {
// "Bun! %x" (needs a better translation)
osSyncPrintf(VT_FGCOL(MAGENTA) "☆☆☆☆☆ ばぅん! ☆☆☆☆☆ %x\n" VT_RST, play->actorCtx.flags.chest);
play->actorCtx.flags.chest = 0;
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = -1;
gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] = -1;
SkelAnime_InitFlex(play, &this->skelAnime, &object_ts_Skel_004FE0, &object_ts_Anim_000498, this->jointTable,
this->morphTable, 10);
thisx->focus.pos = thisx->world.pos;
@ -130,7 +130,7 @@ void func_80B17934(EnTakaraMan* this, PlayState* play) {
if (this->dialogState == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0: // Yes
if (gSaveContext.rupees >= 10) {
if (gSaveContext.save.info.playerData.rupees >= 10) {
Message_CloseTextbox(play);
Rupees_ChangeBy(-10);
this->unk_214 = 1;

View file

@ -368,7 +368,7 @@ s16 EnTk_UpdateTalkState(PlayState* play, Actor* thisx) {
if (play->msgCtx.choiceIndex == 1) {
/* "Thanks a lot!" */
thisx->textId = 0x0084;
} else if (gSaveContext.rupees < 10) {
} else if (gSaveContext.save.info.playerData.rupees < 10) {
/* "You don't have enough Rupees!" */
thisx->textId = 0x0085;
} else {
@ -491,8 +491,8 @@ void EnTk_Init(Actor* thisx, PlayState* play) {
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
if (gSaveContext.dayTime <= CLOCK_TIME(18, 0) || gSaveContext.dayTime >= CLOCK_TIME(21, 0) || LINK_IS_ADULT ||
play->sceneId != SCENE_GRAVEYARD) {
if (gSaveContext.save.dayTime <= CLOCK_TIME(18, 0) || gSaveContext.save.dayTime >= CLOCK_TIME(21, 0) ||
LINK_IS_ADULT || play->sceneId != SCENE_GRAVEYARD) {
Actor_Kill(&this->actor);
return;
}

View file

@ -109,7 +109,7 @@ void EnTorch2_Init(Actor* thisx, PlayState* play2) {
this->shieldQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY;
this->shieldQuad.base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER;
this->actor.colChkInfo.damageTable = &sDamageTable;
this->actor.colChkInfo.health = gSaveContext.healthCapacity >> 3;
this->actor.colChkInfo.health = gSaveContext.save.info.playerData.healthCapacity >> 3;
this->actor.colChkInfo.cylRadius = 60;
this->actor.colChkInfo.cylHeight = 100;
play->func_11D54(this, play);
@ -156,7 +156,7 @@ s32 EnTorch2_SwingSword(PlayState* play, Input* input, Player* this) {
if ((this->speedXZ < 0.0f) || (player->speedXZ < 0.0f)) {
return 0;
}
if (gSaveContext.health < 0x50) {
if (gSaveContext.save.info.playerData.health < 0x50) {
attackDelay = 15;
noAttackChance += 0.3f;
}
@ -266,7 +266,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
* creating a hole in his defenses. This also makes Dark Link harder at low
* health, while the other health checks are intended to make him easier.
*/
if ((gSaveContext.health < 0x50) && (sCounterState != 0)) {
if ((gSaveContext.save.info.playerData.health < 0x50) && (sCounterState != 0)) {
sCounterState = 0;
sStaggerTimer = 50;
}
@ -641,7 +641,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
*/
if (this->speedXZ == -18.0f) {
staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 6;
if (gSaveContext.health < 0x50) {
if (gSaveContext.save.info.playerData.health < 0x50) {
staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 3;
}
if (this->actor.xzDistToPlayer > 80.0f) {

View file

@ -230,7 +230,7 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 200.0f && this->actor.world.pos.y <= player->actor.world.pos.y) {
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
this->actor.flags |= ACTOR_FLAG_0;
targetHeight = 40.0f + -10.0f * gSaveContext.linkAge;
targetHeight = 40.0f + -10.0f * gSaveContext.save.linkAge;
this->targetY = player->actor.world.pos.y + targetHeight;
if (this->targetY < this->actor.world.pos.y) {

View file

@ -160,7 +160,7 @@ u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, PlayState* play, u8 s
}
} else {
if (gTimeSpeed != 0) {
gSaveContext.dayTime += 20;
gSaveContext.save.dayTime += 20;
}
}
}
@ -197,7 +197,7 @@ u8 WeatherTag_CheckRestoreWeather(EnWeatherTag* this, PlayState* play, u8 skybox
ret = true;
}
} else if (gTimeSpeed != 0) {
gSaveContext.dayTime += 20;
gSaveContext.save.dayTime += 20;
}
}
return ret;

View file

@ -378,7 +378,7 @@ void EnZl4_Init(Actor* thisx, PlayState* play) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0);
this->actionFunc = EnZl4_Idle;
} else {
if (gSaveContext.entranceIndex != ENTR_CASTLE_COURTYARD_ZELDA_1) {
if (gSaveContext.save.entranceIndex != ENTR_CASTLE_COURTYARD_ZELDA_1) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_21);
this->csState = ZL4_CS_WAIT;
this->talkState = 0;

View file

@ -823,7 +823,7 @@ void Fishing_Init(Actor* thisx, PlayState* play2) {
if (KREG(5) != 0) {
sLinkAge = LINK_AGE_CHILD;
} else {
sLinkAge = gSaveContext.linkAge;
sLinkAge = gSaveContext.save.linkAge;
}
if (thisx->params < 100) {
@ -3096,12 +3096,13 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
}
if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) {
if ((gSaveContext.dayTime >= CLOCK_TIME(18, 0)) && (gSaveContext.dayTime <= CLOCK_TIME(18, 0) + 27)) {
if ((gSaveContext.save.dayTime >= CLOCK_TIME(18, 0)) &&
(gSaveContext.save.dayTime <= CLOCK_TIME(18, 0) + 27)) {
this->unk_158 = 7;
this->unk_17A[3] = (s16)Rand_ZeroFloat(150.0f) + 200;
}
if ((gSaveContext.dayTime >= CLOCK_TIME(5, 30) - 1) &&
(gSaveContext.dayTime < CLOCK_TIME(5, 30) + 27)) {
if ((gSaveContext.save.dayTime >= CLOCK_TIME(5, 30) - 1) &&
(gSaveContext.save.dayTime < CLOCK_TIME(5, 30) + 27)) {
this->unk_158 = 7;
this->unk_17A[3] = (s16)Rand_ZeroFloat(150.0f) + 200;
}
@ -3351,9 +3352,10 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
multiplier = 1.0f;
}
if ((gSaveContext.dayTime >= CLOCK_TIME(17, 0)) && (gSaveContext.dayTime < CLOCK_TIME(19, 0))) {
if ((gSaveContext.save.dayTime >= CLOCK_TIME(17, 0)) && (gSaveContext.save.dayTime < CLOCK_TIME(19, 0))) {
multiplier *= 1.75f;
} else if ((gSaveContext.dayTime >= CLOCK_TIME(5, 0)) && (gSaveContext.dayTime < CLOCK_TIME(7, 0))) {
} else if ((gSaveContext.save.dayTime >= CLOCK_TIME(5, 0)) &&
(gSaveContext.save.dayTime < CLOCK_TIME(7, 0))) {
multiplier *= 1.5f;
} else if (D_80B7E076 != 0) {
multiplier *= 1.5f;
@ -4757,7 +4759,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) {
switch (play->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees >= 20) {
if (gSaveContext.save.info.playerData.rupees >= 20) {
Rupees_ChangeBy(-20);
if (!Rumble_Controller1HasRumblePak()) {
this->actor.textId = 0x407C;
@ -5585,7 +5587,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) {
sREG(14) = 0;
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("zelda_time %x\n", ((void)0, gSaveContext.dayTime));
osSyncPrintf("zelda_time %x\n", ((void)0, gSaveContext.save.dayTime));
osSyncPrintf(VT_RST);
if (D_80B7E077 >= 2) {

View file

@ -44,7 +44,7 @@ void ObjDekujr_Init(Actor* thisx, PlayState* play) {
ObjDekujr* this = (ObjDekujr*)thisx;
s32 pad;
if (gSaveContext.cutsceneIndex < 0xFFF0) {
if (gSaveContext.save.cutsceneIndex < 0xFFF0) {
if (!LINK_IS_ADULT) {
Actor_Kill(thisx);
return;
@ -140,7 +140,7 @@ void ObjDekujr_Update(Actor* thisx, PlayState* play) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (this->unk_19B == 0)) {
if ((gSaveContext.save.cutsceneIndex >= 0xFFF0) && (this->unk_19B == 0)) {
this->unk_19C = 0;
this->unk_19B = 1;
}

View file

@ -132,22 +132,22 @@ void ObjectKankyo_Init(Actor* thisx, PlayState* play) {
}
if (gSaveContext.cutsceneTrigger != 0) {
if (gSaveContext.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_2) {
if (gSaveContext.save.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_2) {
this->effects[0].size = 0.1f;
}
if (gSaveContext.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_3) {
if (gSaveContext.save.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_3) {
this->effects[1].size = 0.1f;
}
if (gSaveContext.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_4) {
if (gSaveContext.save.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_4) {
this->effects[2].size = 0.1f;
}
if (gSaveContext.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_5) {
if (gSaveContext.save.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_5) {
this->effects[3].size = 0.1f;
}
if (gSaveContext.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_6) {
if (gSaveContext.save.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_6) {
this->effects[4].size = 0.1f;
}
if (gSaveContext.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_7) {
if (gSaveContext.save.entranceIndex == ENTR_INSIDE_GANONS_CASTLE_7) {
this->effects[5].size = 0.1f;
}
}
@ -227,7 +227,7 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, PlayState* play) {
}
if (play->envCtx.precipitation[PRECIP_SNOW_MAX] < 64 &&
(gSaveContext.entranceIndex != ENTR_KOKIRI_FOREST_0 || gSaveContext.sceneLayer != 4 ||
(gSaveContext.save.entranceIndex != ENTR_KOKIRI_FOREST_0 || gSaveContext.sceneLayer != 4 ||
play->envCtx.precipitation[PRECIP_SNOW_MAX])) {
play->envCtx.precipitation[PRECIP_SNOW_MAX] += 16;
}

View file

@ -186,8 +186,8 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) {
}
Actor_Kill(&this->actor);
} else {
if (!(this->actor.xzDistToPlayer > 120.0f) && gSaveContext.dayTime >= CLOCK_TIME(6, 30) &&
gSaveContext.dayTime < CLOCK_TIME(7, 30)) {
if (!(this->actor.xzDistToPlayer > 120.0f) && gSaveContext.save.dayTime >= CLOCK_TIME(6, 30) &&
gSaveContext.save.dayTime < CLOCK_TIME(7, 30)) {
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + play->envCtx.sunPos.x * (1.0f / 6.0f);
cylinderPos.y =
player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f + play->envCtx.sunPos.y * (1.0f / 6.0f);

View file

@ -2205,7 +2205,8 @@ void func_80833A20(Player* this, s32 newMeleeWeaponState) {
u16 voiceSfx;
if (this->meleeWeaponState == 0) {
if ((this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) && (gSaveContext.swordHealth > 0.0f)) {
if ((this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) &&
(gSaveContext.save.info.playerData.swordHealth > 0.0f)) {
itemSfx = NA_SE_IT_HAMMER_SWING;
} else {
itemSfx = NA_SE_IT_SWORD_SWING;
@ -2402,9 +2403,10 @@ void func_808340DC(Player* this, PlayState* play) {
void func_80834298(Player* this, PlayState* play) {
if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & PLAYER_STATE1_8) &&
((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_22)) &&
(gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csMode == PLAYER_CSMODE_NONE) &&
(play->shootingGalleryStatus == 0) && (play->activeCamId == CAM_ID_MAIN) &&
(play->transitionTrigger != TRANS_TRIGGER_START) && (gSaveContext.timerState != TIMER_STATE_STOP)) {
(gSaveContext.save.info.playerData.health != 0) && (play->csCtx.state == CS_STATE_IDLE) &&
(this->csMode == PLAYER_CSMODE_NONE) && (play->shootingGalleryStatus == 0) &&
(play->activeCamId == CAM_ID_MAIN) && (play->transitionTrigger != TRANS_TRIGGER_START) &&
(gSaveContext.timerState != TIMER_STATE_STOP)) {
func_80833DF8(this, play);
}
@ -2936,7 +2938,7 @@ s32 func_808356E8(Player* this, PlayState* play) {
}
void func_808357E8(Player* this, Gfx** dLists) {
this->leftHandDLists = dLists + gSaveContext.linkAge;
this->leftHandDLists = dLists + gSaveContext.save.linkAge;
}
s32 func_80835800(Player* this, PlayState* play) {
@ -3168,7 +3170,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) {
} else if ((temp = Player_ActionToMagicSpell(this, itemAction)) >= 0) {
if (((itemAction == PLAYER_IA_FARORES_WIND) && (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0)) ||
((gSaveContext.magicCapacity != 0) && (gSaveContext.magicState == MAGIC_STATE_IDLE) &&
(gSaveContext.magic >= sMagicSpellCosts[temp]))) {
(gSaveContext.save.info.playerData.magic >= sMagicSpellCosts[temp]))) {
this->itemAction = itemAction;
this->unk_6AD = 4;
} else {
@ -5694,7 +5696,8 @@ s32 func_8083C544(Player* this, PlayState* play) {
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) {
if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld(this) != 0) && (this->unk_844 == 1) &&
(this->heldItemAction != PLAYER_IA_DEKU_STICK)) {
if ((this->heldItemAction != PLAYER_IA_SWORD_BIGGORON) || (gSaveContext.swordHealth > 0.0f)) {
if ((this->heldItemAction != PLAYER_IA_SWORD_BIGGORON) ||
(gSaveContext.save.info.playerData.swordHealth > 0.0f)) {
func_808377DC(play, this);
return 1;
}
@ -8007,8 +8010,8 @@ s32 func_80842AC4(PlayState* play, Player* this) {
s32 func_80842B7C(PlayState* play, Player* this) {
if (this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) {
if (!gSaveContext.bgsFlag && (gSaveContext.swordHealth > 0.0f)) {
if ((gSaveContext.swordHealth -= 1.0f) <= 0.0f) {
if (!gSaveContext.save.info.playerData.bgsFlag && (gSaveContext.save.info.playerData.swordHealth > 0.0f)) {
if ((gSaveContext.save.info.playerData.swordHealth -= 1.0f) <= 0.0f) {
EffectSsStick_Spawn(play, &this->bodyPartsPos[PLAYER_BODYPART_R_HAND],
this->actor.shape.rot.y + 0x8000);
func_800849EC(play);
@ -9496,7 +9499,7 @@ void func_80846660(PlayState* play, Player* this) {
static u8 D_808546F0[] = { ITEM_SWORD_MASTER, ITEM_SWORD_KOKIRI };
void func_80846720(PlayState* play, Player* this, s32 arg2) {
s32 item = D_808546F0[(void)0, gSaveContext.linkAge];
s32 item = D_808546F0[(void)0, gSaveContext.save.linkAge];
s32 itemAction = sItemActions[item];
func_80835EFC(this);
@ -9577,7 +9580,7 @@ static EffectBlureInit2 D_8085470C = {
static Vec3s D_80854730 = { -57, 3377, 0 };
void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHeader) {
this->ageProperties = &sAgeProperties[gSaveContext.linkAge];
this->ageProperties = &sAgeProperties[gSaveContext.save.linkAge];
Actor_ProcessInitChain(&this->actor, sInitChain);
this->meleeWeaponEffectIndex = TOTAL_EFFECT_COUNT;
this->yaw = this->actor.world.rot.y;
@ -9647,14 +9650,14 @@ void Player_Init(Actor* thisx, PlayState* play2) {
play->talkWithPlayer = func_80853148;
thisx->room = -1;
this->ageProperties = &sAgeProperties[gSaveContext.linkAge];
this->ageProperties = &sAgeProperties[gSaveContext.save.linkAge];
this->itemAction = this->heldItemAction = -1;
this->heldItemId = ITEM_NONE;
func_80835F44(play, this, ITEM_NONE);
Player_SetEquipmentData(play, this);
this->prevBoots = this->currentBoots;
Player_InitCommon(this, play, gPlayerSkelHeaders[((void)0, gSaveContext.linkAge)]);
Player_InitCommon(this, play, gPlayerSkelHeaders[((void)0, gSaveContext.save.linkAge)]);
this->giObjectSegment = (void*)(((uintptr_t)ZeldaArena_MallocDebug(0x3008, "../z_player.c", 17175) + 8) & ~0xF);
respawnFlag = gSaveContext.respawnFlag;
@ -9688,7 +9691,7 @@ void Player_Init(Actor* thisx, PlayState* play2) {
titleFileSize = scene->titleFile.vromEnd - scene->titleFile.vromStart;
if ((titleFileSize != 0) && gSaveContext.showTitleCard) {
if (!IS_CUTSCENE_LAYER &&
(gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].field &
(gEntranceTable[((void)0, gSaveContext.save.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].field &
ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG) &&
((play->sceneId != SCENE_DODONGOS_CAVERN) || GET_EVENTCHKINF(EVENTCHKINF_B0)) &&
((play->sceneId != SCENE_BOMBCHU_SHOP) || GET_EVENTCHKINF(EVENTCHKINF_25))) {
@ -9705,12 +9708,12 @@ void Player_Init(Actor* thisx, PlayState* play2) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1;
if (play->sceneId <= SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) {
gSaveContext.infTable[INFTABLE_1AX_INDEX] |= gBitFlags[play->sceneId];
gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] |= gBitFlags[play->sceneId];
}
initMode = (thisx->params & 0xF00) >> 8;
if ((initMode == 5) || (initMode == 6)) {
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
if (gSaveContext.save.cutsceneIndex >= 0xFFF0) {
initMode = 13;
}
}
@ -10706,7 +10709,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
if (!Player_InBlockingCsMode(play, this) && !(this->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
func_8083D53C(play, this);
if ((this->actor.category == ACTORCAT_PLAYER) && (gSaveContext.health == 0)) {
if ((this->actor.category == ACTORCAT_PLAYER) && (gSaveContext.save.info.playerData.health == 0)) {
if (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21)) {
func_80832440(play, this);
func_80837B9C(this, play);
@ -11136,7 +11139,7 @@ void Player_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
gSaveContext.linkAge = play->linkAgeOnLoad;
gSaveContext.save.linkAge = play->linkAgeOnLoad;
}
s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) {
@ -12169,10 +12172,10 @@ void func_8084D3E4(Player* this, PlayState* play) {
AREG(6) = 0;
if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) {
gSaveContext.horseData.pos.x = rideActor->actor.world.pos.x;
gSaveContext.horseData.pos.y = rideActor->actor.world.pos.y;
gSaveContext.horseData.pos.z = rideActor->actor.world.pos.z;
gSaveContext.horseData.angle = rideActor->actor.shape.rot.y;
gSaveContext.save.info.horseData.pos.x = rideActor->actor.world.pos.x;
gSaveContext.save.info.horseData.pos.y = rideActor->actor.world.pos.y;
gSaveContext.save.info.horseData.pos.z = rideActor->actor.world.pos.z;
gSaveContext.save.info.horseData.angle = rideActor->actor.shape.rot.y;
}
} else {
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_NORMAL0);
@ -12459,7 +12462,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) {
} else {
if ((this->getItemId == GI_HEART_CONTAINER_2) || (this->getItemId == GI_HEART_CONTAINER) ||
((this->getItemId == GI_HEART_PIECE) &&
((gSaveContext.inventory.questItems & 0xF0000000) == (4 << QUEST_HEART_PIECE_COUNT)))) {
((gSaveContext.save.info.inventory.questItems & 0xF0000000) == (4 << QUEST_HEART_PIECE_COUNT)))) {
temp1 = NA_BGM_HEART_GET | 0x900;
} else {
temp1 = temp2 = (this->getItemId == GI_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900;
@ -12732,7 +12735,7 @@ void func_8084EAC0(Player* this, PlayState* play) {
rand = 3;
}
if ((rand < 0) && (gSaveContext.health <= 0x10)) {
if ((rand < 0) && (gSaveContext.save.info.playerData.health <= 0x10)) {
rand = 3;
}
@ -13443,7 +13446,7 @@ void func_8085063C(Player* this, PlayState* play) {
if (play->msgCtx.choiceIndex == 1) {
gSaveContext.respawn[RESPAWN_MODE_TOP].data = -respawnData;
gSaveContext.fw.set = 0;
gSaveContext.save.info.fw.set = 0;
func_80078914(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, NA_SE_PL_MAGIC_WIND_VANISH);
}
@ -13545,16 +13548,16 @@ void func_808507F4(Player* this, PlayState* play) {
if (this->unk_850 == 0) {
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 1;
Play_SetupRespawnPoint(play, RESPAWN_MODE_TOP, 0x6FF);
gSaveContext.fw.set = 1;
gSaveContext.fw.pos.x = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x;
gSaveContext.fw.pos.y = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.y;
gSaveContext.fw.pos.z = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.z;
gSaveContext.fw.yaw = gSaveContext.respawn[RESPAWN_MODE_DOWN].yaw;
gSaveContext.fw.playerParams = 0x6FF;
gSaveContext.fw.entranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
gSaveContext.fw.roomIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].roomIndex;
gSaveContext.fw.tempSwchFlags = gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags;
gSaveContext.fw.tempCollectFlags = gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags;
gSaveContext.save.info.fw.set = 1;
gSaveContext.save.info.fw.pos.x = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x;
gSaveContext.save.info.fw.pos.y = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.y;
gSaveContext.save.info.fw.pos.z = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.z;
gSaveContext.save.info.fw.yaw = gSaveContext.respawn[RESPAWN_MODE_DOWN].yaw;
gSaveContext.save.info.fw.playerParams = 0x6FF;
gSaveContext.save.info.fw.entranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
gSaveContext.save.info.fw.roomIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].roomIndex;
gSaveContext.save.info.fw.tempSwchFlags = gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags;
gSaveContext.save.info.fw.tempCollectFlags = gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags;
this->unk_850 = 2;
}
} else if (this->unk_84F >= 0) {
@ -14207,7 +14210,7 @@ void func_80851A50(PlayState* play, Player* this, CsCmdActorCue* cue) {
if ((LINK_IS_ADULT && LinkAnimation_OnFrame(&this->skelAnime, 70.0f)) ||
(!LINK_IS_ADULT && LinkAnimation_OnFrame(&this->skelAnime, 87.0f))) {
sp2C = &D_808551A4[gSaveContext.linkAge];
sp2C = &D_808551A4[gSaveContext.save.linkAge];
this->interactRangeActor->parent = &this->actor;
if (!LINK_IS_ADULT) {
@ -14215,7 +14218,7 @@ void func_80851A50(PlayState* play, Player* this, CsCmdActorCue* cue) {
} else {
dLists = gPlayerLeftHandClosedDLs;
}
this->leftHandDLists = dLists + gSaveContext.linkAge;
this->leftHandDLists = dLists + gSaveContext.save.linkAge;
Player_PlaySfx(this, sp2C->unk_00);
if (!LINK_IS_ADULT) {
@ -14529,7 +14532,7 @@ void func_80852648(PlayState* play, Player* this, CsCmdActorCue* cue) {
this->modelGroup = this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_IA_NONE);
this->leftHandDLists = gPlayerLeftHandOpenDLs;
Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_MASTER);
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER;
gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_MASTER;
Inventory_DeleteEquipment(play, EQUIP_TYPE_SWORD);
}
}
@ -14548,7 +14551,7 @@ void func_808526EC(PlayState* play, Player* this, CsCmdActorCue* cue) {
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
static Color_RGBA8 primColor = { 255, 255, 255, 0 };
static Color_RGBA8 envColor = { 0, 128, 128, 0 };
s32 linkAge = gSaveContext.linkAge;
s32 linkAge = gSaveContext.save.linkAge;
Vec3f sparklePos;
Vec3f sp34;
Vec3s* ptr;
@ -14560,7 +14563,7 @@ void func_808526EC(PlayState* play, Player* this, CsCmdActorCue* cue) {
return;
}
ptr = D_80855210[gSaveContext.linkAge];
ptr = D_80855210[gSaveContext.save.linkAge];
sp34.x = ptr[0].x + Rand_CenteredFloat(ptr[1].x);
sp34.y = ptr[0].y + Rand_CenteredFloat(ptr[1].y);

View file

@ -30,7 +30,7 @@ u32 EffectSsStick_Init(PlayState* play, u32 index, EffectSs* this, void* initPar
{ OBJECT_LINK_BOY, gLinkAdultBrokenGiantsKnifeBladeDL }, // adult, broken sword
{ OBJECT_LINK_CHILD, gLinkChildLinkDekuStickDL }, // child, broken stick
};
StickDrawInfo* ageInfoEntry = gSaveContext.linkAge + drawInfo;
StickDrawInfo* ageInfoEntry = gSaveContext.save.linkAge + drawInfo;
EffectSsStickInitParams* initParams = (EffectSsStickInitParams*)initParamsx;
this->rObjBankIdx = Object_GetIndex(&play->objectCtx, ageInfoEntry->objectID);

View file

@ -6,7 +6,7 @@
#include "global.h"
#define GET_NEWF(sramCtx, slotNum, index) (sramCtx->readBuff[gSramSlotOffsets[slotNum] + offsetof(SaveContext, newf[index])])
#define GET_NEWF(sramCtx, slotNum, index) (sramCtx->readBuff[gSramSlotOffsets[slotNum] + offsetof(SaveContext, save.info.playerData.newf[index])])
#define SLOT_OCCUPIED(sramCtx, slotNum) \
((GET_NEWF(sramCtx, slotNum, 0) == 'Z') || \

View file

@ -1490,26 +1490,28 @@ void FileSelect_LoadGame(GameState* thisx) {
gSaveContext.hudVisibilityModeTimer = gSaveContext.magicCapacity = 0; // false, HUD_VISIBILITY_NO_CHANGE
// Set the fill target to be the saved magic amount
gSaveContext.magicFillTarget = gSaveContext.magic;
gSaveContext.magicFillTarget = gSaveContext.save.info.playerData.magic;
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing to respectively the full
// capacity and `magicFillTarget`
gSaveContext.magicLevel = gSaveContext.magic = 0;
gSaveContext.save.info.playerData.magicLevel = gSaveContext.save.info.playerData.magic = 0;
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.magicFillTarget), gSaveContext.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.magicFillTarget),
gSaveContext.save.info.playerData.magic);
osSyncPrintf(VT_RST);
gSaveContext.naviTimer = 0;
gSaveContext.save.info.playerData.naviTimer = 0;
if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) &&
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) &&
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BIGGORON) &&
(gSaveContext.equips.buttonItems[0] != ITEM_GIANTS_KNIFE)) {
if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) &&
(gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_MASTER) &&
(gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_BIGGORON) &&
(gSaveContext.save.info.equips.buttonItems[0] != ITEM_GIANTS_KNIFE)) {
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
swordEquipValue = (gEquipMasks[EQUIP_TYPE_SWORD] & gSaveContext.equips.equipment) >> (EQUIP_TYPE_SWORD * 4);
gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD];
gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1);
gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE;
swordEquipValue =
(gEquipMasks[EQUIP_TYPE_SWORD] & gSaveContext.save.info.equips.equipment) >> (EQUIP_TYPE_SWORD * 4);
gSaveContext.save.info.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD];
gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1);
}
}
@ -1827,7 +1829,7 @@ void FileSelect_InitContext(GameState* thisx) {
Letterbox_SetSizeTarget(0);
gSaveContext.skyboxTime = CLOCK_TIME(0, 0);
gSaveContext.dayTime = CLOCK_TIME(0, 0);
gSaveContext.save.dayTime = CLOCK_TIME(0, 0);
Skybox_Init(&this->state, &this->skyboxCtx, SKYBOX_NORMAL_SKY);

View file

@ -377,9 +377,9 @@ void FileSelect_CopyConfirm(GameState* thisx) {
Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) {
dayTime = gSaveContext.dayTime;
dayTime = gSaveContext.save.dayTime;
Sram_CopySave(this, sramCtx);
gSaveContext.dayTime = dayTime;
gSaveContext.save.dayTime = dayTime;
this->fileInfoAlpha[this->copyDestFileIndex] = this->nameAlpha[this->copyDestFileIndex] = 0;
this->nextTitleLabel = FS_TITLE_COPY_COMPLETE;
this->actionTimer = 8;

View file

@ -438,9 +438,9 @@ void FileSelect_DrawNameEntry(GameState* thisx) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
gSaveContext.fileNum = this->buttonIndex;
dayTime = ((void)0, gSaveContext.dayTime);
dayTime = ((void)0, gSaveContext.save.dayTime);
Sram_InitSave(this, &this->sramCtx);
gSaveContext.dayTime = dayTime;
gSaveContext.save.dayTime = dayTime;
this->configMode = CM_NAME_ENTRY_TO_MAIN;
this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200;
this->connectorAlpha[this->buttonIndex] = 255;

View file

@ -9,9 +9,9 @@
void TitleSetup_SetupTitleScreen(TitleSetupState* this) {
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
this->state.running = false;
gSaveContext.linkAge = LINK_AGE_ADULT;
gSaveContext.save.linkAge = LINK_AGE_ADULT;
Sram_InitDebugSave();
gSaveContext.cutsceneIndex = 0xFFF3;
gSaveContext.save.cutsceneIndex = 0xFFF3;
gSaveContext.sceneLayer = 7;
SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState);
}

View file

@ -21,18 +21,18 @@ void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex) {
if (gSaveContext.fileNum == 0xFF) {
Sram_InitDebugSave();
// Set the fill target to be the saved magic amount
gSaveContext.magicFillTarget = gSaveContext.magic;
gSaveContext.magicFillTarget = gSaveContext.save.info.playerData.magic;
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing
// to respectively the full capacity and `magicFillTarget`
gSaveContext.magicCapacity = 0;
gSaveContext.magicLevel = gSaveContext.magic = 0;
gSaveContext.save.info.playerData.magicLevel = gSaveContext.save.info.playerData.magic = 0;
}
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode =
gSaveContext.hudVisibilityModeTimer = 0; // false, HUD_VISIBILITY_NO_CHANGE
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
gSaveContext.entranceIndex = entranceIndex;
gSaveContext.save.entranceIndex = entranceIndex;
gSaveContext.respawnFlag = 0;
gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = ENTR_LOAD_OPENING;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
@ -302,73 +302,73 @@ void MapSelect_UpdateMenu(MapSelectState* this) {
if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
gSaveContext.linkAge = LINK_AGE_CHILD;
gSaveContext.save.linkAge = LINK_AGE_CHILD;
} else {
gSaveContext.linkAge = LINK_AGE_ADULT;
gSaveContext.save.linkAge = LINK_AGE_ADULT;
}
}
if (CHECK_BTN_ALL(input->press.button, BTN_Z)) {
if (gSaveContext.cutsceneIndex == 0x8000) {
gSaveContext.cutsceneIndex = 0;
} else if (gSaveContext.cutsceneIndex == 0) {
gSaveContext.cutsceneIndex = 0xFFF0;
} else if (gSaveContext.cutsceneIndex == 0xFFF0) {
gSaveContext.cutsceneIndex = 0xFFF1;
} else if (gSaveContext.cutsceneIndex == 0xFFF1) {
gSaveContext.cutsceneIndex = 0xFFF2;
} else if (gSaveContext.cutsceneIndex == 0xFFF2) {
gSaveContext.cutsceneIndex = 0xFFF3;
} else if (gSaveContext.cutsceneIndex == 0xFFF3) {
gSaveContext.cutsceneIndex = 0xFFF4;
} else if (gSaveContext.cutsceneIndex == 0xFFF4) {
gSaveContext.cutsceneIndex = 0xFFF5;
} else if (gSaveContext.cutsceneIndex == 0xFFF5) {
gSaveContext.cutsceneIndex = 0xFFF6;
} else if (gSaveContext.cutsceneIndex == 0xFFF6) {
gSaveContext.cutsceneIndex = 0xFFF7;
} else if (gSaveContext.cutsceneIndex == 0xFFF7) {
gSaveContext.cutsceneIndex = 0xFFF8;
} else if (gSaveContext.cutsceneIndex == 0xFFF8) {
gSaveContext.cutsceneIndex = 0xFFF9;
} else if (gSaveContext.cutsceneIndex == 0xFFF9) {
gSaveContext.cutsceneIndex = 0xFFFA;
} else if (gSaveContext.cutsceneIndex == 0xFFFA) {
gSaveContext.cutsceneIndex = 0x8000;
if (gSaveContext.save.cutsceneIndex == 0x8000) {
gSaveContext.save.cutsceneIndex = 0;
} else if (gSaveContext.save.cutsceneIndex == 0) {
gSaveContext.save.cutsceneIndex = 0xFFF0;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF0) {
gSaveContext.save.cutsceneIndex = 0xFFF1;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF1) {
gSaveContext.save.cutsceneIndex = 0xFFF2;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF2) {
gSaveContext.save.cutsceneIndex = 0xFFF3;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF3) {
gSaveContext.save.cutsceneIndex = 0xFFF4;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF4) {
gSaveContext.save.cutsceneIndex = 0xFFF5;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF5) {
gSaveContext.save.cutsceneIndex = 0xFFF6;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF6) {
gSaveContext.save.cutsceneIndex = 0xFFF7;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF7) {
gSaveContext.save.cutsceneIndex = 0xFFF8;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF8) {
gSaveContext.save.cutsceneIndex = 0xFFF9;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF9) {
gSaveContext.save.cutsceneIndex = 0xFFFA;
} else if (gSaveContext.save.cutsceneIndex == 0xFFFA) {
gSaveContext.save.cutsceneIndex = 0x8000;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_R)) {
if (gSaveContext.cutsceneIndex == 0x8000) {
gSaveContext.cutsceneIndex = 0xFFFA;
} else if (gSaveContext.cutsceneIndex == 0) {
gSaveContext.cutsceneIndex = 0x8000;
} else if (gSaveContext.cutsceneIndex == 0xFFF0) {
gSaveContext.cutsceneIndex = 0;
} else if (gSaveContext.cutsceneIndex == 0xFFF1) {
gSaveContext.cutsceneIndex = 0xFFF0;
} else if (gSaveContext.cutsceneIndex == 0xFFF2) {
gSaveContext.cutsceneIndex = 0xFFF1;
} else if (gSaveContext.cutsceneIndex == 0xFFF3) {
gSaveContext.cutsceneIndex = 0xFFF2;
} else if (gSaveContext.cutsceneIndex == 0xFFF4) {
gSaveContext.cutsceneIndex = 0xFFF3;
} else if (gSaveContext.cutsceneIndex == 0xFFF5) {
gSaveContext.cutsceneIndex = 0xFFF4;
} else if (gSaveContext.cutsceneIndex == 0xFFF6) {
gSaveContext.cutsceneIndex = 0xFFF5;
} else if (gSaveContext.cutsceneIndex == 0xFFF7) {
gSaveContext.cutsceneIndex = 0xFFF6;
} else if (gSaveContext.cutsceneIndex == 0xFFF8) {
gSaveContext.cutsceneIndex = 0xFFF7;
} else if (gSaveContext.cutsceneIndex == 0xFFF9) {
gSaveContext.cutsceneIndex = 0xFFF8;
} else if (gSaveContext.cutsceneIndex == 0xFFFA) {
gSaveContext.cutsceneIndex = 0xFFF9;
if (gSaveContext.save.cutsceneIndex == 0x8000) {
gSaveContext.save.cutsceneIndex = 0xFFFA;
} else if (gSaveContext.save.cutsceneIndex == 0) {
gSaveContext.save.cutsceneIndex = 0x8000;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF0) {
gSaveContext.save.cutsceneIndex = 0;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF1) {
gSaveContext.save.cutsceneIndex = 0xFFF0;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF2) {
gSaveContext.save.cutsceneIndex = 0xFFF1;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF3) {
gSaveContext.save.cutsceneIndex = 0xFFF2;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF4) {
gSaveContext.save.cutsceneIndex = 0xFFF3;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF5) {
gSaveContext.save.cutsceneIndex = 0xFFF4;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF6) {
gSaveContext.save.cutsceneIndex = 0xFFF5;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF7) {
gSaveContext.save.cutsceneIndex = 0xFFF6;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF8) {
gSaveContext.save.cutsceneIndex = 0xFFF7;
} else if (gSaveContext.save.cutsceneIndex == 0xFFF9) {
gSaveContext.save.cutsceneIndex = 0xFFF8;
} else if (gSaveContext.save.cutsceneIndex == 0xFFFA) {
gSaveContext.save.cutsceneIndex = 0xFFF9;
}
}
gSaveContext.nightFlag = 0;
if (gSaveContext.cutsceneIndex == 0) {
gSaveContext.nightFlag = 1;
gSaveContext.save.nightFlag = 0;
if (gSaveContext.save.cutsceneIndex == 0) {
gSaveContext.save.nightFlag = 1;
}
// user can change "opt", but it doesn't do anything
@ -583,16 +583,16 @@ void MapSelect_PrintCutsceneSetting(MapSelectState* this, GfxPrint* printer, u16
switch (csIndex) {
case 0:
label = GFXP_HIRAGANA " ヨル " GFXP_KATAKANA "ゴロン";
gSaveContext.dayTime = CLOCK_TIME(0, 0);
gSaveContext.save.dayTime = CLOCK_TIME(0, 0);
break;
case 0x8000:
// clang-format off
gSaveContext.dayTime = CLOCK_TIME(12, 0); label = GFXP_HIRAGANA "オヒル " GFXP_KATAKANA "ジャラ";
gSaveContext.save.dayTime = CLOCK_TIME(12, 0); label = GFXP_HIRAGANA "オヒル " GFXP_KATAKANA "ジャラ";
// clang-format on
break;
case 0xFFF0:
// clang-format off
gSaveContext.dayTime = CLOCK_TIME(12, 0); label = "デモ00";
gSaveContext.save.dayTime = CLOCK_TIME(12, 0); label = "デモ00";
// clang-format on
break;
case 0xFFF1:
@ -627,7 +627,7 @@ void MapSelect_PrintCutsceneSetting(MapSelectState* this, GfxPrint* printer, u16
break;
};
gSaveContext.skyboxTime = gSaveContext.dayTime;
gSaveContext.skyboxTime = gSaveContext.save.dayTime;
GfxPrint_Printf(printer, "Stage:" GFXP_KATAKANA "%s", label);
}
@ -647,8 +647,8 @@ void MapSelect_DrawMenu(MapSelectState* this) {
GfxPrint_Init(printer);
GfxPrint_Open(printer, POLY_OPA_DISP);
MapSelect_PrintMenu(this, printer);
MapSelect_PrintAgeSetting(this, printer, ((void)0, gSaveContext.linkAge));
MapSelect_PrintCutsceneSetting(this, printer, ((void)0, gSaveContext.cutsceneIndex));
MapSelect_PrintAgeSetting(this, printer, ((void)0, gSaveContext.save.linkAge));
MapSelect_PrintCutsceneSetting(this, printer, ((void)0, gSaveContext.save.cutsceneIndex));
POLY_OPA_DISP = GfxPrint_Close(printer);
GfxPrint_Destroy(printer);
@ -751,6 +751,6 @@ void MapSelect_Init(GameState* thisx) {
this->staticSegment = GameState_Alloc(&this->state, size, "../z_select.c", 1114);
DmaMgr_RequestSyncDebug(this->staticSegment, (uintptr_t)_z_select_staticSegmentRomStart, size, "../z_select.c",
1115);
gSaveContext.cutsceneIndex = 0x8000;
gSaveContext.linkAge = LINK_AGE_CHILD;
gSaveContext.save.cutsceneIndex = 0x8000;
gSaveContext.save.linkAge = LINK_AGE_CHILD;
}

View file

@ -162,13 +162,13 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
0x18);
}
} else {
if ((gSaveContext.inventory.questItems & 0xF0000000) != 0) {
if ((gSaveContext.save.info.inventory.questItems & 0xF0000000) != 0) {
cursorItem = ITEM_HEART_CONTAINER;
} else {
cursorItem = PAUSE_ITEM_NONE;
}
osSyncPrintf("888 ccc=%d (%d, %d, %x)\n", cursorItem, pauseCtx->cursorPoint[PAUSE_QUEST],
ITEM_HEART_CONTAINER, gSaveContext.inventory.questItems & 0xF0000000);
ITEM_HEART_CONTAINER, gSaveContext.save.info.inventory.questItems & 0xF0000000);
}
sp216 = pauseCtx->cursorPoint[PAUSE_QUEST];
@ -439,7 +439,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
}
if ((gSaveContext.inventory.questItems >> QUEST_HEART_PIECE_COUNT) != 0) {
if ((gSaveContext.save.info.inventory.questItems >> QUEST_HEART_PIECE_COUNT) != 0) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
@ -457,7 +457,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(
POLY_OPA_DISP,
gItemIcons[ITEM_HEART_PIECE_2 - 1 +
(((gSaveContext.inventory.questItems & 0xF0000000) & 0xF0000000) >> QUEST_HEART_PIECE_COUNT)],
(((gSaveContext.save.info.inventory.questItems & 0xF0000000) & 0xF0000000) >>
QUEST_HEART_PIECE_COUNT)],
48, 48, 0);
}
@ -633,7 +634,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0);
sp208[0] = sp208[1] = 0;
sp208[2] = gSaveContext.inventory.gsTokens;
sp208[2] = gSaveContext.save.info.inventory.gsTokens;
while (sp208[2] >= 100) {
sp208[0]++;
@ -650,7 +651,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
for (phi_s3 = 0, sp218 = 0, sp21A = 0; phi_s3 < 2; phi_s3++) {
if (phi_s3 == 0) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, pauseCtx->alpha);
} else if (gSaveContext.inventory.gsTokens == 100) {
} else if (gSaveContext.save.info.inventory.gsTokens == 100) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 200, 50, 50, pauseCtx->alpha);
} else {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);

View file

@ -138,14 +138,14 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0);
// Current Health Quarter (X / 4)
KaleidoScope_DrawDigit(play, (gSaveContext.health % 0x10) / 4, 194, 15);
KaleidoScope_DrawDigit(play, (gSaveContext.save.info.playerData.health % 0x10) / 4, 194, 15);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
// Rupees
spD8[0] = spD8[1] = spD8[2] = 0;
spD8[3] = gSaveContext.rupees;
spD8[3] = gSaveContext.save.info.playerData.rupees;
while (spD8[3] >= 1000) {
spD8[0]++;
spD8[3] -= 1000;
@ -167,7 +167,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
// Health capacity
spD8[2] = 0;
spD8[3] = gSaveContext.healthCapacity / 0x10;
spD8[3] = gSaveContext.save.info.playerData.healthCapacity / 0x10;
while (spD8[3] >= 10) {
spD8[2]++;
spD8[3] -= 10;
@ -178,7 +178,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
// Health
spD8[2] = 0;
spD8[3] = gSaveContext.health / 0x10;
spD8[3] = gSaveContext.save.info.playerData.health / 0x10;
while (spD8[3] >= 10) {
spD8[2]++;
spD8[3] -= 10;
@ -195,9 +195,9 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
if ((slot <= SLOT_BOW) || (slot == SLOT_SLINGSHOT) || (slot == SLOT_BOMBCHU) || (slot == SLOT_MAGIC_BEAN)) {
spD8[3] = AMMO(gAmmoItems[slot]);
} else if (slot == SLOT_OCARINA) {
spD8[3] = gSaveContext.inventory.items[slot];
spD8[3] = gSaveContext.save.info.inventory.items[slot];
} else {
spD8[3] = gSaveContext.inventory.items[slot];
spD8[3] = gSaveContext.save.info.inventory.items[slot];
}
if (spD8[3] != ITEM_NONE) {
@ -218,7 +218,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
for (spD8[1] = 78, i = 0; i < 17; i++) {
spD8[2] = 0;
if ((spD8[3] = gSaveContext.inventory.dungeonKeys[i]) >= 0) {
if ((spD8[3] = gSaveContext.save.info.inventory.dungeonKeys[i]) >= 0) {
while (spD8[3] >= 10) {
spD8[2]++;
spD8[3] -= 10;
@ -243,7 +243,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
// Dungeon Items
for (spD8[1] = 78, i = 0; i < 12; i++, spD8[1] += 12) {
spD8[2] = gSaveContext.inventory.dungeonItems[i] & gEquipMasks[0];
spD8[2] = gSaveContext.save.info.inventory.dungeonItems[i] & gEquipMasks[0];
KaleidoScope_DrawDigit(play, spD8[2], spD8[1], 132);
}
@ -284,7 +284,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
}
// GS Tokens
spD8[3] = gSaveContext.inventory.gsTokens;
spD8[3] = gSaveContext.save.info.inventory.gsTokens;
spD8[1] = 0;
spD8[2] = 0;
while (spD8[3] >= 100) {
@ -303,7 +303,8 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
// Heart Pieces (X / 4)
KaleidoScope_DrawDigit(
play, ((gSaveContext.inventory.questItems & 0xF0000000) & 0xF0000000) >> QUEST_HEART_PIECE_COUNT, 210, 185);
play, ((gSaveContext.save.info.inventory.questItems & 0xF0000000) & 0xF0000000) >> QUEST_HEART_PIECE_COUNT, 210,
185);
// Handles navigating the menu to different sections with the D-Pad
// When the same direction is held, registers the input periodically based on a timer
@ -343,39 +344,39 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
switch (curSection) {
case 0:
if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
gSaveContext.rupees -= 100;
if (gSaveContext.rupees < 0) {
gSaveContext.rupees = 0;
gSaveContext.save.info.playerData.rupees -= 100;
if (gSaveContext.save.info.playerData.rupees < 0) {
gSaveContext.save.info.playerData.rupees = 0;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) {
gSaveContext.rupees += 100;
if (gSaveContext.rupees >= 9999) {
gSaveContext.rupees = 9999;
gSaveContext.save.info.playerData.rupees += 100;
if (gSaveContext.save.info.playerData.rupees >= 9999) {
gSaveContext.save.info.playerData.rupees = 9999;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
gSaveContext.rupees--;
if (gSaveContext.rupees < 0) {
gSaveContext.rupees = 0;
gSaveContext.save.info.playerData.rupees--;
if (gSaveContext.save.info.playerData.rupees < 0) {
gSaveContext.save.info.playerData.rupees = 0;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
gSaveContext.rupees++;
if (gSaveContext.rupees >= 9999) {
gSaveContext.rupees = 9999;
gSaveContext.save.info.playerData.rupees++;
if (gSaveContext.save.info.playerData.rupees >= 9999) {
gSaveContext.save.info.playerData.rupees = 9999;
}
}
break;
case 1:
if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
gSaveContext.healthCapacity -= 0x10;
if (gSaveContext.healthCapacity < 0x30) {
gSaveContext.healthCapacity = 0x30;
gSaveContext.save.info.playerData.healthCapacity -= 0x10;
if (gSaveContext.save.info.playerData.healthCapacity < 0x30) {
gSaveContext.save.info.playerData.healthCapacity = 0x30;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
gSaveContext.healthCapacity += 0x10;
if (gSaveContext.healthCapacity >= 0x140) {
gSaveContext.healthCapacity = 0x140;
gSaveContext.save.info.playerData.healthCapacity += 0x10;
if (gSaveContext.save.info.playerData.healthCapacity >= 0x140) {
gSaveContext.save.info.playerData.healthCapacity = 0x140;
}
}
break;
@ -394,13 +395,14 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
case 0x5C:
if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
if ((((gSaveContext.inventory.questItems & 0xF0000000) & 0xF0000000) >> QUEST_HEART_PIECE_COUNT) != 0) {
gSaveContext.inventory.questItems -= (1 << QUEST_HEART_PIECE_COUNT);
if ((((gSaveContext.save.info.inventory.questItems & 0xF0000000) & 0xF0000000) >>
QUEST_HEART_PIECE_COUNT) != 0) {
gSaveContext.save.info.inventory.questItems -= (1 << QUEST_HEART_PIECE_COUNT);
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
if ((gSaveContext.inventory.questItems & 0xF0000000) <= (4 << QUEST_HEART_PIECE_COUNT)) {
gSaveContext.inventory.questItems += (1 << QUEST_HEART_PIECE_COUNT);
if ((gSaveContext.save.info.inventory.questItems & 0xF0000000) <= (4 << QUEST_HEART_PIECE_COUNT)) {
gSaveContext.save.info.inventory.questItems += (1 << QUEST_HEART_PIECE_COUNT);
}
}
break;
@ -432,72 +434,72 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
Inventory_DeleteItem(ITEM_OCARINA_FAIRY, SLOT(ITEM_OCARINA_FAIRY));
} else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_OCARINA_FAIRY;
} else if ((gSaveContext.inventory.items[i] >= ITEM_OCARINA_FAIRY) &&
(gSaveContext.inventory.items[i] < ITEM_OCARINA_OF_TIME)) {
gSaveContext.inventory.items[i]++;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_OCARINA_FAIRY;
} else if ((gSaveContext.save.info.inventory.items[i] >= ITEM_OCARINA_FAIRY) &&
(gSaveContext.save.info.inventory.items[i] < ITEM_OCARINA_OF_TIME)) {
gSaveContext.save.info.inventory.items[i]++;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_OCARINA_OF_TIME;
} else if ((gSaveContext.inventory.items[i] > ITEM_OCARINA_FAIRY) &&
(gSaveContext.inventory.items[i] <= ITEM_OCARINA_OF_TIME)) {
gSaveContext.inventory.items[i]--;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_OCARINA_OF_TIME;
} else if ((gSaveContext.save.info.inventory.items[i] > ITEM_OCARINA_FAIRY) &&
(gSaveContext.save.info.inventory.items[i] <= ITEM_OCARINA_OF_TIME)) {
gSaveContext.save.info.inventory.items[i]--;
}
}
} else if (i == SLOT_HOOKSHOT) {
if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
Inventory_DeleteItem(ITEM_HOOKSHOT, SLOT(ITEM_HOOKSHOT));
} else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_HOOKSHOT;
} else if ((gSaveContext.inventory.items[i] >= ITEM_HOOKSHOT) &&
(gSaveContext.inventory.items[i] < ITEM_LONGSHOT)) {
gSaveContext.inventory.items[i]++;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_HOOKSHOT;
} else if ((gSaveContext.save.info.inventory.items[i] >= ITEM_HOOKSHOT) &&
(gSaveContext.save.info.inventory.items[i] < ITEM_LONGSHOT)) {
gSaveContext.save.info.inventory.items[i]++;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_LONGSHOT;
} else if ((gSaveContext.inventory.items[i] > ITEM_HOOKSHOT) &&
(gSaveContext.inventory.items[i] <= ITEM_LONGSHOT)) {
gSaveContext.inventory.items[i]--;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_LONGSHOT;
} else if ((gSaveContext.save.info.inventory.items[i] > ITEM_HOOKSHOT) &&
(gSaveContext.save.info.inventory.items[i] <= ITEM_LONGSHOT)) {
gSaveContext.save.info.inventory.items[i]--;
}
}
} else if (i == SLOT_TRADE_ADULT) {
if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
Inventory_DeleteItem(ITEM_POCKET_EGG, SLOT(ITEM_POCKET_EGG));
} else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_POCKET_EGG;
} else if ((gSaveContext.inventory.items[i] >= ITEM_POCKET_EGG) &&
(gSaveContext.inventory.items[i] < ITEM_CLAIM_CHECK)) {
gSaveContext.inventory.items[i]++;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_POCKET_EGG;
} else if ((gSaveContext.save.info.inventory.items[i] >= ITEM_POCKET_EGG) &&
(gSaveContext.save.info.inventory.items[i] < ITEM_CLAIM_CHECK)) {
gSaveContext.save.info.inventory.items[i]++;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_CLAIM_CHECK;
} else if ((gSaveContext.inventory.items[i] > ITEM_POCKET_EGG) &&
(gSaveContext.inventory.items[i] <= ITEM_CLAIM_CHECK)) {
gSaveContext.inventory.items[i]--;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_CLAIM_CHECK;
} else if ((gSaveContext.save.info.inventory.items[i] > ITEM_POCKET_EGG) &&
(gSaveContext.save.info.inventory.items[i] <= ITEM_CLAIM_CHECK)) {
gSaveContext.save.info.inventory.items[i]--;
}
}
} else if (i == SLOT_TRADE_CHILD) {
if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
Inventory_DeleteItem(ITEM_WEIRD_EGG, SLOT(ITEM_WEIRD_EGG));
} else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_WEIRD_EGG;
} else if ((gSaveContext.inventory.items[i] >= ITEM_WEIRD_EGG) &&
(gSaveContext.inventory.items[i] < ITEM_SOLD_OUT)) {
gSaveContext.inventory.items[i]++;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_WEIRD_EGG;
} else if ((gSaveContext.save.info.inventory.items[i] >= ITEM_WEIRD_EGG) &&
(gSaveContext.save.info.inventory.items[i] < ITEM_SOLD_OUT)) {
gSaveContext.save.info.inventory.items[i]++;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_SOLD_OUT;
} else if ((gSaveContext.inventory.items[i] > ITEM_WEIRD_EGG) &&
(gSaveContext.inventory.items[i] <= ITEM_SOLD_OUT)) {
gSaveContext.inventory.items[i]--;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_SOLD_OUT;
} else if ((gSaveContext.save.info.inventory.items[i] > ITEM_WEIRD_EGG) &&
(gSaveContext.save.info.inventory.items[i] <= ITEM_SOLD_OUT)) {
gSaveContext.save.info.inventory.items[i]--;
}
}
} else if ((i >= SLOT_BOTTLE_1) && (i <= SLOT_BOTTLE_4)) {
@ -505,18 +507,18 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
Inventory_DeleteItem(ITEM_BOTTLE_EMPTY + i - SLOT_BOTTLE_1,
SLOT(ITEM_BOTTLE_EMPTY) + i - SLOT_BOTTLE_1);
} else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_BOTTLE_EMPTY;
} else if ((gSaveContext.inventory.items[i] >= ITEM_BOTTLE_EMPTY) &&
(gSaveContext.inventory.items[i] <= ITEM_BOTTLE_MILK_HALF)) {
gSaveContext.inventory.items[i]++;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_BOTTLE_EMPTY;
} else if ((gSaveContext.save.info.inventory.items[i] >= ITEM_BOTTLE_EMPTY) &&
(gSaveContext.save.info.inventory.items[i] <= ITEM_BOTTLE_MILK_HALF)) {
gSaveContext.save.info.inventory.items[i]++;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_BOTTLE_POE;
} else if ((gSaveContext.inventory.items[i] >= ITEM_BOTTLE_POTION_RED) &&
(gSaveContext.inventory.items[i] <= ITEM_BOTTLE_POE)) {
gSaveContext.inventory.items[i]--;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_BOTTLE_POE;
} else if ((gSaveContext.save.info.inventory.items[i] >= ITEM_BOTTLE_POTION_RED) &&
(gSaveContext.save.info.inventory.items[i] <= ITEM_BOTTLE_POE)) {
gSaveContext.save.info.inventory.items[i]--;
}
}
} else if (i < 0x1B) {
@ -524,16 +526,16 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
if (i == SLOT_TRADE_ADULT) {
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = ITEM_MAGIC_BEAN;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = ITEM_MAGIC_BEAN;
} else {
Inventory_DeleteItem(ITEM_MAGIC_BEAN, SLOT(ITEM_MAGIC_BEAN));
}
} else {
j = sSlotItems[i];
osSyncPrintf("i=%d j=%d\n", i, j);
if (gSaveContext.inventory.items[i] == ITEM_NONE) {
gSaveContext.inventory.items[i] = j;
if (gSaveContext.save.info.inventory.items[i] == ITEM_NONE) {
gSaveContext.save.info.inventory.items[i] = j;
} else {
Inventory_DeleteItem(j, i);
}
@ -543,19 +545,19 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
} else if (curSection < 0x2C) {
if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
i = curSection - 0x1B;
gSaveContext.inventory.dungeonKeys[i]--;
if (gSaveContext.inventory.dungeonKeys[i] < 0) {
gSaveContext.inventory.dungeonKeys[i] = -1;
gSaveContext.save.info.inventory.dungeonKeys[i]--;
if (gSaveContext.save.info.inventory.dungeonKeys[i] < 0) {
gSaveContext.save.info.inventory.dungeonKeys[i] = -1;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
i = curSection - 0x1B;
if (gSaveContext.inventory.dungeonKeys[i] < 0) {
gSaveContext.inventory.dungeonKeys[i] = 1;
if (gSaveContext.save.info.inventory.dungeonKeys[i] < 0) {
gSaveContext.save.info.inventory.dungeonKeys[i] = 1;
} else {
gSaveContext.inventory.dungeonKeys[i]++;
if (gSaveContext.inventory.dungeonKeys[i] >= 9) {
gSaveContext.inventory.dungeonKeys[i] = 9;
gSaveContext.save.info.inventory.dungeonKeys[i]++;
if (gSaveContext.save.info.inventory.dungeonKeys[i] >= 9) {
gSaveContext.save.info.inventory.dungeonKeys[i] = 9;
}
}
}
@ -577,43 +579,43 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
} else {
i = curSection - 0x34; // 0 <= i < 4
if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 0);
gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 0);
}
if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) {
gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 1);
gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 1);
}
if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 2);
gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 2);
}
if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 3);
gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 3);
}
}
} else if (curSection < 0x44) {
i = curSection - 0x38;
if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
gSaveContext.inventory.dungeonItems[i] ^= 4;
gSaveContext.save.info.inventory.dungeonItems[i] ^= 4;
}
if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) {
gSaveContext.inventory.dungeonItems[i] ^= 2;
gSaveContext.save.info.inventory.dungeonItems[i] ^= 2;
}
if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
gSaveContext.inventory.dungeonItems[i] ^= 1;
gSaveContext.save.info.inventory.dungeonItems[i] ^= 1;
}
} else if (curSection == 0x5B) {
if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
gSaveContext.inventory.gsTokens++;
gSaveContext.save.info.inventory.gsTokens++;
} else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
gSaveContext.inventory.gsTokens--;
if (gSaveContext.inventory.gsTokens <= 0) {
gSaveContext.inventory.gsTokens = 0;
gSaveContext.save.info.inventory.gsTokens--;
if (gSaveContext.save.info.inventory.gsTokens <= 0) {
gSaveContext.save.info.inventory.gsTokens = 0;
}
}
} else if (curSection < 0x5C) {
i = curSection - 0x44;
if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
gSaveContext.inventory.questItems ^= gBitFlags[i];
gSaveContext.save.info.inventory.questItems ^= gBitFlags[i];
}
}
}

View file

@ -186,7 +186,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
}
} else {
if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) {
if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
gSaveContext.save.info.inventory.equipment) {
cursorMoveResult = 2;
}
}
@ -222,7 +223,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 1;
}
} else {
if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) {
if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
gSaveContext.save.info.inventory.equipment) {
cursorMoveResult = 2;
}
}
@ -274,7 +276,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 1;
}
} else if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
gSaveContext.inventory.equipment) {
gSaveContext.save.info.inventory.equipment) {
cursorMoveResult = 2;
}
} else {
@ -292,7 +294,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 1;
}
} else if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
gSaveContext.inventory.equipment) {
gSaveContext.save.info.inventory.equipment) {
cursorMoveResult = 2;
}
} else {
@ -328,7 +330,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
pauseCtx->cursorY[PAUSE_EQUIP] = cursorY;
break;
}
} else if (gBitFlags[cursorPoint - 1] & gSaveContext.inventory.equipment) {
} else if (gBitFlags[cursorPoint - 1] & gSaveContext.save.info.inventory.equipment) {
pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint;
pauseCtx->cursorX[PAUSE_EQUIP] = cursorX;
pauseCtx->cursorY[PAUSE_EQUIP] = cursorY;
@ -369,7 +371,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
pauseCtx->cursorY[PAUSE_EQUIP] = cursorY;
break;
}
} else if (gBitFlags[cursorPoint - 1] & gSaveContext.inventory.equipment) {
} else if (gBitFlags[cursorPoint - 1] & gSaveContext.save.info.inventory.equipment) {
pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint;
pauseCtx->cursorX[PAUSE_EQUIP] = cursorX;
pauseCtx->cursorY[PAUSE_EQUIP] = cursorY;
@ -425,7 +427,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
if ((pauseCtx->cursorY[PAUSE_EQUIP] == 0) && (pauseCtx->cursorX[PAUSE_EQUIP] == 3)) {
if (gSaveContext.bgsFlag != 0) {
if (gSaveContext.save.info.playerData.bgsFlag != 0) {
cursorItem = ITEM_HEART_PIECE_2;
} else if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) {
cursorItem = ITEM_GIANTS_KNIFE;
@ -441,7 +443,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
if (!((gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] == 9) ||
(gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] ==
((void)0, gSaveContext.linkAge)))) {
((void)0, gSaveContext.save.linkAge)))) {
pauseCtx->nameColorSet = 1;
}
@ -473,24 +475,25 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
if ((gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] == 9) ||
(gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] ==
((void)0, gSaveContext.linkAge))) {
((void)0, gSaveContext.save.linkAge))) {
Inventory_ChangeEquipment(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP]);
if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) {
gSaveContext.infTable[INFTABLE_1DX_INDEX] = 0;
gSaveContext.equips.buttonItems[0] = cursorItem;
gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] = 0;
gSaveContext.save.info.equips.buttonItems[0] = cursorItem;
if ((pauseCtx->cursorX[PAUSE_EQUIP] == 3) && (gSaveContext.bgsFlag != 0)) {
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BIGGORON;
gSaveContext.swordHealth = 8;
if ((pauseCtx->cursorX[PAUSE_EQUIP] == 3) && (gSaveContext.save.info.playerData.bgsFlag != 0)) {
gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON;
gSaveContext.save.info.playerData.swordHealth = 8;
} else {
if (gSaveContext.equips.buttonItems[0] == ITEM_HEART_PIECE_2) {
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BIGGORON;
if (gSaveContext.save.info.equips.buttonItems[0] == ITEM_HEART_PIECE_2) {
gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON;
}
if ((gSaveContext.equips.buttonItems[0] == ITEM_SWORD_BIGGORON) &&
(gSaveContext.bgsFlag == 0) &&
if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_SWORD_BIGGORON) &&
(gSaveContext.save.info.playerData.bgsFlag == 0) &&
CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) {
gSaveContext.equips.buttonItems[0] = ITEM_GIANTS_KNIFE;
gSaveContext.save.info.equips.buttonItems[0] = ITEM_GIANTS_KNIFE;
}
}
@ -525,8 +528,9 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
for (k = 0, temp = rowStart + 1, bit = rowStart, j = point; k < 3; k++, bit++, j += 4, temp++) {
if ((gBitFlags[bit] & gSaveContext.inventory.equipment) && (pauseCtx->cursorSpecialPos == 0)) {
if ((gEquipAgeReqs[i][k + 1] == 9) || (gEquipAgeReqs[i][k + 1] == ((void)0, gSaveContext.linkAge))) {
if ((gBitFlags[bit] & gSaveContext.save.info.inventory.equipment) && (pauseCtx->cursorSpecialPos == 0)) {
if ((gEquipAgeReqs[i][k + 1] == 9) ||
(gEquipAgeReqs[i][k + 1] == ((void)0, gSaveContext.save.linkAge))) {
if (temp == cursorSlot) {
pauseCtx->equipVtx[j].v.ob[0] = pauseCtx->equipVtx[j + 2].v.ob[0] =
pauseCtx->equipVtx[j].v.ob[0] - 2;
@ -572,13 +576,13 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
for (k = 0, bit = rowStart, point = 4; k < 3; k++, point += 4, temp++, bit++) {
if (((u32)i == 0) && (k == 2) && (gSaveContext.bgsFlag != 0)) {
if (((u32)i == 0) && (k == 2) && (gSaveContext.save.info.playerData.bgsFlag != 0)) {
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconSwordBiggoronTex, ITEM_ICON_WIDTH,
ITEM_ICON_HEIGHT, point);
} else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) {
} else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.save.info.inventory.equipment)) {
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconBrokenGiantsKnifeTex, ITEM_ICON_WIDTH,
ITEM_ICON_HEIGHT, point);
} else if (gBitFlags[bit] & gSaveContext.inventory.equipment) {
} else if (gBitFlags[bit] & gSaveContext.save.info.inventory.equipment) {
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[ITEM_SWORD_KOKIRI + temp],
ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, point);
}

View file

@ -24,7 +24,7 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx,
gDPPipeSync(POLY_OPA_DISP++);
if (!((gSlotAgeReqs[SLOT(item)] == 9) || gSlotAgeReqs[SLOT(item)] == ((void)0, gSaveContext.linkAge))) {
if (!((gSlotAgeReqs[SLOT(item)] == 9) || gSlotAgeReqs[SLOT(item)] == ((void)0, gSaveContext.save.linkAge))) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 100, 100, 100, pauseCtx->alpha);
} else {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
@ -126,7 +126,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
// Seems necessary to match
if (pauseCtx->cursorX[PAUSE_ITEM]) {}
if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]) {}
if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]) {}
while (moveCursorResult == 0) {
if (pauseCtx->stickAdjX < -30) {
@ -134,7 +134,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorX[PAUSE_ITEM]--;
pauseCtx->cursorPoint[PAUSE_ITEM] -= 1;
if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] !=
ITEM_NONE) {
moveCursorResult = 1;
}
} else {
@ -166,7 +167,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorX[PAUSE_ITEM]++;
pauseCtx->cursorPoint[PAUSE_ITEM] += 1;
if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] !=
ITEM_NONE) {
moveCursorResult = 1;
}
} else {
@ -197,7 +199,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
}
if (moveCursorResult == 1) {
cursorItem = gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]];
cursorItem = gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]];
}
osSyncPrintf("【X cursor=%d(%) (cur_xpt=%d)(ok_fg=%d)(ccc=%d)(key_angle=%d)】 ",
@ -214,7 +216,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
cursorPoint = cursorX = cursorY = 0;
while (true) {
if (gSaveContext.inventory.items[cursorPoint] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[cursorPoint] != ITEM_NONE) {
pauseCtx->cursorPoint[PAUSE_ITEM] = cursorPoint;
pauseCtx->cursorX[PAUSE_ITEM] = cursorX;
pauseCtx->cursorY[PAUSE_ITEM] = cursorY;
@ -250,7 +252,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
cursorPoint = cursorX = 5;
cursorY = 0;
while (true) {
if (gSaveContext.inventory.items[cursorPoint] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[cursorPoint] != ITEM_NONE) {
pauseCtx->cursorPoint[PAUSE_ITEM] = cursorPoint;
pauseCtx->cursorX[PAUSE_ITEM] = cursorX;
pauseCtx->cursorY[PAUSE_ITEM] = cursorY;
@ -290,7 +292,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorY[PAUSE_ITEM]--;
pauseCtx->cursorPoint[PAUSE_ITEM] -= 6;
if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] !=
ITEM_NONE) {
moveCursorResult = 1;
}
} else {
@ -304,7 +307,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorY[PAUSE_ITEM]++;
pauseCtx->cursorPoint[PAUSE_ITEM] += 6;
if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] !=
ITEM_NONE) {
moveCursorResult = 1;
}
} else {
@ -328,15 +332,16 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorColorSet = 4;
if (moveCursorResult == 1) {
cursorItem = gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]];
cursorItem = gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]];
} else if (moveCursorResult != 2) {
cursorItem = gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]];
cursorItem = gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]];
}
pauseCtx->cursorItem[PAUSE_ITEM] = cursorItem;
pauseCtx->cursorSlot[PAUSE_ITEM] = cursorSlot;
if (!((gSlotAgeReqs[cursorSlot] == 9) || (gSlotAgeReqs[cursorSlot] == ((void)0, gSaveContext.linkAge)))) {
if (!((gSlotAgeReqs[cursorSlot] == 9) ||
(gSlotAgeReqs[cursorSlot] == ((void)0, gSaveContext.save.linkAge)))) {
pauseCtx->nameColorSet = 1;
}
@ -347,7 +352,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) {
if (CHECK_BTN_ANY(input->press.button, BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) {
if (((gSlotAgeReqs[cursorSlot] == 9) ||
(gSlotAgeReqs[cursorSlot] == ((void)0, gSaveContext.linkAge))) &&
(gSlotAgeReqs[cursorSlot] == ((void)0, gSaveContext.save.linkAge))) &&
(cursorItem != ITEM_SOLD_OUT)) {
if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
pauseCtx->equipTargetCBtn = 0;
@ -419,7 +424,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0);
for (i = 0, j = 24 * 4; i < 3; i++, j += 4) {
if (gSaveContext.equips.buttonItems[i + 1] != ITEM_NONE) {
if (gSaveContext.save.info.equips.buttonItems[i + 1] != ITEM_NONE) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j], 4, 0);
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0);
}
@ -431,9 +436,9 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
for (i = j = 0; i < 24; i++, j += 4) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
if (gSaveContext.inventory.items[i] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[i] != ITEM_NONE) {
if ((pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM) && (pauseCtx->cursorSpecialPos == 0)) {
if ((gSlotAgeReqs[i] == 9) || (gSlotAgeReqs[i] == ((void)0, gSaveContext.linkAge))) {
if ((gSlotAgeReqs[i] == 9) || (gSlotAgeReqs[i] == ((void)0, gSaveContext.save.linkAge))) {
if ((sEquipState == 2) && (i == 3)) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, magicArrowEffectsR[pauseCtx->equipTargetItem - 0xBF],
magicArrowEffectsG[pauseCtx->equipTargetItem - 0xBF],
@ -467,8 +472,9 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
}
gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j + 0], 4, 0);
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[gSaveContext.inventory.items[i]],
ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 0);
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx,
gItemIcons[gSaveContext.save.info.inventory.items[i]], ITEM_ICON_WIDTH,
ITEM_ICON_HEIGHT, 0);
}
}
@ -481,8 +487,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
for (i = 0; i < 15; i++) {
if ((gAmmoItems[i] != ITEM_NONE) && (gSaveContext.inventory.items[i] != ITEM_NONE)) {
KaleidoScope_DrawAmmoCount(pauseCtx, play->state.gfxCtx, gSaveContext.inventory.items[i]);
if ((gAmmoItems[i] != ITEM_NONE) && (gSaveContext.save.info.inventory.items[i] != ITEM_NONE)) {
KaleidoScope_DrawAmmoCount(pauseCtx, play->state.gfxCtx, gSaveContext.save.info.inventory.items[i]);
}
}
@ -586,219 +592,230 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) {
if (pauseCtx->equipTargetCBtn == 0) {
if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[1]) {
if (gSaveContext.equips.buttonItems[1] != ITEM_NONE) {
if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[1]) {
if (gSaveContext.save.info.equips.buttonItems[1] != ITEM_NONE) {
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) &&
((gSaveContext.equips.buttonItems[1] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[1] <= ITEM_BOW_LIGHT)))) {
((gSaveContext.save.info.equips.buttonItems[1] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
} else {
gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[1];
gSaveContext.equips.cButtonSlots[1] = gSaveContext.equips.cButtonSlots[0];
gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[1];
gSaveContext.save.info.equips.cButtonSlots[1] =
gSaveContext.save.info.equips.cButtonSlots[0];
Interface_LoadItemIcon2(play, 2);
}
} else {
gSaveContext.equips.buttonItems[2] = ITEM_NONE;
gSaveContext.equips.cButtonSlots[1] = SLOT_NONE;
gSaveContext.save.info.equips.buttonItems[2] = ITEM_NONE;
gSaveContext.save.info.equips.cButtonSlots[1] = SLOT_NONE;
}
} else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[2]) {
if (gSaveContext.equips.buttonItems[1] != ITEM_NONE) {
} else if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[2]) {
if (gSaveContext.save.info.equips.buttonItems[1] != ITEM_NONE) {
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) &&
((gSaveContext.equips.buttonItems[1] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[1] <= ITEM_BOW_LIGHT)))) {
((gSaveContext.save.info.equips.buttonItems[1] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
} else {
gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[1];
gSaveContext.equips.cButtonSlots[2] = gSaveContext.equips.cButtonSlots[0];
gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[1];
gSaveContext.save.info.equips.cButtonSlots[2] =
gSaveContext.save.info.equips.cButtonSlots[0];
Interface_LoadItemIcon2(play, 3);
}
} else {
gSaveContext.equips.buttonItems[3] = ITEM_NONE;
gSaveContext.equips.cButtonSlots[2] = SLOT_NONE;
gSaveContext.save.info.equips.buttonItems[3] = ITEM_NONE;
gSaveContext.save.info.equips.cButtonSlots[2] = SLOT_NONE;
}
}
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) {
if ((gSaveContext.equips.buttonItems[1] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[1] <= ITEM_BOW_LIGHT))) {
if ((gSaveContext.save.info.equips.buttonItems[1] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
}
} else if (pauseCtx->equipTargetItem == ITEM_BOW) {
if ((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[2] <= ITEM_BOW_LIGHT)) {
gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[1];
gSaveContext.equips.cButtonSlots[1] = gSaveContext.equips.cButtonSlots[0];
if ((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)) {
gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[1];
gSaveContext.save.info.equips.cButtonSlots[1] = gSaveContext.save.info.equips.cButtonSlots[0];
Interface_LoadItemIcon2(play, 2);
} else if ((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[3] <= ITEM_BOW_LIGHT)) {
gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[1];
gSaveContext.equips.cButtonSlots[2] = gSaveContext.equips.cButtonSlots[0];
} else if ((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)) {
gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[1];
gSaveContext.save.info.equips.cButtonSlots[2] = gSaveContext.save.info.equips.cButtonSlots[0];
Interface_LoadItemIcon2(play, 3);
}
}
gSaveContext.equips.buttonItems[1] = pauseCtx->equipTargetItem;
gSaveContext.equips.cButtonSlots[0] = pauseCtx->equipTargetSlot;
gSaveContext.save.info.equips.buttonItems[1] = pauseCtx->equipTargetItem;
gSaveContext.save.info.equips.cButtonSlots[0] = pauseCtx->equipTargetSlot;
Interface_LoadItemIcon1(play, 1);
osSyncPrintf("左sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem,
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
gSaveContext.equips.buttonItems[3]);
gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2],
gSaveContext.save.info.equips.buttonItems[3]);
osSyncPrintf("左sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot,
gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1],
gSaveContext.equips.cButtonSlots[2]);
gSaveContext.save.info.equips.cButtonSlots[0],
gSaveContext.save.info.equips.cButtonSlots[1],
gSaveContext.save.info.equips.cButtonSlots[2]);
} else if (pauseCtx->equipTargetCBtn == 1) {
osSyncPrintf("下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem,
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
gSaveContext.equips.buttonItems[3]);
gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2],
gSaveContext.save.info.equips.buttonItems[3]);
osSyncPrintf("下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot,
gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1],
gSaveContext.equips.cButtonSlots[2]);
gSaveContext.save.info.equips.cButtonSlots[0],
gSaveContext.save.info.equips.cButtonSlots[1],
gSaveContext.save.info.equips.cButtonSlots[2]);
if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[0]) {
if (gSaveContext.equips.buttonItems[2] != ITEM_NONE) {
if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[0]) {
if (gSaveContext.save.info.equips.buttonItems[2] != ITEM_NONE) {
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) &&
((gSaveContext.equips.buttonItems[2] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[2] <= ITEM_BOW_LIGHT)))) {
((gSaveContext.save.info.equips.buttonItems[2] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
} else {
gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[2];
gSaveContext.equips.cButtonSlots[0] = gSaveContext.equips.cButtonSlots[1];
gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[2];
gSaveContext.save.info.equips.cButtonSlots[0] =
gSaveContext.save.info.equips.cButtonSlots[1];
Interface_LoadItemIcon2(play, 1);
}
} else {
gSaveContext.equips.buttonItems[1] = ITEM_NONE;
gSaveContext.equips.cButtonSlots[0] = SLOT_NONE;
gSaveContext.save.info.equips.buttonItems[1] = ITEM_NONE;
gSaveContext.save.info.equips.cButtonSlots[0] = SLOT_NONE;
}
} else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[2]) {
if (gSaveContext.equips.buttonItems[2] != ITEM_NONE) {
} else if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[2]) {
if (gSaveContext.save.info.equips.buttonItems[2] != ITEM_NONE) {
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) &&
((gSaveContext.equips.buttonItems[2] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[2] <= ITEM_BOW_LIGHT)))) {
((gSaveContext.save.info.equips.buttonItems[2] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
} else {
gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[2];
gSaveContext.equips.cButtonSlots[2] = gSaveContext.equips.cButtonSlots[1];
gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[2];
gSaveContext.save.info.equips.cButtonSlots[2] =
gSaveContext.save.info.equips.cButtonSlots[1];
Interface_LoadItemIcon2(play, 3);
}
} else {
gSaveContext.equips.buttonItems[3] = ITEM_NONE;
gSaveContext.equips.cButtonSlots[2] = SLOT_NONE;
gSaveContext.save.info.equips.buttonItems[3] = ITEM_NONE;
gSaveContext.save.info.equips.cButtonSlots[2] = SLOT_NONE;
}
}
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) {
if ((gSaveContext.equips.buttonItems[2] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[2] <= ITEM_BOW_LIGHT))) {
if ((gSaveContext.save.info.equips.buttonItems[2] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
}
} else if (pauseCtx->equipTargetItem == ITEM_BOW) {
if ((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[1] <= ITEM_BOW_LIGHT)) {
gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[2];
if ((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)) {
gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[2];
Interface_LoadItemIcon2(play, 1);
} else if ((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[3] <= ITEM_BOW_LIGHT)) {
gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[2];
} else if ((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)) {
gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[2];
Interface_LoadItemIcon2(play, 3);
}
}
gSaveContext.equips.buttonItems[2] = pauseCtx->equipTargetItem;
gSaveContext.equips.cButtonSlots[1] = pauseCtx->equipTargetSlot;
gSaveContext.save.info.equips.buttonItems[2] = pauseCtx->equipTargetItem;
gSaveContext.save.info.equips.cButtonSlots[1] = pauseCtx->equipTargetSlot;
Interface_LoadItemIcon1(play, 2);
osSyncPrintf("下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem,
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
gSaveContext.equips.buttonItems[3]);
gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2],
gSaveContext.save.info.equips.buttonItems[3]);
osSyncPrintf("下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot,
gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1],
gSaveContext.equips.cButtonSlots[2]);
gSaveContext.save.info.equips.cButtonSlots[0],
gSaveContext.save.info.equips.cButtonSlots[1],
gSaveContext.save.info.equips.cButtonSlots[2]);
} else {
osSyncPrintf("右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem,
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
gSaveContext.equips.buttonItems[3]);
gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2],
gSaveContext.save.info.equips.buttonItems[3]);
osSyncPrintf("右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot,
gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1],
gSaveContext.equips.cButtonSlots[2]);
gSaveContext.save.info.equips.cButtonSlots[0],
gSaveContext.save.info.equips.cButtonSlots[1],
gSaveContext.save.info.equips.cButtonSlots[2]);
if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[0]) {
if (gSaveContext.equips.buttonItems[3] != ITEM_NONE) {
if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[0]) {
if (gSaveContext.save.info.equips.buttonItems[3] != ITEM_NONE) {
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) &&
((gSaveContext.equips.buttonItems[3] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[3] <= ITEM_BOW_LIGHT)))) {
((gSaveContext.save.info.equips.buttonItems[3] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
} else {
gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[3];
gSaveContext.equips.cButtonSlots[0] = gSaveContext.equips.cButtonSlots[2];
gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[3];
gSaveContext.save.info.equips.cButtonSlots[0] =
gSaveContext.save.info.equips.cButtonSlots[2];
Interface_LoadItemIcon2(play, 1);
}
} else {
gSaveContext.equips.buttonItems[1] = ITEM_NONE;
gSaveContext.equips.cButtonSlots[0] = SLOT_NONE;
gSaveContext.save.info.equips.buttonItems[1] = ITEM_NONE;
gSaveContext.save.info.equips.cButtonSlots[0] = SLOT_NONE;
}
} else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[1]) {
if (gSaveContext.equips.buttonItems[3] != ITEM_NONE) {
} else if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[1]) {
if (gSaveContext.save.info.equips.buttonItems[3] != ITEM_NONE) {
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) &&
((gSaveContext.equips.buttonItems[3] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[3] <= ITEM_BOW_LIGHT)))) {
((gSaveContext.save.info.equips.buttonItems[3] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
} else {
gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[3];
gSaveContext.equips.cButtonSlots[1] = gSaveContext.equips.cButtonSlots[2];
gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[3];
gSaveContext.save.info.equips.cButtonSlots[1] =
gSaveContext.save.info.equips.cButtonSlots[2];
Interface_LoadItemIcon2(play, 2);
}
} else {
gSaveContext.equips.buttonItems[2] = ITEM_NONE;
gSaveContext.equips.cButtonSlots[1] = SLOT_NONE;
gSaveContext.save.info.equips.buttonItems[2] = ITEM_NONE;
gSaveContext.save.info.equips.cButtonSlots[1] = SLOT_NONE;
}
}
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) {
if ((gSaveContext.equips.buttonItems[3] == ITEM_BOW) ||
((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[3] <= ITEM_BOW_LIGHT))) {
if ((gSaveContext.save.info.equips.buttonItems[3] == ITEM_BOW) ||
((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT))) {
pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE;
pauseCtx->equipTargetSlot = SLOT_BOW;
}
} else if (pauseCtx->equipTargetItem == ITEM_BOW) {
if ((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[1] <= ITEM_BOW_LIGHT)) {
gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[3];
if ((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)) {
gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[3];
Interface_LoadItemIcon2(play, 1);
} else if ((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.equips.buttonItems[2] <= ITEM_BOW_LIGHT)) {
gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[3];
} else if ((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) &&
(gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)) {
gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[3];
Interface_LoadItemIcon2(play, 2);
}
}
gSaveContext.equips.buttonItems[3] = pauseCtx->equipTargetItem;
gSaveContext.equips.cButtonSlots[2] = pauseCtx->equipTargetSlot;
gSaveContext.save.info.equips.buttonItems[3] = pauseCtx->equipTargetItem;
gSaveContext.save.info.equips.cButtonSlots[2] = pauseCtx->equipTargetSlot;
Interface_LoadItemIcon1(play, 3);
osSyncPrintf("右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem,
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
gSaveContext.equips.buttonItems[3]);
gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2],
gSaveContext.save.info.equips.buttonItems[3]);
osSyncPrintf("右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot,
gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1],
gSaveContext.equips.cButtonSlots[2]);
gSaveContext.save.info.equips.cButtonSlots[0],
gSaveContext.save.info.equips.cButtonSlots[1],
gSaveContext.save.info.equips.cButtonSlots[2]);
}
pauseCtx->unk_1E4 = 0;

View file

@ -107,7 +107,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] >= 4) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 - 1; i >= 0; i--) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
if ((gSaveContext.save.info.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
(CHECK_DUNGEON_ITEM(DUNGEON_MAP, gSaveContext.mapIndex) &&
(gMapData->floorID[interfaceCtx->unk_25A][i] != 0))) {
pauseCtx->cursorPoint[PAUSE_MAP] = i + 3;
@ -118,7 +118,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
} else if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] != 10) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 + 1; i < 11; i++) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
if ((gSaveContext.save.info.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
(CHECK_DUNGEON_ITEM(DUNGEON_MAP, gSaveContext.mapIndex) &&
(gMapData->floorID[interfaceCtx->unk_25A][i] != 0))) {
pauseCtx->cursorPoint[PAUSE_MAP] = i + 3;
@ -243,7 +243,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[84], 32, 0);
for (i = j = 0; i < 8; i++, j += 4) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
if ((gSaveContext.save.info.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
CHECK_DUNGEON_ITEM(DUNGEON_MAP, gSaveContext.mapIndex)) {
if (i != (pauseCtx->dungeonMapSlot - 3)) {
gDPLoadTextureBlock(POLY_OPA_DISP++, floorIconTexs[gMapData->floorID[interfaceCtx->unk_25A][i]],
@ -558,7 +558,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[60 + k * 4], 32, 0);
for (j = i = 0; i < 8; i++, j += 4) {
if (!(gSaveContext.worldMapAreaData & gBitFlags[cloudFlagNums[k + i]])) {
if (!(gSaveContext.save.info.worldMapAreaData & gBitFlags[cloudFlagNums[k + i]])) {
gDPLoadTextureBlock_4b(POLY_OPA_DISP++, cloudTexs[k + i], G_IM_FMT_I, D_8082AAEC[k + i],
D_8082AB2C[k + i], 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);

View file

@ -338,10 +338,10 @@ void KaleidoScope_SetDefaultCursor(PlayState* play) {
switch (pauseCtx->pageIndex) {
case PAUSE_ITEM:
s = pauseCtx->cursorSlot[PAUSE_ITEM];
if (gSaveContext.inventory.items[s] == ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[s] == ITEM_NONE) {
i = s + 1;
while (true) {
if (gSaveContext.inventory.items[i] != ITEM_NONE) {
if (gSaveContext.save.info.inventory.items[i] != ITEM_NONE) {
break;
}
i++;
@ -353,7 +353,7 @@ void KaleidoScope_SetDefaultCursor(PlayState* play) {
return;
}
}
pauseCtx->cursorItem[PAUSE_ITEM] = gSaveContext.inventory.items[i];
pauseCtx->cursorItem[PAUSE_ITEM] = gSaveContext.save.info.inventory.items[i];
pauseCtx->cursorSlot[PAUSE_ITEM] = i;
}
break;
@ -1150,7 +1150,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) {
if (YREG(7) != 0) {
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("キンスタ数(%d) Get_KIN_STA=%x (%x) (%x)\n", YREG(6), GET_GS_FLAGS(YREG(6)),
gAreaGsFlags[YREG(6)], gSaveContext.gsFlags[YREG(6) >> 2]);
gAreaGsFlags[YREG(6)], gSaveContext.save.info.gsFlags[YREG(6) >> 2]);
osSyncPrintf(VT_RST);
YREG(7) = 0;
@ -1916,8 +1916,8 @@ void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) {
}
for (phi_t3 = 1; phi_t3 < 4; phi_t3++, phi_t2 += 4) {
if (gSaveContext.equips.cButtonSlots[phi_t3 - 1] != ITEM_NONE) {
phi_t4 = gSaveContext.equips.cButtonSlots[phi_t3 - 1] * 4;
if (gSaveContext.save.info.equips.cButtonSlots[phi_t3 - 1] != ITEM_NONE) {
phi_t4 = gSaveContext.save.info.equips.cButtonSlots[phi_t3 - 1] * 4;
pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] =
pauseCtx->itemVtx[phi_t4].v.ob[0] - 2;
@ -2551,7 +2551,7 @@ void KaleidoScope_Update(PlayState* play) {
gSegments[8] = VIRTUAL_TO_PHYSICAL(pauseCtx->iconItemSegment);
for (i = 0; i < ARRAY_COUNTU(gItemAgeReqs); i++) {
if ((gItemAgeReqs[i] != 9) && (gItemAgeReqs[i] != ((void)0, gSaveContext.linkAge))) {
if ((gItemAgeReqs[i] != 9) && (gItemAgeReqs[i] != ((void)0, gSaveContext.save.linkAge))) {
KaleidoScope_GrayOutTextureRGBA32(SEGMENTED_TO_VIRTUAL(gItemIcons[i]),
ITEM_ICON_WIDTH * ITEM_ICON_HEIGHT);
}
@ -2771,7 +2771,7 @@ void KaleidoScope_Update(PlayState* play) {
pauseCtx->worldMapPoints[7] = 1;
}
if (gBitFlags[1] & gSaveContext.worldMapAreaData) {
if (gBitFlags[1] & gSaveContext.save.info.worldMapAreaData) {
pauseCtx->worldMapPoints[8] = 1;
}
@ -2807,7 +2807,7 @@ void KaleidoScope_Update(PlayState* play) {
pauseCtx->worldMapPoints[8] = 1;
}
if (gBitFlags[10] & gSaveContext.worldMapAreaData) {
if (gBitFlags[10] & gSaveContext.save.info.worldMapAreaData) {
pauseCtx->worldMapPoints[9] = 1;
}
@ -2883,7 +2883,7 @@ void KaleidoScope_Update(PlayState* play) {
if (i == ITEM_EYEBALL_FROG) {
pauseCtx->tradeQuestLocation = 3;
}
if ((i == ITEM_CLAIM_CHECK) && (gSaveContext.bgsFlag == 0)) {
if ((i == ITEM_CLAIM_CHECK) && (gSaveContext.save.info.playerData.bgsFlag == 0)) {
pauseCtx->tradeQuestLocation = 7;
}
}
@ -3080,7 +3080,7 @@ void KaleidoScope_Update(PlayState* play) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
Play_SaveSceneFlags(play);
gSaveContext.savedSceneId = play->sceneId;
gSaveContext.save.info.playerData.savedSceneId = play->sceneId;
Sram_WriteSave(&play->sramCtx);
pauseCtx->unk_1EC = 4;
D_8082B25C = 3;
@ -3298,9 +3298,9 @@ void KaleidoScope_Update(PlayState* play) {
WREG(2) = 0;
pauseCtx->alpha = 255;
pauseCtx->state = 0xE;
gSaveContext.deaths++;
if (gSaveContext.deaths > 999) {
gSaveContext.deaths = 999;
gSaveContext.save.info.playerData.deaths++;
if (gSaveContext.save.info.playerData.deaths > 999) {
gSaveContext.save.info.playerData.deaths = 999;
}
}
osSyncPrintf("kscope->angle_s = %f\n", pauseCtx->unk_204);
@ -3319,7 +3319,7 @@ void KaleidoScope_Update(PlayState* play) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
pauseCtx->promptChoice = 0;
Play_SaveSceneFlags(play);
gSaveContext.savedSceneId = play->sceneId;
gSaveContext.save.info.playerData.savedSceneId = play->sceneId;
Sram_WriteSave(&play->sramCtx);
pauseCtx->state = 0xF;
D_8082B25C = 3;
@ -3347,7 +3347,7 @@ void KaleidoScope_Update(PlayState* play) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Play_SaveSceneFlags(play);
switch (gSaveContext.entranceIndex) {
switch (gSaveContext.save.entranceIndex) {
case ENTR_DEKU_TREE_0:
case ENTR_DODONGOS_CAVERN_0:
case ENTR_JABU_JABU_0:
@ -3366,39 +3366,39 @@ void KaleidoScope_Update(PlayState* play) {
break;
case ENTR_DEKU_TREE_BOSS_0:
gSaveContext.entranceIndex = ENTR_DEKU_TREE_0;
gSaveContext.save.entranceIndex = ENTR_DEKU_TREE_0;
break;
case ENTR_DODONGOS_CAVERN_BOSS_0:
gSaveContext.entranceIndex = ENTR_DODONGOS_CAVERN_0;
gSaveContext.save.entranceIndex = ENTR_DODONGOS_CAVERN_0;
break;
case ENTR_JABU_JABU_BOSS_0:
gSaveContext.entranceIndex = ENTR_JABU_JABU_0;
gSaveContext.save.entranceIndex = ENTR_JABU_JABU_0;
break;
case ENTR_FOREST_TEMPLE_BOSS_0:
gSaveContext.entranceIndex = ENTR_FOREST_TEMPLE_0;
gSaveContext.save.entranceIndex = ENTR_FOREST_TEMPLE_0;
break;
case ENTR_FIRE_TEMPLE_BOSS_0:
gSaveContext.entranceIndex = ENTR_FIRE_TEMPLE_0;
gSaveContext.save.entranceIndex = ENTR_FIRE_TEMPLE_0;
break;
case ENTR_WATER_TEMPLE_BOSS_0:
gSaveContext.entranceIndex = ENTR_WATER_TEMPLE_0;
gSaveContext.save.entranceIndex = ENTR_WATER_TEMPLE_0;
break;
case ENTR_SPIRIT_TEMPLE_BOSS_0:
gSaveContext.entranceIndex = ENTR_SPIRIT_TEMPLE_0;
gSaveContext.save.entranceIndex = ENTR_SPIRIT_TEMPLE_0;
break;
case ENTR_SHADOW_TEMPLE_BOSS_0:
gSaveContext.entranceIndex = ENTR_SHADOW_TEMPLE_0;
gSaveContext.save.entranceIndex = ENTR_SHADOW_TEMPLE_0;
break;
case ENTR_GANONDORF_BOSS_0:
gSaveContext.entranceIndex = ENTR_GANONS_TOWER_0;
gSaveContext.save.entranceIndex = ENTR_GANONS_TOWER_0;
break;
}
} else {
@ -3424,21 +3424,21 @@ void KaleidoScope_Update(PlayState* play) {
Play_TriggerRespawn(play);
gSaveContext.respawnFlag = -2;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.health = 0x30;
gSaveContext.save.info.playerData.health = 0x30;
SEQCMD_RESET_AUDIO_HEAP(0, 10);
gSaveContext.healthAccumulator = 0;
gSaveContext.magicState = MAGIC_STATE_IDLE;
gSaveContext.prevMagicState = MAGIC_STATE_IDLE;
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.magic);
osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.save.info.playerData.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d → ", gSaveContext.magicFillTarget);
gSaveContext.magicCapacity = 0;
// Set the fill target to be the magic amount before game over
gSaveContext.magicFillTarget = gSaveContext.magic;
gSaveContext.magicFillTarget = gSaveContext.save.info.playerData.magic;
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing
// to respectively the full capacity and `magicFillTarget`
gSaveContext.magicLevel = gSaveContext.magic = 0;
osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.magic);
gSaveContext.save.info.playerData.magicLevel = gSaveContext.save.info.playerData.magic = 0;
osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.save.info.playerData.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.magicFillTarget);
osSyncPrintf(VT_RST);
} else {