diff options
| author | Roman971 <32455037+Roman971@users.noreply.github.com> | 2021-09-05 20:41:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-05 14:41:02 -0400 |
| commit | 3d57eaf01993f14d75eab1766256d1a8d808943a (patch) | |
| tree | b00b2392429734ed9e068733a5503e64a0539820 /src/code | |
| parent | d874cd08fce72191d48fcc0341f8fcabfa842b8e (diff) | |
Add do whiles to all remaining gbi macros (#946)
* Add do whiles to all remaining gbi macros
* Cleanup and remove unnecessary do whiles
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/code_800FC620.c | 7 | ||||
| -rw-r--r-- | src/code/gfxprint.c | 17 | ||||
| -rw-r--r-- | src/code/z_actor.c | 2 | ||||
| -rw-r--r-- | src/code/z_camera.c | 4 | ||||
| -rw-r--r-- | src/code/z_eff_shield_particle.c | 2 | ||||
| -rw-r--r-- | src/code/z_eff_spark.c | 2 | ||||
| -rw-r--r-- | src/code/z_effect.c | 11 | ||||
| -rw-r--r-- | src/code/z_fcurve_data_skelanime.c | 4 | ||||
| -rw-r--r-- | src/code/z_parameter.c | 5 | ||||
| -rw-r--r-- | src/code/z_room.c | 1 | ||||
| -rw-r--r-- | src/code/z_view.c | 2 |
11 files changed, 15 insertions, 42 deletions
diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c index a3b1475ab..d268af5ac 100644 --- a/src/code/code_800FC620.c +++ b/src/code/code_800FC620.c @@ -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) {} diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index 17bde62cd..3dc385edf 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -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) { diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 77ac23806..1cbb2027d 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -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, diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 8eae2f7ac..9f9eaf4fd 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -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++; diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index 725bf7b37..1eae4db65 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -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); diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index db0b000e8..9a37dee1f 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -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) { diff --git a/src/code/z_effect.c b/src/code/z_effect.c index eeeecbd16..d024d0892 100644 --- a/src/code/z_effect.c +++ b/src/code/z_effect.c @@ -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++) { diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index 389102238..3bc89c0a0 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -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; } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index cb861de04..8e3dda4c8 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -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, diff --git a/src/code/z_room.c b/src/code/z_room.c index 1aa2ac9b6..acad1905a 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -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, diff --git a/src/code/z_view.c b/src/code/z_view.c index 56ee4776a..74c554c55 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -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); |
