1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 17:54:15 +00:00

assert macro OK (#755)

* create assert macro and replace a bunch of __assert

Signed-off-by: angie <angheloalf95@gmail.com>

* Another bunch of assert

Signed-off-by: angie <angheloalf95@gmail.com>

* more assert

Signed-off-by: angie <angheloalf95@gmail.com>

* assert(false)

Signed-off-by: angie <angheloalf95@gmail.com>

* last assert used in matching code

Signed-off-by: angie <angheloalf95@gmail.com>

* the non-matchings

Signed-off-by: angie <angheloalf95@gmail.com>

* typo

Signed-off-by: angie <angheloalf95@gmail.com>

* format

Signed-off-by: angie <angheloalf95@gmail.com>

* change macro to uppercase

Signed-off-by: angie <angheloalf95@gmail.com>

* Apply suggestions from code review

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Change ASSERT(false) to ASSERT(0)

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal 2021-04-29 14:39:46 -04:00 committed by GitHub
parent 0b8252cfe9
commit 98aef8988a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 148 additions and 301 deletions

View file

@ -129,4 +129,12 @@ extern GraphicsContext* __gfxCtx;
#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } }
#ifdef NDEBUG
#define ASSERT(cond, msg, file, line) ((void)0)
#elif defined(REAL_ASSERT_MACRO)
#define ASSERT(cond, msg, file, line) ((cond) ? ((void)0) : __assert(#cond, __FILE__, __LINE__))
#else
#define ASSERT(cond, msg, file, line) ((cond) ? ((void)0) : __assert(msg, file, line))
#endif
#endif

View file

@ -1651,17 +1651,9 @@ DmaMgr_DMARomToRam_end:
s32 DmaMgr_DmaCallback0(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) {
s32 ret;
if (pihandle != gCartHandle) {
__assert("pihandle == carthandle", "../z_std_dma.c", 530);
}
if (direction != OS_READ) {
__assert("direction == OS_READ", "../z_std_dma.c", 531);
}
if (mb == NULL) {
__assert("mb != NULL", "../z_std_dma.c", 532);
}
ASSERT(pihandle == gCartHandle, "pihandle == carthandle", "../z_std_dma.c", 530);
ASSERT(direction == OS_READ, "direction == OS_READ", "../z_std_dma.c", 531);
ASSERT(mb != NULL, "mb != NULL", "../z_std_dma.c", 532);
if (D_80009460 == 10) {
osSyncPrintf("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr,

View file

@ -100,10 +100,9 @@ void Sched_HandleStart(SchedContext* sc) {
void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
s32 type = task->list.t.type;
if (!((type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK))) {
__assert("(type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK)",
"../sched.c", 463);
}
ASSERT((type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK),
"(type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK)", "../sched.c",
463);
if (type == M_AUDTASK) {
if (sLogScheduler) {
@ -136,9 +135,7 @@ void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
void Sched_Yield(SchedContext* sc) {
if (!(sc->curRSPTask->state & OS_SC_YIELD)) {
if (sc->curRSPTask->list.t.type == M_AUDTASK) {
__assert("sc->curRSPTask->list.t.type != M_AUDTASK", "../sched.c", 496);
}
ASSERT(sc->curRSPTask->list.t.type != M_AUDTASK, "sc->curRSPTask->list.t.type != M_AUDTASK", "../sched.c", 496);
sc->curRSPTask->state |= OS_SC_YIELD;
@ -157,14 +154,14 @@ OSScTask* func_800C89D4(SchedContext* sc, OSScTask* task) {
if (sc->pendingSwapBuf1 != NULL) {
if (0) {
__assert("sc->pending_swapbuffer1", "../sched.c", UNK_LINE);
ASSERT(sc->pendingSwapBuf1 != NULL, "sc->pending_swapbuffer1", "../sched.c", UNK_LINE);
}
return NULL;
}
if (sc->pendingSwapBuf2 != NULL) {
if (0) {
__assert("sc->pending_swapbuffer2", "../sched.c", UNK_LINE);
ASSERT(sc->pendingSwapBuf2 != NULL, "sc->pending_swapbuffer2", "../sched.c", UNK_LINE);
}
return NULL;
}
@ -250,9 +247,7 @@ u32 Sched_IsComplete(SchedContext* sc, OSScTask* task) {
}
void Sched_RunTask(SchedContext* sc, OSScTask* spTask, OSScTask* dpTask) {
if (sc->curRSPTask != NULL) {
__assert("sc->curRSPTask == NULL", "../sched.c", 663);
}
ASSERT(sc->curRSPTask == NULL, "sc->curRSPTask == NULL", "../sched.c", 663);
if (spTask != NULL) {
if (spTask->list.t.type == 0) {
if (spTask->flags & OS_SC_NEEDS_RSP) {
@ -362,9 +357,7 @@ void Sched_HandleRSPDone(SchedContext* sc) {
OSScTask* nextRDP = NULL;
s32 state;
if (sc->curRSPTask == NULL) {
__assert("sc->curRSPTask", "../sched.c", 819);
}
ASSERT(sc->curRSPTask != NULL, "sc->curRSPTask", "../sched.c", 819);
if (sc->curRSPTask->list.t.type == M_AUDTASK) {
gRSPAudioTotalTime += osGetTime() - sRSPAudioStartTime;
@ -413,12 +406,8 @@ void Sched_HandleRDPDone(SchedContext* sc) {
s32 state;
gRDPTotalTime = osGetTime() - sRDPStartTime;
if (sc->curRDPTask == NULL) {
__assert("sc->curRDPTask", "../sched.c", 878);
}
if (sc->curRDPTask->list.t.type != M_GFXTASK) {
__assert("sc->curRDPTask->list.t.type == M_GFXTASK", "../sched.c", 879);
}
ASSERT(sc->curRDPTask != NULL, "sc->curRDPTask", "../sched.c", 878);
ASSERT(sc->curRDPTask->list.t.type == M_GFXTASK, "sc->curRDPTask->list.t.type == M_GFXTASK", "../sched.c", 879);
curTask = sc->curRDPTask;
sc->curRDPTask = NULL;
curTask->state &= ~OS_SC_DP;

View file

@ -31,9 +31,7 @@ void Matrix_Push(void) {
void Matrix_Pop(void) {
sCurrentMatrix--;
if (sCurrentMatrix < sMatrixStack) {
__assert("Matrix_now >= Matrix_stack", "../sys_matrix.c", 176);
}
ASSERT(sCurrentMatrix >= sMatrixStack, "Matrix_now >= Matrix_stack", "../sys_matrix.c", 176);
}
void Matrix_Get(MtxF* dest) {

View file

@ -1997,10 +1997,8 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
player = PLAYER;
if (0) {
// This assert is optimized out but it exists due to its presence in rodata
if (gMaxActorId != ACTOR_ID_MAX) {
__assert("MaxProfile == ACTOR_DLF_MAX", "../z_actor.c", UNK_LINE);
}
// This ASSERT is optimized out but it exists due to its presence in rodata
ASSERT(gMaxActorId == ACTOR_ID_MAX, "MaxProfile == ACTOR_DLF_MAX", "../z_actor.c", UNK_LINE);
}
sp74 = NULL;
@ -2390,9 +2388,8 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) {
if ((actor->flags & 0x80) &&
((globalCtx->roomCtx.curRoom.showInvisActors == 0) || (globalCtx->actorCtx.unk_03 != 0) ||
(actor->room != globalCtx->roomCtx.curRoom.num))) {
if (invisibleActorCounter >= INVISIBLE_ACTOR_MAX) {
__assert("invisible_actor_counter < INVISIBLE_ACTOR_MAX", "../z_actor.c", 6464);
}
ASSERT(invisibleActorCounter < INVISIBLE_ACTOR_MAX,
"invisible_actor_counter < INVISIBLE_ACTOR_MAX", "../z_actor.c", 6464);
invisibleActors[invisibleActorCounter] = actor;
invisibleActorCounter++;
} else {
@ -2632,10 +2629,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
u32 overlaySize;
overlayEntry = &gActorOverlayTable[actorId];
if (actorId >= ACTOR_ID_MAX) {
__assert("profile < ACTOR_DLF_MAX", "../z_actor.c", 6883);
}
ASSERT(actorId < ACTOR_ID_MAX, "profile < ACTOR_DLF_MAX", "../z_actor.c", 6883);
name = overlayEntry->name != NULL ? overlayEntry->name : "";
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
@ -2666,9 +2660,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
}
} else {
if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) {
if (overlaySize > AM_FIELD_SIZE) {
__assert("actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934);
}
ASSERT(overlaySize <= AM_FIELD_SIZE, "actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934);
if (actorCtx->absoluteSpace == NULL) {
// Translates to: "AMF: ABSOLUTE MAGIC FIELD"
@ -2732,9 +2724,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
return NULL;
}
if (overlayEntry->nbLoaded >= 255) {
__assert("actor_dlftbl->clients < 255", "../z_actor.c", 7031);
}
ASSERT(overlayEntry->nbLoaded < 255, "actor_dlftbl->clients < 255", "../z_actor.c", 7031);
overlayEntry->nbLoaded++;
@ -2873,14 +2863,8 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
osSyncPrintf("オーバーレイではありません\n");
}
} else {
if (overlayEntry->loadedRamAddr == NULL) {
__assert("actor_dlftbl->allocp != NULL", "../z_actor.c", 7251);
}
if (overlayEntry->nbLoaded <= 0) {
__assert("actor_dlftbl->clients > 0", "../z_actor.c", 7252);
}
ASSERT(overlayEntry->loadedRamAddr != NULL, "actor_dlftbl->allocp != NULL", "../z_actor.c", 7251);
ASSERT(overlayEntry->nbLoaded > 0, "actor_dlftbl->clients > 0", "../z_actor.c", 7252);
overlayEntry->nbLoaded--;
Actor_FreeOverlay(overlayEntry);
}

View file

@ -85,8 +85,7 @@ void SSNodeList_SetSSListHead(SSNodeList* nodeList, SSList* ssList, s16* polyId)
void DynaSSNodeList_SetSSListHead(DynaSSNodeList* nodeList, SSList* ssList, s16* polyId) {
u16 newNodeId = DynaSSNodeList_GetNextNodeIdx(nodeList);
(newNodeId != SS_NULL) ? (void)0 : __assert("new_node != SS_NULL", "../z_bgcheck.c", 1776);
ASSERT(newNodeId != SS_NULL, "new_node != SS_NULL", "../z_bgcheck.c", 1776);
SSNode_SetValue(&nodeList->tbl[newNodeId], polyId, ssList->head);
ssList->head = newNodeId;
}
@ -105,7 +104,7 @@ void DynaSSNodeList_Initialize(GlobalContext* globalCtx, DynaSSNodeList* nodeLis
void DynaSSNodeList_Alloc(GlobalContext* globalCtx, DynaSSNodeList* nodeList, s32 max) {
nodeList->tbl = THA_AllocEndAlign(&globalCtx->state.tha, max * sizeof(SSNode), -2);
(nodeList->tbl != NULL) ? (void)0 : __assert("psst->tbl != NULL", "../z_bgcheck.c", 1811);
ASSERT(nodeList->tbl != NULL, "psst->tbl != NULL", "../z_bgcheck.c", 1811);
nodeList->max = max;
nodeList->count = 0;
@ -699,7 +698,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
}
}
(!IS_ZERO(normalXZ)) ? (void)0 : __assert("!IS_ZERO(ac_size)", "../z_bgcheck.c", 2854);
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", "../z_bgcheck.c", 2854);
invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nz) * invNormalXZ;
@ -780,7 +779,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
}
}
(!IS_ZERO(normalXZ)) ? (void)0 : __assert("!IS_ZERO(ac_size)", "../z_bgcheck.c", 2964);
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", "../z_bgcheck.c", 2964);
invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nx) * invNormalXZ;
@ -2407,9 +2406,11 @@ void SSNodeList_Alloc(GlobalContext* globalCtx, SSNodeList* this, s32 tblMax, s3
this->count = 0;
this->tbl = THA_AllocEndAlign(&globalCtx->state.tha, tblMax * sizeof(SSNode), -2);
(this->tbl != NULL) ? (void)0 : __assert("this->short_slist_node_tbl != NULL", "../z_bgcheck.c", 5975);
ASSERT(this->tbl != NULL, "this->short_slist_node_tbl != NULL", "../z_bgcheck.c", 5975);
this->polyCheckTbl = GameState_Alloc(&globalCtx->state, numPolys, "../z_bgcheck.c", 5979);
(this->polyCheckTbl != NULL) ? (void)0 : __assert("this->polygon_check != NULL", "../z_bgcheck.c", 5981);
ASSERT(this->polyCheckTbl != NULL, "this->polygon_check != NULL", "../z_bgcheck.c", 5981);
}
/**
@ -2417,11 +2418,10 @@ void SSNodeList_Alloc(GlobalContext* globalCtx, SSNodeList* this, s32 tblMax, s3
*/
SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
SSNode* result = &this->tbl[this->count];
this->count++;
(this->count < this->max)
? (void)0
: __assert("this->short_slist_node_last_index < this->short_slist_node_size", "../z_bgcheck.c", 5998);
this->count++;
ASSERT(this->count < this->max, "this->short_slist_node_last_index < this->short_slist_node_size", "../z_bgcheck.c",
5998);
if (!(this->count < this->max)) {
return NULL;
}
@ -2434,7 +2434,7 @@ SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
u16 SSNodeList_GetNextNodeIdx(SSNodeList* this) {
u16 new_index = this->count++;
(new_index < this->max) ? (void)0 : __assert("new_index < this->short_slist_node_size", "../z_bgcheck.c", 6021);
ASSERT(new_index < this->max, "new_index < this->short_slist_node_size", "../z_bgcheck.c", 6021);
return new_index;
}
@ -2540,7 +2540,7 @@ void DynaPoly_NullPolyList(CollisionPoly** polyList) {
*/
void DynaPoly_AllocPolyList(GlobalContext* globalCtx, CollisionPoly** polyList, s32 numPolys) {
*polyList = THA_AllocEndAlign(&globalCtx->state.tha, numPolys * sizeof(CollisionPoly), -2);
(*polyList != NULL) ? (void)0 : __assert("ptbl->pbuf != NULL", "../z_bgcheck.c", 6247);
ASSERT(*polyList != NULL, "ptbl->pbuf != NULL", "../z_bgcheck.c", 6247);
}
/**
@ -2555,7 +2555,7 @@ void DynaPoly_NullVtxList(Vec3s** vtxList) {
*/
void DynaPoly_AllocVtxList(GlobalContext* globalCtx, Vec3s** vtxList, s32 numVtx) {
*vtxList = THA_AllocEndAlign(&globalCtx->state.tha, numVtx * sizeof(Vec3s), -2);
(*vtxList != NULL) ? (void)0 : __assert("ptbl->pbuf != NULL", "../z_bgcheck.c", 6277);
ASSERT(*vtxList != NULL, "ptbl->pbuf != NULL", "../z_bgcheck.c", 6277);
}
/**
@ -2772,13 +2772,10 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3
*vtxStartIndex + pbgdata->nbVertices, dyna->vtxListMax);
}
(dyna->polyListMax >= *polyStartIndex + pbgdata->nbPolygons)
? (void)0
: __assert("pdyna_poly_info->poly_num >= *pstart_poly_index + pbgdata->poly_num", "../z_bgcheck.c", 6687);
(dyna->vtxListMax >= *vtxStartIndex + pbgdata->nbVertices)
? (void)0
: __assert("pdyna_poly_info->vert_num >= *pstart_vert_index + pbgdata->vtx_num", "../z_bgcheck.c", 6688);
ASSERT(dyna->polyListMax >= *polyStartIndex + pbgdata->nbPolygons,
"pdyna_poly_info->poly_num >= *pstart_poly_index + pbgdata->poly_num", "../z_bgcheck.c", 6687);
ASSERT(dyna->vtxListMax >= *vtxStartIndex + pbgdata->nbVertices,
"pdyna_poly_info->vert_num >= *pstart_vert_index + pbgdata->vtx_num", "../z_bgcheck.c", 6688);
if (!(dyna->bitFlag & DYNAPOLY_INVALIDATE_LOOKUP) &&
(BgActor_IsTransformUnchanged(&dyna->bgActors[bgId]) == true)) {
@ -3209,7 +3206,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo
poly = &dyna->polyList[polyId];
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
normalXZ = sqrtf(SQ(nx) + SQ(nz));
(!IS_ZERO(normalXZ)) ? (void)0 : __assert("!IS_ZERO(ac_size)", "../z_bgcheck.c", 7382);
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", "../z_bgcheck.c", 7382);
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {
@ -3282,7 +3279,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo
poly = &dyna->polyList[polyId];
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
normalXZ = sqrtf(SQ(nx) + SQ(nz));
(!IS_ZERO(normalXZ)) ? (void)0 : __assert("!IS_ZERO(ac_size)", "../z_bgcheck.c", 7489);
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", "../z_bgcheck.c", 7489);
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {

View file

@ -70,9 +70,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC,
gDPPipeSync(POLY_OPA_DISP++);
vtxTbl = Graph_Alloc(gfxCtx, 3 * sizeof(Vtx));
if (vtxTbl == NULL) {
__assert("vtx_tbl != NULL", "../z_collision_check.c", 726);
}
ASSERT(vtxTbl != NULL, "vtx_tbl != NULL", "../z_collision_check.c", 726);
vtxTbl[0].n.ob[0] = vA->x;
vtxTbl[0].n.ob[1] = vA->y;
@ -457,10 +455,8 @@ s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* ac
Collider_SetBase(globalCtx, &dest->base, actor, &src->base);
dest->count = src->count;
dest->elements = elements;
ASSERT(dest->elements != NULL, "pclobj_jntsph->elem_tbl != NULL", "../z_collision_check.c", 1603);
if (dest->elements == NULL) {
__assert("pclobj_jntsph->elem_tbl != NULL", "../z_collision_check.c", 1603);
}
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) {
Collider_InitJntSphElement(globalCtx, destElem);
@ -798,10 +794,7 @@ s32 Collider_SetTris(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor,
Collider_SetBase(globalCtx, &dest->base, actor, &src->base);
dest->count = src->count;
dest->elements = elements;
if (dest->elements == NULL) {
__assert("pclobj_tris->elem_tbl != NULL", "../z_collision_check.c", 2258);
}
ASSERT(dest->elements != NULL, "pclobj_tris->elem_tbl != NULL", "../z_collision_check.c", 2258);
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) {
@ -1192,9 +1185,7 @@ s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChk
if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1;
}
if (!(collider->shape <= COLSHAPE_QUAD)) {
__assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 2997);
}
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 2997);
sATResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@ -1219,10 +1210,7 @@ s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChk
*/
s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) {
if (!(collider->shape <= COLSHAPE_QUAD)) {
__assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3037);
}
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3037);
if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1;
}
@ -1266,9 +1254,7 @@ s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChk
if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1;
}
if (!(collider->shape <= COLSHAPE_QUAD)) {
__assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3114);
}
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3114);
sACResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@ -1293,9 +1279,7 @@ s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChk
*/
s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) {
if (!(collider->shape <= COLSHAPE_QUAD)) {
__assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3153);
}
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3153);
if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1;
}
@ -1339,9 +1323,9 @@ s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colChk
if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1;
}
if (!(collider->shape <= COLSHAPE_QUAD)) {
__assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3229);
}
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3229);
sOCResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@ -1369,9 +1353,7 @@ s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* co
if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1;
}
if (!(collider->shape <= COLSHAPE_QUAD)) {
__assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3274);
}
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3274);
sOCResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@ -3009,9 +2991,8 @@ void CollisionCheck_ApplyDamage(GlobalContext* globalCtx, CollisionCheckContext*
if (!(info->bumperFlags & BUMP_HIT) || info->bumperFlags & BUMP_NO_DAMAGE) {
return;
}
if (info->acHitInfo == NULL) {
__assert("pclobj_elem->ac_hit_elem != NULL", "../z_collision_check.c", 6493);
}
ASSERT(info->acHitInfo != NULL, "pclobj_elem->ac_hit_elem != NULL", "../z_collision_check.c", 6493);
tbl = collider->actor->colChkInfo.damageTable;
if (tbl == NULL) {
damage = (f32)info->acHitInfo->toucher.damage - info->bumper.defense;

View file

@ -36,10 +36,7 @@ void func_801109B0(GlobalContext* globalCtx) {
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
if (interfaceCtx->parameterSegment == NULL) {
__assert("parameter->parameterSegment != NULL", "../z_construct.c", 161);
}
ASSERT(interfaceCtx->parameterSegment != NULL, "parameter->parameterSegment != NULL", "../z_construct.c", 161);
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (u32)_parameter_staticSegmentRomStart, parameterSize,
"../z_construct.c", 162);
@ -49,9 +46,7 @@ void func_801109B0(GlobalContext* globalCtx) {
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480);
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->do_actionSegment);
if (interfaceCtx->do_actionSegment == NULL) {
__assert("parameter->do_actionSegment != NULL", "../z_construct.c", 169);
}
ASSERT(interfaceCtx->do_actionSegment != NULL, "parameter->do_actionSegment != NULL", "../z_construct.c", 169);
if (gSaveContext.language == 0) {
do_actionOffset = 0;
@ -81,9 +76,7 @@ void func_801109B0(GlobalContext* globalCtx) {
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->icon_itemSegment);
if (interfaceCtx->icon_itemSegment == NULL) {
__assert("parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
}
ASSERT(interfaceCtx->icon_itemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0],
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
@ -194,10 +187,7 @@ void func_80110F68(GlobalContext* globalCtx) {
// Translates to: "Textbox game_alloc=%x"
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200);
if (msgCtx->textboxSegment == NULL) {
__assert("message->fukidashiSegment != NULL", "../z_construct.c", 352);
}
ASSERT(msgCtx->textboxSegment != NULL, "message->fukidashiSegment != NULL", "../z_construct.c", 352);
Font_LoadOrderedFont(&globalCtx->msgCtx.font);

View file

@ -542,7 +542,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp118;
Vec3f sp10C;
(index - 1 >= 0) ? (void)0 : __assert("index - 1 >= 0", "../z_eff_blure.c", 1005);
ASSERT(index - 1 >= 0, "index - 1 >= 0", "../z_eff_blure.c", 1005);
ratio = (f32)(elem - 1)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index - 1, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);
@ -562,8 +562,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp100;
Vec3f spF4;
(index + 2 < this->numElements) ? (void)0
: __assert("index + 2 < this2->now_edge_num", "../z_eff_blure.c", 1032);
ASSERT(index + 2 < this->numElements, "index + 2 < this2->now_edge_num", "../z_eff_blure.c", 1032);
ratio = (f32)(elem + 2)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index + 2, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);

View file

@ -16,9 +16,7 @@ void EffectSs_InitInfo(GlobalContext* globalCtx, s32 tableSize) {
sEffectSsInfo.table =
GameState_Alloc(&globalCtx->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289);
if (sEffectSsInfo.table == NULL) {
__assert("EffectSS2Info.data_table != NULL", "../z_effect_soft_sprite.c", 290);
}
ASSERT(sEffectSsInfo.table != NULL, "EffectSS2Info.data_table != NULL", "../z_effect_soft_sprite.c", 290);
sEffectSsInfo.searchStartIndex = 0;
sEffectSsInfo.tableSize = tableSize;
@ -175,9 +173,7 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
overlayEntry = &gEffectSsOverlayTable[type];
if (type >= EFFECT_SS_TYPE_MAX) {
__assert("type < EFFECT_SS2_TYPE_LAST_LABEL", "../z_effect_soft_sprite.c", 556);
}
ASSERT(type < EFFECT_SS_TYPE_MAX, "type < EFFECT_SS2_TYPE_LAST_LABEL", "../z_effect_soft_sprite.c", 556);
if (EffectSs_FindSlot(priority, &index) != 0) {
// Abort because we couldn't find a suitable slot to add this effect in

View file

@ -47,7 +47,7 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) {
// "Unplanned conditions"
LOG_STRING("企画外 条件", "../z_elf_message.c", 156);
__assert("0", "../z_elf_message.c", 157);
ASSERT(0, "0", "../z_elf_message.c", 157);
return false;
}
@ -131,7 +131,7 @@ u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) {
default:
// "Unplanned conditions"
LOG_STRING("企画外 条件", "../z_elf_message.c", 281);
__assert("0", "../z_elf_message.c", 282);
ASSERT(0, "0", "../z_elf_message.c", 282);
}
msg++;
}

View file

@ -21,9 +21,7 @@ s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurv
skelCurve->transforms = ZeldaArena_MallocDebug(sizeof(*skelCurve->transforms) * skelCurve->limbCount,
"../z_fcurve_data_skelanime.c", 125);
if (skelCurve->transforms == NULL) {
__assert("this->now_joint != NULL", "../z_fcurve_data_skelanime.c", 127);
}
ASSERT(skelCurve->transforms != NULL, "this->now_joint != NULL", "../z_fcurve_data_skelanime.c", 127);
do {
skelCurve->animCurFrame = 0.0f;
} while (0);

View file

@ -51,9 +51,8 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.world.pos.x,
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x,
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
}
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 343);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
@ -71,9 +70,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
} else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) {
Actor* horseActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
if (horseActor == NULL) {
__assert("horse_actor != NULL", "../z_horse.c", 389);
}
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 389);
} else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) &&
(Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
@ -84,10 +81,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
Actor* horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
gSaveContext.horseData.pos.x, gSaveContext.horseData.pos.y,
gSaveContext.horseData.pos.z, 0, gSaveContext.horseData.angle, 0, 1);
if (horseActor == NULL) {
__assert("horse_actor != NULL", "../z_horse.c", 414);
}
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 414);
if (globalCtx->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
}
@ -101,9 +95,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
Actor* horseActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
if (horseActor == NULL) {
__assert("horse_actor != NULL", "../z_horse.c", 443);
}
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 443);
} else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
HorseSpawn* horseSpawn = &horseSpawns[i];
@ -111,10 +103,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
Actor* horseActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type);
if (horseActor == NULL) {
__assert("horse_actor != NULL", "../z_horse.c", 466);
}
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 466);
if (globalCtx->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
}
@ -164,9 +153,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
spawnPos.z, 0, player->actor.world.rot.y, 0, 7);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
}
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 561);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
@ -175,9 +162,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
player->rideActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 582);
}
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 582);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
@ -207,9 +192,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
player->actor.world.rot.y, 0, D_8011F9B8[i].type);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
}
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 628);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
@ -224,9 +207,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 667);
}
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 667);
player->actor.world.pos.x = D_8011F9B8[i].pos.x;
player->actor.world.pos.y = D_8011F9B8[i].pos.y;

