214 u16 flag, u8 alpha) {
305 msg_drawState = &D_80155D20;
318 msg_drawState->
clipX[0] = 0;
319 msg_drawState->
clipY[0] = 0;
324 msg_drawState->
unk_29 = 0;
326 msg_drawState->
unk_2C = 0;
333 msg_drawState->
font = 0;
344 msg_drawState->
font = 1;
356 u16 lastbyte, glyph_index, byte2;
401 msg_drawState->
nextPos[1] += 5;
472 if (straightWidth > 256) {
475 if (straightWidth < 70) {
480 printer->
windowSize.
x = straightWidth + (curveWidth * 2);
523 bubbleX = (temp_f24 - temp_f2_2 * 0.5) + 0.5;
524 bubbleY = (temp_f20 - temp_f0_2 * 0.5) + 0.5;
525 msg_draw_speech_bubble(printer, bubbleX, bubbleY, straightWidth, curveWidth, height, windowScaleX, windowScaleY, temp_f28, 1);
538 bubbleX = (temp_f24 - temp_f2 * 0.5) + 0.5;
539 bubbleY = (temp_f20 - temp_f0 * 0.5) + 0.5;
540 temp_f22_2 = (temp_f24 + temp_f2 * 0.5) - 0.5;
541 temp_f20_3 = (temp_f20 + temp_f0 * 0.5) - 0.5;
543 sp8E = temp_f28 * 0.35;
549 msg_draw_speech_bubble(printer, bubbleX, bubbleY, straightWidth, curveWidth, height, windowScaleX, windowScaleY, temp_f28, 1);
564 msg_drawState->
clipX[0] = 20;
577 frameSizeX = windowSizeX;
578 frameSizeY = windowSizeY;
590 temp_f10 = ((f32) printer->
fadeInCounter * (2.0 / 15.0)) + 0.2;
594 temp1 = z1 - (windowSizeX * temp_f10 * 0.5);
595 temp2 = z2 - (windowSizeY * temp_f10 * 0.5);
596 frameX = temp1 + 0.5;
597 frameY = temp2 + 0.5;
598 frameSizeX = windowSizeX * temp_f10 + 0.5;
599 frameSizeY = windowSizeY * temp_f10 + 0.5;
601 if (frameSizeX < 24) {
604 if (frameSizeY < 24) {
608 sp8E = (u8)(temp_f10 * 255.0) * 0.6;
615 sp8E = ((u8)frameAlpha) * 0.6;
625 msg_draw_prim_rect(255, 32, 32, 0, frameX - 1, frameY - 1, windowSizeX + 2, windowSizeY + 2);
627 msg_drawState->
clipX[0] = frameX + 2;
628 msg_drawState->
clipY[0] = frameY + 2;
629 msg_drawState->
clipX[1] = frameX + frameSizeX - 2;
630 msg_drawState->
clipY[1] = frameY + frameSizeY - 2;
634 spAE = frameAlpha & 0xFF;
662 sp8E = (phi_s0_5 & 0xFF) - 0x30;
670 sp8E = (phi_s0_5 & 0xFF) - 0x30;
679 msg_drawState->
framePalette, fading, phi_s0_5, phi_s0_5);
681 spAE = phi_s0_5 & 0xFF;
693 msg_drawState->
nextPos[1] -= 2;
707 msg_drawState->
clipY[0] = 40;
715 sp8E = (temp_s1_5 & 0xFF) - 0x30;
723 sp8E = (temp_s1_5 & 0xFF) - 0x30;
730 spAE = (u8)temp_s1_5;
732 28, 10, 10, 310, 230, temp_s1_5);
734 28, 10, 10, 310, 230, temp_s1_5);
736 printer->
windowSize.
y + 12, 10, 10, 310, 230, temp_s1_5);
738 10, 10, 310, 230, temp_s1_5);
739 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_sign_side_top_png, G_IM_FMT_CI, 32, 0, 0, 0, 31, 15, 0, G_TX_NOMIRROR | G_TX_WRAP,
740 G_TX_NOMIRROR | G_TX_WRAP, 5, 4, G_TX_NOLOD, G_TX_NOLOD);
743 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_sign_side_left_png, G_IM_FMT_CI, 16, 0, 0, 0, 15, 31, 0, G_TX_NOMIRROR | G_TX_WRAP,
744 G_TX_NOMIRROR | G_TX_WRAP, 4, 5, G_TX_NOLOD, G_TX_NOLOD);
746 G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
747 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_sign_side_right_png, G_IM_FMT_CI, 16, 0, 0, 0, 15, 31, 0, G_TX_NOMIRROR | G_TX_WRAP,
748 G_TX_NOMIRROR | G_TX_WRAP, 4, 5, G_TX_NOLOD, G_TX_NOLOD);
750 G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
751 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_sign_side_bottom_png, G_IM_FMT_CI, 32, 0, 0, 0, 31, 15, 0, G_TX_NOMIRROR | G_TX_WRAP,
752 G_TX_NOMIRROR | G_TX_WRAP, 5, 4, G_TX_NOLOD, G_TX_NOLOD);
754 (printer->
windowSize.
y + 28) * 4, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
755 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_sign_fill_png, G_IM_FMT_CI, 8, 0, 0, 0, 7, 7, 0, G_TX_NOMIRROR | G_TX_WRAP,
756 G_TX_NOMIRROR | G_TX_WRAP, 3, 3, G_TX_NOLOD, G_TX_NOLOD);
758 G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
768 msg_drawState->
clipX[0] = 45;
769 msg_drawState->
clipY[0] = 32;
770 msg_drawState->
clipX[1] = 272;
771 msg_drawState->
clipY[1] = 81;
781 sp8E = (phi_s3_2 & 0xFF) - 0x30;
789 sp8E = (phi_s3_2 & 0xFF) - 0x30;
802 spAE = phi_s3_2 & 0xFF;
809 msg_drawState->
clipX[0] = 0;
811 msg_drawState->
clipY[0] = 0;
822 printer->
windowSize.
y, 255, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, 0, NULL,
866 if (printer->
unk_4C8 < phi_v0_3) {
867 if (printer->
unk_4C8 <= 0x10) {
870 sp8E = 0xFF - (phi_a0_4 * printer->
unk_4CC);
909 msg_drawState->
msgScale.
x = (f32)(packedScaleX >> 4) + ((packedScaleX & 0xF) * 0.0625f);
911 msg_drawState->
msgScale.
y = (f32)(packedScaleY >> 4) + ((packedScaleY & 0xF) * 0.0625f);
951 phi_t5 = (s32)(sp8E * 0.7);
959 msgImageData->
palette, imgDrawPosX, imgDrawPosY, (s32) msg_drawState->
clipX[0], (s32) msg_drawState->
clipY[0],
960 msg_drawState->
clipX[1] - msg_drawState->
clipX[0], msg_drawState->
clipY[1] - msg_drawState->
clipY[0], phi_t5);
967 phi_s0_6 = (s32)(sp8E * 0.7);
979 msg_drawState->
clipX[0], msg_drawState->
clipY[0], msg_drawState->
clipX[1] - msg_drawState->
clipX[0],
980 msg_drawState->
clipY[1] - msg_drawState->
clipY[0], phi_s0_6);
989 phi_t3 = (s32)(sp8E * 0.7);
997 msg_drawState->
clipY[0], msg_drawState->
clipX[1] - msg_drawState->
clipX[0],
998 msg_drawState->
clipY[1] - msg_drawState->
clipY[0], phi_t3);
1016 (msg_drawState->
printBuffer[dbPos + 1] == animIdx)) {
1025 (msg_drawState->
printBuffer[dbPos + 2] == animIdx)) {
1038 if (msg_drawState->
printBuffer[dbPos + 2] == animIdx) {
1076 msg_drawState->
nextPos[0] - additionalOffsetX - 6;
1078 msg_drawState->
nextPos[1] - additionalOffsetY - 1;
1087 msg_drawState->
nextPos[0] += 14;
1195 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_NOISE_OUTLINE;
1198 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_STATIC;
1204 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_RAINBOW;
1208 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_DITHER_FADE;
1211 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_GLOBAL_WAVE;
1214 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_GLOBAL_RAINBOW;
1218 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_RISE_PRINT;
1221 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_GROW_PRINT;
1224 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_SIZE_JITTER;
1227 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_SIZE_WAVE;
1230 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_DROP_SHADOW;
1243 msg_drawState->
nextPos[0] = 0;
1252 if (lastbyte >= 0x5f && lastbyte <= 0x8f) {
1279 charPosY = rasterOffsetY + (baseOffsetY - additionalOffsetY);
1282 (charPosX < msg_drawState->
clipX[1]) &&
1283 (charPosY < msg_drawState->clipY[1]) &&
1284 (msg_drawState->
clipX[0] < charPosX + (s32)(msg_drawState->
msgScale.
x *
1294 phi_s2_5 = (f32) phi_s2_5 * 0.35;
1300 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_GLOBAL_RAINBOW;
1301 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_GLOBAL_WAVE;
1302 msg_drawState->
effectFlags &= ~MSG_FX_FLAG_DROP_SHADOW;
1312 temp_f2_3 = msg_drawState->
msgScale.
x - 1.0;
1314 (s32)(45.0 - (temp_f2_3 * 15.0)));
1315 charPosX +=
cosine(temp_s0_7) * ((msg_drawState->
msgScale.
x - 1.0) + 1.6);
1316 charPosY +=
cosine((temp_s0_7 + 180.0 + 90.0)) * (msg_drawState->
msgScale.
y - 1.0 + 1.6);
1321 charPosX +=
cosine(temp_s0_8) * ((msg_drawState->
msgScale.
x - 1.0) + 1.6);
1322 charPosY +=
cosine((temp_s0_8 + 180.0 + 90.0)) * ((msg_drawState->
msgScale.
y - 1.0) + 1.6);
1333 phi_s2_5 = spB6 * (phi_s2_5 / 255.0);
1336 if ((sp96 < 0xFF) && (phi_s2_5 < 0xFF)) {
1337 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 0, 0, 0, phi_s2_5);
1338 }
else if ((sp96 == 0xFF) && (phi_s2_5 < 0xFF)) {
1341 gDPSetRenderMode(
gMainGfxPos++, IM_RD | CVG_DST_CLAMP | ZMODE_XLU | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN,
1342 G_BL_CLR_MEM, G_BL_1MA), IM_RD | CVG_DST_CLAMP | ZMODE_XLU | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM,
1346 gDPSetRenderMode(
gMainGfxPos++, IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN,
1347 G_BL_CLR_MEM, G_BL_1MA), IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM,
1352 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 0, 0, 0, phi_s2_5);
1353 }
else if ((sp96 < 0xFF) && (phi_s2_5 == 0xFF)) {
1355 gDPSetRenderMode(
gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
1356 gDPSetCombineMode(
gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
1370 temp_f8 = (msg_drawState->
charScale.
y / 1.7) * 6.0;
1371 charPosX -= temp_f8;
1372 charPosY -= temp_f8;
1377 temp_f8 = (msg_drawState->
charScale.
y / 1.4) * 3.0;
1378 charPosX -= temp_f8;
1379 charPosY -= temp_f8;
1384 temp_f8 = (msg_drawState->
charScale.
y / 1.2) * 2.0;
1385 charPosX -= temp_f8;
1386 charPosY -= temp_f8;
1417 temp_f8_5 = ((temp_f8_5 * 0.5) + 1.0) - 0.25;
1419 if (temp_f8_5 > 1.0) {
1422 charPosX -= (temp_f8_5 * 8.0) - 8.5;
1423 charPosY -= (temp_f8_5 * 8.0) - 8.5;
1424 }
else if (temp_f8_5 < 1.0) {
1427 charPosX += 8.0 - (temp_f8_5 * 16.0) * 0.5;
1428 charPosY += 8.0 - (temp_f8_5 * 16.0) * 0.5;
1435 mod360 = temp_a0_49 % 360;
1436 temp_f8_5 = (
cosine(mod360) * 0.25) + 1.0;
1438 if (temp_f8_5 > 1.0) {
1441 charPosX -= (temp_f8_5 * 8.0) - 8.5;
1442 charPosY -= (temp_f8_5 * 8.0) - 8.5;
1443 }
else if (temp_f8_5 < 1.0) {
1446 charPosX += 8.0 - (temp_f8_5 * 16.0) * 0.5;
1447 charPosY += 8.0 - (temp_f8_5 * 16.0) * 0.5;
1488 if (palette != sp9E) {
1494 gDPSetRenderMode(
gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
1496 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 40, 40, 40, 72);
1498 if (
byte >= MSG_CHAR_MULTIBYTE_FIRST &&
byte <= MSG_CHAR_MULTIBYTE_LAST) {
1499 glyph_index = (MSG_CHAR_ZH_START - MSG_CHAR_MULTIBYTE_FIRST) +
byte + (byte2 - 1)
1500 * (MSG_CHAR_MULTIBYTE_LAST - MSG_CHAR_MULTIBYTE_FIRST + 1);
1502 palette, charPosX + 2, charPosY + 2);
1505 palette, charPosX + 2, charPosY + 2);
1510 palette, charPosX + 2, charPosY + 2);
1513 if (phi_s2_5 < 0xFF) {
1514 gDPSetRenderMode(
gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
1517 gDPSetRenderMode(
gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
1518 gDPSetCombineMode(
gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
1523 for (i = 0; i < 5; i++) {
1524 phi_s0_7 = charPosX;
1525 phi_s1_8 = charPosY;
1527 phi_s0_7 += (
rand_int(10000) % 3) - 1;
1530 phi_s1_8 += (
rand_int(10000) % 3) - 1;
1533 if (
byte >= MSG_CHAR_MULTIBYTE_FIRST &&
byte <= MSG_CHAR_MULTIBYTE_LAST) {
1534 glyph_index = (MSG_CHAR_ZH_START - MSG_CHAR_MULTIBYTE_FIRST) +
byte + (byte2 - 1)
1535 * (MSG_CHAR_MULTIBYTE_LAST - MSG_CHAR_MULTIBYTE_FIRST + 1);
1537 palette, charPosX + 2, charPosY + 2);
1540 palette, charPosX + 2, charPosY + 2);
1545 phi_s0_7, phi_s1_8);
1550 if (
byte >= MSG_CHAR_MULTIBYTE_FIRST &&
byte <= MSG_CHAR_MULTIBYTE_LAST) {
1551 glyph_index = (MSG_CHAR_ZH_START - MSG_CHAR_MULTIBYTE_FIRST) +
byte + (byte2 - 1)
1552 * (MSG_CHAR_MULTIBYTE_LAST - MSG_CHAR_MULTIBYTE_FIRST + 1);
1554 palette, charPosX + 2, charPosY + 2);
1557 palette, charPosX + 2, charPosY + 2);
1584 varImgHasBorder = FALSE;
1586 s16 varImgFinalAlpha;
1595 varImgHasBorder = TRUE;
1608 varImgFinalAlpha = (u8)(((f32) spAE / 255.0) * (f32) printer->
varImgFinalAlpha);
1613 if (varImgFinalAlpha < 1) {
1620 varImgFinalAlpha = (u8)(((f32) spAE / 255.0) * (f32) printer->
varImgFinalAlpha);
1624 if (varImgFinalAlpha > 0) {
1625 if (varImgHasBorder) {
1627 msgVarImage->
width + 15, msgVarImage->
height + 14, varImgFinalAlpha, 0, 0.0f, 0.0f, 0.0f, 0.0f,
1660 s32 ulx, texOffsetX;
1661 s32 uly, texOffsetY;
1667 if (charIndex == MSG_CHAR_ZH_RANK) {
1669 }
else if (charIndex == MSG_CHAR_ZH_CHAPTER) {
1671 }
else if (charIndex >= MSG_CHAR_ZH_START) {
1679 clipUly = drawState->
clipY[0];
1680 clipLry = drawState->
clipY[1];
1681 clipUlx = drawState->
clipX[0];
1682 clipLrx = drawState->
clipX[1];
1690 if (posX2 >= clipLrx || posY2 >= clipLry || rightPosX <= clipUlx || rightPosY <= clipUly) {
1694 if (posX2 < clipUlx) {
1695 clipOffset = abs(posX2 - clipUlx) / drawState->
charScale.
x;
1696 texOffsetX = (f32)((clipOffset + 0.5) * 32.0);
1703 if (posY2 < clipUly) {
1705 clipOffset = abs(posY2 - clipUly) / drawState->
charScale.
y;
1706 texOffsetY = clipOffset * 32.0f;
1718 if (lrx >= clipLrx) {
1723 if (lry >= clipLry) {
1727 dsdx = 1.0f / drawState->
charScale.
x * 1024.0f;
1728 dtdy = 1.0f / drawState->
charScale.
y * 1024.0f;
1735 if (messageCharset->
texSize.
x >= 16 && messageCharset->
texSize.
x % 16 == 0) {
1737 if (charIndex == MSG_CHAR_ZH_RANK || charIndex == MSG_CHAR_ZH_CHAPTER) {
1738 gDPLoadTextureBlock_4b(
gMainGfxPos++, D_801544A0[charIndex - MSG_CHAR_ZH_RANK], G_IM_FMT_CI,
1740 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
1741 }
else if (charIndex >= MSG_CHAR_ZH_START) {
1742 gDPLoadTextureBlock_4b(
gMainGfxPos++, D_801544A0[D_8014AD24], G_IM_FMT_CI,
1744 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
1749 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
1755 if (charIndex == MSG_CHAR_ZH_RANK || charIndex == MSG_CHAR_ZH_CHAPTER) {
1756 gDPLoadTextureTile_4b(
gMainGfxPos++, D_801544A0[charIndex - MSG_CHAR_ZH_RANK], G_IM_FMT_CI,
1759 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
1760 }
else if (charIndex >= MSG_CHAR_ZH_START) {
1761 gDPLoadTextureTile_4b(
gMainGfxPos++, D_801544A0[D_8014AD24], G_IM_FMT_CI,
1764 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
1770 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
1775 gSPTextureRectangle(
gMainGfxPos++, ulx * 4, uly * 4, lrx * 4, lry * 4, G_TX_RENDERTILE, texOffsetX, texOffsetY,
1779 if (charIndex >= MSG_CHAR_ZH_START) {
1780 D_8014AD24 = (D_8014AD24 + 1) % 120;
1781 if (D_8014AD24 == 0) {
1825 s16 posX, s16 posY, s16 straightWidth, s16 curveWidth, s16 height, f32 scaleX, f32 scaleY, u8 opacity, s32 arg9)
1832 if (opacity == 255 && scaleX == 1.0 && scaleY == 1.0) {
1833 msg_draw_prim_rect(32, 128, 240, 0, posX - 1, posY + 1, curveWidth + (straightWidth + curveWidth) + 2, height - 2);
1836 negHeight = -height;
1845 temp_v0 = curveWidth + straightWidth;
1854 temp_v0_2 = curveWidth + temp_v0;
1865 if (scaleX != 1.0 || scaleY != 1.0) {
1866 guScaleF(sp60, scaleX, scaleY, 1.0f);
1873 G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
1877 gSPClearGeometryMode(
gMainGfxPos++, G_CULL_BOTH | G_LIGHTING);
1878 gSPSetGeometryMode(
gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
1880 gSPTexture(
gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
1889 if (opacity >= 255) {
1890 gDPSetRenderMode(
gMainGfxPos++, AA_EN | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
1891 GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM),
1892 AA_EN | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
1893 GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM));
1894 gDPSetCombineMode(
gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
1896 gDPSetRenderMode(
gMainGfxPos++, IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL |
1897 GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA),
1898 IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL |
1899 GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
1901 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 32, 32, 32, opacity);
1905 gDPSetTextureImage(
gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1,
1908 gDPSetTile(
gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0,
1909 G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
1913 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_bubble_left_png, G_IM_FMT_CI, 32, 0, 0, 0, 31, 63, 0,
1914 G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD);
1916 gSP2Triangles(
gMainGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0);
1917 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_bubble_mid_png, G_IM_FMT_CI, 8, 0, 0, 0, 7, 63, 0,
1918 G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, 6, G_TX_NOLOD, G_TX_NOLOD);
1920 gSP2Triangles(
gMainGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0);
1921 gDPLoadTextureTile_4b(
gMainGfxPos++,
ui_msg_bubble_right_png, G_IM_FMT_CI, 32, 0, 0, 0, 31, 63, 0,
1922 G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD);
1924 gSP2Triangles(
gMainGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0);
2043void msg_draw_frame(s32 posX, s32 posY, s32 sizeX, s32 sizeY, s32 style, s32 palette, s32 fading, s32 bgAlpha, s32 frameAlpha) {
2050 if (sizeX < 16 || sizeY < 16) {
2054 if (fading != 0 && bgAlpha == 0 && frameAlpha == 0) {
2067 if (fading == 0 || bgAlpha != 0) {
2079 if (fading != 0 && bgAlpha < 255) {
2080 gDPSetRenderMode(
gMainGfxPos++, IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
2082 gDPSetRenderMode(
gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
2084 gDPSetCombineMode(
gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
2085 gDPSetPrimColor(
gMainGfxPos++, 0, 0, r, g, b, bgAlpha);
2086 if (posX + sizeX - 8 > 0) {
2087 gDPScisFillRectangle(
gMainGfxPos++, posX + 8, posY + 8, posX + sizeX - 8, posY + sizeY - 8);
2093 gDPSetRenderMode(
gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
2095 if (fading == 0 || bgAlpha == 255) {
2096 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 0, 0, 0, 216);
2098 if (bgAlpha > 216) {
2101 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 0, 0, 0, bgAlpha);
2104 gDPLoadTextureBlock_4b(
gMainGfxPos++,
ui_msg_background_png, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 6, 6, G_TX_NOLOD, G_TX_NOLOD);
2106 gSPScisTextureRectangle(
gMainGfxPos++, (posX + 3) * 4, (posY + 3) * 4, (posX + sizeX - 3) * 4, (posY + sizeY - 3) * 4,
2109 gSPScisTextureRectangle(
gMainGfxPos++, (posX + 5) * 4, (posY + 5) * 4, (posX + sizeX - 5) * 4, (posY + sizeY - 5) * 4,
2117 quads[2].
ulx = (posX + 16) * 4;
2118 quads[2].
uly = posY * 4;
2119 quads[2].
lrx = (posX + sizeX - 16) * 4;
2120 quads[2].
lry = (posY + 8) * 4;
2122 quads[13].
ulx = (posX + 16) * 4;
2123 quads[13].
uly = (posY + sizeY - 8) * 4;
2124 quads[13].
lrx = (posX + sizeX - 16) * 4;
2125 quads[13].
lry = (posY + sizeY) * 4;
2126 }
else if (sizeX > 16 && sizeX < 24) {
2127 quads[2].
ulx = (posX + 8) * 4;
2128 quads[2].
uly = posY * 4;
2129 quads[2].
lrx = (posX + sizeX - 8) * 4;
2130 quads[2].
lry = (posY + 8) * 4;
2132 quads[13].
ulx = (posX + 8) * 4;
2133 quads[13].
uly = (posY + sizeY - 8) * 4;
2134 quads[13].
lrx = (posX + sizeX - 8) * 4;
2135 quads[13].
lry = (posY + sizeY) * 4;
2137 quads[2].
ulx = 10000;
2138 quads[13].
ulx = 10000;
2142 quads[7].
ulx = posX * 4;
2143 quads[7].
uly = (posY + 16) * 4;
2144 quads[7].
lrx = (posX + 8) * 4;
2145 quads[7].
lry = (posY + sizeY - 16) * 4;
2147 quads[8].
ulx = (posX + sizeX - 8) * 4;
2148 quads[8].
uly = (posY + 16) * 4;
2149 quads[8].
lrx = (posX + sizeX) * 4;
2150 quads[8].
lry = (posY + sizeY - 16) * 4;
2151 }
else if (sizeY > 16 && sizeY < 24) {
2152 quads[7].
ulx = posX * 4;
2153 quads[7].
uly = (posY + 8) * 4;
2154 quads[7].
lrx = (posX + 8) * 4;
2155 quads[7].
lry = (posY + sizeY - 8) * 4;
2157 quads[8].
ulx = (posX + sizeX - 8) * 4;
2158 quads[8].
uly = (posY + 8) * 4;
2159 quads[8].
lrx = (posX + sizeX) * 4;
2160 quads[8].
lry = (posY + sizeY - 8) * 4;
2162 quads[7].
ulx = 10000;
2163 quads[8].
ulx = 10000;
2167 quads[1].
ulx = (posX + 8) * 4;
2168 quads[1].
uly = posY * 4;
2169 quads[1].
lrx = (posX + 16) * 4;
2170 quads[1].
lry = (posY + 8) * 4;
2172 quads[3].
ulx = (posX + sizeX - 16) * 4;
2173 quads[3].
uly = posY * 4;
2174 quads[3].
lrx = (posX + sizeX - 8) * 4;
2175 quads[3].
lry = (posY + 8) * 4;
2177 quads[12].
ulx = (posX + 8) * 4;
2178 quads[12].
uly = (posY + sizeY - 8) * 4;
2179 quads[12].
lrx = (posX + 16) * 4;
2180 quads[12].
lry = (posY + sizeY) * 4;
2182 quads[14].
ulx = (posX + sizeX - 16) * 4;
2183 quads[14].
uly = (posY + sizeY - 8) * 4;
2184 quads[14].
lrx = (posX + sizeX - 8) * 4;
2185 quads[14].
lry = (posY + sizeY) * 4;
2187 quads[1].
ulx = 10000;
2188 quads[3].
ulx = 10000;
2189 quads[12].
ulx = 10000;
2190 quads[14].
ulx = 10000;
2194 quads[5].
ulx = posX * 4;
2195 quads[5].
uly = (posY + 8) * 4;
2196 quads[5].
lrx = (posX + 8) * 4;
2197 quads[5].
lry = (posY + 16) * 4;
2199 quads[6].
ulx = (posX + sizeX - 8) * 4;
2200 quads[6].
uly = (posY + 8) * 4;
2201 quads[6].
lrx = (posX + sizeX) * 4;
2202 quads[6].
lry = (posY + 16) * 4;
2204 quads[9].
ulx = posX * 4;
2205 quads[9].
uly = (posY + sizeY - 16) * 4;
2206 quads[9].
lrx = (posX + 8) * 4;
2207 quads[9].
lry = (posY + sizeY - 8) * 4;
2209 quads[10].
ulx = (posX + sizeX - 8) * 4;
2210 quads[10].
uly = (posY + sizeY - 16) * 4;
2211 quads[10].
lrx = (posX + sizeX) * 4;
2212 quads[10].
lry = (posY + sizeY - 8) * 4;
2214 quads[5].
ulx = 10000;
2215 quads[6].
ulx = 10000;
2216 quads[9].
ulx = 10000;
2217 quads[10].
ulx = 10000;
2220 quads[0].
ulx = posX * 4;
2221 quads[0].
uly = posY * 4;
2222 quads[0].
lrx = (posX + 8) * 4;
2223 quads[0].
lry = (posY + 8) * 4;
2225 quads[4].
ulx = (posX + sizeX - 8) * 4;
2226 quads[4].
uly = posY * 4;
2227 quads[4].
lrx = (posX + sizeX) * 4;
2228 quads[4].
lry = (posY + 8) * 4;
2230 quads[11].
ulx = posX * 4;
2231 quads[11].
uly = (posY + sizeY - 8) * 4;
2232 quads[11].
lrx = (posX + 8) * 4;
2233 quads[11].
lry = (posY + sizeY) * 4;
2235 quads[15].
ulx = (posX + sizeX - 8) * 4;
2236 quads[15].
uly = (posY + sizeY - 8) * 4;
2237 quads[15].
lrx = (posX + sizeX) * 4;
2238 quads[15].
lry = (posY + sizeY) * 4;
2261 gDPSetRenderMode(
gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
2263 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 0, 0, 0, frameAlpha);
2268 if (textures[i] != NULL && quads[i].ulx < 10000) {
2269 gDPLoadTextureTile_4b(
gMainGfxPos++, textures[i], G_IM_FMT_CI, 8, 8, 0, 0, 7, 7, 0, G_TX_WRAP, G_TX_WRAP, 3, 3, G_TX_NOLOD, G_TX_NOLOD);
2270 gSPScisTextureRectangle(
gMainGfxPos++, quads[i].ulx, quads[i].uly, quads[i].lrx, quads[i].lry,
2271 G_TX_RENDERTILE, 0, 0, 0x400, 0x400);