ASSERT macro __FILE__ __LINE__

This commit is contained in:
Baoulettes 2022-06-27 21:52:00 +02:00
parent 1cdaf454c2
commit 73d9bafe74
50 changed files with 133 additions and 150 deletions

View File

@ -190,13 +190,7 @@ 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 } } #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(expression) (void)((!!(expression)) || (__assert(#expression, __FILE__, (unsigned)(__LINE__)), 0))
#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
#define gDPSetTileCustom(pkt, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ #define gDPSetTileCustom(pkt, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
do { \ do { \

View File

@ -43,7 +43,7 @@ extern "C" void OTRGameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s
scene->unk_13 = 0; scene->unk_13 = 0;
//ASSERT(globalCtx->sceneSegment != NULL, "this->sceneSegment != NULL", __FILE__, __LINE__); //ASSERT(globalCtx->sceneSegment != NULL);
//gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment); //gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment);
OTRGameplay_InitScene(globalCtx, spawn); OTRGameplay_InitScene(globalCtx, spawn);

View File

@ -908,7 +908,7 @@ extern "C" s32 OTRfunc_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx,
roomCtx->curRoom.segment = NULL; roomCtx->curRoom.segment = NULL;
roomCtx->status = 1; roomCtx->status = 1;
ASSERT(roomNum < globalCtx->numRooms, "read_room_ID < game_play->room_rom_address.num", __FILE__, __LINE__); ASSERT(roomNum < globalCtx->numRooms);
if (roomNum >= globalCtx->numRooms) if (roomNum >= globalCtx->numRooms)
return 0; // UH OH return 0; // UH OH

View File

@ -125,9 +125,9 @@ end:
s32 DmaMgr_DmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) { s32 DmaMgr_DmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) {
s32 ret; s32 ret;
ASSERT(pihandle == gCartHandle, "pihandle == carthandle", __FILE__, __LINE__); ASSERT(pihandle == gCartHandle);
ASSERT(direction == OS_READ, "direction == OS_READ", __FILE__, __LINE__); ASSERT(direction == OS_READ);
ASSERT(mb != NULL, "mb != NULL", __FILE__, __LINE__); ASSERT(mb != NULL);
if (D_80009460 == 10) { if (D_80009460 == 10) {
osSyncPrintf("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr, osSyncPrintf("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr,

View File

@ -102,9 +102,7 @@ void Sched_HandleStart(SchedContext* sc) {
void Sched_QueueTask(SchedContext* sc, OSScTask* task) { void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
s32 type = task->list.t.type; s32 type = task->list.t.type;
ASSERT((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));
"(type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK)", __FILE__,
__LINE__);
if (type == M_AUDTASK) { if (type == M_AUDTASK) {
if (sLogScheduler) { if (sLogScheduler) {
@ -136,7 +134,7 @@ void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
void Sched_Yield(SchedContext* sc) { void Sched_Yield(SchedContext* sc) {
if (!(sc->curRSPTask->state & OS_SC_YIELD)) { if (!(sc->curRSPTask->state & OS_SC_YIELD)) {
ASSERT(sc->curRSPTask->list.t.type != M_AUDTASK, "sc->curRSPTask->list.t.type != M_AUDTASK", __FILE__, __LINE__); ASSERT(sc->curRSPTask->list.t.type != M_AUDTASK);
sc->curRSPTask->state |= OS_SC_YIELD; sc->curRSPTask->state |= OS_SC_YIELD;
@ -155,14 +153,14 @@ OSScTask* func_800C89D4(SchedContext* sc, OSScTask* task) {
if (sc->pendingSwapBuf1 != NULL) { if (sc->pendingSwapBuf1 != NULL) {
if (0) { if (0) {
ASSERT(sc->pendingSwapBuf1 != NULL, "sc->pending_swapbuffer1", __FILE__, UNK_LINE); ASSERT(sc->pendingSwapBuf1 != NULL);
} }
return NULL; return NULL;
} }
if (sc->pendingSwapBuf2 != NULL) { if (sc->pendingSwapBuf2 != NULL) {
if (0) { if (0) {
ASSERT(sc->pendingSwapBuf2 != NULL, "sc->pending_swapbuffer2", __FILE__, UNK_LINE); ASSERT(sc->pendingSwapBuf2 != NULL);
} }
return NULL; return NULL;
} }
@ -248,7 +246,7 @@ u32 Sched_IsComplete(SchedContext* sc, OSScTask* task) {
} }
void Sched_RunTask(SchedContext* sc, OSScTask* spTask, OSScTask* dpTask) { void Sched_RunTask(SchedContext* sc, OSScTask* spTask, OSScTask* dpTask) {
ASSERT(sc->curRSPTask == NULL, "sc->curRSPTask == NULL", __FILE__, __LINE__); ASSERT(sc->curRSPTask == NULL);
if (spTask != NULL) { if (spTask != NULL) {
if (spTask->list.t.type == M_NULTASK) { if (spTask->list.t.type == M_NULTASK) {
if (spTask->flags & OS_SC_NEEDS_RSP) { if (spTask->flags & OS_SC_NEEDS_RSP) {
@ -358,7 +356,7 @@ void Sched_HandleRSPDone(SchedContext* sc) {
OSScTask* nextRDP = NULL; OSScTask* nextRDP = NULL;
s32 state; s32 state;
ASSERT(sc->curRSPTask != NULL, "sc->curRSPTask", __FILE__, __LINE__); ASSERT(sc->curRSPTask != NULL);
if (sc->curRSPTask->list.t.type == M_AUDTASK) { if (sc->curRSPTask->list.t.type == M_AUDTASK) {
gRSPAudioTotalTime += osGetTime() - sRSPAudioStartTime; gRSPAudioTotalTime += osGetTime() - sRSPAudioStartTime;
@ -407,8 +405,8 @@ void Sched_HandleRDPDone(SchedContext* sc) {
s32 state; s32 state;
gRDPTotalTime = osGetTime() - sRDPStartTime; gRDPTotalTime = osGetTime() - sRDPStartTime;
ASSERT(sc->curRDPTask != NULL, "sc->curRDPTask", __FILE__, __LINE__); ASSERT(sc->curRDPTask != NULL);
ASSERT(sc->curRDPTask->list.t.type == M_GFXTASK, "sc->curRDPTask->list.t.type == M_GFXTASK", __FILE__, __LINE__); ASSERT(sc->curRDPTask->list.t.type == M_GFXTASK);
curTask = sc->curRDPTask; curTask = sc->curRDPTask;
sc->curRDPTask = NULL; sc->curRDPTask = NULL;
curTask->state &= ~OS_SC_DP; curTask->state &= ~OS_SC_DP;

View File

@ -35,7 +35,7 @@ void Matrix_Push(void) {
void Matrix_Pop(void) { void Matrix_Pop(void) {
FrameInterpolation_RecordMatrixPop(); FrameInterpolation_RecordMatrixPop();
sCurrentMatrix--; sCurrentMatrix--;
ASSERT(sCurrentMatrix >= sMatrixStack, "Matrix_now >= Matrix_stack", __FILE__, __LINE__); ASSERT(sCurrentMatrix >= sMatrixStack);
} }
void Matrix_Get(MtxF* dest) { void Matrix_Get(MtxF* dest) {

View File

@ -2362,7 +2362,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
if (0) { if (0) {
// This ASSERT is optimized out but it exists due to its presence in rodata // This ASSERT is optimized out but it exists due to its presence in rodata
ASSERT(gMaxActorId == ACTOR_ID_MAX, "MaxProfile == ACTOR_DLF_MAX", __FILE__, UNK_LINE); ASSERT(gMaxActorId == ACTOR_ID_MAX);
} }
sp74 = NULL; sp74 = NULL;
@ -2762,8 +2762,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) {
if ((actor->flags & ACTOR_FLAG_7) && if ((actor->flags & ACTOR_FLAG_7) &&
((globalCtx->roomCtx.curRoom.showInvisActors == 0) || (globalCtx->actorCtx.unk_03 != 0) || ((globalCtx->roomCtx.curRoom.showInvisActors == 0) || (globalCtx->actorCtx.unk_03 != 0) ||
(actor->room != globalCtx->roomCtx.curRoom.num))) { (actor->room != globalCtx->roomCtx.curRoom.num))) {
ASSERT(invisibleActorCounter < INVISIBLE_ACTOR_MAX, ASSERT(invisibleActorCounter < INVISIBLE_ACTOR_MAX);
"invisible_actor_counter < INVISIBLE_ACTOR_MAX", __FILE__, __LINE__);
invisibleActors[invisibleActorCounter] = actor; invisibleActors[invisibleActorCounter] = actor;
invisibleActorCounter++; invisibleActorCounter++;
} else { } else {
@ -3006,7 +3005,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
u32 overlaySize; u32 overlaySize;
overlayEntry = &gActorOverlayTable[actorId]; overlayEntry = &gActorOverlayTable[actorId];
ASSERT(actorId < ACTOR_ID_MAX, "profile < ACTOR_DLF_MAX", __FILE__, __LINE__); ASSERT(actorId < ACTOR_ID_MAX);
name = overlayEntry->name != NULL ? overlayEntry->name : ""; name = overlayEntry->name != NULL ? overlayEntry->name : "";
overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart; overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart;
@ -3035,7 +3034,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
} }
} else { } else {
if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) { if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) {
ASSERT(overlaySize <= AM_FIELD_SIZE, "actor_segsize <= AM_FIELD_SIZE", __FILE__, __LINE__); ASSERT(overlaySize <= AM_FIELD_SIZE);
if (actorCtx->absoluteSpace == NULL) { if (actorCtx->absoluteSpace == NULL) {
// "AMF: absolute magic field" // "AMF: absolute magic field"
@ -3102,7 +3101,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
return NULL; return NULL;
} }
ASSERT(overlayEntry->numLoaded < 255, "actor_dlftbl->clients < 255", __FILE__, __LINE__); ASSERT(overlayEntry->numLoaded < 255);
overlayEntry->numLoaded++; overlayEntry->numLoaded++;
@ -3243,8 +3242,8 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
osSyncPrintf("オーバーレイではありません\n"); // "Not an overlay" osSyncPrintf("オーバーレイではありません\n"); // "Not an overlay"
} }
} else { */ } else { */
//ASSERT(overlayEntry->loadedRamAddr != NULL, "actor_dlftbl->allocp != NULL", __FILE__, __LINE__); //ASSERT(overlayEntry->loadedRamAddr != NULL, "actor_dlftbl->allocp != NULL");
//ASSERT(overlayEntry->numLoaded > 0, "actor_dlftbl->clients > 0", __FILE__, __LINE__); //ASSERT(overlayEntry->numLoaded > 0, "actor_dlftbl->clients > 0");
overlayEntry->numLoaded--; overlayEntry->numLoaded--;
Actor_FreeOverlay(overlayEntry); Actor_FreeOverlay(overlayEntry);
//} //}

View File

@ -87,7 +87,7 @@ void SSNodeList_SetSSListHead(SSNodeList* nodeList, SSList* ssList, s16* polyId)
void DynaSSNodeList_SetSSListHead(DynaSSNodeList* nodeList, SSList* ssList, s16* polyId) { void DynaSSNodeList_SetSSListHead(DynaSSNodeList* nodeList, SSList* ssList, s16* polyId) {
u16 newNodeId = DynaSSNodeList_GetNextNodeIdx(nodeList); u16 newNodeId = DynaSSNodeList_GetNextNodeIdx(nodeList);
ASSERT(newNodeId != SS_NULL, "new_node != SS_NULL", __FILE__, __LINE__); ASSERT(newNodeId != SS_NULL);
SSNode_SetValue(&nodeList->tbl[newNodeId], polyId, ssList->head); SSNode_SetValue(&nodeList->tbl[newNodeId], polyId, ssList->head);
ssList->head = newNodeId; ssList->head = newNodeId;
} }
@ -106,7 +106,7 @@ void DynaSSNodeList_Initialize(GlobalContext* globalCtx, DynaSSNodeList* nodeLis
void DynaSSNodeList_Alloc(GlobalContext* globalCtx, DynaSSNodeList* nodeList, s32 max) { void DynaSSNodeList_Alloc(GlobalContext* globalCtx, DynaSSNodeList* nodeList, s32 max) {
nodeList->tbl = THA_AllocEndAlign(&globalCtx->state.tha, max * sizeof(SSNode), -2); nodeList->tbl = THA_AllocEndAlign(&globalCtx->state.tha, max * sizeof(SSNode), -2);
ASSERT(nodeList->tbl != NULL, "psst->tbl != NULL", __FILE__, __LINE__); ASSERT(nodeList->tbl != NULL);
nodeList->max = max; nodeList->max = max;
nodeList->count = 0; nodeList->count = 0;
@ -700,7 +700,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
} }
} }
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", __FILE__, __LINE__); ASSERT(!IS_ZERO(normalXZ));
invNormalXZ = 1.0f / normalXZ; invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nz) * invNormalXZ; temp_f16 = fabsf(nz) * invNormalXZ;
@ -781,7 +781,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
} }
} }
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", __FILE__, __LINE__); ASSERT(!IS_ZERO(normalXZ));
invNormalXZ = 1.0f / normalXZ; invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nx) * invNormalXZ; temp_f16 = fabsf(nx) * invNormalXZ;
@ -2427,11 +2427,11 @@ void SSNodeList_Alloc(GlobalContext* globalCtx, SSNodeList* this, s32 tblMax, s3
this->count = 0; this->count = 0;
this->tbl = THA_AllocEndAlign(&globalCtx->state.tha, tblMax * sizeof(SSNode), -2); this->tbl = THA_AllocEndAlign(&globalCtx->state.tha, tblMax * sizeof(SSNode), -2);
ASSERT(this->tbl != NULL, "this->short_slist_node_tbl != NULL", __FILE__, __LINE__); ASSERT(this->tbl != NULL);
this->polyCheckTbl = GameState_Alloc(&globalCtx->state, numPolys, __FILE__, __LINE__); this->polyCheckTbl = GameState_Alloc(&globalCtx->state, numPolys, __FILE__, __LINE__);
ASSERT(this->polyCheckTbl != NULL, "this->polygon_check != NULL", __FILE__, __LINE__); ASSERT(this->polyCheckTbl != NULL);
} }
/** /**
@ -2441,8 +2441,7 @@ SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
SSNode* result = &this->tbl[this->count]; SSNode* result = &this->tbl[this->count];
this->count++; this->count++;
ASSERT(this->count < this->max, "this->short_slist_node_last_index < this->short_slist_node_size", __FILE__, ASSERT(this->count < this->max);
__LINE__);
if (!(this->count < this->max)) { if (!(this->count < this->max)) {
return NULL; return NULL;
} }
@ -2455,7 +2454,7 @@ SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
u16 SSNodeList_GetNextNodeIdx(SSNodeList* this) { u16 SSNodeList_GetNextNodeIdx(SSNodeList* this) {
u16 new_index = this->count++; u16 new_index = this->count++;
ASSERT(new_index < this->max, "new_index < this->short_slist_node_size", __FILE__, __LINE__); ASSERT(new_index < this->max);
return new_index; return new_index;
} }
@ -2561,7 +2560,7 @@ void DynaPoly_NullPolyList(CollisionPoly** polyList) {
*/ */
void DynaPoly_AllocPolyList(GlobalContext* globalCtx, CollisionPoly** polyList, s32 numPolys) { void DynaPoly_AllocPolyList(GlobalContext* globalCtx, CollisionPoly** polyList, s32 numPolys) {
*polyList = THA_AllocEndAlign(&globalCtx->state.tha, numPolys * sizeof(CollisionPoly), -2); *polyList = THA_AllocEndAlign(&globalCtx->state.tha, numPolys * sizeof(CollisionPoly), -2);
ASSERT(*polyList != NULL, "ptbl->pbuf != NULL", __FILE__, __LINE__); ASSERT(*polyList != NULL);
} }
/** /**
@ -2576,7 +2575,7 @@ void DynaPoly_NullVtxList(Vec3s** vtxList) {
*/ */
void DynaPoly_AllocVtxList(GlobalContext* globalCtx, Vec3s** vtxList, s32 numVtx) { void DynaPoly_AllocVtxList(GlobalContext* globalCtx, Vec3s** vtxList, s32 numVtx) {
*vtxList = THA_AllocEndAlign(&globalCtx->state.tha, numVtx * sizeof(Vec3s), -2); *vtxList = THA_AllocEndAlign(&globalCtx->state.tha, numVtx * sizeof(Vec3s), -2);
ASSERT(*vtxList != NULL, "ptbl->pbuf != NULL", __FILE__, __LINE__); ASSERT(*vtxList != NULL);
} }
/** /**
@ -2793,10 +2792,8 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3
*vtxStartIndex + pbgdata->numVertices, dyna->vtxListMax); *vtxStartIndex + pbgdata->numVertices, dyna->vtxListMax);
} }
ASSERT(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons, ASSERT(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons);
"pdyna_poly_info->poly_num >= *pstart_poly_index + pbgdata->poly_num", __FILE__, __LINE__); ASSERT(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices);
ASSERT(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices,
"pdyna_poly_info->vert_num >= *pstart_vert_index + pbgdata->vtx_num", __FILE__, __LINE__);
if (!(dyna->bitFlag & DYNAPOLY_INVALIDATE_LOOKUP) && if (!(dyna->bitFlag & DYNAPOLY_INVALIDATE_LOOKUP) &&
(BgActor_IsTransformUnchanged(&dyna->bgActors[bgId]) == true)) { (BgActor_IsTransformUnchanged(&dyna->bgActors[bgId]) == true)) {
@ -3229,7 +3226,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo
poly = &dyna->polyList[polyId]; poly = &dyna->polyList[polyId];
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz); CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
normalXZ = sqrtf(SQ(nx) + SQ(nz)); normalXZ = sqrtf(SQ(nx) + SQ(nz));
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", __FILE__, __LINE__); ASSERT(!IS_ZERO(normalXZ));
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos); planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) { if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {
@ -3302,7 +3299,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo
poly = &dyna->polyList[polyId]; poly = &dyna->polyList[polyId];
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz); CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
normalXZ = sqrtf(SQ(nx) + SQ(nz)); normalXZ = sqrtf(SQ(nx) + SQ(nz));
ASSERT(!IS_ZERO(normalXZ), "!IS_ZERO(ac_size)", __FILE__, __LINE__); ASSERT(!IS_ZERO(normalXZ));
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos); planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) { if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {

View File

@ -70,7 +70,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC,
gDPPipeSync(POLY_OPA_DISP++); gDPPipeSync(POLY_OPA_DISP++);
vtxTbl = Graph_Alloc(gfxCtx, 3 * sizeof(Vtx)); vtxTbl = Graph_Alloc(gfxCtx, 3 * sizeof(Vtx));
ASSERT(vtxTbl != NULL, "vtx_tbl != NULL", __FILE__, __LINE__); ASSERT(vtxTbl != NULL);
vtxTbl[0].n.ob[0] = vA->x; vtxTbl[0].n.ob[0] = vA->x;
vtxTbl[0].n.ob[1] = vA->y; vtxTbl[0].n.ob[1] = vA->y;
@ -452,7 +452,7 @@ s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* ac
Collider_SetBase(globalCtx, &dest->base, actor, &src->base); Collider_SetBase(globalCtx, &dest->base, actor, &src->base);
dest->count = src->count; dest->count = src->count;
dest->elements = elements; dest->elements = elements;
ASSERT(dest->elements != NULL, "pclobj_jntsph->elem_tbl != NULL", __FILE__, __LINE__); ASSERT(dest->elements != NULL);
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) { destElem++, srcElem++) {
@ -789,7 +789,7 @@ s32 Collider_SetTris(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor,
Collider_SetBase(globalCtx, &dest->base, actor, &src->base); Collider_SetBase(globalCtx, &dest->base, actor, &src->base);
dest->count = src->count; dest->count = src->count;
dest->elements = elements; dest->elements = elements;
ASSERT(dest->elements != NULL, "pclobj_tris->elem_tbl != NULL", __FILE__, __LINE__); ASSERT(dest->elements != NULL);
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) { destElem++, srcElem++) {
@ -1180,7 +1180,7 @@ s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChk
if (FrameAdvance_IsEnabled(globalCtx) == true) { if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1; return -1;
} }
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", __FILE__, __LINE__); ASSERT(collider->shape <= COLSHAPE_QUAD);
sATResetFuncs[collider->shape](globalCtx, collider); sATResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) { if (collider->actor != NULL && collider->actor->update == NULL) {
return -1; return -1;
@ -1205,7 +1205,7 @@ s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChk
*/ */
s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) { s32 index) {
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", __FILE__, __LINE__); ASSERT(collider->shape <= COLSHAPE_QUAD);
if (FrameAdvance_IsEnabled(globalCtx) == true) { if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1; return -1;
} }
@ -1249,7 +1249,7 @@ s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChk
if (FrameAdvance_IsEnabled(globalCtx) == true) { if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1; return -1;
} }
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", __FILE__, __LINE__); ASSERT(collider->shape <= COLSHAPE_QUAD);
sACResetFuncs[collider->shape](globalCtx, collider); sACResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) { if (collider->actor != NULL && collider->actor->update == NULL) {
return -1; return -1;
@ -1274,7 +1274,7 @@ s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChk
*/ */
s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) { s32 index) {
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", __FILE__, __LINE__); ASSERT(collider->shape <= COLSHAPE_QUAD);
if (FrameAdvance_IsEnabled(globalCtx) == true) { if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1; return -1;
} }
@ -1319,7 +1319,7 @@ s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colChk
return -1; return -1;
} }
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", __FILE__, __LINE__); ASSERT(collider->shape <= COLSHAPE_QUAD);
sOCResetFuncs[collider->shape](globalCtx, collider); sOCResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) { if (collider->actor != NULL && collider->actor->update == NULL) {
@ -1348,7 +1348,7 @@ s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* co
if (FrameAdvance_IsEnabled(globalCtx) == true) { if (FrameAdvance_IsEnabled(globalCtx) == true) {
return -1; return -1;
} }
ASSERT(collider->shape <= COLSHAPE_QUAD, "pcl_obj->data_type <= CL_DATA_LBL_SWRD", __FILE__, __LINE__); ASSERT(collider->shape <= COLSHAPE_QUAD);
sOCResetFuncs[collider->shape](globalCtx, collider); sOCResetFuncs[collider->shape](globalCtx, collider);
if (collider->actor != NULL && collider->actor->update == NULL) { if (collider->actor != NULL && collider->actor->update == NULL) {
return -1; return -1;
@ -2987,7 +2987,7 @@ void CollisionCheck_ApplyDamage(GlobalContext* globalCtx, CollisionCheckContext*
return; return;
} }
ASSERT(info->acHitInfo != NULL, "pclobj_elem->ac_hit_elem != NULL", __FILE__, __LINE__); ASSERT(info->acHitInfo != NULL);
tbl = collider->actor->colChkInfo.damageTable; tbl = collider->actor->colChkInfo.damageTable;
if (tbl == NULL) { if (tbl == NULL) {
damage = (f32)info->acHitInfo->toucher.damage - info->bumper.defense; damage = (f32)info->acHitInfo->toucher.damage - info->bumper.defense;

View File

@ -38,7 +38,7 @@ void func_801109B0(GlobalContext* globalCtx) {
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment); osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
ASSERT(interfaceCtx->parameterSegment != NULL, "parameter->parameterSegment != NULL", __FILE__, __LINE__); ASSERT(interfaceCtx->parameterSegment != NULL);
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize, DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize,
__FILE__, 162); __FILE__, 162);
@ -47,7 +47,7 @@ void func_801109B0(GlobalContext* globalCtx) {
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480); // "DO Action Texture Initialization" osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480); // "DO Action Texture Initialization"
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment); osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
ASSERT(interfaceCtx->doActionSegment != NULL, "parameter->do_actionSegment != NULL", __FILE__, __LINE__); ASSERT(interfaceCtx->doActionSegment != NULL);
if (gSaveContext.language == LANGUAGE_ENG) { if (gSaveContext.language == LANGUAGE_ENG) {
doActionOffset = 0; doActionOffset = 0;
@ -72,7 +72,7 @@ void func_801109B0(GlobalContext* globalCtx) {
memcpy(interfaceCtx->doActionSegment + 0x300, ResourceMgr_LoadTexByName(gReturnDoActionENGTex), 0x180); memcpy(interfaceCtx->doActionSegment + 0x300, ResourceMgr_LoadTexByName(gReturnDoActionENGTex), 0x180);
//DmaMgr_SendRequest1(interfaceCtx->doActionSegment + 0x300, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, //DmaMgr_SendRequest1(interfaceCtx->doActionSegment + 0x300, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset,
//0x180, __FILE__, __LINE__); //0x180);
interfaceCtx->iconItemSegment = GameState_Alloc( interfaceCtx->iconItemSegment = GameState_Alloc(
&globalCtx->state, 0x1000 * ARRAY_COUNT(gSaveContext.equips.buttonItems), __FILE__, __LINE__); &globalCtx->state, 0x1000 * ARRAY_COUNT(gSaveContext.equips.buttonItems), __FILE__, __LINE__);
@ -81,7 +81,7 @@ void func_801109B0(GlobalContext* globalCtx) {
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000); osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment); osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment);
ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", __FILE__, __LINE__); ASSERT(interfaceCtx->iconItemSegment != NULL);
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0], osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0],
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
@ -176,7 +176,7 @@ void Message_Init(GlobalContext* globalCtx) {
osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment); osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment);
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200); // "Textbox game_alloc=%x" osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200); // "Textbox game_alloc=%x"
ASSERT(msgCtx->textboxSegment != NULL, "message->fukidashiSegment != NULL", __FILE__, __LINE__); ASSERT(msgCtx->textboxSegment != NULL);
Font_LoadOrderedFont(&globalCtx->msgCtx.font); Font_LoadOrderedFont(&globalCtx->msgCtx.font);

View File

@ -534,7 +534,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp118; Vec3f sp118;
Vec3f sp10C; Vec3f sp10C;
ASSERT(index - 1 >= 0, "index - 1 >= 0", __FILE__, __LINE__); ASSERT(index - 1 >= 0);
ratio = (f32)(elem - 1)->timer / (f32)this->elemDuration; ratio = (f32)(elem - 1)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index - 1, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8); EffectBlure_GetComputedValues(this, index - 1, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);
@ -554,7 +554,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp100; Vec3f sp100;
Vec3f spF4; Vec3f spF4;
ASSERT(index + 2 < this->numElements, "index + 2 < this2->now_edge_num", __FILE__, __LINE__); ASSERT(index + 2 < this->numElements);
ratio = (f32)(elem + 2)->timer / (f32)this->elemDuration; ratio = (f32)(elem + 2)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index + 2, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8); EffectBlure_GetComputedValues(this, index + 2, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);

View File

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

View File

@ -59,7 +59,7 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) {
} }
LOG_STRING("企画外 条件"); // "Unplanned conditions" LOG_STRING("企画外 条件"); // "Unplanned conditions"
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(0);
return false; return false;
} }
@ -142,7 +142,7 @@ u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) {
return msg->byte2 | 0x100; return msg->byte2 | 0x100;
default: default:
LOG_STRING("企画外 条件"); // "Unplanned conditions" LOG_STRING("企画外 条件"); // "Unplanned conditions"
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(0);
} }
msg++; msg++;
} }

View File

@ -25,7 +25,7 @@ s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurv
skelCurve->transforms = ZeldaArena_MallocDebug(sizeof(*skelCurve->transforms) * skelCurve->limbCount, skelCurve->transforms = ZeldaArena_MallocDebug(sizeof(*skelCurve->transforms) * skelCurve->limbCount,
__FILE__, __LINE__); __FILE__, __LINE__);
ASSERT(skelCurve->transforms != NULL, "this->now_joint != NULL", __FILE__, __LINE__); ASSERT(skelCurve->transforms != NULL);
skelCurve->animCurFrame = 0.0f; skelCurve->animCurFrame = 0.0f;
return 1; return 1;
} }

View File

@ -52,7 +52,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.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); player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", __FILE__, __LINE__); ASSERT(player->rideActor != NULL);
Actor_MountHorse(globalCtx, player, player->rideActor); Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player); func_8002DE74(globalCtx, player);
@ -70,7 +70,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
} else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) { } else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) {
Actor* horseActor = Actor* horseActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
ASSERT(horseActor != NULL, "horse_actor != NULL", __FILE__, __LINE__); ASSERT(horseActor != NULL);
} else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) && } else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) &&
(Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) { (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
// "Set by existence of horse %d %d %d" // "Set by existence of horse %d %d %d"
@ -81,7 +81,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
Actor* horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, Actor* horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
gSaveContext.horseData.pos.x, gSaveContext.horseData.pos.y, gSaveContext.horseData.pos.x, gSaveContext.horseData.pos.y,
gSaveContext.horseData.pos.z, 0, gSaveContext.horseData.angle, 0, 1); gSaveContext.horseData.pos.z, 0, gSaveContext.horseData.angle, 0, 1);
ASSERT(horseActor != NULL, "horse_actor != NULL", __FILE__, __LINE__); ASSERT(horseActor != NULL);
if (globalCtx->sceneNum == SCENE_SPOT12) { if (globalCtx->sceneNum == SCENE_SPOT12) {
horseActor->room = -1; horseActor->room = -1;
} }
@ -95,7 +95,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) { } else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
Actor* horseActor = Actor* horseActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
ASSERT(horseActor != NULL, "horse_actor != NULL", __FILE__, __LINE__); ASSERT(horseActor != NULL);
} else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { } else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) { for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
HorseSpawn* horseSpawn = &horseSpawns[i]; HorseSpawn* horseSpawn = &horseSpawns[i];
@ -103,7 +103,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
Actor* horseActor = Actor* horseActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y, Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type); horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type);
ASSERT(horseActor != NULL, "horse_actor != NULL", __FILE__, __LINE__); ASSERT(horseActor != NULL);
if (globalCtx->sceneNum == SCENE_SPOT12) { if (globalCtx->sceneNum == SCENE_SPOT12) {
horseActor->room = -1; horseActor->room = -1;
} }
@ -153,7 +153,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y, player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
spawnPos.z, 0, player->actor.world.rot.y, 0, 7); spawnPos.z, 0, player->actor.world.rot.y, 0, 7);
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", __FILE__, __LINE__); ASSERT(player->rideActor != NULL);
Actor_MountHorse(globalCtx, player, player->rideActor); Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player); func_8002DE74(globalCtx, player);
@ -162,7 +162,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) { (Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
player->rideActor = player->rideActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", __FILE__, __LINE__); ASSERT(player->rideActor != NULL);
Actor_MountHorse(globalCtx, player, player->rideActor); Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player); func_8002DE74(globalCtx, player);
@ -192,7 +192,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 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].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
player->actor.world.rot.y, 0, D_8011F9B8[i].type); player->actor.world.rot.y, 0, D_8011F9B8[i].type);
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", __FILE__, __LINE__); ASSERT(player->rideActor != NULL);
Actor_MountHorse(globalCtx, player, player->rideActor); Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player); func_8002DE74(globalCtx, player);
@ -207,7 +207,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 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].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp); D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", __FILE__, __LINE__); ASSERT(player->rideActor != NULL);
player->actor.world.pos.x = D_8011F9B8[i].pos.x; player->actor.world.pos.x = D_8011F9B8[i].pos.x;
player->actor.world.pos.y = D_8011F9B8[i].pos.y; player->actor.world.pos.y = D_8011F9B8[i].pos.y;