View file

@ -218,10 +218,9 @@ s32 Jpeg_Decode(void* data, u16* zbuffer, JpegWork* workBuff, u32 workSize) {
OSTime time2;
time = osGetTime();
if (workSize <
sizeof(JpegWork)) { // (?) I guess MB_SIZE=0x180, PROC_OF_MBS=5 which means unk_6C0 is not a part of JpegWork
__assert("worksize >= sizeof(JPEGWork) + MB_SIZE * (PROC_OF_MBS - 1)", "../z_jpeg.c", 527);
}
// (?) I guess MB_SIZE=0x180, PROC_OF_MBS=5 which means unk_6C0 is not a part of JpegWork
ASSERT(workSize >= sizeof(JpegWork), "worksize >= sizeof(JPEGWork) + MB_SIZE * (PROC_OF_MBS - 1)", "../z_jpeg.c",
527);
osCreateMesgQueue(&ctx.mq, &ctx.msg, 1);
MsgEvent_SendNullTask();

View file

@ -235,9 +235,7 @@ void Map_Init(GlobalContext* globalCtx) {
// Translates to " TEXTURE INITIALIZATION scene_data_ID=%d mapSegment=%x"
osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", globalCtx->sceneNum,
interfaceCtx->mapSegment, globalCtx);
if (interfaceCtx->mapSegment == NULL) {
__assert("parameter->mapSegment != NULL", "../z_map_exp.c", 459);
}
ASSERT(interfaceCtx->mapSegment != NULL, "parameter->mapSegment != NULL", "../z_map_exp.c", 459);
switch (globalCtx->sceneNum) {
case SCENE_SPOT00:

View file

@ -18,9 +18,7 @@ void func_800BC450(GlobalContext* globalCtx) {
}
void func_800BC490(GlobalContext* globalCtx, s16 point) {
if (!(point == 1 || point == 2)) {
__assert("point == 1 || point == 2", "../z_play.c", 2160);
}
ASSERT(point == 1 || point == 2, "point == 1 || point == 2", "../z_play.c", 2160);
globalCtx->unk_1242B = point;
@ -1469,9 +1467,8 @@ void Gameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s32 spawn) {
globalCtx->sceneSegment = Gameplay_LoadFile(globalCtx, &scene->sceneFile);
scene->unk_13 = 0;
if (globalCtx->sceneSegment == NULL) {
__assert("this->sceneSegment != NULL", "../z_play.c", 4960);
}
ASSERT(globalCtx->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960);
gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment);
Gameplay_InitScene(globalCtx, spawn);

View file

@ -777,10 +777,7 @@ Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
if (f == n) {
f++;
}
if (n == f) {
__assert("n != f", "../z_rcp.c", 1155);
}
ASSERT(n != f, "n != f", "../z_rcp.c", 1155);
gDPSetFogColor(gfx++, r, g, b, a);
@ -801,10 +798,7 @@ Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
if (f == n) {
f++;
}
if (n == f) {
__assert("n != f", "../z_rcp.c", 1187);
}
ASSERT(n != f, "n != f", "../z_rcp.c", 1187);
gDPPipeSync(gfx++);
gDPSetFogColor(gfx++, r, g, b, a);

View file

@ -121,9 +121,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start);
spA4 = spB8;
if (polygon2->num > SHAPE_SORT_MAX) {
__assert("polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
}
ASSERT(polygon2->num <= SHAPE_SORT_MAX, "polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
sp78 = polygonDlist;
for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) {
@ -565,9 +563,7 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
roomCtx->curRoom.segment = NULL;
roomCtx->status = 1;
if (roomNum >= globalCtx->nbRooms) {
__assert("read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
}
ASSERT(roomNum < globalCtx->nbRooms, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart;
roomCtx->unk_34 = (void*)ALIGN16((s32)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
@ -608,9 +604,8 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
if (room->segment != NULL) {
gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers)) {
__assert("this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
}
ASSERT(room->mesh->polygon.type < ARRAY_COUNTU(sRoomDrawHandlers),
"this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags);
}
}

View file

@ -14,11 +14,10 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) {
osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (s32)objectCtx->status[objectCtx->num].segment + size,
objectCtx->spaceEnd);
if (!((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) &&
(((s32)objectCtx->status[objectCtx->num].segment + size) < (u32)objectCtx->spaceEnd))) {
__assert("this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment",
ASSERT(((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) &&
(((s32)objectCtx->status[objectCtx->num].segment + size) < (u32)objectCtx->spaceEnd)),
"this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment",
"../z_scene.c", 142);
}
DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size,
"../z_scene.c", 145);
@ -151,9 +150,7 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) {
nextPtr = (void*)ALIGN16((s32)status->segment + size);
if (1) {} // Necessary to match
if (nextPtr >= objectCtx->spaceEnd) {
__assert("nextptr < this->endSegment", "../z_scene.c", 381);
}
ASSERT(nextPtr < objectCtx->spaceEnd, "nextptr < this->endSegment", "../z_scene.c", 381);
// Translates to: "OBJECT EXCHANGE FREE SIZE=%08x"
osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (s32)objectCtx->spaceEnd - (s32)nextPtr);
@ -294,9 +291,8 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) {
status++;
}
if (cmd->objectList.num > OBJECT_EXCHANGE_BANK_MAX) {
__assert("scene_info->object_bank.num <= OBJECT_EXCHANGE_BANK_MAX", "../z_scene.c", 705);
}
ASSERT(cmd->objectList.num <= OBJECT_EXCHANGE_BANK_MAX, "scene_info->object_bank.num <= OBJECT_EXCHANGE_BANK_MAX",
"../z_scene.c", 705);
if (1) {}

View file

@ -1109,9 +1109,7 @@ void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkel
skelAnime->jointTable = ZeldaArena_MallocDebug(allocSize, "../z_skelanime.c", 2364);
skelAnime->morphTable = ZeldaArena_MallocDebug(allocSize, "../z_skelanime.c", 2365);
} else {
if (limbBufCount != limbCount) {
__assert("joint_buff_num == joint_num", "../z_skelanime.c", 2369);
}
ASSERT(limbBufCount == limbCount, "joint_buff_num == joint_num", "../z_skelanime.c", 2369);
skelAnime->jointTable = (Vec3s*)ALIGN16((u32)jointTable);
skelAnime->morphTable = (Vec3s*)ALIGN16((u32)morphTable);
@ -1432,9 +1430,7 @@ s32 SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeade
skelAnime->morphTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 2969);
} else {
if (limbCount != skelAnime->limbCount) {
__assert("joint_buff_num == this->joint_num", "../z_skelanime.c", 2973);
}
ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 2973);
skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable;
}
@ -1468,9 +1464,7 @@ s32 SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkele
skelAnime->morphTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3048);
} else {
if (limbCount != skelAnime->limbCount) {
__assert("joint_buff_num == this->joint_num", "../z_skelanime.c", 3052);
}
ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 3052);
skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable;
}

