mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 23:14:37 +00:00
Add do whiles to all remaining gbi macros (#946)
* Add do whiles to all remaining gbi macros * Cleanup and remove unnecessary do whiles
This commit is contained in:
parent
d874cd08fc
commit
3d57eaf019
22 changed files with 142 additions and 204 deletions
|
@ -157,10 +157,9 @@ void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg
|
|||
if (masked_arg2) {}
|
||||
|
||||
while (pos > end) {
|
||||
do {
|
||||
pos -= masked_arg2;
|
||||
arg3((void*)pos, 2);
|
||||
} while (0);
|
||||
pos -= masked_arg2;
|
||||
arg3((void*)pos, 2);
|
||||
if (1) {}
|
||||
}
|
||||
|
||||
if (!masked_arg2) {}
|
||||
|
|
|
@ -128,17 +128,8 @@ u8 sGfxPrintFontData[(16 * 256) / 2] = {
|
|||
0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30,
|
||||
0x00, 0x10, 0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04,
|
||||
0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
};
|
||||
|
||||
#define gDPSetPrimColorMod(pkt, m, l, rgba) \
|
||||
{ \
|
||||
Gfx* _g = (Gfx*)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
|
||||
_g->words.w1 = (rgba); \
|
||||
}
|
||||
|
||||
void GfxPrint_InitDlist(GfxPrint* this) {
|
||||
s32 width = 16;
|
||||
s32 height = 256;
|
||||
|
@ -160,7 +151,7 @@ void GfxPrint_InitDlist(GfxPrint* this) {
|
|||
gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba);
|
||||
gDPSetColor(this->dlist++, G_SETPRIMCOLOR, this->color.rgba);
|
||||
|
||||
gDPLoadMultiTile_4b(this->dlist++, sGfxPrintUnkData, 0, 1, G_IM_FMT_CI, 2, 8, 0, 0, 1, 7, 4,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 1, 3, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
@ -180,7 +171,7 @@ void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) {
|
|||
this->color.b = b;
|
||||
this->color.a = a;
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba);
|
||||
gDPSetColor(this->dlist++, G_SETPRIMCOLOR, this->color.rgba);
|
||||
}
|
||||
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) {
|
||||
|
@ -218,7 +209,7 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) {
|
|||
}
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG4) {
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, 0);
|
||||
gDPSetColor(this->dlist++, G_SETPRIMCOLOR, 0);
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG64) {
|
||||
gSPTextureRectangle(this->dlist++, (this->posX + 4) << 1, (this->posY + 4) << 1, (this->posX + 4 + 32) << 1,
|
||||
|
@ -229,7 +220,7 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) {
|
|||
tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba);
|
||||
gDPSetColor(this->dlist++, G_SETPRIMCOLOR, this->color.rgba);
|
||||
}
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG64) {
|
||||
|
|
|
@ -731,8 +731,6 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
|||
spC8 = (spCC * spC8 > 0x1000) ? 0x1000 / spCC : spC8;
|
||||
spB4 = spB8 + (spC8 * 4);
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
OVERLAY_DISP = func_80093808(OVERLAY_DISP);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity,
|
||||
|
|
|
@ -6648,8 +6648,8 @@ s32 Camera_Special9(Camera* camera) {
|
|||
sCameraInterfaceFlags = params->interfaceFlags;
|
||||
|
||||
switch (camera->animState) {
|
||||
do {
|
||||
} while (0);
|
||||
if (1) {}
|
||||
|
||||
case 0:
|
||||
camera->unk_14C &= ~(0x4 | 0x2);
|
||||
camera->animState++;
|
||||
|
|
|
@ -166,8 +166,6 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
|||
gDPLoadTextureBlock(POLY_XLU_DISP++, gUnknownCircle6Tex, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
gDPSetCombineLERP(POLY_XLU_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, 0, 0,
|
||||
0, COMBINED, 0, 0, 0, COMBINED);
|
||||
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_ZB_CLD_SURF2);
|
||||
|
|
|
@ -152,8 +152,6 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
|||
u8 sp1C4;
|
||||
f32 ratio;
|
||||
|
||||
if (1) {}
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_eff_spark.c", 293);
|
||||
|
||||
if (this != NULL) {
|
||||
|
|
|
@ -166,12 +166,11 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
|
|||
}
|
||||
|
||||
for (i = 0; i < BLURE_COUNT; i++) {
|
||||
do {
|
||||
if (1) {} // Necessary to match
|
||||
if (sEffectContext.blures[i].status.active) {
|
||||
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
|
||||
}
|
||||
} while (0); // Necessary to match
|
||||
if (sEffectContext.blures[i].status.active) {
|
||||
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
|
||||
}
|
||||
if (1) {} // Necessary to match
|
||||
if (1) {}
|
||||
}
|
||||
|
||||
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
|
||||
|
|
|
@ -22,9 +22,7 @@ s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurv
|
|||
skelCurve->transforms = ZeldaArena_MallocDebug(sizeof(*skelCurve->transforms) * skelCurve->limbCount,
|
||||
"../z_fcurve_data_skelanime.c", 125);
|
||||
ASSERT(skelCurve->transforms != NULL, "this->now_joint != NULL", "../z_fcurve_data_skelanime.c", 127);
|
||||
do {
|
||||
skelCurve->animCurFrame = 0.0f;
|
||||
} while (0);
|
||||
skelCurve->animCurFrame = 0.0f;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -2860,8 +2860,6 @@ void Interface_DrawActionButton(GlobalContext* globalCtx) {
|
|||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3177),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0);
|
||||
|
@ -3183,7 +3181,6 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cLeftAlpha);
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||
if (1) {}
|
||||
Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment + 0x1000, 1);
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
|
@ -3197,7 +3194,6 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cDownAlpha);
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||
if (1) {}
|
||||
Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment + 0x2000, 2);
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
|
@ -3211,7 +3207,6 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cRightAlpha);
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||
if (1) {}
|
||||
Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment + 0x3000, 3);
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
|
|
|
@ -297,7 +297,6 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
|
|||
bg->s.scaleW = 1024;
|
||||
bg->s.scaleH = 1024;
|
||||
bg->s.imageYorig = bg->b.imageY;
|
||||
if (1) {}
|
||||
gDPSetOtherMode(displayListHead++,
|
||||
mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE |
|
||||
G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
|
|
|
@ -402,8 +402,6 @@ s32 func_800AB2C4(View* view) {
|
|||
Mtx* projection;
|
||||
GraphicsContext* gfxCtx;
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
gfxCtx = view->gfxCtx;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_view.c", 777);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue