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
2 changes: 1 addition & 1 deletion include/d/actor/d_a_e_hz.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class daE_HZ_c : public fopEn_enemy_c {
/* 0x6B4 */ s16 field_0x6b4;
/* 0x6B6 */ s16 field_0x6b6;
/* 0x6B8 */ u8 field_0x6B8[0x6BC - 0x6B8];
/* 0x6BC */ char* mpName;
/* 0x6BC */ const char* mpName;
/* 0x6C0 */ s32 mAction;
/* 0x6C4 */ s32 mPrevAction;
/* 0x6C8 */ s32 mMode; // That's just a guess. Might need a better name for it's usage
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc2.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class daBaseNpc_c : public fopAc_ac_c {
/* 0x842 */ u16 field_0x842;
/* 0x844 */ u8 field_0x844;
/* 0x845 */ u8 field_0x845[0x848 - 0x845];
/* 0x848 */ s32 field_0x848;
/* 0x848 */ s32 mFlowID;
/* 0x84C */ dMsgFlow_c mMsgFlow;
/* 0x898 */ u8 field_0x898[0x89A - 0x898];
/* 0x89A */ s16 mEvtIdx;
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_bouS.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class daNpcBouS_c : public daNpcF_c {
void setExpression(int, f32);
bool talk(void*);
bool demo(void*);
inline fopAc_ac_c* searchInstructionTag();
inline fopAc_ac_c* searchInstructionTag();
bool instruction(void*);
bool checkIntroDemoStart();
int EvCut_BousIntroSumo1(int);
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_gra.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class daNpc_grA_c : public daNpcF_c {
/* 0x14B0 */ int field_0x1460;
/* 0x1464 */ int field_0x1464;
/* 0x1468 */ int field_0x1468;
/* 0x146C */ int field_0x146C;
/* 0x146C */ int mFlowID;
/* 0x1470 */ s16 mLookMode;
/* 0x1472 */ u16 field_0x1472;
/* 0x1474 */ u8 mType;
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_grs.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class daNpc_grS_c : public daNpcF_c {
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE08 */ int field_0xe08;
/* 0xE0C */ int field_0xe0c;
/* 0xE0C */ int mFlowID;
/* 0xE10 */ s16 mLookMode;
/* 0xE12 */ u16 mActionState;
/* 0xE14 */ u8 mType;
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_gwolf.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class daNpc_GWolf_c : public daNpcF_c {
/* 0xDFC */ int field_0xdfc;
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE08 */ int field_0xe08;
/* 0xE08 */ int mFlowID;
/* 0xE0C */ s16 mLookMode;
/* 0xE0E */ u16 mMode;
/* 0xE10 */ u8 mType;
Expand Down
3 changes: 2 additions & 1 deletion include/d/actor/d_a_npc_kasi_hana.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ class daNpcKasiHana_c : public daNpcF_c {
s16 getMessageNo() { return s16(home.angle.x); }
s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;


// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
Expand Down
3 changes: 2 additions & 1 deletion include/d/actor/d_a_npc_kasi_kyu.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class daNpcKasiKyu_c : public daNpcF_c {

s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;


// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
Expand Down
3 changes: 2 additions & 1 deletion include/d/actor/d_a_npc_kasi_mich.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class daNpcKasiMich_c : public daNpcF_c {

s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;


// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_kn.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class daNpc_Kn_c : public fopEn_enemy_c {

class daNpc_Kn_prtclMngr_c {
public:
/* 0x00 */ bool mpModel;
/* 0x00 */ bool field_0x00;
/* 0x04 */ cXyz mPos;
/* 0x10 */ csXyz mAngle;
/* 0x18 */ cXyz mScale;
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_ks.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class npc_ks_class {
/* 0x5B7 */ u8 field_0x5b7;
/* 0x5B8 */ int order;
/* 0x5BC */ int bitTRB;
/* 0x5C0 */ char* res_name;
/* 0x5C0 */ const char* res_name;
/* 0x5C4 */ f32 dis;
/* 0x5C8 */ s16 target_angle;
/* 0x5CC */ mDoExt_McaMorfSO* model;
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_myna2.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class daNpc_myna2_c : public daNpcF_c {
/* 0xDF8 */ int field_0xdf8;
/* 0xDFC */ int field_0xdfc;
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE04 */ int mFlowID;
/* 0xE08 */ s16 mLookMode;
/* 0xE0A */ u16 mMode;
/* 0xE0C */ u8 mType;
Expand Down
2 changes: 1 addition & 1 deletion include/d/actor/d_a_npc_ne.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class npc_ne_class : public fopEn_enemy_c {
/* 0x5D8 */ f32 mDistToTarget;
/* 0x5DC */ s16 mAngleToPlayer;
/* 0x5E0 */ f32 mDistScale;
/* 0x5E4 */ char* mResName;
/* 0x5E4 */ const char* mResName;
/* 0x5E8 */ mDoExt_McaMorf* mpMorf;
/* 0x5EC */ mDoExt_btkAnm* mpBtkAnm;
/* 0x5F0 */ mDoExt_btpAnm* mpBtpAnm;
Expand Down
3 changes: 3 additions & 0 deletions include/d/actor/d_a_tag_push.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class daTag_Push_c : public fopAc_ac_c {
u8 getBitSW2() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }

u32 getFlowNodeNo() {
// !@bug home.angle.x is promoted to a 32-bit signed integer prior
// to being compared, so the compared value can never exceed
// SHORT_MAX and the condition always passes.
if (home.angle.x != 0xFFFF) {
return (u16)home.angle.x;
}
Expand Down
4 changes: 4 additions & 0 deletions include/d/actor/d_a_tag_shop_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class daTag_ShopItem_c : public fopAc_ac_c {

u32 getProcessID() { return mProcessID; }

int getFlowNodeNum() {
return (u16)home.angle.x == 0xFFFF ? -1 : (u16)home.angle.x;
}

/* 0x56C */ u32 mProcessID;
/* 0x570 */ s16 mCreateTimer;
/* 0x572 */ u8 field_0x572;
Expand Down
23 changes: 1 addition & 22 deletions include/d/d_demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,27 +336,6 @@ class dDemo_particle_c : public JStudio_JParticle::TCreateObject {
virtual JPABaseEmitter* emitter_create(u32);
};

namespace {
class jstudio_tAdaptor_message : public JStudio::TAdaptor_message {
public:
typedef JStudio::TObject_message ObjectType;

jstudio_tAdaptor_message() {}

virtual ~jstudio_tAdaptor_message();
virtual void adaptor_do_MESSAGE(JStudio::data::TEOperationData, const void*, u32);
};

class jstudio_tCreateObject_message : public JStudio::TCreateObject {
public:
jstudio_tCreateObject_message() {}

virtual ~jstudio_tCreateObject_message();
virtual bool create(JStudio::TObject**, const JStudio::stb::data::TParse_TBlock_object&);
};

}; // namespace

int dDemo_setDemoData(fopAc_ac_c*, u8, mDoExt_McaMorf*, char const*, int, u16*, u32, s8);

class dDemo_c {
Expand Down Expand Up @@ -405,7 +384,7 @@ class dDemo_c {
static JStudio_JStage::TCreateObject* m_stage;
static JStudio_JAudio2::TCreateObject* m_audio;
static dDemo_particle_c* m_particle;
static jstudio_tCreateObject_message* m_message;
static JStudio::TCreateObject* m_message;
static JStudio::TFactory* m_factory;
static jmessage_tControl* m_mesgControl;
static dDemo_object_c* m_object;
Expand Down
2 changes: 1 addition & 1 deletion include/d/d_menu_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class dMw_c : public msg_class {
bool isPauseWindow() { return mPauseWindow != false; }
void onShowFlag() { mShowFlag |= 1; }
void offShowFlag() { mShowFlag &= ~1; }
bool isShowFlag() { return mShowFlag & 1 != 0; }
bool isShowFlag() { return (mShowFlag & 1) != 0; }
bool isFadeNowCheck() { return mDoGph_gInf_c::getFader()->getStatus() == 1; }

private:
Expand Down
3 changes: 0 additions & 3 deletions include/d/d_msg_scrn_howl.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,4 @@ struct dMsgScrnHowl_c : public dMsgScrnBase_c {
/* 0x27A8 */ f32 field_0x27a8;
};

#define LINE_MAX 30
#define PLOT_BUFFER_MAX_e 0x300

#endif /* MSG_SCRN_D_MSG_SCRN_HOWL_H */
18 changes: 9 additions & 9 deletions include/f_op/f_op_actor_mng.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ inline void fopAcM_SetAngle(fopAc_ac_c* i_actor, s16 x, s16 y, s16 z) {
i_actor->current.angle.set(x, y, z);
}

inline void dComIfGs_onSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
inline void dComIfGs_revSwitch(int i_no, int i_roomNo);
inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offActor(int i_no, int i_roomNo);
void dComIfGs_onSwitch(int i_no, int i_roomNo);
void dComIfGs_offSwitch(int i_no, int i_roomNo);
void dComIfGs_revSwitch(int i_no, int i_roomNo);
BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
void dComIfGs_offActor(int i_no, int i_roomNo);

inline void fopAcM_onSwitch(const fopAc_ac_c* i_actor, int sw) {
return dComIfGs_onSwitch(sw, fopAcM_GetHomeRoomNo(i_actor));
Expand All @@ -451,12 +451,12 @@ inline fopAc_ac_c* fopAcM_SearchByName(s16 proc_id) {
return (fopAc_ac_c*)fopAcIt_Judge(fpcSch_JudgeForPName, &proc_id);
}

inline void dComIfGs_onItem(int bitNo, int roomNo);
void dComIfGs_onItem(int bitNo, int roomNo);
inline void fopAcM_onItem(const fopAc_ac_c* item, int bitNo) {
dComIfGs_onItem(bitNo, fopAcM_GetHomeRoomNo(item));
}

inline bool dComIfGs_isItem(int bitNo, int roomNo);
bool dComIfGs_isItem(int bitNo, int roomNo);
inline bool fopAcM_isItem(const fopAc_ac_c* item, int bitNo) {
return dComIfGs_isItem(bitNo, fopAcM_GetHomeRoomNo(item));
}
Expand All @@ -469,7 +469,7 @@ inline int fopAcM_GetSetId(const fopAc_ac_c* i_actor) {
return i_actor->setID;
}

inline void dComIfGs_onActor(int bitNo, int roomNo);
void dComIfGs_onActor(int bitNo, int roomNo);

inline void fopAcM_onActor(const fopAc_ac_c* i_actor) {
dComIfGs_onActor(fopAcM_GetSetId(i_actor), fopAcM_GetHomeRoomNo(i_actor));
Expand Down Expand Up @@ -704,7 +704,7 @@ inline void make_prm_warp_hole(u32* o_params, u8 prm1, u8 prm2, u8 prm3) {
*o_params = pprm2 | pprm3 | pprm1;
}

inline fopAc_ac_c* dComIfGp_getPlayer(int);
fopAc_ac_c* dComIfGp_getPlayer(int);

inline s16 fopAcM_searchPlayerAngleY(const fopAc_ac_c* actor) {
return fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0));
Expand Down
13 changes: 12 additions & 1 deletion include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static const float INF = 2000000000.0f;
#define NO_INLINE
#endif
#endif

// Hack to trick the compiler into not inlining functions that use this macro.
#define FORCE_DONT_INLINE \
(void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \
Expand Down Expand Up @@ -176,4 +176,15 @@ static const float INF = 2000000000.0f;
using std::isnan;
#endif

// Comparing a non-volatile reference type to NULL is tautological
// and triggers a warning on modern compilers, but in some cases is
// required to match the original assembly.
#if defined(__MWERKS__) || defined(DECOMPCTX)
#define IS_REF_NULL(r) (&(r) == NULL)
#define IS_REF_NONNULL(r) (&(r) != NULL)
#else
#define IS_REF_NULL(r) (0)
#define IS_REF_NONNULL(r) (1)
#endif

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "JSystem/J3DGraphAnimator/J3DAnimation.h"

class J3DMaterial;

/**
* @ingroup jsystem-j3d
*
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JAudio2/JASAramStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ void JASAramStream::updateChannel(u32 i_callbackType, JASChannel* i_channel,
field_0x120 = 0;
field_0x12c |= 2;
if (field_0x0c4 < 0xffffffff) {
field_0x0c4++;
field_0x0c4 += 1;
}
field_0x0c0 = false;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JAudio2/JASAudioThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void* JASAudioThread::run() {

case AUDIOMSG_DSP:
JUT_ASSERT(125, snIntCount != 0);
snIntCount--;
snIntCount -= 1;
if (snIntCount == 0) {
JASProbe::stop(7);
JASDriver::finishDSPFrame();
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JAudio2/JASBasicBank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool JASBasicBank::getInstParam(int prg_no, int param_1, int param_2,
JASInstParam* o_param) const {
JASInst* inst = getInst(prg_no);
if (inst == NULL) {
return NULL;
return false;
}
return inst->getParam(param_1, param_2, o_param);
}
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JAudio2/JASCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <limits>

void JASCalc::imixcopy(const s16* s1, const s16* s2, s16* dst, u32 n) {
for (n; n != 0; n--) {
for (; n != 0; n--) {
*dst++ = *(s1)++;
*dst++ = *(s2)++;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JAudio2/JASSeqParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ u32 JASSeqParser::readReg(JASTrack* param_0, u32 param_1) const {
case 0x6a:
result = param_0->getReleasePrio();
// @bug this should have been <<=
result << 8;
(void)(result << 8);
result |= param_0->getNoteOnPrio();
break;
case 0x6b:
Expand Down
6 changes: 3 additions & 3 deletions libs/JSystem/src/JParticle/JPABaseShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ JPABaseShape::JPABaseShape(u8 const* pData, JKRHeap* pHeap) {
}

if (isTexAnm()) {
JUT_ASSERT(1698, pBsd->texAnmKeyNum != NULL);
JUT_ASSERT(1698, pBsd->texAnmKeyNum != 0);
u32 offs = sizeof(JPABaseShapeData);
if (isTexCrdAnm()) {
offs += 0x28;
Expand All @@ -1271,7 +1271,7 @@ JPABaseShape::JPABaseShape(u8 const* pData, JKRHeap* pHeap) {
}

if (isPrmAnm()) {
JUT_ASSERT(1707, pBsd->prmAnmKeyNum != NULL);
JUT_ASSERT(1707, pBsd->prmAnmKeyNum != 0);
JPAClrAnmKeyData* anmKeyData = (JPAClrAnmKeyData*)(pData + pBsd->mClrPrmAnmOffset);
makeColorTable(&mpPrmClrAnmTbl, anmKeyData,
pBsd->prmAnmKeyNum, pBsd->mClrAnmFrmMax, pHeap);
Expand All @@ -1280,7 +1280,7 @@ JPABaseShape::JPABaseShape(u8 const* pData, JKRHeap* pHeap) {
}

if (isEnvAnm()) {
JUT_ASSERT(1716, pBsd->envAnmKeyNum != NULL);
JUT_ASSERT(1716, pBsd->envAnmKeyNum != 0);
JPAClrAnmKeyData* anmKeyData = (JPAClrAnmKeyData*)(pData + pBsd->mClrEnvAnmOffset);
makeColorTable(&mpEnvClrAnmTbl, anmKeyData,
pBsd->envAnmKeyNum, pBsd->mClrAnmFrmMax, pHeap);
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JStudio/JStudio_JStage/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool JStudio_JStage::TCreateObject::create(
eObject = JStage::OBJECT_FOG;
break;
default:
return NULL;
return false;
}
JUT_ASSERT(99, pfnCreateObject!=NULL);
JUT_ASSERT(100, eObject!=JStage::OBJECT_UNDEFINED);
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JUtility/JUTConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void JUTConsole::doDraw(JUTConsole::EConsoleType consoleType) const {
mFont->drawString_scale((int)f31, sp94, mFontSizeX, mFontSizeY,
mVisible ? "[ON]" : "[OFF]", TRUE);
f31 += (int)(mFontSizeX * 6.0f);
if (this == NULL) // ????
if (IS_REF_NULL(*this)) // ????
{
mFont->setCharColor(JUtility::TColor(0xff, 0xff, 0x64, 0xff));
mFont->drawString_scale((int)(f31 - mFontSizeX), mFontSizeX, mFontSizeY, sp94,
Expand Down
2 changes: 1 addition & 1 deletion libs/JSystem/src/JUtility/JUTException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ bool JUTException::queryMapAddress_single(char* mapPath, u32 address, s32 sectio
dst--;
i--;
}
(void)*src; // needed to match debug
UNUSED(*src); // needed to match debug
*dst = 0;
if (print) {
if (begin_with_newline) {
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_alink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15712,7 +15712,7 @@ int daAlink_c::procMoveTurnInit(int param_0) {
dComIfGp_setPlayerStatus0(0, 0x800);

if (param_0 != 0) {
mProcVar3.field_0x300e = (mpHIO->mMove.m.mMaxTurnAngle * 4) + 19030;
mProcVar3.field_0x300e = (s16)((mpHIO->mMove.m.mMaxTurnAngle * 4) + 19030);
mProcVar4.field_0x3010 = mpHIO->mMove.m.mMaxTurnAngle * 2;
mProcVar1.field_0x300a = 2;
current.angle.y = mMoveAngle;
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_b_bq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ static void demo_camera(b_bq_class* i_this) {
spFC.set(BREG_F(5) + -30.0f, 0.0f, BREG_F(6) + 1938.0f);
}

daPy_getPlayerActorClass()->setPlayerPosAndAngle(&spFC, BREG_S(5) + 0x8000, 0);
daPy_getPlayerActorClass()->setPlayerPosAndAngle(&spFC, (s16)(BREG_S(5) + 0x8000), 0);

if (i_this->field_0x5c8 != 0) {
i_this->field_0x5cc.y += i_this->field_0x5d8;
Expand Down
Loading
Loading