View File

@ -250,8 +250,7 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) {
time = osGetTime(); time = osGetTime();
// (?) I guess MB_SIZE=0x180, PROC_OF_MBS=5 which means data is not a part of JpegWork // (?) I guess MB_SIZE=0x180, PROC_OF_MBS=5 which means data is not a part of JpegWork
ASSERT(workSize >= sizeof(JpegWork), "worksize >= sizeof(JPEGWork) + MB_SIZE * (PROC_OF_MBS - 1)", __FILE__, ASSERT(workSize >= sizeof(JpegWork));
__LINE__);
osCreateMesgQueue(&ctx.mq, &ctx.msg, 1); osCreateMesgQueue(&ctx.mq, &ctx.msg, 1);
MsgEvent_SendNullTask(); MsgEvent_SendNullTask();

View File

@ -520,7 +520,7 @@ void Map_Init(GlobalContext* globalCtx) {
// " texture initialization scene_data_ID=%d mapSegment=%x" // " texture initialization scene_data_ID=%d mapSegment=%x"
osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", globalCtx->sceneNum, osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", globalCtx->sceneNum,
interfaceCtx->mapSegment, globalCtx); interfaceCtx->mapSegment, globalCtx);
ASSERT(interfaceCtx->mapSegment != NULL, "parameter->mapSegment != NULL", __FILE__, __LINE__); ASSERT(interfaceCtx->mapSegment != NULL);
switch (globalCtx->sceneNum) { switch (globalCtx->sceneNum) {
case SCENE_SPOT00: case SCENE_SPOT00:

View File

@ -28,7 +28,7 @@ void func_800BC450(GlobalContext* globalCtx) {
} }
void func_800BC490(GlobalContext* globalCtx, s16 point) { void func_800BC490(GlobalContext* globalCtx, s16 point) {
ASSERT(point == 1 || point == 2, "point == 1 || point == 2", __FILE__, __LINE__); ASSERT(point == 1 || point == 2);
globalCtx->unk_1242B = point; globalCtx->unk_1242B = point;

View File

@ -852,7 +852,7 @@ Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far) {
far++; far++;
} }
ASSERT(near != far, "n != f", __FILE__, __LINE__); ASSERT(near != far);
gDPSetFogColor(gfx++, r, g, b, a); gDPSetFogColor(gfx++, r, g, b, a);
@ -873,7 +873,7 @@ Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far)
if (far == near) { if (far == near) {
far++; far++;
} }
ASSERT(near != far, "n != f", __FILE__, __LINE__); ASSERT(near != far);
gDPPipeSync(gfx++); gDPPipeSync(gfx++);
gDPSetFogColor(gfx++, r, g, b, a); gDPSetFogColor(gfx++, r, g, b, a);