View file

@ -40,9 +40,8 @@ void func_800A663C(GlobalContext* globalCtx, PSkinAwb* skin, SkeletonHeader* ske
skeleton = SEGMENTED_TO_VIRTUAL(skin->skeletonHeader->segment);
limbCount = skin->skeletonHeader->limbCount;
skin->avbTbl = ZeldaArena_MallocDebug(limbCount * sizeof(SkinAvb), "../z_skin_awb.c", 212);
if (skin->avbTbl == NULL) {
__assert("pskin_awb->avb_tbl != NULL", "../z_skin_awb.c", 214);
}
ASSERT(skin->avbTbl != NULL, "pskin_awb->avb_tbl != NULL", "../z_skin_awb.c", 214);
for (i = 0; i < limbCount; i++) {
SkinAvb* avbEntry = &skin->avbTbl[i];
SkinLimb* limb = SEGMENTED_TO_VIRTUAL(skeleton[i]);
@ -57,13 +56,9 @@ void func_800A663C(GlobalContext* globalCtx, PSkinAwb* skin, SkeletonHeader* ske
avbEntry->unk_0 = 0;
avbEntry->buf[0] = ZeldaArena_MallocDebug(temp_s1->unk_0 * sizeof(Vtx), "../z_skin_awb.c", 235);
if (avbEntry->buf[0] == 0) {
__assert("psavb->buf[0] != NULL", "../z_skin_awb.c", 237);
}
ASSERT(avbEntry->buf[0] != NULL, "psavb->buf[0] != NULL", "../z_skin_awb.c", 237);
avbEntry->buf[1] = ZeldaArena_MallocDebug(temp_s1->unk_0 * sizeof(Vtx), "../z_skin_awb.c", 240);
if (avbEntry->buf[1] == 0) {
__assert("psavb->buf[1] != NULL", "../z_skin_awb.c", 242);
}
ASSERT(avbEntry->buf[1] != NULL, "psavb->buf[1] != NULL", "../z_skin_awb.c", 242);
func_800A6460(globalCtx, skin, i);
}
if (1) {}

View file

@ -890,10 +890,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
void Sram_Alloc(GameState* gameState, SramContext* sramCtx) {
sramCtx->readBuff = GameState_Alloc(gameState, SRAM_SIZE, "../z_sram.c", 1294);
if (!(sramCtx->readBuff != NULL)) {
__assert("sram->read_buff != NULL", "../z_sram.c", 1295);
}
ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295);
}
void Sram_Init(GlobalContext* globalCtx, SramContext* sramCtx) {

View file

@ -157,18 +157,10 @@ void func_800AA550(View* view) {
lrx = view->viewport.rightX - varX;
lry = view->viewport.bottomY - varY;
if (ulx < 0) {
__assert("ulx >= 0", "../z_view.c", 454);
}
if (uly < 0) {
__assert("uly >= 0", "../z_view.c", 455);
}
if (lrx > SCREEN_WIDTH) {
__assert("lrx <= SCREEN_WD", "../z_view.c", 456);
}
if (lry > SCREEN_HEIGHT) {
__assert("lry <= SCREEN_HT", "../z_view.c", 457);
}
ASSERT(ulx >= 0, "ulx >= 0", "../z_view.c", 454);
ASSERT(uly >= 0, "uly >= 0", "../z_view.c", 455);
ASSERT(lrx <= SCREEN_WIDTH, "lrx <= SCREEN_WD", "../z_view.c", 456);
ASSERT(lry <= SCREEN_HEIGHT, "lry <= SCREEN_HT", "../z_view.c", 457);
OPEN_DISPS(gfxCtx, "../z_view.c", 459);

View file

@ -95,10 +95,7 @@ void VisMono_Draw(VisMono* this, Gfx** gfxp) {
LOG_ADDRESS("mono_dl + (1+3+1+1+80*(7+2+2+3)+1)", monoDL + DLSIZE, "../z_vismono.c", 259);
LOG_ADDRESS("(1+3+1+1+80*(7+2+2+3)+1)", DLSIZE, "../z_vismono.c", 260);
}
if (!(glistpEnd <= monoDL + DLSIZE)) {
__assert("glistp_end <= mono_dl + DLSIZE", "../z_vismono.c", 262);
}
ASSERT(glistpEnd <= monoDL + DLSIZE, "glistp_end <= mono_dl + DLSIZE", "../z_vismono.c", 262);
}
gDPPipeSync(gfx++);
@ -128,8 +125,6 @@ void VisMono_DrawOld(VisMono* this) {
if (!this->monoDl) {
this->monoDl = SystemArena_MallocDebug(DLSIZE * sizeof(Gfx), "../z_vismono.c", 289);
glistpEnd = VisMono_DrawTexture(this, this->monoDl);
if (!(glistpEnd <= this->monoDl + DLSIZE)) {
__assert("glistp_end <= this->mono_dl + DLSIZE", "../z_vismono.c", 292);
}
ASSERT(glistpEnd <= this->monoDl + DLSIZE, "glistp_end <= this->mono_dl + DLSIZE", "../z_vismono.c", 292);
}
}

View file

@ -65,7 +65,7 @@ void BgGndIceblock_Init(Actor* thisx, GlobalContext* globalCtx) {
sBlockPositions[1] = 14;
} else {
LOG_FLOAT("thisx->world.position.x", this->dyna.actor.world.pos.x, "../z_bg_gnd_iceblock.c", 138);
__assert("0", "../z_bg_gnd_iceblock.c", 139);
ASSERT(0, "0", "../z_bg_gnd_iceblock.c", 139);
}
}

View file

@ -89,7 +89,7 @@ void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("bank_ID = %d\n", objBankIndex);
if (objBankIndex < 0) {
__assert("0", "../z_demo_6k.c", 334);
ASSERT(0, "0", "../z_demo_6k.c", 334);
} else {
this->objBankIndex = objBankIndex;
}
@ -176,7 +176,7 @@ void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_293 = params - 14;
break;
default:
__assert("0", "../z_demo_6k.c", 435);
ASSERT(0, "0", "../z_demo_6k.c", 435);
break;
}

