From 9e1eafac9bcfd21e077daf94a28a2f5758c628f2 Mon Sep 17 00:00:00 2001 From: Cuyler36 Date: Thu, 14 Aug 2025 10:06:22 -0400 Subject: [PATCH] More work on matching Aus version --- config/GAFU01_00/build.sha1 | 4 ++-- config/GAFU01_00/config.yml | 4 ++-- configure.py | 10 ++++---- include/graph.h | 22 +++++++++++++++++ src/actor/ac_animal_logo.c | 48 ++++++++++++++++++++++++++++++++++--- 5 files changed, 77 insertions(+), 11 deletions(-) diff --git a/config/GAFU01_00/build.sha1 b/config/GAFU01_00/build.sha1 index 32c72fba..c71f534c 100644 --- a/config/GAFU01_00/build.sha1 +++ b/config/GAFU01_00/build.sha1 @@ -1,2 +1,2 @@ -ae1eb839a218f96cfa09c730adadd932ba6bd1ce orig/GAFU01_00/sys/main.dol -7d91c20ebc85ef2197ca07eb7348d5477b2ff478 orig/GAFU01_00/files/foresta.rel +ae1eb839a218f96cfa09c730adadd932ba6bd1ce build/GAFU01_00/static.dol +7d91c20ebc85ef2197ca07eb7348d5477b2ff478 build/GAFU01_00/foresta/foresta.rel diff --git a/config/GAFU01_00/config.yml b/config/GAFU01_00/config.yml index fff9bed4..3a3e6eaa 100644 --- a/config/GAFU01_00/config.yml +++ b/config/GAFU01_00/config.yml @@ -1,6 +1,6 @@ object_base: orig/GAFU01_00 object: sys/main.dol -hash: ae1eb839a218f96cfa09c730adadd932ba6bd1ce +hash: AE1EB839A218F96CFA09C730ADADD932BA6BD1CE name: static symbols: config/GAFU01_00/symbols.txt splits: config/GAFU01_00/splits.txt @@ -429,7 +429,7 @@ extract: modules: - object: files/foresta.rel.szs - hash: 7d91c20ebc85ef2197ca07eb7348d5477b2ff478 + hash: 7D91C20EBC85EF2197CA07EB7348D5477B2FF478 symbols: config/GAFU01_00/foresta/symbols.txt splits: config/GAFU01_00/foresta/splits.txt # map: orig/GAFU01_00/files/foresta.map diff --git a/configure.py b/configure.py index 611a25de..65753b81 100644 --- a/configure.py +++ b/configure.py @@ -264,10 +264,12 @@ cflags_foresta = [ if version_num >= 1: cflags_foresta.append("-O4,p") cflags_foresta.append("-inline off") + config.linker_version = "GC/2.0" + foresta_compiler = "GC/2.0" else: cflags_foresta.append("-O4,s") - -config.linker_version = "GC/1.3.2" + config.linker_version = "GC/1.3.2" + foresta_compiler = "GC/1.3.2" # Helper function for Dolphin libraries @@ -308,7 +310,7 @@ def JSystemLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]: def Rel(lib_name: str, objects: List[Object]) -> Dict[str, Any]: return { "lib": lib_name, - "mw_version": "GC/1.3.2", + "mw_version": foresta_compiler, "cflags": cflags_foresta, "progress_category": "game", "objects": objects, @@ -958,7 +960,7 @@ config.libs = [ "actor", [ Object(Matching, "actor/ac_airplane.c"), - Object(MatchingFor("GAFE01_00"), "actor/ac_animal_logo.c"), + Object(Matching, "actor/ac_animal_logo.c"), Object(Matching, "actor/ac_ant.c"), Object(Matching, "actor/ac_aprilfool_control.c"), Object(Matching, "actor/ac_arrange_ftr.c"), diff --git a/include/graph.h b/include/graph.h index ae3146a3..887486b2 100644 --- a/include/graph.h +++ b/include/graph.h @@ -235,6 +235,28 @@ extern void graph_dt(GRAPH* graph); #define SHADOW_DISP __shadow_gfx +// clang-format off +#define OPEN_FONT_DISP(g) \ + do {} while (0); \ + OPEN_DISP(g); \ + { \ + Gfx* __font_gfx = NOW_FONT_DISP; \ + s32 __font_opened = 0; \ + do {} while (0) +// clang-format on + +// clang-format off +#define CLOSE_FONT_DISP(g) \ + do {} while (0); \ + (void)__font_opened; \ + SET_FONT_DISP(__font_gfx); \ + } \ + CLOSE_DISP(g); \ + do {} while (0) +// clang-format on + +#define FONT_DISP __font_gfx + #define GRAPH_ALLOC(graph, size) \ ((void*)((graph)->polygon_opaque_thaga.tha.tail_p = \ (char*)((int)(graph)->polygon_opaque_thaga.tha.tail_p - (int)(size)))) diff --git a/src/actor/ac_animal_logo.c b/src/actor/ac_animal_logo.c index 8fdb09f8..68af4c9f 100644 --- a/src/actor/ac_animal_logo.c +++ b/src/actor/ac_animal_logo.c @@ -30,6 +30,12 @@ #define TITLE_WIDTH 64 #define TITLE_HEIGHT 16 +#if VERSION == VER_GAFE01_00 +#define aAL_IN_FRAMES 121.0f +#elif VERSION == VER_GAFU01_00 +#define aAL_IN_FRAMES 101.0f +#endif + extern u8 log_win_nintendo1_tex[]; extern u8 log_win_nintendo2_tex[]; extern u8 log_win_nintendo3_tex[]; @@ -262,9 +268,9 @@ extern cKF_Animation_R_c cKF_ba_r_logo_us_cros; extern cKF_Animation_R_c cKF_ba_r_logo_us_sing; static void aAL_logo_in_init(ANIMAL_LOGO_ACTOR* actor, GAME* game) { - cKF_SkeletonInfo_R_init(&actor->animal.skeleton, actor->animal.skeleton.skeleton, &cKF_ba_r_logo_us_animal, 1.0f, 121.0f, 1.0f, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL); - cKF_SkeletonInfo_R_init(&actor->cros.skeleton, actor->cros.skeleton.skeleton, &cKF_ba_r_logo_us_cros, 1.0f, 121.0f, 1.0f, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL); - cKF_SkeletonInfo_R_init(&actor->sing.skeleton, actor->sing.skeleton.skeleton, &cKF_ba_r_logo_us_sing, 1.0f, 121.0f, 1.0f, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL); + cKF_SkeletonInfo_R_init(&actor->animal.skeleton, actor->animal.skeleton.skeleton, &cKF_ba_r_logo_us_animal, 1.0f, aAL_IN_FRAMES, 1.0f, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL); + cKF_SkeletonInfo_R_init(&actor->cros.skeleton, actor->cros.skeleton.skeleton, &cKF_ba_r_logo_us_cros, 1.0f, aAL_IN_FRAMES, 1.0f, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL); + cKF_SkeletonInfo_R_init(&actor->sing.skeleton, actor->sing.skeleton.skeleton, &cKF_ba_r_logo_us_sing, 1.0f, aAL_IN_FRAMES, 1.0f, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL); actor->copyright_opacity = 0; actor->titledemo_no = mTD_get_titledemo_no(); @@ -338,6 +344,7 @@ static void aAL_actor_move(ACTOR* actor, GAME* game) { (*logo_actor->action_proc)(logo_actor, game); } +#if VERSION == VER_GAFE01_00 static void aAL_copyright_draw(ANIMAL_LOGO_ACTOR* actor, GRAPH* graph) { static const u32 draw_pos_x[3] = { 61, 125, 189 }; static const u32 draw_pos_y[3] = { 198, 198, 198 }; @@ -419,6 +426,41 @@ static void aAL_copyright_draw(ANIMAL_LOGO_ACTOR* actor, GRAPH* graph) { CLOSE_DISP(graph); } +#elif VERSION == VER_GAFU01_00 +extern Gfx logo_nin_copyT_model[]; + +static void aAL_copyright_draw(ANIMAL_LOGO_ACTOR* actor, GRAPH* graph) { + // clang-format off + static const Gfx init_disp[] = { + gsSPTexture(0, 0, 0, 0, G_ON), + gsSPLoadGeometryMode(G_CULL_BACK), + gsDPSetOtherMode(G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2), + gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0), + gsSPEndDisplayList(), + }; + // clang-format on + + actor->copyright_opacity += aAL_COPYRIGHT_ALPHA_RATE; + if (actor->copyright_opacity >= 255) { + actor->copyright_opacity = 255; + } + + Matrix_push(); + + OPEN_FONT_DISP(graph); + + Matrix_translate(32.0f, -1376.0f, 0.0f, MTX_MULT); + Matrix_scale(0.16208267f, 0.16208267f, 0.16208267f, MTX_MULT); + gSPMatrix(FONT_DISP++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPSetPrimColor(FONT_DISP++, 0, 255, 255, 255, 255, actor->copyright_opacity); + gSPDisplayList(FONT_DISP++, init_disp); + gSPDisplayList(FONT_DISP++, logo_nin_copyT_model); + + CLOSE_FONT_DISP(graph); + + Matrix_pull(); +} +#endif static void aAL_tm_draw(GRAPH* graph) { static const Gfx init_disp[] = {