View File

@ -118,7 +118,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start); polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start);
spA4 = spB8; spA4 = spB8;
ASSERT(polygon2->num <= SHAPE_SORT_MAX, "polygon2->num <= SHAPE_SORT_MAX", __FILE__, __LINE__); ASSERT(polygon2->num <= SHAPE_SORT_MAX);
sp78 = polygonDlist; sp78 = polygonDlist;
for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) { for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) {
@ -579,7 +579,7 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
roomCtx->curRoom.segment = NULL; roomCtx->curRoom.segment = NULL;
roomCtx->status = 1; roomCtx->status = 1;
ASSERT(roomNum < globalCtx->numRooms, "read_room_ID < game_play->room_rom_address.num", __FILE__, __LINE__); ASSERT(roomNum < globalCtx->numRooms);
size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart; size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart;
roomCtx->unk_34 = (void*)ALIGN16((intptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7)); roomCtx->unk_34 = (void*)ALIGN16((intptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
@ -622,8 +622,7 @@ void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
if (room->segment != NULL) if (room->segment != NULL)
{ {
gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment); gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
ASSERT(room->mesh->polygon.type < ARRAY_COUNTU(sRoomDrawHandlers), ASSERT(room->mesh->polygon.type < ARRAY_COUNTU(sRoomDrawHandlers));
"this->ground_shape->polygon.type < number(Room_Draw_Proc)", __FILE__, __LINE__);
sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags); sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags);
} }
} }

