summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2022-07-23 15:44:49 -0400
committerGitHub <noreply@github.com>2022-07-23 15:44:49 -0400
commit6fc12c3a707cd3bb73660dbcbaa515ede8e86547 (patch)
tree8b3b52eec659d4996774fe6c1d07ff23630f9b84 /src
parent6472f6832328c12492a73afb99d9f951b6d85ee8 (diff)
Inventory Editor Ok and Documented (z_kaleido_debug.c) (#954)
* Match Debug Menu * Many docs and discussions * Missed one * A bit more * More PR Suggestions * phrasing * hex health * Fix
Diffstat (limited to 'src')
-rw-r--r--src/code/flg_set.c3
-rw-r--r--src/code/z_actor.c2
-rw-r--r--src/code/z_bgcheck.c3
-rw-r--r--src/code/z_kaleido_scope_call.c5
-rw-r--r--src/code/z_kaleido_setup.c23
-rw-r--r--src/code/z_lifemeter.c7
-rw-r--r--src/code/z_map_exp.c3
-rw-r--r--src/code/z_message.c3
-rw-r--r--src/code/z_message_nes.c3
-rw-r--r--src/code/z_parameter.c10
-rw-r--r--src/code/z_sram_NES.c55
-rw-r--r--src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c5
-rw-r--r--src/overlays/gamestates/ovl_file_choose/z_file_choose.h9
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c80
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c1101
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c58
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c81
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c42
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h21
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c296
20 files changed, 1741 insertions, 69 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;
diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c
index 3e977520d..ae3b3f04c 100644
--- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c
+++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c
@@ -5,6 +5,7 @@
*/
#include "z_en_okarina_effect.h"
+#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
@@ -58,7 +59,7 @@ void func_8096B104(EnOkarinaEffect* this, PlayState* play) {
void func_8096B174(EnOkarinaEffect* this, PlayState* play) {
DECR(this->unk144);
if ((play->pauseCtx.state == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
- (play->msgCtx.msgLength == 0) && !FrameAdvance_IsEnabled(&play->state) && this->unk144 == 0) {
+ (play->msgCtx.msgLength == 0) && !FrameAdvance_IsEnabled(&play->state) && (this->unk144 == 0)) {
EnOkarinaEffect_SetupAction(this, func_8096B1FC);
}
}
@@ -66,7 +67,7 @@ void func_8096B174(EnOkarinaEffect* this, PlayState* play) {
void func_8096B1FC(EnOkarinaEffect* this, PlayState* play) {
if (play->envCtx.unk_F2[4]) {
if ((play->state.frames & 3) == 0) {
- --play->envCtx.unk_F2[4];
+ play->envCtx.unk_F2[4]--;
if (play->envCtx.unk_F2[4] == 8) {
func_800FD858(play);
}
diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.h b/src/overlays/gamestates/ovl_file_choose/z_file_choose.h
index ff8b85723..4184ca576 100644
--- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.h
+++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.h
@@ -112,13 +112,4 @@ typedef struct FileChooseContext {
/* 0x24550 */ s16 unk_24550;
} FileChooseContext; // size = 0x24558
-// TODO: Confirm those values has the same meaning as their OoT counterparts
-typedef enum {
- /* 0x00 */ PAUSE_0, // PAUSE_ITEM
- /* 0x01 */ PAUSE_1, // PAUSE_MAP
- /* 0x02 */ PAUSE_2, // PAUSE_QUEST
- /* 0x03 */ PAUSE_3, // PAUSE_EQUIP
- /* 0x04 */ PAUSE_4 // PAUSE_WORLD_MAP
-} PauseMenuPage;
-
#endif
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
index aaa7c9fc6..316ad3355 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
@@ -16,6 +16,86 @@ extern UNK_TYPE D_0B000000;
extern UNK_TYPE D_0C000000;
extern UNK_TYPE D_0C006C00;
+s16 D_8082AED0[] = { 120, 60, 2, 80 };
+
+s16 D_8082AED8[] = { 20, 4, 20, 10 };
+
+s32 D_8082AEE0 = 0;
+
+s32 D_8082AEE4[] = { 0, 0, 0 };
+
+s32 D_8082AEF0[] = { 0, 0, 0, 0, 0 };
+
+s16 D_8082AF04[] = {
+ 255, 0, 0, 255, 255, 70, 0, 150, 255, 70, 0, 150, 255, 0, 0, 255,
+};
+
+s16 D_8082AF24[] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x003C, 0x0000, 0x005A, 0x0000, 0x0000,
+ 0x0000, 0x0028, 0x006E, 0x0050, 0x0028, 0x0000, 0x0046, 0x0000, 0x005A, 0x005A, 0x005A, 0x0000,
+};
+
+s16 D_8082AF6C[] = {
+ 255, 255, 255, 255, 255, 255,
+};
+
+s16 D_8082AF78[] = {
+ 255, 255, 255, 255, 255, 255,
+};
+
+s16 D_8082AF84[] = {
+ 150, 150, 150, 150, 150, 150,
+};
+
+s16 D_8082AF90 = 20;
+
+s32 D_8082AF94 = 0;
+
+s32 D_8082AF98 = 0;
+
+s32 D_8082AF9C = 0;
+
+s32 D_8082AFA0 = 0;
+
+s32 D_8082AFA4 = 0;
+
+s16 D_8082AFA8 = 20;
+
+s32 D_8082AFAC = 0;
+
+void* D_8082AFB0[] = {
+ 0x020024A0, 0x020025A0, 0x020026A0, 0x020027A0, 0x020028A0,
+};
+
+s16 D_8082AFC4[] = {
+ 150, 255, 100, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+};
+
+s16 D_8082AFDC[] = {
+ 255, 80, 150, 160, 100, 240, 255, 255, 255, 255, 255, 255,
+};
+
+s16 D_8082AFF4[] = { 100, 40, 255, 0, 255, 100, 255, 255, 255, 255, 255, 255 };
+
+void* D_8082B00C[] = {
+ 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000,
+};
+
+s16 D_8082B024 = 1;
+
+s16 D_8082B028 = 0;
+
+s16 D_8082B02C[] = {
+ 0xFFFF, 0x0003, 0x0002, 0x0001, 0x0000, 0x0004, 0x0003, 0xFFFE, 0x0000, 0x0005, 0x0016, 0x0003, 0x0000, 0x0004,
+ 0x0002, 0x0001, 0x0001, 0x0014, 0x0005, 0xFFFE, 0x0002, 0x0013, 0x0010, 0x0004, 0x000C, 0xFFFF, 0xFFFD, 0x0007,
+ 0x000D, 0xFFFF, 0x0006, 0x0008, 0x000E, 0xFFFF, 0x0007, 0x0009, 0x000F, 0xFFFF, 0x0008, 0x000A, 0x0010, 0xFFFF,
+ 0x0009, 0x0013, 0x0011, 0xFFFF, 0x000A, 0x0005, 0x0012, 0x0006, 0xFFFD, 0x000D, 0x0012, 0x0007, 0x000C, 0x000E,
+ 0x0016, 0x0008, 0x000D, 0x000F, 0x0016, 0x0009, 0x000E, 0x0010, 0x0016, 0x000A, 0x000F, 0x0005, 0x0016, 0x000B,
+ 0x0010, 0x0005, 0xFFFF, 0x000C, 0xFFFD, 0x0016, 0x0005, 0xFFFF, 0x000A, 0x0014, 0x0004, 0xFFFF, 0x0013, 0xFFFE,
+ 0x0013, 0x000C, 0xFFFD, 0x0016, 0xFFFF, 0x0010, 0x0012, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+};
+
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_808160A0.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80817B5C.s")
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c
index 99928bb16..2854b02c6 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c
@@ -1,25 +1,1098 @@
/*
* File: z_kaleido_debug.c
* Overlay: ovl_kaleido_scope
- * Description:
+ * Description: Inventory Editor
*/
#include "z_kaleido_scope.h"
+#include "interface/parameter_static/parameter_static.h"
-extern UNK_TYPE D_02001360;
-extern UNK_TYPE D_020044A0;
-extern UNK_TYPE D_02004AA0;
-extern UNK_TYPE D_0200B998;
-extern UNK_TYPE D_08062000;
-extern UNK_TYPE D_08064340;
-extern UNK_TYPE D_0B000000;
-extern UNK_TYPE D_0C000000;
-extern UNK_TYPE D_0C006C00;
+s16 sCurSection = 0;
+s16 sCurRow = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80818920.s")
+// These defines must line up with the indices of sSectionPositions
+#define INV_EDITOR_SECTION_RUPEE 0
+#define INV_EDITOR_SECTION_HEALTH_CAPACITY 1
+#define INV_EDITOR_SECTION_HEALTH 2
+#define INV_EDITOR_SECTION_ITEMS 3
+#define INV_EDITOR_SECTION_MASKS 27
+#define INV_EDITOR_SECTION_BOSS 51
+#define INV_EDITOR_SECTION_SWORD 55
+#define INV_EDITOR_SECTION_SHIELD 56
+#define INV_EDITOR_SECTION_SONGS 57
+#define INV_EDITOR_SECTION_LULLABY_INTRO 69
+#define INV_EDITOR_SECTION_NOTEBOOK 70
+#define INV_EDITOR_SECTION_QUIVER 71
+#define INV_EDITOR_SECTION_BOMB_BAG 72
+#define INV_EDITOR_SECTION_SWAMP_GOLD_SKULLS 73
+#define INV_EDITOR_SECTION_OCEAN_GOLD_SKULLS 74
+#define INV_EDITOR_SECTION_HEART_PIECE_COUNT 75
+#define INV_EDITOR_SECTION_SMALL_KEYS 76
+#define INV_EDITOR_SECTION_DUNGEON_ITEMS 80
+#define INV_EDITOR_SECTION_STRAY_FAIRIES 84
+#define INV_EDITOR_SECTION_DOUBLE_DEFENSE 88
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_808190C4.s")
+// Geometry of the highlights for the selected section
+typedef struct {
+ /* 0 */ s16 screenX;
+ /* 1 */ s16 screenY;
+ /* 2 */ s16 width;
+} SectionPosition;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80819238.s")
+// clang-format off
+SectionPosition sSectionPositions[] = {
+ // Rupees (0)
+ { 65, 14, 41 },
+ // Health Capacity (1)
+ { 145, 14, 21 },
+ // Health (2)
+ { 193, 14, 35 },
+ // Items (3)
+ { 42, 37, 22 }, { 65, 37, 22 }, { 88, 37, 22 }, { 111, 37, 22 }, { 134, 37, 22 }, { 157, 37, 22 }, // row 1
+ { 42, 51, 22 }, { 65, 51, 22 }, { 88, 51, 22 }, { 111, 51, 22 }, { 134, 51, 22 }, { 157, 51, 22 }, // row 2
+ { 42, 65, 22 }, { 65, 65, 22 }, { 88, 65, 22 }, { 111, 65, 22 }, { 134, 65, 22 }, { 157, 65, 22 }, // row 3
+ { 42, 80, 22 }, { 65, 80, 22 }, { 88, 80, 22 }, { 111, 80, 22 }, { 134, 80, 22 }, { 157, 80, 22 }, // row 4
+ // Masks (27)
+ { 202, 37, 14 }, { 215, 37, 14 }, { 229, 37, 14 }, { 243, 37, 14 }, { 257, 37, 14 }, { 271, 37, 14 }, // row 1
+ { 202, 51, 14 }, { 215, 51, 14 }, { 229, 51, 14 }, { 243, 51, 14 }, { 257, 51, 14 }, { 271, 51, 14 }, // row 2
+ { 202, 65, 14 }, { 215, 65, 14 }, { 229, 65, 14 }, { 243, 65, 14 }, { 257, 65, 14 }, { 271, 65, 14 }, // row 3
+ { 202, 80, 14 }, { 215, 80, 14 }, { 229, 80, 14 }, { 243, 80, 14 }, { 257, 80, 14 }, { 271, 80, 14 }, // row 4
+ // Boss (51)
+ { 42, 111, 14 }, { 54, 111, 14 }, { 66, 111, 14 }, { 78, 111, 14 },
+ // Sword (55)
+ { 114, 99, 14 },
+ // Shield (56)
+ { 142, 99, 14 },
+ // Songs (57)
+ { 188, 99, 14 }, { 202, 99, 14 }, { 216, 99, 14 }, { 230, 99, 14 }, { 244, 99, 14 }, { 258, 99, 14 },
+ { 188, 113, 14 }, { 202, 113, 14 }, { 216, 113, 14 }, { 230, 113, 14 }, { 244, 113, 14 }, { 258, 113, 14 },
+ // Goron Lullaby Intro (69)
+ { 272, 113, 14 },
+ // Bombers Notebook (70)
+ { 54, 141, 14 },
+ // Quiver Upgrade (71)
+ { 112, 134, 14 },
+ // Bomb Bag Upgrade (72)
+ { 155, 134, 14 },
+ // Gold Skulltula Count (73)
+ { 194, 130, 32 }, { 194, 144, 32 },
+ // Heart Piece Count (75)
+ { 262, 134, 14 },
+ // Small Keys (76)
+ { 43, 168, 14 }, { 55, 168, 14 }, { 67, 168, 14 }, { 79, 168, 14 },
+ // Dungeon Items (80)
+ { 127, 168, 14 }, { 139, 168, 14 }, { 151, 168, 14 }, { 163, 168, 14 },
+ // Stray Fairies (84)
+ { 202, 168, 22 }, { 223, 168, 22 }, { 244, 168, 22 }, { 265, 168, 22 },
+ // Life (88)
+ { 42, 202, 14 },
+ // Magic
+ { 73, 202, 14 },
+ // Lottery
+ { 136, 202, 38 },
+ // Gold Color/Bombers Code (not highlighted properly)
+ { 214, 202, 74 }, { 214, 202, 74 },
+};
+// clang-format on
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80819F04.s")
+s16 sSlotItems[] = {
+ // Items Row 1
+ ITEM_OCARINA,
+ ITEM_BOW,
+ ITEM_ARROW_FIRE,
+ ITEM_ARROW_ICE,
+ ITEM_ARROW_LIGHT,
+ ITEM_OCARINA_FAIRY,
+ // Items Row 2
+ ITEM_BOMB,
+ ITEM_BOMBCHU,
+ ITEM_STICK,
+ ITEM_NUT,
+ ITEM_MAGIC_BEANS,
+ ITEM_SLINGSHOT,
+ // Items Row 3
+ ITEM_POWDER_KEG,
+ ITEM_PICTO_BOX,
+ ITEM_LENS,
+ ITEM_HOOKSHOT,
+ ITEM_SWORD_GREAT_FAIRY,
+ ITEM_LONGSHOT,
+ // Items Row 4
+ ITEM_BOTTLE,
+ ITEM_POTION_RED,
+ ITEM_POTION_GREEN,
+ ITEM_POTION_BLUE,
+ ITEM_FAIRY,
+ ITEM_MUSHROOM,
+ // Masks Row 1
+ ITEM_MASK_POSTMAN,
+ ITEM_MASK_ALL_NIGHT,
+ ITEM_MASK_BLAST,
+ ITEM_MASK_STONE,
+ ITEM_MASK_GREAT_FAIRY,
+ ITEM_MASK_DEKU,
+ // Masks Row 2
+ ITEM_MASK_KEATON,
+ ITEM_MASK_BREMEN,
+ ITEM_MASK_BUNNY,
+ ITEM_MASK_DON_GERO,
+ ITEM_MASK_SCENTS,
+ ITEM_MASK_GORON,
+ // Masks Row 3
+ ITEM_MASK_ROMANI,
+ ITEM_MASK_CIRCUS_LEADER,
+ ITEM_MASK_KAFEIS_MASK,
+ ITEM_MASK_COUPLE,
+ ITEM_MASK_TRUTH,
+ ITEM_MASK_ZORA,
+ // Masks Row 4
+ ITEM_MASK_KAMARO,
+ ITEM_MASK_GIBDO,
+ ITEM_MASK_GARO,
+ ITEM_MASK_CAPTAIN,
+ ITEM_MASK_GIANT,
+ ITEM_MASK_FIERCE_DEITY,
+};
+
+s16 sRowFirstSections[] = {
+ INV_EDITOR_SECTION_RUPEE,
+ INV_EDITOR_SECTION_HEALTH_CAPACITY,
+ INV_EDITOR_SECTION_HEALTH,
+ INV_EDITOR_SECTION_ITEMS,
+ INV_EDITOR_SECTION_MASKS,
+ INV_EDITOR_SECTION_BOSS,
+ INV_EDITOR_SECTION_SWORD,
+ INV_EDITOR_SECTION_SHIELD,
+ INV_EDITOR_SECTION_SONGS,
+ INV_EDITOR_SECTION_NOTEBOOK,
+ INV_EDITOR_SECTION_QUIVER,
+ INV_EDITOR_SECTION_BOMB_BAG,
+ INV_EDITOR_SECTION_SWAMP_GOLD_SKULLS,
+ INV_EDITOR_SECTION_HEART_PIECE_COUNT,
+ INV_EDITOR_SECTION_SMALL_KEYS,
+ INV_EDITOR_SECTION_DUNGEON_ITEMS,
+ INV_EDITOR_SECTION_STRAY_FAIRIES,
+ INV_EDITOR_SECTION_DOUBLE_DEFENSE,
+};
+
+void KaleidoScope_DrawInventoryEditorText(Gfx** gfxp) {
+ GfxPrint printer;
+ s32 pad[2];
+
+ GfxPrint_Init(&printer);
+ GfxPrint_Open(&printer, *gfxp);
+
+ // Rupees
+ GfxPrint_SetPos(&printer, 4, 2);
+ GfxPrint_SetColor(&printer, 255, 60, 0, 255);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ルピー");
+
+ // Hearts
+ GfxPrint_SetPos(&printer, 15, 2);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ハート");
+ GfxPrint_SetPos(&printer, 15, 3);
+ GfxPrint_Printf(&printer, "%s", "MAX");
+ GfxPrint_SetPos(&printer, 21, 3);
+ GfxPrint_Printf(&printer, "%s", "NOW");
+ GfxPrint_SetPos(&printer, 28, 3);
+ GfxPrint_Printf(&printer, "%s", "/4");
+
+ // Items
+ GfxPrint_SetPos(&printer, 4, 5);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ア");
+ GfxPrint_SetPos(&printer, 4, 6);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "イ");
+ GfxPrint_SetPos(&printer, 4, 7);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "テ");
+ GfxPrint_SetPos(&printer, 4, 8);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ム");
+
+ // Masks
+ GfxPrint_SetPos(&printer, 24, 5);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "マ");
+ GfxPrint_SetPos(&printer, 24, 6);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ス");
+ GfxPrint_SetPos(&printer, 24, 7);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ク");
+
+ // Boss (Remains)
+ GfxPrint_SetPos(&printer, 4, 13);
+ GfxPrint_Printf(&printer, "%s", "BOSS");
+
+ // Sword
+ GfxPrint_SetPos(&printer, 13, 13);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ケ");
+ GfxPrint_SetPos(&printer, 13, 14);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ン");
+
+ // Shield
+ GfxPrint_SetPos(&printer, 17, 13);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "タ");
+ GfxPrint_SetPos(&printer, 17, 14);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "テ");
+
+ // Ocarina (Songs)
+ GfxPrint_SetPos(&printer, 21, 13);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "オカ");
+ GfxPrint_SetPos(&printer, 21, 14);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "リナ");
+
+ // Schedule (Bombers Notebook)
+ GfxPrint_SetPos(&printer, 4, 17);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "スケジュール");
+
+ // Quiver
+ GfxPrint_SetPos(&printer, 12, 17);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ヤ");
+ GfxPrint_SetPos(&printer, 12, 18);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "タテ");
+
+ // Bomb Bag
+ GfxPrint_SetPos(&printer, 16, 17);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ボム");
+ GfxPrint_SetPos(&printer, 16, 18);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "フクロ");
+
+ // Gold Skulls
+ GfxPrint_SetPos(&printer, 22, 17);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "キン");
+ GfxPrint_SetPos(&printer, 22, 18);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "スタ");
+
+ // Heart Pieces
+ GfxPrint_SetPos(&printer, 29, 17);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ハート");
+ GfxPrint_SetPos(&printer, 29, 18);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "カケラ");
+ GfxPrint_SetPos(&printer, 34, 18);
+ GfxPrint_Printf(&printer, "%s", "/4");
+
+ // Keys
+ GfxPrint_SetPos(&printer, 4, 21);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "カ");
+ GfxPrint_SetPos(&printer, 4, 22);
+ GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ギ");
+
+ // Map/Compass
+ GfxPrint_SetPos(&printer, 12, 21);
+ GfxPrint_Printf(&printer, "%s", "MAP");
+ GfxPrint_SetPos(&printer, 12, 22);
+ GfxPrint_Printf(&printer, "%s", "コンパ");
+
+ // Fairies
+ GfxPrint_SetPos(&printer, 23, 21);
+ GfxPrint_Printf(&printer, "%s", "ヨウ");
+ GfxPrint_SetPos(&printer, 23, 22);
+ GfxPrint_Printf(&printer, "%s", "セイ");
+
+ // Life (double defence)
+ GfxPrint_SetPos(&printer, 4, 25);
+ GfxPrint_Printf(&printer, "%s", "イ");
+ GfxPrint_SetPos(&printer, 4, 26);
+ GfxPrint_Printf(&printer, "%s", "ノ");
+ GfxPrint_SetPos(&printer, 4, 27);
+ GfxPrint_Printf(&printer, "%s", "チ");
+
+ // Magic
+ GfxPrint_SetPos(&printer, 8, 25);
+ GfxPrint_Printf(&printer, "%s", "マ");
+ GfxPrint_SetPos(&printer, 8, 26);
+ GfxPrint_Printf(&printer, "%s", "ホ");
+ GfxPrint_SetPos(&printer, 8, 27);
+ GfxPrint_Printf(&printer, "%s", "ウ");
+
+ // Lottery
+ GfxPrint_SetPos(&printer, 13, 25);
+ GfxPrint_Printf(&printer, "%s", "タカラ");
+ GfxPrint_SetPos(&printer, 13, 26);
+ GfxPrint_Printf(&printer, "%s", "クジ");
+
+ // Gold Color (Oceanside Spider House Mask Order)
+ GfxPrint_SetPos(&printer, 23, 24);
+ GfxPrint_Printf(&printer, "%s", "キンイロ");
+
+ // Bombers (code)
+ GfxPrint_SetPos(&printer, 23, 26);
+ GfxPrint_Printf(&printer, "%s", "ボン");
+ GfxPrint_SetPos(&printer, 23, 27);
+ GfxPrint_Printf(&printer, "%s", "バーズ");
+
+ *gfxp = GfxPrint_Close(&printer);
+ GfxPrint_Destroy(&printer);
+}
+
+void KaleidoScope_DrawDigit(PlayState* play, s32 digit, s32 rectLeft, s32 rectTop) {
+ OPEN_DISPS(play->state.gfxCtx);
+
+ gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gCounterDigit0Tex + (8 * 16 * digit)), G_IM_FMT_I, G_IM_SIZ_8b, 8, 16, 0,
+ G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
+ G_TX_NOLOD);
+ gSPTextureRectangle(POLY_OPA_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + 8) << 2, (rectTop + 16) << 2,
+ G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
+
+ CLOSE_DISPS(play->state.gfxCtx);
+}
+
+void KaleidoScope_DrawInventoryEditor(PlayState* play) {
+ Gfx* gfx;
+ Gfx* gfxRef;
+ s32 counterDigits[4];
+ s16 slot;
+ s16 i;
+ s16 j;
+ s32 rectLeft;
+ s32 rectTop;
+
+ OPEN_DISPS(play->state.gfxCtx);
+
+ func_8012C628(play->state.gfxCtx);
+
+ gDPSetRenderMode(POLY_OPA_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
+ gDPSetCombineMode(POLY_OPA_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, 220);
+ gDPFillRectangle(POLY_OPA_DISP++, 24, 12, 298, 228);
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetCombineLERP(POLY_OPA_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
+ PRIMITIVE, 0);
+
+ gfxRef = POLY_OPA_DISP;
+ gfx = Graph_GfxPlusOne(gfxRef);
+ gSPDisplayList(OVERLAY_DISP++, gfx);
+
+ KaleidoScope_DrawInventoryEditorText(&gfx);
+
+ gSPEndDisplayList(gfx++);
+ Graph_BranchDlist(gfxRef, gfx);
+ POLY_OPA_DISP = gfx;
+
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 0, 0, 255);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0);
+
+ // Current Health Quarter (X / 4)
+ KaleidoScope_DrawDigit(play, (((void)0, gSaveContext.save.playerData.health) % 0x10) / 4, 217, 15);
+
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
+
+ // Rupees
+ counterDigits[0] = counterDigits[1] = counterDigits[2] = 0;
+ counterDigits[3] = gSaveContext.save.playerData.rupees;
+ while (counterDigits[3] >= 1000) {
+ counterDigits[0]++;
+ counterDigits[3] -= 1000;
+ }
+
+ while (counterDigits[3] >= 100) {
+ counterDigits[1]++;
+ counterDigits[3] -= 100;
+ }
+
+ while (counterDigits[3] >= 10) {
+ counterDigits[2]++;
+ counterDigits[3] -= 10;
+ }
+
+ // Loop over columns (i)
+ for (i = 0, rectLeft = 68; i < 4; i++, rectLeft += 9) {
+ KaleidoScope_DrawDigit(play, counterDigits[i], rectLeft, 15);
+ }
+
+ // Health capacity
+ counterDigits[2] = 0;
+ counterDigits[3] = gSaveContext.save.playerData.healthCapacity / 0x10;
+ while (counterDigits[3] >= 10) {
+ counterDigits[2]++;
+ counterDigits[3] -= 10;
+ }
+
+ KaleidoScope_DrawDigit(play, counterDigits[2], 145, 15);
+ KaleidoScope_DrawDigit(play, counterDigits[3], 154, 15);
+
+ // Health
+ counterDigits[2] = 0;
+ counterDigits[3] = gSaveContext.save.playerData.health / 0x10;
+ while (counterDigits[3] >= 10) {
+ counterDigits[2]++;
+ counterDigits[3] -= 10;
+ }
+
+ KaleidoScope_DrawDigit(play, counterDigits[2], 195, 15);
+ KaleidoScope_DrawDigit(play, counterDigits[3], 204, 15);
+
+ // Items
+ // Loop over rows (i)
+ for (slot = 0, i = 0, rectTop = 38; i < 4; i++, rectTop += 14) {
+ // Loop over columns (j)
+ for (j = 0, rectLeft = 44; j < 6; j++, slot++, rectLeft += 23) {
+ counterDigits[3] = 0;
+ counterDigits[2] = 0;
+ if ((slot == SLOT_BOW) || ((slot >= SLOT_BOMB) && (slot <= SLOT_NUT)) || (slot == SLOT_POWDER_KEG) ||
+ (slot == SLOT_MAGIC_BEANS)) {
+ counterDigits[3] = AMMO(gAmmoItems[slot]);
+ } else if ((slot == SLOT_TRADE_DEED) || (slot == SLOT_TRADE_KEY_MAMA) || (slot == SLOT_TRADE_COUPLE)) {
+ counterDigits[3] = gSaveContext.save.inventory.items[slot];
+ } else if (slot >= SLOT_BOTTLE_1) {
+ counterDigits[3] = gSaveContext.save.inventory.items[slot];
+ } else if (gSaveContext.save.inventory.items[slot] != ITEM_NONE) {
+ counterDigits[3] = 1;
+ }
+
+ if (counterDigits[3] != ITEM_NONE) {
+ while (counterDigits[3] >= 10) {
+ counterDigits[2]++;
+ counterDigits[3] -= 10;
+ }
+ } else {
+ counterDigits[2] = counterDigits[3] = 0;
+ }
+
+ if (counterDigits[2] != 0) {
+ KaleidoScope_DrawDigit(play, counterDigits[2], rectLeft, rectTop);
+ }
+ KaleidoScope_DrawDigit(play, counterDigits[3], rectLeft + 9, rectTop);
+ }
+ }
+
+ // Masks
+ // Loop over rows (i)
+ for (slot = 0, i = 0, rectTop = 38; i < 4; i++, rectTop += 14) {
+ // Loop over columns (j)
+ for (j = 0, rectLeft = 204; j < 6; j++, slot++, rectLeft += 14) {
+ counterDigits[2] = 0;
+
+ if (gSaveContext.save.inventory.items[SLOT_MASK_POSTMAN + slot] != ITEM_NONE) {
+ counterDigits[2] = 1;
+ }
+ KaleidoScope_DrawDigit(play, counterDigits[2], rectLeft, rectTop);
+ }
+ }
+
+ // Boss Remains
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 44, i = 0; i < 4; i++) {
+ counterDigits[2] = 0;
+ if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA + i)) {
+ counterDigits[2] = 1;
+ }
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 112);
+ counterDigits[1] += 14;
+ }
+
+ // Sword
+ KaleidoScope_DrawDigit(play, GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD), 116, 100);
+
+ // Shield
+ KaleidoScope_DrawDigit(play, GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD), 145, 100);
+
+ // Songs
+ // Loop over rows (j), (counterDigits[3] stores rectTop)
+ for (counterDigits[3] = 100, j = 0, slot = 0; j < 2; j++) {
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 190, i = 0; i < 6; i++, slot++) {
+ counterDigits[2] = 0;
+ if (CHECK_QUEST_ITEM(QUEST_SONG_SONATA + slot)) {
+ counterDigits[2] = 1;
+ }
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], counterDigits[3]);
+ counterDigits[1] += 14;
+ }
+ counterDigits[3] += 14;
+ }
+
+ // Goron Lullaby Intro
+ counterDigits[2] = 0;
+ counterDigits[3] -= 14;
+ if (CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO)) {
+ counterDigits[2] = 1;
+ }
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], counterDigits[3]);
+
+ // Bombers Notebook
+ counterDigits[2] = 0;
+ if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
+ counterDigits[2] = 1;
+ }
+ KaleidoScope_DrawDigit(play, counterDigits[2], 56, 142);
+
+ // Quiver
+ KaleidoScope_DrawDigit(play, CUR_UPG_VALUE(UPG_QUIVER), 114, 134);
+
+ // Bomb Bag
+ KaleidoScope_DrawDigit(play, CUR_UPG_VALUE(UPG_BOMB_BAG), 156, 134);
+
+ // Gold Skulls (Swamp Spider House)
+ counterDigits[2] = 0;
+ counterDigits[1] = 0;
+ counterDigits[3] = Inventory_GetSkullTokenCount(SCENE_KINSTA1);
+
+ while (counterDigits[3] >= 100) {
+ counterDigits[3] -= 100;
+ counterDigits[1]++;
+ }
+
+ while (counterDigits[3] >= 10) {
+ counterDigits[3] -= 10;
+ counterDigits[2]++;
+ }
+
+ KaleidoScope_DrawDigit(play, counterDigits[1], 196, 130);
+ KaleidoScope_DrawDigit(play, counterDigits[2], 205, 130);
+ KaleidoScope_DrawDigit(play, counterDigits[3], 214, 130);
+
+ // Gold Skulls (Oceans Spider House)
+ counterDigits[2] = 0;
+ counterDigits[1] = 0;
+ counterDigits[3] = Inventory_GetSkullTokenCount(SCENE_KINDAN2);
+
+ while (counterDigits[3] >= 100) {
+ counterDigits[3] -= 100;
+ counterDigits[1]++;
+ }
+
+ while (counterDigits[3] >= 10) {
+ counterDigits[3] -= 10;
+ counterDigits[2]++;
+ }
+
+ KaleidoScope_DrawDigit(play, counterDigits[1], 196, 144);
+ KaleidoScope_DrawDigit(play, counterDigits[2], 205, 144);
+ KaleidoScope_DrawDigit(play, counterDigits[3], 214, 144);
+
+ // Heart Pieces
+ KaleidoScope_DrawDigit(play, GET_QUEST_HEART_PIECE_COUNT, 264, 134);
+
+ // Keys
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 45, i = 0; i < 4; i++) {
+ counterDigits[2] = 0;
+
+ if ((counterDigits[3] = DUNGEON_KEY_COUNT(i)) >= 0) {
+ while (counterDigits[3] >= 10) {
+ counterDigits[2]++;
+ counterDigits[3] -= 10;
+ }
+ } else {
+ counterDigits[2] = counterDigits[3] = 0;
+ }
+
+ KaleidoScope_DrawDigit(play, counterDigits[3], counterDigits[1], 168);
+ counterDigits[1] += 12;
+ }
+
+ // Dungeon Items
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 129, i = 0; i < 4; i++) {
+ counterDigits[2] = gSaveContext.save.inventory.dungeonItems[i] & gEquipMasks[0];
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 168);
+ counterDigits[1] += 12;
+ }
+
+ // Stray Fairies
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 202, i = 0; i < 4; i++) {
+ counterDigits[3] = gSaveContext.save.inventory.strayFairies[i];
+ counterDigits[2] = counterDigits[3] / 10;
+ counterDigits[3] -= counterDigits[2] * 10;
+ if (counterDigits[2] != 0) {
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 168);
+ }
+ KaleidoScope_DrawDigit(play, counterDigits[3], counterDigits[1] + 9, 168);
+ counterDigits[1] += 21;
+ }
+
+ // Double Defence
+ KaleidoScope_DrawDigit(play, gSaveContext.save.playerData.doubleDefense, 44, 202);
+
+ // Magic
+ //! @bug should be gSaveContext.save.playerData.doubleMagic
+ KaleidoScope_DrawDigit(play, gSaveContext.save.playerData.doubleDefense, 75, 202);
+
+ // Lottery
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 139, i = 0; i < 3; i++) {
+ counterDigits[2] = gSaveContext.save.lotteryCodes[0][i];
+
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 184);
+ counterDigits[2] = gSaveContext.save.lotteryCodes[1][i];
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 198);
+
+ counterDigits[2] = gSaveContext.save.lotteryCodes[2][i];
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 212);
+
+ counterDigits[1] += 12;
+ }
+
+ // Oceanside Spider House Mask Order
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 217, i = 0; i < 6; i++) {
+ counterDigits[2] = gSaveContext.save.spiderHouseMaskOrder[i];
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 186);
+
+ counterDigits[1] += 12;
+ }
+
+ // Bombers code
+ // Loop over columns (i), (counterDigits[1] stores rectLeft)
+ for (counterDigits[1] = 220, i = 0; i < 5; i++) {
+ counterDigits[2] = gSaveContext.save.bomberCode[i];
+ KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 210);
+
+ counterDigits[1] += 12;
+ }
+
+ // Draws a highlight on the selected section
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetRenderMode(POLY_OPA_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
+ gDPSetCombineMode(POLY_OPA_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 200, 120);
+
+ gDPFillRectangle(POLY_OPA_DISP++, sSectionPositions[sCurSection].screenX, sSectionPositions[sCurSection].screenY,
+ sSectionPositions[sCurSection].screenX + sSectionPositions[sCurSection].width,
+ sSectionPositions[sCurSection].screenY + 15);
+
+ CLOSE_DISPS(play->state.gfxCtx);
+}
+
+void KaleidoScope_UpdateInventoryEditor(PlayState* play) {
+ static s32 sPrevDBtnInput = 0;
+ static s32 sHeldDBtnTimer = 0;
+ PauseContext* pauseCtx = &play->pauseCtx;
+ Input* input = CONTROLLER1(&play->state);
+ s16 slot;
+ s16 value;
+ s32 dBtnInput = input->cur.button & (BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT);
+
+ pauseCtx->stickRelX = input->rel.stick_x;
+ pauseCtx->stickRelY = input->rel.stick_y;
+
+ // 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
+ if (dBtnInput == sPrevDBtnInput) {
+ sHeldDBtnTimer--;
+ if (sHeldDBtnTimer < 0) {
+ sHeldDBtnTimer = 1;
+ } else {
+ dBtnInput ^= sPrevDBtnInput;
+ }
+ } else {
+ sPrevDBtnInput = dBtnInput;
+ sHeldDBtnTimer = 16;
+ }
+
+ if (CHECK_BTN_ANY(dBtnInput, BTN_DDOWN)) {
+ sCurRow++;
+ if (sCurRow > 17) {
+ sCurRow = 0;
+ }
+ sCurSection = sRowFirstSections[sCurRow];
+ } else if (CHECK_BTN_ANY(dBtnInput, BTN_DUP)) {
+ sCurRow--;
+ if (sCurRow < 0) {
+ sCurRow = 17;
+ }
+ sCurSection = sRowFirstSections[sCurRow];
+ } else if (CHECK_BTN_ANY(dBtnInput, BTN_DLEFT)) {
+ sCurSection--;
+ if (sCurSection < 0) {
+ sCurSection = ARRAY_COUNT(sSectionPositions) - 1;
+ }
+ } else if (CHECK_BTN_ANY(dBtnInput, BTN_DRIGHT)) {
+ sCurSection++;
+ if (sCurSection > (ARRAY_COUNT(sSectionPositions) - 1)) {
+ sCurSection = 0;
+ }
+ }
+
+ // Handles the logic to change values based on the selected section
+ switch (sCurSection) {
+ case INV_EDITOR_SECTION_RUPEE:
+ // Rupees
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
+ gSaveContext.save.playerData.rupees -= 100;
+ if (gSaveContext.save.playerData.rupees < 0) {
+ gSaveContext.save.playerData.rupees = 0;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) {
+ gSaveContext.save.playerData.rupees += 100;
+ if (gSaveContext.save.playerData.rupees >= 9999) {
+ gSaveContext.save.playerData.rupees = 9999;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ gSaveContext.save.playerData.rupees--;
+ if (gSaveContext.save.playerData.rupees < 0) {
+ gSaveContext.save.playerData.rupees = 0;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ gSaveContext.save.playerData.rupees++;
+ if (gSaveContext.save.playerData.rupees >= 9999) {
+ gSaveContext.save.playerData.rupees = 9999;
+ }
+ }
+ break;
+
+ case INV_EDITOR_SECTION_HEALTH_CAPACITY:
+ // Health Capacity
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ gSaveContext.save.playerData.healthCapacity -= 0x10;
+ if (gSaveContext.save.playerData.healthCapacity < 0x30) {
+ gSaveContext.save.playerData.healthCapacity = 0x30;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ gSaveContext.save.playerData.healthCapacity += 0x10;
+ if (gSaveContext.save.playerData.healthCapacity >= 0x140) {
+ gSaveContext.save.playerData.healthCapacity = 0x140;
+ }
+ }
+ break;
+
+ case INV_EDITOR_SECTION_HEALTH:
+ // Health
+ if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ Health_ChangeBy(play, -4);
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ Health_ChangeBy(play, 4);
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
+ Health_ChangeBy(play, -0x10);
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) {
+ Health_ChangeBy(play, 0x10);
+ }
+ break;
+
+ case INV_EDITOR_SECTION_HEART_PIECE_COUNT:
+ // Heart Piece Count
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ if (GET_QUEST_HEART_PIECE_COUNT != 0) {
+ DECREMENT_QUEST_HEART_PIECE_COUNT;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ if (LEQ_MAX_QUEST_HEART_PIECE_COUNT) {
+ INCREMENT_QUEST_HEART_PIECE_COUNT;
+ }
+ }
+ break;
+
+ default:
+ if (sCurSection < INV_EDITOR_SECTION_BOSS) {
+ // Items
+ slot = sCurSection - INV_EDITOR_SECTION_ITEMS;
+ if ((slot == SLOT_BOW) || ((slot >= SLOT_BOMB) && (slot <= SLOT_NUT)) || (slot == SLOT_POWDER_KEG) ||
+ (slot == SLOT_MAGIC_BEANS)) {
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
+ Inventory_DeleteItem(gAmmoItems[slot], SLOT(gAmmoItems[slot]));
+ AMMO(gAmmoItems[slot]) = 0;
+ }
+
+ if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ if (slot != INV_CONTENT(gAmmoItems[slot])) {
+ INV_CONTENT(gAmmoItems[slot]) = gAmmoItems[slot];
+ }
+ AMMO(gAmmoItems[slot])++;
+ if (AMMO(gAmmoItems[slot]) > 99) {
+ AMMO(gAmmoItems[slot]) = 99;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ AMMO(gAmmoItems[slot])--;
+ if (AMMO(gAmmoItems[slot]) < 0) {
+ AMMO(gAmmoItems[slot]) = 0;
+ }
+ }
+ } else if ((slot == SLOT_TRADE_DEED) || (slot == SLOT_TRADE_KEY_MAMA) || (slot == SLOT_TRADE_COUPLE)) {
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
+ value = sSlotItems[slot];
+ Inventory_DeleteItem(value, slot);
+ } else if (slot == SLOT_TRADE_DEED) {
+ if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ if (INV_CONTENT(ITEM_MOON_TEAR) == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_MOON_TEAR;
+ } else if ((INV_CONTENT(ITEM_MOON_TEAR) >= ITEM_MOON_TEAR) &&
+ (INV_CONTENT(ITEM_MOON_TEAR) <= ITEM_DEED_MOUNTAIN)) {
+ gSaveContext.save.inventory.items[slot] = INV_CONTENT(ITEM_MOON_TEAR) + 1;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ if (INV_CONTENT(ITEM_MOON_TEAR) == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_DEED_OCEAN;
+ } else if ((INV_CONTENT(ITEM_MOON_TEAR) >= ITEM_DEED_LAND) &&
+ (INV_CONTENT(ITEM_MOON_TEAR) <= ITEM_DEED_OCEAN)) {
+ gSaveContext.save.inventory.items[slot] = INV_CONTENT(ITEM_MOON_TEAR) - 1;
+ }
+ }
+ } else if (slot == SLOT_TRADE_KEY_MAMA) {
+ if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ if (INV_CONTENT(ITEM_ROOM_KEY) == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_ROOM_KEY;
+ } else if ((INV_CONTENT(ITEM_ROOM_KEY) >= ITEM_ROOM_KEY) &&
+ (INV_CONTENT(ITEM_ROOM_KEY) <= ITEM_ROOM_KEY)) {
+ gSaveContext.save.inventory.items[slot] = INV_CONTENT(ITEM_ROOM_KEY) + 1;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ if (INV_CONTENT(ITEM_ROOM_KEY) == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_LETTER_MAMA;
+ } else if ((INV_CONTENT(ITEM_ROOM_KEY) >= ITEM_LETTER_MAMA) &&
+ (INV_CONTENT(ITEM_ROOM_KEY) <= ITEM_LETTER_MAMA)) {
+ gSaveContext.save.inventory.items[slot] = INV_CONTENT(ITEM_ROOM_KEY) - 1;
+ }
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ if (INV_CONTENT(ITEM_LETTER_TO_KAFEI) == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_LETTER_TO_KAFEI;
+ } else if ((INV_CONTENT(ITEM_LETTER_TO_KAFEI) >= ITEM_LETTER_TO_KAFEI) &&
+ (INV_CONTENT(ITEM_LETTER_TO_KAFEI) <= ITEM_LETTER_TO_KAFEI)) {
+ gSaveContext.save.inventory.items[slot] = INV_CONTENT(ITEM_LETTER_TO_KAFEI) + 1;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ if (INV_CONTENT(ITEM_LETTER_TO_KAFEI) == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_PENDANT_OF_MEMORIES;
+ } else if ((INV_CONTENT(ITEM_LETTER_TO_KAFEI) >= ITEM_PENDANT_OF_MEMORIES) &&
+ (INV_CONTENT(ITEM_LETTER_TO_KAFEI) <= ITEM_PENDANT_OF_MEMORIES)) {
+ gSaveContext.save.inventory.items[slot] = INV_CONTENT(ITEM_LETTER_TO_KAFEI) - 1;
+ }
+ }
+ } else if ((slot >= SLOT_BOTTLE_1) && (slot <= SLOT_BOTTLE_6)) {
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
+ value = ITEM_BOTTLE + slot - SLOT_BOTTLE_1;
+ Inventory_DeleteItem(value, SLOT(ITEM_BOTTLE) + slot - SLOT_BOTTLE_1);
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ if (gSaveContext.save.inventory.items[slot] == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_BOTTLE;
+ } else if ((gSaveContext.save.inventory.items[slot] >= ITEM_BOTTLE) &&
+ (gSaveContext.save.inventory.items[slot] <= ITEM_HYLIAN_LOACH)) {
+ gSaveContext.save.inventory.items[slot] = gSaveContext.save.inventory.items[slot] + 1;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ if (gSaveContext.save.inventory.items[slot] == ITEM_NONE) {
+ gSaveContext.save.inventory.items[slot] = ITEM_OBABA_DRINK;
+ } else if ((gSaveContext.save.inventory.items[slot] >= ITEM_POTION_RED) &&
+ (gSaveContext.save.inventory.items[slot] <= ITEM_OBABA_DRINK)) {
+ gSaveContext.save.inventory.items[slot] = gSaveContext.save.inventory.items[slot] - 1;
+ }
+ }
+ } else {
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ value = sSlotItems[slot];
+ if (gSaveContext.save.inventory.items[slot] == ITEM_NONE) {
+ INV_CONTENT(value) = value;
+ } else {
+ Inventory_DeleteItem(value, slot);
+ }
+ }
+ }
+
+ } else if (sCurSection == INV_EDITOR_SECTION_SWORD) {
+ // Sword
+ value = GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD);
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ value--;
+ if (value < EQUIP_VALUE_SWORD_NONE) {
+ value = EQUIP_VALUE_SWORD_NONE;
+ }
+
+ SET_EQUIP_VALUE(EQUIP_TYPE_SWORD, value);
+
+ if (value != 0) {
+ BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = value + (ITEM_SWORD_KOKIRI - 1);
+ gSaveContext.save.playerData.swordHealth = 100;
+ } else {
+ BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = ITEM_NONE;
+ }
+
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ value++;
+ if (value > EQUIP_VALUE_SWORD_DIETY) {
+ value = EQUIP_VALUE_SWORD_DIETY;
+ }
+
+ SET_EQUIP_VALUE(EQUIP_TYPE_SWORD, value);
+
+ BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = value + (ITEM_SWORD_KOKIRI - 1);
+ gSaveContext.save.playerData.swordHealth = 100;
+ }
+
+ Interface_LoadItemIconImpl(play, EQUIP_SLOT_B);
+
+ } else if (sCurSection == INV_EDITOR_SECTION_SHIELD) {
+ // Shield
+ value = GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD);
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ value--;
+ if (value < EQUIP_VALUE_SHIELD_NONE) {
+ value = EQUIP_VALUE_SHIELD_NONE;
+ }
+
+ SET_EQUIP_VALUE(EQUIP_TYPE_SHIELD, value);
+
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ value++;
+ if (value > EQUIP_VALUE_SHIELD_MAX) {
+ value = EQUIP_VALUE_SHIELD_MAX;
+ }
+ SET_EQUIP_VALUE(EQUIP_TYPE_SHIELD, value);
+ }
+
+ } else if (sCurSection == INV_EDITOR_SECTION_QUIVER) {
+ // Quiver
+ value = GET_CUR_UPG_VALUE(UPG_QUIVER);
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ value--;
+ if (value < 0) {
+ value = 0;
+ }
+ Inventory_ChangeUpgrade(UPG_QUIVER, value);
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ value++;
+ if (value > 3) {
+ value = 3;
+ }
+ Inventory_ChangeUpgrade(UPG_QUIVER, value);
+ }
+
+ } else if (sCurSection == INV_EDITOR_SECTION_BOMB_BAG) {
+ // Bomb Bag
+ value = GET_CUR_UPG_VALUE(UPG_BOMB_BAG);
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ value--;
+ if (value < 0) {
+ value = 0;
+ }
+ Inventory_ChangeUpgrade(UPG_BOMB_BAG, value);
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ value++;
+ if (value > 3) {
+ value = 3;
+ }
+ Inventory_ChangeUpgrade(UPG_BOMB_BAG, value);
+ }
+
+ } else if (sCurSection == INV_EDITOR_SECTION_SWAMP_GOLD_SKULLS) {
+ // Gold Skulls (Swamp Spider House)
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ if (((gSaveContext.save.skullTokenCount & 0xFFFF0000) >> 0x10) != 0) {
+ gSaveContext.save.skullTokenCount =
+ ((u16)(((gSaveContext.save.skullTokenCount & 0xFFFF0000) >> 0x10) - 1) << 0x10) |
+ (gSaveContext.save.skullTokenCount & 0xFFFF);
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ gSaveContext.save.skullTokenCount =
+ ((u16)(((gSaveContext.save.skullTokenCount & 0xFFFF0000) >> 0x10) + 1) << 0x10) |
+ (gSaveContext.save.skullTokenCount & 0xFFFF);
+ }
+
+ } else if (sCurSection == INV_EDITOR_SECTION_OCEAN_GOLD_SKULLS) {
+ // Gold Skulls (Oceans Spider House)
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ if (((u16)gSaveContext.save.skullTokenCount) != 0) {
+ gSaveContext.save.skullTokenCount = (((u16)gSaveContext.save.skullTokenCount - 1) & 0xFFFF) |
+ (gSaveContext.save.skullTokenCount & 0xFFFF0000);
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ gSaveContext.save.skullTokenCount = (((u16)gSaveContext.save.skullTokenCount + 1) & 0xFFFF) |
+ (gSaveContext.save.skullTokenCount & 0xFFFF0000);
+ }
+
+ } else if (sCurSection == INV_EDITOR_SECTION_NOTEBOOK) {
+ // Bombers Notebook
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ gSaveContext.save.inventory.questItems ^= gBitFlags[QUEST_BOMBERS_NOTEBOOK];
+ }
+
+ } else if (sCurSection == INV_EDITOR_SECTION_LULLABY_INTRO) {
+ // Goron Lullaby Intro
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ gSaveContext.save.inventory.questItems ^= gBitFlags[QUEST_SONG_LULLABY_INTRO];
+ }
+
+ } else if (sCurSection < INV_EDITOR_SECTION_LULLABY_INTRO) {
+ // Boss Remains and Songs
+ //! Note: quest items must align with section, and all cases below INV_EDITOR_SECTION_LULLABY_INTRO must
+ //! have also been taken
+ slot = sCurSection - INV_EDITOR_SECTION_BOSS;
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ gSaveContext.save.inventory.questItems ^= gBitFlags[slot];
+ }
+
+ } else if (sCurSection < INV_EDITOR_SECTION_DUNGEON_ITEMS) {
+ // Dungeon Small Keys
+ slot = sCurSection - INV_EDITOR_SECTION_SMALL_KEYS;
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ DUNGEON_KEY_COUNT(slot)--;
+ if (DUNGEON_KEY_COUNT(slot) < 0) {
+ DUNGEON_KEY_COUNT(slot) = -1;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ if (DUNGEON_KEY_COUNT(slot) < 0) {
+ DUNGEON_KEY_COUNT(slot) = 1;
+ } else {
+ DUNGEON_KEY_COUNT(slot)++;
+ if (DUNGEON_KEY_COUNT(slot) >= 9) {
+ DUNGEON_KEY_COUNT(slot) = 9;
+ }
+ }
+ }
+
+ } else if (sCurSection < INV_EDITOR_SECTION_STRAY_FAIRIES) {
+ // Dungeon Items
+ slot = sCurSection - INV_EDITOR_SECTION_DUNGEON_ITEMS;
+ if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ // Map
+ gSaveContext.save.inventory.dungeonItems[slot] ^= 4;
+ }
+ if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) {
+ // Compass
+ gSaveContext.save.inventory.dungeonItems[slot] ^= 2;
+ }
+ if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ // Boss Key
+ gSaveContext.save.inventory.dungeonItems[slot] ^= 1;
+ }
+
+ } else if (sCurSection < INV_EDITOR_SECTION_DOUBLE_DEFENSE) {
+ // Stray Fairies
+ slot = sCurSection - INV_EDITOR_SECTION_STRAY_FAIRIES;
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
+ gSaveContext.save.inventory.strayFairies[slot]--;
+ if (gSaveContext.save.inventory.strayFairies[slot] < 0) {
+ gSaveContext.save.inventory.strayFairies[slot] = 0;
+ }
+ } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ gSaveContext.save.inventory.strayFairies[slot]++;
+ if (gSaveContext.save.inventory.strayFairies[slot] >= 99) {
+ gSaveContext.save.inventory.strayFairies[slot] = 99;
+ }
+ }
+
+ } else {
+ // Double Defence
+ if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT) ||
+ CHECK_BTN_ALL(input->press.button, BTN_CDOWN) || CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
+ gSaveContext.save.playerData.doubleDefense ^= 1;
+ if (!gSaveContext.save.playerData.doubleDefense) {
+ gSaveContext.save.inventory.defenseHearts = 0;
+ } else {
+ gSaveContext.save.inventory.defenseHearts = 20;
+ }
+ }
+ }
+ break;
+ }
+
+ // Handles exiting the inventory editor with the L button
+ // The editor is opened with `debugEditor` set to DEBUG_EDITOR_INVENTORY_INIT,
+ // and becomes closable after a frame once `debugEditor` is set to DEBUG_EDITOR_INVENTORY
+ if (pauseCtx->debugEditor == DEBUG_EDITOR_INVENTORY_INIT) {
+ pauseCtx->debugEditor = DEBUG_EDITOR_INVENTORY;
+ } else if ((pauseCtx->debugEditor == DEBUG_EDITOR_INVENTORY) && CHECK_BTN_ALL(input->press.button, BTN_L)) {
+ pauseCtx->debugEditor = DEBUG_EDITOR_NONE;
+ }
+}
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
index 11d0b1207..ae2140f2c 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
@@ -16,6 +16,64 @@ extern UNK_TYPE D_0B000000;
extern UNK_TYPE D_0C000000;
extern UNK_TYPE D_0C006C00;
+s32 D_8082B3C0 = 0;
+
+s32 D_8082B3C4 = 0;
+
+s16 D_8082B3C8 = 10;
+
+u8 D_8082B3CC[5][24] = {
+ {
+ false, false, false, false, false, false, false, false, false, false, false, false,
+ false, false, false, false, false, false, true, true, true, true, true, true,
+ },
+ {
+ true, false, false, false, false, true, false, false, false, false, false, true,
+ true, true, true, false, false, true, true, true, true, true, true, true,
+ },
+ {
+ true, false, false, false, false, true, false, false, false, false, false, true,
+ false, true, true, false, false, true, true, true, true, true, true, true,
+ },
+ {
+ true, false, false, false, false, true, false, false, false, true, false, true,
+ false, true, true, false, false, true, true, true, true, true, true, true,
+ },
+ {
+ true, true, true, true, true, true, true, true, true, true, true, true,
+ false, true, true, true, true, true, true, true, true, true, true, true,
+ },
+};
+
+s16 D_8082B444[] = {
+ 0x005F, 0x003E, 0x005F, 0x0080, 0x00A1, 0x00C2, 0x003E, 0x005F,
+};
+
+s16 D_8082B454[] = {
+ 0x0055, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0096, 0x0096, 0x00FF, 0x0064,
+ 0x00FF, 0x0000, 0x0000, 0x0064, 0x00FF, 0x0000, 0x0000, 0x00FF, 0x0064, 0x0000,
+};
+
+u8 D_8082B47C[] = {
+ 0x35, 0x33, 0x34, 0x32, 0xFF,
+};
+
+s16 D_8082B484[] = {
+ 0x0294,
+ 0x0384,
+ 0x0474,
+ 0x0000,
+};
+
+s16 D_8082B48C[] = {
+ 0x044C,
+ 0x0398,
+ 0x044C,
+ 0x0000,
+};
+
+s32 D_8082B494[] = { 0, 0, 0 };
+
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8081B240.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8081B6BC.s")
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
index 83869bd10..6e23e8f6f 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
@@ -16,6 +16,87 @@ extern UNK_TYPE D_0B000000;
extern UNK_TYPE D_0C000000;
extern UNK_TYPE D_0C006C00;
+s32 D_8082B4A0[] = { 0x09003600, 0x09003F00, 0x09004800 };
+
+s32 D_8082B4AC[] = {
+ 0x0D000000,
+ 0x0D000800,
+ 0x0D001000,
+ 0x0D001800,
+};
+
+s16 D_8082B4BC[] = {
+ 0x0043,
+ 0x0051,
+ 0x005F,
+ 0x006D,
+};
+
+s16 D_8082B4C4 = 0x7B;
+s16 D_8082B4C8 = 30;
+s16 D_8082B4CC = 0;
+s16 D_8082B4D0 = 0xF;
+s16 D_8082B4D4 = 0;
+s16 D_8082B4D8 = 0xFF;
+f32 D_8082B4DC = 100.0f;
+
+s32 D_8082B4E0[] = {
+ 0x02008998, 0x0C001B80, 0x02008998, 0x0C001B80, 0x02009598, 0x0C002780, 0x02009598, 0x0C002780,
+ 0x0200A198, 0x0C003380, 0x0200A198, 0x0C003380, 0x0200AD98, 0x0C003F80, 0x0200AD98, 0x0C003F80,
+};
+
+s32 D_8082B520[] = {
+ 0xFF6EA05A,
+ 0xFF6478FF,
+ 0xFFF5F55A,
+};
+
+s32 D_8082B52C[] = {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFE1AA00,
+};
+
+s32 D_8082B538[] = {
+ 0x00000400,
+ 0x00000000,
+ 0x00000000,
+ 0x00000000,
+};
+
+s16 D_8082B548[] = {
+ 0x0C00, 0x8418, 0x0C00, 0x9098, 0x0C01, 0x2898, 0x0C01, 0x35D8, 0x0C01, 0x4318,
+ 0x0C00, 0xDE58, 0x0C00, 0xEB58, 0x0C00, 0xFAA8, 0x0C00, 0x9858, 0x0C00, 0x9E58,
+ 0x0C00, 0xAE58, 0x0C00, 0xBE58, 0x0C00, 0xCE58, 0x0C01, 0x09F8, 0x0C01, 0x1958,
+};
+
+s16 D_8082B584[] = {
+ 0x0000, 0x0000, 0x00FF, 0x00FF, 0x00FF, 0x0000,
+};
+
+s16 D_8082B590[] = {
+ 0x00FF, 0x00FF, 0x0000, 0x0000, 0x0000, 0x00FF,
+};
+
+s16 D_8082B59C[] = {
+ 0x0056, 0x0068, 0x0091, 0x0099, 0x00A3, 0x009F, 0x009D, 0x00C7, 0x00D0, 0x00D2, 0x00DA, 0x0000,
+};
+
+s16 D_8082B5B4[] = {
+ 0x007F, 0x0099, 0x008A, 0x00AB, 0x0092, 0x0077, 0x004D, 0x006A, 0x0078, 0x0049, 0x0063, 0x0000,
+};
+
+s16 D_8082B5CC[] = {
+ 0x0005, 0x0004, 0x0006, 0x0000, 0x0008, 0x0005, 0x0004, 0x0006, 0x0000, 0x0008,
+};
+
+u16 D_8082B5E0[] = {
+ 0xAF, 0xB3, 0xAA, 0xB1, 0xA9, 0xB2, 0xA8, 0xB0, 0xAC, 0xAE,
+};
+u16 D_8082B5F4 = 0;
+
+s32 D_8082B5F8[] = { 0, 0 };
+
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8081D240.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8081D6DC.s")
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
index 04fa566e3..aa24bf2e2 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
@@ -16,6 +16,48 @@ extern UNK_TYPE D_0B000000;
extern UNK_TYPE D_0C000000;
extern UNK_TYPE D_0C006C00;
+s32 D_8082B600 = 0;
+
+s32 D_8082B604 = 0;
+
+s16 D_8082B608 = 10;
+
+s32 D_8082B60C[] = {
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00010000,
+ 0x00000001, 0x00000000, 0x00010000, 0x00000001, 0x00000000, 0x00010000, 0x00000001, 0x00000000,
+ 0x00010000, 0x00000001, 0x00000000, 0x00010000, 0x00000001, 0x00000000, 0x00010000, 0x00000001,
+ 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101,
+};
+
+s32 D_8082B684[] = {
+ 0x01010004, 0x02020180, 0x01040210, 0x00100201, 0x00080110, 0x02040220, 0x00400080, 0x00020102, 0x00010240,
+ 0x01200108, 0x00200140, 0x02080280, 0x00FF0064, 0x00FF0000, 0x00000064, 0x00FF0000, 0x000000FF, 0x00640000,
+};
+
+u8 D_8082B6CC[] = { 0x35, 0x33, 0x34, 0x32, 0xFF };
+
+s16 D_8082B6D4[] = {
+ 0x0294,
+ 0x0384,
+ 0x0474,
+ 0x0000,
+};
+
+s16 D_8082B6DC[] = {
+ 0x044C,
+ 0x0398,
+ 0x044C,
+ 0x0000,
+};
+
+s32 D_8082B6E4[] = { 0, 0, 0 };
+
+s16 D_8082B6F0[] = { 100, 255 };
+
+s32 D_8082B6F4 = 0;
+
+s16 D_8082B6F8[] = { 10, 0, 0, 0 };
+
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8081FF80.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_808204AC.s")
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h
index 91c6b044d..f4c91e9e8 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h
@@ -1,8 +1,25 @@
-#ifndef _Z64_KALEIDO_SCOPE_H_
-#define _Z64_KALEIDO_SCOPE_H_
+#ifndef Z_KALEIDO_SCOPE_H
+#define Z_KALEIDO_SCOPE_H
#include "global.h"
+typedef enum {
+ /* 0x00 */ PAUSE_ITEM,
+ /* 0x01 */ PAUSE_MAP,
+ /* 0x02 */ PAUSE_QUEST,
+ /* 0x03 */ PAUSE_MASK,
+ /* 0x04 */ PAUSE_WORLD_MAP
+} PauseMenuPage;
+typedef enum {
+ /* 0 */ DEBUG_EDITOR_NONE,
+ /* 1 */ DEBUG_EDITOR_INVENTORY_INIT,
+ /* 2 */ DEBUG_EDITOR_INVENTORY,
+ /* 3 */ DEBUG_EDITOR_EVENTS
+} DebugEditor;
+
+// Debug
+void KaleidoScope_DrawInventoryEditor(PlayState* play);
+void KaleidoScope_UpdateInventoryEditor(PlayState* play);
#endif
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
index 5573ecb11..44575f156 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
@@ -16,6 +16,302 @@ extern UNK_TYPE D_0B000000;
extern UNK_TYPE D_0C000000;
extern UNK_TYPE D_0C006C00;
+void* D_8082B700[] = {
+ 0x08064440, 0x0806E440, 0x08077A40, 0x08081040, 0x0808A640, 0x0D003A00, 0x0806EE40, 0x08078440,
+ 0x08081A40, 0x0808B040, 0x08065840, 0x0806F840, 0x08078E40, 0x08082440, 0x0808BA40,
+};
+void* D_8082B73C[] = {
+ 0x0D004400, 0x08070240, 0x08079840, 0x08082E40, 0x0808C440, 0x0D004E00, 0x08070C40, 0x0807A240,
+ 0x08083840, 0x0808CE40, 0x0D005800, 0x08071640, 0x0807AC40, 0x08084240, 0x0808D840,
+};
+void* D_8082B778[] = {
+ 0x08068040, 0x08072040, 0x0807B640, 0x08084C40, 0x0808E240, 0x0D006200, 0x08072A40, 0x0807C040,
+ 0x08085640, 0x0808EC40, 0x08069440, 0x08073440, 0x0807CA40, 0x08086040, 0x0808F640,
+};
+void* D_8082B7B4[] = {
+ 0x0D006C00, 0x08073E40, 0x0807D440, 0x08086A40, 0x08090040, 0x0D007600, 0x08074840, 0x0807DE40,
+ 0x08087440, 0x08090A40, 0x0D008000, 0x08075240, 0x0807E840, 0x08087E40, 0x08091440,
+};
+
+s16 D_8082B7F0[] = {
+ 0x0050, 0x0040, 0x0040, 0x0040, 0x0010, 0x0040, 0x0070, 0x0070, 0x0030, 0x0040, 0x0040, 0x0040,
+ 0x0040, 0x0030, 0x0040, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
+ 0x0008, 0x0008, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
+};
+s16 D_8082B838[] = {
+ 0x0028, 0x001F, 0x0035, 0x0035, 0x0035, 0x0034, 0x0023, 0x0023, 0x0020, 0x0040, 0x0040, 0x0040,
+ 0x0040, 0x0052, 0x003D, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
+ 0x0008, 0x0008, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C,
+};
+
+s16 D_8082B880 = 0;
+s16 D_8082B884 = 0;
+s16 D_8082B888 = 0;
+s16 D_8082B88C = 255;
+s16 D_8082B890 = 0;
+s16 D_8082B894 = 0;
+s16 D_8082B898 = 0;
+s16 D_8082B89C = 0;
+s16 D_8082B8A0 = 0;
+s16 D_8082B8A4 = 0;
+s16 D_8082B8A8 = 255;
+s16 D_8082B8AC = 0;
+s16 D_8082B8B0 = 0;
+
+s16 D_8082B8B4 = false;
+
+f32 D_8082B8B8[] = {
+ -4.0f, 4.0f, 4.0f, 4.0f, 4.0f, -4.0f, -4.0f, -4.0f,
+};
+
+f32 D_8082B8D8[] = {
+ -4.0f, -4.0f, -4.0f, 4.0f, 4.0f, 4.0f, 4.0f, -4.0f,
+};
+
+s16 D_8082B8F8[] = {
+ PAUSE_MAP, PAUSE_MASK, PAUSE_QUEST, PAUSE_ITEM, PAUSE_MASK, PAUSE_MAP, PAUSE_ITEM, PAUSE_QUEST,
+};
+
+f32 D_8082B908 = 0.0f;
+f32 D_8082B90C = 0.0f;
+f32 D_8082B910 = 40.0f;
+f32 D_8082B914 = -40.0f;
+
+s32 D_8082B918 = 0;
+
+s32 D_8082B91C = 0;
+
+s16 D_8082B920 = 10;
+
+u8 D_8082B924[] = {
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x14, 0x00, 0x0A, 0x0F, 0x1F, 0x0F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+ 0x07, 0x07, 0x03, 0x0F, 0x07, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0x1F, 0x0F, 0x03, 0x0F, 0x00, 0x00,
+};
+
+s16 D_8082B944 = 0x42;
+
+s16 D_8082B948[][3] = {
+ { 0x00FF, 0x00FF, 0x00FF }, { 0x00FF, 0x00FF, 0x00FF }, { 0x00FF, 0x00FF, 0x0000 },
+ { 0x00FF, 0x00FF, 0x0000 }, { 0x0064, 0x0096, 0x00FF }, { 0x0064, 0x00FF, 0x00FF },
+};
+
+s16 D_8082B96C[][3] = {
+ { 0x0000, 0x0000, 0x0000 }, { 0x00AA, 0x00AA, 0x00AA }, { 0x0000, 0x0000, 0x0000 },
+ { 0x00FF, 0x00A0, 0x0000 }, { 0x0000, 0x0000, 0x0064 }, { 0x0000, 0x0096, 0x00FF },
+};
+
+s16 D_8082B990 = 10;
+s16 D_8082B994 = 0;
+
+s32 D_8082B998[] = {
+ 0x0D003300,
+ 0x0D002700,
+ 0x0D002B00,
+ 0x0D002F00,
+};
+
+s32 D_8082B9A8[] = {
+ 0x0D002B00,
+ 0x0D002F00,
+ 0x0D003300,
+ 0x0D002700,
+};
+
+s16 D_8082B9B8[] = {
+ 0x00B4, 0x00D2, 0x00FF, 0x00DC, 0x0064, 0x0064, 0x0096, 0x00DC,
+};
+
+s16 D_8082B9C8 = 20;
+
+s32 D_8082B9CC = 0;
+
+s16 D_8082B9D0[] = {
+ 0x00B4, 0x00D2, 0x00FF, 0x00DC, 0x0064, 0x0064, 0x0096, 0x00DC,
+};
+
+s16 D_8082B9E0 = 20;
+
+s32 D_8082B9E4 = 0;
+
+s32 D_8082B9E8 = 0;
+
+s32 D_8082B9EC = 0;
+
+s16 D_8082B9F0[] = {
+ 0xFFEB, 0xFF98, 0xFFB4, 0xFFD0, 0xFF98, 0xFFD8,
+};
+
+s32 D_8082B9FC = 0;
+
+s16 D_8082BA00[] = {
+ 0xFFD7, 0x0009, 0x002B, 0xFFEB, 0xFFDB, 0x002B, 0xFFBB, 0xFFBB, 0xFFE0, 0xFF93, 0xFFD3, 0xFF93,
+ 0xFFD3, 0x003B, 0xFFFB, 0xFFBA, 0xFFCC, 0xFFF5, 0xFFFE, 0x0008, 0x0002, 0x0001, 0x002B, 0x0034,
+ 0x0036, 0x003E, 0xFFB0, 0xFFC0, 0xFFF7, 0xFFFD, 0xFFF9, 0xFFF0, 0xFFFF, 0x0017, 0x002C, 0x0036,
+};
+
+s16 D_8082BA48[] = {
+ 0xFFB4, 0xFFC6, 0x000A, 0xFFC6, 0x000A, 0x0000,
+};
+
+s32 D_8082BA54 = 0;
+
+s32 D_8082BA58 = 0;
+
+s16 D_8082BA5C[] = {
+ 0x0080, 0x0018, 0x0018, 0x0018, 0x0020, 0x0018,
+};
+
+s32 D_8082BA68 = 0;
+
+s16 D_8082BA6C[] = {
+ 0x0098, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000,
+};
+
+s32 D_8082BA78 = 0;
+
+s32 D_8082BA7C = 0;
+
+s16 D_8082BA80[] = {
+ 0x0036, 0xFFD6, 0xFFD6, 0xFFD6, 0xFFE8, 0x0032,
+};
+
+s32 D_8082BA8C = 0;
+
+s16 D_8082BA90[] = {
+ 0x000B, 0x0016, 0xFFF0, 0xFFF0, 0xFFF0, 0x003B, 0x0018, 0x003B, 0xFFF5, 0xFFFB, 0xFFFB, 0x003B,
+ 0x003B, 0x0027, 0x001F, 0xFFF6, 0xFFDC, 0xFFED, 0xFFCB, 0xFFE5, 0xFFFE, 0x0029, 0x000B, 0xFFFD,
+ 0x002D, 0x0012, 0xFFF8, 0xFFDA, 0x0027, 0x001A, 0x0001, 0xFFF9, 0xFFE4, 0xFFE5, 0xFFFF, 0x0018,
+};
+
+s16 D_8082BAD8[] = {
+ 0x0024, 0x000A, 0x000A, 0xFFFA, 0xFFFA, 0x0000,
+};
+
+s32 D_8082BAE4 = 0;
+
+s32 D_8082BAE8 = 0;
+
+s16 D_8082BAEC[] = {
+ 0x0010, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
+};
+
+s32 D_8082BAF8 = 0;
+
+s16 D_8082BAFC[] = {
+ 0x0010, 0x0030, 0x0030, 0x0010, 0x0010, 0x0000,
+};
+
+void* D_8082BB08[] = {
+ &D_8082B9E8, &D_8082B9EC, &D_8082B9F0, &D_8082B9FC, &D_8082BA00, &D_8082BA48,
+};
+
+void* D_8082BB20[] = {
+ &D_8082BA54, &D_8082BA58, &D_8082BA5C, &D_8082BA68, &D_8082B7F0, &D_8082BA6C,
+};
+
+void* D_8082BB38[] = {
+ &D_8082BA78, &D_8082BA7C, &D_8082BA80, &D_8082BA8C, &D_8082BA90, &D_8082BAD8,
+};
+
+void* D_8082BB50[] = {
+ &D_8082BAE4, &D_8082BAE8, &D_8082BAEC, &D_8082BAF8, &D_8082B838, &D_8082BAFC,
+};
+
+s16 D_8082BB68[] = {
+ 0x000E, 0xFFFE, 0xFFFE, 0xFFEE, 0xFFEE, 0x0000,
+};
+
+s16 D_8082BB74[] = {
+ 0x002D, 0x004E, 0x000A, 0x002D, 0x0050, 0x000B, 0xFF93, 0xFFA9, 0xFFBF, 0xFFD7, 0xFFED, 0xFFEE, 0xFF93, 0xFFA9,
+ 0xFFBF, 0xFFD7, 0xFFED, 0xFFEE, 0xFF99, 0x0007, 0x0052, 0xFF92, 0xFFCA, 0xFF9E, 0xFFAA, 0xFFB6, 0xFFC2, 0xFFCE,
+ 0xFFDA, 0xFFE6, 0xFFF2, 0xFF9E, 0xFFAA, 0xFFB6, 0xFFC2, 0xFFCE, 0xFFDA, 0xFFE6, 0xFFF2, 0x0000,
+};
+
+s16 D_8082BBC4[] = {
+ 0x003E, 0x002A, 0x002A, 0x0014, 0xFFF7, 0xFFF7, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0x0002, 0x0002,
+ 0x0002, 0x0002, 0x0002, 0x0002, 0x0036, 0xFFD4, 0xFFD4, 0x0022, 0x003A, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC,
+ 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0x0000,
+};
+
+s16 D_8082BC14[] = {
+ 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
+ 0x0010, 0x0010, 0x0010, 0x0010, 0x0020, 0x0020, 0x0020, 0x0018, 0x0030, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
+ 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0000,
+};
+
+s16 D_8082BC64[] = {
+ 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
+ 0x0018, 0x0018, 0x0018, 0x0018, 0x0020, 0x0020, 0x0020, 0x0018, 0x0030, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
+ 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0000,
+};
+
+f32 D_8082BCB4[] = {
+ -62.0f, -36.0f, -10.0f, 16.0f, 42.0f, 68.0f,
+};
+
+f32 D_8082BCCC[] = {
+ 31.0f,
+ 5.0f,
+ -21.0f,
+ -47.0f,
+};
+
+f32 D_8082BCDC[] = {
+ -49.0f, -35.0f, -3.0f, 4.0f, 12.0f, 8.0f, 7.0f, 40.0f, 47.0f, 49.0f, 55.0f,
+};
+
+f32 D_8082BD08[] = {
+ -15.0f, -36.0f, -23.0f, -49.0f, -29.0f, -8.0f, 25.0f, 2.0f, -9.0f, 28.0f, 7.0f,
+};
+
+f32 D_8082BD34[] = {
+ -50.0f, -38.0f, 6.0f, 11.0f, 8.0f, 0.0f, 12.0f, 31.0f, 48.0f, 56.0f,
+};
+
+f32 D_8082BD5C[] = {
+ -14.0f, -39.0f, 23.0f, 11.0f, -8.0f, -15.0f, -31.0f, -30.0f, -10.0f, 11.0f,
+};
+
+f32 D_8082BD84[] = {
+ -72.0f, -47.0f, -26.0f, -50.0f, -48.0f, -48.0f, -48.0f, -48.0f, -48.0f,
+};
+
+f32 D_8082BDA8[] = {
+ -47.0f, -47.0f, -47.0f, -30.0f, 33.0f, 22.0f, 11.0f, -2.0f, -13.0f,
+};
+
+f32 D_8082BDCC[] = {
+ 52.0f, 80.0f, 24.0f, 52.0f, 81.0f, 24.0f, -78.0f, -61.0f, -44.0f, -24.0f, -6.0f, -3.0f,
+ -78.0f, -61.0f, -44.0f, -24.0f, -6.0f, -3.0f, -68.0f, 22.0f, 83.0f, -67.0f, -21.0f,
+};
+
+f32 D_8082BE28[] = {
+ 33.0f, 18.0f, 18.0f, 0.0f, -23.0f, -23.0f, -29.0f, -29.0f, -29.0f, -29.0f, -29.0f, -29.0f,
+ -11.0f, -11.0f, -11.0f, -11.0f, -11.0f, -11.0f, 27.0f, -53.0f, -53.0f, 14.0f, 26.0f,
+};
+
+s16 D_8082BE84 = 0;
+
+s16 D_8082BE88[] = {
+ 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025,
+};
+
+s32 D_8082BE9C = 0;
+
+s32 D_8082BEA0 = 0;
+
+s16 D_8082BEA4 = 10;
+
+s32 D_8082BEA8 = 0;
+
+s32 D_8082BEAC = 0;
+
+s32 D_8082BEB0 = 0;
+
+s32 D_8082BEB4 = 0;
+
+s32 D_8082BEB8[] = { 0, 0 };
+
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821900.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8082192C.s")