2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-07-17 01:37:53 +00:00
|
|
|
u32 sFontColorRed = 255;
|
|
|
|
u32 sFontColorGreen = 255;
|
|
|
|
u32 sFontColorBlue = 255;
|
|
|
|
u32 sFontColorAlpha = 255;
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 D_80120120 = 0;
|
|
|
|
s32 D_80120124 = 0;
|
|
|
|
|
|
|
|
UNK_TYPE D_8015FFC0;
|
|
|
|
UNK_TYPE D_8015FFC4;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8007B910(u32 red, u32 green, u32 blue, u32 alpha) {
|
2020-03-17 04:31:30 +00:00
|
|
|
sFontColorRed = red;
|
|
|
|
sFontColorGreen = green;
|
|
|
|
sFontColorBlue = blue;
|
|
|
|
sFontColorAlpha = alpha;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8007B934(s32 arg0, s32 arg1) {
|
|
|
|
if (arg0 > 39) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120120 = 39 * 8;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if (arg0 < 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120120 = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120120 = arg0 * 8;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (arg1 > 29) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120124 = 29 * 8;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if (arg1 < 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120124 = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120124 = arg1 * 8;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1) {
|
2020-08-29 23:00:17 +00:00
|
|
|
s32 pad[2];
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
OPEN_DISPS(gfxCtx, "../z_moji.c", 86);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((u32)gLetterTLUT & 0xF) {
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf("moji_tlut --> %X\n", gLetterTLUT);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FFC0 != (arg1 & 3)) {
|
2020-10-29 21:31:09 +00:00
|
|
|
gDPLoadTLUT(POLY_OPA_DISP++, 16, 256, &gLetterTLUT[arg1 & 3]);
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FFC0 = arg1 & 3;
|
|
|
|
}
|
|
|
|
|
2020-11-19 21:49:08 +00:00
|
|
|
gSPTextureRectangle(POLY_OPA_DISP++, D_80120120 << 2, D_80120124 << 2, (D_80120120 + 8) << 2, (D_80120124 + 8) << 2,
|
|
|
|
G_TX_RENDERTILE, (u16)(arg1 & 4) * 64, (u16)(arg1 >> 3) * 256, 1024, 1024);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
CLOSE_DISPS(gfxCtx, "../z_moji.c", 123);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 i;
|
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
OPEN_DISPS(gfxCtx, "../z_moji.c", 137);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((u32)gFontFF & 0xF) {
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf("font_ff --> %X\n", gFontFF);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-10-29 21:31:09 +00:00
|
|
|
gDPPipeSync(POLY_OPA_DISP++);
|
|
|
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sFontColorRed, sFontColorGreen, sFontColorBlue, sFontColorAlpha);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-10-29 21:31:09 +00:00
|
|
|
gDPSetTextureImage(POLY_OPA_DISP++, G_IM_FMT_CI, G_IM_SIZ_16b, 1, (s32)gFontFF);
|
|
|
|
gDPSetTile(POLY_OPA_DISP++, G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
2020-03-22 21:19:43 +00:00
|
|
|
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
2020-10-29 21:31:09 +00:00
|
|
|
gDPLoadSync(POLY_OPA_DISP++);
|
|
|
|
gDPLoadBlock(POLY_OPA_DISP++, G_TX_LOADTILE, 0, 0, 511, 2048);
|
|
|
|
gDPPipeSync(POLY_OPA_DISP++);
|
|
|
|
gDPSetTile(POLY_OPA_DISP++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
2020-03-22 21:19:43 +00:00
|
|
|
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
2020-10-29 21:31:09 +00:00
|
|
|
gDPSetTileSize(POLY_OPA_DISP++, G_TX_RENDERTILE, 0, 0, 60, 508);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
D_8015FFC0 = -1;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; arg1[i] != 0; i++) {
|
|
|
|
switch (arg1[i]) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 9:
|
|
|
|
D_80120120 = (((D_80120120 / 8) / 8) + 1) * 8 * 8;
|
2020-09-15 19:10:19 +00:00
|
|
|
if (D_80120120 >= SCREEN_WIDTH) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120120 = 0;
|
|
|
|
D_80120124 += 8;
|
2020-09-15 19:10:19 +00:00
|
|
|
if (D_80120124 >= SCREEN_HEIGHT) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120124 = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
case 13:
|
|
|
|
D_80120120 = 0;
|
|
|
|
D_80120124 += 8;
|
2020-09-15 19:10:19 +00:00
|
|
|
if (D_80120124 >= SCREEN_HEIGHT) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_80120124 = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
func_8007B9A4(gfxCtx, arg1[i]);
|
|
|
|
D_80120120 += 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
CLOSE_DISPS(gfxCtx, "../z_moji.c", 181);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|