View File

@ -15,9 +15,7 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) {
objectCtx->spaceEnd); objectCtx->spaceEnd);
ASSERT(((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) && ASSERT(((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) &&
(((uintptr_t)objectCtx->status[objectCtx->num].segment + size) < (uintptr_t)objectCtx->spaceEnd)), (((uintptr_t)objectCtx->status[objectCtx->num].segment + size) < (uintptr_t)objectCtx->spaceEnd)));
"this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment",
__FILE__, __LINE__);
DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size, DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size,
__FILE__, __LINE__); __FILE__, __LINE__);
@ -153,9 +151,8 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) {
osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", bankIndex, objectId, size / 1024.0f); osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", bankIndex, objectId, size / 1024.0f);
nextPtr = (void*)ALIGN16((uintptr_t)status->segment + size); nextPtr = (void*)ALIGN16((uintptr_t)status->segment + size);
if (1) {} // Necessary to match
ASSERT(nextPtr < objectCtx->spaceEnd, "nextptr < this->endSegment", __FILE__, __LINE__); ASSERT(nextPtr < objectCtx->spaceEnd);
// "Object exchange free size=%08x" // "Object exchange free size=%08x"
osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (uintptr_t)objectCtx->spaceEnd - (uintptr_t)nextPtr); osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (uintptr_t)objectCtx->spaceEnd - (uintptr_t)nextPtr);
@ -295,8 +292,7 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) {
status++; status++;
} }
ASSERT(cmd->objectList.num <= OBJECT_EXCHANGE_BANK_MAX, "scene_info->object_bank.num <= OBJECT_EXCHANGE_BANK_MAX", ASSERT(cmd->objectList.num <= OBJECT_EXCHANGE_BANK_MAX);
__FILE__, __LINE__);
if (1) {} if (1) {}

