From 81df8b6a442b220116743b22b8ecde1169feadb8 Mon Sep 17 00:00:00 2001 From: Maide Date: Sat, 12 Oct 2024 11:49:59 +0100 Subject: [PATCH] fragment16 --- include/libleo/internal.h | 2 +- include/macros.h | 4 +- include/prevent_bss_reordering.h | 83 + linker_scripts/us/symbol_addrs.txt | 3 + src/11BA0.c | 2 +- src/11BA0.h | 2 +- src/18480.c | 278 --- src/18480.h | 279 +++ src/1CF30.c | 2 +- src/2C1C0.c | 3 +- src/E1C0.c | 2 +- src/fragments/15/fragment15_14CA70.c | 2 +- src/fragments/16/fragment16.h | 459 ++++ src/fragments/16/fragment16_158A00.c | 1676 ++++++++++++- src/fragments/16/fragment16_15A2A0.c | 6 +- src/fragments/16/fragment16_15A2B0.c | 3434 +++++++++++++++++++++++++- src/fragments/16/fragment16_15AD80.c | 409 ++- src/fragments/36/fragment36.c | 2 +- src/fragments/37/fragment37.c | 2 +- src/reset.c | 2 +- tools/data2c.py | 637 +++++ yamls/us/rom.yaml | 8 +- 22 files changed, 6977 insertions(+), 320 deletions(-) create mode 100644 include/prevent_bss_reordering.h create mode 100644 src/fragments/16/fragment16.h create mode 100755 tools/data2c.py diff --git a/include/libleo/internal.h b/include/libleo/internal.h index b97f0f89..0a8ebdbd 100644 --- a/include/libleo/internal.h +++ b/include/libleo/internal.h @@ -26,7 +26,7 @@ typedef struct { } block_param_form; // size = 0x10 typedef union { - /* 0x00 */ struct { + struct { /* 0x00 */ u32 country; /* 0x04 */ u8 fmt_type; /* 0x05 */ u8 disk_type; diff --git a/include/macros.h b/include/macros.h index c9f7a4e3..72b871cb 100644 --- a/include/macros.h +++ b/include/macros.h @@ -46,7 +46,7 @@ #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) #define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) -#define ROUND_MAX(x) (((x) > 0.0f ? 0.5f : -0.5f) + (x)) +#define ROUND_MAX(x) ((x) + ((x) > 0.0f ? 0.5f : -0.5f)) #define ABS(x) ((x) < 0 ? -(x) : (x)) #define ABS_ALT(x) ((x) >= 0 ? (x) : -(x)) @@ -72,7 +72,7 @@ func_80004258(ASSET_ID(vram), rom##_ROM_START, rom##_ROM_END, arg0) \ ) -#define ASSET_LOAD2(vram, rom, arg0, arg1) (\ +#define ASSET_LOAD2(rom, arg0, arg1) (\ func_800044F4(rom##_ROM_START, rom##_ROM_END, arg0, arg1) \ ) #endif diff --git a/include/prevent_bss_reordering.h b/include/prevent_bss_reordering.h new file mode 100644 index 00000000..604e45b8 --- /dev/null +++ b/include/prevent_bss_reordering.h @@ -0,0 +1,83 @@ +#ifndef PREVENT_BSS_REORDERING_H +#define PREVENT_BSS_REORDERING_H + +/** + * To determine variable order for .bss, the compiler sorts variables by their + * "name index" mod 256, where name index is something that, with -g, gets + * incremented by struct and variable declarations, typedefs, and file markers, + * among else. (Without -g, only variable declarations affects the index.) + * This file contains enough dummy declarations to bump the index by 128. + * Including it, or removing the include, should fix bss reordering problems + * for a file, assuming the name index distance between its first and last bss + * variable is at most 128. + * Note that if a variable is declared "extern" within a header file, the name + * index is taken at that point of the extern declaration. Thus, this include + * must come before any such header. + */ + +struct Dummy0 { int x; }; +struct Dummy1 { int x; }; +struct Dummy2 { int x; }; +struct Dummy3 { int x; }; +struct Dummy4 { int x; }; +struct Dummy5 { int x; }; +struct Dummy6 { int x; }; +struct Dummy7 { int x; }; +struct Dummy8 { int x; }; +struct Dummy9 { int x; }; +struct Dummy10 { int x; }; +struct Dummy11 { int x; }; +struct Dummy12 { int x; }; +struct Dummy13 { int x; }; +struct Dummy14 { int x; }; +struct Dummy15 { int x; }; +struct Dummy16 { int x; }; +struct Dummy17 { int x; }; +struct Dummy18 { int x; }; +struct Dummy19 { int x; }; +struct Dummy20 { int x; }; +struct Dummy21 { int x; }; +struct Dummy22 { int x; }; +struct Dummy23 { int x; }; +struct Dummy24 { int x; }; +struct Dummy25 { int x; }; +struct Dummy26 { int x; }; +struct Dummy27 { int x; }; +struct Dummy28 { int x; }; +struct Dummy29 { int x; }; +struct Dummy30 { int x; }; +struct Dummy31 { int x; }; +struct Dummy32 { int x; }; +struct Dummy33 { int x; }; +struct Dummy34 { int x; }; +struct Dummy35 { int x; }; +struct Dummy36 { int x; }; +struct Dummy37 { int x; }; +struct Dummy38 { int x; }; +struct Dummy39 { int x; }; +struct Dummy40 { int x; }; +struct Dummy41 { int x; }; +struct Dummy42 { int x; }; +struct Dummy43 { int x; }; +struct Dummy44 { int x; }; +struct Dummy45 { int x; }; +struct Dummy46 { int x; }; +struct Dummy47 { int x; }; +struct Dummy48 { int x; }; +struct Dummy49 { int x; }; +struct Dummy50 { int x; }; +struct Dummy51 { int x; }; +struct Dummy52 { int x; }; +struct Dummy53 { int x; }; +struct Dummy54 { int x; }; +struct Dummy55 { int x; }; +struct Dummy56 { int x; }; +struct Dummy57 { int x; }; +struct Dummy58 { int x; }; +struct Dummy59 { int x; }; +struct Dummy60 { int x; }; +struct Dummy61 { int x; }; +struct Dummy62 { int x; }; +typedef int Dummy63; + +#endif diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index d3d0828c..c9bf1672 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -341,3 +341,6 @@ D_8007596C = 0x8007596C; D_8690B360 = 0x8690B360; // size:0x18 D_8690B390 = 0x8690B390; // size:0x24 D_8690B5D0 = 0x8690B5D0; // size:0x24 +D_86A06228 = 0x86A06228; // size:0xC +D_86A06238 = 0x86A06238; // size:0xC +D_86A06248 = 0x86A06248; // size:0xC diff --git a/src/11BA0.c b/src/11BA0.c index 57b0e28e..638bcc1c 100644 --- a/src/11BA0.c +++ b/src/11BA0.c @@ -31,7 +31,7 @@ void func_80010FDC(unk_D_86002F34_000* arg0, func_D_86002F34_000_010 arg1, unk_D } } -unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, void* arg1) { +unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, unk_D_86002F34_000* arg1) { if (arg0 != NULL) { arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_000), 4); } diff --git a/src/11BA0.h b/src/11BA0.h index 67783669..7f8b7769 100644 --- a/src/11BA0.h +++ b/src/11BA0.h @@ -22,7 +22,7 @@ typedef struct unk_D_8690A610 { void func_80010FA0(unk_D_86002F34_000* arg0, u8 arg1); void func_80010FDC(unk_D_86002F34_000* arg0, func_D_86002F34_000_010 arg1, unk_D_86002F34_000_014* arg2); -unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, void* arg1); +unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, unk_D_86002F34_000* arg1); unk_D_86002F34_alt2* func_80011088(MainPoolState* arg0, unk_D_86002F34_alt2* arg1, unk_D_86002F34_000* arg2); unk_D_86002F34_00C* func_800110E0(MemoryBlock* arg0, unk_D_86002F34_00C* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5); unk_D_86002F34_alt13* func_800111A4(MemoryBlock* arg0, unk_D_86002F34_alt13* arg1, s16 arg2); diff --git a/src/18480.c b/src/18480.c index f70753ff..82362733 100644 --- a/src/18480.c +++ b/src/18480.c @@ -3,284 +3,6 @@ #include "src/F420.h" #include "src/util.h" -typedef void (*func_D_8006F2B0)(void); - -typedef struct unk_D_800ABE00_cmd0 { - /* 0x00 */ u8 cmd; - /* 0x02 */ u16 unk_02; - /* 0x04 */ s32 unk_04; -} unk_D_800ABE00_cmd0; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd1 { - /* 0x00 */ u8 cmd; -} unk_D_800ABE00_cmd1; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd2 { - /* 0x00 */ u8 cmd; - /* 0x04 */ u32 unk_04; -} unk_D_800ABE00_cmd2; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd3 { - /* 0x00 */ u8 cmd; - /* 0x04 */ u32 unk_04; -} unk_D_800ABE00_cmd3; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd4 { - /* 0x00 */ u8 cmd; -} unk_D_800ABE00_cmd4; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd5 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char pad[3]; -} unk_D_800ABE00_cmd5; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd6 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char pad[3]; -} unk_D_800ABE00_cmd6; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd7 { - /* 0x00 */ u8 cmd; - /* 0x04 */ unk_D_8690A610* unk_04; -} unk_D_800ABE00_cmd7; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd8 { - /* 0x00 */ u8 cmd; - /* 0x04 */ func_D_86002F34_000_010 unk_04; - /* 0x08 */ unk_D_86002F34_000_014* unk_08; -} unk_D_800ABE00_cmd8; // size = 0xC - -typedef struct unk_D_800ABE00_cmd9 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char pad[3]; -} unk_D_800ABE00_cmd9; // size = 0x4 - -typedef struct unk_D_800ABE00_cmdA { - /* 0x00 */ u8 cmd; - /* 0x04 */ unk_D_86002F34_000* unk_04; -} unk_D_800ABE00_cmdA; // size = 0x8 - -typedef struct unk_D_800ABE00_cmdB { - /* 0x00 */ u8 cmd; - /* 0x02 */ u16 unk_02; - /* 0x04 */ u16 unk_04; - /* 0x06 */ u16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; - /* 0x0C */ Vec3s unk_0C; - /* 0x12 */ s16 unk_12; - /* 0x14 */ s16 unk_14; - /* 0x16 */ s16 unk_16; -} unk_D_800ABE00_cmdB; // size = 0x18 - -typedef struct unk_D_800ABE00_cmdC { - /* 0x00 */ u8 cmd; - /* 0x02 */ s16 unk_02; -} unk_D_800ABE00_cmdC; // size = 0x4 - -typedef struct unk_D_800ABE00_cmdD { - /* 0x00 */ u8 cmd; - /* 0x02 */ s16 unk_02; -} unk_D_800ABE00_cmdD; // size = 0x4 - -typedef struct unk_D_800ABE00_cmdE { - /* 0x00 */ u8 cmd; - /* 0x02 */ s16 unk_02; -} unk_D_800ABE00_cmdE; // size = 0x4 - -typedef struct unk_D_800ABE00_cmdF { - /* 0x00 */ u8 cmd; - /* 0x02 */ s16 unk_02; -} unk_D_800ABE00_cmdF; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd10 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ u8 unk_02; - /* 0x03 */ u8 unk_03; -} unk_D_800ABE00_cmd10; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd11 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char pad[3]; -} unk_D_800ABE00_cmd11; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd13 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 r; - /* 0x02 */ u8 g; - /* 0x03 */ u8 b; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; -} unk_D_800ABE00_cmd13; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd14 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char unk01[0x3]; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ u8 r; - /* 0x09 */ u8 g; - /* 0x0A */ u8 b; - /* 0x0B */ u8 a; -} unk_D_800ABE00_cmd14; // size = 0xC - -typedef struct unk_D_800ABE00_cmd15 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char unk01[0xB]; -} unk_D_800ABE00_cmd15; // size = 0xC - -typedef struct unk_D_800ABE00_cmd16 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 r; - /* 0x02 */ u8 g; - /* 0x03 */ u8 b; -} unk_D_800ABE00_cmd16; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd17 { - /* 0x00 */ u8 cmd; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ unk_D_86002F34_018* unk_08; - /* 0x0C */ unk_D_86002F34_01C* unk_0C; - /* 0x10 */ Vtx* unk_10; -} unk_D_800ABE00_cmd17; // size = 0x14 - -typedef struct unk_D_800ABE00_cmd18 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; -} unk_D_800ABE00_cmd18; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd19 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char unk01[0x3]; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; -} unk_D_800ABE00_cmd19; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd1A { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ s16 unk_02; -} unk_D_800ABE00_cmd1A; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd1B { - /* 0x00 */ u8 cmd; - /* 0x01 */ char unk01[0x3]; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ Vec3s unk_0A; -} unk_D_800ABE00_cmd1B; // size = 0x10 - -typedef struct unk_D_800ABE00_cmd1C { - /* 0x00 */ u8 cmd; - /* 0x01 */ char unk01[0x3]; - /* 0x04 */ u32 unk_04; - /* 0x08 */ u32 unk_08; - /* 0x0C */ u32 unk_0C; -} unk_D_800ABE00_cmd1C; // size = 0x10 - -typedef struct unk_D_800ABE00_cmd1D { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ u8 unk_02; - /* 0x03 */ u8 unk_03; - /* 0x04 */ Vec3s unk_04; - /* 0x0A */ Vec3s unk_0A; - /* 0x10 */ u32 unk_10; - /* 0x14 */ u32 unk_14; - /* 0x18 */ u32 unk_18; -} unk_D_800ABE00_cmd1D; // size = 0x1C - -typedef struct unk_D_800ABE00_cmd1E { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ s16 unk_02; - /* 0x04 */ Gfx* unk_04; -} unk_D_800ABE00_cmd1E; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd1F { - /* 0x00 */ u8 cmd; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ Vec3s unk_0A; - /* 0x10 */ s16 unk_10; - /* 0x12 */ s16 unk_12; - /* 0x14 */ s16 unk_14; - /* 0x16 */ char pad[0x2]; -} unk_D_800ABE00_cmd1F; // size = 0x18 - -typedef struct unk_D_800ABE00_cmd20 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ char unk02[0x2]; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ Vec3s unk_0A; - /* 0x10 */ Gfx* unk_10; -} unk_D_800ABE00_cmd20; // size = 0x14 - -typedef struct unk_D_800ABE00_cmd21 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ Vec3s unk_02; - /* 0x08 */ u32 unk_08; - /* 0x0C */ Gfx* unk_0C; -} unk_D_800ABE00_cmd21; // size = 0x10 - -typedef struct unk_D_800ABE00_cmd22 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x04 */ Gfx* unk_04; -} unk_D_800ABE00_cmd22; // size = 0x8 - -typedef struct unk_D_800ABE00_cmd23 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s32 unk_04; - /* 0x07 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; - /* 0x0C */ u8 r; - /* 0x0D */ u8 g; - /* 0x0E */ u8 b; - /* 0x0F */ u8 a; -} unk_D_800ABE00_cmd23; // size = 0x10 - -typedef struct unk_D_800ABE00_cmd24 { - /* 0x00 */ u8 cmd; - /* 0x02 */ s16 unk_02; -} unk_D_800ABE00_cmd24; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd25 { - /* 0x00 */ u8 cmd; - /* 0x01 */ char pad[3]; -} unk_D_800ABE00_cmd25; // size = 0x4 - -typedef struct unk_D_800ABE00_cmd26 { - /* 0x00 */ u8 cmd; - /* 0x01 */ u8 unk_01; - /* 0x02 */ u8 unk_02; - /* 0x03 */ s8 unk_03; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; - /* 0x0C */ s32 unk_0C; - /* 0x10 */ u8 r; - /* 0x11 */ u8 g; - /* 0x12 */ u8 b; - /* 0x13 */ u8 a; -} unk_D_800ABE00_cmd26; // size = 0x14 - extern MemoryBlock* D_800ABD30; extern unk_D_86002F34* D_800ABD34; extern u32 D_800ABD38[]; diff --git a/src/18480.h b/src/18480.h index 826bfb01..2164697a 100644 --- a/src/18480.h +++ b/src/18480.h @@ -3,6 +3,285 @@ #include "global.h" #include "src/memory.h" +#include "src/11BA0.h" + +typedef void (*func_D_8006F2B0)(void); + +typedef struct unk_D_800ABE00_cmd0 { + /* 0x00 */ u8 cmd; + /* 0x02 */ u16 unk_02; + /* 0x04 */ s32 unk_04; +} unk_D_800ABE00_cmd0; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd1 { + /* 0x00 */ u8 cmd; +} unk_D_800ABE00_cmd1; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd2 { + /* 0x00 */ u8 cmd; + /* 0x04 */ u32 unk_04; +} unk_D_800ABE00_cmd2; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd3 { + /* 0x00 */ u8 cmd; + /* 0x04 */ u32 unk_04; +} unk_D_800ABE00_cmd3; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd4 { + /* 0x00 */ u8 cmd; +} unk_D_800ABE00_cmd4; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd5 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd5; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd6 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd6; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd7 { + /* 0x00 */ u8 cmd; + /* 0x04 */ unk_D_8690A610* unk_04; +} unk_D_800ABE00_cmd7; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd8 { + /* 0x00 */ u8 cmd; + /* 0x04 */ func_D_86002F34_000_010 unk_04; + /* 0x08 */ unk_D_86002F34_000_014* unk_08; +} unk_D_800ABE00_cmd8; // size = 0xC + +typedef struct unk_D_800ABE00_cmd9 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd9; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdA { + /* 0x00 */ u8 cmd; + /* 0x04 */ unk_D_86002F34_000* unk_04; +} unk_D_800ABE00_cmdA; // size = 0x8 + +typedef struct unk_D_800ABE00_cmdB { + /* 0x00 */ u8 cmd; + /* 0x02 */ u16 unk_02; + /* 0x04 */ u16 unk_04; + /* 0x06 */ u16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ Vec3s unk_0C; + /* 0x12 */ s16 unk_12; + /* 0x14 */ s16 unk_14; + /* 0x16 */ s16 unk_16; +} unk_D_800ABE00_cmdB; // size = 0x18 + +typedef struct unk_D_800ABE00_cmdC { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdC; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdD { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdD; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdE { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdE; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdF { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdF; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd10 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ u8 unk_03; +} unk_D_800ABE00_cmd10; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd11 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd11; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd13 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 r; + /* 0x02 */ u8 g; + /* 0x03 */ u8 b; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; +} unk_D_800ABE00_cmd13; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd14 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ u8 r; + /* 0x09 */ u8 g; + /* 0x0A */ u8 b; + /* 0x0B */ u8 a; +} unk_D_800ABE00_cmd14; // size = 0xC + +typedef struct unk_D_800ABE00_cmd15 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0xB]; +} unk_D_800ABE00_cmd15; // size = 0xC + +typedef struct unk_D_800ABE00_cmd16 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 r; + /* 0x02 */ u8 g; + /* 0x03 */ u8 b; +} unk_D_800ABE00_cmd16; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd17 { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ unk_D_86002F34_018* unk_08; + /* 0x0C */ unk_D_86002F34_01C* unk_0C; + /* 0x10 */ Vtx* unk_10; +} unk_D_800ABE00_cmd17; // size = 0x14 + +typedef struct unk_D_800ABE00_cmd18 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; +} unk_D_800ABE00_cmd18; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd19 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; +} unk_D_800ABE00_cmd19; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd1A { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmd1A; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd1B { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ Vec3s unk_0A; +} unk_D_800ABE00_cmd1B; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd1C { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ u32 unk_04; + /* 0x08 */ u32 unk_08; + /* 0x0C */ u32 unk_0C; +} unk_D_800ABE00_cmd1C; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd1D { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ u8 unk_03; + /* 0x04 */ Vec3s unk_04; + /* 0x0A */ Vec3s unk_0A; + /* 0x10 */ u32 unk_10; + /* 0x14 */ u32 unk_14; + /* 0x18 */ u32 unk_18; +} unk_D_800ABE00_cmd1D; // size = 0x1C + +typedef struct unk_D_800ABE00_cmd1E { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; + /* 0x04 */ Gfx* unk_04; +} unk_D_800ABE00_cmd1E; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd1F { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ Vec3s unk_0A; + /* 0x10 */ s16 unk_10; + /* 0x12 */ s16 unk_12; + /* 0x14 */ s16 unk_14; + /* 0x16 */ char pad[0x2]; +} unk_D_800ABE00_cmd1F; // size = 0x18 + +typedef struct unk_D_800ABE00_cmd20 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ char unk02[0x2]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ Vec3s unk_0A; + /* 0x10 */ Gfx* unk_10; +} unk_D_800ABE00_cmd20; // size = 0x14 + +typedef struct unk_D_800ABE00_cmd21 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ Vec3s unk_02; + /* 0x08 */ u32 unk_08; + /* 0x0C */ Gfx* unk_0C; +} unk_D_800ABE00_cmd21; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd22 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x04 */ Gfx* unk_04; +} unk_D_800ABE00_cmd22; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd23 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s32 unk_04; + /* 0x07 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ u8 r; + /* 0x0D */ u8 g; + /* 0x0E */ u8 b; + /* 0x0F */ u8 a; +} unk_D_800ABE00_cmd23; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd24 { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmd24; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd25 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd25; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd26 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ s8 unk_03; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ s32 unk_0C; + /* 0x10 */ u8 r; + /* 0x11 */ u8 g; + /* 0x12 */ u8 b; + /* 0x13 */ u8 a; +} unk_D_800ABE00_cmd26; // size = 0x14 void func_80017880(void); // cmd 0 void func_80017914(void); // cmd 1 diff --git a/src/1CF30.c b/src/1CF30.c index 85957b42..1d7cb0f0 100644 --- a/src/1CF30.c +++ b/src/1CF30.c @@ -379,7 +379,7 @@ void func_8001E884(s32 arg0, s32 arg1, s32 arg2) { unk_D_800AC870* func_8001E94C(s32 arg0, s32 arg1) { D_800AC870 = main_pool_alloc_with_func(sizeof(*D_800AC870), arg1, 'PRNT', func_8001E7C0); bzero(D_800AC870, sizeof(*D_800AC870)); - D_800AC870->unk_48 = ASSET_LOAD2(func_800044F4, fonts, 1, 1); + D_800AC870->unk_48 = ASSET_LOAD2(fonts, 1, 1); func_8001E9F0(arg0); return D_800AC870; diff --git a/src/2C1C0.c b/src/2C1C0.c index 8e4c5d4e..6caf70b4 100644 --- a/src/2C1C0.c +++ b/src/2C1C0.c @@ -367,8 +367,7 @@ typedef struct unk_func_8002BFC4_004 { /* 0x034 */ u16 unk_34; /* 0x036 */ u16 unk_36; /* 0x038 */ unk_func_80026268_arg0 unk_38[1]; - /* 0x08C */ -} unk_func_8002BFC4_004; +} unk_func_8002BFC4_004; // size >= 0x8C typedef struct unk_func_8002BFC4 { /* 0x000 */ s32 unk_00; diff --git a/src/E1C0.c b/src/E1C0.c index 39139222..5683dc28 100644 --- a/src/E1C0.c +++ b/src/E1C0.c @@ -64,7 +64,7 @@ void func_8000D738(UnkInputStruct8000D738* arg0) { D_800AA664 = main_pool_alloc(0x21E0, 0); FRAGMENT_LOAD(fragment1); - temp_v0 = ASSET_LOAD2(func_800044F4, fonts, 1, 1); + temp_v0 = ASSET_LOAD2(fonts, 1, 1); D_800AA660->unk_21FC = func_8000484C(temp_v0, 0); D_800AA660->unk_2200 = func_8000484C(temp_v0, 1); diff --git a/src/fragments/15/fragment15_14CA70.c b/src/fragments/15/fragment15_14CA70.c index 560b01eb..446c2ffc 100644 --- a/src/fragments/15/fragment15_14CA70.c +++ b/src/fragments/15/fragment15_14CA70.c @@ -1147,7 +1147,7 @@ s32 func_86902098(s32 arg0, UNUSED s32 arg1) { func_80028AFC(2); func_80027FA0(&D_8690B378, 0); - D_8690A698 = ASSET_LOAD2(_5C7A70, stadium_models, 1, 1); + D_8690A698 = ASSET_LOAD2(stadium_models, 1, 1); func_8002D510(); D_8690A678 = func_8002D5AC(0x2B); func_86902004(arg0); diff --git a/src/fragments/16/fragment16.h b/src/fragments/16/fragment16.h new file mode 100644 index 00000000..d8d1fbc0 --- /dev/null +++ b/src/fragments/16/fragment16.h @@ -0,0 +1,459 @@ +#ifndef _FRAGMENT16_H_ +#define _FRAGMENT16_H_ + +#include "global.h" +#include "prevent_bss_reordering.h" + +typedef struct unk_D_86A025A0 { + /* 0x00 */ s8 unk_00; + /* 0x01 */ s8 unk_01; + /* 0x02 */ u16 unk_02; +} unk_D_86A025A0; // size = 0x4 + +typedef struct unk_D_86A02750 { + /* 0x00 */ s32 unk_00; + /* 0x04 */ char* unk_04[2]; +} unk_D_86A02750; // size = 0xC + +typedef struct unk_D_86A03014 { + /* 0x00 */ u16 unk_00; + /* 0x02 */ u16 unk_02; + /* 0x04 */ u8 unk_04; + /* 0x05 */ u8 unk_05; + /* 0x08 */ unk_D_86A02750* unk_08; +} unk_D_86A03014; // size = 0xC + +typedef struct unk_D_86A03170 { + /* 0x00 */ s16 unk_00; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s8 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; +} unk_D_86A03170; // size = 0x1C + +typedef struct unk_D_86A04328 { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ Vec3f unk_14; + /* 0x20 */ f32 unk_20; + /* 0x24 */ f32 unk_24; + /* 0x28 */ f32 unk_28; + /* 0x2C */ f32 unk_2C; + /* 0x30 */ f32 unk_30; + /* 0x34 */ f32 unk_34; +} unk_D_86A04328; // size = 0x38 + +extern unk_D_86A03170 D_86A03170[17][6]; + +extern u16 D_86A05B50; +extern char D_86A05B60; +extern char D_86A05B64; +extern char D_86A05B68; +extern char D_86A05B6C; +extern char D_86A05B70; +extern char D_86A05B74; +extern char D_86A05B78; +extern char D_86A05B7C; +extern char D_86A05B80; +extern char D_86A05B84; +extern char D_86A05B88; +extern char D_86A05B8C; +extern char D_86A05B90; +extern char D_86A05B94; +extern char D_86A05B98; +extern char D_86A05B9C; +extern char D_86A05BA0; +extern char D_86A05BA4; +extern char D_86A05BA8; +extern char D_86A05BAC; +extern char D_86A05BB0; +extern char D_86A05BB4; +extern char D_86A05BB8; +extern char D_86A05BBC; +extern char D_86A05BC0; +extern char D_86A05BC4; +extern char D_86A05BC8; +extern char D_86A05BCC; +extern char D_86A05BD0; +extern char D_86A05BD4; +extern char D_86A05BD8; +extern char D_86A05BDC; +extern char D_86A05BE0; +extern char D_86A05BE4; +extern char D_86A05BE8; +extern char D_86A05BEC; +extern char D_86A05BF0; +extern char D_86A05BF4; +extern char D_86A05BF8; +extern char D_86A05BFC; +extern char D_86A05C00; +extern char D_86A05C04; +extern char D_86A05C08; +extern char D_86A05C0C; +extern char D_86A05C10; +extern char D_86A05C14; +extern char D_86A05C18; +extern char D_86A05C1C; +extern char D_86A05C20; +extern char D_86A05C24; +extern char D_86A05C28; +extern char D_86A05C2C; +extern char D_86A05C30; +extern char D_86A05C34; +extern char D_86A05C38; +extern char D_86A05C3C; +extern char D_86A05C40; +extern char D_86A05C44; +extern char D_86A05C48; +extern char D_86A05C4C; +extern char D_86A05C50; +extern char D_86A05C54; +extern char D_86A05C58; +extern char D_86A05C5C; +extern char D_86A05C60; +extern char D_86A05C64; +extern char D_86A05C68; +extern char D_86A05C6C; +extern char D_86A05C70; +extern char D_86A05C74; +extern char D_86A05C78; +extern char D_86A05C7C; +extern char D_86A05C80; +extern char D_86A05C84; +extern char D_86A05C88; +extern char D_86A05C8C; +extern char D_86A05C90; +extern char D_86A05C94; +extern char D_86A05C98; +extern char D_86A05C9C; +extern char D_86A05CA0; +extern char D_86A05CA4; +extern char D_86A05CA8; +extern char D_86A05CAC; +extern char D_86A05CB0; +extern char D_86A05CB4; +extern char D_86A05CB8; +extern char D_86A05CBC; +extern char D_86A05CC0; +extern char D_86A05CC4; +extern char D_86A05CC8; +extern char D_86A05CCC; +extern char D_86A05CD0; +extern char D_86A05CD4; +extern char D_86A05CD8; +extern char D_86A05CDC; +extern char D_86A05CE0; +extern char D_86A05CE4; +extern char D_86A05CE8; +extern char D_86A05CEC; +extern char D_86A05CF0; +extern char D_86A05CF4; +extern char D_86A05CF8; +extern char D_86A05CFC; +extern char D_86A05D00; +extern char D_86A05D04; +extern char D_86A05D08; +extern char D_86A05D0C; +extern char D_86A05D10; +extern char D_86A05D14; +extern char D_86A05D18; +extern char D_86A05D1C; +extern char D_86A05D20; +extern char D_86A05D24; +extern char D_86A05D28; +extern char D_86A05D2C; +extern char D_86A05D30; +extern char D_86A05D34; +extern char D_86A05D38; +extern char D_86A05D3C; +extern char D_86A05D40; +extern char D_86A05D44; +extern char D_86A05D48; +extern char D_86A05D4C; +extern char D_86A05D50; +extern char D_86A05D54; +extern char D_86A05D58; +extern char D_86A05D5C; +extern char D_86A05D60; +extern char D_86A05D64; +extern char D_86A05D68; +extern char D_86A05D6C; +extern char D_86A05D70; +extern char D_86A05D74; +extern char D_86A05D78; +extern char D_86A05D7C; +extern char D_86A05D80; +extern char D_86A05D84; +extern char D_86A05D88; +extern char D_86A05D8C; +extern char D_86A05D90; +extern char D_86A05D94; +extern char D_86A05D98; +extern char D_86A05D9C; +extern char D_86A05DA0; +extern char D_86A05DA4; +extern char D_86A05DA8; +extern char D_86A05DAC; +extern char D_86A05DB0; +extern char D_86A05DB4; +extern char D_86A05DB8; +extern char D_86A05DBC; +extern char D_86A05DC0; +extern char D_86A05DC4; +extern char D_86A05DC8; +extern char D_86A05DCC; +extern char D_86A05DD0; +extern char D_86A05DD4; +extern char D_86A05DD8; +extern char D_86A05DDC; +extern char D_86A05DE0; +extern char D_86A05DE4; +extern char D_86A05DE8; +extern char D_86A05DEC; +extern char D_86A05DF0; +extern char D_86A05DF4; +extern char D_86A05DF8; +extern char D_86A05DFC; +extern char D_86A05E00; +extern char D_86A05E04; +extern char D_86A05E08; +extern char D_86A05E0C; +extern char D_86A05E10; +extern char D_86A05E14; +extern char D_86A05E18; +extern char D_86A05E1C; +extern char D_86A05E20; +extern char D_86A05E24; +extern char D_86A05E28; +extern char D_86A05E2C; +extern char D_86A05E30; +extern char D_86A05E34; +extern char D_86A05E38; +extern char D_86A05E3C; +extern char D_86A05E40; +extern char D_86A05E44; +extern char D_86A05E48; +extern char D_86A05E4C; +extern char D_86A05E50; +extern char D_86A05E54; +extern char D_86A05E58; +extern char D_86A05E5C; +extern char D_86A05E60; +extern char D_86A05E64; +extern char D_86A05E68; +extern char D_86A05E6C; +extern char D_86A05E70; +extern char D_86A05E74; +extern char D_86A05E78; +extern char D_86A05E7C; +extern char D_86A05E80; +extern char D_86A05E84; +extern char D_86A05E88; +extern char D_86A05E8C; +extern char D_86A05E90; +extern char D_86A05E94; +extern char D_86A05E98; +extern char D_86A05E9C; +extern char D_86A05EA0; +extern char D_86A05EA4; +extern char D_86A05EA8; +extern char D_86A05EAC; +extern char D_86A05EB0; +extern char D_86A05EB4; +extern char D_86A05EB8; +extern char D_86A05EBC; +extern char D_86A05EC0; +extern char D_86A05EC4; +extern char D_86A05EC8; +extern char D_86A05ECC; +extern char D_86A05ED0; +extern char D_86A05ED4; +extern char D_86A05ED8; +extern char D_86A05EDC; +extern char D_86A05EE0; +extern char D_86A05EE4; +extern char D_86A05EE8; +extern char D_86A05EEC; +extern char D_86A05EF0; +extern char D_86A05EF4; +extern char D_86A05EF8; +extern char D_86A05EFC; +extern char D_86A05F00; +extern char D_86A05F04; +extern char D_86A05F08; +extern char D_86A05F0C; +extern char D_86A05F10; +extern char D_86A05F14; +extern char D_86A05F18; +extern char D_86A05F1C; +extern char D_86A05F20; +extern char D_86A05F24; +extern char D_86A05F28; +extern char D_86A05F2C; +extern char D_86A05F30; +extern char D_86A05F34; +extern char D_86A05F38; +extern char D_86A05F3C; +extern char D_86A05F40; +extern char D_86A05F44; +extern char D_86A05F48; +extern char D_86A05F4C; +extern char D_86A05F50; +extern char D_86A05F54; +extern char D_86A05F58; +extern char D_86A05F5C; +extern char D_86A05F60; +extern char D_86A05F64; +extern char D_86A05F68; +extern char D_86A05F6C; +extern char D_86A05F70; +extern char D_86A05F74; +extern char D_86A05F78; +extern char D_86A05F7C; +extern char D_86A05F80; +extern char D_86A05F84; +extern char D_86A05F88; +extern char D_86A05F8C; +extern char D_86A05F90; +extern char D_86A05F94; +extern char D_86A05F98; +extern char D_86A05F9C; +extern char D_86A05FA0; +extern char D_86A05FA4; +extern char D_86A05FA8; +extern char D_86A05FAC; +extern char D_86A05FB0; +extern char D_86A05FB4; +extern char D_86A05FB8; +extern char D_86A05FBC; +extern char D_86A05FC0; +extern char D_86A05FC4; +extern char D_86A05FC8; +extern char D_86A05FCC; +extern char D_86A05FD0; +extern char D_86A05FD4; +extern char D_86A05FD8; +extern char D_86A05FDC; +extern char D_86A05FE0; +extern char D_86A05FE4; +extern char D_86A05FE8; +extern char D_86A05FEC; +extern char D_86A05FF0; +extern char D_86A05FF4; +extern char D_86A05FF8; +extern char D_86A05FFC; +extern char D_86A06000; +extern char D_86A06004; +extern char D_86A06008; +extern char D_86A0600C; +extern char D_86A06010; +extern char D_86A06014; +extern char D_86A06018; +extern char D_86A0601C; +extern char D_86A06020; +extern char D_86A06024; +extern char D_86A06028; +extern char D_86A0602C; +extern char D_86A06030; +extern char D_86A06034; +extern char D_86A06038; +extern char D_86A0603C; +extern char D_86A06040; +extern char D_86A06044; +extern char D_86A06048; +extern char D_86A0604C; +extern char D_86A06050; +extern char D_86A06054; +extern char D_86A06058; +extern char D_86A0605C; +extern char D_86A06060; +extern char D_86A06064; +extern char D_86A06068; +extern char D_86A0606C; +extern char D_86A06070; +extern char D_86A06074; +extern char D_86A06078; +extern char D_86A0607C; +extern char D_86A06080; +extern char D_86A06084; +extern char D_86A06088; +extern char D_86A0608C; +extern char D_86A06090; +extern char D_86A06094; +extern char D_86A06098; +extern char D_86A0609C; +extern char D_86A060A0; +extern char D_86A060A4; +extern char D_86A060A8; +extern char D_86A060AC; +extern char D_86A060B0; +extern char D_86A060B4; +extern char D_86A060B8; +extern char D_86A060BC; +extern char D_86A060C0; +extern char D_86A060C4; +extern char D_86A060C8; +extern char D_86A060CC; +extern char D_86A060D0; +extern char D_86A060D4; +extern char D_86A060D8; +extern char D_86A060DC; +extern char D_86A060E0; +extern char D_86A060E4; +extern char D_86A060E8; +extern char D_86A060EC; +extern char D_86A060F0; +extern char D_86A060F4; +extern char D_86A060F8; +extern char D_86A060FC; +extern char D_86A06100; +extern char D_86A06104; +extern char D_86A06108; +extern char D_86A0610C; +extern char D_86A06110; +extern char D_86A06114; +extern char D_86A06118; +extern char D_86A0611C; +extern char D_86A06120; +extern char D_86A06124; +extern char D_86A06128; +extern char D_86A0612C; +extern char D_86A06130; +extern char D_86A06134; + +extern u8 D_86A06210; +extern u8 D_86A06211; + +extern u16 D_86A06220; +extern u16 D_86A06222; +extern Vec3f D_86A06228; +extern f32 D_86A06234; +extern Vec3f D_86A06238; +extern f32 D_86A06244; +extern Vec3f D_86A06248; +extern unk_D_86002F34_00C* D_86A06254; +extern s16 D_86A06258; +extern s16* D_86A0625C; + +s32 func_86A00020(s32 arg0, unk_D_86002F34_000* arg1); +void func_86A013C8(u8 arg0, u8 arg1, unk_D_86A03014* arg2); +void func_86A01490(void); +void func_86A014F0(void); + +u16 func_86A018C0(void); + +void func_86A018D0(unk_D_86002F34_00C*, u16, s8, u8); +void func_86A01BEC(void); +void func_86A01CF0(s16*, s16*, s16*, unk_D_86002F34_00C*, u16, s8, u8); +void func_86A02164(void); +void func_86A021C0(s8*, u8*); + +s32 func_86A023A0(s32); +void func_86A0240C(u8); + +#endif // _FRAGMENT16_H_ diff --git a/src/fragments/16/fragment16_158A00.c b/src/fragments/16/fragment16_158A00.c index 40466768..67e0a920 100644 --- a/src/fragments/16/fragment16_158A00.c +++ b/src/fragments/16/fragment16_158A00.c @@ -1,37 +1,1679 @@ -#include "global.h" +#include "fragment16.h" +#include "src/11BA0.h" +#include "src/12D80.h" +#include "src/18480.h" +#include "src/1C720.h" +#include "src/1CF30.h" +#include "src/20330.h" +#include "src/2E110.h" +#include "src/3FB0.h" +#include "src/4BDC0.h" +#include "src/50860.h" +#include "src/6A40.h" +#include "src/6BC0.h" +#include "src/F420.h" +#include "src/controller.h" +#include "src/dp_intro.h" +#include "src/fragments/34/fragment34.h" +#include "src/memory.h" +#include "src/stage_loader.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00020.s") +typedef struct unk_D_86A02700 { + /* 0x00 */ u16 unk_00; + /* 0x02 */ u8 unk_02; + /* 0x03 */ Color_RGB8 unk_03[4]; +} unk_D_86A02700; // size = 0x10 -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A0003C.s") +static unk_D_8690A610 D_86A06170; +static unk_D_86002F34_000 D_86A06190; +static unk_D_86002F34_000 D_86A061A8; +static unk_D_86002F34_000 D_86A061C0; +static s8 D_86A061D8; +static u8 D_86A061D9; +static BinArchive* D_86A061DC; +static Color_RGBA8_u32 D_86A061E0; +static unk_D_86002F34_000* D_86A061E4; +static unk_D_86002F34_00C* D_86A061E8; +static s16 D_86A061EC; +static s16 D_86A061EE; +static s16 D_86A061F0; +static s32 pad_D_86A061F8[2]; +static unk_D_800AC870* D_86A06200; +static s32 pad_D_86A06208[2]; +u8 D_86A06210; +u8 D_86A06211; +u8 D_86A06212; +unk_D_86A03014* D_86A06214; +char* D_86A06218; +u32 D_86A0621C; +u16 D_86A06220; +u16 D_86A06222; +Vec3f D_86A06228; +f32 D_86A06234; +Vec3f D_86A06238; +f32 D_86A06244; +Vec3f D_86A06248; +unk_D_86002F34_00C* D_86A06254; +s16 D_86A06258; +s16* D_86A0625C; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A000B4.s") +unk_D_86A025A0 D_86A025A0[9] = { + { + 0x00, + 0x00, + 0x0528, + }, + { + 0x00, + 0x01, + 0x0438, + }, + { + 0x00, + 0x02, + 0x0438, + }, + { + 0x00, + 0x03, + 0x0438, + }, + { + 0x00, + 0x04, + 0x0438, + }, + { + 0x00, + 0x05, + 0x0438, + }, + { + 0x00, + 0x06, + 0x0528, + }, + { + 0x00, + 0x07, + 0x0438, + }, + { + 0xFF, + 0x00, + 0x0000, + }, +}; +u8 D_86A025C4 = 0; +u32 D_86A025C8 = 0; +u16 D_86A025CC = 0; +u32 D_86A025D0[] = { + 0x0C00FFFF, 0x05000000, 0x0B00001E, 0x00000000, 0x014000F0, 0x0000000F, 0x00000000, 0x00000000, + 0x05000000, 0x0D000000, 0x05000000, 0x07000000, &D_86A06170, 0x14000000, 0x002D0019, 0xFFFFFF28, + 0x16646464, 0x0F000002, 0x05000000, 0x1F00FFFF, 0x00000000, 0x00000000, 0x00000000, 0x00640064, + 0x00640000, 0x08000000, func_86A00020, 0x00000000, 0x05000000, 0x07000000, &D_86A06190, 0x06000000, + 0x06000000, 0x0F000003, 0x05000000, 0x1F00FFFF, 0x00000000, 0x00000000, 0x00000000, 0x00640064, + 0x00640000, 0x08000000, func_86A00020, 0x00000000, 0x05000000, 0x07000000, &D_86A061A8, 0x06000000, + 0x06000000, 0x0F000002, 0x05000000, 0x1F00FFFF, 0x00000000, 0x00000000, 0x00000000, 0x00640064, + 0x00640000, 0x08000000, func_86A00020, 0x00000000, 0x05000000, 0x07000000, &D_86A061C0, 0x06000000, + 0x06000000, 0x0F000003, 0x05000000, 0x0A000000, &D_800AC840, 0x06000000, 0x06000000, 0x06000000, + 0x06000000, 0x01000000, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00434.s") +s32 func_86A00020(s32 arg0, unk_D_86002F34_000* arg1) { + unk_D_86002F58_004_000* ptr = (unk_D_86002F58_004_000*)arg1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00464.s") + if (arg0 == 2) { + ptr->unk_03C.rgba = D_86A061E0.rgba; + } + return 0; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A0056C.s") +void func_86A0003C(u8 r, u8 g, u8 b) { + u8 v = r & g & b; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00720.s") + D_86A061E0.r = r; + D_86A061E0.g = g; + D_86A061E0.b = b; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00788.s") + if (v == 0xFF) { + if (D_86A06170.unk_00.unk_14 == 1) { + D_86A06170.unk_00.unk_01 |= 1; + } + } else { + D_86A06170.unk_00.unk_01 &= ~1; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00840.s") +void func_86A000B4(s8 arg0, u8 arg1) { + MemoryBlock* sp2C; + FragmentEntry sp28; + unk_D_86002F58_004_000_000* temp_v0; + unk_D_8690A610_018* temp_v0_4; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A0092C.s") + while (func_80001C90() == 0) {} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00C90.s") + func_8001103C(NULL, &D_86A06190); + func_8001103C(NULL, &D_86A061A8); + func_8001103C(NULL, &D_86A061C0); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00D00.s") + main_pool_pop_state('BACK'); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00DAC.s") + main_pool_push_state('BACK'); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A00ED8.s") + sp28 = func_8000484C(D_86A061DC, arg0); + sp2C = func_80002D10(main_pool_get_available(), 0); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A01020.s") + temp_v0 = sp28(0, 0); + if (temp_v0 != NULL) { + func_80012094(&D_86A06190, func_80018B70(sp2C, temp_v0)); + } + temp_v0 = sp28(1, 0); + if (temp_v0 != NULL) { + func_80012094(&D_86A061A8, func_80018B70(sp2C, temp_v0)); + } + + temp_v0 = sp28(3, 0); + if (temp_v0 != NULL) { + func_80012094(&D_86A061C0, func_80018B70(sp2C, temp_v0)); + } + + D_86A025C8 = sp28(2, 0); + func_80002D60(sp2C); + + temp_v0_4 = sp28(4, 0); + if (temp_v0_4 == NULL) { + D_86A06170.unk_00.unk_14 = 0; + D_86A06170.unk_00.unk_01 &= ~1; + } else { + D_86A06170.unk_18.unk_00 = temp_v0_4->unk_00; + D_86A06170.unk_18.unk_02 = temp_v0_4->unk_02; + D_86A06170.unk_18.unk_04.rgba = temp_v0_4->unk_04.rgba; + D_86A06170.unk_00.unk_14 = 1; + } + + func_86A0003C(0xFF, 0xFF, 0xFF); + + if (arg1 < 6) { + func_86A01CF0(&D_86A061EC, &D_86A061EE, &D_86A061F0, D_86A061E8, D_86A025A0[D_86A025C4].unk_02, arg0, arg1); + } else if (arg1 < 9) { + func_86A01CF0(&D_86A061EC, &D_86A061EE, &D_86A061F0, D_86A061E8, D_86A025A0[D_86A025C4].unk_02, arg0, arg1); + } else if (arg1 < 0xF) { + if (D_86A025C4 == 7) { + func_86A018D0(D_86A061E8, D_86A025A0[D_86A025C4].unk_02 - 0x28, arg0, arg1); + } else { + func_86A018D0(D_86A061E8, D_86A025A0[D_86A025C4].unk_02, arg0, arg1); + } + } else { + D_86A061E8->unk_60.at.y = D_86A03170[arg0][D_86A061D9].unk_10; + D_86A061F0 = D_86A03170[arg0][D_86A061D9].unk_08; + } +} + +void func_86A00434(void) { + Cont_StartReadInputs(); + Cont_ReadInputs(); + func_8001F730(); +} + +void func_86A00464(void) { + if (D_86A061D9 < 6) { + func_80010354(&D_86A061E8->unk_60.at, &D_86A061E8->unk_60.eye, D_86A061F0, D_86A061EC, D_86A061EE); + } else if (D_86A061D9 < 9) { + func_80010354(&D_86A06248, &D_86A061E8->unk_60.eye, D_86A061F0, D_86A061EC, D_86A061EE); + func_80010354(&D_86A06248, &D_86A061E8->unk_60.at, D_86A061F0 + 500.0f, D_86A061EC, D_86A061EE); + } +} + +void func_86A0056C(void) { + u8 temp_v1_2; + + if (D_86A025A0[D_86A025C4].unk_00 != -1) { + if (D_86A025CC < 8) { + temp_v1_2 = (s8)ROUND_MAX(((-(f32)D_86A025CC / 8) + 1.0f) * 255.0f); + if (temp_v1_2 != 0) { + func_8001F504(0, 0, 0x140, 0xF0, 0, 0, 0, temp_v1_2); + } + } else { + if ((D_86A025A0[D_86A025C4].unk_02 - 0x28) < D_86A025CC) { + s32 tmp = D_86A025A0[D_86A025C4].unk_02; + + temp_v1_2 = (s32)ROUND_MAX((((D_86A025CC - tmp) + 0x28) * 255.0f) / 40.0f); + if (temp_v1_2 != 0) { + func_8001F504(0, 0, 0x140, 0xF0, 0, 0, 0, temp_v1_2); + } + } + } + } +} + +void func_86A00720(u8 arg0) { + if ((arg0 == 1) || (arg0 == 2)) { + func_86A0056C(); + if ((D_86A025C4 != 0) || (D_86A025CC >= 0xF0)) { + func_86A014F0(); + } + } +} + +void func_86A00788(u8 arg0) { + func_800079C4(); + + if ((D_86A025C8 == -1) || (D_86A025C8 == 0)) { + func_8000699C(&gDisplayListHead, 1); + } else if (D_86A025C8 < 0x10000) { + func_8000699C(&gDisplayListHead, D_86A025C8); + } else { + func_8000699C(&gDisplayListHead, 0xA6BF); + } + + if (arg0 == 0) { + func_86A0240C(0); + } else { + func_80015094(D_86A061E4); + func_86A00720(arg0); + } + + func_80007778(); +} + +void func_86A00840(void) { + u8 i; + u8 j; + u8 sp35; + s32 var_s1; + + func_8004B9C4(0x1E); + + for (i = 0; i < 3; i++) { + var_s1 = sp35; + + switch (i) { + case 0: + sp35 = 0x1E; + func_80006C6C(sp35); + var_s1 = 0x1E; + break; + + case 1: + sp35 = 0x5A; + var_s1 = sp35; + break; + + case 2: + sp35 = 0x78; + func_80006CB4(sp35); + var_s1 = sp35; + break; + + default: + var_s1 = sp35; + break; + } + + for (j = 0; j < var_s1; j++) { + func_86A00434(); + func_86A00788(0); + } + } +} + +void func_86A0092C(s32 arg0) { + static u8 D_86A026F8 = 0; + + s32 var_s6 = 1; + + func_800077B4(0x3C); + func_80006C6C(0xB4); + + if (arg0 != 0) { + func_8004B1CC(0x42); + } else { + func_8004B1CC(0x43); + } + + func_86A021C0(&D_86A061D8, &D_86A061D9); + func_86A000B4(D_86A061D8, D_86A061D9); + + while (var_s6 != 0) { + func_86A01490(); + func_8140C5D0(); + + if (D_86A025A0[D_86A025C4].unk_02 != 0) { + if (D_86A025A0[D_86A025C4].unk_00 != -1) { + if (D_86A061D9 < 9) { + func_86A02164(); + } else { + func_86A01BEC(); + } + } + + if (D_86A025CC >= D_86A025A0[D_86A025C4].unk_02) { + D_86A025C4++; + if (D_86A025A0[D_86A025C4].unk_02 != 0) { + D_86A025A0[D_86A025C4].unk_02 = + D_86A025A0[D_86A025C4 - 1].unk_02 + (D_86A025A0[D_86A025C4].unk_02 - D_86A025CC); + } + + D_86A025CC = 0; + + if (D_86A025A0[D_86A025C4].unk_00 != -1) { + func_86A021C0(&D_86A061D8, &D_86A061D9); + func_86A000B4(D_86A061D8, D_86A061D9); + } else { + D_86A061D8 = -1; + D_86A025C8 = 0; + + func_8001103C(NULL, &D_86A06190); + func_8001103C(NULL, &D_86A061A8); + func_8001103C(NULL, &D_86A061C0); + + D_86A06170.unk_00.unk_01 &= ~1; + if (D_86A025A0[D_86A025C4].unk_02 == 0) { + main_pool_pop_state('BACK'); + } + } + } else if ((D_86A025C4 == 3) && (D_86A026F8 < 2) && + (D_86A025CC >= (((D_86A025A0[D_86A025C4].unk_02 * (D_86A026F8 + 1)) / 3) - 1))) { + func_86A021C0(&D_86A061D8, &D_86A061D9); + func_86A000B4(D_86A061D8, 0xFF); + D_86A026F8++; + } + } + + func_86A00434(); + func_86A00464(); + + if (D_86A05B50 >= 0x2D1) { + var_s6 = 0; + } else if ((D_86A05B50 >= 0x169) && + ((gPlayer1Controller->buttonPressed & 0x1000) || (gPlayer1Controller->buttonPressed & 0x8000))) { + var_s6 = 0; + } + + func_86A00788(1); + + if (D_86A025A0[D_86A025C4].unk_02 != 0) { + D_86A025CC += D_86A06210; + } + } +} + +static s32 pad_D_86A026FC = 0; +unk_D_86A02700 D_86A02700[] = { + { + 0, + 0, + { + { 0xFF, 0, 0xE6 }, + { 0xFF, 0xC8, 0xFF }, + { 0, 0x46, 0xFF }, + { 0x64, 0xFF, 0xFF }, + }, + }, + { + 8, + 0xFF, + { + { 0xFF, 0xC8, 0xFF }, + { 0xFF, 0xFF, 0xFF }, + { 0x64, 0xFF, 0xFF }, + { 0xFF, 0xFF, 0xFF }, + }, + }, + { + 0x1E, + 0xFF, + { + { 0xFF, 0, 0xFF }, + { 0xFF, 0xC8, 0xFF }, + { 0, 0x46, 0xFF }, + { 0x64, 0xFF, 0xFF }, + }, + }, + { + 0x153, + 0xFF, + { + { 0xFF, 0, 0xFF }, + { 0xFF, 0xC8, 0xFF }, + { 0, 0x46, 0xFF }, + { 0x64, 0xFF, 0xFF }, + }, + }, + { + 0x167, + 0, + { + { 0xFF, 0, 0xE6 }, + { 0xFF, 0xC8, 0xFF }, + { 0, 0x46, 0xFF }, + { 0x64, 0xFF, 0xFF }, + }, + }, +}; + +static unk_D_86A02750 D_86A02750[] = { + { + 0, + { &D_86A05B60, &D_86A05B64 }, + }, + { + 1, + { &D_86A05B68, &D_86A05B6C }, + }, + { + 0, + { &D_86A05B70, &D_86A05B74 }, + }, + { + 1, + { &D_86A05B78, &D_86A05B7C }, + }, + { + 0, + { &D_86A05B80, &D_86A05B84 }, + }, + { + 1, + { &D_86A05B88, &D_86A05B8C }, + }, + { + 0, + { &D_86A05B90, &D_86A05B94 }, + }, + { + 1, + { &D_86A05B98, &D_86A05B9C }, + }, + { + 0, + { &D_86A05BA0, &D_86A05BA4 }, + }, + { + 1, + { &D_86A05BA8, &D_86A05BAC }, + }, + { + 0, + { &D_86A05BB0, &D_86A05BB4 }, + }, + { + 1, + { &D_86A05BB8, &D_86A05BBC }, + }, + { + 0, + { &D_86A05BC0, &D_86A05BC4 }, + }, + { + 1, + { &D_86A05BC8, &D_86A05BCC }, + }, + { + 0, + { &D_86A05BD0, &D_86A05BD4 }, + }, + { + 1, + { &D_86A05BD8, &D_86A05BDC }, + }, + { + 0, + { &D_86A05BE0, &D_86A05BE4 }, + }, + { + 1, + { &D_86A05BE8, &D_86A05BEC }, + }, + { + 1, + { &D_86A05BF0, &D_86A05BF4 }, + }, + { + 1, + { &D_86A05BF8, &D_86A05BFC }, + }, + { + 0, + { &D_86A05C00, &D_86A05C04 }, + }, + { + 1, + { &D_86A05C08, &D_86A05C0C }, + }, + { + 0, + { &D_86A05C10, &D_86A05C14 }, + }, + { + 1, + { &D_86A05C18, &D_86A05C1C }, + }, + { + 0, + { &D_86A05C20, &D_86A05C24 }, + }, + { + 1, + { &D_86A05C28, &D_86A05C2C }, + }, + { + 0, + { &D_86A05C30, &D_86A05C34 }, + }, + { + 1, + { &D_86A05C38, &D_86A05C3C }, + }, + { + 1, + { &D_86A05C40, &D_86A05C44 }, + }, + { + 1, + { &D_86A05C48, &D_86A05C4C }, + }, + { + 1, + { &D_86A05C50, &D_86A05C54 }, + }, + { + 1, + { &D_86A05C58, &D_86A05C5C }, + }, + { + 0, + { &D_86A05C60, &D_86A05C64 }, + }, + { + 1, + { &D_86A05C68, &D_86A05C6C }, + }, + { + 1, + { &D_86A05C70, &D_86A05C74 }, + }, + { + 1, + { &D_86A05C78, &D_86A05C7C }, + }, + { + 1, + { &D_86A05C80, &D_86A05C84 }, + }, + { + 0, + { &D_86A05C88, &D_86A05C8C }, + }, + { + 1, + { &D_86A05C90, &D_86A05C94 }, + }, + { + 1, + { &D_86A05C98, &D_86A05C9C }, + }, + { + 0, + { &D_86A05CA0, &D_86A05CA4 }, + }, + { + 1, + { &D_86A05CA8, &D_86A05CAC }, + }, + { + 1, + { &D_86A05CB0, &D_86A05CB4 }, + }, + { + 1, + { &D_86A05CB8, &D_86A05CBC }, + }, + { + 1, + { &D_86A05CC0, &D_86A05CC4 }, + }, + { + 1, + { &D_86A05CC8, &D_86A05CCC }, + }, + { + 1, + { &D_86A05CD0, &D_86A05CD4 }, + }, + { + 1, + { &D_86A05CD8, &D_86A05CDC }, + }, + { + 1, + { &D_86A05CE0, &D_86A05CE4 }, + }, + { + 0, + { &D_86A05CE8, &D_86A05CEC }, + }, + { + 1, + { &D_86A05CF0, &D_86A05CF4 }, + }, + { + 1, + { &D_86A05CF8, &D_86A05CFC }, + }, + { + 1, + { &D_86A05D00, &D_86A05D04 }, + }, + { + 1, + { &D_86A05D08, &D_86A05D0C }, + }, + { + 1, + { &D_86A05D10, &D_86A05D14 }, + }, + { + 1, + { &D_86A05D18, &D_86A05D1C }, + }, + { + 1, + { &D_86A05D20, &D_86A05D24 }, + }, + { + 1, + { &D_86A05D28, &D_86A05D2C }, + }, + { + 0, + { &D_86A05D30, &D_86A05D34 }, + }, + { + 1, + { &D_86A05D38, &D_86A05D3C }, + }, + { + 1, + { &D_86A05D40, &D_86A05D44 }, + }, + { + 1, + { &D_86A05D48, &D_86A05D4C }, + }, + { + 1, + { &D_86A05D50, &D_86A05D54 }, + }, + { + 1, + { &D_86A05D58, &D_86A05D5C }, + }, + { + 1, + { &D_86A05D60, &D_86A05D64 }, + }, + { + 1, + { &D_86A05D68, &D_86A05D6C }, + }, + { + 1, + { &D_86A05D70, &D_86A05D74 }, + }, + { + 0, + { &D_86A05D78, &D_86A05D7C }, + }, + { + 1, + { &D_86A05D80, &D_86A05D84 }, + }, + { + 1, + { &D_86A05D88, &D_86A05D8C }, + }, + { + 1, + { &D_86A05D90, &D_86A05D94 }, + }, + { + 1, + { &D_86A05D98, &D_86A05D9C }, + }, + { + 1, + { &D_86A05DA0, &D_86A05DA4 }, + }, + { + 1, + { &D_86A05DA8, &D_86A05DAC }, + }, + { + 1, + { &D_86A05DB0, &D_86A05DB4 }, + }, + { + 1, + { &D_86A05DB8, &D_86A05DBC }, + }, + { + 0, + { &D_86A05DC0, &D_86A05DC4 }, + }, + { + 1, + { &D_86A05DC8, &D_86A05DCC }, + }, + { + 1, + { &D_86A05DD0, &D_86A05DD4 }, + }, + { + 1, + { &D_86A05DD8, &D_86A05DDC }, + }, + { + 1, + { &D_86A05DE0, &D_86A05DE4 }, + }, + { + 1, + { &D_86A05DE8, &D_86A05DEC }, + }, + { + 1, + { &D_86A05DF0, &D_86A05DF4 }, + }, + { + 1, + { &D_86A05DF8, &D_86A05DFC }, + }, + { + 1, + { &D_86A05E00, &D_86A05E04 }, + }, + { + 0, + { &D_86A05E08, &D_86A05E0C }, + }, + { + 1, + { &D_86A05E10, &D_86A05E14 }, + }, + { + 1, + { &D_86A05E18, &D_86A05E1C }, + }, + { + 1, + { &D_86A05E20, &D_86A05E24 }, + }, + { + 0, + { &D_86A05E28, &D_86A05E2C }, + }, + { + 1, + { &D_86A05E30, &D_86A05E34 }, + }, + { + 0, + { &D_86A05E38, &D_86A05E3C }, + }, + { + 1, + { &D_86A05E40, &D_86A05E44 }, + }, + { + 1, + { &D_86A05E48, &D_86A05E4C }, + }, + { + 0, + { &D_86A05E50, &D_86A05E54 }, + }, + { + 1, + { &D_86A05E58, &D_86A05E5C }, + }, + { + 0, + { &D_86A05E60, &D_86A05E64 }, + }, + { + 1, + { &D_86A05E68, &D_86A05E6C }, + }, + { + 1, + { &D_86A05E70, &D_86A05E74 }, + }, + { + 0, + { &D_86A05E78, &D_86A05E7C }, + }, + { + 1, + { &D_86A05E80, &D_86A05E84 }, + }, + { + 0, + { &D_86A05E88, &D_86A05E8C }, + }, + { + 1, + { &D_86A05E90, &D_86A05E94 }, + }, + { + 1, + { &D_86A05E98, &D_86A05E9C }, + }, + { + 0, + { &D_86A05EA0, &D_86A05EA4 }, + }, + { + 1, + { &D_86A05EA8, &D_86A05EAC }, + }, + { + 1, + { &D_86A05EB0, &D_86A05EB4 }, + }, + { + 1, + { &D_86A05EB8, &D_86A05EBC }, + }, + { + 0, + { &D_86A05EC0, &D_86A05EC4 }, + }, + { + 1, + { &D_86A05EC8, &D_86A05ECC }, + }, + { + 0, + { &D_86A05ED0, &D_86A05ED4 }, + }, + { + 1, + { &D_86A05ED8, &D_86A05EDC }, + }, + { + 0, + { &D_86A05EE0, &D_86A05EE4 }, + }, + { + 1, + { &D_86A05EE8, &D_86A05EEC }, + }, + { + 1, + { &D_86A05EF0, &D_86A05EF4 }, + }, + { + 0, + { &D_86A05EF8, &D_86A05EFC }, + }, + { + 1, + { &D_86A05F00, &D_86A05F04 }, + }, + { + 1, + { &D_86A05F08, &D_86A05F0C }, + }, + { + 1, + { &D_86A05F10, &D_86A05F14 }, + }, + { + 1, + { &D_86A05F18, &D_86A05F1C }, + }, + { + 1, + { &D_86A05F20, &D_86A05F24 }, + }, + { + 0, + { &D_86A05F28, &D_86A05F2C }, + }, + { + 1, + { &D_86A05F30, &D_86A05F34 }, + }, + { + 1, + { &D_86A05F38, &D_86A05F3C }, + }, + { + 1, + { &D_86A05F40, &D_86A05F44 }, + }, + { + 1, + { &D_86A05F48, &D_86A05F4C }, + }, + { + 2, + { &D_86A05F50, &D_86A05F54 }, + }, + { + 1, + { &D_86A05F58, &D_86A05F5C }, + }, + { + 1, + { &D_86A05F60, &D_86A05F64 }, + }, + { + 1, + { &D_86A05F68, &D_86A05F6C }, + }, + { + 0, + { &D_86A05F70, &D_86A05F74 }, + }, + { + 1, + { &D_86A05F78, &D_86A05F7C }, + }, + { + 1, + { &D_86A05F80, &D_86A05F84 }, + }, + { + 1, + { &D_86A05F88, &D_86A05F8C }, + }, + { + 1, + { &D_86A05F90, &D_86A05F94 }, + }, + { + 1, + { &D_86A05F98, &D_86A05F9C }, + }, + { + 1, + { &D_86A05FA0, &D_86A05FA4 }, + }, + { + 0, + { &D_86A05FA8, &D_86A05FAC }, + }, + { + 1, + { &D_86A05FB0, &D_86A05FB4 }, + }, + { + 0, + { &D_86A05FB8, &D_86A05FBC }, + }, + { + 1, + { &D_86A05FC0, &D_86A05FC4 }, + }, + { + 0, + { &D_86A05FC8, &D_86A05FCC }, + }, + { + 1, + { &D_86A05FD0, &D_86A05FD4 }, + }, + { + 1, + { &D_86A05FD8, &D_86A05FDC }, + }, + { + 1, + { &D_86A05FE0, &D_86A05FE4 }, + }, + { + 1, + { &D_86A05FE8, &D_86A05FEC }, + }, + { + 0, + { &D_86A05FF0, &D_86A05FF4 }, + }, + { + 1, + { &D_86A05FF8, &D_86A05FFC }, + }, + { + 1, + { &D_86A06000, &D_86A06004 }, + }, + { + 1, + { &D_86A06008, &D_86A0600C }, + }, + { + 1, + { &D_86A06010, &D_86A06014 }, + }, + { + 0, + { &D_86A06018, &D_86A0601C }, + }, + { + 1, + { &D_86A06020, &D_86A06024 }, + }, + { + 1, + { &D_86A06028, &D_86A0602C }, + }, + { + 1, + { &D_86A06030, &D_86A06034 }, + }, + { + 2, + { &D_86A06038, &D_86A0603C }, + }, + { + 1, + { &D_86A06040, &D_86A06044 }, + }, + { + 1, + { &D_86A06048, &D_86A0604C }, + }, + { + 1, + { &D_86A06050, &D_86A06054 }, + }, + { + 1, + { &D_86A06058, &D_86A0605C }, + }, + { + 1, + { &D_86A06060, &D_86A06064 }, + }, + { + 1, + { &D_86A06068, &D_86A0606C }, + }, + { + 0, + { &D_86A06070, &D_86A06074 }, + }, + { + 1, + { &D_86A06078, &D_86A0607C }, + }, + { + 1, + { &D_86A06080, &D_86A06084 }, + }, + { + 1, + { &D_86A06088, &D_86A0608C }, + }, + { + 1, + { &D_86A06090, &D_86A06094 }, + }, + { + 1, + { &D_86A06098, &D_86A0609C }, + }, + { + 0, + { &D_86A060A0, &D_86A060A4 }, + }, + { + 1, + { &D_86A060A8, &D_86A060AC }, + }, + { + 1, + { &D_86A060B0, &D_86A060B4 }, + }, + { + 0, + { &D_86A060B8, &D_86A060BC }, + }, + { + 1, + { &D_86A060C0, &D_86A060C4 }, + }, + { + 0, + { &D_86A060C8, &D_86A060CC }, + }, + { + 1, + { &D_86A060D0, &D_86A060D4 }, + }, + { + 1, + { &D_86A060D8, &D_86A060DC }, + }, + { + 1, + { &D_86A060E0, &D_86A060E4 }, + }, + { + 0, + { &D_86A060E8, &D_86A060EC }, + }, + { + 1, + { &D_86A060F0, &D_86A060F4 }, + }, + { + 1, + { &D_86A060F8, &D_86A060FC }, + }, + { + 0, + { &D_86A06100, &D_86A06104 }, + }, + { + 1, + { &D_86A06108, &D_86A0610C }, + }, + { + 1, + { &D_86A06110, &D_86A06114 }, + }, + { + 1, + { &D_86A06118, &D_86A0611C }, + }, + { + 1, + { &D_86A06120, &D_86A06124 }, + }, + { + 0, + { &D_86A06128, &D_86A0612C }, + }, + { + 1, + { &D_86A06130, &D_86A06134 }, + }, +}; + +unk_D_86A03014 D_86A03014[29] = { + { + 0, + 360, + 40, + 6, + D_86A02750, + }, + { + 0, + 360, + 40, + 6, + NULL, + }, + { + 0, + 368, + 48, + 8, + NULL, + }, + { + 0, + 352, + 40, + 6, + NULL, + }, + { + 0, + 360, + 40, + 6, + NULL, + }, + { + 0, + 368, + 48, + 5, + NULL, + }, + { + 0, + 352, + 40, + 3, + NULL, + }, + { + 0, + 360, + 40, + 9, + NULL, + }, + { + 0, + 368, + 48, + 9, + NULL, + }, + { + 0, + 352, + 40, + 9, + NULL, + }, + { + 0, + 360, + 40, + 9, + NULL, + }, + { + 0, + 368, + 48, + 9, + NULL, + }, + { + 0, + 232, + 40, + 4, + NULL, + }, + { + 0, + 240, + 40, + 5, + NULL, + }, + { + 0, + 240, + 40, + 5, + NULL, + }, + { + 0, + 368, + 48, + 9, + NULL, + }, + { + 0, + 352, + 40, + 7, + NULL, + }, + { + 0, + 360, + 40, + 6, + NULL, + }, + { + 0, + 368, + 48, + 9, + NULL, + }, + { + 0, + 352, + 40, + 9, + NULL, + }, + { + 0, + 240, + 40, + 2, + NULL, + }, + { + 0, + 360, + 40, + 10, + NULL, + }, + { + 0, + 368, + 48, + 11, + NULL, + }, + { + 0, + 352, + 40, + 9, + NULL, + }, + { + 0, + 360, + 40, + 9, + NULL, + }, + { + 0, + 360, + 40, + 5, + NULL, + }, + { + 0, + 240, + 40, + 2, + NULL, + }, + { + 0, + 0, + 40, + 0, + NULL, + }, + { + 0, + 0, + 0, + 0, + NULL, + }, +}; + +void func_86A00C90(void) { + u8 i; + + func_8004FC60(1, 0x78); + func_8004FC60(2, 0x78); + func_80006CB4(0x78); + + for (i = 0; i < 120; i++) { + func_86A00434(); + func_86A00788(2); + } + + func_800077B4(0x3C); +} + +void func_86A00D00(void) { + D_86A061E8 = D_86A061E4->unk_0C; + D_86A061EC = 0x100; + D_86A061EE = 0; + D_86A061F0 = 0x78; + + D_86A061E8->unk_24.near = 50.0f; + D_86A061E8->unk_24.far = 6400.0f; + func_80010354(&D_86A061E8->unk_60.at, &D_86A061E8->unk_60.eye, D_86A061F0, D_86A061EC, D_86A061EE); +} + +void func_86A00DAC(s32 arg0) { + MemoryBlock* sp2C; + MemoryBlock* temp_v0; + + D_86A061DC = ASSET_LOAD2(stadium_models, 1, 1); + func_800113F8(0, &D_86A06170, 0x3C0, 0x3E8, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001103C(NULL, &D_86A06190); + func_8001103C(NULL, &D_86A061A8); + func_8001103C(NULL, &D_86A061C0); + func_86A0003C(0xFF, 0xFF, 0xFF); + sp2C = func_80002D10(main_pool_get_available(), 0); + D_86A061E4 = func_80018B70(sp2C, &D_86A025D0); + func_80002D60(sp2C); + func_8001BB20(); + func_86A00D00(); + func_86A013C8(1, arg0, D_86A03014); + D_86A061D8 = -1; + + main_pool_push_state('BACK'); +} + +s32 func_86A00ED8(s32 arg0, s32 arg1) { + unk_func_80007444* sp24; + + main_pool_push_state('ROLE'); + + func_80005E40(0x10000, 0); + sp24 = func_80007444(0, 1, 3, 1, 1, 1); + D_86A06200 = func_8001E94C(4, 0); + + ASSET_LOAD(D_1000000, common_menu1_ui, 0); + ASSET_LOAD(D_3000000, kids_club_game_ui, 0); + FRAGMENT_LOAD(fragment31); + + func_86A00DAC(arg1); + func_80007678(sp24); + func_86A00840(); + func_86A0092C(arg1); + func_86A00C90(); + func_800076C0(); + func_8001E9CC(); + func_80005EAC(); + + main_pool_pop_state('ROLE'); + + return 0; +} + +s32 func_86A01020(Color_RGBA8_u32* arg0, u16 arg1, u16 arg2, u8 arg3) { + u8 i; + u8 j; + u8 temp_fv1; + + if (arg1 >= (arg2 - arg3)) { + return 0; + } + + D_86A02700[3].unk_00 = (arg2 - arg3) - 0x15; + D_86A02700[4].unk_00 = (arg2 - arg3) - 1; + + for (i = 0; i < 5; i++) { + if (arg1 == D_86A02700[i].unk_00) { + for (j = 0; j < 4; j++) { + func_8000E840(&arg0[j], D_86A02700[i].unk_03[j].r, D_86A02700[i].unk_03[j].g, D_86A02700[i].unk_03[j].b, + D_86A02700[i].unk_02); + } + break; + } + + if ((D_86A02700[i].unk_00 < arg1) && (arg1 < D_86A02700[i + 1].unk_00)) { + temp_fv1 = + (s32)ROUND_MAX((((D_86A02700[i + 1].unk_02 - D_86A02700[i].unk_02) * (arg1 - D_86A02700[i].unk_00)) / + (f32)(D_86A02700[i + 1].unk_00 - D_86A02700[i].unk_00)) + + D_86A02700[i].unk_02); + + for (j = 0; j < 4; j++) { + arg0[j].r = (s32)ROUND_MAX( + (((D_86A02700[i + 1].unk_03[j].r - D_86A02700[i].unk_03[j].r) * (arg1 - D_86A02700[i].unk_00)) / + (f32)(D_86A02700[i + 1].unk_00 - D_86A02700[i].unk_00)) + + D_86A02700[i].unk_03[j].r); + arg0[j].g = (s32)ROUND_MAX( + (((D_86A02700[i + 1].unk_03[j].g - D_86A02700[i].unk_03[j].g) * (arg1 - D_86A02700[i].unk_00)) / + (f32)(D_86A02700[i + 1].unk_00 - D_86A02700[i].unk_00)) + + D_86A02700[i].unk_03[j].g); + arg0[j].b = (s32)ROUND_MAX( + (((D_86A02700[i + 1].unk_03[j].b - D_86A02700[i].unk_03[j].b) * (arg1 - D_86A02700[i].unk_00)) / + (f32)(D_86A02700[i + 1].unk_00 - D_86A02700[i].unk_00)) + + D_86A02700[i].unk_03[j].b); + arg0[j].a = temp_fv1; + } + + break; + } + } + return 1; +} + +#ifdef NON_MATCHING +// Needs the in-fucntion static but that breaks bss ordering +void func_86A013C8(u8 arg0, u8 arg1, unk_D_86A03014* arg2) { + static char* D_86A06218; + + u16 i; + u16 sp2C; + unk_D_86A02750* ptr; + + sp2C = func_86A018C0(); + func_8002D510(); + D_86A06218 = func_8002D5AC(0x2D); + + for (i = 0, ptr = D_86A02750; i < sp2C; i++, ptr++) { + ptr->unk_04[0] = func_8002D7C0(NULL, 0, D_86A06218, i); + } + + D_86A06210 = arg0; + D_86A06211 = 0; + D_86A06212 = 0; + D_86A06214 = arg2; +} +#else #pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A013C8.s") +#endif +#ifdef NON_MATCHING +void func_86A01490(void) { + static u32 D_86A0621C; + + s32 temp_v0 = D_800A6CF4.unk_20; + + if (D_86A06212 == 0) { + D_86A06212 = 1; + } else if (D_86A0621C < temp_v0) { + D_86A06210 = temp_v0 - D_86A0621C; + } else { + D_86A06210 = temp_v0 - D_86A0621C; + } + D_86A0621C = temp_v0; +} +#else #pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A01490.s") +#endif + +void func_86A014F0(void) { + u8 var_a1; + u8 var_s0; + u8 var_s1; + u8 i; + s32 var_s5; + Color_RGBA8_u32 sp60[4]; + u16 var_s11; + unk_D_86A02750* ptr; + unk_D_86A03014 sp4C; + + if (D_86A06214 == NULL) { + func_86A0240C(1); + return; + } + + var_s0 = 0; + var_s1 = 0; + + if (func_86A01020(sp60, D_86A06214->unk_00, D_86A06214->unk_02, D_86A06214->unk_04) != 0) { + func_8001F3F4(); + func_8001F470(); + func_8001EBE0(4, 0); + + var_s5 = 0; + + func_8001F324(sp60[0].r, sp60[0].g, sp60[0].b, sp60[0].a); + func_8001F36C(sp60[1].r, sp60[1].g, sp60[1].b, sp60[1].a); + + ptr = D_86A06214->unk_08; + for (i = 0; i < D_86A06214->unk_05; i++, ptr++) { + switch (ptr->unk_00) { + case 0: + var_s0++; + break; + + case 2: + var_s1++; + break; + } + } + + if (var_s0 >= 2) { + var_a1 = ((var_s0 * 4) + (var_s0 * 0xC) + (var_s1 * 0xA)) - 0xC; + } else { + var_a1 = (var_s0 * 4) + (var_s1 * 0xA); + } + + var_s11 = (((-((D_86A06214->unk_05 - var_s1) * 0x11) - var_a1) + 0xF0) / 2) & 0xFFFF; + + for (i = 0, ptr = D_86A06214->unk_08; i < D_86A06214->unk_05; i++, ptr++) { + if (ptr->unk_00 == 2) { + var_s11 += 0xA; + continue; + } + + if (var_s5 != ptr->unk_00) { + switch (ptr->unk_00) { + case 0: + func_8001F324(sp60[0].r, sp60[0].g, sp60[0].b, sp60[0].a); + func_8001F36C(sp60[1].r, sp60[1].g, sp60[1].b, sp60[1].a); + var_s5 = 0; + var_s11 += 0xC; + break; + + case 1: + func_8001F324(sp60[2].r, sp60[2].g, sp60[2].b, sp60[2].a); + func_8001F36C(sp60[3].r, sp60[3].g, sp60[3].b, sp60[3].a); + var_s5 = 1; + var_s11 += 4; + break; + } + } + + func_8001F1E8(0xA0 - (func_8001F5B0(0, 0, ptr->unk_04[D_86A06211]) / 2), (var_s11 * 4) >> 2, + ptr->unk_04[D_86A06211]); + var_s11 += 0x11; + } + + func_8001F4C4(); + func_8001F444(); + } + + D_86A06214->unk_00 = D_86A06214->unk_00 + D_86A06210; + if (D_86A06214->unk_00 >= D_86A06214->unk_02) { + sp4C = *D_86A06214; + + D_86A06214++; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_158A00/func_86A014F0.s") + D_86A06214->unk_08 = &sp4C.unk_08[sp4C.unk_05]; + if (D_86A06214->unk_02 == 0) { + D_86A06214 = NULL; + } else { + D_86A06214->unk_02 = (D_86A06214->unk_02 - sp4C.unk_00) + sp4C.unk_02; + D_86A06214->unk_00 = 0; + } + } +} diff --git a/src/fragments/16/fragment16_15A2A0.c b/src/fragments/16/fragment16_15A2A0.c index 2d80ab4e..e1b0bc11 100644 --- a/src/fragments/16/fragment16_15A2A0.c +++ b/src/fragments/16/fragment16_15A2A0.c @@ -1,3 +1,5 @@ -#include "global.h" +#include "fragment16.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15A2A0/func_86A018C0.s") +u16 func_86A018C0(void) { + return 0xBB; +} diff --git a/src/fragments/16/fragment16_15A2B0.c b/src/fragments/16/fragment16_15A2B0.c index 5252c85a..57b83b08 100644 --- a/src/fragments/16/fragment16_15A2B0.c +++ b/src/fragments/16/fragment16_15A2B0.c @@ -1,11 +1,3437 @@ -#include "global.h" +#include "fragment16.h" +#include "src/F420.h" +unk_D_86A03170 D_86A03170[17][6] = { + { + { + 0xAB00, + 0x2B00, + 0x01, + 0x0880, + 0x04B0, + 45.5f, + 71.0f, + 28.0f, + 7400.0f, + }, + { + 0xCC00, + 0x3500, + 0x01, + 0x0280, + 0x05AA, + 30.0f, + 22.0f, + 28.0f, + 7400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0200, + 0x0514, + 22.5f, + 200.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1600, + 0x04B0, + 60.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3000, + 0x1388, + 25.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0xFC00, + 0x001E, + 89.5f, + 40.0f, + 25.0f, + 12800.0f, + }, + }, + { + { + 0x4000, + 0xC000, + 0x01, + 0x0C00, + 0x0780, + 53.5f, + 136.0f, + 200.0f, + 25600.0f, + }, + { + 0x4000, + 0xC000, + 0xFF, + 0x3F00, + 0x3200, + 17.5f, + 675.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0500, + 0x05DC, + 40.0f, + 500.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1000, + 0x0CB2, + 60.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x3200, + 17.5f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0xF500, + 0x001E, + 89.5f, + 15.0f, + 5.0f, + 12800.0f, + }, + }, + { + { + 0x4000, + 0xC000, + 0x01, + 0x0880, + 0x092E, + 50.5f, + 294.0f, + 100.0f, + 12800.0f, + }, + { + 0x4000, + 0xC000, + 0x01, + 0xF900, + 0x04B0, + 55.5f, + 351.0f, + 5.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0A00, + 0x08CA, + 30.0f, + 15.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0100, + 0x0384, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0xF800, + 0x001E, + 60.0f, + 15.0f, + 5.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0xF100, + 0x001E, + 40.0f, + 0.0f, + 100.0f, + 12800.0f, + }, + }, + { + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x0384, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x0384, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x0384, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x0384, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x0384, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x0384, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x4000, + 0xC100, + 0x01, + 0x0580, + 0x062C, + 44.5f, + 195.0f, + 100.0f, + 12800.0f, + }, + { + 0x4000, + 0xC000, + 0x01, + 0xFE80, + 0x0226, + 59.5f, + 115.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0200, + 0x001E, + 30.0f, + 300.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0B00, + 0x0DAC, + 30.0f, + 50.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x0A8C, + 70.0f, + 15.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0700, + 0x01F4, + 70.0f, + 75.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x0000, + 0x8000, + 0x01, + 0x0500, + 0x06FE, + 42.5f, + 213.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x8000, + 0x01, + 0xFA80, + 0x0276, + 57.0f, + 168.0f, + 50.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1800, + 0x05DC, + 30.0f, + 500.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0A00, + 0x0BB8, + 30.0f, + -90.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1600, + 0x1388, + 30.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x0C80, + 50.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + }, + { + { + 0x4000, + 0xC000, + 0x01, + 0x0C00, + 0x050A, + 42.5f, + 181.0f, + 50.0f, + 6400.0f, + }, + { + 0x4000, + 0xC000, + 0x01, + 0xFC80, + 0x0302, + 60.0f, + 195.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0F00, + 0x05DC, + 30.0f, + 350.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1C00, + 0x05DC, + 45.0f, + 50.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x05DC, + 75.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0600, + 0x044C, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x0C80, + 0x0546, + 50.0f, + 181.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x04B0, + 110.0f, + 40.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x1080, + 0x064A, + 49.0f, + 178.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x0456, + 110.0f, + 142.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x0B80, + 0x05DC, + 44.0f, + 117.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x044C, + 110.0f, + 116.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x0C80, + 0x0596, + 46.5f, + 106.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x044C, + 110.0f, + 138.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x0C00, + 0x058C, + 46.0f, + 150.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x0456, + 110.0f, + 130.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x0980, + 0x0550, + 49.0f, + 73.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x050A, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x0580, + 0x049C, + 48.5f, + 162.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x044C, + 110.0f, + 238.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x5600, + 0xD600, + 0xFF, + 0x1080, + 0x0514, + 48.0f, + 90.0f, + 200.0f, + 25600.0f, + }, + { + 0x0100, + 0x8100, + 0xFF, + 0x3F00, + 0x0456, + 110.0f, + 87.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0D00, + 0x02B2, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1D00, + 0x07D0, + 45.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x044C, + 110.0f, + 15.0f, + 200.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0000, + 0x01F4, + 80.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0x0000, + 0x3000, + 0x01, + 0x0300, + 0x01F4, + 30.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0200, + 0x0046, + 30.0f, + 215.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1100, + 0x0280, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x2000, + 0x0366, + 60.0f, + 15.0f, + 500.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x06A4, + 40.0f, + 15.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0500, + 0x001E, + 60.0f, + 50.0f, + 10.0f, + 3200.0f, + }, + }, + { + { + 0x0000, + 0x3000, + 0x01, + 0x0300, + 0x01F4, + 30.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0200, + 0x0046, + 30.0f, + 215.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x1100, + 0x0280, + 50.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x2000, + 0x0366, + 60.0f, + 15.0f, + 500.0f, + 25600.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x3F00, + 0x06A4, + 40.0f, + 15.0f, + 100.0f, + 12800.0f, + }, + { + 0x0000, + 0x3000, + 0x01, + 0x0500, + 0x001E, + 60.0f, + 50.0f, + 10.0f, + 3200.0f, + }, + }, +}; + +static unk_D_86A03170 D_86A03C98[2][3] = { + { + { + 256, + -32512, + 1, + 5120, + 860, + 60.0f, + 87.0f, + 430.0f, + 25600.0f, + }, + { + 256, + -32512, + 1, + 1920, + 490, + 60.0f, + 49.0f, + 220.0f, + 25600.0f, + }, + { + 0, + -32768, + -1, + -1152, + 520, + 57.0f, + 108.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 8192, + 870, + 60.0f, + 15.0f, + 500.0f, + 25600.0f, + }, + { + 0, + 12288, + 1, + 16128, + 1700, + 40.0f, + 15.0f, + 100.0f, + 12800.0f, + }, + { + 0, + 12288, + 1, + 1280, + 30, + 60.0f, + 50.0f, + 10.0f, + 3200.0f, + }, + }, +}; +static unk_D_86A03170 D_86A03D40[18][3] = { + { + { + 0, + 12288, + 1, + 0, + 120, + 30.0f, + 135.0f, + 100.0f, + 12800.0f, + }, + { + 0, + 12288, + 1, + -5152, + 30, + 30.0f, + 950.0f, + 100.0f, + 12800.0f, + }, + { + 0, + 12288, + 1, + 512, + 1300, + 30.0f, + 250.0f, + 200.0f, + 25600.0f, + }, + }, + { + { + 0, + 12288, + 1, + 512, + 390, + 30.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 512, + 390, + 30.0f, + 700.0f, + 100.0f, + 12800.0f, + }, + { + 0, + 12288, + 1, + -3488, + 30, + 40.0f, + 1400.0f, + 100.0f, + 12800.0f, + }, + }, + { + { + 0, + 12288, + 1, + 2304, + 670, + 40.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 3680, + 30, + 30.0f, + 150.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -4480, + 30, + 30.0f, + 1800.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 0, + 900, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 0, + 900, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 0, + 900, + 60.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 1088, + 750, + 30.0f, + 128.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -5024, + 30, + 30.0f, + 1400.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 3104, + 460, + 30.0f, + -40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 1088, + 750, + 30.0f, + 128.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -5024, + 30, + 30.0f, + 1400.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 3104, + 460, + 30.0f, + -40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 2624, + 500, + 30.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 736, + 30, + 30.0f, + 15.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -7712, + 350, + 30.0f, + 1250.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + -7360, + 30, + 30.0f, + 1050.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -352, + 30, + 30.0f, + 175.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -64, + 630, + 30.0f, + 260.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 576, + 750, + 30.0f, + 125.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 2592, + 280, + 30.0f, + -42.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -544, + 70, + 30.0f, + 215.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 576, + 750, + 30.0f, + 125.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 2592, + 280, + 30.0f, + -42.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -544, + 70, + 30.0f, + 215.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + 0, + 12288, + 1, + 576, + 750, + 30.0f, + 125.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + 2592, + 280, + 30.0f, + -42.0f, + 50.0f, + 6400.0f, + }, + { + 0, + 12288, + 1, + -544, + 70, + 30.0f, + 215.0f, + 50.0f, + 6400.0f, + }, + }, +}; + +static unk_D_86A04328 D_86A04328[18][6] = { + { + { + { 172.0f, 166.0f, 1901.0f }, + -6.0f, + 173.0f, + { 1280.0f, 482.0f, 622.0f }, + -11.0f, + 243.5f, + 52.5f, + 45.5f, + 28.0f, + 7400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 323.0f, 766.0f, -2353.0f }, + 18.0f, + 109.5f, + { 299.0f, 164.0f, -581.0f }, + -4.0f, + 335.0f, + 45.5f, + 56.5f, + 50.0f, + 6400.0f, + }, + { + { 359.0f, 732.0f, -2349.0f }, + 21.0f, + 109.5f, + { 853.0f, 508.0f, -607.0f }, + -18.0f, + 307.0f, + 45.5f, + 56.5f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 1663.0f, 396.0f, -686.0f }, + 17.5f, + 38.5f, + { 1035.0f, 458.0f, 15.0f }, + -10.5f, + 269.5f, + 63.5f, + 59.5f, + 50.0f, + 6400.0f, + }, + { + { 268.0f, 222.0f, 15.0f }, + -41.5f, + 267.0f, + { 824.0f, 12.0f, -16.0f }, + 23.5f, + 272.0f, + 30.0f, + 48.5f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { -74.0f, 142.0f, 864.0f }, + 1.0f, + 121.5f, + { 75.0f, 142.0f, 894.0f }, + 1.0f, + 239.0f, + 52.0f, + 52.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 946.0f, 68.0f, -514.0f }, + -2.0f, + 131.0f, + { 381.0f, 42.0f, -1029.0f }, + 10.0f, + 339.5f, + 8.0f, + 53.0f, + 50.0f, + 6400.0f, + }, + { + { -91.0f, 140.0f, 748.0f }, + 1.0f, + 121.5f, + { 123.0f, 140.0f, 739.0f }, + 1.0f, + 239.0f, + 52.0f, + 52.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 415.0f, 20.0f, -4.0f }, + 7.5f, + 91.5f, + { 732.0f, 44.0f, -353.0f }, + 10.0f, + 301.0f, + 38.0f, + 45.0f, + 50.0f, + 6400.0f, + }, + { + { -81.0f, 56.0f, 366.0f }, + 5.5f, + 130.5f, + { 76.0f, 46.0f, 332.0f }, + 5.5f, + 232.5f, + 56.0f, + 56.0f, + 50.0f, + 6400.0f, + }, + { + { 53.0f, 66.0f, 487.0f }, + 5.5f, + 120.0f, + { 57.0f, 60.0f, 48.5f }, + 5.5f, + 230.0f, + 56.0f, + 56.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 972.0f, 186.0f, -761.0f }, + 9.5f, + 23.0f, + { 1060.0f, 302.0f, 547.0f }, + -10.5f, + 241.5f, + 45.0f, + 48.0f, + 50.0f, + 6400.0f, + }, + { + { -277.0f, 254.0f, -2.0f }, + -45.0f, + 90.0f, + { -1376.0f, 484.0f, 1.0f }, + -14.5f, + 91.5f, + 30.0f, + 51.5f, + 50.0f, + 6400.0f, + }, + { + { -787.0f, 264.0f, -775.0f }, + -16.0f, + 0.5f, + { 735.0f, 264.0f, -775.0f }, + -16.0f, + 0.5f, + 57.0f, + 57.0f, + 50.0f, + 6400.0f, + }, + { + { 452.0f, -304.0f, 544.0f }, + 6.0f, + 22.5f, + { 389.0f, 842.0f, 437.0f }, + -40.0f, + 22.5f, + 71.0f, + 50.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 933.0f, 170.0f, -796.0f }, + 11.5f, + 22.5f, + { 1198.0f, 678.0f, 553.0f }, + -25.0f, + 244.5f, + 47.0f, + 50.0f, + 50.0f, + 6400.0f, + }, + { + { -324.0f, 56.0f, 0.0f }, + -25.5f, + 90.0f, + { -1317.0f, 736.0f, 15.0f }, + -24.0f, + 92.0f, + 43.5f, + 47.5f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 466.0f, -348.0f, 590.0f }, + 6.5f, + 22.5f, + { 328.0f, 846.0f, 492.0f }, + -40.0f, + 22.5f, + 70.0f, + 50.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 951.0f, 172.0f, -715.0f }, + 11.0f, + 19.5f, + { 999.0f, 366.0f, 476.0f }, + -12.0f, + 241.5f, + 43.0f, + 53.0f, + 50.0f, + 6400.0f, + }, + { + { -213.0f, 276.0f, -1.0f }, + -51.0f, + 89.0f, + { -1078.0f, 220.0f, -15.0f }, + -4.5f, + 90.0f, + 46.5f, + 53.5f, + 50.0f, + 6400.0f, + }, + { + { -728.0f, 262.0f, -792.0f }, + -16.0f, + 0.0f, + { 780.0f, 262.0f, -792.0f }, + -16.0f, + 0.0f, + 56.0f, + 56.0f, + 50.0f, + 6400.0f, + }, + { + { 445.0f, -318.0f, 530.0f }, + 6.0f, + 22.5f, + { 392.0f, 814.0f, 462.0f }, + -40.0f, + 22.5f, + 70.0f, + 50.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 963.0f, 192.0f, -817.0f }, + 9.0f, + 17.5f, + { 1101.0f, 508.0f, 518.0f }, + -18.0f, + 242.0f, + 41.5f, + 50.5f, + 50.0f, + 6400.0f, + }, + { + { -312.0f, 402.0f, -6.0f }, + -53.5f, + 89.5f, + { -1219.0f, 190.0f, 13.0f }, + 0.0f, + 91.5f, + 30.0f, + 49.5f, + 50.0f, + 6400.0f, + }, + { + { -763.0f, 286.0f, -775.0f }, + -16.0f, + 0.5f, + { 787.0f, 286.0f, -775.0f }, + -16.0f, + 0.5f, + 57.0f, + 57.0f, + 50.0f, + 6400.0f, + }, + { + { 418.0f, -396.0f, 452.0f }, + 6.5f, + 23.0f, + { 388.0f, 840.0f, 457.0f }, + -40.0f, + 23.0f, + 73.0f, + 50.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 974.0f, 218.0f, -798.0f }, + 11.0f, + 16.5f, + { 1216.0f, 542.0f, 604.0f }, + -16.5f, + 242.0f, + 42.5f, + 48.5f, + 50.0f, + 6400.0f, + }, + { + { -238.0f, 264.0f, 8.0f }, + -48.0f, + 92.0f, + { -1191.0f, 162.0f, 4.0f }, + 2.5f, + 91.5f, + 44.5f, + 53.5f, + 50.0f, + 6400.0f, + }, + { + { -755.0f, 304.0f, -841.0f }, + -16.0f, + 1.0f, + { 738.0f, 304.0f, -840.0f }, + -16.0f, + 1.0f, + 57.0f, + 57.0f, + 50.0f, + 6400.0f, + }, + { + { 477.0f, -420.0f, 480.0f }, + -5.0f, + 23.0f, + { 378.0f, 846.0f, 485.0f }, + -40.0f, + 23.0f, + 73.0f, + 51.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 1039.0f, 198.0f, -823.0f }, + 7.5f, + 17.0f, + { 1256.0f, 374.0f, 682.0f }, + -11.0f, + 236.0f, + 48.0f, + 53.0f, + 50.0f, + 6400.0f, + }, + { + { -2350.0f, -766.0f, -139.0f }, + 0.0f, + 88.5f, + { -983.0f, 322.0f, 5.0f }, + -15.0f, + 91.0f, + 25.0f, + 56.0f, + 50.0f, + 6400.0f, + }, + { + { -827.0f, 206.0f, -806.0f }, + -16.0f, + 1.0f, + { 762.0f, 206.0f, -806.0f }, + -16.0f, + 1.0f, + 57.0f, + 57.0f, + 50.0f, + 6400.0f, + }, + { + { 468.0f, -512.0f, 516.0f }, + 6.5f, + 22.5f, + { 447.0f, 844.0f, 525.0f }, + -40.0f, + 22.5f, + 73.0f, + 50.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 1086.0f, 282.0f, -858.0f }, + 3.5f, + 19.5f, + { 963.0f, 170.0f, 392.0f }, + -1.5f, + 248.5f, + 47.5f, + 54.0f, + 50.0f, + 6400.0f, + }, + { + { -294.0f, 514.0f, 0.0f }, + -55.0f, + 90.5f, + { -1280.0f, 388.0f, -25.0f }, + -13.5f, + 89.0f, + 30.0f, + 48.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { -986.0f, 28.0f, -470.0f }, + 7.5f, + 0.0f, + { 1014.0f, 28.0f, -470.0f }, + 7.5f, + 0.0f, + 47.0f, + 47.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 961.0f, 252.0f, -802.0f }, + 0.0f, + 15.0f, + { 1041.0f, 376.0f, 415.0f }, + -15.5f, + 246.0f, + 46.5f, + 53.0f, + 50.0f, + 6400.0f, + }, + { + { -312.0f, 364.0f, -6.0f }, + -48.5f, + 89.0f, + { -1377.0f, 400.0f, 10.0f }, + -11.5f, + 90.5f, + 41.0f, + 47.0f, + 50.0f, + 6400.0f, + }, + { + { -715.0f, 212.0f, -701.0f }, + -16.0f, + 1.0f, + { 730.0f, 212.0f, -701.0f }, + -16.0f, + 1.0f, + 57.0f, + 57.0f, + 50.0f, + 6400.0f, + }, + { + { 416.0f, -368.0f, 533.0f }, + 6.0f, + 22.5f, + { 379.0f, 770.0f, 484.0f }, + -40.0f, + 22.5f, + 73.0f, + 51.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { -297.0f, 192.0f, 0.0f }, + -36.0f, + 90.0f, + { -726.0f, 150.0f, 0.0f }, + 0.5f, + 90.0f, + 44.5f, + 48.0f, + 50.0f, + 6400.0f, + }, + { + { -297.0f, 192.0f, 0.0f }, + -36.0f, + 90.0f, + { -726.0f, 150.0f, 0.0f }, + 0.5f, + 90.0f, + 44.5f, + 48.0f, + 50.0f, + 6400.0f, + }, + { + { -297.0f, 192.0f, 0.0f }, + -36.0f, + 90.0f, + { -692.0f, 124.0f, 0.0f }, + -1.5f, + 90.0f, + 44.5f, + 48.0f, + 50.0f, + 6400.0f, + }, + { + { -201.0f, 194.0f, 4.0f }, + -42.0f, + 91.0f, + { -778.0f, 180.0f, 1.0f }, + -2.5f, + 90.5f, + 44.5f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, + { + { + { -344.0f, 132.0f, -913.0f }, + -25.0f, + 40.0f, + { 1113.0f, 256.0f, 22.0f }, + -14.5f, + 269.5f, + 30.0f, + 46.5f, + 50.0f, + 6400.0f, + }, + { + { -353.0f, 438.0f, 1.0f }, + -49.5f, + 90.0f, + { -938.0f, 340.0f, 9.0f }, + -26.0f, + 91.0f, + 30.0f, + 52.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + { + { 0.0f, 50.0f, -500.0f }, + 0.0f, + 40.0f, + { 500.0f, 10.0f, -500.0f }, + 10.0f, + 50.0f, + 30.0f, + 40.0f, + 50.0f, + 6400.0f, + }, + }, +}; + +#ifdef NON_MATCHING +void func_86A018D0(unk_D_86002F34_00C* arg0, u16 arg1, s8 arg2, u8 arg3) { + UNUSED s32 pad; + unk_D_86A04328* ptr = &D_86A04328[arg2 - 1][arg3 - 3]; + Vec3f sp3C; + Vec3f sp30; + + D_86A06254 = arg0; + D_86A06220 = 0; + D_86A06222 = arg1; + + func_80010354(&ptr->unk_00, &sp3C, 720.0f, ((s32)D_86A04328[arg2 - 1][arg3 - 3].unk_0C << 0xF) / 180, + ((s32)D_86A04328[arg2 - 1][arg3 - 3].unk_10 << 0xF) / 180); + func_80010354(&ptr->unk_14, &sp30, 720.0f, ((s32)D_86A04328[arg2 - 1][arg3 - 3].unk_20 << 0xF) / 180, + ((s32)D_86A04328[arg2 - 1][arg3 - 3].unk_24 << 0xF) / 180); + + D_86A06254->unk_60.eye = ptr->unk_00; + D_86A06254->unk_60.at = sp3C; + + D_86A06254->unk_24.fovy = ptr->unk_28; + D_86A06254->unk_24.near = ptr->unk_30; + D_86A06254->unk_24.far = ptr->unk_34; + + D_86A06228.x = ((ptr->unk_14.x - ptr->unk_00.x) * 1) / arg1; + D_86A06228.y = ((ptr->unk_14.y - ptr->unk_00.y) * 1) / arg1; + D_86A06228.z = ((ptr->unk_14.z - ptr->unk_00.z) * 1) / arg1; + + D_86A06238.x = ((sp30.x - sp3C.x) * 1) / arg1; + D_86A06238.y = ((sp30.y - sp3C.y) * 1) / arg1; + D_86A06238.z = ((sp30.z - sp3C.z) * 1) / arg1; + + D_86A06244 = ((ptr->unk_2C - ptr->unk_28) * 1) / arg1; +} +#else #pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15A2B0/func_86A018D0.s") +#endif + +void func_86A01BEC(void) { + if (D_86A06220 < D_86A06222) { + s8 tmp = D_86A06210; + + D_86A06220 += tmp; + D_86A06254->unk_60.eye.x += D_86A06228.x * tmp; + D_86A06254->unk_60.eye.y += D_86A06228.y * tmp; + D_86A06254->unk_60.eye.z += D_86A06228.z * tmp; + D_86A06254->unk_60.at.x += D_86A06238.x * tmp; + D_86A06254->unk_60.at.y += D_86A06238.y * tmp; + D_86A06254->unk_60.at.z += D_86A06238.z * tmp; + D_86A06254->unk_24.fovy += D_86A06244 * tmp; + } +} + +#ifdef NON_MATCHING +void func_86A01CF0(s16* arg0, s16* arg1, s16* arg2, unk_D_86002F34_00C* arg3, u16 arg4, s8 arg5, u8 arg6) { + unk_D_86A03170* temp_v1; + + if (!arg4) {} + + D_86A0625C = arg1; + D_86A06254 = arg3; + D_86A06220 = 0; + D_86A06222 = arg4; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15A2B0/func_86A01BEC.s") + if (arg6 < 6) { + *D_86A0625C = D_86A03170[arg5][arg6].unk_00; + } else if (arg6 < 9) { + *D_86A0625C = D_86A03C98[arg5][arg6].unk_00; + } + if (arg6 < 6) { + if (1) {} + if (D_86A03170[arg5][arg6].unk_04 == 1) { + if (D_86A03170[arg5][arg6].unk_00 < D_86A03170[arg5][arg6].unk_02) { + D_86A06258 = (D_86A03170[arg5][arg6].unk_02 - D_86A03170[arg5][arg6].unk_00) / arg4; + } else { + D_86A06258 = ((D_86A03170[arg5][arg6].unk_02 - D_86A03170[arg5][arg6].unk_00) + 0x10000) / arg4; + } + } else if (D_86A03170[arg5][arg6].unk_00 < D_86A03170[arg5][arg6].unk_02) { + D_86A06258 = (s32)((D_86A03170[arg5][arg6].unk_02 - D_86A03170[arg5][arg6].unk_00) + 0xFFFF0000) / arg4; + } else { + D_86A06258 = (s32)(D_86A03170[arg5][arg6].unk_02 - D_86A03170[arg5][arg6].unk_00) / arg4; + } + + *arg0 = D_86A03170[arg5][arg6].unk_06; + *arg2 = D_86A03170[arg5][arg6].unk_08; + + D_86A06254->unk_60.at.x = 0.0f; + D_86A06254->unk_60.at.y = D_86A03170[arg5][arg6].unk_10; + D_86A06254->unk_60.at.z = 0.0f; + + D_86A06254->unk_24.fovy = D_86A03170[arg5][arg6].unk_0C; + D_86A06254->unk_24.near = D_86A03170[arg5][arg6].unk_14; + D_86A06254->unk_24.far = D_86A03170[arg5][arg6].unk_18; + } else if (arg6 < 9) { + if (D_86A03D40[arg5 - 2][arg6].unk_04 == 1) { + if (D_86A03D40[arg5 - 2][arg6].unk_00 < D_86A03D40[arg5 - 2][arg6].unk_02) { + D_86A06258 = (s32)(D_86A03D40[arg5 - 2][arg6].unk_02 - D_86A03D40[arg5 - 2][arg6].unk_00) / arg4; + } else { + D_86A06258 = + (s32)((D_86A03D40[arg5 - 2][arg6].unk_02 - D_86A03D40[arg5 - 2][arg6].unk_00) + 0x10000) / arg4; + } + } else if (D_86A03D40[arg5 - 2][arg6].unk_00 < D_86A03D40[arg5 - 2][arg6].unk_02) { + D_86A06258 = + (s32)(D_86A03D40[arg5 - 2][arg6].unk_00 + D_86A03D40[arg5 - 2][arg6].unk_02 + 0xFFFF0000) / arg4; + } else { + D_86A06258 = (s32)(D_86A03D40[arg5 - 2][arg6].unk_02 - D_86A03D40[arg5 - 2][arg6].unk_00) / arg4; + } + + *arg0 = D_86A03D40[arg5 - 2][arg6].unk_06; + *arg2 = D_86A03D40[arg5 - 2][arg6].unk_08; + + D_86A06248.x = 0.0f; + D_86A06248.y = D_86A03D40[arg5 - 2][arg6].unk_10; + D_86A06248.z = 0.0f; + + D_86A06254->unk_24.fovy = D_86A03D40[arg5 - 2][arg6].unk_0C; + D_86A06254->unk_24.near = D_86A03D40[arg5 - 2][arg6].unk_14; + D_86A06254->unk_24.far = D_86A03D40[arg5 - 2][arg6].unk_18; + } +} +#else #pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15A2B0/func_86A01CF0.s") +#endif + +void func_86A02164(void) { + if (D_86A06220 < D_86A06222) { + D_86A06220 += D_86A06210; + *D_86A0625C += D_86A06258 * D_86A06210; + } +} + +void func_86A021C0(s8* arg0, u8* arg1) { + u8 var_a3; + u8 i; + u8 j; + u8 sp38[] = { + // D_86A05AC8 + 0x03, 0x03, 0x03, 0x08, 0x8, 0x08, 0x8, 0x06, 0x6, 0x01, + }; + s8 sp28[16]; + + static u8 D_86A05AD4 = 0; + static s8 D_86A05AD8[] = { + 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, + }; + static s8 D_86A05AE8[] = { + 0x00, + 0x01, + 0x02, + }; + static s8 D_86A05AEC[] = { + 0x00, + 0x01, + 0x02, + }; + static s8 D_86A05AF0[] = { + 0x04, + 0x05, + 0x06, + }; + static s8 D_86A05AF4[] = { + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + }; + static s8 D_86A05AFC[] = { + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + }; + static s8 D_86A05B04[] = { + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + }; + static s8 D_86A05B0C[] = { + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + }; + static s8 D_86A05B14[] = { + 0x07, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, + }; + static s8 D_86A05B1C[] = { + 0x00, 0x02, 0x04, 0x05, 0x06, 0x11, + }; + static s8 D_86A05B24[] = { + 0x0F, + }; + static s8* D_86A05B28[] = { + D_86A05AE8, D_86A05AEC, D_86A05AF0, D_86A05AF4, D_86A05AFC, + D_86A05B04, D_86A05B0C, D_86A05B14, D_86A05B1C, D_86A05B24, + }; + + if ((D_86A06211 == 0) && (D_86A05AD4 == 2)) { + *arg0 = 6; + } else { + var_a3 = 0; + for (i = 0; i < 16; i++) { + for (j = 0; j < sp38[D_86A05AD4]; j++) { + if (D_86A05B28[D_86A05AD4][j] == D_86A05AD8[i]) { + sp28[var_a3++] = D_86A05AD8[i]; + break; + } + } + } + *arg0 = sp28[func_86A023A0(var_a3)]; + } + + switch (D_86A05AD4) { + case 0: + case 6: + *arg1 = 9; + break; + + case 1: + *arg1 = 0; + break; + + case 2: + case 9: + *arg1 = 0xA; + break; + + case 7: + *arg1 = 0xB; + break; + + case 3: + case 8: + *arg1 = 1; + break; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15A2B0/func_86A02164.s") + for (i = 0; i < 16; i++) { + if (*arg0 == D_86A05AD8[i]) { + D_86A05AD8[i] = -1; + break; + } + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15A2B0/func_86A021C0.s") + D_86A05AD4++; +} diff --git a/src/fragments/16/fragment16_15AD80.c b/src/fragments/16/fragment16_15AD80.c index fbe4185c..ad7dfb27 100644 --- a/src/fragments/16/fragment16_15AD80.c +++ b/src/fragments/16/fragment16_15AD80.c @@ -1,5 +1,408 @@ -#include "global.h" +#include "fragment16.h" +#include "src/fragments/2/fragment2.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15AD80/func_86A023A0.s") +u16 D_86A05B50 = 0; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/16/fragment16_15AD80/func_86A0240C.s") +s32 func_86A023A0(s32 arg0) { + if (arg0 == 0) { + return 0; + } + return ((guRandom() + osGetCount()) / 10) % arg0; +} + +void func_86A0240C(u8 arg0) { + static u8 D_86A05B54 = 0; + + gSPDisplayList(gDisplayListHead++, D_8006F518); + + if (!arg0) { + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + } else if (D_86A05B54 < 0x1E) { + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, (s32)ROUND_MAX((D_86A05B54 * 255.0f) / 30.0f)); + D_86A05B54++; + } else { + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + D_86A05B50++; + } + + func_878021B4(0x6E, 0x5C); + + gSPDisplayList(gDisplayListHead++, D_8006F630); +} + +s32 pad_D_86A05B58[2] = { 0, 0 }; + +char D_86A05B60 = '\x00'; +char D_86A05B64 = '\x00'; +char D_86A05B68 = '\x00'; +char D_86A05B6C = '\x00'; +char D_86A05B70 = '\x00'; +char D_86A05B74 = '\x00'; +char D_86A05B78 = '\x00'; +char D_86A05B7C = '\x00'; +char D_86A05B80 = '\x00'; +char D_86A05B84 = '\x00'; +char D_86A05B88 = '\x00'; +char D_86A05B8C = '\x00'; +char D_86A05B90 = '\x00'; +char D_86A05B94 = '\x00'; +char D_86A05B98 = '\x00'; +char D_86A05B9C = '\x00'; +char D_86A05BA0 = '\x00'; +char D_86A05BA4 = '\x00'; +char D_86A05BA8 = '\x00'; +char D_86A05BAC = '\x00'; +char D_86A05BB0 = '\x00'; +char D_86A05BB4 = '\x00'; +char D_86A05BB8 = '\x00'; +char D_86A05BBC = '\x00'; +char D_86A05BC0 = '\x00'; +char D_86A05BC4 = '\x00'; +char D_86A05BC8 = '\x00'; +char D_86A05BCC = '\x00'; +char D_86A05BD0 = '\x00'; +char D_86A05BD4 = '\x00'; +char D_86A05BD8 = '\x00'; +char D_86A05BDC = '\x00'; +char D_86A05BE0 = '\x00'; +char D_86A05BE4 = '\x00'; +char D_86A05BE8 = '\x00'; +char D_86A05BEC = '\x00'; +char D_86A05BF0 = '\x00'; +char D_86A05BF4 = '\x00'; +char D_86A05BF8 = '\x00'; +char D_86A05BFC = '\x00'; +char D_86A05C00 = '\x00'; +char D_86A05C04 = '\x00'; +char D_86A05C08 = '\x00'; +char D_86A05C0C = '\x00'; +char D_86A05C10 = '\x00'; +char D_86A05C14 = '\x00'; +char D_86A05C18 = '\x00'; +char D_86A05C1C = '\x00'; +char D_86A05C20 = '\x00'; +char D_86A05C24 = '\x00'; +char D_86A05C28 = '\x00'; +char D_86A05C2C = '\x00'; +char D_86A05C30 = '\x00'; +char D_86A05C34 = '\x00'; +char D_86A05C38 = '\x00'; +char D_86A05C3C = '\x00'; +char D_86A05C40 = '\x00'; +char D_86A05C44 = '\x00'; +char D_86A05C48 = '\x00'; +char D_86A05C4C = '\x00'; +char D_86A05C50 = '\x00'; +char D_86A05C54 = '\x00'; +char D_86A05C58 = '\x00'; +char D_86A05C5C = '\x00'; +char D_86A05C60 = '\x00'; +char D_86A05C64 = '\x00'; +char D_86A05C68 = '\x00'; +char D_86A05C6C = '\x00'; +char D_86A05C70 = '\x00'; +char D_86A05C74 = '\x00'; +char D_86A05C78 = '\x00'; +char D_86A05C7C = '\x00'; +char D_86A05C80 = '\x00'; +char D_86A05C84 = '\x00'; +char D_86A05C88 = '\x00'; +char D_86A05C8C = '\x00'; +char D_86A05C90 = '\x00'; +char D_86A05C94 = '\x00'; +char D_86A05C98 = '\x00'; +char D_86A05C9C = '\x00'; +char D_86A05CA0 = '\x00'; +char D_86A05CA4 = '\x00'; +char D_86A05CA8 = '\x00'; +char D_86A05CAC = '\x00'; +char D_86A05CB0 = '\x00'; +char D_86A05CB4 = '\x00'; +char D_86A05CB8 = '\x00'; +char D_86A05CBC = '\x00'; +char D_86A05CC0 = '\x00'; +char D_86A05CC4 = '\x00'; +char D_86A05CC8 = '\x00'; +char D_86A05CCC = '\x00'; +char D_86A05CD0 = '\x00'; +char D_86A05CD4 = '\x00'; +char D_86A05CD8 = '\x00'; +char D_86A05CDC = '\x00'; +char D_86A05CE0 = '\x00'; +char D_86A05CE4 = '\x00'; +char D_86A05CE8 = '\x00'; +char D_86A05CEC = '\x00'; +char D_86A05CF0 = '\x00'; +char D_86A05CF4 = '\x00'; +char D_86A05CF8 = '\x00'; +char D_86A05CFC = '\x00'; +char D_86A05D00 = '\x00'; +char D_86A05D04 = '\x00'; +char D_86A05D08 = '\x00'; +char D_86A05D0C = '\x00'; +char D_86A05D10 = '\x00'; +char D_86A05D14 = '\x00'; +char D_86A05D18 = '\x00'; +char D_86A05D1C = '\x00'; +char D_86A05D20 = '\x00'; +char D_86A05D24 = '\x00'; +char D_86A05D28 = '\x00'; +char D_86A05D2C = '\x00'; +char D_86A05D30 = '\x00'; +char D_86A05D34 = '\x00'; +char D_86A05D38 = '\x00'; +char D_86A05D3C = '\x00'; +char D_86A05D40 = '\x00'; +char D_86A05D44 = '\x00'; +char D_86A05D48 = '\x00'; +char D_86A05D4C = '\x00'; +char D_86A05D50 = '\x00'; +char D_86A05D54 = '\x00'; +char D_86A05D58 = '\x00'; +char D_86A05D5C = '\x00'; +char D_86A05D60 = '\x00'; +char D_86A05D64 = '\x00'; +char D_86A05D68 = '\x00'; +char D_86A05D6C = '\x00'; +char D_86A05D70 = '\x00'; +char D_86A05D74 = '\x00'; +char D_86A05D78 = '\x00'; +char D_86A05D7C = '\x00'; +char D_86A05D80 = '\x00'; +char D_86A05D84 = '\x00'; +char D_86A05D88 = '\x00'; +char D_86A05D8C = '\x00'; +char D_86A05D90 = '\x00'; +char D_86A05D94 = '\x00'; +char D_86A05D98 = '\x00'; +char D_86A05D9C = '\x00'; +char D_86A05DA0 = '\x00'; +char D_86A05DA4 = '\x00'; +char D_86A05DA8 = '\x00'; +char D_86A05DAC = '\x00'; +char D_86A05DB0 = '\x00'; +char D_86A05DB4 = '\x00'; +char D_86A05DB8 = '\x00'; +char D_86A05DBC = '\x00'; +char D_86A05DC0 = '\x00'; +char D_86A05DC4 = '\x00'; +char D_86A05DC8 = '\x00'; +char D_86A05DCC = '\x00'; +char D_86A05DD0 = '\x00'; +char D_86A05DD4 = '\x00'; +char D_86A05DD8 = '\x00'; +char D_86A05DDC = '\x00'; +char D_86A05DE0 = '\x00'; +char D_86A05DE4 = '\x00'; +char D_86A05DE8 = '\x00'; +char D_86A05DEC = '\x00'; +char D_86A05DF0 = '\x00'; +char D_86A05DF4 = '\x00'; +char D_86A05DF8 = '\x00'; +char D_86A05DFC = '\x00'; +char D_86A05E00 = '\x00'; +char D_86A05E04 = '\x00'; +char D_86A05E08 = '\x00'; +char D_86A05E0C = '\x00'; +char D_86A05E10 = '\x00'; +char D_86A05E14 = '\x00'; +char D_86A05E18 = '\x00'; +char D_86A05E1C = '\x00'; +char D_86A05E20 = '\x00'; +char D_86A05E24 = '\x00'; +char D_86A05E28 = '\x00'; +char D_86A05E2C = '\x00'; +char D_86A05E30 = '\x00'; +char D_86A05E34 = '\x00'; +char D_86A05E38 = '\x00'; +char D_86A05E3C = '\x00'; +char D_86A05E40 = '\x00'; +char D_86A05E44 = '\x00'; +char D_86A05E48 = '\x00'; +char D_86A05E4C = '\x00'; +char D_86A05E50 = '\x00'; +char D_86A05E54 = '\x00'; +char D_86A05E58 = '\x00'; +char D_86A05E5C = '\x00'; +char D_86A05E60 = '\x00'; +char D_86A05E64 = '\x00'; +char D_86A05E68 = '\x00'; +char D_86A05E6C = '\x00'; +char D_86A05E70 = '\x00'; +char D_86A05E74 = '\x00'; +char D_86A05E78 = '\x00'; +char D_86A05E7C = '\x00'; +char D_86A05E80 = '\x00'; +char D_86A05E84 = '\x00'; +char D_86A05E88 = '\x00'; +char D_86A05E8C = '\x00'; +char D_86A05E90 = '\x00'; +char D_86A05E94 = '\x00'; +char D_86A05E98 = '\x00'; +char D_86A05E9C = '\x00'; +char D_86A05EA0 = '\x00'; +char D_86A05EA4 = '\x00'; +char D_86A05EA8 = '\x00'; +char D_86A05EAC = '\x00'; +char D_86A05EB0 = '\x00'; +char D_86A05EB4 = '\x00'; +char D_86A05EB8 = '\x00'; +char D_86A05EBC = '\x00'; +char D_86A05EC0 = '\x00'; +char D_86A05EC4 = '\x00'; +char D_86A05EC8 = '\x00'; +char D_86A05ECC = '\x00'; +char D_86A05ED0 = '\x00'; +char D_86A05ED4 = '\x00'; +char D_86A05ED8 = '\x00'; +char D_86A05EDC = '\x00'; +char D_86A05EE0 = '\x00'; +char D_86A05EE4 = '\x00'; +char D_86A05EE8 = '\x00'; +char D_86A05EEC = '\x00'; +char D_86A05EF0 = '\x00'; +char D_86A05EF4 = '\x00'; +char D_86A05EF8 = '\x00'; +char D_86A05EFC = '\x00'; +char D_86A05F00 = '\x00'; +char D_86A05F04 = '\x00'; +char D_86A05F08 = '\x00'; +char D_86A05F0C = '\x00'; +char D_86A05F10 = '\x00'; +char D_86A05F14 = '\x00'; +char D_86A05F18 = '\x00'; +char D_86A05F1C = '\x00'; +char D_86A05F20 = '\x00'; +char D_86A05F24 = '\x00'; +char D_86A05F28 = '\x00'; +char D_86A05F2C = '\x00'; +char D_86A05F30 = '\x00'; +char D_86A05F34 = '\x00'; +char D_86A05F38 = '\x00'; +char D_86A05F3C = '\x00'; +char D_86A05F40 = '\x00'; +char D_86A05F44 = '\x00'; +char D_86A05F48 = '\x00'; +char D_86A05F4C = '\x00'; +char D_86A05F50 = '\x00'; +char D_86A05F54 = '\x00'; +char D_86A05F58 = '\x00'; +char D_86A05F5C = '\x00'; +char D_86A05F60 = '\x00'; +char D_86A05F64 = '\x00'; +char D_86A05F68 = '\x00'; +char D_86A05F6C = '\x00'; +char D_86A05F70 = '\x00'; +char D_86A05F74 = '\x00'; +char D_86A05F78 = '\x00'; +char D_86A05F7C = '\x00'; +char D_86A05F80 = '\x00'; +char D_86A05F84 = '\x00'; +char D_86A05F88 = '\x00'; +char D_86A05F8C = '\x00'; +char D_86A05F90 = '\x00'; +char D_86A05F94 = '\x00'; +char D_86A05F98 = '\x00'; +char D_86A05F9C = '\x00'; +char D_86A05FA0 = '\x00'; +char D_86A05FA4 = '\x00'; +char D_86A05FA8 = '\x00'; +char D_86A05FAC = '\x00'; +char D_86A05FB0 = '\x00'; +char D_86A05FB4 = '\x00'; +char D_86A05FB8 = '\x00'; +char D_86A05FBC = '\x00'; +char D_86A05FC0 = '\x00'; +char D_86A05FC4 = '\x00'; +char D_86A05FC8 = '\x00'; +char D_86A05FCC = '\x00'; +char D_86A05FD0 = '\x00'; +char D_86A05FD4 = '\x00'; +char D_86A05FD8 = '\x00'; +char D_86A05FDC = '\x00'; +char D_86A05FE0 = '\x00'; +char D_86A05FE4 = '\x00'; +char D_86A05FE8 = '\x00'; +char D_86A05FEC = '\x00'; +char D_86A05FF0 = '\x00'; +char D_86A05FF4 = '\x00'; +char D_86A05FF8 = '\x00'; +char D_86A05FFC = '\x00'; +char D_86A06000 = '\x00'; +char D_86A06004 = '\x00'; +char D_86A06008 = '\x00'; +char D_86A0600C = '\x00'; +char D_86A06010 = '\x00'; +char D_86A06014 = '\x00'; +char D_86A06018 = '\x00'; +char D_86A0601C = '\x00'; +char D_86A06020 = '\x00'; +char D_86A06024 = '\x00'; +char D_86A06028 = '\x00'; +char D_86A0602C = '\x00'; +char D_86A06030 = '\x00'; +char D_86A06034 = '\x00'; +char D_86A06038 = '\x00'; +char D_86A0603C = '\x00'; +char D_86A06040 = '\x00'; +char D_86A06044 = '\x00'; +char D_86A06048 = '\x00'; +char D_86A0604C = '\x00'; +char D_86A06050 = '\x00'; +char D_86A06054 = '\x00'; +char D_86A06058 = '\x00'; +char D_86A0605C = '\x00'; +char D_86A06060 = '\x00'; +char D_86A06064 = '\x00'; +char D_86A06068 = '\x00'; +char D_86A0606C = '\x00'; +char D_86A06070 = '\x00'; +char D_86A06074 = '\x00'; +char D_86A06078 = '\x00'; +char D_86A0607C = '\x00'; +char D_86A06080 = '\x00'; +char D_86A06084 = '\x00'; +char D_86A06088 = '\x00'; +char D_86A0608C = '\x00'; +char D_86A06090 = '\x00'; +char D_86A06094 = '\x00'; +char D_86A06098 = '\x00'; +char D_86A0609C = '\x00'; +char D_86A060A0 = '\x00'; +char D_86A060A4 = '\x00'; +char D_86A060A8 = '\x00'; +char D_86A060AC = '\x00'; +char D_86A060B0 = '\x00'; +char D_86A060B4 = '\x00'; +char D_86A060B8 = '\x00'; +char D_86A060BC = '\x00'; +char D_86A060C0 = '\x00'; +char D_86A060C4 = '\x00'; +char D_86A060C8 = '\x00'; +char D_86A060CC = '\x00'; +char D_86A060D0 = '\x00'; +char D_86A060D4 = '\x00'; +char D_86A060D8 = '\x00'; +char D_86A060DC = '\x00'; +char D_86A060E0 = '\x00'; +char D_86A060E4 = '\x00'; +char D_86A060E8 = '\x00'; +char D_86A060EC = '\x00'; +char D_86A060F0 = '\x00'; +char D_86A060F4 = '\x00'; +char D_86A060F8 = '\x00'; +char D_86A060FC = '\x00'; +char D_86A06100 = '\x00'; +char D_86A06104 = '\x00'; +char D_86A06108 = '\x00'; +char D_86A0610C = '\x00'; +char D_86A06110 = '\x00'; +char D_86A06114 = '\x00'; +char D_86A06118 = '\x00'; +char D_86A0611C = '\x00'; +char D_86A06120 = '\x00'; +char D_86A06124 = '\x00'; +char D_86A06128 = '\x00'; +char D_86A0612C = '\x00'; +char D_86A06130 = '\x00'; +char D_86A06134 = '\x00'; diff --git a/src/fragments/36/fragment36.c b/src/fragments/36/fragment36.c index f8f51eab..fe51bf86 100644 --- a/src/fragments/36/fragment36.c +++ b/src/fragments/36/fragment36.c @@ -349,7 +349,7 @@ void func_82100B98(void) { D_82100EB8 = main_pool_alloc(0x4510, 0); D_82100EBC = main_pool_alloc(0x100000, 0); - D_82100EB0 = ASSET_LOAD2(backgrounds, backgrounds, 1, 1); + D_82100EB0 = ASSET_LOAD2(backgrounds, 1, 1); if (D_82100EA8.unk_00 == 0x1F8) { D_82100EB4 = func_8000484C(D_82100EB0, 0x11); diff --git a/src/fragments/37/fragment37.c b/src/fragments/37/fragment37.c index f90b8d9b..abfc668b 100644 --- a/src/fragments/37/fragment37.c +++ b/src/fragments/37/fragment37.c @@ -785,7 +785,7 @@ void func_82202B60(void) { } void func_82202CB8(void) { - D_822030F4 = ASSET_LOAD2(backgrounds, backgrounds, 1, 1); + D_822030F4 = ASSET_LOAD2(backgrounds, 1, 1); if (D_822031E8.unk_00 == 2) { if (D_800AE540.unk_11F2 == 0) { diff --git a/src/reset.c b/src/reset.c index 93712393..1290d58f 100644 --- a/src/reset.c +++ b/src/reset.c @@ -5,7 +5,7 @@ // this file handles the soft reset effect. typedef struct UnkStruct800A6D20 { OSThread thread; - char filler1B0[0x5E0 - 0x1B0]; + char filler1B0[0x430]; u32 unk5E0; } UnkStruct800A6D20; diff --git a/tools/data2c.py b/tools/data2c.py new file mode 100755 index 00000000..e0b9d107 --- /dev/null +++ b/tools/data2c.py @@ -0,0 +1,637 @@ +#!/usr/bin/env python3 + +import sys +from pathlib import Path +from struct import * + +STRUCTS = {} +STRUCT_TYPEDEFS = {} +DEFINES = {} +BASE_TYPES = { + "s8": 1, + "u8": 1, + "s16": 2, + "u16": 2, + "s32": 4, + "u32": 4, + + "s64": 8, + "u64": 8, + + "f32": 4, + "f64": 8, + + "char": 1, + "short": 2, + "short int": 2, + "int": 4, + "long": 4, + "long int": 8, + "long long": 8, + "long long int": 8, + + "float": 4, + "double": 8, + + "ptr": 4, + "size_t": 4, + "uintptr_t": 4, +} + +SIGNED = { + "s8", + "s16", + "s32", + "s64", + + "short", + "int", +} + +FLOAT = { + "f32", "f64", "float", "double", +} + +def calc_struct_sizes(): + def round_up(offset, rounding): + return offset + (-offset % rounding) + + def calc_size(name, data): + max_size = 0 + max_rounding = 0 + + testMe = False + #if name == "unk_D_86002F58_004_000_010_02C": + # testMe = True + + #print(data) + + i = 0 + offset = 0 + while i < len(data): + member = data[i] + if testMe: + print(member) + size = 0 + if member["type"] in STRUCTS: + if "size" in STRUCTS[member["type"]]: + rounding = STRUCTS[member["type"]]["round"] + #size = round_up(size, rounding) + size += STRUCTS[member["type"]]["size"] + else: + calc_size(member["type"], STRUCTS[member["type"]]["data"]) + rounding = STRUCTS[member["type"]]["round"] + #size = round_up(size, rounding) + size += STRUCTS[member["type"]]["size"] + elif "*" in member["type"]: + rounding = 4 + #size = round_up(size, rounding) + size += 4 + elif member["type"] in BASE_TYPES: + rounding = BASE_TYPES[member["type"]] + #size = round_up(size, rounding) + size += BASE_TYPES[member["type"]] + elif member["type"] in DEFINES: + print(f"DEFINE!") + print(member["type"]) + + exit() + else: + print() + print() + print(f"What type? {member['type']}") + exit() + + max_rounding = max(max_rounding, rounding) + num_entries = 1 + for entry in member["counts"]: + num_entries *= entry + size *= num_entries + + offset = round_up(offset, rounding) + + if testMe: + print(f"size 0x{size:X} rounding 0x{rounding:X} offset 0x{offset:X}") + + STRUCTS[name]["data"][i]["size"] = size + STRUCTS[name]["data"][i]["round"] = rounding + STRUCTS[name]["data"][i]["offset"] = offset + + offset += size + + if STRUCTS[name]["union"]: + max_size = max(max_size, size) + else: + max_size = offset + + i += 1 + + STRUCTS[name]["size"] = max_size + STRUCTS[name]["round"] = max_rounding + + for struct_name, struct_data in STRUCTS.items(): + #print(f"--------------") + #print(struct_name) + #print(struct_data) + #print() + calc_size(struct_name, struct_data["data"]) + #print(f"####") + #print(f"Type {struct_name} has size 0x{STRUCTS[struct_name]['size']:X} and rounding {STRUCTS[struct_name]['round']:X}") + #print(STRUCTS[struct_name]["data"]) + +def parse_struct(filename, fd, i): + testMe = False + start_line = i + + indent = 0 + while fd[start_line][indent] == " ": + indent += 1 + + while len(fd[i]) <= indent or fd[i][indent] != "}": + i += 1 + + end_line = i + if "sndp" in str(filename): + testMe = True + + #if testMe: + # print(start_line, end_line, indent, fd[start_line:end_line]) + # exit() + + pre_struct_name = fd[start_line] + pre_struct_name = pre_struct_name.replace("struct","") + pre_struct_name = pre_struct_name.replace("union","") + pre_struct_name = pre_struct_name.replace("typedef","") + pre_struct_name = pre_struct_name.replace("{","") + pre_struct_name = pre_struct_name.strip() + + #print() + #print() + #print(start_line, end_line, indent) + #print(fd[start_line:end_line]) + + while "typedef" in fd[start_line] or fd[start_line][indent] == "{" or fd[start_line][indent:indent+6] == "struct" or fd[start_line][indent:indent+5] == "union": + start_line += 1 + + struct_name = fd[end_line].strip().rsplit(";",1)[0].split("}",1)[1].strip() + + #if "LEOCmd" in struct_name: + # testMe = True + + #if testMe: + # print() + # print(struct_name) + # print(start_line, end_line, indent) + # print(fd[start_line:end_line]) + # #exit() + + if struct_name and struct_name in STRUCTS: + return i, True, "", [] + + if pre_struct_name and pre_struct_name != struct_name: + STRUCT_TYPEDEFS[pre_struct_name] = struct_name + + #print(struct_name) + #print(f"cccc") + #print(fd[start_line:end_line]) + + skipMe = False + struct_data = [] + j = start_line + startedComment = False + while j < end_line: + #print(f"xxxxx", j, end_line) + data_member = fd[j] + j += 1 + + if not data_member.strip(): + continue + + #if testMe: + # print(f"bbbb {j}") + # print(data_member) + + if " : " in data_member: + skipMe = True + break; + + elif "#ifdef" in data_member or "#else" in data_member or "#endif" in data_member: + continue + + elif (data_member.strip().startswith("union") or data_member.strip().startswith("struct")) and ";" not in data_member: + is_union = "union" in data_member + start = j + + while "{" not in data_member: + data_member += fd[j] + j += 1 + + #while "{" not in fd[j]: + # j += 1 + + #if testMe: + #print(f"RECURSE {str(filename)} j {j} -- {fd[start-1]}") + j, skipMe, name, data = parse_struct("", fd, start - 1) + j += 1 + + if skipMe: + continue + + # invent a name for this anonymous struct + if not name: + name = f"{struct_name}_{j}" + + STRUCTS[name] = {} + STRUCTS[name]["data"] = data + STRUCTS[name]["union"] = is_union + + #if testMe: + #print(f"DONE RECURSE {str(filename)} j {j}") + #print(STRUCTS[name]) + #exit() + struct_data.append({"name":name, "type":name, "counts":[], "size":0, "round":0, "offset":0}) + continue; + + elif ";" not in data_member and "/" in data_member: + continue + + elif ";" not in data_member and startedComment: + while ";" not in fd[j]: + #print(f"yyyyy", j, end_line) + j += 1 + startedComment = False + continue + + if ";" in data_member and "/" in data_member: + startedComment = True + + data_members = [] + if ";" not in data_member: + data_members = [data_member] + while ";" not in fd[j]: + #print(f"zzzzzz", j, end_line) + data_members.append(fd[j]) + j += 1 + data_members.append(fd[j]) + j += 1 + + data_member = "".join(data_members) + + #if testMe: + # print() + # print() + # print(data_members) + + #print(data_members) + data_member = data_member.rsplit(";",1)[0] + + #print(data_member) + + if "*/" in data_member: + data_member = data_member.split("*/",1)[1] + + type, name = data_member.rsplit(" ",1) + + type = type.strip() + if "," in type: + names = type.split(" ",1)[1].split(",") + type = type.split(" ",1)[0] + + x = 0 + while x < len(names): + names[x] = names[x].strip() + x += 1 + else: + names = [] + names.append(name) + + for name in names: + if not name: + continue + name = name.strip() + + if "*" in name: + ptrs = name.count("*") + name = name.rsplit("*",1)[1] + type += "*" * ptrs + + if "struct " in type: + type = type.rsplit(" ",1)[1] + + type = type.replace("unsigned", "") + type = type.replace("signed", "") + + counts = [] + while "[" in name: + count = name.split("[",1)[1].split("]",1)[0] + name = name.split("[",1)[0] + name.split("]",1)[1] + + try: + count = int(count, 0) + except Exception: + skipMe = True + break; + + counts.append(count) + + if skipMe: + break; + + type = type.strip() + name = name.strip() + + #print(f"name:\"{name}\", type:\"{type}\"") + + struct_data.append({"name":name, "type":type, "counts":counts, "size":0, "round":0, "offset":0}) + + #if testMe: + # exit() + + return i, skipMe, struct_name, struct_data + +def parse_structs(): + file_list = [] + + inc_path = Path(sys.argv[0]).absolute().parent / "../include/" + src_path = Path(sys.argv[0]).absolute().parent / "../src/" + lib_path = Path(sys.argv[0]).absolute().parent / "../lib/ultralib/include/" + + file_list += inc_path.glob("**/*.c") + file_list += inc_path.glob("**/*.h") + file_list += lib_path.glob("**/*.c") + file_list += lib_path.glob("**/*.h") + file_list += src_path.glob("**/*.c") + file_list += src_path.glob("**/*.h") + + #print("\n".join(str(x) for x in file_list)) + + for file_name in file_list: + fd = file_name.read_text() + + fd = fd.replace("\t", " ") + fd = fd.splitlines() + + i = 0 + while i < len(fd): + if not fd[i].startswith("typedef") and not fd[i].startswith("#define"): + i += 1 + continue + + if fd[i].startswith("#define"): + if "\\" in fd[i]: + i += 1 + continue + + line = fd[i].split() + if len(line) >= 3: + try: + val = int(line[2], 0) + except Exception: + i += 1 + continue + + name = line[1] + DEFINES[name] = val + + i += 1 + + elif fd[i].startswith("typedef struct") and ";" not in fd[i]: + # struct + i, skipMe, name, data = parse_struct(file_name, fd, i) + + if not skipMe: + STRUCTS[name] = {} + STRUCTS[name]["data"] = data + STRUCTS[name]["union"] = False + + elif fd[i].startswith("typedef union"): + i, skipMe, name, data = parse_struct(file_name, fd, i) + + if not skipMe: + STRUCTS[name] = {} + STRUCTS[name]["data"] = data + STRUCTS[name]["union"] = True + + elif "(*" in fd[i]: + # func ptr + #print(fd[i]) + func_ptr = fd[i].split("typedef ",1)[1].rsplit(";",1)[0] + func_ptr = func_ptr.split("(*",1)[1].split(")",1)[0] + STRUCTS[func_ptr] = {} + STRUCTS[func_ptr]["data"] = [{"name":func_ptr, "type":"ptr", "counts":[], "size":4, "round":4, "offset":0}] + STRUCTS[func_ptr]["size"] = 4; + STRUCTS[func_ptr]["round"] = 4; + STRUCTS[func_ptr]["union"] = False + i += 1 + + elif "typedef" in fd[i] and ";" in fd[i]: + if "va_list" in fd[i]: + i += 1 + continue + + #print(fd[i]) + line = fd[i].replace("typedef ", "") + line = line.replace("unsigned ", "") + line = line.replace("signed ", "") + line = line.replace("struct ", "") + line = line.replace("union ", "") + line = line.replace(";", "") + + #if "Bitmap" in line: + # print(line) + # exit() + + if len(line.split(" ",1)) == 1: + i += 1 + continue + + type, name = line.split(" ",1) + type = type.strip() + name = name.strip() + + if "Bitmap" in name or "Sprite" in name: + STRUCT_TYPEDEFS[name] = type + i += 1 + continue + + skipMe = False + counts = [] + while "[" in name: + count = name.split("[",1)[1].split("]",1)[0] + + if count in DEFINES: + count = DEFINES[count] + else: + try: + count = int(count, 0) + except Exception: + #print(f"Skipping {name}") + skipMe = True + break; + name = name.split("[",1)[0] + name.split("]",1)[1] + counts.append(count) + + if skipMe: + i += 1 + continue + + if "*" in name: + ptr_count = name.count("*") + type += "*" * ptr_count + name = name.replace("*", "") + + name = name.strip() + type = type.strip() + + #print(counts) + #print(name, type) + + if type in BASE_TYPES and len(counts) == 0: + BASE_TYPES[name] = BASE_TYPES[type] + i += 1 + continue + + if name not in STRUCTS: + STRUCTS[name] = {} + STRUCTS[name]["data"] = [{"name":name, "type":type, "counts":counts, "size":0, "round":0, "offset":0}] + STRUCTS[name]["union"] = False + + i += 1 + + else: + #print(fd[i]) + i += 1 + + #exit() + + # For every struct, fix change pre-declared name to actual name: + # e.g typedef struct mystruct_s {} mystruct_t; + # mystruct_s -> mystruct_t + for struct_name, struct_data in STRUCTS.items(): + #print(struct_name, struct_data["data"]) + for member in struct_data["data"]: + ptr_count = 0 + #print(member) + pointerless_type = member["type"] + if "*" in pointerless_type: + ptr_count = pointerless_type.count("*") + pointerless_type = pointerless_type.split("*",1)[0] + + if pointerless_type in STRUCT_TYPEDEFS: + new_name = STRUCT_TYPEDEFS[pointerless_type] + ("*" * ptr_count) + member["type"] = new_name + + +def dump_data(offset, struct, counts): + + def output_struct(data, name, out, offset, indent): + def round_up(offset, rounding): + return offset + (-offset % rounding) + + out += indent + "{ " + + for member in STRUCTS[name]["data"]: + if member["type"] in STRUCTS: + out = output_struct(data, member["type"], out, offset + member["offset"], indent) + else: + #print(member) + + is_signed = member["type"] in SIGNED + is_float = member["type"] in FLOAT + read_offset = offset + member["offset"] + make_hex = "*" in member["type"] + + match member["size"]: + case 1: + v = unpack_from(">b" if is_signed else ">B", data, read_offset)[0] + out += f"{v}, " + + case 2: + v = unpack_from(">h" if is_signed else ">H", data, read_offset)[0] + out += f"{v}, " + + case 4: + v = unpack_from(">f" if is_float else ">i" if is_signed else ">I", data, read_offset)[0] + if make_hex: + if v == 0: + out += f"NULL" + ", " + else: + out += f"0x{v:08X}" + ", " + else: + out += f"{v}" + ("f" if is_float else "") + ", " + + case 8: + v = unpack_from(">d" if is_float else ">q" if is_signed else ">Q", data, read_offset)[0] + out += f"{v}" + ", " + + if len(STRUCTS[name]["data"]) <= 4: + out = out[:-2] + out += indent + "}, " + return out + + def output_array(data, name, counts, depth, out, offset): + indent = (depth + 1) * " " + if depth < len(counts): + for i in range(counts[depth]): + #print(f"depth {depth} number {i} offset 0x{offset:X}") + + if len(counts) > depth + 1: + out += indent + "\n{" + + #print(f"recurse start depth {depth+1} offset 0x{offset:X}") + out, offset = output_array(data, name, counts, depth+1, out, offset) + #print(f"recurse end depth {depth} offset 0x{offset:X}") + + out += indent + "\n}," + else: + out = output_struct(data, name, out, offset, (depth + 1) * " ") + offset += STRUCTS[name]["size"] + + else: + out = output_struct(data, name, out, offset, "") + + return out, offset + + total_size = STRUCTS[struct]["size"] + total_count = 1 + for count in counts: + total_count *= count + total_size = STRUCTS[struct]["size"] * total_count + + #print(f"size 0x{STRUCTS[struct]['size']:X} x {total_count} = 0x{total_size:X}") + + with open(Path(sys.argv[0]).absolute().parent / "../baseroms/us/baserom.z64", "rb") as f: + f.seek(offset, 0) + + data = f.read(total_size) + + out = "{" if len(counts) > 0 else "" + out, _ = output_array(data, struct, counts, 0, out, 0) + out = out + "};" if len(counts) > 0 else (out[:-2] + ";") + + print(out) + + + +####################################################################### + +parse_structs() +calc_struct_sizes() + +#print(f"{len(STRUCTS)} structs parsed in") + +offset = int(sys.argv[1], 16) +struct = sys.argv[2] + +counts = [] +while "[" in struct: + count = struct.split("[",1)[1].split("]",1)[0] + struct = struct.split("[",1)[0] + struct.split("]",1)[1] + count = int(count, 0) + counts.append(count) + +if struct not in STRUCTS: + print(f"Could not find struct definition \"{struct}\", maybe it failed to parse...") + exit() + +dump_data(offset, struct, counts) diff --git a/yamls/us/rom.yaml b/yamls/us/rom.yaml index aa722976..8eed6da3 100644 --- a/yamls/us/rom.yaml +++ b/yamls/us/rom.yaml @@ -956,10 +956,12 @@ - [0x15A2A0, c, fragments/16/fragment16_15A2A0] - [0x15A2B0, c, fragments/16/fragment16_15A2B0] - [0x15AD80, c, fragments/16/fragment16_15AD80] - - [0x15AF80, data, fragments/16/fragment16_data] - - [0x15EB20, rodata, fragments/16/fragment16_rodata] + - [0x15AF80, .data, fragments/16/fragment16_158A00] + - [0x15BB50, .data, fragments/16/fragment16_15A2B0] + - [0x15E530, .data, fragments/16/fragment16_15AD80] + - [0x15EB20, .rodata, fragments/16/fragment16_15A2B0] - - {vram: 0x86A06170, type: bss, name: fragments/16/fragment16_bss} + - {vram: 0x86A06170, type: .bss, name: fragments/16/fragment16_158A00} - name: fragment16_relocs type: code