View file

@ -196,7 +196,7 @@ void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf(VT_FGCOL(CYAN) " bank_ID = %d\n" VT_RST, objectIndex);
if (objectIndex < 0) {
__assert("0", "../z_demo_effect.c", 723);
ASSERT(0, "0", "../z_demo_effect.c", 723);
} else {
this->initObjectBankIndex = objectIndex;
}
@ -506,7 +506,7 @@ void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
default:
__assert("0", "../z_demo_effect.c", 1062);
ASSERT(0, "0", "../z_demo_effect.c", 1062);
break;
}
@ -683,7 +683,7 @@ void DemoEffect_InitTimeWarp(DemoEffect* this, GlobalContext* globalCtx) {
s32 effectType = (this->actor.params & 0x00FF);
if (!SkelCurve_Init(globalCtx, &this->skelCurve, &gTimeWarpSkel, &gTimeWarpAnim)) {
__assert("0", "../z_demo_effect.c", 1283);
ASSERT(0, "0", "../z_demo_effect.c", 1283);
}
if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) {

View file

@ -193,7 +193,7 @@ void DemoKankyo_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("bank_ID = %d\n", objBankIndex);
if (objBankIndex < 0) {
__assert("0", "../z_demo_kankyo.c", 521);
ASSERT(0, "0", "../z_demo_kankyo.c", 521);
} else {
this->objBankIndex = objBankIndex;
}

View file

@ -55,10 +55,7 @@ void DemoTreLgt_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("Demo_Tre_Lgt_Actor_ct();コンストラクト失敗\n");
}
// This assert is optimized out but it exists due to its presence in rodata
if (0) {
__assert("1", "../z_demo_tre_lgt.c", UNK_LINE);
}
ASSERT(true, "1", "../z_demo_tre_lgt.c", UNK_LINE);
this->unk_170 = 255;
this->unk_174 = 255;

