Skip to content

Commit 1ef98ec

Browse files
author
n64
committed
Refresh 1
1 parent c6102eb commit 1ef98ec

File tree

475 files changed

+100250
-97222
lines changed

Some content is hidden

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

475 files changed

+100250
-97222
lines changed

.clang-format

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
IndentWidth: 4
2+
Language: Cpp
23
AlignAfterOpenBracket: Align
34
SortIncludes: false
45
ColumnLimit: 104
@@ -8,8 +9,10 @@ AllowShortIfStatementsOnASingleLine: false
89
BinPackArguments: true
910
BinPackParameters: true
1011
SpaceAfterCStyleCast: true
12+
BreakBeforeBraces: Attach
1113
BreakBeforeTernaryOperators: true
1214
BreakBeforeBinaryOperators: NonAssignment
1315
Cpp11BracedListStyle: false
1416
IndentCaseLabels: true
1517
AlignTrailingComments: true
18+
UseTab: Never

.clang-tidy

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
Checks: '-*,readability-braces-around-statements'
3+
WarningsAsErrors: ''
4+
HeaderFilterRegex: '(src|include|enhancements)\/.*\.h$'
5+
FormatStyle: 'file'
6+
CheckOptions:

.gitattributes

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# List text files in case git doesn't characterize correctly
5+
*.c text
6+
*.h text
7+
*.s text
8+
*.in text
9+
*.js text
10+
*.md text
11+
*.py text
12+
*.sh text
13+
*.ld text
14+
*.inc text
15+
*.txt text
16+
*.json text
17+
*.yaml text
18+
19+
# Same for binary
20+
*.bin binary
21+
*.m64 binary
22+
*.png binary
23+
*.aiff binary

CHANGES

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Refresh #1
2+
Changes from initial release:
3+
4+
1.) More README cleanups and documentation
5+
2.) Fix .gitignore in tools/
6+
3.) More README cleanups and corrections
7+
4.) oUnk190 -> oInteractionSubtype
8+
5.) Normalize line endings
9+
6.) Replace bank_sets.s by sequences.json + build magic
10+
7.) Fix tabledesign in .gitignore
11+
8.) Cleaned and documented arrays in audio/
12+
9.) Change minimum Python 3 requirement in README.md to 3.6
13+
10.) Remove whitespace in ingame_menu.c, save_file.c, and star_select.c
14+
11.) Documentation comment style fixed
15+
12.) sm64.map -> sm64.version.map (ex: sm64.us.map)
16+
13.) Decompile EU versions of HUD and obj behaviors
17+
14.) Label ukiki.inc.c and ukiki_cage.inc.c
18+
15.) Add missing OS header includes
19+
16.) Fix alignment issue in model_ids.h
20+
17.) A bunch of behavior changes:
21+
a.) Made styles consistent with function names (ex: BehBehaviorLoop -> beh_behavior_loop)
22+
b.) Split obj_behaviors_2.c into multiple .inc.c files in behaviors/
23+
c.) bhvHauntedRoomCheck -> bhvCoffinManager
24+
18.) Update README.md notes on WSL and add links
25+
19.) Added tidy.sh and also bracing around single-line ifs and loops

Makefile

