From db4eed23a2809145e6ec891241253cc3ec304b98 Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Sun, 19 Sep 2021 12:38:32 -0400 Subject: [PATCH] Add missing header includes, fix a couple of variable types and some warnings --- include/structs.h | 51 +++++++++++++++++++++++++++++++++++++++++++ src/fade_transition.c | 4 +++- src/font.c | 1 + src/font.h | 51 ------------------------------------------- src/game_text.c | 1 + src/gzip.c | 9 ++++---- src/menu.c | 2 +- src/menu.h | 2 +- 8 files changed, 63 insertions(+), 58 deletions(-) diff --git a/include/structs.h b/include/structs.h index 2a71d095..0656cd19 100644 --- a/include/structs.h +++ b/include/structs.h @@ -984,4 +984,55 @@ typedef struct unk80042178 { u8 pad0[0x20]; } unk80042178; +typedef struct unk8012A7E8_24 { + u8 unk00; + u8 unk01; + char *unk4; + s16 unk8; + s16 unkA; + s16 unkC; + s16 unkE; + u8 unk10; + u8 unk11; + u8 unk12; + u8 unk13; + u8 unk14; + u8 unk15; + u8 unk16; + u8 unk17; + u8 unk18; + u8 unk19; + struct unk8012A7E8_24 *unk1C; +} unk8012A7E8_24; + +/* Size: 0x28 bytes */ +typedef struct unk8012A7E8 { + s16 xpos; + s16 ypos; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; + s16 unkC; + s16 unkE; + u8 unk10; + u8 unk11; + u8 unk12; + u8 unk13; + u8 colorRed; + u8 colorGreen; + u8 colorBlue; + u8 colorAlpha; + u8 bgRed; + u8 bgGreen; + u8 bgBlue; + u8 bgAlpha; + u8 opacity; + u8 font; + u16 unk1E; + s16 unk20; + s16 unk22; + unk8012A7E8_24 *unk24; +} unk8012A7E8; + #endif diff --git a/src/fade_transition.c b/src/fade_transition.c index 0adaa99e..9bf6dfce 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -9,6 +9,8 @@ #include "asset_sections.h" #include "memory.h" #include "PR/libultra.h" +#include "video.h" +#include "textures_sprites.h" /************ .data ************/ @@ -457,7 +459,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/render_fade_circle.s") #if 0 // This doesn't work properly. void render_fade_waves(Gfx **dlist, s32 arg1, s32 arg2) { s32 i; - func_8007B3D0(); + func_8007B3D0(dlist); gSPDisplayList((*dlist)++, D_800E3648) for(i = 0; i < 6; i++) { s32 index = D_800E31D0[0] + i; diff --git a/src/font.c b/src/font.c index b1a80578..78a9070e 100644 --- a/src/font.c +++ b/src/font.c @@ -3,6 +3,7 @@ #include "font.h" #include "menu.h" +#include "textures_sprites.h" /************ .data ************/ diff --git a/src/font.h b/src/font.h index 2981da97..a02cade3 100644 --- a/src/font.h +++ b/src/font.h @@ -14,57 +14,6 @@ #include "f3ddkr.h" #include "textures_sprites.h" -typedef struct unk8012A7E8_24 { - u8 unk00; - u8 unk01; - char *unk4; - s16 unk8; - s16 unkA; - s16 unkC; - s16 unkE; - u8 unk10; - u8 unk11; - u8 unk12; - u8 unk13; - u8 unk14; - u8 unk15; - u8 unk16; - u8 unk17; - u8 unk18; - u8 unk19; - struct unk8012A7E8_24 *unk1C; -} unk8012A7E8_24; - -/* Size: 0x28 bytes */ -typedef struct unk8012A7E8 { - s16 xpos; - s16 ypos; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; - s16 unkC; - s16 unkE; - u8 unk10; - u8 unk11; - u8 unk12; - u8 unk13; - u8 colorRed; - u8 colorGreen; - u8 colorBlue; - u8 colorAlpha; - u8 bgRed; - u8 bgGreen; - u8 bgBlue; - u8 bgAlpha; - u8 opacity; - u8 font; - u16 unk1E; - s16 unk20; - s16 unk22; - unk8012A7E8_24 *unk24; -} unk8012A7E8; - /* Size: 0x20 bytes */ typedef struct unk8012A7EC { u8 unk0; diff --git a/src/game_text.c b/src/game_text.c index 3d82db49..01c742cc 100644 --- a/src/game_text.c +++ b/src/game_text.c @@ -5,6 +5,7 @@ #include "menu.h" #include "unknown_00BC20.h" #include "unknown_043920.h" +#include "unknown_06B2B0.h" /************ .data ************/ diff --git a/src/gzip.c b/src/gzip.c index 74b4a7a7..debda388 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -2,11 +2,12 @@ /* RAM_POS: 0x800C6170 */ #include "gzip.h" +#include "asset_loading.h" /************ .data ************/ huft *D_800E3760 = NULL; -u8 *D_800E3764 = NULL; +s32 *gAssetAddress = NULL; u8 *gzip_inflate_input = NULL; u8 *gzip_inflate_output = NULL; @@ -22,7 +23,7 @@ s32 D_8012AAD8; void func_800C6170(void) { D_800E3760 = (huft*)allocate_from_main_pool_safe(0x2800, COLOR_TAG_BLACK); - D_800E3764 = (u8*)allocate_from_main_pool_safe(0x10, COLOR_TAG_BLACK); + gAssetAddress = (s32*)allocate_from_main_pool_safe(0x10, COLOR_TAG_BLACK); } /** @@ -41,8 +42,8 @@ s32 byteswap32(u8 *arg0) { * Returns the uncompressed size of a gzip compressed asset. */ s32 get_asset_uncompressed_size(s32 assetIndex, s32 assetOffset) { - load_asset_to_address(assetIndex, D_800E3764, assetOffset, 8); - return byteswap32(D_800E3764); + load_asset_to_address(assetIndex, gAssetAddress, assetOffset, 8); + return byteswap32((u8 *)gAssetAddress); } /** diff --git a/src/menu.c b/src/menu.c index f3dab073..f4f5b9b1 100644 --- a/src/menu.c +++ b/src/menu.c @@ -6545,7 +6545,7 @@ void func_8009E9A8(void) { } -f32 func_8009E9B0(s32 arg0, Gfx **arg1, s32 *arg2, s32 *arg3) { +f32 func_8009E9B0(unk8012A7E8 *arg0, Gfx **arg1, s32 *arg2, s32 *arg3) { D_801263A0 = *arg1; D_801263A8 = *arg2; D_801263AC = *arg3; diff --git a/src/menu.h b/src/menu.h index 7aeebe89..c8c86129 100644 --- a/src/menu.h +++ b/src/menu.h @@ -765,7 +765,7 @@ s32 func_8009D9F4(void); s32 trophy_race_cabinet_menu_loop(void); void func_8009E9A0(void); void func_8009E9A8(void); -f32 func_8009E9B0(s32 arg0, Gfx **arg1, s32 *arg2, s32 *arg3); +f32 func_8009E9B0(unk8012A7E8 *arg0, Gfx **arg1, s32 *arg2, s32 *arg3); s64 *func_8009EA6C(void); s32 func_8009EA78(s64 arg0); s32 func_8009EABC(s64 arg0);