View file

@ -578,9 +578,7 @@ Gfx* EnBox_EmptyDList(GraphicsContext* gfxCtx) {
Gfx* dList;
dList = Graph_Alloc(gfxCtx, sizeof(Gfx));
if (dList == NULL) {
__assert("gfxp != NULL", "../z_en_box.c", 1528);
}
ASSERT(dList != NULL, "gfxp != NULL", "../z_en_box.c", 1528);
dListHead = dList;
gSPEndDisplayList(dListHead++);
@ -594,9 +592,7 @@ Gfx* func_809CA4A0(GraphicsContext* gfxCtx) {
Gfx* dListHead;
dListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx));
if (dListHead == NULL) {
__assert("gfxp != NULL", "../z_en_box.c", 1546);
}
ASSERT(dListHead != NULL, "gfxp != NULL", "../z_en_box.c", 1546);
dList = dListHead;
gDPSetRenderMode(dListHead++,
@ -614,9 +610,7 @@ Gfx* func_809CA518(GraphicsContext* gfxCtx) {
Gfx* dListHead;
dListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx));
if (dListHead == NULL) {
__assert("gfxp != NULL", "../z_en_box.c", 1564);
}
ASSERT(dListHead != NULL, "gfxp != NULL", "../z_en_box.c", 1564);
dList = dListHead;
gDPSetRenderMode(dListHead++,

View file

@ -405,7 +405,7 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) {
}
break;
default:
__assert("0", "../z_en_elf.c", 1103);
ASSERT(0, "0", "../z_en_elf.c", 1103);
break;
}
@ -798,7 +798,7 @@ void func_80A03AB0(EnElf* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (this->func_2C8 == NULL) {
__assert("0", "../z_en_elf.c", 1725);
ASSERT(0, "0", "../z_en_elf.c", 1725);
}
this->func_2C8(this, globalCtx);

View file

@ -244,7 +244,7 @@ void EnFr_Init(Actor* thisx, GlobalContext* globalCtx) {
// Translation: The argument is wrong!!
osSyncPrintf("%s[%d] : 引数が間違っている!!(%d)\n", "../z_en_fr.c", 370, this->actor.params);
osSyncPrintf(VT_RST);
__assert("0", "../z_en_fr.c", 372);
ASSERT(0, "0", "../z_en_fr.c", 372);
}
this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP);
@ -254,7 +254,7 @@ void EnFr_Init(Actor* thisx, GlobalContext* globalCtx) {
// Translation: There is no bank!!
osSyncPrintf("%s[%d] : バンクが無いよ!!\n", "../z_en_fr.c", 380);
osSyncPrintf(VT_RST);
__assert("0", "../z_en_fr.c", 382);
ASSERT(0, "0", "../z_en_fr.c", 382);
}
}
}

