Skip to content

Commit

Permalink
Merge pull request pret#96 from Kelebek1/fragment6
Browse files Browse the repository at this point in the history
fragment6
  • Loading branch information
RevoSucks authored Aug 8, 2024
2 parents 124a148 + 767c947 commit eef09bb
Show file tree
Hide file tree
Showing 208 changed files with 14,082 additions and 11,793 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ endif
ASFLAGS = -EB -mtune=vr4300 -march=vr4300 $(IINCS) -32

# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff.
CFLAGS = -G 0 -non_shared -Xfullwarn -Xcpluscomm $(IINCS) -Wab,-r4300_mul $(CDEFS) -woff 649,838,712,807 $(MIPS_VERSION)
CFLAGS = -G 0 -non_shared -Xfullwarn -Xcpluscomm $(IINCS) -Wab,-r4300_mul $(CDEFS) -woff 624,649,838,712,516,513,596,564,594,807 $(MIPS_VERSION)

LDFLAGS = -T undefined_syms.txt -T undefined_syms_auto.txt -T undefined_funcs_auto.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/$(TARGET).map --no-check-sections


######################## Targets #############################

$(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(DATA_DIRS) $(COMPRESSED_DIRS) $(MAP_DIRS) $(BGM_DIRS),$(shell mkdir -p build/$(dir)))
Expand Down Expand Up @@ -370,13 +369,16 @@ submodules:
split:
rm -rf $(DATA_DIRS) $(ASM_DIRS) && ./tools/n64splat/split.py $(SPLAT_YAML)

setup: distclean submodules split
tools:
make -s -C tools

expected:
$(RM) -r expected/
mkdir -p expected/
cp -r $(BUILD_DIR) expected/$(BUILD_DIR)

setup: distclean submodules split tools all expected

$(BUILD_DIR):
echo $(C_FILES)
mkdir $(BUILD_DIR)
Expand Down
45 changes: 45 additions & 0 deletions include/attributes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#ifndef ATTRIBUTES_H
#define ATTRIBUTES_H


#if (!defined(__GNUC__) && !defined(__clang__)) || defined(M2CTX) || defined(__sgi)
#ifndef __attribute__
#define __attribute__(x)
#endif
#endif


#ifndef FALLTHROUGH
#ifdef PERMUTER
#define FALLTHROUGH
#elif __STDC_VERSION__ >= 202000L
#define FALLTHROUGH [[fallthrough]]
#else
#define FALLTHROUGH __attribute__((fallthrough))
#endif
#endif

#ifndef NORETURN
#ifdef PERMUTER
#define NORETURN
#elif __STDC_VERSION__ >= 202000L
#define NORETURN [[noreturn]]
#elif __STDC_VERSION__ >= 201112L
#define NORETURN _Noreturn
#else
#define NORETURN __attribute__((noreturn))
#endif
#endif

#ifndef UNUSED
#ifdef PERMUTER
#define UNUSED
#elif __STDC_VERSION__ >= 202000L
#define UNUSED [[maybe_unused]]
#else
#define UNUSED __attribute__((unused))
#endif
#endif


#endif
50 changes: 50 additions & 0 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,57 @@
#define _COMMON_H

#include "ultra64.h"
#include "attributes.h"
#include "functions.h"
#include "variables.h"
#include "gfx.h"

typedef struct unk_D_86002F58_004 {
/* 0x000 */ char pad0[0xC];
/* 0x00C */ s32 unk_00C;
/* 0x010 */ s8 unk_010[0x10];
/* 0x020 */ s16 unk_020;
/* 0x024 */ f32 unk_024;
/* 0x028 */ f32 unk_028;
/* 0x02C */ f32 unk_02C;
/* 0x030 */ f32 unk_030;
/* 0x034 */ f32 unk_034;
/* 0x038 */ f32 unk_038;
/* 0x03C */ char pad3C[0xC];
/* 0x048 */ s32 unk_048;
/* 0x04C */ u32 unk_04C;
/* 0x050 */ char pad50[0x56];
/* 0x0A6 */ s8 unk_0A6;
/* 0x0A7 */ char padA7[5];
/* 0x0AC */ f32 unk_0AC;
/* 0x0B0 */ f32 unk_0B0;
/* 0x0B4 */ char padB4[0xB4];
/* 0x168 */ s16 unk_168;
/* 0x16A */ u16 unk_16A;
/* 0x16C */ s16 unk_16C;
/* 0x16E */ char pad16E[2];
} unk_D_86002F58_004; // size = 0x170

// possibly unk_D_86002F58_004
typedef struct unk_D_86002F34_00C {
/* 0x00 */ char pad00[0x2C];
/* 0x2C */ f32 unk_02C;
/* 0x30 */ char pad30[0x4];
/* 0x34 */ f32 unk_034;
/* 0x38 */ f32 unk_038;
/* 0x3C */ char pad3C[0x6C];
/* 0xA8 */ f32 unk_0A8;
/* 0xAC */ char padAC[0x8];
/* 0xB4 */ f32 unk_0B4;
/* 0xB8 */ f32 unk_0B8;
/* 0xBC */ f32 unk_0BC;
} unk_D_86002F34_00C; // size >= 0xC0

typedef struct unk_D_86002F34 {
/* 0x00 */ char pad00[0xC];
/* 0x0C */ unk_D_86002F34_00C* unk_0C;
} unk_D_86002F34; // size >= 0x10



#endif
21 changes: 21 additions & 0 deletions include/gfx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef GFX_H
#define GFX_H

/**
* `x` vertex x
* `y` vertex y
* `z` vertex z
* `s` texture s coordinate
* `t` texture t coordinate
* `crnx` red component of color vertex, or x component of normal vertex
* `cgny` green component of color vertex, or y component of normal vertex
* `cbnz` blue component of color vertex, or z component of normal vertex
* `a` alpha
*/
#define VTX(x, y, z, s, t, crnx, cgny, cbnz, a) \
{ { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } }, }

#define VTX_T(x, y, z, s, t, cr, cg, cb, a) \
{ { x, y, z }, 0, { s, t }, { cr, cg, cb, a }, }

#endif
3 changes: 3 additions & 0 deletions include/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ extern u8 fragment30_ROM_END[];
extern u8 fragment31_TEXT_START[];
extern u8 fragment31_ROM_START[];
extern u8 fragment31_ROM_END[];
extern u8 fragment31_VRAM[];

// fragment 32
extern u8 fragment32_TEXT_START[];
Expand Down Expand Up @@ -408,4 +409,6 @@ extern u8 _5F6790_ROM_START[];
extern u8 _5F92A0_ROM_START[];
extern u8 _5FFC30_ROM_START[];

extern u8 D_124570[];

#endif // _SECTIONS_H_
19 changes: 19 additions & 0 deletions include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,23 @@
*/
extern u8 gPool[1];

extern Gfx* gDisplayListHead;

extern u32 D_1000000;
extern u32 D_3000000;
extern u32 D_5000000;
extern u32 D_6000000;
extern u32 D_800AC840;
extern u32 D_8D000000;

typedef struct unk_D_80068BA0 {
/* 0x00 */ char pad00[6];
/* 0x06 */ u16 unk_06;
/* 0x08 */ u16 unk_08;
} unk_D_80068BA0; // size >= 0xC

extern unk_D_80068BA0* D_80068BA0[4];
extern Gfx D_8006F518[];
extern Gfx D_8006F630[];

#endif
Loading

0 comments on commit eef09bb

Please sign in to comment.