1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-11 17:30:25 +00:00

Use official macros for Physical Address conversion (#2511)

This commit is contained in:
fig02 2025-04-24 14:53:18 -04:00 committed by GitHub
parent de59ad3db7
commit 2341c44a6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 85 additions and 88 deletions

View file

@ -87,7 +87,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
OPEN_DISPS(gfxCtx, "../z_eff_ss_d_fire.c", 276);
if (Object_GetSlot(&play->objectCtx, OBJECT_DODONGO) >= 0) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
scale = this->rScale / 100.0f;
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
@ -103,7 +103,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,
this->rPrimColorA);
gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIndex]));
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
}

View file

@ -39,7 +39,7 @@ u32 EffectSsExtra_Init(PlayState* play, u32 index, EffectSs* this, void* initPar
if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) {
uintptr_t oldSeg6 = gSegments[6];
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
this->pos = initParams->pos;
this->velocity = initParams->velocity;
this->accel = initParams->accel;
@ -71,7 +71,7 @@ void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) {
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_extra.c", 168);
gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);

View file

@ -55,7 +55,7 @@ u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* init
if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) {
prevSeg6 = gSegments[6];
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
this->rObjectSlot = objectSlot;
this->pos = initParams->pos;
this->velocity = initParams->velocity;
@ -111,7 +111,7 @@ void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this)
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, this->rAlpha);

View file

@ -53,7 +53,7 @@ u32 EffectSsGMagma2_Init(PlayState* play, u32 index, EffectSs* this, void* initP
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
EffectSsGMagma2InitParams* initParams = (EffectSsGMagma2InitParams*)initParamsx;
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
this->rObjectSlot = objectSlot;
this->pos = initParams->pos;
this->velocity = zeroVec;
@ -92,7 +92,7 @@ void EffectSsGMagma2_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ss_g_magma2.c", 282);

View file

@ -40,7 +40,7 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init
if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) {
uintptr_t prevSeg6 = gSegments[6];
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
Math_Vec3f_Copy(&this->pos, &initParams->pos);
Math_Vec3f_Copy(&this->velocity, &initParams->velocity);
Math_Vec3f_Copy(&this->accel, &initParams->accel);
@ -76,7 +76,7 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) {
if ((objectSlot >= 0) && Object_IsLoaded(&play2->objectCtx, objectSlot)) {
gDPPipeSync(POLY_XLU_DISP++);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamStartDL));
gDPPipeSync(POLY_XLU_DISP++);