mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Merge pull request #168 from Ryan-Myers/master
More header files - font, game_text, gzip, main, memory
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "libultra_internal.h"
|
||||
#include "memory.h"
|
||||
|
||||
s32 D_800E38D0 = 0;
|
||||
|
||||
@@ -31,7 +32,7 @@ s32 __osBaseCounter;
|
||||
s32 D_8012D22C;
|
||||
s32 D_8012D230[4];
|
||||
s32 D_8012D240[108];
|
||||
s32 D_8012D3F0;
|
||||
MemoryPoolSlot *gMainMemoryPool;
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CE200/__osSiCreateAccessQueue.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CE200/__osSiGetAccess.s")
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define _UNKNOWN_0777A0_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "gzip.h"
|
||||
|
||||
void func_80076BA0(void);
|
||||
s32 *load_asset_section_from_rom(u32 assetIndex);
|
||||
|
||||
+7
-137
@@ -1,16 +1,7 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800C3C00 */
|
||||
|
||||
#include "memory.h"
|
||||
#include "video.h"
|
||||
#include "stacks.h"
|
||||
|
||||
#include "structs.h"
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "asset_sections.h"
|
||||
#include "libultra_internal.h"
|
||||
#include "f3ddkr.h"
|
||||
#include "font.h"
|
||||
|
||||
/************ .data ************/
|
||||
|
||||
@@ -40,7 +31,7 @@ s8 D_800E36E8 = 0;
|
||||
|
||||
// Descending powers of 10
|
||||
s32 gDescPowsOf10[9] = {
|
||||
1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10
|
||||
1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10,
|
||||
};
|
||||
|
||||
s8 D_800E3710[48] = {
|
||||
@@ -52,145 +43,35 @@ s8 D_800E3710[48] = {
|
||||
2, TRUE, -2, TRUE, -1,
|
||||
4, TRUE, -1, TRUE, 0,
|
||||
-1, 0, 0, 0, 0, // End of Data
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
OSDevMgr __osPiDevMgr = { 0, NULL, NULL, NULL, NULL, NULL, NULL };
|
||||
OSDevMgr __osPiDevMgr = { 0, NULL, NULL, NULL, NULL, NULL, NULL, };
|
||||
|
||||
/*******************************/
|
||||
|
||||
/************ .bss ************/
|
||||
|
||||
s32 gNumberOfFonts;
|
||||
|
||||
/* Size: 8 bytes */
|
||||
typedef struct FontCharData {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
} FontCharData;
|
||||
|
||||
/* Size: 0x400 bytes */
|
||||
typedef struct FontData {
|
||||
/* 0x000 */ s32 unk0;
|
||||
/* 0x004 */ char name[0x1C];
|
||||
/* 0x020 */ u16 unk20;
|
||||
/* 0x022 */ u16 unk22;
|
||||
/* 0x024 */ u16 unk24;
|
||||
/* 0x026 */ u16 unk26;
|
||||
/* 0x028 */ u8 unk28[24];
|
||||
/* 0x040 */ s16 unk40[32];
|
||||
/* 0x080 */ TextureHeader *texturePointers[32];
|
||||
/* 0x100 */ FontCharData unk100[96];
|
||||
} FontData;
|
||||
|
||||
FontData *gFonts;
|
||||
|
||||
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;
|
||||
|
||||
unk8012A7E8 (*D_8012A7E8)[1];
|
||||
|
||||
/* Size: 0x20 bytes */
|
||||
typedef struct unk8012A7EC {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
u8 unk10;
|
||||
u8 unk11;
|
||||
u8 unk12;
|
||||
u8 unk13;
|
||||
u8 unk14;
|
||||
u8 unk15;
|
||||
u8 unk16;
|
||||
u8 unk17;
|
||||
s32 unk18;
|
||||
s32 unk1C;
|
||||
} unk8012A7EC;
|
||||
unk8012A7EC (*D_8012A7EC)[1];
|
||||
|
||||
s32 D_8012A7F0;
|
||||
s8 D_8012A7F4;
|
||||
s32 D_8012A7F8;
|
||||
s32 D_8012A7FC;
|
||||
|
||||
/******************************/
|
||||
|
||||
void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3);
|
||||
void parse_string_with_number(unsigned char *input, char *output, s32 number);
|
||||
void func_800C4170(s32 arg0);
|
||||
|
||||
#define unk8012A7E8_COUNT 8
|
||||
#define unk8012A7EC_COUNT 64
|
||||
#define unk8012A7E8_TOTAL_SIZE (sizeof(unk8012A7E8) * unk8012A7E8_COUNT)
|
||||
#define unk8012A7EC_TOTAL_SIZE (sizeof(unk8012A7EC) * unk8012A7EC_COUNT)
|
||||
|
||||
void load_fonts(void) {
|
||||
u8 *fontAssetData;
|
||||
s32 *fontAssetData;
|
||||
s32 i;
|
||||
|
||||
fontAssetData = load_asset_section_from_rom(ASSET_BINARY_44);
|
||||
|
||||
gFonts = (FontData*)(fontAssetData); // ???
|
||||
gNumberOfFonts = *((s32*)fontAssetData);
|
||||
gFonts = (FontData*)(fontAssetData + 4);
|
||||
gNumberOfFonts = *(fontAssetData);
|
||||
gFonts = (FontData*)(fontAssetData + 1);
|
||||
|
||||
for (i = 0; i < gNumberOfFonts; i++) {
|
||||
gFonts[i].unk28[0] = 0;
|
||||
@@ -345,8 +226,6 @@ void set_text_background_color(s32 red, s32 green, s32 blue, s32 alpha) {
|
||||
(*D_8012A7E8)[0].bgAlpha = alpha;
|
||||
}
|
||||
|
||||
void func_800C45A4(Gfx **dlist, unk8012A7E8 *arg1, u8 *text, s32 alignmentFlags, f32 arg4);
|
||||
|
||||
// Unused?
|
||||
void func_800C4404(Gfx** displayList, char *text, s32 alignmentFlags) {
|
||||
func_800C45A4(displayList, &(*D_8012A7E8)[0], text, alignmentFlags, 1.0f);
|
||||
@@ -557,14 +436,6 @@ void func_800C5494(s32 arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct unk800C54E8 {
|
||||
u8 pad0[0xC];
|
||||
s16 unkC;
|
||||
s16 unkE;
|
||||
u8 pad10[9];
|
||||
u8 unk19;
|
||||
} unk800C54E8;
|
||||
|
||||
// Unused
|
||||
void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) {
|
||||
FontData *fontData;
|
||||
@@ -679,7 +550,6 @@ void s32_to_string(char** outString, s32 number) {
|
||||
(*outString)++;
|
||||
}
|
||||
#else
|
||||
void s32_to_string(char**, s32);
|
||||
GLOBAL_ASM("asm/non_matchings/font/s32_to_string.s")
|
||||
#endif
|
||||
|
||||
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
#ifndef _FONT_H_
|
||||
#define _FONT_H_
|
||||
|
||||
#include "memory.h"
|
||||
#include "video.h"
|
||||
#include "stacks.h"
|
||||
|
||||
#include "asset_loading.h"
|
||||
#include "structs.h"
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "asset_sections.h"
|
||||
#include "libultra_internal.h"
|
||||
#include "f3ddkr.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;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
u8 unk10;
|
||||
u8 unk11;
|
||||
u8 unk12;
|
||||
u8 unk13;
|
||||
u8 unk14;
|
||||
u8 unk15;
|
||||
u8 unk16;
|
||||
u8 unk17;
|
||||
s32 unk18;
|
||||
s32 unk1C;
|
||||
} unk8012A7EC;
|
||||
|
||||
typedef struct unk800C54E8 {
|
||||
u8 pad0[0xC];
|
||||
s16 unkC;
|
||||
s16 unkE;
|
||||
u8 pad10[9];
|
||||
u8 unk19;
|
||||
} unk800C54E8;
|
||||
|
||||
/* Size: 8 bytes */
|
||||
typedef struct FontCharData {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
} FontCharData;
|
||||
|
||||
/* Size: 0x400 bytes */
|
||||
typedef struct FontData {
|
||||
/* 0x000 */ s32 unk0;
|
||||
/* 0x004 */ char name[0x1C];
|
||||
/* 0x020 */ u16 unk20;
|
||||
/* 0x022 */ u16 unk22;
|
||||
/* 0x024 */ u16 unk24;
|
||||
/* 0x026 */ u16 unk26;
|
||||
/* 0x028 */ u8 unk28[24];
|
||||
/* 0x040 */ s16 unk40[32];
|
||||
/* 0x080 */ TextureHeader *texturePointers[32];
|
||||
/* 0x100 */ FontCharData unk100[96];
|
||||
} FontData;
|
||||
|
||||
#define unk8012A7E8_COUNT 8
|
||||
#define unk8012A7EC_COUNT 64
|
||||
#define unk8012A7E8_TOTAL_SIZE (sizeof(unk8012A7E8) * unk8012A7E8_COUNT)
|
||||
#define unk8012A7EC_TOTAL_SIZE (sizeof(unk8012A7EC) * unk8012A7EC_COUNT)
|
||||
|
||||
f32 func_8009E9B0(s32 arg0, Gfx **arg1, s32 *arg2, s32 *arg3); //menu.c
|
||||
void func_8009E9A0(void); //menu.c
|
||||
void func_8009E9A8(void); //menu.c
|
||||
//TextureHeader *load_texture(s32 arg0); //texture_sprites.c NON_MATCHING
|
||||
|
||||
void load_fonts(void);
|
||||
void func_800C4164(s32 arg0);
|
||||
void set_text_font(s32 arg0);
|
||||
void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3);
|
||||
void set_text_color(s32 red, s32 green, s32 blue, s32 alpha, s32 opacity);
|
||||
void set_text_background_color(s32 red, s32 green, s32 blue, s32 alpha);
|
||||
void func_800C4404(Gfx** displayList, char *text, s32 alignmentFlags);
|
||||
void draw_text(Gfx** displayList, s32 xpos, s32 ypos, char *text, s32 alignmentFlags);
|
||||
void func_800C44C0(Gfx** displayList, s32 arg1, char *text, s32 alignmentFlags);
|
||||
void func_800C4510(Gfx** displayList, s32 arg1, s32 xpos, s32 ypos, char *text, s32 alignmentFlags);
|
||||
void func_800C4EDC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
|
||||
void func_800C4F7C(s32 arg0, s32 font);
|
||||
void func_800C4FBC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
|
||||
void func_800C5000(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity);
|
||||
void func_800C5050(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
|
||||
void func_800C5094(s32 arg0, s32 arg1, s32 arg2);
|
||||
void func_800C50D8(s32 arg0);
|
||||
void func_800C510C(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
|
||||
void func_800C5428(s32 arg0, unk8012A7E8_24 *arg1);
|
||||
void func_800C5494(s32 arg0);
|
||||
void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4);
|
||||
void func_800C55F4(s32 arg0);
|
||||
void func_800C5620(s32 arg0);
|
||||
void func_800C564C(s32 arg0);
|
||||
void func_800C5678(s32 arg0);
|
||||
void func_800C56A4(s32 arg0);
|
||||
void func_800C56D0(s32 arg0);
|
||||
void func_800C56FC(s32 arg0, s32 arg1, s32 arg2);
|
||||
void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry);
|
||||
void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3);
|
||||
void parse_string_with_number(unsigned char *input, char *output, s32 number);
|
||||
|
||||
void s32_to_string(char** outString, s32 number); //Non Matching
|
||||
TextureHeader *func_800C4318(s32 font, u8 arg1); //Non Matching
|
||||
void func_800C4170(s32 arg0); //Non Matching
|
||||
void func_800C422C(s32 arg0); //Non Matching
|
||||
void func_800C45A4(Gfx **dlist, unk8012A7E8 *arg1, u8 *text, s32 alignmentFlags, f32 arg4); //Non Matching
|
||||
s32 func_800C4DA0(u8 *text, s32 x, s32 font); //Non Matching
|
||||
//void func_800C5168(s32, s16, s16, s32, s32, s32); //Non Matching
|
||||
|
||||
#endif
|
||||
+1
-23
@@ -1,12 +1,7 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800C29F0 */
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "f3ddkr.h"
|
||||
#include "asset_sections.h"
|
||||
#include "memory.h"
|
||||
#include "PR/libultra.h"
|
||||
#include "game_text.h"
|
||||
|
||||
/************ .data ************/
|
||||
|
||||
@@ -20,16 +15,6 @@ s32 D_800E3680 = 1;
|
||||
|
||||
/************ .bss ************/
|
||||
|
||||
typedef struct unk8012A7C8 {
|
||||
u8 *unk0;
|
||||
u8 *unk4;
|
||||
} unk8012A7C8;
|
||||
|
||||
typedef struct unk8012A798 {
|
||||
u8 *unk0;
|
||||
u8 *unk4;
|
||||
} unk8012A798;
|
||||
|
||||
u8 *D_8012A780;
|
||||
s8 D_8012A784;
|
||||
s8 D_8012A785;
|
||||
@@ -65,13 +50,6 @@ s32 D_8012A7DC;
|
||||
|
||||
/*****************************/
|
||||
|
||||
extern u32 osTvType;
|
||||
|
||||
void func_800C2F1C(s32);
|
||||
void func_8005A3B0(void);
|
||||
void func_800C31EC(s32);
|
||||
s8 func_8000C8B4(s32);
|
||||
|
||||
void func_800C29F0(void) {
|
||||
D_8012A7C8.unk0 = (u8 *)allocate_from_main_pool_safe(0x780, COLOR_TAG_GREEN);
|
||||
D_8012A7C8.unk4 = D_8012A7C8.unk0 + 0x3C0;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef _GAME_TEXT_H_
|
||||
#define _GAME_TEXT_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "f3ddkr.h"
|
||||
#include "asset_sections.h"
|
||||
#include "memory.h"
|
||||
#include "font.h"
|
||||
#include "PR/libultra.h"
|
||||
|
||||
typedef struct unk8012A7C8 {
|
||||
u8 *unk0;
|
||||
u8 *unk4;
|
||||
} unk8012A7C8;
|
||||
|
||||
typedef struct unk8012A798 {
|
||||
u8 *unk0;
|
||||
u8 *unk4;
|
||||
} unk8012A798;
|
||||
|
||||
extern u32 osTvType;
|
||||
|
||||
void func_8005A3B0(void); //unknown_043920.c
|
||||
s32 func_8000C8B4(s32 arg0); //unknown_00BC20.c
|
||||
void func_8009CFB0(void); //menu.c
|
||||
s32 func_8009CFEC(u32 arg0); //menu.c
|
||||
|
||||
void func_800C29F0(void);
|
||||
void func_800C2AB4(void);
|
||||
void func_800C2AF4(s32 arg0);
|
||||
void func_800C2F1C(s32 arg0);
|
||||
void func_800C3048(void);
|
||||
void func_800C30CC(void);
|
||||
void func_800C3140(s32 arg0);
|
||||
void func_800C314C(void);
|
||||
void func_800C3158(s32 arg0, f32 arg1);
|
||||
s32 func_800C3400(void);
|
||||
void func_800C3440(s32 arg0);
|
||||
|
||||
void func_800C31EC(s32); //Non Matching
|
||||
|
||||
#endif
|
||||
+1
-18
@@ -1,22 +1,7 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800C6170 */
|
||||
|
||||
#include "memory.h"
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
|
||||
typedef struct huft {
|
||||
u8 e; /* number of extra bits or operation */
|
||||
u8 b; /* number of bits in this code or subcode */
|
||||
union {
|
||||
u16 n; /* literal, length base, or distance base */
|
||||
struct huft *t; /* pointer to next level of table */
|
||||
} v;
|
||||
} huft;
|
||||
|
||||
/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */
|
||||
#define BMAX 16 /* maximum bit length of any code (16 for explode) */
|
||||
#define N_MAX 288 /* maximum number of codes in any set */
|
||||
#include "gzip.h"
|
||||
|
||||
/************ .data ************/
|
||||
|
||||
@@ -60,8 +45,6 @@ s32 get_asset_uncompressed_size(s32 assetIndex, s32 assetOffset) {
|
||||
return byteswap32(D_800E3764);
|
||||
}
|
||||
|
||||
s32 gzip_inflate_block(void);
|
||||
|
||||
/**
|
||||
* Decompresses gzip data.
|
||||
* Returns the pointer to the decompressed data.
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#ifndef _GZIP_H_
|
||||
#define _GZIP_H_
|
||||
|
||||
#include "memory.h"
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
|
||||
typedef struct huft {
|
||||
u8 e; /* number of extra bits or operation */
|
||||
u8 b; /* number of bits in this code or subcode */
|
||||
union {
|
||||
u16 n; /* literal, length base, or distance base */
|
||||
struct huft *t; /* pointer to next level of table */
|
||||
} v;
|
||||
} huft;
|
||||
|
||||
/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */
|
||||
#define BMAX 16 /* maximum bit length of any code (16 for explode) */
|
||||
#define N_MAX 288 /* maximum number of codes in any set */
|
||||
|
||||
void func_800C6170(void);
|
||||
s32 byteswap32(u8 *arg0);
|
||||
s32 get_asset_uncompressed_size(s32 assetIndex, s32 assetOffset);
|
||||
u8 *gzip_inflate(u8 *compressedInput, u8 *decompressedOutput);
|
||||
|
||||
|
||||
s32 gzip_inflate_block(void); // Non Matching
|
||||
void gzip_huft_build(u32 *b, u32 n, u32 s, u16 *d, u16 *e, huft **t, s32 *m); // Non Matching
|
||||
|
||||
#endif
|
||||
+6
-11
@@ -1,9 +1,7 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x80065D40 */
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "libultra_internal.h"
|
||||
#include "main.h"
|
||||
|
||||
/************ .rodata ************/
|
||||
|
||||
@@ -16,12 +14,12 @@ const char D_800E6ED0[] = "WARNING: Stack overflow/underflow!!!\n";
|
||||
|
||||
/************ .bss ************/
|
||||
|
||||
s32 *D_8011D750; // stack pointer for thread 1
|
||||
s32 *gThread1StackPointer; // stack pointer for thread 1
|
||||
s32 D_8011D754;
|
||||
s32 D_8011D758[2048];
|
||||
s32 *D_8011F758;
|
||||
s32 D_8011F75C;
|
||||
OSThread *D_8011F760; // OSThread for thread 1
|
||||
OSThread *gThread1; // OSThread for thread 1
|
||||
s32 D_8011F764;
|
||||
s32 D_8011F768[106];
|
||||
OSThread *D_8011F910; // OSThread for thread 3
|
||||
@@ -30,19 +28,16 @@ s32 D_8011F918[1130];
|
||||
|
||||
/******************************/
|
||||
|
||||
void func_80065D98(s32 arg0);
|
||||
void thread3_main(s32 arg0);
|
||||
|
||||
void main(void) {
|
||||
osInitialize();
|
||||
osCreateThread(&D_8011F760, 1, &func_80065D98, 0, &D_8011D750, 0);
|
||||
osStartThread(&D_8011F760);
|
||||
osCreateThread(&gThread1, 1, (OSId) &func_80065D98, 0, &gThread1StackPointer, (OSPri) 0);
|
||||
osStartThread(&gThread1);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_80065D98(s32 arg0) {
|
||||
func_800B6F50();
|
||||
osCreateThread(&D_8011F910, 3, &thread3_main, 0, &D_8011F758, 10);
|
||||
osCreateThread(&D_8011F910, 3, (OSId) &thread3_main, 0, &D_8011F758, (OSPri) 10);
|
||||
D_8011D758[2049] = 0;
|
||||
D_8011D758[2048] = 0;
|
||||
D_8011D758[1] = 0;
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
#ifndef _MAIN_H_
|
||||
#define _MAIN_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "libultra_internal.h"
|
||||
|
||||
void thread3_main(s32 arg0); //unknown_06B2B0.c
|
||||
|
||||
void main(void);
|
||||
|
||||
void func_80065D98(s32 arg0); //Non Matching
|
||||
//void func_80065E30(void); //Non Matching
|
||||
|
||||
#endif
|
||||
+4
-70
@@ -3,13 +3,6 @@
|
||||
|
||||
#include "memory.h"
|
||||
|
||||
#include "structs.h"
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
|
||||
#define RAM_END 0x80400000
|
||||
#define MAIN_POOL_SLOT_COUNT 1600
|
||||
|
||||
/************ .rodata ************/
|
||||
|
||||
const char D_800E7210[] = "*** mmAlloc: size = 0 ***\n";
|
||||
@@ -31,36 +24,6 @@ const char D_800E7488[] = "Unable to record %d slots, colours overflowed table.\
|
||||
|
||||
/************ .bss ************/
|
||||
|
||||
/* Size: 0x8 bytes */
|
||||
typedef struct unk80070BE4_8_0 {
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s32 unk4;
|
||||
} unk80070BE4_8_0;
|
||||
|
||||
/* Size: 0x14 bytes */
|
||||
typedef struct MemoryPoolSlot {
|
||||
/* 0x00 */ unk80070BE4_8_0 *unk0;
|
||||
/* 0x04 */ s32 size;
|
||||
/* 0x08 */ s16 flags;
|
||||
// 0x00 = Slot is free
|
||||
// 0x01 = Slot is being used?
|
||||
// 0x02 = ???
|
||||
// 0x04 = ???
|
||||
/* 0x0A */ s16 prevIndex;
|
||||
/* 0x0C */ s16 nextIndex;
|
||||
/* 0x0E */ s16 index;
|
||||
/* 0x10 */ u32 colorTag;
|
||||
} MemoryPoolSlot;
|
||||
|
||||
/* Size: 0x10 bytes */
|
||||
typedef struct MemoryPool {
|
||||
/* 0x00 */ s32 maxNumSlots;
|
||||
/* 0x04 */ s32 curNumSlots;
|
||||
/* 0x08 */ MemoryPoolSlot *slots;
|
||||
/* 0x0C */ s32 size;
|
||||
} MemoryPool;
|
||||
|
||||
MemoryPool gMemoryPools[4];
|
||||
|
||||
#ifndef _ALIGN16
|
||||
@@ -69,15 +32,7 @@ MemoryPool gMemoryPools[4];
|
||||
|
||||
s32 gNumberOfMemoryPools;
|
||||
s32 D_801235C4;
|
||||
|
||||
/* Size: 0x8 bytes */
|
||||
typedef struct FreeQueueSlot {
|
||||
void *dataAddress;
|
||||
u8 unk4;
|
||||
} FreeQueueSlot;
|
||||
|
||||
FreeQueueSlot gFreeQueue[256];
|
||||
|
||||
s32 gFreeQueueCount;
|
||||
s32 gFreeQueueState;
|
||||
s32 D_80123DD0[64];
|
||||
@@ -85,28 +40,10 @@ s32 D_80123ED0[64];
|
||||
s32 D_80123FD0[8];
|
||||
s32 D_80123FF0[8];
|
||||
|
||||
extern MemoryPoolSlot D_8012D3F0;
|
||||
extern MemoryPoolSlot *gMainMemoryPool;
|
||||
|
||||
/******************************/
|
||||
|
||||
/* Unknown size */
|
||||
typedef struct unk800B7D10 {
|
||||
u8 pad0[0x14];
|
||||
s32 unk14;
|
||||
} unk800B7D10;
|
||||
|
||||
unk800B7D10 *get_stack_pointer(void);
|
||||
MemoryPoolSlot *allocate_from_memory_pool(s32, s32, u32);
|
||||
|
||||
MemoryPoolSlot *new_memory_pool(MemoryPoolSlot *arg0, s32 size, s32 numSlots);
|
||||
void set_free_queue_state(s32);
|
||||
void *allocate_from_main_pool_safe(s32, u32);
|
||||
s32 *func_8006F510(void);
|
||||
void func_8006F53C(s32*);
|
||||
void func_80071440(void *dataAddress);
|
||||
s32 get_memory_pool_index_containing_address(u8 *address);
|
||||
void free_memory_pool_slot(s32 poolIndex, s32 slotIndex);
|
||||
|
||||
/**
|
||||
* Creates the main memory pool.
|
||||
* Starts at 0x8012D3F0. Ends at 0x80400000. Contains 1600 allocation slots.
|
||||
@@ -115,7 +52,7 @@ void init_main_memory_pool(void) {
|
||||
gNumberOfMemoryPools = -1;
|
||||
if(1) {
|
||||
// Create the main memory pool.
|
||||
new_memory_pool(&D_8012D3F0, RAM_END - (s32)(&D_8012D3F0), MAIN_POOL_SLOT_COUNT);
|
||||
new_memory_pool(&gMainMemoryPool, RAM_END - (s32)(&gMainMemoryPool), MAIN_POOL_SLOT_COUNT);
|
||||
}
|
||||
set_free_queue_state(2);
|
||||
gFreeQueueCount = 0;
|
||||
@@ -292,8 +229,6 @@ void *allocate_at_address_in_main_pool(s32 size, u8 *address, u32 colorTag) {
|
||||
GLOBAL_ASM("asm/non_matchings/memory/allocate_at_address_in_main_pool.s")
|
||||
#endif
|
||||
|
||||
void free_slot_containing_address(u8 *address);
|
||||
|
||||
/**
|
||||
* Sets the state of the free queue. State is either 0, 1, or 2.
|
||||
* The free queue will get flushed if the state is set to 0.
|
||||
@@ -399,8 +334,8 @@ void func_80071314(void) {
|
||||
GLOBAL_ASM("asm/non_matchings/memory/free_slot_containing_address.s")
|
||||
#endif
|
||||
|
||||
void func_80071440(void *data) {
|
||||
gFreeQueue[gFreeQueueCount].dataAddress = data;
|
||||
void func_80071440(void *dataAddress) {
|
||||
gFreeQueue[gFreeQueueCount].dataAddress = dataAddress;
|
||||
gFreeQueue[gFreeQueueCount].unk4 = gFreeQueueState;
|
||||
gFreeQueueCount++;
|
||||
}
|
||||
@@ -650,7 +585,6 @@ void render_memory_color_tags(void) {
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
|
||||
// Unused. Does nothing?
|
||||
void func_80071C74(void) {
|
||||
s32 i, flags;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
#ifndef _MEMORY_H_
|
||||
#define _MEMORY_H_
|
||||
|
||||
#include "structs.h"
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
|
||||
#define RAM_END 0x80400000
|
||||
#define MAIN_POOL_SLOT_COUNT 1600
|
||||
|
||||
// Animation related?
|
||||
#define COLOR_TAG_RED 0xFF0000FF
|
||||
@@ -24,8 +29,76 @@
|
||||
// ???
|
||||
#define COLOR_TAG_BLACK 0x000000FF
|
||||
|
||||
/* Size: 0x8 bytes */
|
||||
typedef struct unk80070BE4_8_0 {
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s32 unk4;
|
||||
} unk80070BE4_8_0;
|
||||
|
||||
/* Size: 0x14 bytes */
|
||||
typedef struct MemoryPoolSlot {
|
||||
/* 0x00 */ unk80070BE4_8_0 *unk0;
|
||||
/* 0x04 */ s32 size;
|
||||
/* 0x08 */ s16 flags;
|
||||
// 0x00 = Slot is free
|
||||
// 0x01 = Slot is being used?
|
||||
// 0x02 = ???
|
||||
// 0x04 = ???
|
||||
/* 0x0A */ s16 prevIndex;
|
||||
/* 0x0C */ s16 nextIndex;
|
||||
/* 0x0E */ s16 index;
|
||||
/* 0x10 */ u32 colorTag;
|
||||
} MemoryPoolSlot;
|
||||
|
||||
/* Size: 0x10 bytes */
|
||||
typedef struct MemoryPool {
|
||||
/* 0x00 */ s32 maxNumSlots;
|
||||
/* 0x04 */ s32 curNumSlots;
|
||||
/* 0x08 */ MemoryPoolSlot *slots;
|
||||
/* 0x0C */ s32 size;
|
||||
} MemoryPool;
|
||||
|
||||
/* Size: 0x8 bytes */
|
||||
typedef struct FreeQueueSlot {
|
||||
void *dataAddress;
|
||||
u8 unk4; //FreeQueueState?
|
||||
} FreeQueueSlot;
|
||||
|
||||
/* Unknown size */
|
||||
typedef struct unk800B7D10 {
|
||||
u8 pad0[0x14];
|
||||
s32 unk14;
|
||||
} unk800B7D10;
|
||||
|
||||
unk800B7D10 *get_stack_pointer(void); // Non Matching with own file
|
||||
s32 *func_8006F510(void); // Non Matching unknown_070110
|
||||
void func_8006F53C(s32*); // Non Matching unknown_070110
|
||||
|
||||
void init_main_memory_pool(void);
|
||||
MemoryPoolSlot *new_sub_memory_pool(s32 poolDataSize, s32 numSlots);
|
||||
void *allocate_from_main_pool_safe(s32 size, u32 colorTag);
|
||||
MemoryPoolSlot *allocate_from_main_pool(s32 size, u32 colorTag);
|
||||
void *allocate_from_pool_containing_slots(MemoryPoolSlot *slots, s32 size);
|
||||
void set_free_queue_state(s32 state);
|
||||
void free_from_memory_pool(void *data);
|
||||
void clear_free_queue(void);
|
||||
void func_80071440(void *dataAddress);
|
||||
s32 func_80071478(u8 *address);
|
||||
s32 func_80071538(u8 *address);
|
||||
s32 get_memory_pool_index_containing_address(u8 *address);
|
||||
u8 *align16(u8 *address);
|
||||
u8 *align8(u8 *address);
|
||||
u8 *align4(u8 *address);
|
||||
void print_memory_color_tags(void);
|
||||
void render_memory_color_tags(void);
|
||||
void func_80071CE8(void);
|
||||
|
||||
MemoryPoolSlot *allocate_from_memory_pool(s32 memoryPoolIndex, s32 size, u32 colorTag); // Non Matching
|
||||
MemoryPoolSlot *new_memory_pool(MemoryPoolSlot *slots, s32 poolSize, s32 numSlots); // Non Matching
|
||||
void free_memory_pool_slot(s32 poolIndex, s32 slotIndex); // Non Matching
|
||||
void *allocate_at_address_in_main_pool(s32 size, u8 *address, u32 colorTag); // Non Matching
|
||||
void free_slot_containing_address(u8 *address); // Non Matching
|
||||
s32 get_memory_color_tag_count(s32 arg0); // Non Matching
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -1565,7 +1565,7 @@ s32 music_is_playing(void);
|
||||
void set_text_color(s32 red, s32 green, s32 blue, s32 alpha, s32 opacity);
|
||||
void func_80082FAC(void);
|
||||
void func_8009ABAC(void);
|
||||
void func_800C31EC(s32);
|
||||
void func_800C31EC(s32); //game_text.h
|
||||
void update_controller_sticks(void);
|
||||
void func_80078D00(Gfx**, void *element, s32, s32, f32, f32, u32, s32);
|
||||
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ extern s32 D_80129BB0[256];
|
||||
extern s32 D_80129FB0[3];
|
||||
extern s32 D_80129FBC;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* RAM_POS: 0x8007AC70 */
|
||||
|
||||
#include "textures_sprites.h"
|
||||
#include "gzip.h"
|
||||
|
||||
/************ .data ************/
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "structs.h"
|
||||
#include "f3ddkr.h"
|
||||
#include "asset_sections.h"
|
||||
#include "asset_loading.h"
|
||||
|
||||
/************ .data ************/
|
||||
|
||||
@@ -296,10 +297,6 @@ void calc_dynamic_lighting_for_object_1(unk8001D6E4_arg1 *, ObjectModel *, s16,
|
||||
void calc_dynamic_lighting_for_object_2(unk8001D6E4_arg1 *, ObjectModel *, s16, f32);
|
||||
|
||||
void func_8000C460(void);
|
||||
|
||||
void *new_sub_memory_pool(s32, u32);
|
||||
void *allocate_from_main_pool_safe(s32, u32);
|
||||
s32 *load_asset_section_from_rom(s32);
|
||||
void gParticlePtrList_addObject(Object *);
|
||||
void gParticlePtrList_flush(void);
|
||||
void func_8001D258(f32, f32, s32, s32, s32);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "menu.h"
|
||||
#include "video.h"
|
||||
#include "lib/src/mips1/sc/sched.h"
|
||||
#include "gzip.h"
|
||||
|
||||
/************ .rodata ************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user