View File

@ -1106,7 +1106,7 @@ void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkel
skelAnime->jointTable = ZeldaArena_MallocDebug(allocSize, __FILE__, __LINE__); skelAnime->jointTable = ZeldaArena_MallocDebug(allocSize, __FILE__, __LINE__);
skelAnime->morphTable = ZeldaArena_MallocDebug(allocSize, __FILE__, __LINE__); skelAnime->morphTable = ZeldaArena_MallocDebug(allocSize, __FILE__, __LINE__);
} else { } else {
ASSERT(limbBufCount == limbCount, "joint_buff_num == joint_num", __FILE__, __LINE__); ASSERT(limbBufCount == limbCount);
skelAnime->jointTable = (Vec3s*)ALIGN16((uintptr_t)jointTable); skelAnime->jointTable = (Vec3s*)ALIGN16((uintptr_t)jointTable);
skelAnime->morphTable = (Vec3s*)ALIGN16((uintptr_t)morphTable); skelAnime->morphTable = (Vec3s*)ALIGN16((uintptr_t)morphTable);
@ -1435,7 +1435,7 @@ s32 SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeade
skelAnime->morphTable = skelAnime->morphTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), __FILE__, __LINE__); ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), __FILE__, __LINE__);
} else { } else {
ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", __FILE__, __LINE__); ASSERT(limbCount == skelAnime->limbCount);
skelAnime->jointTable = jointTable; skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable; skelAnime->morphTable = morphTable;
} }
@ -1471,7 +1471,7 @@ s32 SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkele
skelAnime->morphTable = skelAnime->morphTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), __FILE__, __LINE__); ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), __FILE__, __LINE__);
} else { } else {
ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", __FILE__, __LINE__); ASSERT(limbCount == skelAnime->limbCount);
skelAnime->jointTable = jointTable; skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable; skelAnime->morphTable = morphTable;
} }