View file

@ -157,7 +157,7 @@ void EnGe2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 6;
break;
default:
__assert("0", "../z_en_ge2.c", 418);
ASSERT(0, "0", "../z_en_ge2.c", 418);
}
this->stateFlags = 0;

View file

@ -291,7 +291,7 @@ void func_80A3A8D0(EnGirlA* this, GlobalContext* globalCtx) {
osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf("引数がおかしいよ(arg_data=%d)\n", this->actor.params);
osSyncPrintf(VT_RST);
__assert("0", "../z_en_girlA.c", 1421);
ASSERT(0, "0", "../z_en_girlA.c", 1421);
return;
}
@ -302,7 +302,7 @@ void func_80A3A8D0(EnGirlA* this, GlobalContext* globalCtx) {
osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf("バンクが無いよ!!(%s)\n", D_80A3C590[params]);
osSyncPrintf(VT_RST);
__assert("0", "../z_en_girlA.c", 1434);
ASSERT(0, "0", "../z_en_girlA.c", 1434);
return;
}

View file

@ -81,7 +81,7 @@ void EnGm_Init(Actor* thisx, GlobalContext* globalCtx) {
// "There is no model bank! !! (Medi Goron)"
osSyncPrintf("モデル バンクが無いよ!!(中ゴロン)\n");
osSyncPrintf(VT_RST);
__assert("0", "../z_en_gm.c", 145);
ASSERT(0, "0", "../z_en_gm.c", 145);
}
this->updateFunc = func_80A3D838;

