get rid of useless structs and cleanup some includes

This commit is contained in:
Angie 2024-08-23 21:24:38 -04:00
parent 3c19b2b615
commit a070b6780d
44 changed files with 143 additions and 251 deletions

View File

@ -35,6 +35,8 @@ DEP_INCLUDE ?= 1
USE_LLD ?= 0
# If non-zero, partially links each segment, making the first build slower but improving build times afterwards
PARTIAL_LINKING ?= 0
# Toggles a few commodities for modding
MODDING ?= 0
# Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk!
# In nearly all cases, not having 'mips-linux-gnu-*' binaries on the PATH is indicative of missing dependencies
@ -73,6 +75,11 @@ else
$(error Invalid VERSION variable detected. Please use either 'us', 'cn' or 'gw')
endif
ifneq ($(MODDING), 0)
NON_MATCHING := 1
BUILD_DEFINES += -DMODDING=1
endif
ifeq ($(NON_MATCHING),1)
BUILD_DEFINES += -DNON_MATCHING -DPRESERVE_UB
COMPARE := 0
@ -137,9 +144,14 @@ ifeq ($(VERSION),cn)
else
SLINKY_FLAGS += --custom-options scommon_in_common=true
endif
ifneq ($(PARTIAL_LINKING),0)
ifneq ($(PARTIAL_LINKING), 0)
SLINKY_FLAGS += --partial-linking
endif
ifneq ($(MODDING), 0)
SLINKY_FLAGS += --custom-options modding=true
else
SLINKY_FLAGS += --custom-options modding=false
endif
ROM_COMPRESSOR ?= tools/compressor/rom_compressor.py
ROM_DECOMPRESSOR ?= tools/compressor/rom_decompressor.py

View File

@ -112,7 +112,6 @@ options:
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
asm_inc_header: ""
use_legacy_include_asm: False
create_asm_dependencies: True

View File

@ -113,7 +113,6 @@ options:
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
asm_inc_header: ""
use_legacy_include_asm: False
create_asm_dependencies: True

View File

@ -112,7 +112,6 @@ options:
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
asm_inc_header: ""
use_legacy_include_asm: False
create_asm_dependencies: True

View File

@ -2,21 +2,36 @@
#define DM_MANUAL_MAIN_H
#include "libultra.h"
#include "main.h"
#include "libc/stdbool.h"
#include "unk.h"
#include "main.h"
#include "msgwnd.h"
struct struct_game_state_data;
struct GameMapCell;
struct struct_800F4890_unk_034;
struct struct_800F4890_unk_0E8;
struct NNSched;
struct struct_watchManual;
typedef struct struct_800F4890_unk_034 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ s32 unk_04;
/* 0x08 */ f32 unk_08; // alpha, 0.0f ~ 1.0f
/* 0x0C */ f32 unk_0C;
/* 0x10 */ MessageWnd messageWnd;
} struct_800F4890_unk_034; // size = 0x90
typedef struct struct_800F4890_unk_0E8 {
/* 0x0 */ s8 unk_0;
/* 0x0 */ s8 unk_1;
/* 0x0 */ s8 unk_2;
/* 0x0 */ s8 unk_3[3];
} struct_800F4890_unk_0E8; // size = 0x6
void func_80071EF0(struct struct_800F4890_unk_034 *arg0, s32 arg1, s32 arg2);
void func_80071F0C();
void func_80071F14(struct struct_800F4890_unk_034 *arg0, UNK_PTR *arg1);
void func_80071F14(struct struct_800F4890_unk_034 *arg0, void **heapP);
void func_80071FA0(struct struct_800F4890_unk_034 *arg0);
void tutolWnd_draw(struct struct_800F4890_unk_034 *arg0, Gfx **gfxP);
void func_800721A0(struct struct_800F4890_unk_034 *arg0);

View File