View File

@ -53,7 +53,7 @@ void Skin_Init(GlobalContext* globalCtx, Skin* skin, SkeletonHeader* skeletonHea
skin->vtxTable = ZeldaArena_MallocDebug(limbCount * sizeof(SkinLimbVtx), __FILE__, __LINE__); skin->vtxTable = ZeldaArena_MallocDebug(limbCount * sizeof(SkinLimbVtx), __FILE__, __LINE__);
ASSERT(skin->vtxTable != NULL, "pskin_awb->avb_tbl != NULL", __FILE__, __LINE__); ASSERT(skin->vtxTable != NULL);
for (i = 0; i < limbCount; i++) { for (i = 0; i < limbCount; i++) {
SkinLimbVtx* vtxEntry = &skin->vtxTable[i]; SkinLimbVtx* vtxEntry = &skin->vtxTable[i];
@ -71,11 +71,11 @@ void Skin_Init(GlobalContext* globalCtx, Skin* skin, SkeletonHeader* skeletonHea
vtxEntry->buf[0] = vtxEntry->buf[0] =
ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), __FILE__, __LINE__); ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), __FILE__, __LINE__);
ASSERT(vtxEntry->buf[0] != NULL, "psavb->buf[0] != NULL", __FILE__, __LINE__); ASSERT(vtxEntry->buf[0] != NULL);
vtxEntry->buf[1] = vtxEntry->buf[1] =
ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), __FILE__, __LINE__); ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), __FILE__, __LINE__);
ASSERT(vtxEntry->buf[1] != NULL, "psavb->buf[1] != NULL", __FILE__, __LINE__); ASSERT(vtxEntry->buf[1] != NULL);
Skin_InitAnimatedLimb(globalCtx, skin, i); Skin_InitAnimatedLimb(globalCtx, skin, i);
} }

View File

@ -176,10 +176,10 @@ void func_800AA550(View* view) {
lrx = view->viewport.rightX - varX; lrx = view->viewport.rightX - varX;
lry = view->viewport.bottomY - varY; lry = view->viewport.bottomY - varY;
ASSERT(ulx >= 0, "ulx >= 0", __FILE__, __LINE__); ASSERT(ulx >= 0);
ASSERT(uly >= 0, "uly >= 0", __FILE__, __LINE__); ASSERT(uly >= 0);
ASSERT(lrx <= SCREEN_WIDTH, "lrx <= SCREEN_WD", __FILE__, __LINE__); ASSERT(lrx <= SCREEN_WIDTH);
ASSERT(lry <= SCREEN_HEIGHT, "lry <= SCREEN_HT", __FILE__, __LINE__); ASSERT(lry <= SCREEN_HEIGHT);
OPEN_DISPS(gfxCtx); OPEN_DISPS(gfxCtx);

View File

@ -101,7 +101,7 @@ void VisMono_Draw(VisMono* this, Gfx** gfxp) {
LOG_ADDRESS("mono_dl + (1+3+1+1+80*(7+2+2+3)+1)", monoDL + DLSIZE); LOG_ADDRESS("mono_dl + (1+3+1+1+80*(7+2+2+3)+1)", monoDL + DLSIZE);
LOG_ADDRESS("(1+3+1+1+80*(7+2+2+3)+1)", DLSIZE); LOG_ADDRESS("(1+3+1+1+80*(7+2+2+3)+1)", DLSIZE);
} }
ASSERT(glistpEnd <= monoDL + DLSIZE, "glistp_end <= mono_dl + DLSIZE", __FILE__, __LINE__); ASSERT(glistpEnd <= monoDL + DLSIZE);
} }
gDPPipeSync(gfx++); gDPPipeSync(gfx++);
@ -131,6 +131,6 @@ void VisMono_DrawOld(VisMono* this) {
if (!this->monoDl) { if (!this->monoDl) {
this->monoDl = SystemArena_MallocDebug(DLSIZE * sizeof(Gfx), __FILE__, __LINE__); this->monoDl = SystemArena_MallocDebug(DLSIZE * sizeof(Gfx), __FILE__, __LINE__);
glistpEnd = VisMono_DrawTexture(this, this->monoDl); glistpEnd = VisMono_DrawTexture(this, this->monoDl);
ASSERT(glistpEnd <= this->monoDl + DLSIZE, "glistp_end <= this->mono_dl + DLSIZE", __FILE__, __LINE__); ASSERT(glistpEnd <= this->monoDl + DLSIZE);
} }
} }

View File

