mirror of
https://github.com/zeldaret/tww.git
synced 2026-06-05 03:07:40 -04:00
d_save fixes, d_a_andsw dComIfGp fix
This commit is contained in:
+51
-22
@@ -117,6 +117,7 @@ public:
|
||||
dStage_roomControl_c* getRoomControl() { return &mRoomCtrl; }
|
||||
dStage_stageDt_c& getStage() { return mStageData; }
|
||||
dEvt_control_c& getEvent() { return mEvtCtrl; }
|
||||
dEvent_manager_c& getEvtManager() { return mEvtManager; }
|
||||
|
||||
const char* getStartStageName() { return mCurStage.getName(); }
|
||||
s8 getStartStageRoomNo() { return mCurStage.getRoomNo(); }
|
||||
@@ -148,7 +149,7 @@ public:
|
||||
/* 0x3EB0 */ dStage_stageDt_c mStageData;
|
||||
/* 0x3F34 */ dStage_roomControl_c mRoomCtrl;
|
||||
/* 0x3F38 */ dEvt_control_c mEvtCtrl;
|
||||
/* 0x402C */ dEvent_manager_c mEventMgr;
|
||||
/* 0x402C */ dEvent_manager_c mEvtManager;
|
||||
/* 0x4568 */ dAttention_c mAttention;
|
||||
/* 0x46F8 */ u8 field_0x46F8[0x4700 - 0x46F8];
|
||||
/* 0x4700 */ dVibration_c mVibration;
|
||||
@@ -310,7 +311,7 @@ public:
|
||||
|
||||
void ct();
|
||||
|
||||
/* 0x00000 */ dSv_info_c info;
|
||||
/* 0x00000 */ dSv_info_c save;
|
||||
/* 0x012A0 */ dComIfG_play_c play;
|
||||
/* 0x05D1C */ dDlst_list_c drawlist;
|
||||
/* 0x1BF50 */ u8 field_0x1BF50[0x1BFC0 - 0x1BF50];
|
||||
@@ -330,83 +331,95 @@ extern dComIfG_inf_c g_dComIfG_gameInfo;
|
||||
u8 dComIfGs_checkGetItem(u8);
|
||||
|
||||
inline u8 dComIfGs_getSelectEquip(int param_0) {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(param_0);
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().getSelectEquip(param_0);
|
||||
}
|
||||
|
||||
inline u8 dComIfGs_getItem(int param_0) {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getItem().getItem(param_0);
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getItem().getItem(param_0);
|
||||
}
|
||||
|
||||
inline void dComIfGs_setEventReg(u16 i_reg, u8 i_no) {
|
||||
g_dComIfG_gameInfo.info.getEvent().setEventReg(i_reg, i_no);
|
||||
g_dComIfG_gameInfo.save.getEvent().setEventReg(i_reg, i_no);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isEventBit(u16 id) {
|
||||
return g_dComIfG_gameInfo.info.getEvent().isEventBit(id);
|
||||
return g_dComIfG_gameInfo.save.getEvent().isEventBit(id);
|
||||
}
|
||||
|
||||
inline void dComIfGs_setRestartRoomParam(u32 i_param) {
|
||||
g_dComIfG_gameInfo.info.getRestart().setRoomParam(i_param);
|
||||
g_dComIfG_gameInfo.save.getRestart().setRoomParam(i_param);
|
||||
}
|
||||
|
||||
inline void dComIfGs_setStartPoint(s16 i_point) {
|
||||
g_dComIfG_gameInfo.info.getRestart().setStartPoint(i_point);
|
||||
g_dComIfG_gameInfo.save.getRestart().setStartPoint(i_point);
|
||||
}
|
||||
|
||||
inline int dComIfGs_getTriforceNum() {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getCollect().getTriforceNum();
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getCollect().getTriforceNum();
|
||||
}
|
||||
|
||||
inline u8 dComIfGs_getOptVibration() {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getConfig().getVibration();
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getConfig().getVibration();
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isTbox(int i_no) {
|
||||
return g_dComIfG_gameInfo.info.getMemory().getBit().isTbox(i_no);
|
||||
return g_dComIfG_gameInfo.save.getMemory().getBit().isTbox(i_no);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isSaveTbox(int i_stageNo, int i_no) {
|
||||
return g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().isTbox(i_no);
|
||||
return g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().isTbox(i_no);
|
||||
}
|
||||
|
||||
inline void dComIfGs_onTbox(int i_no) {
|
||||
g_dComIfG_gameInfo.info.getMemory().getBit().onTbox(i_no);
|
||||
g_dComIfG_gameInfo.save.getMemory().getBit().onTbox(i_no);
|
||||
}
|
||||
|
||||
inline void dComIfGs_onSaveTbox(int i_stageNo, int i_no) {
|
||||
g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().onTbox(i_no);
|
||||
g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().onTbox(i_no);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isStageBossEnemy() {
|
||||
return g_dComIfG_gameInfo.info.getMemory().getBit().isStageBossEnemy();
|
||||
return g_dComIfG_gameInfo.save.getMemory().getBit().isStageBossEnemy();
|
||||
}
|
||||
|
||||
inline void dComIfGs_onStageLife() {
|
||||
g_dComIfG_gameInfo.info.getMemory().getBit().onStageLife();
|
||||
g_dComIfG_gameInfo.save.getMemory().getBit().onStageLife();
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isStageLife() {
|
||||
return g_dComIfG_gameInfo.info.getMemory().getBit().isStageLife();
|
||||
return g_dComIfG_gameInfo.save.getMemory().getBit().isStageLife();
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isCollect(int i_idx, u8 i_item) {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect(i_idx, i_item);
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getCollect().isCollect(i_idx, i_item);
|
||||
}
|
||||
|
||||
inline void dComIfGs_onCollect(int i_idx, u8 i_item) {
|
||||
g_dComIfG_gameInfo.info.getPlayer().getCollect().onCollect(i_idx, i_item);
|
||||
g_dComIfG_gameInfo.save.getPlayer().getCollect().onCollect(i_idx, i_item);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isTact(u8 i_no) {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isTact(i_no);
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getCollect().isTact(i_no);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isTriforce(u8 i_no) {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isTriforce(i_no);
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getCollect().isTriforce(i_no);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isSymbol(u8 i_no) {
|
||||
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isSymbol(i_no);
|
||||
return g_dComIfG_gameInfo.save.getPlayer().getCollect().isSymbol(i_no);
|
||||
}
|
||||
|
||||
inline void dComIfGs_onSwitch(int i_no, int i_roomNo) {
|
||||
g_dComIfG_gameInfo.save.onSwitch(i_no, i_roomNo);
|
||||
}
|
||||
|
||||
inline void dComIfGs_offSwitch(int i_no, int i_roomNo) {
|
||||
g_dComIfG_gameInfo.save.offSwitch(i_no, i_roomNo);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGs_isSwitch(s32 i_no, s32 i_roomNo) {
|
||||
return g_dComIfG_gameInfo.save.isSwitch(i_no, i_roomNo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -492,6 +505,22 @@ inline daPy_lk_c* daPy_getPlayerLinkActorClass() {
|
||||
return (daPy_lk_c*)g_dComIfG_gameInfo.play.getPlayerPtr(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* === EVENT ===
|
||||
*/
|
||||
|
||||
inline dEvent_manager_c& dComIfGp_getEventManager() {
|
||||
return g_dComIfG_gameInfo.play.getEvtManager();
|
||||
}
|
||||
|
||||
inline u32 dComIfGp_evmng_getEventIdx(char *pName, u8 evNo) {
|
||||
return dComIfGp_getEventManager().getEventIdx(pName, evNo);
|
||||
}
|
||||
|
||||
inline BOOL dComIfGp_evmng_endCheck(s16 eventID) {
|
||||
return g_dComIfG_gameInfo.play.getEvtManager().endCheck(eventID);
|
||||
}
|
||||
|
||||
/**
|
||||
* === DRAWLIST ===
|
||||
*/
|
||||
|
||||
+1
-1
@@ -253,7 +253,7 @@ STATIC_ASSERT(sizeof(dSv_player_info_c) == 0x5C);
|
||||
class dSv_player_config_c {
|
||||
public:
|
||||
/* 8005BF2C */ void init();
|
||||
/* 8005BFA4 */ void checkVibration();
|
||||
/* 8005BFA4 */ s32 checkVibration();
|
||||
|
||||
u8 getVibration() const { return mVibration; }
|
||||
|
||||
|
||||
+1
-1
@@ -449,7 +449,7 @@ public:
|
||||
static void setStayNo(int);
|
||||
static s8 GetTimePass();
|
||||
static void setZoneNo(int, int);
|
||||
static int getZoneNo(int);
|
||||
static int getZoneNo(int i_roomNo);
|
||||
|
||||
static s8 getStayNo() { return mStayNo; }
|
||||
static s8 getMemoryBlockID(int i_roomNo) { return mStatus[i_roomNo].mMemBlockID; }
|
||||
|
||||
@@ -333,7 +333,7 @@ inline f32 fopAcM_getCullSizeSphereR(const fopAc_ac_c* i_actor) {
|
||||
|
||||
inline void dComIfGs_onSwitch(int i_no, int i_roomNo);
|
||||
inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
|
||||
inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
|
||||
inline BOOL dComIfGs_isSwitch(s32 i_no, s32 i_roomNo);
|
||||
inline void dComIfGs_offActor(int i_no, int i_roomNo);
|
||||
|
||||
inline void i_fopAcM_onSwitch(const fopAc_ac_c* pActor, int sw) {
|
||||
|
||||
+10
-10
@@ -97,7 +97,7 @@ BOOL daAndsw2_c::chkAllSw2() {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (!g_dComIfG_gameInfo.info.isSwitch(topSw+i, getRoomNo())) {
|
||||
if (!dComIfGs_isSwitch(topSw+i, getRoomNo())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ static s32 daAndsw2_actionOnAll(daAndsw2_c* i_this) {
|
||||
} else {
|
||||
int room = i_this->getRoomNo();
|
||||
int sw = i_this->getSwbit();
|
||||
g_dComIfG_gameInfo.info.onSwitch(sw, room);
|
||||
dComIfGs_onSwitch(sw, room);
|
||||
|
||||
if (i_this->getType() == TYPE_CONTINUOUS) {
|
||||
i_this->mAction = ACT_OFF;
|
||||
@@ -138,7 +138,7 @@ static s32 daAndsw2_actionTimer(daAndsw2_c* i_this) {
|
||||
} else {
|
||||
int room = i_this->getRoomNo();
|
||||
int sw = i_this->getSwbit();
|
||||
g_dComIfG_gameInfo.info.onSwitch(sw, room);
|
||||
dComIfGs_onSwitch(sw, room);
|
||||
|
||||
if (i_this->getType() == TYPE_CONTINUOUS) {
|
||||
i_this->mAction = ACT_WAIT;
|
||||
@@ -153,7 +153,7 @@ static s32 daAndsw2_actionOrder(daAndsw2_c* i_this) {
|
||||
i_this->mAction = ACT_EVENT;
|
||||
int room = i_this->getRoomNo();
|
||||
int sw = i_this->getSwbit();
|
||||
g_dComIfG_gameInfo.info.onSwitch(sw, room);
|
||||
dComIfGs_onSwitch(sw, room);
|
||||
} else if (i_this->getType() == TYPE_CONTINUOUS && !i_this->chkAllSw2()) {
|
||||
i_this->mAction = ACT_ON_ALL;
|
||||
} else {
|
||||
@@ -165,7 +165,7 @@ static s32 daAndsw2_actionOrder(daAndsw2_c* i_this) {
|
||||
/* 00000438-000004BC .text daAndsw2_actionEvent__FP10daAndsw2_c */
|
||||
static s32 daAndsw2_actionEvent(daAndsw2_c* i_this) {
|
||||
dComIfG_play_c* play = &g_dComIfG_gameInfo.play;
|
||||
if (play->mEventMgr.endCheck(i_this->mEventIdx)) {
|
||||
if (dComIfGp_evmng_endCheck(i_this->mEventIdx)) {
|
||||
if (i_this->getType() == TYPE_CONTINUOUS) {
|
||||
i_this->mAction = ACT_OFF;
|
||||
} else {
|
||||
@@ -182,7 +182,7 @@ static s32 daAndsw2_actionOff(daAndsw2_c* i_this) {
|
||||
i_this->mAction = ACT_ON_ALL;
|
||||
int room = i_this->getRoomNo();
|
||||
int sw = i_this->getSwbit();
|
||||
g_dComIfG_gameInfo.info.offSwitch(sw, room);
|
||||
dComIfGs_offSwitch(sw, room);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -212,27 +212,27 @@ s32 daAndsw2_c::create() {
|
||||
|
||||
switch (getType()) {
|
||||
case TYPE_ONE_OFF:
|
||||
if (sw == 0xFF || g_dComIfG_gameInfo.info.isSwitch(sw, getRoomNo())) {
|
||||
if (sw == 0xFF || dComIfGs_isSwitch(sw, getRoomNo())) {
|
||||
// Switch invalid or already set.
|
||||
mAction = ACT_WAIT;
|
||||
} else {
|
||||
// Switch not yet set, check for the condition to be met.
|
||||
mAction = ACT_ON_ALL;
|
||||
}
|
||||
mEventIdx = g_dComIfG_gameInfo.play.mEventMgr.getEventIdx(NULL, getEventNo());
|
||||
mEventIdx = dComIfGp_evmng_getEventIdx(NULL, getEventNo());
|
||||
break;
|
||||
case TYPE_CONTINUOUS:
|
||||
if (sw == 0xFF) {
|
||||
// Switch invalid.
|
||||
mAction = ACT_WAIT;
|
||||
} else if (g_dComIfG_gameInfo.info.isSwitch(sw, getRoomNo())) {
|
||||
} else if (dComIfGs_isSwitch(sw, getRoomNo())) {
|
||||
// Switch already set, wait for the condition to no longer be met.
|
||||
mAction = ACT_OFF;
|
||||
} else {
|
||||
// Switch not yet set, check for the condition to be met.
|
||||
mAction = ACT_ON_ALL;
|
||||
}
|
||||
mEventIdx = g_dComIfG_gameInfo.play.mEventMgr.getEventIdx(NULL, getEventNo());
|
||||
mEventIdx = dComIfGp_evmng_getEventIdx(NULL, getEventNo());
|
||||
break;
|
||||
default:
|
||||
// Invalid type, do nothing.
|
||||
|
||||
+24
-14
@@ -6,7 +6,10 @@
|
||||
#include "d/d_save.h"
|
||||
#include "d/d_save_init.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "MSL_C/string.h"
|
||||
#include "SSystem/SComponent/c_lib.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
@@ -67,7 +70,7 @@ void dSv_player_status_a_c::init() {
|
||||
case 29:
|
||||
case 30:
|
||||
case 31:
|
||||
item = g_dComIfG_gameInfo.info.getPlayer().mGetItem.mItemFlags[item_idx + 13];
|
||||
item = g_dComIfG_gameInfo.save.getPlayer().mGetItem.mItemFlags[item_idx + 13];
|
||||
break;
|
||||
case 32:
|
||||
case 33:
|
||||
@@ -82,7 +85,7 @@ void dSv_player_status_a_c::init() {
|
||||
case 41:
|
||||
case 42:
|
||||
case 43:
|
||||
item = g_dComIfG_gameInfo.info.getPlayer().mGetItem.mItemFlags[item_idx + 9];
|
||||
item = g_dComIfG_gameInfo.save.getPlayer().mGetItem.mItemFlags[item_idx + 9];
|
||||
break;
|
||||
case 44:
|
||||
case 45:
|
||||
@@ -97,7 +100,7 @@ void dSv_player_status_a_c::init() {
|
||||
case 53:
|
||||
case 54:
|
||||
case 55:
|
||||
item = g_dComIfG_gameInfo.info.getPlayer().mGetItem.mItemFlags[item_idx + 5];
|
||||
item = g_dComIfG_gameInfo.save.getPlayer().mGetItem.mItemFlags[item_idx + 5];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -352,13 +355,23 @@ void dSv_player_item_record_c::init() {
|
||||
}
|
||||
|
||||
/* 8005987C-80059894 .text resetTimer__24dSv_player_item_record_cFUs */
|
||||
void dSv_player_item_record_c::resetTimer(u16) {
|
||||
/* Nonmatching */
|
||||
void dSv_player_item_record_c::resetTimer(u16 timer) {
|
||||
mTimer = timer;
|
||||
g_dComIfG_gameInfo.play.field_0x4956 = 0;
|
||||
}
|
||||
|
||||
/* 80059894-800598D0 .text decTimer__24dSv_player_item_record_cFv */
|
||||
void dSv_player_item_record_c::decTimer() {
|
||||
/* Nonmatching */
|
||||
if (g_dComIfG_gameInfo.play.field_0x4956 != 1)
|
||||
return;
|
||||
|
||||
if (mTimer != 0) {
|
||||
mTimer--;
|
||||
return;
|
||||
}
|
||||
|
||||
mTimer = 0;
|
||||
g_dComIfG_gameInfo.play.field_0x4956 = 0;
|
||||
}
|
||||
|
||||
/* 800598D0-800598D8 .text getTimer__24dSv_player_item_record_cFv */
|
||||
@@ -815,8 +828,11 @@ void dSv_player_config_c::init() {
|
||||
}
|
||||
|
||||
/* 8005BFA4-8005BFC8 .text checkVibration__19dSv_player_config_cFv */
|
||||
void dSv_player_config_c::checkVibration() {
|
||||
/* Nonmatching */
|
||||
s32 dSv_player_config_c::checkVibration() {
|
||||
if (JUTGamePad::sRumbleSupported)
|
||||
return g_dComIfG_gameInfo.play.field_0x4963;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 8005BFC8-8005BFD4 .text init__19dSv_player_priest_cFv */
|
||||
@@ -867,7 +883,6 @@ void dSv_memBit_c::init() {
|
||||
mVisitedRoom[i] = 0;
|
||||
}
|
||||
|
||||
field_0x20 = 0;
|
||||
mDungeonItem = 0;
|
||||
}
|
||||
|
||||
@@ -1265,11 +1280,6 @@ void dSv_info_c::onSwitch(int i_no, int i_roomNo) {
|
||||
}
|
||||
}
|
||||
|
||||
/* 8005DCD0-8005DCEC .text getZoneNo__20dStage_roomControl_cFi */
|
||||
int dStage_roomControl_c::getZoneNo(int param_0) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8005DCEC-8005DE98 .text offSwitch__10dSv_info_cFii */
|
||||
void dSv_info_c::offSwitch(int i_no, int i_roomNo) {
|
||||
JUT_ASSERT(3448,
|
||||
|
||||
Reference in New Issue
Block a user