z_kaleido_item.c Ok and Documented (Pause Menu Item Page) (#1027)

* import wip from kaleido

* small cleanup

* add for-loop comments

* pr review 1

* spacing

* Update src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
This commit is contained in:
engineer124
2022-09-26 23:37:00 -04:00
committed by GitHub
parent 363a7cda46
commit ee82e65c1a
15 changed files with 1054 additions and 117 deletions
+14 -14
View File
@@ -33,12 +33,12 @@ void func_800F4A10(PlayState* play) {
for (i = 9; i >= 0; i--) {
if ((gSaveContext.save.playerData.owlActivationFlags >> i) & 1) {
pauseCtx->worldMapPoints[i] = 1;
pauseCtx->unk_238[4] = i;
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = i;
}
}
if ((gSaveContext.save.playerData.owlActivationFlags >> 4) & 1) {
pauseCtx->unk_238[4] = 4;
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 4;
}
}
@@ -82,7 +82,7 @@ void KaleidoSetup_Update(PlayState* play) {
!(play->actorCtx.flags & ACTORCTX_FLAG_2)) {
if ((play->actorCtx.unk268 == 0) && CHECK_BTN_ALL(input->press.button, BTN_START)) {
gSaveContext.unk_3F26 = gSaveContext.unk_3F22;
pauseCtx->unk_2B9 = 0;
pauseCtx->itemDescriptionOn = false;
pauseCtx->state = 1;
func_800F4A10(play);
pauseCtx->mode = pauseCtx->pageIndex * 2 + 1;
@@ -122,23 +122,23 @@ void KaleidoSetup_Init(PlayState* play) {
pauseCtx->unk_20C = 936.0f;
pauseCtx->unk_220 = -314.0f;
pauseCtx->unk_238[PAUSE_MAP] = XREG(94) + 3;
pauseCtx->cursorPoint[PAUSE_MAP] = XREG(94) + 3;
pauseCtx->unk_258 = 11;
pauseCtx->unk_25A = 0;
pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_RIGHT;
pauseCtx->pageSwitchTimer = 0;
pauseCtx->cursorItem[PAUSE_ITEM] = 999;
pauseCtx->cursorItem[PAUSE_ITEM] = PAUSE_ITEM_NONE;
pauseCtx->cursorItem[PAUSE_MAP] = XREG(94) + 3;
pauseCtx->cursorItem[PAUSE_QUEST] = 999;
pauseCtx->cursorItem[PAUSE_MASK] = 999;
pauseCtx->cursorItem[PAUSE_QUEST] = PAUSE_ITEM_NONE;
pauseCtx->cursorItem[PAUSE_MASK] = PAUSE_ITEM_NONE;
pauseCtx->unk_268[PAUSE_ITEM] = 0;
pauseCtx->unk_268[PAUSE_MAP] = XREG(94) + 3;
pauseCtx->cursorSlot[PAUSE_ITEM] = 0;
pauseCtx->cursorSlot[PAUSE_MAP] = XREG(94) + 3;
pauseCtx->unk_284 = 2;
pauseCtx->cursorColorSet = 2;
pauseCtx->unk_2A0 = -1;
pauseCtx->unk_2BA = 320;
pauseCtx->unk_2BC = 40;
pauseCtx->equipAnimScale = 320;
pauseCtx->equipAnimShrinkRate = 40;
pauseCtx->promptAlpha = 100;
View_Init(&pauseCtx->view, play->state.gfxCtx);
+1 -1
View File
@@ -270,7 +270,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 = pauseCtx->unk_238[PAUSE_WORLD_MAP];
phi_v0 = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
}
temp_s6 = D_801D0250[phi_v0];
+1 -1
View File
@@ -257,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[PAUSE_WORLD_MAP];
currentArea = play->pauseCtx.cursorPoint[PAUSE_WORLD_MAP];
}
stringLimit = D_801D07C4[currentArea];
+1 -1
View File
@@ -274,7 +274,7 @@ u8 Player_MaskIdToItemId(s32 maskIdMinusOne) {
return sMaskItemIds[maskIdMinusOne];
}
u8 Player_GetCurMaskItemId(PlayState* play) {
s32 Player_GetCurMaskItemId(PlayState* play) {
Player* player = GET_PLAYER(play);
if (player->currentMask != PLAYER_MASK_NONE) {
+1 -5
View File
@@ -922,11 +922,7 @@ void EnFsn_DeterminePrice(EnFsn* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) {
itemActionParam = func_80123810(play);
if (itemActionParam > PLAYER_AP_NONE) {
if (player->heldItemButton == 0) {
buttonItem = CUR_FORM_EQUIP(player->heldItemButton);
} else {
buttonItem = gSaveContext.save.equips.buttonItems[0][player->heldItemButton];
}
buttonItem = GET_CUR_FORM_BTN_ITEM(player->heldItemButton);
this->price = (buttonItem < ITEM_MOON_TEAR) ? gItemPrices[buttonItem] : 0;
if (this->price > 0) {
player->actor.textId = 0x29EF;
@@ -34,10 +34,10 @@ s16 sCurRow = 0;
// Geometry of the highlights for the selected section
typedef struct {
/* 0 */ s16 screenX;
/* 1 */ s16 screenY;
/* 2 */ s16 width;
} SectionPosition;
/* 0x0 */ s16 screenX;
/* 0x2 */ s16 screenY;
/* 0x4 */ s16 width;
} SectionPosition; // size = 0x6;
// clang-format off
SectionPosition sSectionPositions[] = {
File diff suppressed because it is too large Load Diff
@@ -3,14 +3,25 @@
#include "global.h"
#define PAUSE_ITEM_NONE 999
#define PAUSE_CURSOR_PAGE_LEFT 10
#define PAUSE_CURSOR_PAGE_RIGHT 11
typedef enum {
/* 0x00 */ PAUSE_ITEM,
/* 0x01 */ PAUSE_MAP,
/* 0x02 */ PAUSE_QUEST,
/* 0x03 */ PAUSE_MASK,
/* 0x04 */ PAUSE_WORLD_MAP
/* 0 */ PAUSE_ITEM,
/* 1 */ PAUSE_MAP,
/* 2 */ PAUSE_QUEST,
/* 3 */ PAUSE_MASK,
/* 4 */ PAUSE_WORLD_MAP
} PauseMenuPage;
typedef enum {
/* 0 */ PAUSE_EQUIP_C_LEFT,
/* 1 */ PAUSE_EQUIP_C_DOWN,
/* 2 */ PAUSE_EQUIP_C_RIGHT
} PauseEquipCButton;
typedef enum {
/* 0 */ DEBUG_EDITOR_NONE,
/* 1 */ DEBUG_EDITOR_INVENTORY_INIT,
@@ -21,6 +32,17 @@ typedef enum {
#define PAUSE_PROMPT_YES 0
#define PAUSE_PROMPT_NO 4
// NES
void KaleidoScope_MoveCursorToSpecialPos(PlayState* play, s16 cursorSpecialPos);
void KaleidoScope_DrawQuadTextureRGBA32(GraphicsContext* gfxCtx, void* texture, u16 width, u16 height, u16 point);
void func_80821A04(PlayState* play);
// Item
void KaleidoScope_SetCursorVtx(PauseContext* pauseCtx, u16 index, Vtx* vtx);
void KaleidoScope_DrawItemSelect(PlayState* play);
void KaleidoScope_UpdateItemCursor(PlayState* play);
void KaleidoScope_UpdateItemEquip(PlayState* play);
// Debug
void KaleidoScope_DrawInventoryEditor(PlayState* play);
void KaleidoScope_UpdateInventoryEditor(PlayState* play);
@@ -318,11 +318,11 @@ s32 D_8082BEB8[] = { 0, 0 };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821958.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821984.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_MoveCursorToSpecialPos.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821A04.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821AD4.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_DrawQuadTextureRGBA32.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821CC4.s")