mirror of
https://github.com/pret/pokestadium.git
synced 2026-03-21 17:24:20 -05:00
fragment16
This commit is contained in:
parent
f8e727ee76
commit
eda64c1eec
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
83
include/prevent_bss_reordering.h
Normal file
83
include/prevent_bss_reordering.h
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
278
src/18480.c
278
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[];
|
||||
|
|
|
|||
279
src/18480.h
279
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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
459
src/fragments/16/fragment16.h
Normal file
459
src/fragments/16/fragment16.h
Normal file
|
|
@ -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_
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
637
tools/data2c.py
Executable file
637
tools/data2c.py
Executable file
|
|
@ -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)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user