Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion config/SOUE01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1712,8 +1712,10 @@ d/lyt/d_lyt_control_game.cpp:
.text start:0x802CC7B0 end:0x802D16A8 align:16
.ctors start:0x804DB8A0 end:0x804DB8A4
.data start:0x805403F8 end:0x80540C88
.sdata start:0x80573EF0 end:0x80573F28
.sbss start:0x80575A00 end:0x80575A18
.bss start:0x805B7DD0 end:0x805B8040
.sdata2 start:0x8057CA68 end:0x8057CAA0
.bss start:0x805B7DD0 end:0x805B8030

d/lyt/d_lyt_control_title.cpp:
.text start:0x802D16B0 end:0x802D17BC align:16
Expand Down
769 changes: 439 additions & 330 deletions config/SOUE01/symbols.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def MatchingFor(*versions):
Object(NonMatching, "toBeSorted/d_a_npc_ken_talk.cpp"),
Object(NonMatching, "toBeSorted/d_a_jstudio_act.cpp"),
Object(NonMatching, "toBeSorted/d_a_jstudio_sys.cpp"),
Object(NonMatching, "d/lyt/d_lyt_control_game.cpp"),
Object(Matching, "d/lyt/d_lyt_control_game.cpp"),
Object(NonMatching, "d/lyt/d_lyt_control_title.cpp"),
Object(NonMatching, "d/tg/d_t_map_area.cpp"),
Object(NonMatching, "d/tg/d_t_truck_rails.cpp"),
Expand Down
9 changes: 9 additions & 0 deletions include/d/a/d_a_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,17 @@ class dAcItem_c : public dAcItemBase_c {
return sIsPerformingInitialCollection;
}

static s32 getCollectionCurrentCount() {
return sCollectionCurrentCount;
}

s32 getQuantity() const {
return mItemQuantity;
}

private:
static bool sIsPerformingInitialCollection;
static s32 sCollectionCurrentCount;

