Merge remote-tracking branch 'origin/develop' into mergeSuluBravo
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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...
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
#include "soh/Enhancements/audio/AudioEditor.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 sfxId;
|
||||
/* 0x04 */ Vec3f* pos;
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -340,13 +340,13 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
gSaveContext.eventChkInf[6] |= 0x0020;
|
||||
Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL);
|
||||
break;
|
||||
case 20:
|
||||
gSaveContext.eventChkInf[6] |= 0x0080;
|
||||
Flags_SetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO);
|
||||
break;
|
||||
case 21:
|
||||
gSaveContext.eventChkInf[6] |= 0x0200;
|
||||
Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER);
|
||||
break;
|
||||
case 22:
|
||||
D_801614B0.r = 255;
|
||||
@@ -624,8 +624,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
gSaveContext.fw.set = 0;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
|
||||
}
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x20)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x20;
|
||||
if (!Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) {
|
||||
Flags_SetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL);
|
||||
play->nextEntranceIndex = 0x00A0;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
gSaveContext.cutsceneIndex = 0xFFF3;
|
||||
@@ -697,7 +697,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
play->fadeTransition = 3;
|
||||
break;
|
||||
case 18:
|
||||
gSaveContext.eventChkInf[4] |= 0x8000;
|
||||
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER);
|
||||
play->nextEntranceIndex = 0x0324;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
play->fadeTransition = 2;
|
||||
@@ -842,14 +842,14 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
play->fadeTransition = 17;
|
||||
break;
|
||||
case 46:
|
||||
gSaveContext.eventChkInf[4] |= 0x8000;
|
||||
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER);
|
||||
play->nextEntranceIndex = 0x0324;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
play->fadeTransition = 4;
|
||||
break;
|
||||
case 47:
|
||||
Item_Give(play, ITEM_SONG_NOCTURNE);
|
||||
gSaveContext.eventChkInf[5] |= 0x10;
|
||||
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW);
|
||||
play->nextEntranceIndex = 0x00DB;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
gSaveContext.cutsceneIndex = 0xFFF1;
|
||||
@@ -1077,8 +1077,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
play->fadeTransition = 3;
|
||||
break;
|
||||
case 95:
|
||||
if ((gSaveContext.eventChkInf[4] & 0x100) && (gSaveContext.eventChkInf[4] & 0x200) &&
|
||||
(gSaveContext.eventChkInf[4] & 0x400)) {
|
||||
if ((Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) &&
|
||||
(Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP))) {
|
||||
play->nextEntranceIndex = 0x0053;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
gSaveContext.cutsceneIndex = 0xFFF3;
|
||||
@@ -1111,7 +1111,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
gSaveContext.cutsceneIndex = 0xFFF1;
|
||||
play->fadeTransition = 5;
|
||||
} else {
|
||||
gSaveContext.eventChkInf[12] |= 0x100;
|
||||
Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION);
|
||||
play->nextEntranceIndex = 0x0610;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
play->fadeTransition = 3;
|
||||
@@ -1233,8 +1233,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
play->fadeTransition = 2;
|
||||
break;
|
||||
case 113:
|
||||
if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) &&
|
||||
Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) {
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FOREST_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_WATER_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SHADOW_TRIAL) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FIRE_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_LIGHT_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SPIRIT_TRIAL)) {
|
||||
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTowerBarrierCs);
|
||||
play->csCtx.frames = 0;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
@@ -1257,7 +1257,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
gSaveContext.nextTransitionType = 2;
|
||||
break;
|
||||
case 116:
|
||||
if (gSaveContext.eventChkInf[12] & 0x100) {
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION)) {
|
||||
play->nextEntranceIndex = 0x0580;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
play->fadeTransition = 3;
|
||||
@@ -2152,39 +2152,39 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) {
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
const bool bShouldTowerRandoSkip =
|
||||
(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE));
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) {
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT)) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xAC);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT);
|
||||
gSaveContext.entranceIndex = 0x0123;
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
}
|
||||
} else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (gSaveContext.eventChkInf[4] & 0x0100) &&
|
||||
(gSaveContext.eventChkInf[4] & 0x0200) && (gSaveContext.eventChkInf[4] & 0x0400) &&
|
||||
!Flags_GetEventChkInf(0xAA)) {
|
||||
} else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) &&
|
||||
(Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) &&
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xAA);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL);
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
}
|
||||
} else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(0xC1)) {
|
||||
} else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE)) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xC1);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE);
|
||||
Item_Give(play, ITEM_OCARINA_FAIRY);
|
||||
gSaveContext.entranceIndex = 0x011E;
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
}
|
||||
} else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
||||
LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) &&
|
||||
LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) &&
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA)) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(0xC4);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS);
|
||||
gSaveContext.entranceIndex = 0x0053;
|
||||
gSaveContext.cutsceneIndex = 0xFFF8;
|
||||
}
|
||||
} else if ((!Flags_GetEventChkInf(0xC7) &&
|
||||
} else if ((!Flags_GetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO) &&
|
||||
gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO) ||
|
||||
(bShouldTowerRandoSkip &&
|
||||
gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_FINAL)) {
|
||||
Flags_SetEventChkInf(0xC7);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO);
|
||||
gSaveContext.entranceIndex = 0x0517;
|
||||
// In rando, skip the cutscene for the tower falling down after the escape.
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 };
|
||||
@@ -47,12 +48,12 @@ void func_8006D0EC(PlayState* play, Player* player) {
|
||||
{ SCENE_SPOT20, 928, 0, -2280, 0, 2 },
|
||||
};
|
||||
|
||||
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
|
||||
if ((AREG(6) != 0) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0))) {
|
||||
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, player->actor.world.pos.x,
|
||||
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x,
|
||||
player->actor.shape.rot.y, player->actor.shape.rot.z, 9, true);
|
||||
|
||||
ASSERT(player->rideActor != NULL);
|
||||
assert(player->rideActor != NULL);
|
||||
|
||||
Actor_MountHorse(play, player, player->rideActor);
|
||||
func_8002DE74(play, player);
|
||||
@@ -67,23 +68,23 @@ void func_8006D0EC(PlayState* play, Player* player) {
|
||||
horseActor =
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1, true);
|
||||
horseActor->room = -1;
|
||||
} else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) {
|
||||
} 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(0x18) != 0) && (!gSaveContext.n64ddFlag ||
|
||||
(((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) != 0) && (!gSaveContext.n64ddFlag ||
|
||||
(gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) &&
|
||||
(INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE)))) || DREG(1) != 0)) {
|
||||
// "Set by existence of horse %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(0x18),
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED),
|
||||
DREG(1));
|
||||
|
||||
if (func_8006CFC0(gSaveContext.horseData.scene)) {
|
||||
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;
|
||||
}
|
||||
@@ -94,18 +95,18 @@ void func_8006D0EC(PlayState* play, Player* player) {
|
||||
osSyncPrintf(VT_RST);
|
||||
func_8006D074(play);
|
||||
}
|
||||
} else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
|
||||
} 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);
|
||||
} else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
|
||||
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];
|
||||
if (horseSpawn->scene == play->sceneNum) {
|
||||
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;
|
||||
}
|
||||
@@ -113,7 +114,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (!Flags_GetEventChkInf(0x18)) {
|
||||
} else if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) {
|
||||
if ((DREG(1) == 0) && (play->sceneNum == SCENE_SOUKO) && !IS_DAY) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1, true);
|
||||
}
|
||||
@@ -155,16 +156,16 @@ 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);
|
||||
gSaveContext.horseData.scene = play->sceneNum;
|
||||
} else if ((play->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
|
||||
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
|
||||
(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;
|
||||
@@ -252,7 +253,7 @@ void func_8006DC68(PlayState* play, Player* player) {
|
||||
gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) &&
|
||||
(gSaveContext.respawnFlag == 0)) ||
|
||||
((play->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
|
||||
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) {
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0))) {
|
||||
func_8006D684(play, player);
|
||||
} else {
|
||||
func_8006D0EC(play, player);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -2542,19 +2547,19 @@ void Environment_WarpSongLeave(PlayState* play) {
|
||||
|
||||
switch (play->nextEntranceIndex) {
|
||||
case 0x147:
|
||||
Flags_SetEventChkInf(0xB9);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DEATH_MOUNTAIN_CRATER);
|
||||
break;
|
||||
case 0x0102:
|
||||
Flags_SetEventChkInf(0xB1);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_LAKE_HYLIA);
|
||||
break;
|
||||
case 0x0123:
|
||||
Flags_SetEventChkInf(0xB8);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DESERT_COLOSSUS);
|
||||
break;
|
||||
case 0x00E4:
|
||||
Flags_SetEventChkInf(0xB6);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_GRAVEYARD);
|
||||
break;
|
||||
case 0x0053:
|
||||
Flags_SetEventChkInf(0xA7);
|
||||
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_TEMPLE_OF_TIME);
|
||||
break;
|
||||
case 0x00FC:
|
||||
break;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -398,11 +399,11 @@ void Map_InitData(PlayState* play, s16 room) {
|
||||
extendedMapIndex = 0x15;
|
||||
}
|
||||
} else if (play->sceneNum == SCENE_SPOT09) {
|
||||
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !((gSaveContext.eventChkInf[9] & 0xF) == 0xF)) {
|
||||
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
|
||||
extendedMapIndex = 0x16;
|
||||
}
|
||||
} else if (play->sceneNum == SCENE_SPOT12) {
|
||||
if ((!gSaveContext.n64ddFlag && ((gSaveContext.eventChkInf[9] & 0xF) == 0xF)) ||
|
||||
if ((!gSaveContext.n64ddFlag && GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) ||
|
||||
(gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GERUDO_CARD))) {
|
||||
extendedMapIndex = 0x17;
|
||||
}
|
||||
@@ -527,7 +528,7 @@ void Map_Init(PlayState* play) {
|
||||
// "MAP texture initialization scene_data_ID=%d mapSegment=%x"
|
||||
osSyncPrintf("\n\n\nMAP テクスチャ初期化 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:
|
||||
|
||||
@@ -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 ?
|
||||
|
||||
@@ -1616,7 +1618,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
|
||||
textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> 0x1C;
|
||||
} else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_SWORD, 2))) {
|
||||
textId = 0xB; // Traded Giant's Knife for Biggoron Sword
|
||||
} else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xB4 && (gSaveContext.eventChkInf[9] & 0x40))) {
|
||||
} else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xB4 && (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE)))) {
|
||||
textId = 0xB5; // Destroyed Gold Skulltula
|
||||
}
|
||||
// Ocarina Staff + Dialog
|
||||
|
||||
@@ -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
|
||||
@@ -1417,7 +1416,7 @@ void Inventory_SwapAgeEquipment(void) {
|
||||
// When becoming adult, remove swordless flag since we'll get master sword
|
||||
// Only in rando to keep swordless link bugs in vanilla
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
gSaveContext.infTable[29] &= ~1;
|
||||
Flags_UnsetInfTable(INFTABLE_SWORDLESS);
|
||||
}
|
||||
|
||||
gSaveContext.childEquips.equipment = gSaveContext.equips.equipment;
|
||||
@@ -1471,13 +1470,13 @@ void Inventory_SwapAgeEquipment(void) {
|
||||
// When becoming child, set swordless flag if player doesn't have kokiri sword
|
||||
// Only in rando to keep swordless link bugs in vanilla
|
||||
if (gSaveContext.n64ddFlag && (1 << 0 & gSaveContext.inventory.equipment) == 0) {
|
||||
gSaveContext.infTable[29] |= 1;
|
||||
Flags_SetInfTable(INFTABLE_SWORDLESS);
|
||||
}
|
||||
|
||||
// When using enhancements, set swordless flag if player doesn't have kokiri sword or hasn't equipped a sword yet.
|
||||
// Then set the child equips button items to item none to ensure kokiri sword is not equipped
|
||||
if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) && ((1 << 0 & gSaveContext.inventory.equipment) == 0 || gSaveContext.infTable[29] & 1)) {
|
||||
gSaveContext.infTable[29] |= 1;
|
||||
if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) && ((1 << 0 & gSaveContext.inventory.equipment) == 0 || Flags_GetInfTable(INFTABLE_SWORDLESS))) {
|
||||
Flags_SetInfTable(INFTABLE_SWORDLESS);
|
||||
gSaveContext.childEquips.buttonItems[0] = ITEM_NONE;
|
||||
}
|
||||
|
||||
@@ -1512,7 +1511,7 @@ void Inventory_SwapAgeEquipment(void) {
|
||||
gSaveContext.equips.equipment = gSaveContext.childEquips.equipment;
|
||||
gSaveContext.equips.equipment &= 0xFFF0;
|
||||
// Equips kokiri sword in the inventory screen only if kokiri sword exists in inventory and a sword has been equipped already
|
||||
if (!((1 << 0 & gSaveContext.inventory.equipment) == 0) && !(gSaveContext.infTable[29] & 1)) {
|
||||
if (!((1 << 0 & gSaveContext.inventory.equipment) == 0) && !Flags_GetInfTable(INFTABLE_SWORDLESS)) {
|
||||
gSaveContext.equips.equipment |= 0x0001;
|
||||
}
|
||||
} else if (gSaveContext.childEquips.buttonItems[0] != ITEM_NONE) {
|
||||
@@ -1543,7 +1542,7 @@ void Inventory_SwapAgeEquipment(void) {
|
||||
When becoming child, set swordless flag if player doesn't have kokiri sword
|
||||
Only in rando to keep swordless link bugs in vanilla*/
|
||||
if (1 << 0 & gSaveContext.inventory.equipment == 0) {
|
||||
gSaveContext.infTable[29] |= 1;
|
||||
Flags_SetInfTable(INFTABLE_SWORDLESS);
|
||||
}
|
||||
|
||||
//zero out items
|
||||
@@ -1558,7 +1557,7 @@ void Inventory_SwapAgeEquipment(void) {
|
||||
|
||||
if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) &&
|
||||
(gSaveContext.equips.buttonItems[0] == ITEM_NONE)) {
|
||||
gSaveContext.infTable[29] |= 1;
|
||||
Flags_SetInfTable(INFTABLE_SWORDLESS);
|
||||
if (gSaveContext.childEquips.equipment == 0) {
|
||||
// force equip kokiri tunic and boots in scenario gSaveContext.childEquips.equipment is uninitialized
|
||||
gSaveContext.equips.equipment &= 0xFFF0;
|
||||
@@ -1871,53 +1870,16 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
gSaveContext.inventory.equipment |= (gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]);
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
} else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
|
||||
// Boss Key, Compass, and Dungeon Map exceptions for rando.
|
||||
// Rando should never be able to get here for Link's Pocket unless something goes wrong,
|
||||
// but we check for a play here so the game won't crash if we do somehow get here.
|
||||
if (gSaveContext.n64ddFlag && play != NULL) {
|
||||
if (play->sceneNum == 13) { // ganon's castle -> ganon's tower
|
||||
gSaveContext.inventory.dungeonItems[10] |= 1;
|
||||
} else if (play->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
|
||||
gSaveContext.inventory.dungeonItems[6] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
}
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
}
|
||||
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
} else if (item == ITEM_KEY_SMALL) {
|
||||
// Small key exceptions for rando with keysanity off.
|
||||
// Rando should never be able to get here for Link's Pocket unless something goes wrong,
|
||||
// but we check for a play here so the game won't crash if we do somehow get here.
|
||||
if (gSaveContext.n64ddFlag && play != NULL) {
|
||||
if (play->sceneNum == 10) { // ganon's tower -> ganon's castle
|
||||
gSaveContext.sohStats.dungeonKeys[13]++;
|
||||
if (gSaveContext.inventory.dungeonKeys[13] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[13] = 1;
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonKeys[13]++;
|
||||
}
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
}
|
||||
|
||||
if (play->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
|
||||
gSaveContext.sohStats.dungeonKeys[6]++;
|
||||
if (gSaveContext.inventory.dungeonKeys[6] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[6] = 1;
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonKeys[6]++;
|
||||
}
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
}
|
||||
}
|
||||
gSaveContext.sohStats.dungeonKeys[gSaveContext.mapIndex]++;
|
||||
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1;
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
} else {
|
||||
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]++;
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
}
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
} else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) {
|
||||
if (CUR_UPG_VALUE(UPG_QUIVER) == 0) {
|
||||
Inventory_ChangeUpgrade(UPG_QUIVER, 1);
|
||||
@@ -2155,8 +2117,8 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
|
||||
}
|
||||
|
||||
if (!(gSaveContext.itemGetInf[1] & 8)) {
|
||||
gSaveContext.itemGetInf[1] |= 8;
|
||||
if (!Flags_GetItemGetInf(ITEMGETINF_13)) {
|
||||
Flags_SetItemGetInf(ITEMGETINF_13);
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
}
|
||||
|
||||
@@ -2168,8 +2130,8 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
|
||||
}
|
||||
|
||||
if (!(gSaveContext.itemGetInf[1] & 8)) {
|
||||
gSaveContext.itemGetInf[1] |= 8;
|
||||
if (!Flags_GetItemGetInf(ITEMGETINF_13)) {
|
||||
Flags_SetItemGetInf(ITEMGETINF_13);
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
}
|
||||
|
||||
@@ -2245,8 +2207,8 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
func_80087708(play, 12, 5);
|
||||
}
|
||||
|
||||
if (!(gSaveContext.infTable[25] & 0x100)) {
|
||||
gSaveContext.infTable[25] |= 0x100;
|
||||
if (!Flags_GetInfTable(INFTABLE_198)) {
|
||||
Flags_SetInfTable(INFTABLE_198);
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
}
|
||||
|
||||
@@ -2261,8 +2223,8 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
func_80087708(play, 24, 5);
|
||||
}
|
||||
|
||||
if (!(gSaveContext.infTable[25] & 0x100)) {
|
||||
gSaveContext.infTable[25] |= 0x100;
|
||||
if (!Flags_GetInfTable(INFTABLE_198)) {
|
||||
Flags_SetInfTable(INFTABLE_198);
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
}
|
||||
|
||||
@@ -2321,7 +2283,7 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
return Return_Item(item, MOD_NONE, ITEM_NONE);
|
||||
} else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) {
|
||||
if ((item == ITEM_SAW) && CVarGetInteger("gDekuNutUpgradeFix", 0) == 0) {
|
||||
gSaveContext.itemGetInf[1] |= 0x8000;
|
||||
Flags_SetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE);
|
||||
}
|
||||
|
||||
if (item >= ITEM_POCKET_EGG) {
|
||||
@@ -2670,7 +2632,7 @@ u8 Item_CheckObtainability(u8 item) {
|
||||
} else if (item == ITEM_LONGSHOT) {
|
||||
return ITEM_NONE;
|
||||
} else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30)) {
|
||||
if (!(gSaveContext.itemGetInf[1] & 0x8)) {
|
||||
if (!Flags_GetItemGetInf(ITEMGETINF_13)) {
|
||||
return ITEM_NONE;
|
||||
} else {
|
||||
return ITEM_SEEDS;
|
||||
@@ -2685,8 +2647,8 @@ u8 Item_CheckObtainability(u8 item) {
|
||||
return ITEM_HEART;
|
||||
} else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE)) {
|
||||
// "Magic Pot Get_Inf_Table( 25, 0x0100)=%d"
|
||||
osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", gSaveContext.infTable[25] & 0x100);
|
||||
if (!(gSaveContext.infTable[25] & 0x100)) {
|
||||
osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", Flags_GetInfTable(INFTABLE_198));
|
||||
if (!Flags_GetInfTable(INFTABLE_198)) {
|
||||
return ITEM_NONE;
|
||||
} else {
|
||||
return item;
|
||||
@@ -3644,6 +3606,178 @@ void Interface_DrawMagicBar(PlayState* play) {
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
static Vtx sEnemyHealthVtx[16];
|
||||
static Mtx sEnemyHealthMtx[2];
|
||||
|
||||
// Build vertex coordinates for a quad command
|
||||
// In order of top left, top right, bottom left, then bottom right
|
||||
// Supports flipping the texture horizontally
|
||||
void Interface_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH) {
|
||||
vtxList[0].v.ob[0] = xStart;
|
||||
vtxList[0].v.ob[1] = yStart;
|
||||
vtxList[0].v.tc[0] = (flippedH ? width : 0) << 5;
|
||||
vtxList[0].v.tc[1] = 0 << 5;
|
||||
|
||||
vtxList[1].v.ob[0] = xStart + width;
|
||||
vtxList[1].v.ob[1] = yStart;
|
||||
vtxList[1].v.tc[0] = (flippedH ? width * 2 : width) << 5;
|
||||
vtxList[1].v.tc[1] = 0 << 5;
|
||||
|
||||
vtxList[2].v.ob[0] = xStart;
|
||||
vtxList[2].v.ob[1] = yStart + height;
|
||||
vtxList[2].v.tc[0] = (flippedH ? width : 0) << 5;
|
||||
vtxList[2].v.tc[1] = height << 5;
|
||||
|
||||
vtxList[3].v.ob[0] = xStart + width;
|
||||
vtxList[3].v.ob[1] = yStart + height;
|
||||
vtxList[3].v.tc[0] = (flippedH ? width * 2 : width) << 5;
|
||||
vtxList[3].v.tc[1] = height << 5;
|
||||
}
|
||||
|
||||
// Draws an enemy health bar using the magic bar textures and positions it in a similar way to Z-Targeting
|
||||
void Interface_DrawEnemyHealthBar(TargetContext* targetCtx, PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
Player* player = GET_PLAYER(play);
|
||||
Actor* actor = targetCtx->targetedActor;
|
||||
|
||||
Vec3f projTargetCenter;
|
||||
f32 projTargetCappedInvW;
|
||||
|
||||
Color_RGBA8 healthbar_red = { 255, 0, 0, 255 };
|
||||
Color_RGBA8 healthbar_border = { 255, 255, 255, 255 };
|
||||
s16 healthbar_fillWidth = 64;
|
||||
s16 healthbar_actorOffset = 40;
|
||||
s32 healthbar_offsetX = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarPosX", 0);
|
||||
s32 healthbar_offsetY = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarPosY", 0);
|
||||
s8 anchorType = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarPosType", ENEMYHEALTH_ANCHOR_ACTOR);
|
||||
|
||||
if (CVarGetInteger("gCosmetics.Hud_EnemyHealthBar.Changed", 0)) {
|
||||
healthbar_red = CVarGetColor("gCosmetics.Hud_EnemyHealthBar.Value", healthbar_red);
|
||||
}
|
||||
if (CVarGetInteger("gCosmetics.Hud_EnemyHealthBorder.Changed", 0)) {
|
||||
healthbar_border = CVarGetColor("gCosmetics.Hud_EnemyHealthBorder.Value", healthbar_border);
|
||||
}
|
||||
if (CVarGetInteger("gCosmetics.Hud_EnemyHealthBarWidth.Changed", 0)) {
|
||||
healthbar_fillWidth = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarWidth.Value", healthbar_fillWidth);
|
||||
}
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if (targetCtx->unk_48 != 0 && actor != NULL && actor->category == ACTORCAT_ENEMY) {
|
||||
s16 texHeight = 16;
|
||||
s16 endTexWidth = 8;
|
||||
f32 scaleY = -0.75f;
|
||||
f32 scaledHeight = -texHeight * scaleY;
|
||||
f32 halfBarWidth = endTexWidth + ((f32)healthbar_fillWidth / 2);
|
||||
s16 healthBarFill = ((f32)actor->colChkInfo.health / actor->maximumHealth) * healthbar_fillWidth;
|
||||
|
||||
if (anchorType == ENEMYHEALTH_ANCHOR_ACTOR) {
|
||||
// Get actor projected position
|
||||
func_8002BE04(play, &targetCtx->targetCenterPos, &projTargetCenter, &projTargetCappedInvW);
|
||||
|
||||
projTargetCenter.x = (SCREEN_WIDTH / 2) * (projTargetCenter.x * projTargetCappedInvW);
|
||||
projTargetCenter.x = projTargetCenter.x * (CVarGetInteger("gMirroredWorld", 0) ? -1 : 1);
|
||||
projTargetCenter.x = CLAMP(projTargetCenter.x, (-SCREEN_WIDTH / 2) + halfBarWidth,
|
||||
(SCREEN_WIDTH / 2) - halfBarWidth);
|
||||
|
||||
projTargetCenter.y = (SCREEN_HEIGHT / 2) * (projTargetCenter.y * projTargetCappedInvW);
|
||||
projTargetCenter.y = projTargetCenter.y - healthbar_offsetY + healthbar_actorOffset;
|
||||
projTargetCenter.y = CLAMP(projTargetCenter.y, (-SCREEN_HEIGHT / 2) + (scaledHeight / 2),
|
||||
(SCREEN_HEIGHT / 2) - (scaledHeight / 2));
|
||||
} else if (anchorType == ENEMYHEALTH_ANCHOR_TOP) {
|
||||
projTargetCenter.x = healthbar_offsetX;
|
||||
projTargetCenter.y = (SCREEN_HEIGHT / 2) - (scaledHeight / 2) - healthbar_offsetY;
|
||||
} else if (anchorType == ENEMYHEALTH_ANCHOR_BOTTOM) {
|
||||
projTargetCenter.x = healthbar_offsetX;
|
||||
projTargetCenter.y = (-SCREEN_HEIGHT / 2) + (scaledHeight / 2) - healthbar_offsetY;
|
||||
}
|
||||
|
||||
// Health bar border end left
|
||||
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[0], -floorf(halfBarWidth), -texHeight / 2, endTexWidth, texHeight, 0);
|
||||
// Health bar border middle
|
||||
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[4], -floorf(halfBarWidth) + endTexWidth, -texHeight / 2,
|
||||
healthbar_fillWidth, texHeight, 0);
|
||||
// Health bar border end right
|
||||
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[8], ceilf(halfBarWidth) - endTexWidth, -texHeight / 2, endTexWidth,
|
||||
texHeight, 1);
|
||||
// Health bar fill
|
||||
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[12], -floorf(halfBarWidth) + endTexWidth, (-texHeight / 2) + 3,
|
||||
healthBarFill, 7, 0);
|
||||
|
||||
if (((!(player->stateFlags1 & 0x40)) || (actor != player->unk_664)) && targetCtx->unk_44 < 500.0f) {
|
||||
f32 slideInOffsetY = 0;
|
||||
|
||||
// Slide in the health bar from edge of the screen (mimic the Z-Target triangles fly in)
|
||||
if (anchorType == ENEMYHEALTH_ANCHOR_ACTOR && targetCtx->unk_44 > 120.0f) {
|
||||
slideInOffsetY = (targetCtx->unk_44 - 120.0f) / 2;
|
||||
// Slide in from the top if the bar is placed on the top half of the screen
|
||||
if (healthbar_offsetY - healthbar_actorOffset <= 0) {
|
||||
slideInOffsetY *= -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Setup DL for overlay disp
|
||||
Gfx_SetupDL_39Overlay(play->state.gfxCtx);
|
||||
|
||||
Matrix_Translate(projTargetCenter.x, projTargetCenter.y - slideInOffsetY, 0, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, scaleY, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_ToMtx(&sEnemyHealthMtx[0], __FILE__, __LINE__);
|
||||
gSPMatrix(OVERLAY_DISP++, &sEnemyHealthMtx[0], G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
// Health bar border
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, healthbar_border.r, healthbar_border.g, healthbar_border.b,
|
||||
healthbar_border.a);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255);
|
||||
|
||||
gSPVertex(OVERLAY_DISP++, sEnemyHealthVtx, 16, 0);
|
||||
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, endTexWidth, texHeight, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
|
||||
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterMidTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, texHeight, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 4, 6, 7, 5, 0);
|
||||
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, endTexWidth, texHeight, 0,
|
||||
G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOLOD);
|
||||
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 8, 10, 11, 9, 0);
|
||||
|
||||
// Health bar fill
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-0.375f, -0.5f, 0, MTXMODE_APPLY);
|
||||
Matrix_ToMtx(&sEnemyHealthMtx[1], __FILE__, __LINE__);
|
||||
gSPMatrix(OVERLAY_DISP++, &sEnemyHealthMtx[1], G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE,
|
||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, healthbar_red.r, healthbar_red.g, healthbar_red.b, healthbar_red.a);
|
||||
|
||||
gDPLoadMultiBlock_4b(OVERLAY_DISP++, gMagicMeterFillTex, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, texHeight, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
gSPVertex(OVERLAY_DISP++, &sEnemyHealthVtx[12], 4, 0);
|
||||
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
|
||||
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void func_80088AA0(s16 arg0) {
|
||||
gSaveContext.timerX[1] = 140;
|
||||
gSaveContext.timerY[1] = 80;
|
||||
@@ -5097,6 +5231,11 @@ void Interface_Draw(PlayState* play) {
|
||||
if (CVarGetInteger("gMirroredWorld", 0)) {
|
||||
gSPMatrix(OVERLAY_DISP++, interfaceCtx->view.projectionPtr, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
}
|
||||
|
||||
// Render enemy health bar after Z-target to leverage set variables
|
||||
if (CVarGetInteger("gEnemyHealthBar", 0)) {
|
||||
Interface_DrawEnemyHealthBar(&play->actorCtx.targetCtx, play);
|
||||
}
|
||||
}
|
||||
|
||||
Gfx_SetupDL_39Overlay(play->state.gfxCtx);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -234,7 +241,7 @@ void GivePlayerRandoRewardNocturne(PlayState* play, RandomizerCheck check) {
|
||||
gSaveContext.entranceIndex == 0x0191 ||
|
||||
gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
|
||||
CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL &&
|
||||
!Player_InBlockingCsMode(play, player) && !Flags_GetEventChkInf(0xAA)) {
|
||||
!Player_InBlockingCsMode(play, player) && !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW);
|
||||
GiveItemEntryWithoutActor(play, getItemEntry);
|
||||
player->pendingFlag.flagID = 0xAA;
|
||||
@@ -246,7 +253,7 @@ void GivePlayerRandoRewardRequiem(PlayState* play, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL &&
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT) && player != NULL &&
|
||||
!Player_InBlockingCsMode(play, player)) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
|
||||
GiveItemEntryWithoutActor(play, getItemEntry);
|
||||
@@ -433,7 +440,7 @@ void GivePlayerRandoRewardSariaGift(PlayState* play, RandomizerCheck check) {
|
||||
if (gSaveContext.entranceIndex == 0x05E0) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY);
|
||||
|
||||
if (!Flags_GetEventChkInf(0xC1) && player != NULL && !Player_InBlockingCsMode(play, player)) {
|
||||
if (!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE) && player != NULL && !Player_InBlockingCsMode(play, player)) {
|
||||
GiveItemEntryWithoutActor(play, getItemEntry);
|
||||
player->pendingFlag.flagType = FLAG_EVENT_CHECK_INF;
|
||||
player->pendingFlag.flagID = 0xC1;
|
||||
@@ -462,7 +469,7 @@ void Play_Init(GameState* thisx) {
|
||||
// entranceIndex 0x7A, Castle Courtyard - Day from crawlspace
|
||||
// entranceIndex 0x400, Zelda's Courtyard
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) &&
|
||||
!(gSaveContext.eventChkInf[4] & 1) && !(gSaveContext.eventChkInf[5] & 0x200)) {
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY)) {
|
||||
if (gSaveContext.entranceIndex == 0x7A) {
|
||||
gSaveContext.entranceIndex = 0x400;
|
||||
}
|
||||
@@ -560,7 +567,7 @@ void Play_Init(GameState* thisx) {
|
||||
}
|
||||
} else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT04) && LINK_IS_ADULT &&
|
||||
gSaveContext.sceneSetupIndex < 4) {
|
||||
gSaveContext.sceneSetupIndex = (gSaveContext.eventChkInf[4] & 0x100) ? 3 : 2;
|
||||
gSaveContext.sceneSetupIndex = (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) ? 3 : 2;
|
||||
}
|
||||
|
||||
Play_SpawnScene(
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -2030,7 +2030,7 @@ void func_8009E0B8(PlayState* play) {
|
||||
spA3 = 255 - (u8)play->roomCtx.unk_74[0];
|
||||
} else if (gSaveContext.sceneSetupIndex == 6) {
|
||||
spA0 = play->roomCtx.unk_74[0] + 500;
|
||||
} else if (((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) && (gSaveContext.eventChkInf[0] & 0x80)) {
|
||||
} else if (((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) && (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD))) {
|
||||
spA0 = 2150;
|
||||
}
|
||||
|
||||
@@ -2058,7 +2058,7 @@ void func_8009E54C(PlayState* play) {
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if ((gSaveContext.sceneSetupIndex > 3) || (LINK_IS_ADULT && !(gSaveContext.eventChkInf[6] & 0x200))) {
|
||||
if ((gSaveContext.sceneSetupIndex > 3) || (LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER))) {
|
||||
play->roomCtx.unk_74[0] = 87;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -153,7 +155,7 @@ void Sram_OpenSave() {
|
||||
}
|
||||
|
||||
// if zelda cutscene has been watched but lullaby was not obtained, restore cutscene and take away letter
|
||||
if ((gSaveContext.eventChkInf[4] & 1) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) {
|
||||
if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) {
|
||||
i = gSaveContext.eventChkInf[4] & ~1;
|
||||
gSaveContext.eventChkInf[4] = i;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user