Skip to content

Commit eef09bb

Browse files
authored
Merge pull request #96 from Kelebek1/fragment6
fragment6
2 parents 124a148 + 767c947 commit eef09bb

File tree

208 files changed

+14082
-11793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+14082
-11793
lines changed

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,10 @@ endif
195195
ASFLAGS = -EB -mtune=vr4300 -march=vr4300 $(IINCS) -32
196196

197197
# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff.
198-
CFLAGS = -G 0 -non_shared -Xfullwarn -Xcpluscomm $(IINCS) -Wab,-r4300_mul $(CDEFS) -woff 649,838,712,807 $(MIPS_VERSION)
198+
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)
199199

200200
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
201201

202-
203202
######################## Targets #############################
204203

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

373-
setup: distclean submodules split
372+
tools:
373+
make -s -C tools
374374

375375
expected:
376376
$(RM) -r expected/
377377
mkdir -p expected/
378378
cp -r $(BUILD_DIR) expected/$(BUILD_DIR)
379379

380+
setup: distclean submodules split tools all expected
381+
380382
$(BUILD_DIR):
381383
echo $(C_FILES)
382384
mkdir $(BUILD_DIR)

include/attributes.h

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#ifndef ATTRIBUTES_H
2+
#define ATTRIBUTES_H
3+
4+
5+
#if (!defined(__GNUC__) && !defined(__clang__)) || defined(M2CTX) || defined(__sgi)
6+
#ifndef __attribute__
7+
#define __attribute__(x)
8+
#endif
9+
#endif
10+
11+
12+
#ifndef FALLTHROUGH
13+
#ifdef PERMUTER
14+
#define FALLTHROUGH
15+
#elif __STDC_VERSION__ >= 202000L
16+
#define FALLTHROUGH [[fallthrough]]
17+
#else
18+
#define FALLTHROUGH __attribute__((fallthrough))
19+
#endif
20+
#endif
21+
22+
#ifndef NORETURN
23+
#ifdef PERMUTER
24+
#define NORETURN
25+
#elif __STDC_VERSION__ >= 202000L
26+
#define NORETURN [[noreturn]]
27+
#elif __STDC_VERSION__ >= 201112L
28+
#define NORETURN _Noreturn
29+
#else
30+
#define NORETURN __attribute__((noreturn))
31+
#endif
32+
#endif
33+
34+
#ifndef UNUSED
35+
#ifdef PERMUTER
36+
#define UNUSED
37+
#elif __STDC_VERSION__ >= 202000L
38+
#define UNUSED [[maybe_unused]]
39+
#else
40+
#define UNUSED __attribute__((unused))
41+
#endif
42+
#endif
43+
44+
45+
#endif

include/common.h

+50
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,57 @@
22
#define _COMMON_H
33