@ -1,91 +0,0 @@
#ifndef MAIN_SEGMENT_VARIABLES_H
#define MAIN_SEGMENT_VARIABLES_H
#include "libultra.h"
#include "libc/stdint.h"
#include "libc/stdbool.h"
#include "PR/sched.h"
#include "unknown_structs.h"
#include "unk.h"
#include "alignment.h"
#include "stack.h"
struct struct_watchMenu;
// bss
// extern UNK_TYPE aiRootP;
// extern UNK_TYPE aiWall;
// extern UNK_TYPE attack_sprite_idx;
// extern UNK_TYPE B_800EB290;s
// extern UNK_TYPE B_800EB4F9;
// extern UNK_TYPE B_800EB50A;
// extern UNK_TYPE B_800EB50B;
// extern UNK_TYPE B_800EB64C;
// extern UNK_TYPE B_800EB64D;
// extern UNK_TYPE hei_data;
// extern UNK_TYPE B_800EBD03;
// extern UNK_TYPE B_800EBD04;
// extern UNK_TYPE B_800EBD05;
// extern UNK_TYPE B_800EBD07;
// extern UNK_TYPE B_800EBD0B;
// extern UNK_TYPE attack_effect_idx;
// extern UNK_TYPE B_800EF54C;
// extern UNK_TYPE B_800F1CE9;
// extern UNK_TYPE aiHiErB;
// extern UNK_TYPE aiPriOfs;
// extern UNK_TYPE aiRollFinal;
// extern UNK_TYPE wid_data;
// extern UNK_TYPE B_800F3E6F;
// extern UNK_TYPE B_800F3E70;
// extern UNK_TYPE B_800F3E71;
// extern UNK_TYPE B_800F3E73;
// extern UNK_TYPE B_800F3E77;
// extern UNK_TYPE aiHiErY;
// extern UNK_TYPE attack_sprite;
// extern UNK_TYPE B_800F3E94;
// extern UNK_TYPE B_800F3E98;
// extern UNK_TYPE B_800F3E9C;
// extern UNK_TYPE B_800F3EA0;
// extern UNK_TYPE B_800F6C71;
// extern UNK_TYPE B_800F6CD4;
// extern UNK_TYPE attack_sprite_address;
// extern UNK_TYPE B_800F8C90;
// extern UNK_TYPE aiHiErR;
// extern UNK_TYPE aiSelCom;
// extern UNK_TYPE aif_field;
// extern UNK_TYPE B_800FAD41;
// extern UNK_TYPE B_800FAE50;
// extern UNK_TYPE B_800FAE60;
// extern UNK_TYPE B_800FAE64;
// extern UNK_TYPE B_800FAE68;
// extern UNK_TYPE B_800FAE6C;
// extern UNK_TYPE B_800FAE70;
// extern UNK_TYPE B_800FAE74;
// extern UNK_TYPE aiHiEraseCtr;
// extern UNK_TYPE B_800FB3AC;
// extern UNK_TYPE B_800FB3B0;
// extern UNK_TYPE B_800FB3B4;
// extern UNK_TYPE B_800FB3B8;
// extern UNK_TYPE B_800FB3BC;
// extern UNK_TYPE B_800FB3C0;
// extern UNK_TYPE B_800FB3C4;
// extern UNK_TYPE B_800FB3C8;
// extern UNK_TYPE B_800FB3CC;
// extern UNK_TYPE B_800FB3D0;
#endif

View File

@ -4,7 +4,6 @@
#include "libultra.h"
#include "unk.h"
#include "libc/stdbool.h"
#include "unknown_structs.h"
struct MenuRank_unk_001C;
struct struct_evs_cfg_4p;

View File

