Merge pull request #94 from TakaRikka/bugfixes

Bugfixes for some issues (cXyz in savegame, collision and fading)
This commit is contained in:
TakaRikka
2026-03-16 14:21:49 -07:00
committed by GitHub
7 changed files with 95 additions and 15 deletions
+13 -13
View File
@@ -58,8 +58,8 @@ struct daNpcCd_HIO_Jnt_c : public JORReflexible {
void genMessage(JORMContext*);
#endif
/* 0x04 */ Vec jntT;
/* 0x10 */ SVec jntR;
/* 0x04 */ BE(Vec) jntT;
/* 0x10 */ struct { BE(s16) x, y, z; } jntR;
};
struct daNpcCd_HIO_Child_c : public JORReflexible {
@@ -71,17 +71,17 @@ struct daNpcCd_HIO_Child_c : public JORReflexible {
#endif
/* 0x004 */ daNpcCd_HIO_Jnt_c field_0x4[12];
/* 0x124 */ s16 field_0x124[0x0C];
/* 0x13C */ f32 mObjScale;
/* 0x140 */ s16 mAtn;
/* 0x144 */ f32 mAnmPlaySpeed;
/* 0x148 */ f32 mWalkAnmPlaySpeed;
/* 0x14C */ f32 mMaxSpeed;
/* 0x150 */ f32 mWalkMaxSpeed;
/* 0x154 */ f32 mCylH;
/* 0x158 */ f32 mCylR;
/* 0x15C */ f32 mChkWallH;
/* 0x160 */ f32 mChkWallR;
/* 0x124 */ BE(s16) field_0x124[0x0C];
/* 0x13C */ BE(f32) mObjScale;
/* 0x140 */ BE(s16) mAtn;
/* 0x144 */ BE(f32) mAnmPlaySpeed;
/* 0x148 */ BE(f32) mWalkAnmPlaySpeed;
/* 0x14C */ BE(f32) mMaxSpeed;
/* 0x150 */ BE(f32) mWalkMaxSpeed;
/* 0x154 */ BE(f32) mCylH;
/* 0x158 */ BE(f32) mCylR;
/* 0x15C */ BE(f32) mChkWallH;
/* 0x160 */ BE(f32) mChkWallR;
};
STATIC_ASSERT(sizeof(daNpcCd_HIO_Child_c) == 0x164);
+1 -1
View File
@@ -253,7 +253,7 @@ public:
struct Group {
u8 field_0x00;
int field_0x04[0];
BE(int) field_0x04[0];
};
static Group* mGroupTbl[4];
+20
View File
@@ -1084,7 +1084,11 @@ s32 dComIfGs_isDungeonItemWarp(int i_stageNo);
void dComIfGs_BossLife_public_Set(s8);
s8 dComIfGs_sense_type_change_Get();
void dComIfGs_sense_type_change_Set(s8);
#if TARGET_PC
cXyz dComIfGs_getWarpPlayerPos();
#else
cXyz& dComIfGs_getWarpPlayerPos();
#endif
const char* dComIfGs_getWarpStageName();
s16 dComIfGs_getWarpPlayerAngleY();
s8 dComIfGs_getWarpRoomNo();
@@ -1174,7 +1178,11 @@ void dComIfGs_setWarpItemData(char const* stage, cXyz pos, s16 angle, s8 roomNo,
u8 param_5);
void dComIfGs_setLastWarpMarkItemData(const char* stage, cXyz pos, s16 angle, s8 roomNo, u8, u8);
const char* dComIfGs_getWarpStageName();
#if TARGET_PC
cXyz dComIfGs_getWarpPlayerPos();
#else
cXyz& dComIfGs_getWarpPlayerPos();
#endif
s16 dComIfGs_getWarpPlayerAngleY();
s8 dComIfGs_getWarpRoomNo();
u8 dComIfGs_getWarpMarkFlag();
@@ -1420,7 +1428,11 @@ inline BOOL dComIfGs_isTransformLV(int i_no) {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().isTransformLV(i_no);
}
#if TARGET_PC
inline cXyz dComIfGs_getHorseRestartPos() {
#else
inline cXyz& dComIfGs_getHorseRestartPos() {
#endif
return g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().getPos();
}
@@ -1441,7 +1453,11 @@ inline void dComIfGs_setHorseRestart(const char* i_stageName, cXyz& i_pos, s16 i
g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().set(i_stageName, i_pos, i_angle, i_roomNo);
}
#if TARGET_PC
inline cXyz dComIfGs_getPlayerFieldLastStayPos() {
#else
inline cXyz& dComIfGs_getPlayerFieldLastStayPos() {
#endif
return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().getPos();
}
@@ -1483,7 +1499,11 @@ inline void dComIfGs_setPlayerFieldLastStayInfo(const char* i_stage, cXyz& i_pos
i_point, i_region);
}
#if TARGET_PC
inline cXyz dComIfGs_getLastWarpMarkPlayerPos() {
#else
inline cXyz& dComIfGs_getLastWarpMarkPlayerPos() {
#endif
return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getPos();
}
+24
View File
@@ -219,13 +219,21 @@ public:
void init();
void set(const char* i_name, const cXyz& i_pos, s16 i_angle, s8 i_roomNo);
#if TARGET_PC
cXyz getPos() { return cXyz(mPos); }
#else
cXyz& getPos() { return mPos; }
#endif
s16 getAngleY() const { return mAngleY; }
const char* getStageName() const { return mName; }
s8 getRoomNo() const { return mRoomNo; }
private:
#if TARGET_PC
/* 0x00 */ BE(Vec) mPos;
#else
/* 0x00 */ cXyz mPos;
#endif
/* 0x0C */ BE(s16) mAngleY;
/* 0x0E */ char mName[8];
/* 0x16 */ u8 mSpawnId;
@@ -257,7 +265,11 @@ public:
void onRegionBit(int i_region);
void set(const char* i_name, const cXyz& i_pos, s16 i_angle, s8 i_spawn, u8 i_regionNo);
#if TARGET_PC
cXyz getPos() { return cXyz(mPos); }
#else
cXyz& getPos() { return mPos; }
#endif
s16 getAngleY() { return mAngleY; }
char* getName() { return mName; }
u8 getRegionNo() const { return mRegionNo; }
@@ -267,7 +279,11 @@ public:
private:
#if TARGET_PC
/* 0x00 */ BE(Vec) mPos;
#else
/* 0x00 */ cXyz mPos;
#endif
/* 0x0C */ BE(s16) mAngleY;
/* 0x0E */ char mName[8];
/* 0x16 */ s8 mLastSpawnId;
@@ -284,7 +300,11 @@ public:
void init();
void setWarpItemData(const char* i_name, const cXyz& i_pos, s16 i_angle, s8 i_roomNo, u8, u8);
#if TARGET_PC
cXyz getPos() { return cXyz(mPos); }
#else
cXyz& getPos() { return mPos; }
#endif
s16 getAngleY() const { return mAngleY; }
const char* getName() { return mName; }
s8 getRoomNo() const { return mRoomNo; }
@@ -293,7 +313,11 @@ public:
void resetWarpAcceptStage() { mWarpAcceptStage = -1; }
private:
#if TARGET_PC
/* 0x00 */ BE(Vec) mPos;
#else
/* 0x00 */ cXyz mPos;
#endif
/* 0x0C */ BE(s16) mAngleY;
/* 0x0E */ char mName[8];
/* 0x16 */ u8 mSpawnId;
+13 -1
View File
@@ -25,12 +25,18 @@ void JUTFader::control() {
if (mStatus == 1) {
return;
}
switch (mStatus) {
case 0:
mColor.a = 0xFF;
break;
case 2:
#if AVOID_UB
if (field_0x8 == 0) {
mStatus = 1;
break;
}
#endif
mColor.a = 0xFF - ((++field_0xa * 0xFF) / field_0x8);
if (field_0xa >= field_0x8) {
@@ -39,6 +45,12 @@ void JUTFader::control() {
break;
case 3:
#if AVOID_UB
if (field_0x8 == 0) {
mStatus = 0;
break;
}
#endif
mColor.a = ((++field_0xa * 0xFF) / field_0x8);
if (field_0xa >= field_0x8) {
+4
View File
@@ -2660,7 +2660,11 @@ const char* dComIfGs_getWarpStageName() {
return dComIfGs_getLastWarpMarkStageName();
}
#if TARGET_PC
cXyz dComIfGs_getWarpPlayerPos() {
#else
cXyz& dComIfGs_getWarpPlayerPos() {
#endif
return dComIfGs_getLastWarpMarkPlayerPos();
}
+20
View File
@@ -197,7 +197,11 @@ BOOL dSv_player_status_b_c::isTransformLV(int i_no) const {
void dSv_horse_place_c::init() {
strcpy(mName, "");
#if TARGET_PC
mPos = BE<Vec>(0.0f, 0.0f, 0.0f);
#else
mPos.set(0.0f, 0.0f, 0.0f);
#endif
mAngleY = 0;
mSpawnId = 0;
mRoomNo = 0;
@@ -228,7 +232,11 @@ void dSv_player_return_place_c::set(const char* i_name, s8 i_roomNo, u8 i_status
void dSv_player_field_last_stay_info_c::init() {
strcpy(mName, "");
#if TARGET_PC
mPos = BE<Vec>(0.0f, 0.0f, 0.0f);
#else
mPos.set(0.0f, 0.0f, 0.0f);
#endif
mAngleY = 0;
mLastSpawnId = 0;
mRegionNo = 1;
@@ -244,7 +252,11 @@ void dSv_player_field_last_stay_info_c::set(const char* i_name, const cXyz& i_po
s8 i_spawn, u8 i_regionNo) {
JUT_ASSERT(468, strlen(i_name) <= 7);
strcpy(mName, i_name);
#if TARGET_PC
mPos = i_pos;
#else
mPos.set(i_pos);
#endif
mAngleY = i_angle;
mLastSpawnId = i_spawn;
mRegionNo = i_regionNo;
@@ -269,7 +281,11 @@ BOOL dSv_player_field_last_stay_info_c::isRegionBit(int i_region) const {
void dSv_player_last_mark_info_c::init() {
strcpy(mName, "");
#if TARGET_PC
mPos = BE<Vec>(0.0f, 0.0f, 0.0f);
#else
mPos.set(0.0f, 0.0f, 0.0f);
#endif
mAngleY = 0;
mRoomNo = 0;
mSpawnId = 0;
@@ -283,7 +299,11 @@ void dSv_player_last_mark_info_c::init() {
void dSv_player_last_mark_info_c::setWarpItemData(const char* i_name, const cXyz& i_pos,
s16 i_angle, s8 i_roomNo, u8 unk_4, u8 unk_5) {
strcpy(mName, i_name);
#if TARGET_PC
mPos = i_pos;
#else
mPos.set(i_pos);
#endif
mAngleY = i_angle;
mRoomNo = i_roomNo;