Add an error for implicit functions (#3017)

* Add the flag and fix errors

* switch assert and skin matrix

* new LUS

* Use normal assert

* hopefully fix WiiU

Signed-off-by: Louis <louist103@pop-os.localdomain>

---------

Signed-off-by: Louis <louist103@pop-os.localdomain>
Co-authored-by: Louis <louist103@pop-os.localdomain>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
This commit is contained in:
louist103
2023-06-27 19:53:35 -04:00
committed by GitHub
parent 7c5efb2785
commit acfc04d0ac
84 changed files with 354 additions and 217 deletions

View File

@@ -2,6 +2,7 @@
#include "alloca.h"
#include <string.h>
#include <stdlib.h>
void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) {
this->widthSave = width;
@@ -474,9 +475,9 @@ void func_800C2FE4(PreRender* this) {
s32 x;
s32 y;
s32 phi_v0;
u8* buffR = alloca(this->width);
u8* buffG = alloca(this->width);
u8* buffB = alloca(this->width);
u8* buffR = malloc(this->width);
u8* buffG = malloc(this->width);
u8* buffB = malloc(this->width);
s32 pad[3];
s32 pxR;
s32 pxG;
@@ -538,6 +539,9 @@ void func_800C2FE4(PreRender* this) {
this->fbufSave[x + y * this->width] = pxOut.rgba;
}
}
free(buffR);
free(buffB);
free(buffG);
}
void PreRender_Calc(PreRender* this) {

View File

@@ -6,6 +6,7 @@
#include "global.h"
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/audio/AudioCollection.h"
#include "soh/Enhancements/audio/AudioEditor.h"
#define MK_ASYNC_MSG(retData, tableType, id, status) (((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (status))
#define ASYNC_TBLTYPE(v) ((u8)(v >> 16))

View File

@@ -3,6 +3,8 @@
#include <libultraship/libultra.h>
#include "global.h"
#include "soh/Enhancements/audio/AudioEditor.h"
extern char** sequenceMap;
#define PORTAMENTO_IS_SPECIAL(x) ((x).mode & 0x80)

View File

@@ -1,5 +1,6 @@
#include <libultraship/libultra.h>
#include "global.h"
#include "soh/Enhancements/audio/AudioEditor.h"
// TODO: can these macros be shared between files? code_800F9280 seems to use
// versions without any casts...

View File

@@ -2,6 +2,8 @@
#include "global.h"
#include "vt.h"
#include "soh/Enhancements/audio/AudioEditor.h"
typedef struct {
/* 0x00 */ u16 sfxId;
/* 0x04 */ Vec3f* pos;

View File

@@ -2,6 +2,8 @@
#include "global.h"
#include "soh/mixer.h"
#include "soh/Enhancements/audio/AudioEditor.h"
typedef struct {
u8 unk_0;
u8 unk_1; // importance?

View File

@@ -1,6 +1,6 @@
#include "global.h"
#include "vt.h"
#include "alloca.h"
#include <stdio.h>
// data
const char* sExceptionNames[] = {
@@ -1124,6 +1124,6 @@ void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1) {
void Fault_AddHungupAndCrash(const char* filename, u32 line) {
char msg[256];
sprintf(msg, "HungUp %s:%d", filename, line);
snprintf(msg, sizeof(msg), "HungUp %s:%d", filename, line);
Fault_AddHungupAndCrashImpl(msg, NULL);
}

View File

@@ -3,6 +3,7 @@
#include "vt.h"
#include "libultraship/bridge.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
SpeedMeter D_801664D0;
struct_801664F0 D_801664F0;
@@ -16,6 +17,7 @@ u16 sLastButtonPressed;
int gfx_create_framebuffer(uint32_t width, uint32_t height);
void gfx_texture_cache_clear();
void GameState_FaultPrint(void) {
static char sBtnChars[] = "ABZSuldr*+LRudlr";
s32 i;

View File

@@ -3,9 +3,12 @@
#include "regs.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "soh/Enhancements/debugger/colViewer.h"
#include "soh/Enhancements/gameconsole.h"
#include "soh/OTRGlobals.h"
#define GFXPOOL_HEAD_MAGIC 0x1234
#define GFXPOOL_TAIL_MAGIC 0x5678
@@ -16,6 +19,9 @@ FaultClient sGraphFaultClient;
CfbInfo sGraphCfbInfos[3];
FaultClient sGraphUcodeFaultClient;
void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId);
void PadMgr_ThreadEntry(PadMgr* padMgr);
// clang-format off
UCodeInfo D_8012D230[3] = {
//{ UCODE_F3DZEX, D_80155F50 },
@@ -461,7 +467,7 @@ static void RunFrame()
{
osSyncPrintf("確保失敗\n"); // "Failure to secure"
sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
snprintf(faultMsg, sizeof(faultMsg), "CLASS SIZE= %d bytes", size);
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
}
GameState_Init(runFrameContext.gameState, runFrameContext.ovl->init, &runFrameContext.gfxCtx);
@@ -478,15 +484,15 @@ static void RunFrame()
while (GameState_IsRunning(runFrameContext.gameState))
{
uint64_t ticksA, ticksB;
ticksA = GetPerfCounter();
//uint64_t ticksA, ticksB;
//ticksA = GetPerfCounter();
Graph_StartFrame();
PadMgr_ThreadEntry(&gPadMgr);
Graph_Update(&runFrameContext.gfxCtx, runFrameContext.gameState);
ticksB = GetPerfCounter();
//ticksB = GetPerfCounter();
Graph_ProcessGfxCommands(runFrameContext.gfxCtx.workBuffer);

View File

@@ -1,16 +1,13 @@
#include "global.h"
#include "vt.h"
#include <string.h>
#include "soh/Enhancements/game-interactor/GameInteractor.h"
//#include <string.h>
#ifdef _MSC_VER
extern void* __cdecl memset(_Out_writes_bytes_all_(_Size) void* _Dst, _In_ int _Val, _In_ size_t _Size);
#endif
s32 D_8012D280 = 1;
void OTRControllerCallback(uint8_t rumble);
OSMesgQueue* PadMgr_LockSerialMesgQueue(PadMgr* padMgr) {
OSMesgQueue* ctrlrQ = NULL;

View File

@@ -1,6 +1,7 @@
#include "global.h"
#include <string.h>
#include <assert.h>
#define RSP_DONE_MSG 667
#define RDP_DONE_MSG 668
@@ -102,7 +103,7 @@ void Sched_HandleStart(SchedContext* sc) {
void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
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));
if (type == M_AUDTASK) {
if (sLogScheduler) {
@@ -134,7 +135,7 @@ void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
void Sched_Yield(SchedContext* sc) {
if (!(sc->curRSPTask->state & OS_SC_YIELD)) {
ASSERT(sc->curRSPTask->list.t.type != M_AUDTASK);
assert(sc->curRSPTask->list.t.type != M_AUDTASK);
sc->curRSPTask->state |= OS_SC_YIELD;
@@ -153,14 +154,14 @@ OSScTask* func_800C89D4(SchedContext* sc, OSScTask* task) {
if (sc->pendingSwapBuf1 != NULL) {
if (0) {
ASSERT(sc->pendingSwapBuf1 != NULL);
assert(sc->pendingSwapBuf1 != NULL);
}
return NULL;
}
if (sc->pendingSwapBuf2 != NULL) {
if (0) {
ASSERT(sc->pendingSwapBuf2 != NULL);
assert(sc->pendingSwapBuf2 != NULL);
}
return NULL;
}
@@ -246,7 +247,7 @@ u32 Sched_IsComplete(SchedContext* sc, OSScTask* task) {
}
void Sched_RunTask(SchedContext* sc, OSScTask* spTask, OSScTask* dpTask) {
ASSERT(sc->curRSPTask == NULL);
assert(sc->curRSPTask == NULL);
if (spTask != NULL) {
if (spTask->list.t.type == M_NULTASK) {
if (spTask->flags & OS_SC_NEEDS_RSP) {
@@ -356,7 +357,7 @@ void Sched_HandleRSPDone(SchedContext* sc) {
OSScTask* nextRDP = NULL;
s32 state;
ASSERT(sc->curRSPTask != NULL);
assert(sc->curRSPTask != NULL);
if (sc->curRSPTask->list.t.type == M_AUDTASK) {
gRSPAudioTotalTime += osGetTime() - sRSPAudioStartTime;
@@ -405,8 +406,8 @@ void Sched_HandleRDPDone(SchedContext* sc) {
s32 state;
gRDPTotalTime = osGetTime() - sRDPStartTime;
ASSERT(sc->curRDPTask != NULL);
ASSERT(sc->curRDPTask->list.t.type == M_GFXTASK);
assert(sc->curRDPTask != NULL);
assert(sc->curRDPTask->list.t.type == M_GFXTASK);
curTask = sc->curRDPTask;
sc->curRDPTask = NULL;
curTask->state &= ~OS_SC_DP;

View File

@@ -1,6 +1,7 @@
#include "global.h"
#include "soh/frame_interpolation.h"
#include <assert.h>
// clang-format off
Mtx gMtxClear = {
@@ -35,7 +36,7 @@ void Matrix_Push(void) {
void Matrix_Pop(void) {
FrameInterpolation_RecordMatrixPop();
sCurrentMatrix--;
ASSERT(sCurrentMatrix >= sMatrixStack);
assert(sCurrentMatrix >= sMatrixStack);
}
void Matrix_Get(MtxF* dest) {

View File

@@ -9,13 +9,13 @@
#include "soh/frame_interpolation.h"
#include "soh/Enhancements/enemyrandomizer.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ActorDB.h"
#if defined(_MSC_VER) || defined(__GNUC__)
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#endif
#if defined(_MSC_VER) || defined(__GNUC__)
#include "textures/place_title_cards/g_pn_49.h"
@@ -2570,7 +2570,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
actor->colorFilterTimer--;
}
actor->update(actor, play);
GameInteractor_ExecuteOnActorUpdate(actor, play);
GameInteractor_ExecuteOnActorUpdate(actor);
func_8003F8EC(play, &play->colCtx.dyna, actor);
}
@@ -2900,7 +2900,7 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
if ((actor->flags & ACTOR_FLAG_LENS) &&
((play->roomCtx.curRoom.lensMode == LENS_MODE_HIDE_ACTORS) ||
play->actorCtx.lensActive || (actor->room != play->roomCtx.curRoom.num))) {
ASSERT(invisibleActorCounter < INVISIBLE_ACTOR_MAX);
assert(invisibleActorCounter < INVISIBLE_ACTOR_MAX);
invisibleActors[invisibleActorCounter] = actor;
invisibleActorCounter++;
} else {
@@ -3127,7 +3127,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
ActorDBEntry* dbEntry = ActorDB_Retrieve(actorId);
ASSERT(dbEntry->valid);
assert(dbEntry->valid);
if (HREG(20) != 0) {
// "Actor class addition [%d:%s]"
@@ -3165,7 +3165,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
return NULL;
}
ASSERT(dbEntry->numLoaded < 255);
assert(dbEntry->numLoaded < 255);
dbEntry->numLoaded++;

View File

@@ -2,6 +2,7 @@
#include "vt.h"
#include <soh/OTRGlobals.h>
#include <assert.h>
#define SS_NULL 0xFFFF
@@ -87,7 +88,7 @@ void SSNodeList_SetSSListHead(SSNodeList* nodeList, SSList* ssList, s16* polyId)
void DynaSSNodeList_SetSSListHead(DynaSSNodeList* nodeList, SSList* ssList, s16* polyId) {
u16 newNodeId = DynaSSNodeList_GetNextNodeIdx(nodeList);
ASSERT(newNodeId != SS_NULL);
assert(newNodeId != SS_NULL);
SSNode_SetValue(&nodeList->tbl[newNodeId], polyId, ssList->head);
ssList->head = newNodeId;
}
@@ -106,7 +107,7 @@ void DynaSSNodeList_Initialize(PlayState* play, DynaSSNodeList* nodeList) {
void DynaSSNodeList_Alloc(PlayState* play, DynaSSNodeList* nodeList, s32 max) {
nodeList->tbl = THA_AllocEndAlign(&play->state.tha, max * sizeof(SSNode), -2);
ASSERT(nodeList->tbl != NULL);
assert(nodeList->tbl != NULL);
nodeList->max = max;
nodeList->count = 0;
@@ -709,7 +710,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
}
}
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nz) * invNormalXZ;
@@ -790,7 +791,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
}
}
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nx) * invNormalXZ;
@@ -2446,11 +2447,11 @@ void SSNodeList_Alloc(PlayState* play, SSNodeList* this, s32 tblMax, s32 numPoly
this->count = 0;
this->tbl = THA_AllocEndAlign(&play->state.tha, tblMax * sizeof(SSNode), -2);
ASSERT(this->tbl != NULL);
assert(this->tbl != NULL);
this->polyCheckTbl = GAMESTATE_ALLOC_MC(&play->state, numPolys);
ASSERT(this->polyCheckTbl != NULL);
assert(this->polyCheckTbl != NULL);
}
/**
@@ -2460,7 +2461,7 @@ SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
SSNode* result = &this->tbl[this->count];
this->count++;
ASSERT(this->count < this->max);
assert(this->count < this->max);
if (!(this->count < this->max)) {
return NULL;
}
@@ -2473,7 +2474,7 @@ SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
u16 SSNodeList_GetNextNodeIdx(SSNodeList* this) {
u16 new_index = this->count++;
ASSERT(new_index < this->max);
assert(new_index < this->max);
return new_index;
}
@@ -2579,7 +2580,7 @@ void DynaPoly_NullPolyList(CollisionPoly** polyList) {
*/
void DynaPoly_AllocPolyList(PlayState* play, CollisionPoly** polyList, s32 numPolys) {
*polyList = THA_AllocEndAlign(&play->state.tha, numPolys * sizeof(CollisionPoly), -2);
ASSERT(*polyList != NULL);
assert(*polyList != NULL);
}
/**
@@ -2594,7 +2595,7 @@ void DynaPoly_NullVtxList(Vec3s** vtxList) {
*/
void DynaPoly_AllocVtxList(PlayState* play, Vec3s** vtxList, s32 numVtx) {
*vtxList = THA_AllocEndAlign(&play->state.tha, numVtx * sizeof(Vec3s), -2);
ASSERT(*vtxList != NULL);
assert(*vtxList != NULL);
}
/**
@@ -2811,8 +2812,8 @@ void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s
*vtxStartIndex + pbgdata->numVertices, dyna->vtxListMax);
}
ASSERT(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons);
ASSERT(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices);
assert(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons);
assert(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices);
if (!(dyna->bitFlag & DYNAPOLY_INVALIDATE_LOOKUP) &&
(BgActor_IsTransformUnchanged(&dyna->bgActors[bgId]) == true)) {
@@ -3245,7 +3246,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));
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {
@@ -3318,7 +3319,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));
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {

View File

@@ -2,6 +2,7 @@
#include "vt.h"
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include <assert.h>
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkBloodFunc)(PlayState*, Collider*, Vec3f*);
@@ -71,7 +72,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC,
gDPPipeSync(POLY_OPA_DISP++);
vtxTbl = Graph_Alloc(gfxCtx, 3 * sizeof(Vtx));
ASSERT(vtxTbl != NULL);
assert(vtxTbl != NULL);
vtxTbl[0].n.ob[0] = vA->x;
vtxTbl[0].n.ob[1] = vA->y;
@@ -453,7 +454,7 @@ s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* dest, Actor* actor, Coll
Collider_SetBase(play, &dest->base, actor, &src->base);
dest->count = src->count;
dest->elements = elements;
ASSERT(dest->elements != NULL);
assert(dest->elements != NULL);
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) {
@@ -790,7 +791,7 @@ s32 Collider_SetTris(PlayState* play, ColliderTris* dest, Actor* actor, Collider
Collider_SetBase(play, &dest->base, actor, &src->base);
dest->count = src->count;
dest->elements = elements;
ASSERT(dest->elements != NULL);
assert(dest->elements != NULL);
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) {
@@ -1185,7 +1186,7 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Coll
if (FrameAdvance_IsEnabled(play) == true) {
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sATResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@@ -1210,7 +1211,7 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Coll
*/
s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) {
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
if (GameInteractor_SecondCollisionUpdate()) {
return -1;
@@ -1264,7 +1265,7 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
if (FrameAdvance_IsEnabled(play) == true) {
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sACResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@@ -1289,7 +1290,7 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
*/
s32 CollisionCheck_SetAC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) {
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
if (GameInteractor_SecondCollisionUpdate()) {
return -1;
@@ -1344,7 +1345,7 @@ s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sOCResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
@@ -1379,7 +1380,7 @@ s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colChkCtx,
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sOCResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@@ -3022,7 +3023,7 @@ void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colChkCt
return;
}
ASSERT(info->acHitInfo != NULL);
assert(info->acHitInfo != NULL);
tbl = collider->actor->colChkInfo.damageTable;
if (tbl == NULL) {
damage = (f32)info->acHitInfo->toucher.damage - info->bumper.defense;

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include <textures/do_action_static/do_action_static.h>
#include <assert.h>
void func_80110990(PlayState* play) {
Map_Destroy(play);
@@ -37,7 +38,7 @@ void func_801109B0(PlayState* play) {
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
ASSERT(interfaceCtx->parameterSegment != NULL);
assert(interfaceCtx->parameterSegment != NULL);
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize,
__FILE__, 162);
@@ -46,7 +47,7 @@ void func_801109B0(PlayState* play) {
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480); // "DO Action Texture Initialization"
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
ASSERT(interfaceCtx->doActionSegment != NULL);
assert(interfaceCtx->doActionSegment != NULL);
interfaceCtx->doActionSegment[0] = gAttackDoActionENGTex;
interfaceCtx->doActionSegment[1] = gCheckDoActionENGTex;
@@ -59,7 +60,7 @@ void func_801109B0(PlayState* play) {
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment);
ASSERT(interfaceCtx->iconItemSegment != NULL);
assert(interfaceCtx->iconItemSegment != NULL);
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0],
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
@@ -154,7 +155,7 @@ void Message_Init(PlayState* play) {
osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment);
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200); // "Textbox game_alloc=%x"
ASSERT(msgCtx->textboxSegment != NULL);
assert(msgCtx->textboxSegment != NULL);
Font_LoadOrderedFont(&play->msgCtx.font);

View File

@@ -2,6 +2,7 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "soh/frame_interpolation.h"
#include <assert.h>
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
EffectBlureElement* elem;
@@ -618,7 +619,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp118;
Vec3f sp10C;
ASSERT(index - 1 >= 0);
assert(index - 1 >= 0);
ratio = (f32)(elem - 1)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index - 1, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);
@@ -638,7 +639,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp100;
Vec3f spF4;
ASSERT(index + 2 < this->numElements);
assert(index + 2 < this->numElements);
ratio = (f32)(elem + 2)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index + 2, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);

View File

@@ -2,6 +2,7 @@
#include "vt.h"
#include "soh/frame_interpolation.h"
#include <assert.h>
EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info"
@@ -18,7 +19,7 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
sEffectSsInfo.table =
GAMESTATE_ALLOC_MC(&play->state, tableSize * sizeof(EffectSs));
ASSERT(sEffectSsInfo.table != NULL);
assert(sEffectSsInfo.table != NULL);
sEffectSsInfo.searchStartIndex = 0;
sEffectSsInfo.tableSize = tableSize;
@@ -175,7 +176,7 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) {
overlayEntry = &gEffectSsOverlayTable[type];
ASSERT(type < EFFECT_SS_TYPE_MAX);
assert(type < EFFECT_SS_TYPE_MAX);
if (EffectSs_FindSlot(priority, &index) != 0) {
// Abort because we couldn't find a suitable slot to add this effect in

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include "z64elf_message.h"
#include <assert.h>
ElfMessage sChildSariaMsgs[] = {
ELF_MSG_STRENGTH_UPG(SKIP, 3, false, 0),
@@ -59,7 +60,7 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) {
}
LOG_STRING("企画外 条件"); // "Unplanned conditions"
ASSERT(0);
assert(0);
return false;
}
@@ -142,7 +143,7 @@ u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) {
return msg->byte2 | 0x100;
default:
LOG_STRING("企画外 条件"); // "Unplanned conditions"
ASSERT(0);
assert(0);
}
msg++;
}

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include <assert.h>
void SkelCurve_Clear(SkelAnimeCurve* skelCurve) {
skelCurve->limbCount = 0;
@@ -24,7 +25,7 @@ s32 SkelCurve_Init(PlayState* play, SkelAnimeCurve* skelCurve, SkelCurveLimbList
skelCurve->limbList = SEGMENTED_TO_VIRTUAL(limbList->limbs);
skelCurve->transforms = ZELDA_ARENA_MALLOC_DEBUG(sizeof(*skelCurve->transforms) * skelCurve->limbCount);
ASSERT(skelCurve->transforms != NULL);
assert(skelCurve->transforms != NULL);
skelCurve->animCurFrame = 0.0f;
return 1;
}

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include "vt.h"
#include <assert.h>
s32 func_8006CFC0(s32 scene) {
s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 };
@@ -52,7 +53,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
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, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
@@ -70,7 +71,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
} else if ((gSaveContext.entranceIndex == 1230) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) {
Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1, true);
ASSERT(horseActor != NULL);
assert(horseActor != NULL);
} else if ((play->sceneNum == gSaveContext.horseData.scene) &&
(((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) != 0) && (!gSaveContext.n64ddFlag ||
(gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) &&
@@ -83,7 +84,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE,
gSaveContext.horseData.pos.x, gSaveContext.horseData.pos.y,
gSaveContext.horseData.pos.z, 0, gSaveContext.horseData.angle, 0, 1, true);
ASSERT(horseActor != NULL);
assert(horseActor != NULL);
if (play->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
}
@@ -97,7 +98,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
} else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1, true);
ASSERT(horseActor != NULL);
assert(horseActor != NULL);
} else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) {
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
HorseSpawn* horseSpawn = &horseSpawns[i];
@@ -105,7 +106,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type, true);
ASSERT(horseActor != NULL);
assert(horseActor != NULL);
if (play->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
}
@@ -155,7 +156,7 @@ void func_8006D684(PlayState* play, Player* player) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
spawnPos.z, 0, player->actor.world.rot.y, 0, 7, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
@@ -164,7 +165,7 @@ void func_8006D684(PlayState* play, Player* player) {
(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) == 0) && (DREG(1) == 0)) {
player->rideActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
@@ -194,7 +195,7 @@ void func_8006D684(PlayState* play, Player* player) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, 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, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
@@ -209,7 +210,7 @@ void func_8006D684(PlayState* play, Player* player) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, 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, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
player->actor.world.pos.x = D_8011F9B8[i].pos.x;
player->actor.world.pos.y = D_8011F9B8[i].pos.y;

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include "vt.h"
#include <assert.h>
#define MARKER_ESCAPE 0x00
#define MARKER_SOI 0xD8
@@ -250,7 +251,7 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) {
time = osGetTime();
// (?) I guess MB_SIZE=0x180, PROC_OF_MBS=5 which means data is not a part of JpegWork
ASSERT(workSize >= sizeof(JpegWork));
assert(workSize >= sizeof(JpegWork));
osCreateMesgQueue(&ctx.mq, &ctx.msg, 1);
MsgEvent_SendNullTask();

View File

@@ -214,6 +214,11 @@ LightInfo sSGameOverLightInfo;
u8 sGameOverLightsIntensity;
u16 D_8015FDB0;
void LoadSkyboxPalette(SkyboxContext* skyboxCtx, int paletteIndex, char* palTex, int width,
int height);
void LoadSkyboxTex(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height, int offsetW, int offsetH);
void Skybox_Update(SkyboxContext* skyboxCtx);
s32 func_8006F0A0(s32 a0) {
s32 ret = ((a0 >> 4 & 0x7FF) << D_8011FAF0[a0 >> 15 & 7].unk_00) + D_8011FAF0[a0 >> 15 & 7].unk_04;

View File

@@ -4,6 +4,7 @@
#include "textures/parameter_static/parameter_static.h"
#include "textures/map_i_static/map_i_static.h"
#include "textures/map_grand_static/map_grand_static.h"
#include <assert.h>
MapData* gMapData;
@@ -527,7 +528,7 @@ void Map_Init(PlayState* play) {
// " texture initialization scene_data_ID=%d mapSegment=%x"
osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneNum,
interfaceCtx->mapSegment, play);
ASSERT(interfaceCtx->mapSegment != NULL);
assert(interfaceCtx->mapSegment != NULL);
switch (play->sceneNum) {
case SCENE_SPOT00:

View File

@@ -8,6 +8,8 @@
#include "textures/message_static/message_static.h"
#include "textures/message_texture_static/message_texture_static.h"
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/OTRGlobals.h"
s16 sTextFade = false; // original name: key_off_flag ?

View File

@@ -6,6 +6,7 @@
#include "soh_assets.h"
#include "soh/Enhancements/randomizer/adult_trade_shuffle.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include "libultraship/bridge.h"
#include "soh/Enhancements/gameplaystats.h"
#include "soh/Enhancements/boss-rush/BossRushTypes.h"
@@ -13,15 +14,13 @@
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
#include "soh/Enhancements/enhancementTypes.h"
#ifdef _MSC_VER
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#endif
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/randomizer_grotto.h"
#define DO_ACTION_TEX_WIDTH() 48
#define DO_ACTION_TEX_HEIGHT() 16

View File

@@ -10,10 +10,12 @@
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include <overlays/actors/ovl_En_Niw/z_en_niw.h>
#include "soh/Enhancements/enhancementTypes.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include <libultraship/libultraship.h>
#include <time.h>
#include <assert.h>
void* D_8012D1F0 = NULL;
//UNK_TYPE D_8012D1F4 = 0; // unused
@@ -33,12 +35,17 @@ PlayState* gPlayState;
s16 gEnPartnerId;
void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn);
void enableBetaQuest();
void disableBetaQuest();
void func_800BC450(PlayState* play) {
Camera_ChangeDataIdx(GET_ACTIVE_CAM(play), play->unk_1242B - 1);
}
void func_800BC490(PlayState* play, s16 point) {
ASSERT(point == 1 || point == 2);
assert(point == 1 || point == 2);
play->unk_1242B = point;

View File

@@ -8,6 +8,8 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include <stdlib.h>
typedef struct {
/* 0x00 */ u8 flag;
/* 0x02 */ u16 textId;
@@ -1712,6 +1714,7 @@ s32 func_80091880(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
}
#include <overlays/actors/ovl_Demo_Effect/z_demo_effect.h>
void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play);
void Pause_DrawTriforceSpot(PlayState* play, s32 showLightColumn) {
static DemoEffect triforce;

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include <assert.h>
Gfx sSetupDL[SETUPDL_MAX][6] = {
{
@@ -852,7 +853,7 @@ Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far) {
far++;
}
ASSERT(near != far);
assert(near != far);
gDPSetFogColor(gfx++, r, g, b, a);
@@ -873,7 +874,7 @@ Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far)
if (far == near) {
far++;
}
ASSERT(near != far);
assert(near != far);
gDPPipeSync(gfx++);
gDPSetFogColor(gfx++, r, g, b, a);

View File

@@ -5,6 +5,8 @@
#include "global.h"
#include "vt.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include <string.h>
#include <assert.h>
void func_80095AB4(PlayState* play, Room* room, u32 flags);
void func_80095D04(PlayState* play, Room* room, u32 flags);
@@ -27,6 +29,9 @@ Gfx D_801270B0[] = {
gsSPEndDisplayList(),
};
s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum);
s32 OTRfunc_800973FC(PlayState* play, RoomContext* roomCtx);
void (*sRoomDrawHandlers[])(PlayState* play, Room* room, u32 flags) = {
func_80095AB4,
func_80096F6C,
@@ -122,7 +127,7 @@ void func_80095D04(PlayState* play, Room* room, u32 flags) {
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start);
spA4 = spB8;
ASSERT(polygon2->num <= SHAPE_SORT_MAX);
assert(polygon2->num <= SHAPE_SORT_MAX);
sp78 = polygonDlist;
for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) {
@@ -586,7 +591,7 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
roomCtx->curRoom.segment = NULL;
roomCtx->status = 1;
ASSERT(roomNum < play->numRooms);
assert(roomNum < play->numRooms);
size = play->roomList[roomNum].vromEnd - play->roomList[roomNum].vromStart;
roomCtx->unk_34 = (void*)ALIGN16((intptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
@@ -629,7 +634,7 @@ void Room_Draw(PlayState* play, Room* room, u32 flags) {
if (room->segment != NULL)
{
gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
ASSERT(room->meshHeader->base.type < ARRAY_COUNTU(sRoomDrawHandlers));
assert(room->meshHeader->base.type < ARRAY_COUNTU(sRoomDrawHandlers));
sRoomDrawHandlers[room->meshHeader->base.type](play, room, flags);
}
}

View File

@@ -1,6 +1,7 @@
#include "global.h"
#include "vt.h"
#include "soh/ActorDB.h"
#include <assert.h>
RomFile sNaviMsgFiles[];
@@ -15,7 +16,7 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) {
osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (uintptr_t)objectCtx->status[objectCtx->num].segment + size,
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)));
DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size,
@@ -153,7 +154,7 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) {
nextPtr = (void*)ALIGN16((uintptr_t)status->segment + size);
ASSERT(nextPtr < objectCtx->spaceEnd);
assert(nextPtr < objectCtx->spaceEnd);
// "Object exchange free size=%08x"
osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (uintptr_t)objectCtx->spaceEnd - (uintptr_t)nextPtr);
@@ -284,7 +285,7 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) {
status++;
}
ASSERT(cmd->objectList.num <= OBJECT_EXCHANGE_BANK_MAX);
assert(cmd->objectList.num <= OBJECT_EXCHANGE_BANK_MAX);
while (k < cmd->objectList.num) {
nextPtr = func_800982FC(&play->objectCtx, i, *objectEntry);

View File

@@ -1,5 +1,8 @@
#include "global.h"
#include "vt.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#define ANIM_INTERP 1
@@ -865,7 +868,7 @@ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animati
char animPath[2048];
sprintf(animPath, "misc/link_animetion/gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000)));
snprintf(animPath, sizeof(animPath), "misc/link_animetion/gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000)));
//printf("Streaming %s, seg = %08X\n", animPath, linkAnimHeader->segment);
@@ -1108,7 +1111,7 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade
skelAnime->jointTable = ZELDA_ARENA_MALLOC_DEBUG(allocSize);
skelAnime->morphTable = ZELDA_ARENA_MALLOC_DEBUG(allocSize);
} else {
ASSERT(limbBufCount == limbCount);
assert(limbBufCount == limbCount);
skelAnime->jointTable = (Vec3s*)ALIGN16((uintptr_t)jointTable);
skelAnime->morphTable = (Vec3s*)ALIGN16((uintptr_t)morphTable);
@@ -1441,7 +1444,7 @@ s32 SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skelet
skelAnime->morphTable =
ZELDA_ARENA_MALLOC_DEBUG(skelAnime->limbCount * sizeof(*skelAnime->morphTable));
} else {
ASSERT(limbCount == skelAnime->limbCount);
assert(limbCount == skelAnime->limbCount);
skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable;
}
@@ -1477,7 +1480,7 @@ s32 SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader
skelAnime->morphTable =
ZELDA_ARENA_MALLOC_DEBUG(skelAnime->limbCount * sizeof(*skelAnime->morphTable));
} else {
ASSERT(limbCount == skelAnime->limbCount);
assert(limbCount == skelAnime->limbCount);
skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable;
}

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
#include <assert.h>
/**
* Initialises the Vtx buffers used for limb at index `limbIndex`
@@ -53,7 +54,7 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim
skin->vtxTable = ZELDA_ARENA_MALLOC_DEBUG(limbCount * sizeof(SkinLimbVtx));
ASSERT(skin->vtxTable != NULL);
assert(skin->vtxTable != NULL);
for (i = 0; i < limbCount; i++) {
SkinLimbVtx* vtxEntry = &skin->vtxTable[i];
@@ -71,11 +72,11 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim
vtxEntry->buf[0] =
ZELDA_ARENA_MALLOC_DEBUG(animatedLimbData->totalVtxCount * sizeof(Vtx));
ASSERT(vtxEntry->buf[0] != NULL);
assert(vtxEntry->buf[0] != NULL);
vtxEntry->buf[1] =
ZELDA_ARENA_MALLOC_DEBUG(animatedLimbData->totalVtxCount * sizeof(Vtx));
ASSERT(vtxEntry->buf[1] != NULL);
assert(vtxEntry->buf[1] != NULL);
Skin_InitAnimatedLimb(play, skin, i);
}

View File

@@ -8,6 +8,8 @@
#define NUM_DUNGEONS 8
#define NUM_COWS 10
void Save_LoadFile(void);
/**
* Initialize new save.
* This save has an empty inventory with 3 hearts and single magic.

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <math.h>
#include <assert.h>
#include "soh/frame_interpolation.h"
@@ -176,10 +177,10 @@ void func_800AA550(View* view) {
lrx = view->viewport.rightX - varX;
lry = view->viewport.bottomY - varY;
ASSERT(ulx >= 0);
ASSERT(uly >= 0);
ASSERT(lrx <= SCREEN_WIDTH);
ASSERT(lry <= SCREEN_HEIGHT);
assert(ulx >= 0);
assert(uly >= 0);
assert(lrx <= SCREEN_WIDTH);
assert(lry <= SCREEN_HEIGHT);
OPEN_DISPS(gfxCtx);

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include <string.h>
#include <assert.h>
// (Note: 80 = SCREEN_HEIGHT/3, see VisMono_DrawTexture)
// This may not have been kept up-to-date with the code, 1+1+1+80*(7+2+2+3)+1+1 makes more sense
@@ -101,7 +102,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("(1+3+1+1+80*(7+2+2+3)+1)", DLSIZE);
}
ASSERT(glistpEnd <= monoDL + DLSIZE);
assert(glistpEnd <= monoDL + DLSIZE);
}
gDPPipeSync(gfx++);
@@ -131,6 +132,6 @@ void VisMono_DrawOld(VisMono* this) {
if (!this->monoDl) {
this->monoDl = SYSTEM_ARENA_MALLOC_DEBUG(DLSIZE * sizeof(Gfx));
glistpEnd = VisMono_DrawTexture(this, this->monoDl);
ASSERT(glistpEnd <= this->monoDl + DLSIZE);
assert(glistpEnd <= this->monoDl + DLSIZE);
}
}

View File

@@ -2,6 +2,7 @@
#include "vt.h"
#include <stdlib.h>
#include <assert.h>
#include "z64environment.h"
#include "assets/textures/backgrounds/vr_ALVR_static.h"
@@ -961,24 +962,24 @@ void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) {
if (skyboxCtx->unk_140 != 0) {
skyboxCtx->dListBuf = GAMESTATE_ALLOC_MC(state, 8 * 150 * sizeof(Gfx));
ASSERT(skyboxCtx->dListBuf != NULL);
assert(skyboxCtx->dListBuf != NULL);
skyboxCtx->roomVtx = GAMESTATE_ALLOC_MC(state, 256 * sizeof(Vtx));
ASSERT(skyboxCtx->roomVtx != NULL);
assert(skyboxCtx->roomVtx != NULL);
func_800AEFC8(skyboxCtx, skyboxId);
} else {
skyboxCtx->dListBuf = GAMESTATE_ALLOC_MC(state, 12 * 150 * sizeof(Gfx));
ASSERT(skyboxCtx->dListBuf != NULL);
assert(skyboxCtx->dListBuf != NULL);
if (skyboxId == SKYBOX_CUTSCENE_MAP) {
skyboxCtx->roomVtx = GAMESTATE_ALLOC_MC(state, 192 * sizeof(Vtx));
ASSERT(skyboxCtx->roomVtx != NULL);
assert(skyboxCtx->roomVtx != NULL);
func_800AF178(skyboxCtx, 6);
} else {
skyboxCtx->roomVtx = GAMESTATE_ALLOC_MC(state, 160 * sizeof(Vtx));
ASSERT(skyboxCtx->roomVtx != NULL);
assert(skyboxCtx->roomVtx != NULL);
func_800AF178(skyboxCtx, 5);
}