@ -1,54 +0,0 @@
#ifndef UNKNOWN_STRUCTS_H
#define UNKNOWN_STRUCTS_H
#include "version.h"
#include "libultra.h"
#include "libc/stdint.h"
#include "libc/stdbool.h"
#include "gcc/stdlib.h"
#include "other_types.h"
#include "color.h"
#include "unk.h"
#include "alignment.h"
#include "msgwnd.h"
#include "recwritingmsg.h"
#include "char_anime.h"
#include "gamemap.h"
#include "main.h"
#include "dm_game_main.h"
typedef struct struct_800F4890_unk_034 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ s32 unk_04;
/* 0x08 */ f32 unk_08; // alpha, 0.0f ~ 1.0f
/* 0x0C */ f32 unk_0C;
/* 0x10 */ MessageWnd messageWnd;
} struct_800F4890_unk_034; // size = 0x90
typedef struct struct_800F4890_unk_0E8 {
/* 0x0 */ s8 unk_0;
/* 0x0 */ s8 unk_1;
/* 0x0 */ s8 unk_2;
/* 0x0 */ s8 unk_3[3];
} struct_800F4890_unk_0E8; // size = 0x6
typedef struct struct_800F4890_unk_0C4 {
/* 0x0 */ s32 unk_0;
/* 0x4 */ s32 unk_4;
/* 0x4 */ s32 unk_8;
} struct_800F4890_unk_0C4; // size = 0xC
typedef struct struct_800F4890_unk_14C {
/* 0x0 */ s32 unk_0;
/* 0x4 */ s32 unk_4;
} struct_800F4890_unk_14C; // size = 0x8
typedef enum enum_800E5930 {
/* 0 */ ENUM_800E5930_0,
/* 1 */ ENUM_800E5930_1,
/* 2 */ ENUM_800E5930_2,
/* 3 */ ENUM_800E5930_MAX
} enum_800E5930;
#endif

View File

@ -5,3 +5,9 @@ crunch64>=0.5.0,<1.0.0
# for m2c
pycparser
# for diff.py
colorama
watchdog
levenshtein
cxxfilt

View File

@ -1,5 +1,5 @@
#include "libultra.h"
#include "include_asm.h"
#include "libc/math.h"
#include "libkmc/explog.h"

View File

