I sure hope this const doesn't break everything

This commit is contained in:
robojumper
2025-12-25 00:04:18 +01:00
parent 98f3ce5b39
commit 14561ef318
11 changed files with 990 additions and 110 deletions
+19 -18
View File
@@ -10094,7 +10094,7 @@ getAdditionalCapacitySizeForItem = .text:0x8018AC70; // type:function size:0x60
swapStockAndPouchItems__Fll = .text:0x8018ACD0; // type:function size:0xC4
swapStockItems__Fll = .text:0x8018ADA0; // type:function size:0xA0
swapAdventurePouchItems__Fll = .text:0x8018AE40; // type:function size:0x120
fn_8018AF60 = .text:0x8018AF60; // type:function size:0x204
sortStock__Fv = .text:0x8018AF60; // type:function size:0x204
itemCheckFindItemSlot__F7ITEM_ID = .text:0x8018B170; // type:function size:0x60
fn_8018B1D0 = .text:0x8018B1D0; // type:function size:0x60
fn_8018B230 = .text:0x8018B230; // type:function size:0x74
@@ -16013,30 +16013,30 @@ setModeIn__17dLytDepositMain_cFv = .text:0x802A9EE0; // type:function size:0x19C
setModeCheck__17dLytDepositMain_cFv = .text:0x802AA080; // type:function size:0x84
setModeChange__17dLytDepositMain_cFb = .text:0x802AA110; // type:function size:0xE4
setModeArrangement__17dLytDepositMain_cFv = .text:0x802AA200; // type:function size:0x90
fn_802AA290 = .text:0x802AA290; // type:function size:0x13C
fn_802AA3D0 = .text:0x802AA3D0; // type:function size:0xFC
fn_802AA4D0 = .text:0x802AA4D0; // type:function size:0xEC
fn_802AA5C0 = .text:0x802AA5C0; // type:function size:0xB0
fn_802AA670 = .text:0x802AA670; // type:function size:0xF8
setModeReverseChange__17dLytDepositMain_cFv = .text:0x802AA290; // type:function size:0x13C
setModeScroll__17dLytDepositMain_cFbb = .text:0x802AA3D0; // type:function size:0xFC
setModeRecycle__17dLytDepositMain_cFv = .text:0x802AA4D0; // type:function size:0xEC
setModeArrangementOut__17dLytDepositMain_cFv = .text:0x802AA5C0; // type:function size:0xB0
setModeOut__17dLytDepositMain_cFv = .text:0x802AA670; // type:function size:0xF8
getStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AA770; // type:function size:0x10
loadItems__17dLytDepositMain_cFl = .text:0x802AA780; // type:function size:0x5C
fn_802AA7E0__17dLytDepositMain_cFv = .text:0x802AA7E0; // type:function size:0x348
fn_802AAB30__17dLytDepositMain_cFv = .text:0x802AAB30; // type:function size:0x388
fn_802AAEC0__17dLytDepositMain_cFl = .text:0x802AAEC0; // type:function size:0xF8
fn_802AAFC0__17dLytDepositMain_cFv = .text:0x802AAFC0; // type:function size:0xB4
fn_802AB080__17dLytDepositMain_cFv = .text:0x802AB080; // type:function size:0x188
fn_802AB210__17dLytDepositMain_cFv = .text:0x802AB210; // type:function size:0x474
fn_802AB690 = .text:0x802AB690; // type:function size:0xB8
fn_802AB750 = .text:0x802AB750; // type:function size:0x2E8
loadStockItems__17dLytDepositMain_cFl = .text:0x802AA780; // type:function size:0x5C
buildSubpanes__17dLytDepositMain_cFv = .text:0x802AA7E0; // type:function size:0x348
loadInitialState__17dLytDepositMain_cFv = .text:0x802AAB30; // type:function size:0x388
loadPouchItem__17dLytDepositMain_cFl = .text:0x802AAEC0; // type:function size:0xF8
checkPointToStock__17dLytDepositMain_cFv = .text:0x802AAFC0; // type:function size:0xB4
checkPointToPouch__17dLytDepositMain_cFv = .text:0x802AB080; // type:function size:0x188
handleNavOrPoint__17dLytDepositMain_cFv = .text:0x802AB210; // type:function size:0x474
navigateOffIcon__17dLytDepositMain_cFv = .text:0x802AB690; // type:function size:0xB8
checkNav__17dLytDepositMain_cFv = .text:0x802AB750; // type:function size:0x2E8
loadItemText__17dLytDepositMain_cFll = .text:0x802ABA40; // type:function size:0x114
fn_802ABB60__17dLytDepositMain_cFv = .text:0x802ABB60; // type:function size:0x580
fn_802AC0E0__17dLytDepositMain_cFl = .text:0x802AC0E0; // type:function size:0x1A8
fn_802AC290__17dLytDepositMain_cFl = .text:0x802AC290; // type:function size:0xC4
fn_802AC360 = .text:0x802AC360; // type:function size:0x58
fn_802AC360__17dLytDepositMain_cFl = .text:0x802AC360; // type:function size:0x58
fn_802AC3C0__17dLytDepositMain_cFv = .text:0x802AC3C0; // type:function size:0x234
fn_802AC600 = .text:0x802AC600; // type:function size:0x64
fn_802AC670__17dLytDepositMain_cFv = .text:0x802AC670; // type:function size:0x304
fn_802AC980 = .text:0x802AC980; // type:function size:0x54
fn_802AC980__17dLytDepositMain_cFv = .text:0x802AC980; // type:function size:0x54
fn_802AC9E0 = .text:0x802AC9E0; // type:function size:0x90
setPouchItemsVisible__17dLytDepositMain_cFb = .text:0x802ACA70; // type:function size:0x80
checkForItemPickupOrDrop__17dLytDepositMain_cFv = .text:0x802ACAF0; // type:function size:0x85C
@@ -37454,7 +37454,8 @@ lbl_8053D550 = .data:0x8053D550; // type:object size:0xF data:string
jumptable_8053D560 = .data:0x8053D560; // type:object size:0x24 scope:local
lbl_8053D584 = .data:0x8053D584; // type:object size:0x44
lbl_8053D5C8 = .data:0x8053D5C8; // type:object size:0xD data:string
lbl_8053D5D8 = .data:0x8053D5D8; // type:object size:0x34
lbl_8053D5D8 = .data:0x8053D5D8; // type:object size:0xE data:string
lbl_8053D5E8 = .data:0x8053D5E8; // type:object size:0x24
g_profile_LYT_DEPOSIT = .data:0x8053D60C; // type:object size:0xC
lbl_8053D618 = .data:0x8053D618; // type:object size:0x1B data:string
__vt__13dLytDeposit_c = .data:0x8053D638; // type:object size:0x50
+1 -1
View File
@@ -39,7 +39,7 @@ public:
mCalibrationPointCenterEnabled = val;
}
dCursorHitCheck_c *getHitCheck() {
dCursorHitCheck_c *getHitCheck() const {
return mCursorIf.getHit();
}
+2
View File
@@ -23,6 +23,8 @@ bool swapAdventurePouchItems(s32 slot1, s32 slot2);
bool swapStockAndPouchItems(s32 pouchSlot, s32 stockSlot);
bool swapStockItems(s32 slot1, s32 slot2);
void sortStock();
#define ITEM_CHECK_SLOT_NONE 60
u16 itemCheckFindItemSlot(ITEM_ID item);
+1 -1
View File
@@ -1520,7 +1520,7 @@ enum StoryFlags_e {
/** [Set when talking to Strich]
* Story Flag #300 (0x012C) - JP 805ACD7D 0x40 / US 805A9AFD 0x40
*/
STORYFLAG_300,
STORYFLAG_TALKED_TO_STRICH,
/** [Kukiel screams]
* Story Flag #301 (0x012D) - JP 805ACD7D 0x80 / US 805A9AFD 0x80
+47 -15
View File
@@ -11,6 +11,7 @@
#include "d/lyt/d_lyt_deposit_stock.h"
#include "d/lyt/d_textbox.h"
#include "d/lyt/d_window.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_bounding.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_State.hpp"
@@ -32,6 +33,11 @@ public:
void setModeCheck();
void setModeChange(bool unk);
void setModeArrangement();
void setModeReverseChange();
void setModeScroll(bool leftRight, bool viaButton);
void setModeRecycle();
void setModeArrangementOut();
void setModeOut();
bool isSellableItem() const {
return field_0x19524 && mItemSellValue > 0;
@@ -53,6 +59,30 @@ public:
return mIsIdle;
}
bool isPointingAtToStockBounding() const {
return mIsPointingAtToStockBounding;
}
bool isPointingAtToPouchBounding() const {
return mIsPointingAtToPouchBounding;
}
bool getField_0x19523() const {
return field_0x19523;
}
bool getField_0x19525() const {
return field_0x19525;
}
bool getField_0x1952B() const {
return field_0x1952B;
}
bool isHoldingItem() const {
return mCurrentlyHoldingItemSlot >= 0;
}
private:
static const s32 NUM_STOCKS = 3;
static const s32 STOCK_ACTIVE = 0;
@@ -65,28 +95,32 @@ private:
static const s32 NUM_PAGES = 5;
void setPouchItemsVisible(bool visible);
void fn_802AA7E0();
void buildSubpanes();
void fn_802AD370();
void fn_802AAFC0();
void fn_802AB210();
void checkPointToStock();
void handleNavOrPoint();
void checkForItemPickupOrDrop();
void fn_802ABB60();
void fn_802AB080();
void checkPointToPouch();
void fn_802AC3C0();
void fn_802AD4C0();
void loadItemText(s32 itemId, s32 where);
void fn_802AC670();
void fn_802AC290(s32);
void fn_802AD460();
void loadItems(s32 hiddenSlot);
void loadStockItems(s32 hiddenSlot);
s32 getItemSellValueFrame(s32 value);
void fn_802AC0E0(s32);
void fn_802AAEC0(s32);
void loadPouchItem(s32 slot);
void fn_8018ADA0(s32);
void fn_802AAB30();
void loadInitialState();
void fn_802AD400();
void navigateOffIcon();
s32 checkNav();
void fn_802AC980();
void fn_802AC360(s32);
STATE_FUNC_DECLARE(dLytDepositMain_c, ModeNone);
STATE_FUNC_DECLARE(dLytDepositMain_c, ModeIn);
@@ -115,9 +149,7 @@ private:
/* 0x00A3C */ dWindow_c *mpWindows[2];
/* 0x00A44 */ dTextBox_c *mpSizeBoxes[2];
/* 0x00A4C */ dCursorHitCheckLyt_c mCsHitCheck;
u8 _0x00002[0x8];
/* 0x00A74 */ mVec2_c mCsPosition;
/* 0x00A7C */ dLytDepositStock_c mStock[NUM_STOCKS];
/* 0x143F0 */ dLytDepositBoxCursor_c mCursor;
/* 0x14D48 */ dLytCommonIconItem_c mPouchItems[RING_NUM_ITEMS];
@@ -127,8 +159,8 @@ private:
/* 0x19494 */ d2d::SubPaneList mRingList;
/* 0x194A0 */ d2d::SubPaneListNode mRingNodes[RING_NUM_ITEMS];
/* 0x19520 */ bool mIsIdle;
/* 0x19521 */ bool field_0x19521;
/* 0x19522 */ bool field_0x19522;
/* 0x19521 */ bool mIsPointingAtToStockBounding;
/* 0x19522 */ bool mIsPointingAtToPouchBounding;
/* 0x19523 */ bool field_0x19523;
/* 0x19524 */ bool field_0x19524;
/* 0x19525 */ bool field_0x19525;
@@ -189,9 +221,9 @@ private:
/* 0x08C */ UI_STATE_MGR_DECLARE(dLytDeposit_c);
/* 0x0C8 */ d2d::ResAccIf_c mResAcc;
/* 0x438 */ dLytDepositMain_c mMain;
/* 0x19998 */ bool field_0x19998;
/* 0x19999 */ bool field_0x19999;
/* 0x1999A */ bool field_0x1999A;
/* 0x19998 */ bool mInRequest;
/* 0x19999 */ bool mIsMovingOut;
/* 0x1999A */ bool mScrollViaArrowButton;
};
#endif
+3 -3
View File
@@ -14,7 +14,7 @@ public:
};
public:
dLytDepositBoxCursor_c() : mSlot(-1), field_0x950(0), mItemLocation(0) {}
dLytDepositBoxCursor_c() : mSlot(-1), mItem(0), mItemLocation(0) {}
/* vt 0x0C */ virtual bool build(d2d::ResAccIf_c *resAcc) override;
/* vt 0x10 */ virtual bool remove() override;
/* vt 0x14 */ virtual bool execute() override;
@@ -33,7 +33,7 @@ public:
bool draw();
void init(s32 location, s32 slot, s32 item, bool unk);
void updateSlot(s32 location, s32 slot, s32 unk, bool unk2);
void updateSlot(s32 location, s32 slot, s32 item, bool unk2);
void fn_801580A0();
bool isVisible() const {
@@ -58,7 +58,7 @@ private:
/* 0x948 */ bool mIsVisible;
/* 0x948 */ bool field_0x949;
/* 0x94C */ s32 mSlot;
/* 0x950 */ s32 field_0x950;
/* 0x950 */ s32 mItem;
/* 0x954 */ s32 mItemLocation;
};
+21 -2
View File
@@ -79,6 +79,10 @@ public:
return mIsModeSell;
}
bool isModeFinish() const {
return mIsModeFinish;
}
void disableModeSort() {
mIsModeSort = false;
}
@@ -91,7 +95,11 @@ public:
mIsModeSell = false;
}
void returnToNormalMode() {
void disableModeFinish() {
mIsModeFinish = false;
}
void returnToNoneMode() {
mIsModeFinish = false;
mIsModeSell = false;
mIsModeSort = false;
@@ -99,6 +107,13 @@ public:
mSavedArrowDirection = ARROW_NONE;
}
void disableSpecialModes() {
mIsModeSell = false;
mIsModeFinish = false;
mIsModeSort = false;
mSavedArrowDirection = ARROW_NONE;
}
u8 getItem(s32 idx) const {
return mItemIds[idx];
}
@@ -127,6 +142,10 @@ public:
return mArrowDirection;
}
void setMainStock(bool b) {
mIsMainStock = b;
}
//private:
static const s32 NUM_ICONS_PER_PAGE = 12;
static const s32 NUM_PAGES = 5;
@@ -161,7 +180,7 @@ public:
/* 0x684A */ bool mIsSortBlocked;
/* 0x684B */ bool field_0x684B;
/* 0x684C */ bool field_0x684C;
/* 0x684D */ bool field_0x684D;
/* 0x684D */ bool mIsMainStock;
/* 0x684E */ bool field_0x684E;
/* 0x6850 */ s32 mCurrentNavTarget;
/* 0x6854 */ UNKWORD field_0x6854;
@@ -4,8 +4,8 @@
#ifdef __cplusplus
namespace std {
using ::mbstowcs;
using ::mbtowc;
// using ::mbstowcs;
// using ::mbtowc;
using ::swprintf;
using ::vswprintf;
using ::wcscat;
@@ -14,7 +14,7 @@ using ::wcscmp;
using ::wcscpy;
using ::wcslen;
using ::wcsncpy;
using ::wcstombs;
// using ::wcstombs;
} // namespace std
#endif
File diff suppressed because it is too large Load Diff
+7 -6
View File
@@ -5,6 +5,7 @@
#include "d/d_pad_nav.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_common_icon_item.h"
#include "d/lyt/d_lyt_common_icon_item_maps.h"
#include "d/lyt/d_lyt_util_items.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_group.h"
@@ -114,17 +115,17 @@ void dLytDepositBoxCursor_c::realizeNav() {
s = mAnm[DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR].getLastFrame();
} else if (dPadNav::isPointerVisible()) {
s = 4;
} else if (field_0x950 == 50) {
} else if (mItem == LYT_CMN_PouchPotionHealthPlusPlusHalf) {
s = 5;
} else if (field_0x949) {
s = 6;
} else if (mItemLocation == LOC_POUCH) {
// Flip the cursor for pouch slot 0 so that it's not above the screen edge
s = mSlot == 0 ? 1 : 0;
if (field_0x950 == 12) {
if (mItem == LYT_CMN_PouchBlank4) {
s += 2;
}
} else if (field_0x950 == 12) {
} else if (mItem == LYT_CMN_PouchBlank4) {
s = 2;
} else {
s = 0;
@@ -182,13 +183,13 @@ void dLytDepositBoxCursor_c::init(s32 location, s32 slot, s32 item, bool unk) {
}
mNode.mpPane->SetVisible(true);
field_0x950 = 12;
mItem = LYT_CMN_PouchBlank4;
realizeNav();
mIsVisible = true;
}
void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 unk, bool unk2) {
field_0x950 = unk;
void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 item, bool unk2) {
mItem = item;
mItemLocation = location;
field_0x949 = unk2;
if (mItemLocation == LOC_POUCH) {
+1 -1
View File
@@ -118,7 +118,7 @@ bool dLytDepositStock_c::execute() {
mNodes[i].mpLytPane->execute();
}
if (field_0x684D) {
if (mIsMainStock) {
mStateMgr.executeState();
}