/* 0x334 */ UNKTYPE *mpMdl; // Model has its own handling system
/* 0x338 */ dShadowCircle_c mShdw;
Expand Down
4 changes: 4 additions & 0 deletions include/d/a/d_a_itembase.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ class dAcItemBase_c : public dAcObjBase_c {
static u16 getTearBit(int tearNum);
static bool setDungeonFlagForTear(int tearNum);

u16 getItemId_i() const {
return mId;
}

private:
u16 mId;

Expand Down
5 changes: 3 additions & 2 deletions include/d/d_cs_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,9 @@ class dCsGame_c : public dCs_c {
bool isCursorActive() const {
return mCursorActive;
}
void setField0x9A0(u8 val) {
mCursorActive = val;

void setField_0x9A2(bool value) {
field_0x9A2 = value;
}

void offNextCursor() {
Expand Down
16 changes: 10 additions & 6 deletions include/d/d_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ class dMessage_c : public dBase_c {
mInMapEvent = val;
}

s32 getField_0x32C() const {
return field_0x32C;
s32 getMapEvent() const {
return mMapEvent;
}

void setField_0x32C(s32 val) {
field_0x32C = val;
void setMapEvent(s32 val) {
mMapEvent = val;
}

void setField_0x329(bool v) {
Expand All @@ -267,6 +267,10 @@ class dMessage_c : public dBase_c {
return field_0x32A;
}

bool getField_0x330() const {
return field_0x330;
}

void setField_0x330(bool v) {
field_0x330 = v;
}
Expand Down Expand Up @@ -367,8 +371,8 @@ class dMessage_c : public dBase_c {
/* 0x32A */ bool field_0x32A;

/* 0x32B */ u8 field_0x32B;
/* 0x32C */ s32 field_0x32C;
/* 0x330 */ u8 field_0x330;
/* 0x32C */ s32 mMapEvent;
/* 0x330 */ bool field_0x330;

/* 0x334 */ u32 mMinigameResultPoints;
/* 0x338 */ u32 mMinigameTime;
Expand Down
14 changes: 7 additions & 7 deletions include/d/flag/storyflag_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ enum StoryFlags_e {
/** [Harp Cutscene (Lanayru Desert layer 2 / Lanayru Mines layer 2 / Temple of Time layer 2 / Behind The Temple
* layer 3)] Story Flag #9 (0x0009) - JP 805ACD58 0x04 / US 805A9AD8 0x04
*/
STORYFLAG_9,
STORYFLAG_HARP_CUTSCENE,

/** [Entering Ancient Cistern Cutscene]
* Story Flag #10 (0x000A) - JP 805ACD58 0x08 / US 805A9AD8 0x08
Expand Down Expand Up @@ -111,7 +111,7 @@ enum StoryFlags_e {
/** [Fire Dragon Text after SotH part Cutscene (Eldin Volcano, Digging Mitts Cave, Volcano Summit Waterfall layer
* 4)] Story Flag #19 (0x0013) - JP 805ACD5B 0x08 / US 805A9ADB 0x08
*/
STORYFLAG_19,
STORYFLAG_BOKO_BASE_BEATEN,

/** [Set when learning 3rd SotH part (Groosenator to Lanayru ready)]
* Story Flag #20 (0x0014) - JP 805ACD5B 0x10 / US 805A9ADB 0x10
Expand Down Expand Up @@ -718,7 +718,7 @@ enum StoryFlags_e {
/** [Groose lands in Faron after Harp (Sealed Temple layer 2)]
* Story Flag #140 (0x008C) - JP 805ACD67 0x04 / US 805A9AE7 0x04
*/
STORYFLAG_140,
STORYFLAG_GROOSE_LANDS_IN_FARON,

/** [Ballad of the Goddess played with Impa (Sealed Grounds layer 2)]
* Story Flag #141 (0x008D) - JP 805ACD6C 0x01 / US 805A9AEC 0x01
Expand Down Expand Up @@ -863,7 +863,7 @@ enum StoryFlags_e {
/** [Eldin Eruption Cutscene ready to play (set when Levias explains SotH quest, set and unset by Faron and Lanayru
* SotH)] Story Flag #169 (0x00A9) - JP 805ACD62 0x01 / US 805A9AE2 0x01
*/
STORYFLAG_169,
STORYFLAG_ELDIN_VOLCANO_CAN_ERUPT,

/** [Fire Dragon teaches SotH part Cutscene (Fire Dragon's Lair layer 2)]
* Story Flag #170 (0x00AA) - JP 805ACD62 0x02 / US 805A9AE2 0x02
Expand Down Expand Up @@ -948,12 +948,12 @@ enum StoryFlags_e {
/** [Water Basin collected (unsets when scrapper picks up anything else)]
* Story Flag #186 (0x00BA) - JP 805ACD69 0x02 / US 805A9AE9 0x02
*/
STORYFLAG_186,
STORYFLAG_SCRAPPER_HAS_WATER_BASIN,

/** [Big Frog Watered]
* Story Flag #187 (0x00BB) - JP 805ACD69 0x04 / US 805A9AE9 0x04
*/
STORYFLAG_187,
STORYFLAG_SUMMIT_BIG_FROG_WATERED,

/** [Asking Fi about the Water Basin after finding the Big Flames in fromt of FS]
* Story Flag #188 (0x00BC) - JP 805ACD69 0x08 / US 805A9AE9 0x08
Expand Down Expand Up @@ -3738,7 +3738,7 @@ enum StoryFlags_e {
/** [set after scrappers text at start of Water Basin Escord]
* Story Flag #743 (0x02E7) - JP 805ACDA6 0x80 / US 805A9B26 0x80
*/
STORYFLAG_743,
STORYFLAG_WATER_BASIN_ESCORT_STARTED,

/** [Scrapper text at start of scrapper escort]
* Story Flag #744 (0x02E8) - JP 805ACDA9 0x01 / US 805A9B29 0x01
Expand Down
73 changes: 57 additions & 16 deletions include/d/lyt/d_lyt_control_game.h
Original file line number Diff line number Diff line change
@@ -1,29 +1,58 @@
#ifndef D_LYT_CONTROL_GAME_H
#define D_LYT_CONTROL_GAME_H

// clang-format off
// vtable order
#include "common.h"
#include "d/d_base.h"
#include "d/lyt/d_lyt_map.h"
#include "d/lyt/d_lyt_wipe.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/lyt/msg_window/d_lyt_msg_window.h"
#include "d/lyt/msg_window/d_lyt_simple_window.h"
#include "d/lyt/d_lyt_wipe.h"
#include "d/lyt/d_lyt_help.h"
#include "d/lyt/d_lyt_map.h"
#include "s/s_State.hpp"
#include "toBeSorted/arc_managers/layout_arc_manager.h"
#include "toBeSorted/raii_ptr.h"
// clang-format on

class dLytDrawMark_c;

class dLytControlGame_c : public dBase_c {
public:
dLytControlGame_c();
virtual ~dLytControlGame_c();

enum Cmd_e {
CMD_NONE = 0,
CMD_MAP = 1,
CMD_PAUSE = 2,
CMD_HELP = 3,
};

virtual int create() override;
virtual int doDelete() override;
virtual int execute() override;
virtual int draw() override;

bool isInSomeMapState() const;
bool isNotInStateMap() const;
void openCollectionScreenDemo();
bool isStateNormalOrNotInEvent() const;
void somehowRelatedToEnteringLightPillars(s32, s32, s32);

void fn_802CCD40(bool);
bool isStateNotNormalOrInEvent() const;
bool fn_802CFF60() const;

void setMapEventDone(bool);
void fn_802D04F0();
void checkForBeaconNextToMark();

void hideHelp();
void changeHelpText(s32 textIndex);
void openPause();
void openPauseDemo();
void openHelp(s32 textIndex);
void openMap();
void openMapEvent(s32 mapEvent, s32 arg1, s32 arg2);

void resetFootsteps();

const dMapFootPrintsQueue_c *getFootprintsQueue() const {
return mFootprintsMgr.getQueue();
Expand Down Expand Up @@ -80,31 +109,43 @@ class dLytControlGame_c : public dBase_c {
}

private:
bool checkStoryflag(s32 flag) const;
void fn_802CFA90();
bool canOpenPause();
bool releaseRes();
bool decrementRes();

/* 0x00068 */ UI_STATE_MGR_DECLARE(dLytControlGame_c);
/* 0x000A4 */ RaiiPtr<void*> field_0x000A4;
/* 0x000A4 */ RaiiPtr<dLytMap_c> mpMap;
/* 0x000A8 */ dLytMeter_c mMeter;
/* 0x13C10 */ dLytMsgWindow_c mMsgWindow;
/* 0x14E34 */ dLytSimpleWindow_c mSimpleWindow;
/* 0x152A0 */ dLytWipe_c mWipe;
/* 0x15848 */ u8 _0x15848[0x15850 - 0x15848];
/* 0x15848 */ dLytHelp_c *mpHelp;
/* 0x1584C */ dLytDrawMark_c *mpDrawMark;
/* 0x15850 */ dMapFootPrintsMgr_c mFootprintsMgr;

/* 0x15C24 */ UNKWORD field_0x15C24;
/* 0x15C28 */ UNKWORD field_0x15C28;

/* 0x15C24 */ s32 mCommand;
/* 0x15C28 */ s32 mHelpTextIndex;
/* 0x15C2C */ s32 mCurrentPauseDisp;
/* 0x15C30 */ s32 mPauseDisp00Tab;
/* 0x15C34 */ u8 mIsEvent;
/* 0x15C38 */ s32 mMapEvent;

/* 0x15C34 */ u8 _0x15C34[0x15C40 - 0x15C34];
/* 0x15C3C */ u8 _0x15C3C[0x15C40 - 0x15C3C];

/* 0x15C40 */ LayoutArcControl mLytArcControl;

/* 0x15C4C */ u8 _0x15C4C[0x15C60 - 0x15C4C];
/* 0x15C4C */ s32 mMapEventArg1;
/* 0x15C50 */ s32 mMapEventArg2;

/* 0x15C60 */ u16 mItemForPauseDemo;
/* 0x15C54 */ UNKWORD field_0x15C54;
/* 0x15C58 */ UNKWORD field_0x15C58;

/* 0x15C62 */ u8 _0x15C62[0x15C64 - 0x15C62];
/* 0x15C5C */ u8 _0x15C5C[0x15C60 - 0x15C5C];

/* 0x15C60 */ u16 mItemForPauseDemo;
/* 0x15C62 */ u16 mPickupItemCount;
/* 0x15C64 */ u16 mItemCountForPauseDemo;
/* 0x15C66 */ u8 field_0x15C66;
/* 0x15C67 */ bool mIsPauseDemo;
Expand Down
48 changes: 48 additions & 0 deletions include/d/lyt/d_lyt_draw_mark.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#ifndef D_LYT_DRAW_MARK_H
#define D_LYT_DRAW_MARK_H

#include "d/lyt/d2d.h"
#include "m/m_vec.h"
#include "s/s_State.hpp"

class dLytDrawMark_c {
public:
dLytDrawMark_c() : mStateMgr(*this) {}
~dLytDrawMark_c() {}

bool build(UNKWORD);
bool remove();
bool execute();
bool draw();

u8 getField_0x940() const {
return field_0x940;
}

void setField_0x941(u8 v) {
field_0x941 = v;
}

private:
/* 0x000 */ UI_STATE_MGR_DECLARE(dLytDrawMark_c);
/* 0x018 */ d2d::LytBase_c mLyt;
/* 0x0CC */ d2d::AnmGroup_c mAnm[16];

/* 0x4CC */ u8 _0x4CC[0x504 - 0x4CC];

/* 0x504 */ d2d::ResAccIf_c mResAcc;

/* 0x874 */ u8 _0x874[0x88C - 0x874];

/* 0x88C */ mVec2_c field_0x88C[6];
/* 0x8BC */ mVec2_c field_0x8BC[6];

/* 0x8EC */ u8 _0x8EC[0x940 - 0x8EC];

/* 0x940 */ u8 field_0x940;
/* 0x941 */ u8 field_0x941;

/* 0x942 */ u8 _0x942[0x958 - 0x942];
};

#endif
20 changes: 18 additions & 2 deletions include/d/lyt/d_lyt_help.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ class dLytHelp_c : public m2d::Base_c {
bool setText(s32 textIndex);
void changeText(s32 textIndex);

static dLytHelp_c *GetInstance() {
return sInstance;
}

bool isStateEnd() const {
return *mStateMgr.getStateID() == StateID_End;
}

void requestOut() {
mOutRequest = true;
}

bool isWaiting() const {
return mIsWaiting;
}

private:
static dLytHelp_c *sInstance;

Expand All @@ -80,8 +96,8 @@ class dLytHelp_c : public m2d::Base_c {
/* 0x04C */ d2d::ResAccIf_c mResAcc;
/* 0x3BC */ dLytHelpMain_c *mpMain;
/* 0x3C0 */ bool field_0x3C0;
/* 0x3C1 */ bool field_0x3C1;
/* 0x3C2 */ bool field_0x3C2;
/* 0x3C1 */ bool mOutRequest;
/* 0x3C2 */ bool mIsWaiting;
/* 0x3C4 */ s32 mTextIndex;
/* 0x3C8 */ s32 field_0x3C8;
};
Expand Down
Loading