mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-04 18:28:45 -04:00
Fix JUT_ASSERT and several other macros (#2711)
* Fix JUT_ASSERT to be a nested define * Switch names that appear in asserts to be constants instead of defines * Replace `0` in asserts with `NULL` or `FALSE` * Fix fpclassify * Fix ARRAY_SIZE * Use G_CM3D_F_INF * More fixes for fpclassify * Remove FLOAT_LABEL * Remove incorrect FLAG_ON macro * Remove UNK_BSS macro * Silence clangd unused header warning for PCH
This commit is contained in:
@@ -19,7 +19,7 @@ public:
|
||||
bool isSoundAttached() const { return sound_ != NULL; }
|
||||
|
||||
JAISound* operator->() const {
|
||||
JUT_ASSERT(58, sound_ != 0);
|
||||
JUT_ASSERT(58, sound_ != NULL);
|
||||
return sound_;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
|
||||
JASGlobalInstance(bool param_1) {
|
||||
if (param_1) {
|
||||
JUT_ASSERT(186, sInstance == 0);
|
||||
JUT_ASSERT(186, sInstance == NULL);
|
||||
sInstance = (T*)this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@ namespace JASDsp {
|
||||
extern const u32 FILTER_MODE_IIR;
|
||||
};
|
||||
|
||||
#define MAX_CHILDREN 16
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
@@ -126,6 +124,8 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
static JASDefaultBankTable sDefaultBankTable;
|
||||
static TList sTrackList;
|
||||
|
||||
static const int MAX_CHILDREN = 16;
|
||||
|
||||
JASSeqCtrl* getSeqCtrl() { return &mSeqCtrl; }
|
||||
u16 getPort(u32 param_0) const { return mTrackPort.get(param_0); }
|
||||
void setPort(u32 param_0, u16 param_1) { mTrackPort.set(param_0, param_1); }
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
JASHeap* heap = &mHeaps[0]; // should probably be mHeaps[i] but that doesn't match
|
||||
heap->free();
|
||||
if (!heap) {
|
||||
JUT_ASSERT(47, 0);
|
||||
JUT_ASSERT(47, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,19 +191,19 @@ struct TLinkList : public TNodeLinkList {
|
||||
};
|
||||
|
||||
static TLinkListNode* Element_toNode(T* p) {
|
||||
JUT_ASSERT(0x2F1, p!=0);
|
||||
JUT_ASSERT(0x2F1, p!=NULL);
|
||||
return reinterpret_cast<TLinkListNode*>(reinterpret_cast<char*>(p) - I);
|
||||
}
|
||||
static const TLinkListNode* Element_toNode(const T* p) {
|
||||
JUT_ASSERT(0x2F6, p!=0);
|
||||
JUT_ASSERT(0x2F6, p!=NULL);
|
||||
return reinterpret_cast<const TLinkListNode*>(reinterpret_cast<const char*>(p) - I);
|
||||
}
|
||||
static T* Element_toValue(TLinkListNode* p) {
|
||||
JUT_ASSERT(0x2FB, p!=0);
|
||||
JUT_ASSERT(0x2FB, p!=NULL);
|
||||
return reinterpret_cast<T*>(reinterpret_cast<char*>(p) + I);
|
||||
}
|
||||
static const T* Element_toValue(const TLinkListNode* p) {
|
||||
JUT_ASSERT(0x300, p!=0);
|
||||
JUT_ASSERT(0x300, p!=NULL);
|
||||
return reinterpret_cast<const T*>(reinterpret_cast<const char*>(p) + I);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ struct TExpandStride_<s32> {
|
||||
//! Target: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d_RCPFdd_d
|
||||
template <typename T>
|
||||
inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& fallback) {
|
||||
JUT_ASSERT(200, pValue!=0);
|
||||
JUT_ASSERT(200, pValue!=NULL);
|
||||
u32 index = idx;
|
||||
if (index >= count) {
|
||||
return fallback;
|
||||
|
||||
@@ -23,7 +23,7 @@ struct TAllocator {
|
||||
}
|
||||
|
||||
void destroy(T* p) {
|
||||
JUT_ASSERT(68, p!=0);
|
||||
JUT_ASSERT(68, p!=NULL);
|
||||
}
|
||||
|
||||
/* 0x0 */ u8 mAllocator;
|
||||
|
||||
@@ -125,7 +125,7 @@ struct TVector {
|
||||
u32 capacity() { return mCapacity; }
|
||||
|
||||
u32 GetSize_extend_(u32 count) {
|
||||
JUT_ASSERT(0x22B, pfnExtend_!=0);
|
||||
JUT_ASSERT(0x22B, pfnExtend_!=NULL);
|
||||
|
||||
u32 oldSize = size();
|
||||
u32 neededNewSpace = oldSize + count;
|
||||
|
||||
@@ -56,12 +56,12 @@ public:
|
||||
void releaseMCTX(JORMContext*);
|
||||
|
||||
void appendEventCallbackListNode(JOREventCallbackListNode* p) {
|
||||
JUT_ASSERT(256, p!=0);
|
||||
JUT_ASSERT(256, p!=NULL);
|
||||
m_eventCallbackList.Push_front(p);
|
||||
}
|
||||
|
||||
void removeEventCallbackListNode(JOREventCallbackListNode* p) {
|
||||
JUT_ASSERT(257, p!=0);
|
||||
JUT_ASSERT(257, p!=NULL);
|
||||
m_eventCallbackList.Remove(p);
|
||||
}
|
||||
|
||||
|
||||
@@ -202,12 +202,12 @@ public:
|
||||
|
||||
static JKRCompression convertAttrToCompressionType(u32 attr) {
|
||||
#define JKRARCHIVE_ATTR_COMPRESSION 0x04
|
||||
#define JKRARCHIVE_ATTR_YAY0 0x80
|
||||
#define JKRARCHIVE_ATTR_YAZ0 0x80
|
||||
|
||||
JKRCompression compression;
|
||||
if (FLAG_ON(attr, JKRARCHIVE_ATTR_COMPRESSION)) {
|
||||
if (!(attr & JKRARCHIVE_ATTR_COMPRESSION)) {
|
||||
compression = COMPRESSION_NONE;
|
||||
} else if (!FLAG_ON(attr, JKRARCHIVE_ATTR_YAY0)) {
|
||||
} else if (attr & JKRARCHIVE_ATTR_YAZ0) {
|
||||
compression = COMPRESSION_YAZ0;
|
||||
} else {
|
||||
compression = COMPRESSION_YAY0;
|
||||
|
||||
@@ -36,8 +36,8 @@ struct TControl {
|
||||
}
|
||||
|
||||
int setMessageCode_inReset_(const TProcessor* pProcessor, u16 u16GroupID, u16 u16Index) {
|
||||
JUT_ASSERT(138, pEntry_==0);
|
||||
JUT_ASSERT(139, pszText_update_current_==0);
|
||||
JUT_ASSERT(138, pEntry_==NULL);
|
||||
JUT_ASSERT(139, pszText_update_current_==NULL);
|
||||
JUT_ASSERT(140, oStack_renderingProcessor_.empty());
|
||||
|
||||
if (!setMessageCode_inSequence_(pProcessor, u16GroupID, u16Index)) {
|
||||
|
||||
@@ -20,7 +20,7 @@ struct TReference {
|
||||
/* 802A7B40 */ virtual const char* do_word(u32) const;
|
||||
|
||||
int on_parseCharacter(const char** ppszText) const {
|
||||
JUT_ASSERT(97, pcResource_!=0);
|
||||
JUT_ASSERT(97, pcResource_!=NULL);
|
||||
return pcResource_->parseCharacter(ppszText);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ struct TProcessor {
|
||||
pResourceCache_(NULL),
|
||||
pszCurrent_(NULL)
|
||||
{
|
||||
JUT_ASSERT(584, pReference_!=0);
|
||||
JUT_ASSERT(584, pReference_!=NULL);
|
||||
}
|
||||
|
||||
typedef bool (*pfnProcess_func)(TProcessor*);
|
||||
@@ -175,7 +175,7 @@ struct TProcessor {
|
||||
void on_character(int iCharacter) { do_character(iCharacter); }
|
||||
|
||||
const char* on_message_limited(u16 u16Index) const {
|
||||
JUT_ASSERT(482, pResourceCache_!=0);
|
||||
JUT_ASSERT(482, pResourceCache_!=NULL);
|
||||
return pResourceCache_->getMessageText_messageIndex(u16Index);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ struct TProcessor {
|
||||
}
|
||||
|
||||
int setBegin_messageEntryText(const TProcessor* pProcessor, const void* pEntry, const char* pszText) {
|
||||
JUT_ASSERT(306, pProcessor!=0);
|
||||
JUT_ASSERT(306, pProcessor!=NULL);
|
||||
setBegin_messageEntryText(pProcessor->getResourceCache(), pEntry, pszText);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ struct TResource {
|
||||
}
|
||||
|
||||
char* getMessageText_messageEntry(const void* pEntry) const {
|
||||
JUT_ASSERT(141, pEntry!=0);
|
||||
JUT_ASSERT(141, pEntry!=NULL);
|
||||
return pMessageText_ + *(int*)pEntry;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ struct TResourceContainer {
|
||||
/* 802A90F0 */ void setEncoding_(u8 e);
|
||||
|
||||
int parseCharacter(const char** ppszText) const {
|
||||
JUT_ASSERT(330, pfnParseCharacter_!=0);
|
||||
JUT_ASSERT(330, pfnParseCharacter_!=NULL);
|
||||
return pfnParseCharacter_(ppszText);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace ctb {
|
||||
struct TObject : public object::TObject_ID {
|
||||
TObject(const void* id, u32 size, const void* param_2) : object::TObject_ID(id, size) {
|
||||
pData_ = param_2;
|
||||
JUT_ASSERT(82, pData_!=0);
|
||||
JUT_ASSERT(82, pData_!=NULL);
|
||||
}
|
||||
/* 80280F18 */ virtual ~TObject() = 0;
|
||||
virtual int getScheme() const = 0;
|
||||
|
||||
@@ -338,7 +338,7 @@ public:
|
||||
|
||||
f32 operator*() {
|
||||
#ifdef DEBUG
|
||||
JUT_ASSERT(947, pf_!=0);
|
||||
JUT_ASSERT(947, pf_!=NULL);
|
||||
#endif
|
||||
return *pf_;
|
||||
}
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
|
||||
f32 operator*() {
|
||||
#ifdef DEBUG
|
||||
JUT_ASSERT(1098, pf_!=0);
|
||||
JUT_ASSERT(1098, pf_!=NULL);
|
||||
#endif
|
||||
return *pf_;
|
||||
}
|
||||
|
||||
@@ -123,13 +123,13 @@ public:
|
||||
CMtxP transformOnSet_getMatrix() const { return mTransformOnSet_Matrix; }
|
||||
|
||||
void transformOnSet_transformTranslation(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(226, pDst!=0);
|
||||
JUT_ASSERT(226, pDst!=NULL);
|
||||
JUT_ASSERT(227, &rSrc!=pDst);
|
||||
MTXMultVec(transformOnSet_getMatrix(), &rSrc, pDst);
|
||||
}
|
||||
|
||||
void transformOnSet_transformRotation(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(232, pDst!=0);
|
||||
JUT_ASSERT(232, pDst!=NULL);
|
||||
JUT_ASSERT(233, &rSrc!=pDst);
|
||||
pDst->x = rSrc.x;
|
||||
pDst->y = rSrc.y + mTransformOnSet_RotationY;
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
}
|
||||
|
||||
void transformOnSet_transformScaling(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(240, pDst!=0);
|
||||
JUT_ASSERT(240, pDst!=NULL);
|
||||
JUT_ASSERT(241, &rSrc!=pDst);
|
||||
*pDst = rSrc;
|
||||
}
|
||||
@@ -176,20 +176,20 @@ public:
|
||||
CMtxP transformOnGet_getMatrix() const { return mTransformOnGet_Matrix; }
|
||||
|
||||
void transformOnGet_transformTranslation(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(296, pDst!=0);
|
||||
JUT_ASSERT(296, pDst!=NULL);
|
||||
JUT_ASSERT(297, &rSrc!=pDst);
|
||||
MTXMultVec(transformOnGet_getMatrix(), &rSrc, pDst);
|
||||
}
|
||||
|
||||
void transformOnGet_transformDirection(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(316, pDst!=0);
|
||||
JUT_ASSERT(316, pDst!=NULL);
|
||||
JUT_ASSERT(317, &rSrc!=pDst);
|
||||
MTXMultVecSR(transformOnGet_getMatrix(), &rSrc, pDst);
|
||||
}
|
||||
|
||||
void transformOnGet_transform(TTransform_position_direction* param_1,
|
||||
TTransform_position_direction* pDst) const {
|
||||
JUT_ASSERT(289, pDst!=0);
|
||||
JUT_ASSERT(289, pDst!=NULL);
|
||||
transformOnGet_transformTranslation(param_1->position, &pDst->position);
|
||||
transformOnGet_transformDirection(param_1->direction, &pDst->direction);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
}
|
||||
|
||||
void transformOnGet_transformRotation(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(302, pDst!=0);
|
||||
JUT_ASSERT(302, pDst!=NULL);
|
||||
JUT_ASSERT(303, &rSrc!=pDst);
|
||||
pDst->x = rSrc.x;
|
||||
pDst->y = rSrc.y + mTransformOnGet_RotationY;
|
||||
@@ -228,14 +228,14 @@ public:
|
||||
}
|
||||
|
||||
void transformOnGet_transformScaling(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(310, pDst!=0);
|
||||
JUT_ASSERT(310, pDst!=NULL);
|
||||
JUT_ASSERT(311, &rSrc!=pDst);
|
||||
*pDst = rSrc;
|
||||
}
|
||||
|
||||
void transformOnGet_transform(TTransform_translation_rotation_scaling* param_1,
|
||||
TTransform_translation_rotation_scaling* pDst) const {
|
||||
JUT_ASSERT(263, pDst!=0);
|
||||
JUT_ASSERT(263, pDst!=NULL);
|
||||
transformOnGet_transformTranslation(param_1->translation, &pDst->translation);
|
||||
transformOnGet_transformRotation(param_1->rotation, &pDst->rotation);
|
||||
transformOnGet_transformScaling(param_1->scaling, &pDst->scaling);
|
||||
@@ -252,14 +252,14 @@ public:
|
||||
}
|
||||
|
||||
void transformOnSet_transformDirection(const Vec& rSrc, Vec* pDst) const {
|
||||
JUT_ASSERT(246, pDst!=0);
|
||||
JUT_ASSERT(246, pDst!=NULL);
|
||||
JUT_ASSERT(247, &rSrc!=pDst);
|
||||
MTXMultVecSR(transformOnSet_getMatrix(), &rSrc, pDst);
|
||||
}
|
||||
|
||||
void transformOnSet_transform(TTransform_position_direction* param_1,
|
||||
TTransform_position_direction* pDst) const {
|
||||
JUT_ASSERT(219, pDst!=0);
|
||||
JUT_ASSERT(219, pDst!=NULL);
|
||||
transformOnSet_transformTranslation(param_1->position, &pDst->position);
|
||||
transformOnSet_transformDirection(param_1->direction, &pDst->direction);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ struct TCreateObject : public JStudio::TCreateObject {
|
||||
pJAISoundStarter_ = p_soundStarter;
|
||||
pJSGSystem_ = p_system;
|
||||
mPermit_onExit_notEnd = false;
|
||||
JUT_ASSERT(45, pJAISoundStarter_!=0);
|
||||
JUT_ASSERT(45, pJAISoundStarter_!=NULL);
|
||||
}
|
||||
|
||||
/* 8028D550 */ virtual ~TCreateObject();
|
||||
|
||||
@@ -14,7 +14,7 @@ struct TCreateObject : public JStudio::TCreateObject {
|
||||
pJPAEmitterManager_ = p_emitMgr;
|
||||
pJSGSystem_ = p_system;
|
||||
mPermit_onExit_notEnd = false;
|
||||
JUT_ASSERT(48, pJPAEmitterManager_!=0);
|
||||
JUT_ASSERT(48, pJPAEmitterManager_!=NULL);
|
||||
}
|
||||
|
||||
/* 8028E3A0 */ virtual ~TCreateObject();
|
||||
@@ -42,7 +42,7 @@ struct TAdaptor_particle : public JStudio::TAdaptor_particle {
|
||||
TJPACallback_emitter_(TAdaptor_particle* param_1) {
|
||||
pThis_ = param_1;
|
||||
pOld = NULL;
|
||||
JUT_ASSERT(113, pThis_!=0);
|
||||
JUT_ASSERT(113, pThis_!=NULL);
|
||||
}
|
||||
/* 8028ECC0 */ virtual void execute(JPABaseEmitter*);
|
||||
/* 8028F060 */ virtual void executeAfter(JPABaseEmitter*);
|
||||
|
||||
@@ -17,7 +17,7 @@ typedef JStudio::TObject* (*ObjCreateFuncT)(const JStudio::stb::data::TParse_TBl
|
||||
struct TCreateObject : public JStudio::TCreateObject {
|
||||
TCreateObject(const JStage::TSystem* pSystem) {
|
||||
pJSGSystem_ = pSystem;
|
||||
JUT_ASSERT(42, pJSGSystem_!=0);
|
||||
JUT_ASSERT(42, pJSGSystem_!=NULL);
|
||||
}
|
||||
|
||||
/* 80289B00 */ virtual ~TCreateObject();
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
#include "dolphin/os.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define JUT_SHOW_ASSERT(LINE, COND) JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND)
|
||||
|
||||
#define JUT_ASSERT(LINE, COND) \
|
||||
(COND) ? (void)0 : (JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND), OSPanic(__FILE__, LINE, "Halt"));
|
||||
(COND) ? (void)0 : (JUT_SHOW_ASSERT(LINE, COND), OSPanic(__FILE__, LINE, "Halt"));
|
||||
|
||||
#define JUT_ASSERT_MSG(LINE, COND, MSG) \
|
||||
(COND) ? (void)0 : (JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, MSG), OSPanic(__FILE__, LINE, "Halt"));
|
||||
|
||||
@@ -57,7 +57,8 @@ public:
|
||||
initialize_state();
|
||||
}
|
||||
|
||||
static IsLeadByte_func const saoAboutEncoding_[3];
|
||||
static const int suAboutEncoding_ = 3;
|
||||
static IsLeadByte_func const saoAboutEncoding_[suAboutEncoding_];
|
||||
|
||||
// some types uncertain, may need to be fixed
|
||||
/* 0x1C */ int mWidth;
|
||||
|
||||
@@ -78,7 +78,7 @@ struct daFmtMng_Path_c {
|
||||
} else {
|
||||
field_0x4 = decIndex(field_0x4);
|
||||
}
|
||||
field_0x8 = 1000000000.0f;
|
||||
field_0x8 = G_CM3D_F_INF;
|
||||
}
|
||||
|
||||
void setNextPoint(cXyz *param_1) {
|
||||
@@ -175,7 +175,7 @@ struct daFmtMng_c : public fopAc_ac_c {
|
||||
int getEndTime() { return (fopAcM_GetParam(this) >> 24) & 0xff; }
|
||||
|
||||
void callExecute() {
|
||||
JUT_ASSERT(680, mAction != 0);
|
||||
JUT_ASSERT(680, mAction != NULL);
|
||||
(this->*(mAction[1]))();
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ struct daFmtMng_c : public fopAc_ac_c {
|
||||
}
|
||||
|
||||
void callInit() {
|
||||
JUT_ASSERT(667, mAction != 0)
|
||||
JUT_ASSERT(667, mAction != NULL)
|
||||
(this->*(*mAction))();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
cXyz sp2C;
|
||||
cXyz sp20;
|
||||
|
||||
JUT_ASSERT(164, 0 != arrow_p);
|
||||
JUT_ASSERT(164, NULL != arrow_p);
|
||||
|
||||
if (field_0xa38 != 0) {
|
||||
return 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
cXyz sp2C;
|
||||
cXyz sp20;
|
||||
|
||||
JUT_ASSERT(170, 0 != arrow_p);
|
||||
JUT_ASSERT(170, NULL != arrow_p);
|
||||
|
||||
if (field_0xa16 != 0 || health == 0) {
|
||||
return 0;
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
void setWolfHowling() {
|
||||
if (mType != 0) {
|
||||
fopAc_ac_c* actor_p = mActorMngrs[3].getActorP();
|
||||
JUT_ASSERT(0x1A3, 0 != actor_p);
|
||||
JUT_ASSERT(0x1A3, NULL != actor_p);
|
||||
|
||||
((daObj_Sekizoa_c*)actor_p)->setWolfHowling();
|
||||
} else {
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
f32 getAttnPosOffset() {
|
||||
u32 attnPosOffset = (fopAcM_GetParam(this) & 0xff0000) >> 0x10;
|
||||
if (attnPosOffset == 0xff) {
|
||||
return 1000000000.0f;
|
||||
return G_CM3D_F_INF;
|
||||
} else {
|
||||
return attnPosOffset;
|
||||
}
|
||||
|
||||
+3
-3
@@ -86,11 +86,11 @@ public:
|
||||
/* 80038098 */ virtual ~dDemo_actor_c();
|
||||
/* 800387EC */ virtual void JSGSetData(u32, void const*, u32);
|
||||
/* 8003A05C */ virtual s32 JSGFindNodeID(char const* param_0) const {
|
||||
JUT_ASSERT(0, mModel != 0);
|
||||
JUT_ASSERT(0, mModel != NULL);
|
||||
return mModel->getModelData()->getJointName()->getIndex(param_0);
|
||||
}
|
||||
/* 8003A088 */ virtual bool JSGGetNodeTransformation(u32 param_0, Mtx param_1) const {
|
||||
JUT_ASSERT(0, mModel != 0);
|
||||
JUT_ASSERT(0, mModel != NULL);
|
||||
cMtx_copy(mModel->getAnmMtx((u16)param_0), param_1);
|
||||
return true;
|
||||
}
|
||||
@@ -375,7 +375,7 @@ public:
|
||||
static jmessage_tControl* getMesgControl() { return m_mesgControl; }
|
||||
|
||||
static dDemo_camera_c* getCamera() {
|
||||
JUT_ASSERT(0, m_object != 0);
|
||||
JUT_ASSERT(0, m_object != NULL);
|
||||
return m_object->getActiveCamera();
|
||||
}
|
||||
|
||||
|
||||
+29
-28
@@ -9,35 +9,36 @@
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JHostIO/JORReflexible.h"
|
||||
|
||||
#define DEFAULT_SELECT_ITEM_INDEX 0
|
||||
#define MAX_SELECT_ITEM 4
|
||||
#define SELECT_ITEM_NUM 2
|
||||
#define MAX_EQUIPMENT 6
|
||||
#define MAX_EVENTS 256
|
||||
#define MAX_ITEM_SLOTS 24
|
||||
#define LIGHT_DROP_STAGE 4
|
||||
#define LETTER_INFO_BIT 64
|
||||
#define MAX_INSECT_NUM 24
|
||||
#define MAX_VISIBLE_HEARTPIECES 4
|
||||
#define MAX_POH_NUM 100
|
||||
#define TBOX_MAX 64
|
||||
#define DSV_MEMBIT_ENUM_MAX 8
|
||||
#define ITEM_MAX_DAN 128
|
||||
#define SWITCH_ZONE_MAX 0x20
|
||||
#define SWITCH_ONE_ZONE_MAX 0x10
|
||||
#define ITEM_ZONE_MAX 0x20
|
||||
#define ITEM_ONE_ZONE_MAX 0x10
|
||||
#define QUEST_LOG_SIZE 0xA94
|
||||
#define QUIVER_MAX 30
|
||||
#define BIG_QUIVER_MAX 60
|
||||
#define GIANT_QUIVER_MAX 100
|
||||
#define WALLET_MAX 300
|
||||
#define BIG_WALLET_MAX 600
|
||||
#define GIANT_WALLET_MAX 1000
|
||||
#define MAX_FINDABLE_FISHES 6
|
||||
|
||||
#define ITEM_XY_MAX_DUMMY 8
|
||||
#define ITEM_BIT_MAX 0x100
|
||||
static const int DEFAULT_SELECT_ITEM_INDEX = 0;
|
||||
static const int MAX_SELECT_ITEM = 4;
|
||||
static const int SELECT_ITEM_NUM = 2;
|
||||
static const int MAX_EQUIPMENT = 6;
|
||||
static const int MAX_EVENTS = 256;
|
||||
static const int MAX_ITEM_SLOTS = 24;
|
||||
static const int LIGHT_DROP_STAGE = 4;
|
||||
static const int LETTER_INFO_BIT = 64;
|
||||
static const int MAX_INSECT_NUM = 24;
|
||||
static const int MAX_VISIBLE_HEARTPIECES = 4;
|
||||
static const int MAX_POH_NUM = 100;
|
||||
static const int TBOX_MAX = 64;
|
||||
static const int DSV_MEMBIT_ENUM_MAX = 8;
|
||||
static const int ITEM_MAX_DAN = 128;
|
||||
static const int SWITCH_ZONE_MAX = 0x20;
|
||||
static const int SWITCH_ONE_ZONE_MAX = 0x10;
|
||||
static const int ITEM_ZONE_MAX = 0x20;
|
||||
static const int ITEM_ONE_ZONE_MAX = 0x10;
|
||||
static const int QUEST_LOG_SIZE = 0xA94;
|
||||
static const int QUIVER_MAX = 30;
|
||||
static const int BIG_QUIVER_MAX = 60;
|
||||
static const int GIANT_QUIVER_MAX = 100;
|
||||
static const int WALLET_MAX = 300;
|
||||
static const int BIG_WALLET_MAX = 600;
|
||||
static const int GIANT_WALLET_MAX = 1000;
|
||||
static const int MAX_FINDABLE_FISHES = 6;
|
||||
|
||||
static const int ITEM_BIT_MAX = 0x100;
|
||||
static const int ITEM_XY_MAX_DUMMY = 8;
|
||||
|
||||
enum ButtonIndexes {
|
||||
/* 0 */ A_BUTTON,
|
||||
|
||||
+48
-48
@@ -581,22 +581,22 @@ public:
|
||||
(void)i_LightVecInfo;
|
||||
dStage_SetErrorStage();
|
||||
OSReport("stage non LightVec data !!\n");
|
||||
JUT_ASSERT(3003, 0);
|
||||
JUT_ASSERT(3003, FALSE);
|
||||
}
|
||||
/* vt[43] */ virtual stage_pure_lightvec_info_class* getLightVecInfo(void) const {
|
||||
OSReport("stage non LightVec data !!\n");
|
||||
JUT_ASSERT(3007, 0);
|
||||
JUT_ASSERT(3007, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
/* vt[44] */ virtual void setLightVecInfoNum(int i_LightVecInfoNum) {
|
||||
(void)i_LightVecInfoNum;
|
||||
dStage_SetErrorStage();
|
||||
OSReport("stage non LightVecNum data !!\n");
|
||||
JUT_ASSERT(3014, 0);
|
||||
JUT_ASSERT(3014, FALSE);
|
||||
}
|
||||
/* vt[45] */ virtual int getLightVecInfoNum(void) const {
|
||||
OSReport("stage non LightVecNum data !!\n");
|
||||
JUT_ASSERT(3018, 0);
|
||||
JUT_ASSERT(3018, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
/* vt[40] */ virtual void setPlightNumInfo(int i_PlightNumInfo) { mPlightNumInfo = i_PlightNumInfo; }
|
||||
@@ -623,22 +623,22 @@ public:
|
||||
(void)list;
|
||||
dStage_SetErrorStage();
|
||||
OSReport("stage non filelist2 data!\n");
|
||||
JUT_ASSERT(3123, 0);
|
||||
JUT_ASSERT(3123, FALSE);
|
||||
}
|
||||
/* vt[65] */ virtual dStage_FileList2_dt_c* getFileList2Info(void) const {
|
||||
OSReport("stage non filelist2 data!\n");
|
||||
JUT_ASSERT(3127, 0);
|
||||
JUT_ASSERT(3127, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
/* vt[66] */ virtual void setFileListInfo(dStage_FileList_dt_c* list) {
|
||||
(void)list;
|
||||
dStage_SetErrorStage();
|
||||
OSReport("stage non filelist data!\n");
|
||||
JUT_ASSERT(3138, 0);
|
||||
JUT_ASSERT(3138, FALSE);
|
||||
}
|
||||
/* vt[67] */ virtual dStage_FileList_dt_c* getFileListInfo(void) const {
|
||||
OSReport("stage non filelist data!\n");
|
||||
JUT_ASSERT(3142, 0);
|
||||
JUT_ASSERT(3142, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
/* vt[68] */ virtual void setFloorInfo(dStage_FloorInfo_c* i_FloorInfo) { mFloorInfo = i_FloorInfo; }
|
||||
@@ -656,11 +656,11 @@ public:
|
||||
(void)lbnk;
|
||||
dStage_SetErrorStage();
|
||||
OSReport("stage non Lbnk data!\n");
|
||||
JUT_ASSERT(3231, 0);
|
||||
JUT_ASSERT(3231, FALSE);
|
||||
}
|
||||
/* vt[80] */ virtual dStage_Lbnk_c* getLbnk(void) const {
|
||||
OSReport("stage non Lbnk data!\n");
|
||||
JUT_ASSERT(3238, 0);
|
||||
JUT_ASSERT(3238, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
/* vt[81] */ virtual void setTresure(stage_tresure_class* i_Tresure) { mTresure = i_Tresure; }
|
||||
@@ -741,11 +741,11 @@ public:
|
||||
(void)i_Room;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non room data !!\n");
|
||||
JUT_ASSERT(2095, 0);
|
||||
JUT_ASSERT(2095, FALSE);
|
||||
}
|
||||
virtual roomRead_class* getRoom(void) const {
|
||||
OSReport("Room non room data !!\n");
|
||||
JUT_ASSERT(2100, 0);
|
||||
JUT_ASSERT(2100, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setMapInfo(stage_map_info_class* i_MapInfo) { mMapInfo = i_MapInfo; }
|
||||
@@ -757,33 +757,33 @@ public:
|
||||
(void)i_PaletteInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non palet data !!\n");
|
||||
JUT_ASSERT(2126, 0);
|
||||
JUT_ASSERT(2126, FALSE);
|
||||
}
|
||||
virtual stage_palette_info_class* getPaletteInfo(void) const {
|
||||
OSReport("Room non palet data !!\n");
|
||||
JUT_ASSERT(2130, 0);
|
||||
JUT_ASSERT(2130, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setPselectInfo(stage_pselect_info_class* i_PselectInfo) {
|
||||
(void)i_PselectInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non pselect data !!\n");
|
||||
JUT_ASSERT(2137, 0);
|
||||
JUT_ASSERT(2137, FALSE);
|
||||
}
|
||||
virtual stage_pselect_info_class* getPselectInfo(void) const {
|
||||
OSReport("Room non pselect data !!\n");
|
||||
JUT_ASSERT(2141, 0);
|
||||
JUT_ASSERT(2141, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setEnvrInfo(stage_envr_info_class* i_EnvrInfo) {
|
||||
(void)i_EnvrInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non envr data !!\n");
|
||||
JUT_ASSERT(2148, 0);
|
||||
JUT_ASSERT(2148, FALSE);
|
||||
}
|
||||
virtual stage_envr_info_class* getEnvrInfo(void) const {
|
||||
OSReport("Room non envr data !!\n");
|
||||
JUT_ASSERT(2152, 0);
|
||||
JUT_ASSERT(2152, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setVrboxInfo(stage_vrbox_info_class* i_VrboxInfo) { mVrboxInfo = i_VrboxInfo; }
|
||||
@@ -794,44 +794,44 @@ public:
|
||||
(void)i_PlightInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non plight data !!\n");
|
||||
JUT_ASSERT(2174, 0);
|
||||
JUT_ASSERT(2174, FALSE);
|
||||
}
|
||||
virtual stage_plight_info_class* getPlightInfo(void) const {
|
||||
OSReport("Room non plight data !!\n");
|
||||
JUT_ASSERT(2178, 0);
|
||||
JUT_ASSERT(2178, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setPaletteNumInfo(int i_PaletteNumInfo) {
|
||||
(void)i_PaletteNumInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non palette num data !!\n");
|
||||
JUT_ASSERT(2186, 0);
|
||||
JUT_ASSERT(2186, FALSE);
|
||||
}
|
||||
virtual int getPaletteNumInfo(void) const {
|
||||
OSReport("Room non palette num data !!\n");
|
||||
JUT_ASSERT(2190, 0);
|
||||
JUT_ASSERT(2190, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setPselectNumInfo(int i_PselectNumInfo) {
|
||||
(void)i_PselectNumInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non pselect num data !!\n");
|
||||
JUT_ASSERT(2197, 0);
|
||||
JUT_ASSERT(2197, FALSE);
|
||||
}
|
||||
virtual int getPselectNumInfo(void) const {
|
||||
OSReport("Room non pselect num data !!\n");
|
||||
JUT_ASSERT(2201, 0);
|
||||
JUT_ASSERT(2201, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setEnvrNumInfo(int i_EnvrNumInfo) {
|
||||
(void)i_EnvrNumInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non envr num data !!\n");
|
||||
JUT_ASSERT(2208, 0);
|
||||
JUT_ASSERT(2208, FALSE);
|
||||
}
|
||||
virtual int getEnvrNumInfo(void) const {
|
||||
OSReport("Room non envr num data !!\n");
|
||||
JUT_ASSERT(2212, 0);
|
||||
JUT_ASSERT(2212, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setVrboxNumInfo(int i_VrboxNumInfo) { mVrboxNumInfo = i_VrboxNumInfo; }
|
||||
@@ -842,11 +842,11 @@ public:
|
||||
(void)i_PlightNumInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non plight num data !!\n");
|
||||
JUT_ASSERT(2223, 0);
|
||||
JUT_ASSERT(2223, FALSE);
|
||||
}
|
||||
virtual int getPlightNumInfo(void) const {
|
||||
OSReport("Room non plight num data !!\n");
|
||||
JUT_ASSERT(2227, 0);
|
||||
JUT_ASSERT(2227, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setLightVecInfo(stage_pure_lightvec_info_class* i_LightVecInfo) { mLightVecInfo = i_LightVecInfo; }
|
||||
@@ -857,11 +857,11 @@ public:
|
||||
(void)i_StagInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non stag data !!\n");
|
||||
JUT_ASSERT(2256, 0);
|
||||
JUT_ASSERT(2256, FALSE);
|
||||
}
|
||||
virtual stage_stag_info_class* getStagInfo(void) const {
|
||||
OSReport("Room non stag data !!\n");
|
||||
JUT_ASSERT(2260, 0);
|
||||
JUT_ASSERT(2260, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setSclsInfo(stage_scls_info_dummy_class* i_SclsInfo) { mSclsInfo = i_SclsInfo; }
|
||||
@@ -870,22 +870,22 @@ public:
|
||||
(void)i_PntInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non Pnt data !\n");
|
||||
JUT_ASSERT(2281, 0);
|
||||
JUT_ASSERT(2281, FALSE);
|
||||
}
|
||||
virtual dStage_dPnt_c* getPntInf(void) const {
|
||||
OSReport("Room non Pnts data !\n");
|
||||
JUT_ASSERT(2285, 0);
|
||||
JUT_ASSERT(2285, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setPathInfo(dStage_dPath_c* i_PathInfo) {
|
||||
(void)i_PathInfo;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non Path data !\n");
|
||||
JUT_ASSERT(2292, 0);
|
||||
JUT_ASSERT(2292, FALSE);
|
||||
}
|
||||
virtual dStage_dPath_c* getPathInf(void) const {
|
||||
OSReport("Room non Path data !\n");
|
||||
JUT_ASSERT(2296, 0);
|
||||
JUT_ASSERT(2296, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setPnt2Info(dStage_dPnt_c* i_Pnt2Info) { mPnt2Info = i_Pnt2Info; }
|
||||
@@ -907,44 +907,44 @@ public:
|
||||
virtual void setMemoryConfig(dStage_MemoryConfig_c* i_MemoryConfig) {
|
||||
(void)i_MemoryConfig;
|
||||
OSReport("Room non memory config data!\n");
|
||||
JUT_ASSERT(2414, 0);
|
||||
JUT_ASSERT(2414, FALSE);
|
||||
}
|
||||
virtual dStage_MemoryConfig_c* getMemoryConfig(void) const {
|
||||
OSReport("Room non memory config data!\n");
|
||||
JUT_ASSERT(2423, 0);
|
||||
JUT_ASSERT(2423, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setMemoryMap(dStage_MemoryMap_c* i_MemoryMap) {
|
||||
(void)i_MemoryMap;
|
||||
OSReport("Room non memory map data!\n");
|
||||
JUT_ASSERT(2433, 0);
|
||||
JUT_ASSERT(2433, FALSE);
|
||||
}
|
||||
virtual dStage_MemoryMap_c* getMemoryMap(void) const {
|
||||
OSReport("Room non memory map data!\n");
|
||||
JUT_ASSERT(2442, 0);
|
||||
JUT_ASSERT(2442, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setMulti(dStage_Multi_c* i_Multi) {
|
||||
(void)i_Multi;
|
||||
OSReport("Room non multi data!\n");
|
||||
JUT_ASSERT(2452, 0);
|
||||
JUT_ASSERT(2452, FALSE);
|
||||
}
|
||||
virtual dStage_Multi_c* getMulti(void) const {
|
||||
OSReport("Room non multi data!\n");
|
||||
JUT_ASSERT(2457, 0);
|
||||
JUT_ASSERT(2457, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setOldMulti(void) {
|
||||
OSReport("Room non old multi data!\n");
|
||||
JUT_ASSERT(2462, 0);
|
||||
JUT_ASSERT(2462, FALSE);
|
||||
}
|
||||
virtual void resetOldMulti(void) {
|
||||
OSReport("Room non old multi data!\n");
|
||||
JUT_ASSERT(2467, 0);
|
||||
JUT_ASSERT(2467, FALSE);
|
||||
}
|
||||
virtual dStage_Multi_c* getOldMulti(void) const {
|
||||
OSReport("Room non old multi data!\n");
|
||||
JUT_ASSERT(2472, 0);
|
||||
JUT_ASSERT(2472, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setLbnk(dStage_Lbnk_c* i_Lbnk) { mLbnk = i_Lbnk; }
|
||||
@@ -954,11 +954,11 @@ public:
|
||||
virtual void setDMap(dStage_DMap_c* i_DMap) {
|
||||
(void)i_DMap;
|
||||
OS_REPORT("Room non DMap data\n");
|
||||
JUT_ASSERT(2508, 0);
|
||||
JUT_ASSERT(2508, FALSE);
|
||||
}
|
||||
virtual dStage_DMap_c* getDMap(void) const {
|
||||
OS_REPORT("Room non DMap data\n");
|
||||
JUT_ASSERT(2513, 0);
|
||||
JUT_ASSERT(2513, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setDrTg(stage_tgsc_class* i_DrTg) { mDrTg = i_DrTg; }
|
||||
@@ -968,18 +968,18 @@ public:
|
||||
virtual void setMapPath(void* i_MapPath) {
|
||||
(void)i_MapPath;
|
||||
OSReport("stage non 2d map path data !!\n");
|
||||
JUT_ASSERT(2557, 0);
|
||||
JUT_ASSERT(2557, FALSE);
|
||||
}
|
||||
virtual void* getMapPath(void) {
|
||||
OSReport("stage non 2d map path data !!\n");
|
||||
JUT_ASSERT(2561, 0);
|
||||
JUT_ASSERT(2561, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
virtual void setElst(dStage_Elst_c* i_Elst) {
|
||||
(void)i_Elst;
|
||||
dStage_SetErrorRoom();
|
||||
OSReport("Room non envLayserSet data\n");
|
||||
JUT_ASSERT(2572, 0);
|
||||
JUT_ASSERT(2572, FALSE);
|
||||
}
|
||||
virtual dStage_Elst_c* getElst(void) {
|
||||
dStage_SetErrorRoom();
|
||||
|
||||
+2
-9
@@ -23,8 +23,8 @@
|
||||
|
||||
#define ALIGN_DECL(ALIGNMENT) __attribute__((aligned(ALIGNMENT)))
|
||||
|
||||
#define ARRAY_SIZE(o) (s32)(sizeof((o)) / sizeof(*(o)))
|
||||
#define ARRAY_SIZEU(o) (sizeof((o)) / sizeof(*(o)))
|
||||
#define ARRAY_SIZE(o) (s32)(sizeof(o) / sizeof(o[0]))
|
||||
#define ARRAY_SIZEU(o) (sizeof(o) / sizeof(o[0]))
|
||||
|
||||
// Align X to the previous N bytes (N must be power of two)
|
||||
#define ALIGN_PREV(X, N) ((X) & ~((N)-1))
|
||||
@@ -37,10 +37,6 @@
|
||||
#define TRUNC(n, a) (((u32)(n)) & ~((a)-1))
|
||||
|
||||
#define JUT_EXPECT(...)
|
||||
#define FLAG_ON(V, F) (((V) & (F)) == 0)
|
||||
|
||||
#define FLOAT_LABEL(x) (*(f32*)&x)
|
||||
#define DOUBLE_LABEL(x) (*(f64*)&x)
|
||||
|
||||
#define _SDA_BASE_(dummy) 0
|
||||
#define _SDA2_BASE_(dummy) 0
|
||||
@@ -76,9 +72,6 @@ void* __memcpy(void*, const void*, int);
|
||||
// hack to make strings with no references compile properly
|
||||
#define DEAD_STRING(s) OSReport(s)
|
||||
|
||||
#define UNK_BSS(name) \
|
||||
static u8 lit_##name[1 + 3 /* padding */];
|
||||
|
||||
#define READU32_BE(ptr, offset) \
|
||||
(((u32)ptr[offset] << 24) | ((u32)ptr[offset + 1] << 16) | ((u32)ptr[offset + 2] << 8) | (u32)ptr[offset + 3]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user