+9-5
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ SOUND_SAMPLE_TABLES := $(foreach file,$(SOUND_SAMPLE_AIFFS),$(BUILD_DIR)/$(file:
173173
SOUND_SAMPLE_AIFCS := $(foreach file,$(SOUND_SAMPLE_AIFFS),$(BUILD_DIR)/$(file:.aiff=.aifc))
174174
SOUND_OBJ_FILES := $(SOUND_BIN_DIR)/sound_data.ctl.o \
175175
$(SOUND_BIN_DIR)/sound_data.tbl.o \
176-
$(SOUND_BIN_DIR)/sequences.bin.o
176+
$(SOUND_BIN_DIR)/sequences.bin.o \
177+
$(SOUND_BIN_DIR)/bank_sets.o
177178

178179

179180
# Object files
@@ -222,7 +223,7 @@ ASFLAGS := -march=vr4300 -mabi=32 -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
222223
CFLAGS = -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn $(OPT_FLAGS) -signed -I include -I $(BUILD_DIR)/include -I src -D_LANGUAGE_C $(VERSION_CFLAGS) $(MIPSISET) $(GRUCODE_CFLAGS)
223224
OBJCOPYFLAGS := --pad-to=0x800000 --gap-fill=0xFF
224225
SYMBOL_LINKING_FLAGS := $(addprefix -R ,$(SEG_FILES))
225-
LDFLAGS := -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.map --no-check-sections $(SYMBOL_LINKING_FLAGS)
226+
LDFLAGS := -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(SYMBOL_LINKING_FLAGS)
226227

227228
ifeq ($(shell getconf LONG_BIT), 32)
228229
# Work around memory allocation bug in QEMU
@@ -375,14 +376,17 @@ $(BUILD_DIR)/%.table: %.aiff
375376
$(BUILD_DIR)/%.aifc: $(BUILD_DIR)/%.table %.aiff
376377
$(VADPCM_ENC) -c $^ $@
377378

378-
$(SOUND_BIN_DIR)/sound_data.ctl: $(SOUND_BANK_FILES) $(SOUND_SAMPLE_AIFCS)
379+
$(SOUND_BIN_DIR)/sound_data.ctl: sound/sound_banks/ $(SOUND_BANK_FILES) $(SOUND_SAMPLE_AIFCS)
379380
$(PYTHON) tools/assemble_sound.py $(BUILD_DIR)/sound/samples/ sound/sound_banks/ $(SOUND_BIN_DIR)/sound_data.ctl $(SOUND_BIN_DIR)/sound_data.tbl $(VERSION_CFLAGS)
380381

381382
$(SOUND_BIN_DIR)/sound_data.tbl: $(SOUND_BIN_DIR)/sound_data.ctl
382383
touch $@
383384

384-
$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_SEQUENCE_FILES)
385-
$(PYTHON) tools/assemble_sound.py --sequences $@ $^
385+
$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences/ sound/sequences/$(VERSION)/ $(SOUND_SEQUENCE_FILES)
386+
$(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks/ sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS)
387+
388+
$(SOUND_BIN_DIR)/bank_sets: $(SOUND_BIN_DIR)/sequences.bin
389+
touch $@
386390

387391
$(SOUND_BIN_DIR)/%.m64: $(SOUND_BIN_DIR)/%.o
388392
$(OBJCOPY) -j .rodata $< -O binary $@

README.md

+41-29
Original file line numberDiff line numberDiff line change
@@ -17,61 +17,73 @@ A prior copy of the game is required to extract the required assets.
1717

1818
### Linux
1919

20-
1. For each version (jp/us/eu) that you want to build a ROM for, put an existing ROM at
20+
#### 1. Copy baserom(s) for asset extraction
21+
22+
For each version (jp/us/eu) that you want to build a ROM for, put an existing ROM at
2123
`./baserom.<version>.z64` for asset extraction.
2224

23-
2. Install the following packages:
25+
#### 2. Install build dependencies
26+
27+
The build system has the following package requirements:
28+
* binutils-mips >= 2.27
29+
* python3 >= 3.6
30+
* libaudiofile
31+
* qemu-irix
2432

2533
__Debian / Ubuntu__
26-
* git
27-
* binutils-mips-linux-gnu / mips64-elf (>= 2.27)
28-
* python3 (>= 3.7)
29-
* build-essential
30-
* pkg-config
31-
* zlib1g-dev
32-
* libaudiofile-dev
34+
```
35+
sudo apt install build-essential pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev
36+
```
3337

3438
__Arch Linux__
35-
* base-devel
36-
* python
37-
* audiofile
39+
```
40+
sudo pacman -Sy base-devel python audiofile
41+
```
42+
Install the following AUR packages:
3843
* [mips64-elf-binutils](https://aur.archlinux.org/packages/mips64-elf-binutils) (AUR)
3944
* [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git) (AUR)
4045

46+
#### 3. Install qemu-irix
4147

42-
3. Install qemu-irix
43-
44-
3.a Options:
45-
1. Clone https://github.com/n64decomp/qemu-irix to somewhere and follow its
46-
install instructions in the README.
47-
2. Optionally, grab the prebuilt qemu-irix from the Releases section.
48-
3. (Arch) Use AUR package [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git)
49-
50-
3.b (For options 1 or 2), copy executable `qemu-irix` from irix-linux-user to
51-
somewhere convenient with a relatively short path.
48+
1. Options:
49+
1. Clone https://github.com/n64decomp/qemu-irix to somewhere and follow its install instructions in the README.
50+
2. Optionally, grab the prebuilt qemu-irix from the [Releases](https://github.com/n64decomp/sm64/releases) section.
51+
3. (Arch) Use AUR package [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git)
52+
2. (For the first two options), copy executable `qemu-irix` from irix-linux-user to
53+
somewhere convenient with a relatively short path. e.g.:
5254
```
5355
mkdir -p /opt/qemu-irix/bin
5456
cp irix-linux-user/qemu-irix /opt/qemu-irix/bin
5557
```
5658

57-
3.c Define `QEMU_IRIX` environment variable in your `~/.bashrc` to point to
58-
this qemu-irix executable.
59+
3. Define `QEMU_IRIX` environment variable in your `~/.bashrc` to point to this qemu-irix executable.
5960
```
6061
export QEMU_IRIX=/opt/qemu-irix/bin/qemu-irix
6162
```
6263

63-
6. Run `make` to build the ROM (defaults to us version). Make sure your path to
64-
the repo is not too long or else this process will error, as the emulated
65-
IDO compiler cannot handle paths longer than 255 characters.
66-
Build examples:
64+
#### 4. Build ROM
65+
66+
Run `make` to build the ROM (defaults to `VERSION=us`). Make sure your path to the repo
67+
is not too long or else this process will error, as the emulated IDO compiler cannot
68+
handle paths longer than 255 characters.
69+
Examples:
6770
```
6871
make VERSION=jp -j4 # build (J) version instead with 4 jobs
6972
make VERSION=eu COMPARE=0 # non-matching EU version still WIP
7073
```
7174

7275
## Windows
7376

74-
For Windows, install WSL and a distro of your choice and follow the Linux guide.
77+
For Windows, install WSL and a distro of your choice following
78+
[Windows Subsystem for Linux Installation Guide for Windows 10](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
79+
We recommend either Debian or Ubuntu 18.04 Linux distributions under WSL.
80+
81+
Then follow the directions in the [Linux](#linux) installation section above.
82+
83+
## macOS
84+
85+
macOS is currently unsupported as qemu-irix is unable to be built for macOS host.
86+
The recommended path is installing a Linux distribution under a VM.
7587

7688
## Contributing
7789

actors/amp/geo.s

+54-54
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
glabel amp_geo # 0x0F000028
2-
geo_shadow SHADOW_CIRCLE_4_VERTS, 0xC8, 100
3-
geo_open_node
4-
geo_scale 0x00, 16384
5-
geo_open_node
6-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
7-
geo_open_node
8-
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002C88
9-
geo_open_node
10-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
11-
geo_open_node
12-
geo_switch_case 2, geo_switch_anim_state
13-
geo_open_node
14-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
15-
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
16-
geo_close_node
17-
geo_close_node
18-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
19-
geo_open_node
20-
geo_switch_case 2, geo_switch_anim_state
21-
geo_open_node
22-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
23-
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
24-
geo_close_node
25-
geo_close_node
26-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
27-
geo_open_node
28-
geo_switch_case 2, geo_switch_anim_state
29-
geo_open_node
30-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
31-
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
32-
geo_close_node
33-
geo_close_node
34-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
35-
geo_open_node
36-
geo_switch_case 2, geo_switch_anim_state
37-
geo_open_node
38-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
39-
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
40-
geo_close_node
41-
geo_close_node
42-
geo_close_node
43-
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002D70
44-
geo_animated_part LAYER_OPAQUE, 0, 0, 0
45-
geo_open_node
46-
geo_billboard
47-
geo_open_node
48-
geo_display_list LAYER_ALPHA, amp_seg8_dl_08002E58
49-
geo_close_node
50-
geo_close_node
51-
geo_close_node
52-
geo_close_node
53-
geo_close_node
54-
geo_end
1+
glabel amp_geo # 0x0F000028
2+
geo_shadow SHADOW_CIRCLE_4_VERTS, 0xC8, 100
3+
geo_open_node
4+
geo_scale 0x00, 16384
5+
geo_open_node
6+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
7+
geo_open_node
8+
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002C88
9+
geo_open_node
10+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
11+
geo_open_node
12+
geo_switch_case 2, geo_switch_anim_state
13+
geo_open_node
14+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
15+
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
16+
geo_close_node
17+
geo_close_node
18+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
19+
geo_open_node
20+
geo_switch_case 2, geo_switch_anim_state
21+
geo_open_node
22+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
23+
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
24+
geo_close_node
25+
geo_close_node
26+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
27+
geo_open_node
28+
geo_switch_case 2, geo_switch_anim_state
29+
geo_open_node
30+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
31+
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
32+
geo_close_node
33+
geo_close_node
34+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
35+
geo_open_node
36+
geo_switch_case 2, geo_switch_anim_state
37+
geo_open_node
38+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
39+
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
40+
geo_close_node
41+
geo_close_node
42+
geo_close_node
43+
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002D70
44+
geo_animated_part LAYER_OPAQUE, 0, 0, 0
45+
geo_open_node
46+
geo_billboard
47+
geo_open_node
48+
geo_display_list LAYER_ALPHA, amp_seg8_dl_08002E58
49+
geo_close_node
50+
geo_close_node
51+
geo_close_node
52+
geo_close_node
53+
geo_close_node
54+
geo_end

0 commit comments

Comments
 (0)