View file

@ -71,7 +71,7 @@ void EnGuest_Init(Actor* thisx, GlobalContext* globalCtx) {
// No such bank!!
osSyncPrintf("%s[%d] : バンクが無いよ!!\n", "../z_en_guest.c", 129);
osSyncPrintf(VT_RST);
__assert("0", "../z_en_guest.c", 132);
ASSERT(0, "0", "../z_en_guest.c", 132);
}
}
}

View file

@ -954,7 +954,7 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) {
this->actor.draw = NULL;
break;
default:
__assert("0", "../z_en_owl.c", 1693);
ASSERT(0, "0", "../z_en_owl.c", 1693);
break;
}

View file

@ -790,7 +790,7 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if (this->hasPlayer == 0x3F80) { // checks if 1.0f has been stored to hasPlayer's address
__assert("0", "../z_en_rr.c", 1355);
ASSERT(0, "0", "../z_en_rr.c", 1355);
}
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f);

View file

@ -123,7 +123,7 @@ void EnSth_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("bank_ID = %d\n", objectBankIdx);
if (objectBankIdx < 0) {
__assert("0", "../z_en_sth.c", 1564);
ASSERT(0, "0", "../z_en_sth.c", 1564);
}
this->objectBankIdx = objectBankIdx;
this->drawFunc = EnSth_Draw;

