From 86cfc280d5949ea55108e34c8e9aa15b16162363 Mon Sep 17 00:00:00 2001 From: CreateSource <72283721+abnormalhare@users.noreply.github.com> Date: Tue, 28 Mar 2023 01:42:44 -0400 Subject: [PATCH] Changed some variable names in state_title_screen (#1003) * Changed some variable names in state_title_screen.c * resolving pull request items * changed TitleData to TitleScreenGfxData across sys * replace gbi names with understandable ones * accidentally switched logo and pressStart * changed GfxData to ImgList * Renaming and b32 * Doing this but more --- src/state_title_screen.c | 88 ++++++++++--------- ver/ique/asm/bss.s | 8 +- .../title_screen_draw_copyright.s | 4 +- ver/ique/symbol_addrs.txt | 2 +- ver/jp/asm/main.bss.s | 10 +-- ver/us/asm/bss.s | 8 +- ver/us/symbol_addrs.txt | 14 +-- 7 files changed, 68 insertions(+), 66 deletions(-) diff --git a/src/state_title_screen.c b/src/state_title_screen.c index 27f7a156c0..2b2b71094b 100644 --- a/src/state_title_screen.c +++ b/src/state_title_screen.c @@ -33,9 +33,11 @@ SaveMetadata gSaveSlotMetadata[4] = { }; u8 gSaveSlotHasData[4] = {TRUE, TRUE, TRUE, TRUE}; -s32 D_80077A28 = 0; -s32 D_80077A2C = 0; -s32 D_80077A30 = 0; + +s32 TitleScreen_PressStart_Alpha = 0; // the opacity of "PRESS START" text +b32 TitleScreen_PressStart_IsVisible = FALSE; // toggles the visibility of "PRESS START" +s32 TitleScreen_PressStart_BlinkCounter = 0; // counts to 16, then toggles TitleScreen_PressStart_IsVisible + s32 D_80077A34[1] = {0}; Lights1 D_80077A38 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0); @@ -62,19 +64,19 @@ Gfx D_80077A50[] = { }; typedef struct TitleDataStruct { - /* 0x0 */ s32 unk_00; - /* 0x4 */ s32 unk_04; - /* 0x8 */ s32 unk_08; - /* 0xC */ s32 img2_pal; + /* 0x0 */ s32 logo; + /* 0x4 */ s32 copyright; + /* 0x8 */ s32 pressStart; + /* 0xC */ s32 copyrightPalette; } TitleDataStruct; // size = 0x10 extern s16 D_800A0970; -extern TitleDataStruct* D_800A0974; -extern s32* D_800A0978; -extern s32* D_800A097C; -extern s32* D_800A0980; +extern TitleDataStruct* TitleScreen_ImgList; +extern s32* TitleScreen_ImgList_Logo; +extern s32* TitleScreen_ImgList_Copyright; +extern s32* TitleScreen_ImgList_PressStart; #if VERSION_JP -extern s32* JP_800A0980; +extern s32* TitleScreen_ImgList_CopyrightPalette; #endif extern s16 D_800A0988; @@ -102,15 +104,15 @@ void state_init_title_screen(void) { gGameStatusPtr->creditsViewportMode = -1; intro_logos_update_fade(); titleData = load_asset_by_name("title_data", &titleDataSize); - titleDataDst = D_800A0974 = heap_malloc(titleDataSize); + titleDataDst = TitleScreen_ImgList = heap_malloc(titleDataSize); decode_yay0(titleData, titleDataDst); general_heap_free(titleData); - D_800A0978 = (s32*)(D_800A0974->unk_00 + (s32) D_800A0974); - D_800A097C = (s32*)(D_800A0974->unk_04 + (s32) D_800A0974); - D_800A0980 = (s32*)(D_800A0974->unk_08 + (s32) D_800A0974); + TitleScreen_ImgList_Logo = (s32*)(TitleScreen_ImgList->logo + (s32) TitleScreen_ImgList); + TitleScreen_ImgList_Copyright = (s32*)(TitleScreen_ImgList->copyright + (s32) TitleScreen_ImgList); + TitleScreen_ImgList_PressStart = (s32*)(TitleScreen_ImgList->pressStart + (s32) TitleScreen_ImgList); #if VERSION_JP - JP_800A0980 = (s32*)(D_800A0974->img2_pal + (s32) D_800A0974); + TitleScreen_ImgList_CopyrightPalette = (s32*)(TitleScreen_ImgList->copyrightPalette + (s32) TitleScreen_ImgList); #endif create_cameras_a(); @@ -300,9 +302,9 @@ void state_step_title_screen(void) { void state_drawUI_title_screen(void) { switch (gGameStatusPtr->introState) { case INTRO_STATE_0: - D_80077A28 = 0; - D_80077A2C = 0; - D_80077A30 = 0; + TitleScreen_PressStart_Alpha = 0; + TitleScreen_PressStart_IsVisible = FALSE; + TitleScreen_PressStart_BlinkCounter = 0; draw_title_screen_NOP(); break; case INTRO_STATE_2: @@ -390,7 +392,7 @@ void title_screen_draw_logo(f32 arg0) { for (i = 0; i < TITLE_NUM_TILES; i++) { // Load a tile from the logo texture - gDPLoadTextureTile(gMainGfxPos++, &D_800A0978[i * TITLE_TILE_PIXELS], G_IM_FMT_RGBA, G_IM_SIZ_32b, + gDPLoadTextureTile(gMainGfxPos++, &TitleScreen_ImgList_Logo[i * TITLE_TILE_PIXELS], G_IM_FMT_RGBA, G_IM_SIZ_32b, TITLE_WIDTH, TITLE_TILE_HEIGHT, // width, height 0, 0, (TITLE_WIDTH - 1), (TITLE_TILE_HEIGHT - 1), // uls, ult, lrs, lrt 0, // pal @@ -418,37 +420,37 @@ void title_screen_draw_logo(f32 arg0) { #endif void title_screen_draw_press_start(void) { - switch (D_80077A2C) { - case 0: - D_80077A28 -= 128; - if (D_80077A28 < 0) { - D_80077A28 = 0; + switch (TitleScreen_PressStart_IsVisible) { + case FALSE: + TitleScreen_PressStart_Alpha -= 128; + if (TitleScreen_PressStart_Alpha < 0) { + TitleScreen_PressStart_Alpha = 0; } - D_80077A30++; - if (D_80077A30 >= 16) { - D_80077A30 = 0; - D_80077A2C = 1; + TitleScreen_PressStart_BlinkCounter++; + if (TitleScreen_PressStart_BlinkCounter >= 16) { + TitleScreen_PressStart_BlinkCounter = 0; + TitleScreen_PressStart_IsVisible = TRUE; } break; - case 1: - D_80077A28 += 128; - if (D_80077A28 > 255) { - D_80077A28 = 255; + case TRUE: + TitleScreen_PressStart_Alpha += 128; + if (TitleScreen_PressStart_Alpha > 255) { + TitleScreen_PressStart_Alpha = 255; } - D_80077A30++; - if (D_80077A30 >= 16) { - D_80077A30 = 0; - D_80077A2C = 0; + TitleScreen_PressStart_BlinkCounter++; + if (TitleScreen_PressStart_BlinkCounter >= 16) { + TitleScreen_PressStart_BlinkCounter = 0; + TitleScreen_PressStart_IsVisible = FALSE; } } gSPDisplayList(gMainGfxPos++, D_80077A50); gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 152, D_80077A28); + gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 152, TitleScreen_PressStart_Alpha); gDPPipeSync(gMainGfxPos++); - gDPLoadTextureBlock(gMainGfxPos++, D_800A0980, G_IM_FMT_IA, G_IM_SIZ_8b, 128, VAR_1, 0, G_TX_NOMIRROR | G_TX_WRAP, + gDPLoadTextureBlock(gMainGfxPos++, TitleScreen_ImgList_PressStart, G_IM_FMT_IA, G_IM_SIZ_8b, 128, VAR_1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(gMainGfxPos++, 384, 548, 896, VAR_2, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400); gDPPipeSync(gMainGfxPos++); @@ -478,8 +480,8 @@ void title_screen_draw_copyright(f32 arg0) { } #if VERSION_JP - gDPLoadTLUT_pal16(gMainGfxPos++, 0, JP_800A0980); - gDPLoadTextureTile_4b(gMainGfxPos++, D_800A097C, G_IM_FMT_CI, 128, 0, 0, 0, 127, 31, 0, + gDPLoadTLUT_pal16(gMainGfxPos++, 0, TitleScreen_ImgList_CopyrightPalette); + gDPLoadTextureTile_4b(gMainGfxPos++, TitleScreen_ImgList_Copyright, G_IM_FMT_CI, 128, 0, 0, 0, 127, 31, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(gMainGfxPos++, 388, 764, 900, 892, G_TX_RENDERTILE, @@ -487,7 +489,7 @@ void title_screen_draw_copyright(f32 arg0) { #else for (i = 0; i < 2; i++) { alpha = 0; // TODO figure out why this is needed - gDPLoadTextureTile(gMainGfxPos++, &D_800A097C[0x240 * i], G_IM_FMT_IA, G_IM_SIZ_8b, 144, 32, 0, 0, 143, 15, 0, + gDPLoadTextureTile(gMainGfxPos++, &TitleScreen_ImgList_Copyright[0x240 * i], G_IM_FMT_IA, G_IM_SIZ_8b, 144, 32, 0, 0, 143, 15, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(gMainGfxPos++, 356, 764 + (0x40 * i), 932, 828 + (0x40 * i), G_TX_RENDERTILE, diff --git a/ver/ique/asm/bss.s b/ver/ique/asm/bss.s index 5f0540303c..eb18f7e44b 100644 --- a/ver/ique/asm/bss.s +++ b/ver/ique/asm/bss.s @@ -406,16 +406,16 @@ dlabel D_800A0968 dlabel D_800A0970 .space 4 -dlabel D_800A0974 +dlabel TitleScreen_ImgList .space 4 -dlabel D_800A0978 +dlabel TitleScreen_ImgList_Logo .space 4 -dlabel D_800A097C +dlabel TitleScreen_ImgList_Copyright .space 4 -dlabel D_800A0980 +dlabel TitleScreen_ImgList_PressStart .space 4 dlabel D_800A0984 diff --git a/ver/ique/asm/nonmatchings/state_title_screen/title_screen_draw_copyright.s b/ver/ique/asm/nonmatchings/state_title_screen/title_screen_draw_copyright.s index f039182e44..e649919b5a 100644 --- a/ver/ique/asm/nonmatchings/state_title_screen/title_screen_draw_copyright.s +++ b/ver/ique/asm/nonmatchings/state_title_screen/title_screen_draw_copyright.s @@ -62,8 +62,8 @@ glabel title_screen_draw_copyright /* 12998 80037598 25299244 */ addiu $t1, $t1, %lo(gMainGfxPos) /* 1299C 8003759C 3C10FD68 */ lui $s0, (0xFD68008F >> 16) /* 129A0 800375A0 3610008F */ ori $s0, $s0, (0xFD68008F & 0xFFFF) -/* 129A4 800375A4 3C16800A */ lui $s6, %hi(D_800A097C) -/* 129A8 800375A8 26D6D38C */ addiu $s6, $s6, %lo(D_800A097C) +/* 129A4 800375A4 3C16800A */ lui $s6, %hi(TitleScreen_ImgList_Copyright) +/* 129A8 800375A8 26D6D38C */ addiu $s6, $s6, %lo(TitleScreen_ImgList_Copyright) /* 129AC 800375AC 3C0EF568 */ lui $t6, (0xF5682400 >> 16) /* 129B0 800375B0 35CE2400 */ ori $t6, $t6, (0xF5682400 & 0xFFFF) /* 129B4 800375B4 3C150700 */ lui $s5, (0x7000000 >> 16) diff --git a/ver/ique/symbol_addrs.txt b/ver/ique/symbol_addrs.txt index a7c2ae38c8..6d0755cb00 100644 --- a/ver/ique/symbol_addrs.txt +++ b/ver/ique/symbol_addrs.txt @@ -50,7 +50,7 @@ D_8009A5EC = 0x800991b8; __osContPifRam + 0x3C = 0x800AF94C; __osEepromTimerQ = 0x800d8e20; -D_800A097C = 0x8009d38c; +TitleScreen_ImgList_Copyright = 0x8009d38c; __osBbIsBb = 0x80000388; main_BSS_START = 0x80099170; diff --git a/ver/jp/asm/main.bss.s b/ver/jp/asm/main.bss.s index 31adb5dae5..4c1fb0d9af 100644 --- a/ver/jp/asm/main.bss.s +++ b/ver/jp/asm/main.bss.s @@ -325,19 +325,19 @@ dlabel D_800A0964 dlabel D_800A0970 .space 4 -dlabel D_800A0974 +dlabel TitleScreen_ImgList .space 4 -dlabel D_800A0978 +dlabel TitleScreen_ImgList_Logo .space 4 -dlabel D_800A097C +dlabel TitleScreen_ImgList_Copyright .space 4 -dlabel D_800A0980 +dlabel TitleScreen_ImgList_PressStart .space 4 -dlabel JP_800A0980 +dlabel TitleScreen_ImgList_CopyrightPalette .space 4 dlabel D_800A0988 diff --git a/ver/us/asm/bss.s b/ver/us/asm/bss.s index b6ebafd687..08784cb5f2 100644 --- a/ver/us/asm/bss.s +++ b/ver/us/asm/bss.s @@ -398,16 +398,16 @@ dlabel D_800A0968 dlabel D_800A0970 .space 4 -dlabel D_800A0974 +dlabel TitleScreen_ImgList .space 4 -dlabel D_800A0978 +dlabel TitleScreen_ImgList_Logo .space 4 -dlabel D_800A097C +dlabel TitleScreen_ImgList_Copyright .space 4 -dlabel D_800A0980 +dlabel TitleScreen_ImgList_PressStart .space 4 dlabel D_800A0984 diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index c0c5914335..67154d42c8 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -1394,9 +1394,9 @@ D_800779B0 = 0x800779B0; // type:data rom:0x52DB0 D_800779C0 = 0x800779C0; // type:data rom:0x52DC0 gSaveSlotMetadata = 0x800779C4; // type:data rom:0x52DC4 gSaveSlotHasData = 0x80077A24; // type:data rom:0x52E24 -D_80077A28 = 0x80077A28; // type:data rom:0x52E28 -D_80077A2C = 0x80077A2C; // type:data rom:0x52E2C -D_80077A30 = 0x80077A30; // type:data rom:0x52E30 +TitleScreen_PressStart_Alpha = 0x80077A28; // type:data rom:0x52E28 +TitleScreen_PressStart_isVisibile = 0x80077A2C; // type:data rom:0x52E2C +TitleScreen_PressStart_BlinkCounter = 0x80077A30; // type:data rom:0x52E30 D_80077A34 = 0x80077A34; // type:data rom:0x52E34 D_80077A38 = 0x80077A38; // type:data rom:0x52E38 D_80077A40 = 0x80077A40; // type:data rom:0x52E40 @@ -2752,10 +2752,10 @@ D_800A0963 = 0x800A0963; // type:data rom:0x7BD63 D_800A0964 = 0x800A0964; // type:data rom:0x7BD64 D_800A0968 = 0x800A0968; // type:data rom:0x7BD68 D_800A0970 = 0x800A0970; // type:data rom:0x7BD70 -D_800A0974 = 0x800A0974; // type:data rom:0x7BD74 -D_800A0978 = 0x800A0978; // type:data rom:0x7BD78 -D_800A097C = 0x800A097C; // type:data rom:0x7BD7C -D_800A0980 = 0x800A0980; // type:data rom:0x7BD80 +TitleScreen_ImgList = 0x800A0974; // type:data rom:0x7BD74 +TitleScreen_ImgList_Logo = 0x800A0978; // type:data rom:0x7BD78 +TitleScreen_ImgList_Copyright = 0x800A097C; // type:data rom:0x7BD7C +TitleScreen_ImgList_PressStart = 0x800A0980; // type:data rom:0x7BD80 D_800A0984 = 0x800A0984; // type:data rom:0x7BD84 D_800A0988 = 0x800A0988; // type:data rom:0x7BD88 D_800A098C = 0x800A098C; // type:data rom:0x7BD8C