Implement the last function

This commit is contained in:
robojumper
2025-09-25 13:31:59 +02:00
parent 48ae3aead6
commit 2fe316f55c
8 changed files with 104 additions and 31 deletions
+2 -2
View File
@@ -42186,10 +42186,10 @@ lbl_80575998 = .sbss:0x80575998; // type:object size:0x8 data:4byte
BOSS_CAPTION_PTR = .sbss:0x805759A0; // type:object size:0x8 data:4byte
sInstance__17dLytDemoDowsing_c = .sbss:0x805759A8; // type:object size:0x8 data:4byte
lbl_805759B0 = .sbss:0x805759B0; // type:object size:0x2 data:2byte
LYT_SHOP = .sbss:0x805759B4; // type:object size:0x4 data:4byte
sInstance__10dLytShop_c = .sbss:0x805759B4; // type:object size:0x4 data:4byte
lbl_805759B8 = .sbss:0x805759B8; // type:object size:0x8
lbl_805759C0 = .sbss:0x805759C0; // type:object size:0x8
lbl_805759C8 = .sbss:0x805759C8; // type:object size:0x8 data:4byte
sInstance__13dLytDeposit_c = .sbss:0x805759C8; // type:object size:0x8 data:4byte
lbl_805759D0 = .sbss:0x805759D0; // type:object size:0x8 data:4byte
LYT_END_ROLL_PTR = .sbss:0x805759D8; // type:object size:0x8 data:4byte
GLOBAL_FI_POINTER = .sbss:0x805759E0; // type:object size:0x4 data:4byte
+14
View File
@@ -0,0 +1,14 @@
#ifndef D_LYT_DEPOSIT_H
#define D_LYT_DEPOSIT_H
class dLytDeposit_c {
public:
static dLytDeposit_c *GetInstance() {
return sInstance;
}
private:
static dLytDeposit_c *sInstance;
};
#endif
+8 -10
View File
@@ -268,6 +268,7 @@ private:
class dLytMapMain_c : public m2d::Base_c {
friend class dLytMap_c;
public:
dLytMapMain_c();
virtual ~dLytMapMain_c();
@@ -342,7 +343,7 @@ private:
/* 0x8904 */ mVec3_c field_0x8904;
/* 0x8910 */ mVec3_c field_0x8910;
/* 0x891C */ mVec3_c field_0x891C;
/* 0x8928 */ u8 _0x8928[0x8930 - 0x8928];
/* 0x8930 */ mVec3_c field_0x8930;
@@ -350,7 +351,7 @@ private:
/* 0x8948 */ u8 idkfixmelater[0x4BC0];
/* 0x8C94 */ s32 field_0x8C94;
// ...
/* 0x8CC4 */ mVec3_c field_0x8CC4;
@@ -411,16 +412,13 @@ public:
void build();
static bool isValid(s32 val) {
if (val >= 2 && val < 7) {
return true;
}
return false;
bool isSomeMapFieldEq2Or4Or5Or6() const {
return mMapMain.field_0x8C94 == 2 || mMapMain.field_0x8C94 == 4 || mMapMain.field_0x8C94 == 5 ||
mMapMain.field_0x8C94 == 6;
}
bool unkMeterCheck() const {
s32 val = mMapMain.field_0x8C94;
return isValid(val) && ((1 << (val - 2)) & 0x1D);
bool isSomeMapFieldEq10() const {
return mMapMain.field_0x8C94 == 10;
}
void lightPillarRelated(s32 p1, s32 p2, s32 p3) {
+14
View File
@@ -0,0 +1,14 @@
#ifndef D_LYT_SHOP_H
#define D_LYT_SHOP_H
class dLytShop_c {
public:
static dLytShop_c *GetInstance() {
return sInstance;
}
private:
static dLytShop_c *sInstance;
};
#endif
+1 -3
View File
@@ -1,14 +1,13 @@
#ifndef EVENT_MANAGER_H
#define EVENT_MANAGER_H
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "f/f_base.h"
#include "sized_string.h"
#include "toBeSorted/event.h"
class dAcBase_c;
class dAcObjBase_c;
class EventManager {
public:
@@ -53,7 +52,6 @@ public:
static bool FUN_800a0ba0();
private:
/* 0x000 */ u8 _000[0x084 - 0x000];
/* 0x084 */ Event mCurrentEvent;
/* 0x0C4 */ u8 _0C4[0x184 - 0x0C4];
+46
View File
@@ -0,0 +1,46 @@
#ifndef EVENT_MANAGER_UTIL_H
#define EVENT_MANAGER_UTIL_H
#include "d/d_base.h"
#include "d/d_message.h"
#include "d/lyt/d_lyt_deposit.h"
#include "d/lyt/d_lyt_map.h"
#include "d/lyt/d_lyt_shop.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/misc_actor.h"
// Pulling these functions out into a separate file to avoid circular dependencies
inline bool EventManagerNotDrawControl0x80() {
return EventManager::isInEvent() && (dBase_c::s_DrawControlFlags & 0x80) == 0;
}
inline bool EventManagerNotSkyKeepPuzzle() {
return EventManager::isInEvent() && !checkIsInSkykeepPuzzle();
}
inline bool EventManagerNotInShop() {
return EventManager::isInEvent() && dLytShop_c::GetInstance() == nullptr;
}
inline bool EventManagerNotInDeposit() {
return EventManager::isInEvent() && dLytDeposit_c::GetInstance() == nullptr;
}
inline bool EventManagerIsInMap() {
return EventManager::isInEvent() && dLytMap_c::GetInstance() != nullptr;
}
inline bool EventManagerIsMapOpen() {
return EventManagerIsInMap() && dLytMap_c::GetInstance()->isOpenMaybe();
}
inline bool EventManagerIsMapOpenAndMessage() {
return EventManagerIsMapOpen() && !dMessage_c::getInstance()->getField_0x328();
}
inline bool EventManagerIsMapOpenAnd0x9008Eq10() {
return EventManagerIsMapOpen() && dLytMap_c::GetInstance()->isSomeMapFieldEq10();
}
#endif
+18 -15
View File
@@ -16,6 +16,7 @@
#include "s/s_StateInterfaces.hpp"
#include "toBeSorted/arc_managers/layout_arc_manager.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/event_manager_util.h"
SPECIAL_BASE_PROFILE(C_GAME, dCsGame_c, fProfile::C_GAME, 0x2BF, 0x06F9);
@@ -254,8 +255,10 @@ bool dCsGame_c::shouldDraw() const {
}
bool dCsGame_c::isForcedHidden() const {
// TODO - lots of EventManager inlines
return false;
return (
EventManagerNotDrawControl0x80() && EventManagerNotSkyKeepPuzzle() && EventManagerNotInShop() &&
EventManagerNotInDeposit() && !EventManagerIsMapOpenAndMessage() && !EventManagerIsMapOpenAnd0x9008Eq10()
);
}
void dCsGame_c::setNextCursorType(CursorType_e cs) {
@@ -501,6 +504,18 @@ void dCsGame_c::lytItemCursor_c::changeState(const sFStateID_c<lytItemCursor_c>
mStateMgr.changeState(newState);
}
void dCsGame_c::lytItemCursor_c::bowStartDrawOrCharge(f32 f1, f32 f2) {
mBow.startDrawOrCharge(f1, f2);
}
void dCsGame_c::lytItemCursor_c::bowAimStart() {
mBow.aimStart();
}
void dCsGame_c::lytItemCursor_c::bowReady() {
mBow.ready();
}
void dCsGame_c::lytItemCursor_c::pachinkoSetCharging(bool charging, f32 progress) {
mPachinko.setCharging(charging, progress);
}
@@ -525,18 +540,6 @@ void dCsGame_c::lytItemCursor_c::clawshotsSetLocked(bool locked) {
mCrawShot.setLocked(locked);
}
void dCsGame_c::lytItemCursor_c::bowStartDrawOrCharge(f32 f1, f32 f2) {
mBow.startDrawOrCharge(f1, f2);
}
void dCsGame_c::lytItemCursor_c::bowAimStart() {
mBow.aimStart();
}
void dCsGame_c::lytItemCursor_c::bowReady() {
mBow.ready();
}
void dCsGame_c::lytItemCursor_c::loadResAcc() {
mLyt.setResAcc(mpResAcc);
}
@@ -646,7 +649,7 @@ void dCsGame_c::lytItemCursor_c::lytDowsingCsr_c::executeState_NotFind() {
if (field_0xC0 < 0.9999f) {
mAnm[MAIN_ANIM_DOWSE_IN_OUT].setAnimEnable(true);
mAnm[MAIN_ANIM_DOWSE_IN_OUT].setForward();
mStateMgr.changeState(StateID_Find);
mStateMgr.changeState(StateID_ToFind);
}
}
void dCsGame_c::lytItemCursor_c::lytDowsingCsr_c::finalizeState_NotFind() {}
+1 -1
View File
@@ -996,7 +996,7 @@ bool dLytMeterMain_c::remove() {
void dLytMeterMain_c::fn_800D5290() {
dLytMeter_c *meter = dLytMeter_c::GetInstance();
if (dLytMap_c::GetInstance() != nullptr && !dLytMap_c::GetInstance()->unkMeterCheck()) {
if (dLytMap_c::GetInstance() != nullptr && !dLytMap_c::GetInstance()->isSomeMapFieldEq2Or4Or5Or6()) {
meter->setFlags(METER_BTN_PLUS);
}