@ -961,24 +961,24 @@ void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) {
if (skyboxCtx->unk_140 != 0) { if (skyboxCtx->unk_140 != 0) {
skyboxCtx->dListBuf = GameState_Alloc(state, 8 * 150 * sizeof(Gfx), __FILE__, __LINE__); skyboxCtx->dListBuf = GameState_Alloc(state, 8 * 150 * sizeof(Gfx), __FILE__, __LINE__);
ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", __FILE__, __LINE__); ASSERT(skyboxCtx->dListBuf != NULL);
skyboxCtx->roomVtx = GameState_Alloc(state, 256 * sizeof(Vtx), __FILE__, __LINE__); skyboxCtx->roomVtx = GameState_Alloc(state, 256 * sizeof(Vtx), __FILE__, __LINE__);
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", __FILE__, __LINE__); ASSERT(skyboxCtx->roomVtx != NULL);
func_800AEFC8(skyboxCtx, skyboxId); func_800AEFC8(skyboxCtx, skyboxId);
} else { } else {
skyboxCtx->dListBuf = GameState_Alloc(state, 12 * 150 * sizeof(Gfx), __FILE__, __LINE__); skyboxCtx->dListBuf = GameState_Alloc(state, 12 * 150 * sizeof(Gfx), __FILE__, __LINE__);
ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", __FILE__, __LINE__); ASSERT(skyboxCtx->dListBuf != NULL);
if (skyboxId == SKYBOX_CUTSCENE_MAP) { if (skyboxId == SKYBOX_CUTSCENE_MAP) {
skyboxCtx->roomVtx = GameState_Alloc(state, 192 * sizeof(Vtx), __FILE__, __LINE__); skyboxCtx->roomVtx = GameState_Alloc(state, 192 * sizeof(Vtx), __FILE__, __LINE__);
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", __FILE__, __LINE__); ASSERT(skyboxCtx->roomVtx != NULL);
func_800AF178(skyboxCtx, 6); func_800AF178(skyboxCtx, 6);
} else { } else {
skyboxCtx->roomVtx = GameState_Alloc(state, 160 * sizeof(Vtx), __FILE__, __LINE__); skyboxCtx->roomVtx = GameState_Alloc(state, 160 * sizeof(Vtx), __FILE__, __LINE__);
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", __FILE__, __LINE__); ASSERT(skyboxCtx->roomVtx != NULL);
func_800AF178(skyboxCtx, 5); func_800AF178(skyboxCtx, 5);
} }

View File

@ -64,7 +64,7 @@ void BgGndIceblock_Init(Actor* thisx, GlobalContext* globalCtx) {
sBlockPositions[1] = 14; sBlockPositions[1] = 14;
} else { } else {
LOG_FLOAT("thisx->world.position.x", this->dyna.actor.world.pos.x); LOG_FLOAT("thisx->world.position.x", this->dyna.actor.world.pos.x);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(0);
} }
} }

View File

@ -86,7 +86,7 @@ void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("bank_ID = %d\n", objBankIndex); osSyncPrintf("bank_ID = %d\n", objBankIndex);
if (objBankIndex < 0) { if (objBankIndex < 0) {
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(objBankIndex < 0);
} else { } else {
this->objBankIndex = objBankIndex; this->objBankIndex = objBankIndex;
} }
@ -173,7 +173,7 @@ void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_293 = params - 14; this->unk_293 = params - 14;
break; break;
default: default:
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(0);
break; break;
} }

View File

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

View File

@ -186,7 +186,7 @@ void DemoKankyo_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("bank_ID = %d\n", objBankIndex); osSyncPrintf("bank_ID = %d\n", objBankIndex);
if (objBankIndex < 0) { if (objBankIndex < 0) {
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(objBankIndex < 0);
} else { } else {
this->objBankIndex = objBankIndex; this->objBankIndex = objBankIndex;
} }

View File

@ -54,7 +54,7 @@ void DemoTreLgt_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("Demo_Tre_Lgt_Actor_ct();コンストラクト失敗\n"); osSyncPrintf("Demo_Tre_Lgt_Actor_ct();コンストラクト失敗\n");
} }
ASSERT(true, "1", __FILE__, UNK_LINE); ASSERT(true);
this->unk_170 = 255; this->unk_170 = 255;
this->unk_174 = 255; this->unk_174 = 255;

View File

@ -569,7 +569,7 @@ Gfx* EnBox_EmptyDList(GraphicsContext* gfxCtx) {
Gfx* dList; Gfx* dList;
dList = Graph_Alloc(gfxCtx, sizeof(Gfx)); dList = Graph_Alloc(gfxCtx, sizeof(Gfx));
ASSERT(dList != NULL, "gfxp != NULL", __FILE__, __LINE__); ASSERT(dList != NULL);
dListHead = dList; dListHead = dList;
gSPEndDisplayList(dListHead++); gSPEndDisplayList(dListHead++);
@ -583,7 +583,7 @@ Gfx* func_809CA4A0(GraphicsContext* gfxCtx) {
Gfx* dListHead; Gfx* dListHead;
dListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx)); dListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx));
ASSERT(dListHead != NULL, "gfxp != NULL", __FILE__, __LINE__); ASSERT(dListHead != NULL);
dList = dListHead; dList = dListHead;
gDPSetRenderMode(dListHead++, gDPSetRenderMode(dListHead++,
@ -601,7 +601,7 @@ Gfx* func_809CA518(GraphicsContext* gfxCtx) {
Gfx* dListHead; Gfx* dListHead;
dListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx)); dListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx));
ASSERT(dListHead != NULL, "gfxp != NULL", __FILE__, __LINE__); ASSERT(dListHead != NULL);
dList = dListHead; dList = dListHead;
gDPSetRenderMode(dListHead++, gDPSetRenderMode(dListHead++,

View File

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

View File

@ -226,7 +226,7 @@ void EnFr_Init(Actor* thisx, GlobalContext* globalCtx) {
// "The argument is wrong!!" // "The argument is wrong!!"
osSyncPrintf("%s[%d] : 引数が間違っている!!(%d)\n", __FILE__, __LINE__, this->actor.params); osSyncPrintf("%s[%d] : 引数が間違っている!!(%d)\n", __FILE__, __LINE__, this->actor.params);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT((this->actor.params >= 6) || (this->actor.params < 0));
} }
this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP); this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP);
@ -236,7 +236,7 @@ void EnFr_Init(Actor* thisx, GlobalContext* globalCtx) {
// "There is no bank!!" // "There is no bank!!"
osSyncPrintf("%s[%d] : バンクが無いよ!!\n", __FILE__, __LINE__); osSyncPrintf("%s[%d] : バンクが無いよ!!\n", __FILE__, __LINE__);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(this->objBankIndex < 0);
} }
} }
} }

View File

@ -156,7 +156,7 @@ void EnGe2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 6; this->actor.targetMode = 6;
break; break;
default: default:
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(0);
} }
this->stateFlags = 0; this->stateFlags = 0;

View File

@ -384,7 +384,7 @@ void EnGirlA_InitItem(EnGirlA* this, GlobalContext* globalCtx) {
osSyncPrintf(VT_COL(RED, WHITE)); osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf("引数がおかしいよ(arg_data=%d)\n", this->actor.params); osSyncPrintf("引数がおかしいよ(arg_data=%d)\n", this->actor.params);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT((params >= SI_MAX) && (params < 0));
return; return;
} }
@ -395,7 +395,7 @@ void EnGirlA_InitItem(EnGirlA* this, GlobalContext* globalCtx) {
osSyncPrintf(VT_COL(RED, WHITE)); osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf("バンクが無いよ!!(%s)\n", sShopItemDescriptions[params]); osSyncPrintf("バンクが無いよ!!(%s)\n", sShopItemDescriptions[params]);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(this->objBankIndex < 0);
return; return;
} }

View File

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

View File

@ -62,7 +62,7 @@ void EnGuest_Init(Actor* thisx, GlobalContext* globalCtx) {
// "No such bank!!" // "No such bank!!"
osSyncPrintf("%s[%d] : バンクが無いよ!!\n", __FILE__, __LINE__); osSyncPrintf("%s[%d] : バンクが無いよ!!\n", __FILE__, __LINE__);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(this->osAnimeBankIndex < 0);
} }
} }
} }

View File

