summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2022-11-08 14:46:30 -0500
committerGitHub <noreply@github.com>2022-11-08 19:46:30 +0000
commita0c65bb3c65bf5de5fd3610c20ffaf75204582c3 (patch)
treed5f6ada9b685bf519be1453ba4d6c1a66039164f /src
parent577a4a772b487b68f0c655d5954fdbd26df04e37 (diff)
`z_parameter`: Textures (#1076)
* match and doc texture functions * name suggestions @Tharo * << 2 as much as possible * gfx * fix merge * texture docs
Diffstat (limited to 'src')
-rw-r--r--src/code/z_parameter.c322
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c14
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c12
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c31
-rw-r--r--src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c2
5 files changed, 323 insertions, 58 deletions
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index db3cce0bb..79c50e921 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -222,27 +222,289 @@ s16 sFinalHoursClockFrameEnvBlue = 0;
s16 sFinalHoursClockColorTimer = 15;
s16 sFinalHoursClockColorTargetIndex = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010CB80.s")
+/**
+ * Draw a RGBA16 texture on a rectangle
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param rectLeft the x-coordinate of upper-left corner of rectangle
+ * @param rectTop the y-coordinate of upper-left corner of rectangle
+ * @param rectWidth rectangle width in texels
+ * @param rectHeight rectangle height in texels
+ * @param dsdx the change in s for each change in x (s5.10)
+ * @param dtdy the change in t for each change in y (s5.10)
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexRectRGBA16(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
+ s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) {
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, textureHeight, 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);
+
+ gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2,
+ G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
+
+ return gfx;
+}
+
+/**
+ * Draw an IA8 texture on a rectangle
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param rectLeft the x-coordinate of upper-left corner of rectangle
+ * @param rectTop the y-coordinate of upper-left corner of rectangle
+ * @param rectWidth rectangle width in texels
+ * @param rectHeight rectangle height in texels
+ * @param dsdx the change in s for each change in x (s5.10)
+ * @param dtdy the change in t for each change in y (s5.10)
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexRectIA8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
+ s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) {
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, textureWidth, textureHeight, 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);
+
+ gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2,
+ G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
+
+ return gfx;
+}
+
+/**
+ * Draw an IA8 texture on a rectangle with a shadow slightly offset to the bottom-right
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param rectLeft the x-coordinate of upper-left corner of rectangle
+ * @param rectTop the y-coordinate of upper-left corner of rectangle
+ * @param rectWidth rectangle width in texels
+ * @param rectHeight rectangle height in texels
+ * @param dsdx the change in s for each change in x (s5.10)
+ * @param dtdy the change in t for each change in y (s5.10)
+ * @param r texture red
+ * @param g texture green
+ * @param b texture blue
+ * @param a texture alpha
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexRectIA8_DropShadow(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft,
+ s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy, s16 r, s16 g, s16 b,
+ s16 a) {
+ s16 dropShadowAlpha = a;
+
+ if (a > 100) {
+ dropShadowAlpha = 100;
+ }
+
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, dropShadowAlpha);
+
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, textureWidth, textureHeight, 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);
+
+ gSPTextureRectangle(gfx++, (rectLeft + 2) * 4, (rectTop + 2) * 4, (rectLeft + rectWidth + 2) * 4,
+ (rectTop + rectHeight + 2) * 4, G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
+
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0, r, g, b, a);
+
+ gSPTextureRectangle(gfx++, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4,
+ G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
+
+ return gfx;
+}
+
+/**
+ * Draw a colored rectangle with a shadow slightly offset to the bottom-right
+ *
+ * @param gfx the display list pointer
+ * @param rectLeft the x-coordinate of upper-left corner of rectangle
+ * @param rectTop the y-coordinate of upper-left corner of rectangle
+ * @param rectWidth rectangle width in texels
+ * @param rectHeight rectangle height in texels
+ * @param dsdx the change in s for each change in x (s5.10)
+ * @param dtdy the change in t for each change in y (s5.10)
+ * @param r // rectangle red
+ * @param g // rectangle green
+ * @param b // rectangle blue
+ * @param a // rectangle alpha
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawRect_DropShadow(Gfx* gfx, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy,
+ s16 r, s16 g, s16 b, s16 a) {
+ s16 dropShadowAlpha = a;
+
+ if (a > 100) {
+ dropShadowAlpha = 100;
+ }
+
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, dropShadowAlpha);
+ gSPTextureRectangle(gfx++, (rectLeft + 2) * 4, (rectTop + 2) * 4, (rectLeft + rectWidth + 2) * 4,
+ (rectTop + rectHeight + 2) * 4, G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
+
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0, r, g, b, a);
+
+ gSPTextureRectangle(gfx++, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4,
+ G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010CD98.s")
+ return gfx;
+}
+
+/**
+ * Draw an IA8 texture on a rectangle with a shadow slightly offset to the bottom-right with additional texture offsets
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param rectLeft the x-coordinate of upper-left corner of rectangle
+ * @param rectTop the y-coordinate of upper-left corner of rectangle
+ * @param rectWidth rectangle width in texels
+ * @param rectHeight rectangle height in texels
+ * @param dsdx the change in s for each change in x (s5.10)
+ * @param dtdy the change in t for each change in y (s5.10)
+ * @param r // texture red
+ * @param g // texture green
+ * @param b // texture blue
+ * @param a // texture alpha
+ * @param masks specify the mask for the s axis
+ * @param rects the texture coordinate s of upper-left corner of rectangle (s10.5)
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexRectIA8_DropShadowOffset(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight,
+ s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy,
+ s16 r, s16 g, s16 b, s16 a, s32 masks, s32 rects) {
+ s16 dropShadowAlpha = a;
+
+ if (a > 100) {
+ dropShadowAlpha = 100;
+ }
+
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, dropShadowAlpha);
+
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, textureWidth, textureHeight, 0,
+ G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, masks, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
-Gfx* func_8010CFBC(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
- s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy, s16 r, s16 g, s16 b, s16 a);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010CFBC.s")
+ gSPTextureRectangle(gfx++, (rectLeft + 2) * 4, (rectTop + 2) * 4, (rectLeft + rectWidth + 2) * 4,
+ (rectTop + rectHeight + 2) * 4, G_TX_RENDERTILE, rects, 0, dsdx, dtdy);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010D2D4.s")
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0, r, g, b, a);
-Gfx* func_8010D480(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
- s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy, s16 r, s16 g, s16 b, s16 a, s32 argE, s32 argF);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010D480.s")
+ gSPTextureRectangle(gfx++, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4,
+ G_TX_RENDERTILE, rects, 0, dsdx, dtdy);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010D7D0.s")
+ return gfx;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010D9F4.s")
+/**
+ * Draw an I8 texture on a rectangle
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param rectLeft the x-coordinate of upper-left corner of rectangle
+ * @param rectTop the y-coordinate of upper-left corner of rectangle
+ * @param rectWidth rectangle width in texels
+ * @param rectHeight rectangle height in texels
+ * @param dsdx the change in s for each change in x (s5.10)
+ * @param dtdy the change in t for each change in y (s5.10)
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexRectI8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
+ s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) {
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_I, G_IM_SIZ_8b, textureWidth, textureHeight, 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);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010DC58.s")
+ gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2,
+ G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010DE38.s")
+ return gfx;
+}
+
+/**
+ * Draw a 4b texture on a rectangle
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param fmt texture image format
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param rectLeft the x-coordinate of upper-left corner of rectangle
+ * @param rectTop the y-coordinate of upper-left corner of rectangle
+ * @param rectWidth rectangle width in texels
+ * @param rectHeight rectangle height in texels
+ * @param cms gives the clamp, wrap, and mirror flag for the s axis
+ * @param masks specify the mask for the s axis
+ * @param rects the texture coordinate s of upper-left corner of rectangle (s10.5)
+ * @param dsdx the change in s for each change in x (s5.10)
+ * @param dtdy the change in t for each change in y (s5.10)
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexRect4b(Gfx* gfx, TexturePtr texture, s32 fmt, s16 textureWidth, s16 textureHeight, s16 rectLeft,
+ s16 rectTop, s16 rectWidth, s16 rectHeight, s32 cms, s32 masks, s32 rects, u16 dsdx, u16 dtdy) {
+ gDPLoadTextureBlock_4b(gfx++, texture, fmt, textureWidth, textureHeight, 0, cms, G_TX_NOMIRROR | G_TX_WRAP, masks,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+
+ gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2,
+ G_TX_RENDERTILE, rects, 0, dsdx, dtdy);
+
+ return gfx;
+}
+
+/**
+ * Draw an I8 texture on a Quadrangle
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param point index of the first point to draw the Quadrangle
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexQuadIA8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, u16 point) {
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, textureWidth, textureHeight, 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(gfx++, point, point + 2, point + 3, point + 1, 0);
+
+ return gfx;
+}
+
+/**
+ * Draw a 4b texture on a Quadrangle
+ *
+ * @param gfx the display list pointer
+ * @param texture
+ * @param fmt texture image format
+ * @param textureWidth texture image width in texels
+ * @param textureHeight texture image height in texels
+ * @param point index of the first point to draw the Quadrangle
+ * @return Gfx* the display list pointer
+ */
+Gfx* Gfx_DrawTexQuad4b(Gfx* gfx, TexturePtr texture, s32 fmt, s16 textureWidth, s16 textureHeight, u16 point) {
+ gDPLoadTextureBlock_4b(gfx++, texture, fmt, textureWidth, textureHeight, 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(gfx++, point, point + 2, point + 3, point + 1, 0);
+
+ return gfx;
+}
s16 D_801BFA04[] = {
-14, -14, -24, -8, -12, -12, -7, -8, -7, -8, -12, 0,
@@ -2418,17 +2680,17 @@ void Magic_DrawMeter(PlayState* play) {
gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255);
- OVERLAY_DISP = func_8010CFBC(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, 18, magicBarY, 8, 16, 1 << 10, 1 << 10,
- sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen, sMagicMeterOutlinePrimBlue,
- interfaceCtx->magicAlpha);
- OVERLAY_DISP =
- func_8010CFBC(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, 26, magicBarY, ((void)0, gSaveContext.magicCapacity),
- 16, 1 << 10, 1 << 10, sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen,
- sMagicMeterOutlinePrimBlue, interfaceCtx->magicAlpha);
- OVERLAY_DISP =
- func_8010D480(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, ((void)0, gSaveContext.magicCapacity) + 26, magicBarY,
- 8, 16, 1 << 10, 1 << 10, sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen,
- sMagicMeterOutlinePrimBlue, interfaceCtx->magicAlpha, 3, 0x100);
+ OVERLAY_DISP = Gfx_DrawTexRectIA8_DropShadow(
+ OVERLAY_DISP, gMagicMeterEndTex, 8, 16, 18, magicBarY, 8, 16, 1 << 10, 1 << 10, sMagicMeterOutlinePrimRed,
+ sMagicMeterOutlinePrimGreen, sMagicMeterOutlinePrimBlue, interfaceCtx->magicAlpha);
+ OVERLAY_DISP = Gfx_DrawTexRectIA8_DropShadow(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, 26, magicBarY,
+ ((void)0, gSaveContext.magicCapacity), 16, 1 << 10, 1 << 10,
+ sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen,
+ sMagicMeterOutlinePrimBlue, interfaceCtx->magicAlpha);
+ OVERLAY_DISP = Gfx_DrawTexRectIA8_DropShadowOffset(
+ OVERLAY_DISP, gMagicMeterEndTex, 8, 16, ((void)0, gSaveContext.magicCapacity) + 26, magicBarY, 8, 16,
+ 1 << 10, 1 << 10, sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen, sMagicMeterOutlinePrimBlue,
+ interfaceCtx->magicAlpha, 3, 0x100);
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE, PRIMITIVE,
@@ -3034,9 +3296,9 @@ void Interface_DrawTimers(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
- OVERLAY_DISP =
- func_8010CD98(OVERLAY_DISP, gTimerClockIconTex, 0x10, 0x10, ((void)0, gSaveContext.timerX[sTimerId]),
- ((void)0, gSaveContext.timerY[sTimerId]) + 2, 0x10, 0x10, 1 << 10, 1 << 10);
+ OVERLAY_DISP = Gfx_DrawTexRectIA8(
+ OVERLAY_DISP, gTimerClockIconTex, 0x10, 0x10, ((void)0, gSaveContext.timerX[sTimerId]),
+ ((void)0, gSaveContext.timerY[sTimerId]) + 2, 0x10, 0x10, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0,
0, PRIMITIVE, 0);
@@ -3083,7 +3345,7 @@ void Interface_DrawTimers(PlayState* play) {
if (sPostmanBunnyHoodState == POSTMAN_MINIGAME_BUNNY_HOOD_ON) {
// draw sTimerDigits[3] (10s of seconds) to sTimerDigits[6] (100s of milliseconds)
for (j = 0; j < 4; j++) {
- OVERLAY_DISP = func_8010D7D0(
+ OVERLAY_DISP = Gfx_DrawTexRectI8(
OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[j + 3])), 8, 0x10,
((void)0, gSaveContext.timerX[sTimerId]) + sTimerDigitsOffsetX[j],
((void)0, gSaveContext.timerY[sTimerId]), sTimerDigitsWidth[j], 0xFA, 0x370, 0x370);
@@ -3091,7 +3353,7 @@ void Interface_DrawTimers(PlayState* play) {
} else {
// draw sTimerDigits[3] (10s of seconds) to sTimerDigits[7] (10s of milliseconds)
for (j = 0; j < 5; j++) {
- OVERLAY_DISP = func_8010D7D0(
+ OVERLAY_DISP = Gfx_DrawTexRectI8(
OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[j + 3])), 8, 0x10,
((void)0, gSaveContext.timerX[sTimerId]) + sTimerDigitsOffsetX[j],
((void)0, gSaveContext.timerY[sTimerId]), sTimerDigitsWidth[j], 0xFA, 0x370, 0x370);
@@ -3100,7 +3362,7 @@ void Interface_DrawTimers(PlayState* play) {
} else {
// draw sTimerDigits[3] (6s of minutes) to sTimerDigits[7] (10s of milliseconds)
for (j = 0; j < 8; j++) {
- OVERLAY_DISP = func_8010D7D0(
+ OVERLAY_DISP = Gfx_DrawTexRectI8(
OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[j])), 8, 0x10,
((void)0, gSaveContext.timerX[sTimerId]) + sTimerDigitsOffsetX[j],
((void)0, gSaveContext.timerY[sTimerId]), sTimerDigitsWidth[j], 0xFA, 0x370, 0x370);
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
index 92fe82e76..3d819423c 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c
@@ -64,7 +64,7 @@ s16 sQuestRemainsEnvBlue[] = {
#ifdef NON_EQUIVALENT
// TODO: is actually NON_MATCHING, update once `z_kaleido_scope_NES.c` is decompiled
-// A single small regalloc at the first `func_8010DC58` for the heart piece count (see `gItemIcons`)
+// A single small regalloc at the first `Gfx_DrawTexQuadIA8` for the heart piece count (see `gItemIcons`)
void KaleidoScope_DrawQuestStatus(PlayState* play) {
static s16 sQuestRemainsColorTimer = 20;
static s16 sQuestRemainsColorTimerIndex = 0;
@@ -337,7 +337,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0);
- POLY_OPA_DISP = func_8010DC58(
+ POLY_OPA_DISP = Gfx_DrawTexQuadIA8(
POLY_OPA_DISP,
gItemIcons[(0x7A + ((GET_SAVE_INVENTORY_QUEST_ITEMS & 0xF0000000) >> QUEST_HEART_PIECE_COUNT))], 48, 48, 0);
}
@@ -387,8 +387,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0);
- POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP,
- sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[i]], 16, 16, 0);
+ POLY_OPA_DISP = Gfx_DrawTexQuadIA8(
+ POLY_OPA_DISP, sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[i]], 16, 16, 0);
}
}
} else if (IS_PAUSE_MAIN_STATE_SAVE_PROMPT || (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) {
@@ -421,7 +421,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0);
- POLY_OPA_DISP = func_8010DC58(
+ POLY_OPA_DISP = Gfx_DrawTexQuadIA8(
POLY_OPA_DISP, sOcarinaButtonTextures[gOcarinaSongButtons[sp1C8].buttonIndex[k]], 16, 16, 0);
}
@@ -471,8 +471,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0);
- POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP,
- sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[k]], 16, 16, 0);
+ POLY_OPA_DISP = Gfx_DrawTexQuadIA8(
+ POLY_OPA_DISP, sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[k]], 16, 16, 0);
}
if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT_INIT) {
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
index 8e69188fb..d1a358e75 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c
@@ -223,13 +223,15 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx,
// Draw upper digit
if (ammoUpperDigit != 0) {
- POLY_OPA_DISP = func_8010CD98(POLY_OPA_DISP, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammoUpperDigit)), 8, 8,
- sAmmoRectLeft[ammoIndex], sAmmoRectHeight[ammoIndex], 8, 8, 1 << 10, 1 << 10);
+ POLY_OPA_DISP =
+ Gfx_DrawTexRectIA8(POLY_OPA_DISP, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammoUpperDigit)), 8, 8,
+ sAmmoRectLeft[ammoIndex], sAmmoRectHeight[ammoIndex], 8, 8, 1 << 10, 1 << 10);
}
// Draw lower digit
- POLY_OPA_DISP = func_8010CD98(POLY_OPA_DISP, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammo)), 8, 8,
- sAmmoRectLeft[ammoIndex] + 6, sAmmoRectHeight[ammoIndex], 8, 8, 1 << 10, 1 << 10);
+ POLY_OPA_DISP =
+ Gfx_DrawTexRectIA8(POLY_OPA_DISP, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammo)), 8, 8, sAmmoRectLeft[ammoIndex] + 6,
+ sAmmoRectHeight[ammoIndex], 8, 8, 1 << 10, 1 << 10);
CLOSE_DISPS(gfxCtx);
}
@@ -260,7 +262,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
if (GET_CUR_FORM_BTN_ITEM(i + 1) != ITEM_NONE) {
if (GET_CUR_FORM_BTN_SLOT(i + 1) < NUM_ITEM_SLOTS) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j], 4, 0);
- POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0);
+ POLY_OPA_DISP = Gfx_DrawTexQuadIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0);
}
}
}
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
index e0c82a1bb..87acfaa6c 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
@@ -35,8 +35,8 @@ void KaleidoScope_DrawDungeonStrayFairyCount(PlayState* play) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, 255);
- POLY_OPA_DISP = func_8010D7D0(POLY_OPA_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[digitIndex]), 8,
- 16, rectLeft + 1, 146, 8, 16, 1 << 10, 1 << 10);
+ POLY_OPA_DISP = Gfx_DrawTexRectI8(POLY_OPA_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[digitIndex]),
+ 8, 16, rectLeft + 1, 146, 8, 16, 1 << 10, 1 << 10);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
@@ -50,7 +50,7 @@ void KaleidoScope_DrawDungeonStrayFairyCount(PlayState* play) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, 255);
POLY_OPA_DISP =
- func_8010D7D0(POLY_OPA_DISP, gStrayFairyMapCounterSlashTex, 8, 16, 107, 146, 8, 16, 1 << 10, 1 << 10);
+ Gfx_DrawTexRectI8(POLY_OPA_DISP, gStrayFairyMapCounterSlashTex, 8, 16, 107, 146, 8, 16, 1 << 10, 1 << 10);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
@@ -68,8 +68,8 @@ void KaleidoScope_DrawDungeonStrayFairyCount(PlayState* play) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, 255);
- POLY_OPA_DISP = func_8010D7D0(POLY_OPA_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[digitIndex]), 8,
- 16, rectLeft + 1, 146, 8, 16, 1 << 10, 1 << 10);
+ POLY_OPA_DISP = Gfx_DrawTexRectI8(POLY_OPA_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[digitIndex]),
+ 8, 16, rectLeft + 1, 146, 8, 16, 1 << 10, 1 << 10);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
@@ -159,7 +159,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA);
POLY_OPA_DISP =
- func_8010DC58(POLY_OPA_DISP, sDungeonTitleTextures[((void)0, gSaveContext.dungeonIndex)], 128, 16, 0);
+ Gfx_DrawTexQuadIA8(POLY_OPA_DISP, sDungeonTitleTextures[((void)0, gSaveContext.dungeonIndex)], 128, 16, 0);
gDPPipeSync(POLY_OPA_DISP++);
@@ -224,7 +224,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[76], 4, 0);
POLY_OPA_DISP =
- func_8010DE38(POLY_OPA_DISP, gStrayFairyGlowingCircleIconTex, G_IM_FMT_I, 32, 24, 0);
+ Gfx_DrawTexQuad4b(POLY_OPA_DISP, gStrayFairyGlowingCircleIconTex, G_IM_FMT_I, 32, 24, 0);
KaleidoScope_SetView(pauseCtx, pauseCtx->eye.x, pauseCtx->eye.y, pauseCtx->eye.z);
func_8012C628(play->state.gfxCtx);
@@ -275,13 +275,14 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
// Draw Player's face next to the dungeon floor icon currently in.
- POLY_OPA_DISP = func_8010CB80(POLY_OPA_DISP, &D_09007500, 16, 16, 62,
- sDungeonMapFloorIconPosY[R_REVERSE_FLOOR_INDEX], 16, 16, 1 << 10, 1 << 10);
+ POLY_OPA_DISP =
+ Gfx_DrawTexRectRGBA16(POLY_OPA_DISP, &D_09007500, 16, 16, 62,
+ sDungeonMapFloorIconPosY[R_REVERSE_FLOOR_INDEX], 16, 16, 1 << 10, 1 << 10);
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.dungeonIndex)) {
- POLY_OPA_DISP = func_8010CB80(POLY_OPA_DISP, gDungeonMapSkullTex, 16, 16, 108,
- sDungeonMapFloorIconPosY[FLOOR_INDEX_MAX - func_80105318()], 16, 16,
- 1 << 10, 1 << 10);
+ POLY_OPA_DISP = Gfx_DrawTexRectRGBA16(POLY_OPA_DISP, gDungeonMapSkullTex, 16, 16, 108,
+ sDungeonMapFloorIconPosY[FLOOR_INDEX_MAX - func_80105318()], 16,
+ 16, 1 << 10, 1 << 10);
}
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
@@ -645,7 +646,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[60 + n * 4], 4, 0);
- POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP, sCloudTextures[n], D_8082B7F0[n], D_8082B838[n], 0);
+ POLY_OPA_DISP = Gfx_DrawTexQuadIA8(POLY_OPA_DISP, sCloudTextures[n], D_8082B7F0[n], D_8082B838[n], 0);
}
}
@@ -798,8 +799,8 @@ void KaleidoScope_DrawWorldMap(PlayState* play) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
- POLY_OPA_DISP = func_8010CB80(POLY_OPA_DISP, &D_09007500, 16, 16, sWorldMapCursorsRectLeft[n],
- sWorldMapCursorsRectTop[n], 16, 16, 1 << 10, 1 << 10);
+ POLY_OPA_DISP = Gfx_DrawTexRectRGBA16(POLY_OPA_DISP, &D_09007500, 16, 16, sWorldMapCursorsRectLeft[n],
+ sWorldMapCursorsRectTop[n], 16, 16, 1 << 10, 1 << 10);
}
}
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
index 6e9f17843..02cb7ce46 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c
@@ -208,7 +208,7 @@ void KaleidoScope_DrawMaskSelect(PlayState* play) {
if (GET_CUR_FORM_BTN_ITEM(i + 1) != ITEM_NONE) {
if (GET_CUR_FORM_BTN_SLOT(i + 1) >= NUM_ITEM_SLOTS) {
gSPVertex(POLY_OPA_DISP++, &pauseCtx->maskVtx[j], 4, 0);
- POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0);
+ POLY_OPA_DISP = Gfx_DrawTexQuadIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0);
}
}
}