44
#include "ultra64.h"
5+
#include "attributes.h"
56
#include "functions.h"
67
#include "variables.h"
8+
#include "gfx.h"
9+
10+
typedef struct unk_D_86002F58_004 {
11+
/* 0x000 */ char pad0[0xC];
12+
/* 0x00C */ s32 unk_00C;
13+
/* 0x010 */ s8 unk_010[0x10];
14+
/* 0x020 */ s16 unk_020;
15+
/* 0x024 */ f32 unk_024;
16+
/* 0x028 */ f32 unk_028;
17+
/* 0x02C */ f32 unk_02C;
18+
/* 0x030 */ f32 unk_030;
19+
/* 0x034 */ f32 unk_034;
20+
/* 0x038 */ f32 unk_038;
21+
/* 0x03C */ char pad3C[0xC];
22+
/* 0x048 */ s32 unk_048;
23+
/* 0x04C */ u32 unk_04C;
24+
/* 0x050 */ char pad50[0x56];
25+
/* 0x0A6 */ s8 unk_0A6;
26+
/* 0x0A7 */ char padA7[5];
27+
/* 0x0AC */ f32 unk_0AC;
28+
/* 0x0B0 */ f32 unk_0B0;
29+
/* 0x0B4 */ char padB4[0xB4];
30+
/* 0x168 */ s16 unk_168;
31+
/* 0x16A */ u16 unk_16A;
32+
/* 0x16C */ s16 unk_16C;
33+
/* 0x16E */ char pad16E[2];
34+
} unk_D_86002F58_004; // size = 0x170
35+
36+
// possibly unk_D_86002F58_004
37+
typedef struct unk_D_86002F34_00C {
38+
/* 0x00 */ char pad00[0x2C];
39+
/* 0x2C */ f32 unk_02C;
40+
/* 0x30 */ char pad30[0x4];
41+
/* 0x34 */ f32 unk_034;
42+
/* 0x38 */ f32 unk_038;
43+
/* 0x3C */ char pad3C[0x6C];
44+
/* 0xA8 */ f32 unk_0A8;
45+
/* 0xAC */ char padAC[0x8];
46+
/* 0xB4 */ f32 unk_0B4;
47+
/* 0xB8 */ f32 unk_0B8;
48+
/* 0xBC */ f32 unk_0BC;
49+
} unk_D_86002F34_00C; // size >= 0xC0
50+
51+
typedef struct unk_D_86002F34 {
52+
/* 0x00 */ char pad00[0xC];
53+
/* 0x0C */ unk_D_86002F34_00C* unk_0C;
54+
} unk_D_86002F34; // size >= 0x10
55+
56+
757

858
#endif

include/gfx.h

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef GFX_H
2+
#define GFX_H
3+
4+
/**
5+
* `x` vertex x
6+
* `y` vertex y
7+
* `z` vertex z
8+
* `s` texture s coordinate
9+
* `t` texture t coordinate
10+
* `crnx` red component of color vertex, or x component of normal vertex
11+
* `cgny` green component of color vertex, or y component of normal vertex
12+
* `cbnz` blue component of color vertex, or z component of normal vertex
13+
* `a` alpha
14+
*/
15+
#define VTX(x, y, z, s, t, crnx, cgny, cbnz, a) \
16+
{ { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } }, }
17+
18+
#define VTX_T(x, y, z, s, t, cr, cg, cb, a) \
19+
{ { x, y, z }, 0, { s, t }, { cr, cg, cb, a }, }
20+
21+
#endif

include/sections.h

+3
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ extern u8 fragment30_ROM_END[];
155155
extern u8 fragment31_TEXT_START[];
156156
extern u8 fragment31_ROM_START[];
157157
extern u8 fragment31_ROM_END[];
158+
extern u8 fragment31_VRAM[];
158159

159160
// fragment 32
160161
extern u8 fragment32_TEXT_START[];
@@ -408,4 +409,6 @@ extern u8 _5F6790_ROM_START[];
408409
extern u8 _5F92A0_ROM_START[];
409410
extern u8 _5FFC30_ROM_START[];
410411

412+
extern u8 D_124570[];
413+
411414
#endif // _SECTIONS_H_

include/variables.h

+19
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,23 @@
2121
*/
2222
extern u8 gPool[1];
2323

24+
extern Gfx* gDisplayListHead;
25+
26+
extern u32 D_1000000;
27+
extern u32 D_3000000;
28+
extern u32 D_5000000;
29+
extern u32 D_6000000;
30+
extern u32 D_800AC840;
31+
extern u32 D_8D000000;
32+
33+
typedef struct unk_D_80068BA0 {
34+
/* 0x00 */ char pad00[6];
35+
/* 0x06 */ u16 unk_06;
36+
/* 0x08 */ u16 unk_08;
37+
} unk_D_80068BA0; // size >= 0xC
38+
39+
extern unk_D_80068BA0* D_80068BA0[4];
40+
extern Gfx D_8006F518[];
41+
extern Gfx D_8006F630[];
42+
2443
#endif

0 commit comments

Comments
 (0)