From bf803eac9905584da8f692f8bf6d8d174a7f8596 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 17 Mar 2022 21:29:15 +1000 Subject: [PATCH] Attempt to decompile titleRenderNoExpansion --- src/game/title.c | 61 +++++++++++++++++++++++++++++++++++++---- src/include/constants.h | 2 +- src/include/data.h | 2 ++ 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/game/title.c b/src/game/title.c index d0f4de5bf..0698b14b2 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -10814,6 +10814,57 @@ glabel titleRenderNoExpansion /* f01b91c: 03e00008 */ jr $ra /* f01b920: 00000000 */ nop ); + +// Mismatch: Need to find a way to allocate another cfe temp. +// (return value of viGetWidth() should go into sp40 but instead goes into sp3c) +//Gfx *titleRenderNoExpansion(Gfx *gdl) +//{ +// s32 textheight; +// s32 textwidth; +// s32 x; +// s32 y; +// char *text; // 4c +// u32 stack[3]; +// +// joyGetConnectedControllers(); +// +// gdl = func0f01afc0(gdl); +// gdl = func0f153628(gdl); +// +// x = 50; +// y = g_TitleViewHeight / 2 - 36; +// +// var80080108jf = 2; +// var8007fad0 = 2; +// +// if (1); +// text = langGet(L_MPWEAPONS_281); +// textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0); +// x = 288 - textwidth; +// gdl = textRenderProjected(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0); +// y += 18; +// +// if (1); +// text = langGet(L_MPWEAPONS_282); +// textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0); +// x = 288 - textwidth; +// gdl = textRenderProjected(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0); +// y += 18; +// +// if (1); +// text = langGet(L_MPWEAPONS_284); +// textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0); +// x = 288 - textwidth; +// gdl = textRenderProjected(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, viGetWidth(), viGetHeight(), 0, 0); +// y += 18; +// +// var80080108jf = 1; +// var8007fad0 = 1; +// +// gdl = func0f153780(gdl); +// +// return gdl; +//} #endif void titleSetNextMode(s32 mode) @@ -10868,7 +10919,7 @@ void titleTick(void) titleExitNoController(); break; #if VERSION >= VERSION_JPN_FINAL - case TITLEMODE_10: + case TITLEMODE_NOEXPANSION: titleExitNoExpansion(); break; #endif @@ -10924,7 +10975,7 @@ void titleTick(void) titleInitNoController(); break; #if VERSION >= VERSION_JPN_FINAL - case TITLEMODE_10: + case TITLEMODE_NOEXPANSION: titleInitNoExpansion(); break; #endif @@ -10956,7 +11007,7 @@ void titleTick(void) titleTickNoController(); break; #if VERSION >= VERSION_JPN_FINAL - case TITLEMODE_10: + case TITLEMODE_NOEXPANSION: titleTickNoExpansion(); break; #endif @@ -11007,7 +11058,7 @@ void titleExit(void) titleExitNoController(); break; #if VERSION >= VERSION_JPN_FINAL - case TITLEMODE_10: + case TITLEMODE_NOEXPANSION: titleExitNoExpansion(); break; #endif @@ -11135,7 +11186,7 @@ Gfx *titleRender(Gfx *gdl) gdl = titleRenderNoController(gdl); break; #if VERSION >= VERSION_JPN_FINAL - case TITLEMODE_10: + case TITLEMODE_NOEXPANSION: gdl = titleRenderNoExpansion(gdl); break; #endif diff --git a/src/include/constants.h b/src/include/constants.h index 8beacda8c..7f4851406 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -3990,7 +3990,7 @@ #define TITLEMODE_RAREPRESENTS1 7 #define TITLEMODE_RAREPRESENTS2 8 #define TITLEMODE_9 9 -#define TITLEMODE_10 10 +#define TITLEMODE_NOEXPANSION 10 #define TITLEAIMODE_RAREPRESENTS1 1 #define TITLEAIMODE_RARELOGO 2 diff --git a/src/include/data.h b/src/include/data.h index 62dec81dd..1a9fa13a5 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -425,6 +425,8 @@ extern s32 g_NextShardNum; extern bool g_ShardsActive; extern u32 var800800f0jf; extern s32 g_ScaleX; +extern u32 var80080108jf; +extern u32 var8007fad0; extern struct font *g_FontNumeric; extern struct fontchar *g_CharsNumeric; extern struct font *g_FontHandelGothicXs;