@ -1,5 +1,4 @@
#include "libultra.h"
#include "include_asm.h"
#include "libkmc/kmclib.h"
void *memset(REG5 void *dest, int ch, REG4 size_t n) {

View File

@ -1,5 +1,4 @@
#include "libultra.h"
#include "include_asm.h"
#include "libkmc/explog.h"
f64 modf(f64 x, f64 *ipart) {

View File

@ -1,5 +1,5 @@
#include "libultra.h"
#include "include_asm.h"
#include "gcc/stdlib.h"
#include "macros_defines.h"
#include "attributes.h"

View File

@ -1,9 +1,6 @@
#include "066580.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "nnsched.h"
char D_800AB170[] = "";

View File

@ -41,8 +41,6 @@
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "dm_virus_init.h"
#include "gamemap.h"

View File

@ -7,11 +7,12 @@
#include "audio/music_driver.h"
#include "include_asm.h"
#include "libc/stdint.h"
#include "alignment.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "unk.h"
#include "main_segment_variables.h"
#include "PR/sched.h"
#include "nnsched.h"
#include "dmadata.h"

View File

@ -4,13 +4,14 @@
#include "audio/sound.h"
#include "gcc/stdlib.h"
#include "macros_defines.h"
#include "unk.h"
#include "audio/music_driver.h"
#include "nnsched.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "unk.h"
#include "main_segment_variables.h"
#include "rom_offsets.h"
#include "buffers.h"
#include "main1x.h"

View File

@ -6,8 +6,7 @@
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "066840.h"
static s32 randomindex;

View File

@ -4,13 +4,12 @@
#include "char_anime.h"
#include "alignment.h"
#include "libc/assert.h"
#include "libultra.h"
#include "include_asm.h"
#include "libc/stdint.h"
#include "gcc/stdlib.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "rom_offsets.h"
#include "segment_symbols.h"
#include "util.h"

View File

@ -8,13 +8,19 @@
#include "util.h"
#include "macros_defines.h"
#include "main_segment_variables.h"
#include "aiset.h"
#include "joy.h"
#include "main1x.h"
#include "screen_print/debug_print.h"
typedef enum enum_800E5930 {
/* 0 */ ENUM_800E5930_0,
/* 1 */ ENUM_800E5930_1,
/* 2 */ ENUM_800E5930_2,
/* 3 */ ENUM_800E5930_MAX
} enum_800E5930;
static s32 B_800E58B0;
static s32 B_800E58B4;
static s32 B_800E58B8;
@ -28,7 +34,7 @@ static s32 B_800E5920;
static s32 B_800E5924;
static s32 B_800E5928;
static s32 B_800E592C;
static s32 B_800E5930;
static s32 B_800E5930; // enum_800E5930
static s32 B_800E5934;
static struct_800E5938 B_800E5938[12];
static struct_800E5968 B_800E5968;

View File

@ -5,8 +5,6 @@
#include "dm_game_main.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "util.h"
#include "gcc/memory.h"

View File

@ -3,11 +3,12 @@
*/
#include "dm_manual_main.h"
#include "libultra.h"
#include "include_asm.h"
#include "libc/assert.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "audio/sound.h"
#include "graphic.h"
#include "msgwnd.h"
@ -19,7 +20,6 @@
#include "static.h"
#include "dm_virus_init.h"
#include "util.h"
#include "libc/assert.h"
#if VERSION_US || VERSION_GW || CC_CHECK
#include "aiset.h"
@ -28,6 +28,17 @@
#define STRUCT_WATCHGAME_MANUAL_UNK_LEN 3
#define STRUCT_WATCHGAME_MANUAL_UNK_LEN2 4
typedef struct struct_800F4890_unk_0C4 {
/* 0x0 */ s32 unk_0;
/* 0x4 */ s32 unk_4;
/* 0x4 */ s32 unk_8;
} struct_800F4890_unk_0C4; // size = 0xC
typedef struct struct_800F4890_unk_14C {
/* 0x0 */ s32 unk_0;
/* 0x4 */ s32 unk_4;
} struct_800F4890_unk_14C; // size = 0x8
typedef struct struct_watchManual {
/* 0x000 */ s32 unk_000;
/* 0x004 */ s32 unk_004;
@ -76,10 +87,10 @@ void func_80071F0C(void) {
#define FUNC_80071F14_UNK_48 0xE
#endif
void func_80071F14(struct_800F4890_unk_034 *arg0, UNK_PTR *arg1) {
void func_80071F14(struct_800F4890_unk_034 *arg0, void **heapP) {
arg0->unk_08 = 0;
arg0->unk_0C = (-1 / 16.0f);
msgWnd_init(&arg0->messageWnd, arg1, 0xD, 4, 0x20, 0x20);
msgWnd_init(&arg0->messageWnd, heapP, 0xD, 4, 0x20, 0x20);
arg0->messageWnd.unk_30 = 0xA;
arg0->messageWnd.unk_34 = 0xC;
arg0->messageWnd.unk_3C = 5;

View File

@ -4,13 +4,13 @@
#include "dm_title_main.h"
#include "include_asm.h"
#include "gcc/stdlib.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "rom_offsets.h"
#include "audio/sound.h"
#include "buffers.h"
#include "dm_game_main.h"
#include "graphic.h"
#include "joy.h"
#include "record.h"

View File

@ -5,10 +5,8 @@
#include "dm_virus_init.h"
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "calc.h"
void init_map_all(GameMapCell *mapCells) {

View File

@ -4,11 +4,10 @@
#include "font.h"
#include "include_asm.h"
#include "alignment.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "unk.h"
#include "main_segment_variables.h"
#include "tex_func.h"
typedef struct struct_800A6F70 {

View File

@ -4,12 +4,13 @@
#include "game_etc.h"
#include "attributes.h"
#include "libc/assert.h"
#include "gcc/stdlib.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "dm_game_main.h"
#include "tex_func.h"
#include "main_story.h"
#include "lws.h"

View File

@ -7,20 +7,20 @@
#include "graphic.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "gs2dex.h"
#include "boot_main.h"
#include "audio/sound.h"
#include "buffers.h"
#include "gs2dex.h"
#include "dm_game_main.h"
#include "dm_manual_main.h"
#include "dm_title_main.h"
#include "dm_thread.h"
#include "main_story.h"
#include "dm_manual_main.h"
#include "main_menu.h"
#include "nnsched.h"
#include "dm_title_main.h"
STACK(sGraphicStack, GRAPHIC_STACK_SIZE);

View File

@ -4,9 +4,7 @@
#include "static.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "unk.h"
#include "main_segment_variables.h"
#include "graphic.h"

View File

@ -5,8 +5,6 @@
#include "joy.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "gateway.h"
#include "nnsched.h"

View File

@ -4,9 +4,8 @@
#include "lws.h"
#include "libc/stdint.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "calc.h"
#include "main_story.h"

View File

@ -6,20 +6,22 @@
#include "unk.h"
#include "macros_defines.h"
#include "boot_main.h"
#include "main_segment_variables.h"
#include "aiset.h"
#include "audio/sound.h"
#include "buffers.h"
#include "dm_game_main.h"
#include "dm_manual_main.h"
#include "dm_title_main.h"
#include "graphic.h"
#include "aiset.h"
#include "joy.h"
#include "record.h"
#include "main1x.h"
#include "main_story.h"
#include "dm_manual_main.h"
#include "main_menu.h"
#include "nnsched.h"
#include "dm_title_main.h"
NNSched B_800EB670;

View File

@ -4,14 +4,15 @@
#include "main1x.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "gcc/stdlib.h"
#include "main_segment_variables.h"
#include "macros_defines.h"
#include "aiset.h"
#include "dm_game_main.h"
#include "main_story.h"
#include "record.h"
#include "vr_init.h"
#include "main_story.h"
#include "aiset.h"
/**
* Original name: Original name: evs_playmax

View File

@ -3,11 +3,10 @@
*/
#include "main_menu.h"
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "util.h"
#include "rom_offsets.h"
#include "audio/sound.h"

View File

@ -4,10 +4,7 @@
#include "main_story.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "libc/assert.h"
@ -18,6 +15,7 @@
#include "tex_func.h"
#include "graphic.h"
#include "main1x.h"
#include "msgwnd.h"
#include "nnsched.h"
#include "lws.h"
#include "066840.h"

View File

@ -4,13 +4,13 @@
#include "msgwnd.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "unk.h"
#include "main_segment_variables.h"
#include "alignment.h"
#include "gcc/memory.h"
#include "libc/stdint.h"
#include "macros_defines.h"
#include "unk.h"
#include "color.h"
#include "font.h"
#include "joy.h"
#include "tex_func.h"

View File

@ -5,7 +5,6 @@
#include "record.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "recwritingmsg.h"
#include "main_menu.h"

View File

@ -5,9 +5,8 @@
#include "replay.h"
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#define REPLAY_TOTAL_BUFF_SIZE 0x10000

View File

@ -1,12 +1,13 @@
#include "screen_print/debug_print.h"
#include "libultra.h"
#include "attributes.h"
#include "alignment.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "screen_print/printf_impl.h"
#include "libc/assert.h"
#include "color.h"
#include "screen_print/printf_impl.h"
// unused
Gfx D_8008D2A0[] = {
gsSPEndDisplayList(),

View File

@ -2,7 +2,7 @@
#define _MIPS_SIM_ABI64 3
#include "screen_print/printer.h"
#include "include_asm.h"
#include "macros_defines.h"
s32 Printer_Open(Printer *printer, ...) {

View File

@ -4,15 +4,18 @@
* The name is completely made up.
*/
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "screen_print/printf_impl.h"
#include "attributes.h"
#include "gcc/memory.h"
#include "gcc/string.h"
#include "libc/ctype.h"
#include "libc/stdarg.h"
#include "libc/stdbool.h"
#include "libc/math.h"
#include "macros_defines.h"
#include "screen_print/printer.h"
#include "libkmc/explog.h"

View File

@ -3,11 +3,13 @@
*/
#include "tex_func.h"
#include "include_asm.h"
#include "unk.h"
#include "util.h"
#include "alignment.h"
#include "macros_defines.h"
#include "main_segment_variables.h"
#include "libc/stdint.h"
#include "unk.h"
#include "util.h"
/**
* Original name: copy_texture_init_dl

View File

@ -1,9 +1,13 @@
#include "020D10.h"
#include "alignment.h"
#include "libc/stdint.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "main_segment_variables.h"
#include "unk.h"
#include "buffers.h"
#include "graphic.h"

View File

@ -1,7 +1,6 @@
#include "libultra.h"
#include "include_asm.h"
#include "macros_defines.h"
#include "unknown_structs.h"
#include "unk.h"
#if VERSION_US

View File

@ -3,7 +3,7 @@
*/
#include "vr_init.h"
#include "include_asm.h"
#include "macros_defines.h"
/**