View file

@ -122,7 +122,7 @@ void EnTr_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
default:
__assert("0", "../z_en_tr.c", 277);
ASSERT(0, "0", "../z_en_tr.c", 277);
break;
}
}

View file

@ -200,14 +200,10 @@ void func_80B2A570(EnViewer* this, GlobalContext* globalCtx) {
struct_80B2CEE8* unkStruct = &D_80B2CEE8[this->actor.params >> 8];
s32 objIndex = Object_GetIndex(&globalCtx->objectCtx, unkStruct->objId1);
if (objIndex < 0) {
__assert("bank_ID >= 0", "../z_en_viewer.c", 576);
}
ASSERT(objIndex >= 0, "bank_ID >= 0", "../z_en_viewer.c", 576);
this->animObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, unkStruct->objId2);
if (this->animObjBankIndex < 0) {
__assert("this->anime_bank_ID >= 0", "../z_en_viewer.c", 579);
}
ASSERT(this->animObjBankIndex >= 0, "this->anime_bank_ID >= 0", "../z_en_viewer.c", 579);
if (!Object_IsLoaded(&globalCtx->objectCtx, objIndex) ||
!Object_IsLoaded(&globalCtx->objectCtx, this->animObjBankIndex)) {

View file

@ -69,7 +69,7 @@ void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx) {
objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIds[type]);
osSyncPrintf("bank_ID = %d\n", objBankIndex);
if (objBankIndex < 0) {
__assert("0", "../z_item_etcetera.c", 241);
ASSERT(0, "0", "../z_item_etcetera.c", 241);
} else {
this->objBankIndex = objBankIndex;
}

View file

@ -4639,10 +4639,7 @@ void func_8083AE40(Player* this, s16 objectId) {
size = gObjectTable[objectId].vromEnd - gObjectTable[objectId].vromStart;
LOG_HEX("size", size, "../z_player.c", 9090);
if (size > 1024 * 8) {
__assert("size <= 1024 * 8", "../z_player.c", 9091);
}
ASSERT(size <= 1024 * 8, "size <= 1024 * 8", "../z_player.c", 9091);
if (gObjectTable[objectId].vromEnd) {}

View file

@ -165,9 +165,7 @@ void Title_Init(GameState* thisx) {
this->staticSegment = GameState_Alloc(&this->state, size, "../z_title.c", 611);
osSyncPrintf("z_title.c\n");
if (this->staticSegment == NULL) {
__assert("this->staticSegment != NULL", "../z_title.c", 614);
}
ASSERT(this->staticSegment != NULL, "this->staticSegment != NULL", "../z_title.c", 614);
DmaMgr_SendRequest1(this->staticSegment, (u32)_nintendo_rogo_staticSegmentRomStart, size, "../z_title.c", 615);
R_UPDATE_RATE = 1;
Matrix_Init(&this->state);