diff options
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/flg_set.c | 3 | ||||
| -rw-r--r-- | src/code/z_actor.c | 2 | ||||
| -rw-r--r-- | src/code/z_bgcheck.c | 3 | ||||
| -rw-r--r-- | src/code/z_kaleido_scope_call.c | 5 | ||||
| -rw-r--r-- | src/code/z_kaleido_setup.c | 23 | ||||
| -rw-r--r-- | src/code/z_lifemeter.c | 7 | ||||
| -rw-r--r-- | src/code/z_map_exp.c | 3 | ||||
| -rw-r--r-- | src/code/z_message.c | 3 | ||||
| -rw-r--r-- | src/code/z_message_nes.c | 3 | ||||
| -rw-r--r-- | src/code/z_parameter.c | 10 | ||||
| -rw-r--r-- | src/code/z_sram_NES.c | 55 |
11 files changed, 75 insertions, 42 deletions
diff --git a/src/code/flg_set.c b/src/code/flg_set.c index 20818c06e..0bc978160 100644 --- a/src/code/flg_set.c +++ b/src/code/flg_set.c @@ -10,6 +10,7 @@ * Hold Start and press B: clear all weekEventReg and eventInf flags */ #include "global.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" static FlagSetEntry sFlagEntries[] = { { &gSaveContext.save.weekEventReg[0], "week_event_reg[0]" }, @@ -255,7 +256,7 @@ void FlagSet_Update(GameState* gameState) { // Pressing B will exit } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - play->pauseCtx.debugState = 0; + play->pauseCtx.debugEditor = DEBUG_EDITOR_NONE; } } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index ff3bb411f..d792b276a 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4514,7 +4514,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 currentMatrix = Matrix_GetCurrent(); // Apply sfx along with damage effect - if ((actor != NULL) && (effectAlpha > 0.05f) && (play->gameOverCtx.state == 0)) { + if ((actor != NULL) && (effectAlpha > 0.05f) && (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { if (type == ACTOR_DRAW_DMGEFF_FIRE) { Actor_PlaySfxAtPos(actor, NA_SE_EV_BURN_OUT - SFX_FLAG); } else if (type == ACTOR_DRAW_DMGEFF_BLUE_FIRE) { diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 812f68c0d..14bdebb75 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,5 +1,6 @@ #include "global.h" #include "vt.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #define DYNA_RAYCAST_FLOORS 1 #define DYNA_RAYCAST_WALLS 2 @@ -3295,7 +3296,7 @@ f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast) { if ((result != BGCHECK_Y_MIN) && (dynaActor != NULL) && (dynaRaycast->play != NULL)) { pauseState = dynaRaycast->play->pauseCtx.state != 0; if (!pauseState) { - pauseState = dynaRaycast->play->pauseCtx.debugState != 0; + pauseState = dynaRaycast->play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE; } if (!pauseState && (dynaRaycast->colCtx->dyna.bgActorFlags[*dynaRaycast->bgId] & 2)) { curTransform = &dynaRaycast->dyna->bgActors[*dynaRaycast->bgId].curTransform; diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index c40154bc7..d7905e4dd 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,5 +1,6 @@ #include "prevent_bss_reordering.h" #include "global.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" void (*sKaleidoScopeUpdateFunc)(PlayState* play); void (*sKaleidoScopeDrawFunc)(PlayState* play); @@ -33,7 +34,7 @@ void KaleidoScopeCall_Update(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]; - if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) { + if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) { if (pauseCtx->state == 1 || pauseCtx->state == 19) { if (ShrinkWindow_GetLetterboxMagnitude() == 0) { R_PAUSE_MENU_MODE = 1; @@ -62,7 +63,7 @@ void KaleidoScopeCall_Update(PlayState* play) { if (gKaleidoMgrCurOvl == kaleidoScopeOvl) { sKaleidoScopeUpdateFunc(play); - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) { + if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) { KaleidoManager_ClearOvl(kaleidoScopeOvl); KaleidoScopeCall_LoadPlayer(); } diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 342fd1bb0..625adf20f 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -1,8 +1,8 @@ #include "global.h" #include "z64rumble.h" -#include "overlays/gamestates/ovl_file_choose/z_file_choose.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" -s16 D_801BDB00[] = { PAUSE_1, PAUSE_2, PAUSE_3, PAUSE_0 }; +s16 D_801BDB00[] = { PAUSE_MAP, PAUSE_QUEST, PAUSE_MASK, PAUSE_ITEM }; f32 sKaleidoSetupEyeX[] = { -64.0f, 0.0f, 64.0f, 0.0f }; f32 sKaleidoSetupEyeZ[] = { 0.0f, -64.0f, 0.0f, 64.0f }; @@ -70,7 +70,8 @@ void KaleidoSetup_Update(PlayState* play) { if (msgCtx && msgCtx) {} } - if ((pauseCtx->state == 0) && (pauseCtx->debugState == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { + if ((pauseCtx->state == 0) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && + (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { if ((gSaveContext.save.cutscene < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) { if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) { @@ -108,7 +109,7 @@ void KaleidoSetup_Init(PlayState* play) { bzero(pauseCtx, sizeof(PauseContext)); - pauseCtx->pageIndex = PAUSE_0; + pauseCtx->pageIndex = PAUSE_ITEM; pauseCtx->unk_21C = 160.0f; pauseCtx->unk_218 = 160.0f; @@ -119,18 +120,18 @@ void KaleidoSetup_Init(PlayState* play) { pauseCtx->unk_20C = 936.0f; pauseCtx->unk_220 = -314.0f; - pauseCtx->unk_238[PAUSE_1] = XREG(94) + 3; + pauseCtx->unk_238[PAUSE_MAP] = XREG(94) + 3; pauseCtx->unk_258 = 11; pauseCtx->unk_25A = 0; - pauseCtx->cursorItem[PAUSE_0] = 999; - pauseCtx->cursorItem[PAUSE_1] = XREG(94) + 3; - pauseCtx->cursorItem[PAUSE_2] = 999; - pauseCtx->cursorItem[PAUSE_3] = 999; + pauseCtx->cursorItem[PAUSE_ITEM] = 999; + pauseCtx->cursorItem[PAUSE_MAP] = XREG(94) + 3; + pauseCtx->cursorItem[PAUSE_QUEST] = 999; + pauseCtx->cursorItem[PAUSE_MASK] = 999; - pauseCtx->unk_268[PAUSE_0] = 0; - pauseCtx->unk_268[PAUSE_1] = XREG(94) + 3; + pauseCtx->unk_268[PAUSE_ITEM] = 0; + pauseCtx->unk_268[PAUSE_MAP] = XREG(94) + 3; pauseCtx->unk_284 = 2; pauseCtx->unk_2A0 = -1; diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index f33a949d8..d2a3a254c 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -1,5 +1,6 @@ #include "prevent_bss_reordering.h" #include "global.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #include "interface/parameter_static/parameter_static.h" s16 sHeartsPrimColors[3][3] = { { 255, 70, 50 }, { 255, 190, 0 }, { 100, 100, 255 } }; @@ -222,7 +223,7 @@ void LifeMeter_Draw(PlayState* play) { f32 lifesize = interfaceCtx->lifeSizeChange * 0.1f; u32 curCombineModeSet = 0; TexturePtr temp = NULL; - s32 ddCount = gSaveContext.save.inventory.dungeonKeys[9] - 1; + s32 ddCount = gSaveContext.save.inventory.defenseHearts - 1; OPEN_DISPS(gfxCtx); @@ -398,8 +399,8 @@ void LifeMeter_UpdateSizeAndBeep(PlayState* play) { if (interfaceCtx->lifeSizeChange <= 0) { interfaceCtx->lifeSizeChange = 0; interfaceCtx->lifeSizeChangeDirection = 0; - if (!Player_InCsMode(play) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) && - LifeMeter_IsCritical() && !Play_InCsMode(play)) { + if (!Player_InCsMode(play) && (play->pauseCtx.state == 0) && + (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && LifeMeter_IsCritical() && !Play_InCsMode(play)) { play_sound(NA_SE_SY_HITPOINT_ALARM); } } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 9baff91f1..5135a3c41 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -1,4 +1,5 @@ #include "global.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" s16 sMinimapInitPosX = 0; s16 sMinimapInitPosZ = 0; @@ -238,7 +239,7 @@ void Map_Update(PlayState* play) { func_80105B34(play); - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) { + if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) { if (Map_IsInDungeonArea(play)) { floor = func_80109124(player->actor.world.pos.y); if (floor != -1) { diff --git a/src/code/z_message.c b/src/code/z_message.c index ac8936674..14fe241c4 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -1,5 +1,6 @@ #include "global.h" #include "message_data_static.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #if 0 @@ -279,7 +280,7 @@ void func_8014D62C(PlayState* play, s32* arg1, f32* arg2, s16* arg3) { if ((func_8010A0A4(play) != 0) || (play->sceneNum == 0x4F)) { phi_v0 = 0xA; } else { - phi_v0 = play->pauseCtx.unk_238[4]; + phi_v0 = play->pauseCtx.unk_238[PAUSE_WORLD_MAP]; } temp_s6 = *(&D_801D0250 + (phi_v0 * 2)); phi_s0 = 0; diff --git a/src/code/z_message_nes.c b/src/code/z_message_nes.c index 491427cef..9231ca9b9 100644 --- a/src/code/z_message_nes.c +++ b/src/code/z_message_nes.c @@ -1,5 +1,6 @@ #include "global.h" #include "message_data_static.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #if 0 @@ -256,7 +257,7 @@ void Message_LoadAreaTextNES(PlayState* play, s32* offset, f32* arg2, s16* decod if ((func_8010A0A4(play) != 0) || (play->sceneNum == SCENE_SECOM)) { currentArea = 10; } else { - currentArea = play->pauseCtx.unk_238[4]; + currentArea = play->pauseCtx.unk_238[PAUSE_WORLD_MAP]; } stringLimit = D_801D07C4[currentArea]; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 0d6c4380d..b63af9038 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2,7 +2,7 @@ #include "interface/parameter_static/parameter_static.h" #include "interface/do_action_static/do_action_static.h" #include "misc/story_static/story_static.h" -#include "overlays/gamestates/ovl_file_choose/z_file_choose.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" typedef struct { /* 0x00 */ u8 scene; @@ -330,9 +330,9 @@ u8 Item_Give(PlayState* play, u8 item) { return ITEM_NONE; } else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) { - gSaveContext.save.inventory.questItems += (1 << QUEST_HEART_PIECE_COUNT); - if ((gSaveContext.save.inventory.questItems & 0xF0000000) == (4 << QUEST_HEART_PIECE_COUNT)) { - gSaveContext.save.inventory.questItems ^= (4 << QUEST_HEART_PIECE_COUNT); + INCREMENT_QUEST_HEART_PIECE_COUNT; + if (EQ_MAX_QUEST_HEART_PIECE_COUNT) { + RESET_HEART_PIECE_COUNT; gSaveContext.save.playerData.healthCapacity += 0x10; gSaveContext.save.playerData.health += 0x10; } @@ -989,7 +989,7 @@ void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 btn) { Interface_LoadItemIconImpl(play, btn); - play->pauseCtx.cursorItem[PAUSE_0] = item; + play->pauseCtx.cursorItem[PAUSE_ITEM] = item; gSaveContext.buttonStatus[btn] = BTN_ENABLED; if (item == ITEM_HOT_SPRING_WATER) { diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c index 5e29a251e..bb6308fb6 100644 --- a/src/code/z_sram_NES.c +++ b/src/code/z_sram_NES.c @@ -148,10 +148,31 @@ s32 D_801C6798[] = { 0x00000020, 0x00001470, 0x000028C0, 0x00003D10, 0x00005160, 0x000065B0, }; -u8 D_801C67B0[24] = { - ITEM_NONE, ITEM_BOW, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_BOMB, ITEM_BOMBCHU, - ITEM_STICK, ITEM_NUT, ITEM_MAGIC_BEANS, ITEM_NONE, ITEM_POWDER_KEG, ITEM_PICTO_BOX, ITEM_NONE, ITEM_NONE, - ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, +u8 gAmmoItems[] = { + ITEM_NONE, // SLOT_OCARINA + ITEM_BOW, // SLOT_BOW + ITEM_NONE, // SLOT_ARROW_FIRE + ITEM_NONE, // SLOT_ARROW_ICE + ITEM_NONE, // SLOT_ARROW_LIGHT + ITEM_NONE, // SLOT_TRADE_DEED + ITEM_BOMB, // SLOT_BOMB + ITEM_BOMBCHU, // SLOT_BOMBCHU + ITEM_STICK, // SLOT_STICK + ITEM_NUT, // SLOT_NUT + ITEM_MAGIC_BEANS, // SLOT_MAGIC_BEANS + ITEM_NONE, // SLOT_TRADE_KEY_MAMA + ITEM_POWDER_KEG, // SLOT_POWDER_KEG + ITEM_PICTO_BOX, // SLOT_PICTO_BOX + ITEM_NONE, // SLOT_LENS + ITEM_NONE, // SLOT_HOOKSHOT + ITEM_NONE, // SLOT_SWORD_GREAT_FAIRY + ITEM_NONE, // SLOT_TRADE_COUPLE + ITEM_NONE, // SLOT_BOTTLE_1 + ITEM_NONE, // SLOT_BOTTLE_2 + ITEM_NONE, // SLOT_BOTTLE_3 + ITEM_NONE, // SLOT_BOTTLE_4 + ITEM_NONE, // SLOT_BOTTLE_5 + ITEM_NONE, // SLOT_BOTTLE_6 }; s32 D_801C67C8[] = { 0, 0x40, 0x80, 0xC0, 0x100, 0x180, 0x200, 0x280 }; @@ -330,8 +351,8 @@ void Sram_SaveEndOfCycle(PlayState* play) { } } - for (i = 0; i < ARRAY_COUNT(D_801C67B0); i++) { - if (D_801C67B0[i] != ITEM_NONE) { + for (i = 0; i < ARRAY_COUNT(gAmmoItems); i++) { + if (gAmmoItems[i] != ITEM_NONE) { if ((gSaveContext.save.inventory.items[i] != ITEM_NONE) && (i != SLOT_PICTO_BOX)) { item = gSaveContext.save.inventory.items[i]; AMMO(item) = 0; @@ -433,8 +454,8 @@ void Sram_SaveEndOfCycle(PlayState* play) { Sram_ClearHighscores(); for (i = 0; i < 8; i++) { - gSaveContext.save.inventory.dungeonItems[i] &= (u8)~1; - gSaveContext.save.inventory.dungeonKeys[i] = 0; + gSaveContext.save.inventory.dungeonItems[i] &= (u8)~1; // remove boss key + DUNGEON_KEY_COUNT(i) = 0; gSaveContext.save.inventory.strayFairies[i] = 0; } @@ -624,7 +645,9 @@ Inventory sSaveDefaultInventory = { // dungeonItems { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // dungeonKeys - { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0 }, + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, + // defenceHearts + 0, // strayFairies { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // dekuPlaygroundPlayerName @@ -768,7 +791,9 @@ Inventory sSaveDebugInventory = { // dungeonItems { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }, // dungeonKeys - { 8, 8, 8, 8, 8, 8, 8, 8, 8, 0 }, + { 8, 8, 8, 8, 8, 8, 8, 8, 8 }, + // defenceHearts + 0, // strayFairies { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // dekuPlaygroundPlayerName @@ -1136,7 +1161,7 @@ void func_801457CC(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) { fileChooseCtx->healthCapacity[sp76] = gSaveContext.save.playerData.healthCapacity; fileChooseCtx->health[sp76] = gSaveContext.save.playerData.health; - fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.dungeonKeys[9]; + fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.defenseHearts; fileChooseCtx->unk_24444[sp76] = gSaveContext.save.inventory.questItems; fileChooseCtx->unk_24458[sp76] = gSaveContext.save.time; fileChooseCtx->unk_24460[sp76] = gSaveContext.save.day; @@ -1231,7 +1256,7 @@ void func_801457CC(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) { fileChooseCtx->healthCapacity[sp76] = gSaveContext.save.playerData.healthCapacity; fileChooseCtx->health[sp76] = gSaveContext.save.playerData.health; - fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.dungeonKeys[9]; + fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.defenseHearts; fileChooseCtx->unk_24444[sp76] = gSaveContext.save.inventory.questItems; fileChooseCtx->unk_24458[sp76] = gSaveContext.save.time; fileChooseCtx->unk_24460[sp76] = gSaveContext.save.day; @@ -1344,7 +1369,7 @@ void func_80146628(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) { fileChooseCtx->unk_24438[fileChooseCtx->fileNum] = gSaveContext.save.playerData.healthCapacity; fileChooseCtx->unk_24440[fileChooseCtx->fileNum] = gSaveContext.save.playerData.health; - fileChooseCtx->unk_24456[fileChooseCtx->fileNum] = gSaveContext.save.inventory.dungeonKeys[9]; + fileChooseCtx->unk_24456[fileChooseCtx->fileNum] = gSaveContext.save.inventory.defenseHearts; fileChooseCtx->unk_2444C[fileChooseCtx->fileNum] = gSaveContext.save.inventory.questItems; fileChooseCtx->unk_2445C[fileChooseCtx->fileNum] = gSaveContext.save.time; fileChooseCtx->unk_24464[fileChooseCtx->fileNum] = gSaveContext.save.day; @@ -1387,7 +1412,7 @@ void func_80146628(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) { fileChooseCtx->healthCapacity[fileChooseCtx->fileNum] = gSaveContext.save.playerData.healthCapacity; fileChooseCtx->health[fileChooseCtx->fileNum] = gSaveContext.save.playerData.health; - fileChooseCtx->unk_24454[fileChooseCtx->fileNum] = gSaveContext.save.inventory.dungeonKeys[9]; + fileChooseCtx->unk_24454[fileChooseCtx->fileNum] = gSaveContext.save.inventory.defenseHearts; fileChooseCtx->unk_24444[fileChooseCtx->fileNum] = gSaveContext.save.inventory.questItems; fileChooseCtx->unk_24458[fileChooseCtx->fileNum] = gSaveContext.save.time; fileChooseCtx->unk_24460[fileChooseCtx->fileNum] = gSaveContext.save.day; @@ -1456,7 +1481,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) { fileChooseCtx->healthCapacity[fileChooseCtx->unk_24480] = gSaveContext.save.playerData.healthCapacity; fileChooseCtx->health[fileChooseCtx->unk_24480] = gSaveContext.save.playerData.health; - fileChooseCtx->unk_24454[fileChooseCtx->unk_24480] = gSaveContext.save.inventory.dungeonKeys[9]; + fileChooseCtx->unk_24454[fileChooseCtx->unk_24480] = gSaveContext.save.inventory.defenseHearts; fileChooseCtx->unk_24444[fileChooseCtx->unk_24480] = gSaveContext.save.inventory.questItems; fileChooseCtx->unk_24458[fileChooseCtx->unk_24480] = gSaveContext.save.time; fileChooseCtx->unk_24460[fileChooseCtx->unk_24480] = gSaveContext.save.day; |