@ -869,7 +869,8 @@ void EnHorse_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_IN, this->actor.world.pos.x, this->actor.world.pos.y, Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_IN, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, 1, 1); this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, 1, 1);
if (this->rider == NULL) { if (this->rider == NULL) {
__assert("this->race.rider != NULL", __FILE__, __LINE__); //__assert("this->race.rider != NULL");
ASSERT(this->rider == NULL);
} }
if (!(gSaveContext.eventInf[0] & 0x40)) { if (!(gSaveContext.eventInf[0] & 0x40)) {
this->ingoHorseMaxSpeed = 12.07f; this->ingoHorseMaxSpeed = 12.07f;

View File

@ -584,7 +584,7 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf(VT_COL(RED, WHITE)); osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf("引数がおかしいよ(arg_data=%d)\n", this->actor.params); osSyncPrintf("引数がおかしいよ(arg_data=%d)\n", this->actor.params);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(this->actor.params > OSSAN_TYPE_MASK && this->actor.params < OSSAN_TYPE_KOKIRI);
return; return;
} }
@ -613,7 +613,7 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf(VT_COL(RED, WHITE)); osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf("バンクが無いよ!!(%s)\n", sShopkeeperPrintName[this->actor.params]); osSyncPrintf("バンクが無いよ!!(%s)\n", sShopkeeperPrintName[this->actor.params]);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(this->objBankIndex1 < 0);
return; return;
} }
@ -622,7 +622,7 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf(VT_COL(RED, WHITE)); osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf("予備バンクが無いよ!!(%s)\n", sShopkeeperPrintName[this->actor.params]); osSyncPrintf("予備バンクが無いよ!!(%s)\n", sShopkeeperPrintName[this->actor.params]);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(EnOssan_TryGetObjBankIndexes(this, globalCtx, objectIds) == 0);
return; return;
} }

View File

@ -964,7 +964,7 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) {
this->actor.draw = NULL; this->actor.draw = NULL;
break; break;
default: default:
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(0);
break; break;
} }

View File

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

View File

@ -128,7 +128,7 @@ void EnSth_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("bank_ID = %d\n", objectBankIdx); osSyncPrintf("bank_ID = %d\n", objectBankIdx);
if (objectBankIdx < 0) { if (objectBankIdx < 0) {
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(objectBankIdx < 0);
} }
this->objectBankIdx = objectBankIdx; this->objectBankIdx = objectBankIdx;
this->drawFunc = EnSth_Draw; this->drawFunc = EnSth_Draw;

View File

@ -114,7 +114,7 @@ void EnTr_Init(Actor* thisx, GlobalContext* globalCtx) {
break; break;
default: default:
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(0);
break; break;
} }
} }

View File

@ -169,10 +169,10 @@ void EnViewer_InitImpl(EnViewer* this, GlobalContext* globalCtx) {
EnViewerInitData* initData = &sInitData[this->actor.params >> 8]; EnViewerInitData* initData = &sInitData[this->actor.params >> 8];
s32 skelObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, initData->skeletonObject); s32 skelObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, initData->skeletonObject);
ASSERT(skelObjBankIndex >= 0, "bank_ID >= 0", __FILE__, __LINE__); ASSERT(skelObjBankIndex >= 0);
this->animObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, initData->animObject); this->animObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, initData->animObject);
ASSERT(this->animObjBankIndex >= 0, "this->anime_bank_ID >= 0", __FILE__, __LINE__); ASSERT(this->animObjBankIndex >= 0);
if (!Object_IsLoaded(&globalCtx->objectCtx, skelObjBankIndex) || if (!Object_IsLoaded(&globalCtx->objectCtx, skelObjBankIndex) ||
!Object_IsLoaded(&globalCtx->objectCtx, this->animObjBankIndex)) { !Object_IsLoaded(&globalCtx->objectCtx, this->animObjBankIndex)) {

View File

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

View File

@ -771,7 +771,7 @@ void ObjectKankyo_SunGraveSparkInit(ObjectKankyo* this, GlobalContext* globalCtx
s32 objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_SPOT02_OBJECTS); s32 objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_SPOT02_OBJECTS);
if (objBankIndex < 0) { if (objBankIndex < 0) {
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(objBankIndex < 0);
} else { } else {
this->requiredObjBankIndex = objBankIndex; this->requiredObjBankIndex = objBankIndex;
} }
@ -872,7 +872,7 @@ void ObjectKankyo_InitBeams(ObjectKankyo* this, GlobalContext* globalCtx) {
s32 objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_DEMO_KEKKAI); s32 objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_DEMO_KEKKAI);
if (objectIndex < 0) { if (objectIndex < 0) {
ASSERT(0, "0", __FILE__, __LINE__); ASSERT(objectIndex < 0);
} else { } else {
this->requiredObjBankIndex = objectIndex; this->requiredObjBankIndex = objectIndex;
} }

View File

@ -4901,7 +4901,7 @@ void func_8083AE40(Player* this, s16 objectId) {
size = gObjectTable[objectId].vromEnd - gObjectTable[objectId].vromStart; size = gObjectTable[objectId].vromEnd - gObjectTable[objectId].vromStart;
LOG_HEX("size", size); LOG_HEX("size", size);
ASSERT(size <= 1024 * 8, "size <= 1024 * 8", __FILE__, __LINE__); ASSERT(size <= 1024 * 8);
DmaMgr_SendRequest2(&this->giObjectDmaRequest, (uintptr_t)this->giObjectSegment, gObjectTable[objectId].vromStart, DmaMgr_SendRequest2(&this->giObjectDmaRequest, (uintptr_t)this->giObjectSegment, gObjectTable[objectId].vromStart,
size, 0, &this->giObjectLoadQueue, OS_MESG_PTR(NULL), __FILE__, __LINE__); size, 0, &this->giObjectLoadQueue, OS_MESG_PTR(NULL), __FILE__, __LINE__);

View File

@ -1954,12 +1954,12 @@ void FileChoose_Init(GameState* thisx) {
osSyncPrintf("SIZE=%x\n", size); osSyncPrintf("SIZE=%x\n", size);
this->staticSegment = GameState_Alloc(&this->state, size, __FILE__, __LINE__); this->staticSegment = GameState_Alloc(&this->state, size, __FILE__, __LINE__);
ASSERT(this->staticSegment != NULL, "this->staticSegment != NULL", __FILE__, __LINE__); ASSERT(this->staticSegment != NULL);
DmaMgr_SendRequest1(this->staticSegment, (u32)_title_staticSegmentRomStart, size, __FILE__, __LINE__); DmaMgr_SendRequest1(this->staticSegment, (u32)_title_staticSegmentRomStart, size, __FILE__, __LINE__);
size = (u32)_parameter_staticSegmentRomEnd - (u32)_parameter_staticSegmentRomStart; size = (u32)_parameter_staticSegmentRomEnd - (u32)_parameter_staticSegmentRomStart;
this->parameterSegment = GameState_Alloc(&this->state, size, __FILE__, __LINE__); this->parameterSegment = GameState_Alloc(&this->state, size, __FILE__, __LINE__);
ASSERT(this->parameterSegment != NULL, "this->parameterSegment != NULL", __FILE__, __LINE__); ASSERT(this->parameterSegment != NULL);
DmaMgr_SendRequest1(this->parameterSegment, (u32)_parameter_staticSegmentRomStart, size, __FILE__, DmaMgr_SendRequest1(this->parameterSegment, (u32)_parameter_staticSegmentRomStart, size, __FILE__,
__LINE__); __LINE__);

View File

@ -333,7 +333,7 @@ void Title_Init(GameState* thisx) {
//this->staticSegment = GameState_Alloc(&this->state, size, __FILE__, __LINE__); //this->staticSegment = GameState_Alloc(&this->state, size, __FILE__, __LINE__);
osSyncPrintf("z_title.c\n"); osSyncPrintf("z_title.c\n");
//ASSERT(this->staticSegment != NULL, "this->staticSegment != NULL", __FILE__, __LINE__); //ASSERT(this->staticSegment != NULL);
//ResourceMgr_CacheDirectory("nintendo_rogo_static*"); //ResourceMgr_CacheDirectory("nintendo_rogo_static*");