Match all but one func, split into TUs

This commit is contained in:
Cuyler36
2023-10-11 21:55:18 -04:00
parent b469454c34
commit fa52761dd2
5 changed files with 1233 additions and 1224 deletions
+13 -1224
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+84
View File
@@ -0,0 +1,84 @@
static u8* mFont_Get_MarkTex_p(int mark_type) {
static u8* tex_p_array[mFont_MARKTYPE_TOTAL] = {
FONT_nes_tex_jyouge,
FONT_nes_tex_sayuu,
FONT_nes_tex_cursor,
FONT_nes_tex_next,
FONT_nes_tex_choice
};
if (0 <= mark_type && mark_type < mFont_MARKTYPE_TOTAL && tex_p_array[mark_type] != NULL) {
return tex_p_array[mark_type];
}
return NULL;
}
static int mFont_Get_MarkTex_sizeW(int mark_type) {
static int size_array[mFont_MARKTYPE_TOTAL] = { 16, 16, 16, 16, 16 };
if (0 <= mark_type && mark_type < mFont_MARKTYPE_TOTAL && size_array[mark_type] != 0) {
return size_array[mark_type];
}
return 0;
}
static int mFont_Get_MarkTex_sizeH(int mark_type) {
static int size_array[mFont_MARKTYPE_TOTAL] = { 16, 16, 16, 16, 16 };
if (0 <= mark_type && mark_type < mFont_MARKTYPE_TOTAL && size_array[mark_type] != 0) {
return size_array[mark_type];
}
return 0;
}
extern f32 mFont_SetMarkChar(
GAME* game,
u8 mark_type,
f32 x, f32 y,
int r, int g, int b, int a,
int revert_flag,
f32 scale_x, f32 scale_y,
int mode
) {
f32 next_x = x;
if ((int)mark_type < mFont_MARKTYPE_TOTAL) {
u8* tex = mFont_Get_MarkTex_p(mark_type);
int w = mFont_Get_MarkTex_sizeW(mark_type);
int h = mFont_Get_MarkTex_sizeH(mark_type);
GRAPH* graph = game->graph;
Gfx* gfx = GRAPH_ALLOC_TYPE(graph, Gfx, 9);
if (tex != NULL && w != 0 && h != 0 && gfx != NULL) {
mFont_SetMode(graph, mode);
mFont_SetPrimColor(graph, r, g, b, a, mode);
mFont_SetCombineMode(graph, revert_flag, mode);
OPEN_DISP(graph);
if (mode == 1) {
gSPDisplayList(NOW_FONT_DISP++, gfx);
}
else {
gSPDisplayList(NOW_POLY_OPA_DISP++, gfx);
}
CLOSE_DISP(graph);
gDPLoadTextureTile_4b_Dolphin(
gfx++,
tex,
G_IM_FMT_I,
w, (h + 3)
);
gSPEndDisplayList(gfx);
next_x = mFont_SetVertexRectangle(game, x, y, w, h, scale_x, scale_y, mode);
}
}
return next_x;
}
+22
View File
@@ -0,0 +1,22 @@
static int mFont_Get_FontOffset(int c) {
static u8 offset_data[256] = {
6, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6,
6, 4, 4, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5,
7, 6, 5, 5, 5, 1, 4, 8, 6, 6, 1, 0, 8, 4, 8, 0,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 1, 4, 3, 4, 4,
2, 3, 5, 4, 4, 5, 5, 4, 4, 6, 6, 5, 5, 2, 4, 4,
5, 3, 5, 5, 5, 4, 4, 2, 5, 5, 6, 5, 0, 5, 5, 3,
5, 5, 5, 5, 5, 6, 7, 5, 4, 7, 7, 6, 7, 3, 5, 5,
5, 4, 6, 6, 7, 5, 6, 3, 6, 6, 7, 5, 5, 5, 5, 0,
0, 6, 6, 6, 6, 8, 4, 5, 5, 5, 5, 5, 5, 3, 5, 5,
0, 5, 5, 5, 5, 5, 5, 6, 6, 5, 5, 4, 5, 6, 6, 6,
3, 4, 2, 3, 5, 2, 2, 0, 0, 0, 0, 0, 5, 5, 5, 0,
1, 1, 1, 0, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0,
4, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4,
8, 3, 8, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
};
return offset_data[c];
}
+19
View File
@@ -0,0 +1,19 @@
extern void mFont_gppSetRectMode(Gfx** gfx_pp) {
static Gfx disp[] = {
gsDPPipeSync(),
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_BILERP),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetCombineMode(mFont_CC_FONT, mFont_CC_FONT),
gsDPSetRenderMode(G_RM_AA_DEC_LINE, G_RM_AA_DEC_LINE2),
gsDPSetPrimColor(0, 0, 255, 255, 255, 255),
gsSPEndDisplayList(),
};
gSPDisplayList((*gfx_pp)++, disp);
}