Skip to content

Commit

Permalink
Refresh 1
Browse files Browse the repository at this point in the history
  • Loading branch information
n64 committed Sep 1, 2019
1 parent c6102eb commit 1ef98ec
Show file tree
Hide file tree
Showing 475 changed files with 100,250 additions and 97,222 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
IndentWidth: 4
Language: Cpp
AlignAfterOpenBracket: Align
SortIncludes: false
ColumnLimit: 104
Expand All @@ -8,8 +9,10 @@ AllowShortIfStatementsOnASingleLine: false
BinPackArguments: true
BinPackParameters: true
SpaceAfterCStyleCast: true
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakBeforeBinaryOperators: NonAssignment
Cpp11BracedListStyle: false
IndentCaseLabels: true
AlignTrailingComments: true
UseTab: Never
6 changes: 6 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
Checks: '-*,readability-braces-around-statements'
WarningsAsErrors: ''
HeaderFilterRegex: '(src|include|enhancements)\/.*\.h$'
FormatStyle: 'file'
CheckOptions:
23 changes: 23 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# List text files in case git doesn't characterize correctly
*.c text
*.h text
*.s text
*.in text
*.js text
*.md text
*.py text
*.sh text
*.ld text
*.inc text
*.txt text
*.json text
*.yaml text

# Same for binary
*.bin binary
*.m64 binary
*.png binary
*.aiff binary
25 changes: 25 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Refresh #1
Changes from initial release:

1.) More README cleanups and documentation
2.) Fix .gitignore in tools/
3.) More README cleanups and corrections
4.) oUnk190 -> oInteractionSubtype
5.) Normalize line endings
6.) Replace bank_sets.s by sequences.json + build magic
7.) Fix tabledesign in .gitignore
8.) Cleaned and documented arrays in audio/
9.) Change minimum Python 3 requirement in README.md to 3.6
10.) Remove whitespace in ingame_menu.c, save_file.c, and star_select.c
11.) Documentation comment style fixed
12.) sm64.map -> sm64.version.map (ex: sm64.us.map)
13.) Decompile EU versions of HUD and obj behaviors
14.) Label ukiki.inc.c and ukiki_cage.inc.c
15.) Add missing OS header includes
16.) Fix alignment issue in model_ids.h
17.) A bunch of behavior changes:
a.) Made styles consistent with function names (ex: BehBehaviorLoop -> beh_behavior_loop)
b.) Split obj_behaviors_2.c into multiple .inc.c files in behaviors/
c.) bhvHauntedRoomCheck -> bhvCoffinManager
18.) Update README.md notes on WSL and add links
19.) Added tidy.sh and also bracing around single-line ifs and loops
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ SOUND_SAMPLE_TABLES := $(foreach file,$(SOUND_SAMPLE_AIFFS),$(BUILD_DIR)/$(file:
SOUND_SAMPLE_AIFCS := $(foreach file,$(SOUND_SAMPLE_AIFFS),$(BUILD_DIR)/$(file:.aiff=.aifc))
SOUND_OBJ_FILES := $(SOUND_BIN_DIR)/sound_data.ctl.o \
$(SOUND_BIN_DIR)/sound_data.tbl.o \
$(SOUND_BIN_DIR)/sequences.bin.o
$(SOUND_BIN_DIR)/sequences.bin.o \
$(SOUND_BIN_DIR)/bank_sets.o


# Object files
Expand Down Expand Up @@ -222,7 +223,7 @@ ASFLAGS := -march=vr4300 -mabi=32 -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
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)
OBJCOPYFLAGS := --pad-to=0x800000 --gap-fill=0xFF
SYMBOL_LINKING_FLAGS := $(addprefix -R ,$(SEG_FILES))
LDFLAGS := -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.map --no-check-sections $(SYMBOL_LINKING_FLAGS)
LDFLAGS := -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(SYMBOL_LINKING_FLAGS)

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

$(SOUND_BIN_DIR)/sound_data.ctl: $(SOUND_BANK_FILES) $(SOUND_SAMPLE_AIFCS)
$(SOUND_BIN_DIR)/sound_data.ctl: sound/sound_banks/ $(SOUND_BANK_FILES) $(SOUND_SAMPLE_AIFCS)
$(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)

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

$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_SEQUENCE_FILES)
$(PYTHON) tools/assemble_sound.py --sequences $@ $^
$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences/ sound/sequences/$(VERSION)/ $(SOUND_SEQUENCE_FILES)
$(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks/ sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS)

$(SOUND_BIN_DIR)/bank_sets: $(SOUND_BIN_DIR)/sequences.bin
touch $@

$(SOUND_BIN_DIR)/%.m64: $(SOUND_BIN_DIR)/%.o
$(OBJCOPY) -j .rodata $< -O binary $@
Expand Down
70 changes: 41 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,61 +17,73 @@ A prior copy of the game is required to extract the required assets.

### Linux

1. For each version (jp/us/eu) that you want to build a ROM for, put an existing ROM at
#### 1. Copy baserom(s) for asset extraction

For each version (jp/us/eu) that you want to build a ROM for, put an existing ROM at
`./baserom.<version>.z64` for asset extraction.

2. Install the following packages:
#### 2. Install build dependencies

The build system has the following package requirements:
* binutils-mips >= 2.27
* python3 >= 3.6
* libaudiofile
* qemu-irix

__Debian / Ubuntu__
* git
* binutils-mips-linux-gnu / mips64-elf (>= 2.27)
* python3 (>= 3.7)
* build-essential
* pkg-config
* zlib1g-dev
* libaudiofile-dev
```
sudo apt install build-essential pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev
```

__Arch Linux__
* base-devel
* python
* audiofile
```
sudo pacman -Sy base-devel python audiofile
```
Install the following AUR packages:
* [mips64-elf-binutils](https://aur.archlinux.org/packages/mips64-elf-binutils) (AUR)
* [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git) (AUR)

#### 3. Install qemu-irix

3. Install qemu-irix

3.a Options:
1. Clone https://github.com/n64decomp/qemu-irix to somewhere and follow its
install instructions in the README.
2. Optionally, grab the prebuilt qemu-irix from the Releases section.
3. (Arch) Use AUR package [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git)

3.b (For options 1 or 2), copy executable `qemu-irix` from irix-linux-user to
somewhere convenient with a relatively short path.
1. Options:
1. Clone https://github.com/n64decomp/qemu-irix to somewhere and follow its install instructions in the README.
2. Optionally, grab the prebuilt qemu-irix from the [Releases](https://github.com/n64decomp/sm64/releases) section.
3. (Arch) Use AUR package [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git)
2. (For the first two options), copy executable `qemu-irix` from irix-linux-user to
somewhere convenient with a relatively short path. e.g.:
```
mkdir -p /opt/qemu-irix/bin
cp irix-linux-user/qemu-irix /opt/qemu-irix/bin
```

3.c Define `QEMU_IRIX` environment variable in your `~/.bashrc` to point to
this qemu-irix executable.
3. Define `QEMU_IRIX` environment variable in your `~/.bashrc` to point to this qemu-irix executable.
```
export QEMU_IRIX=/opt/qemu-irix/bin/qemu-irix
```

6. Run `make` to build the ROM (defaults to us version). Make sure your path to
the repo is not too long or else this process will error, as the emulated
IDO compiler cannot handle paths longer than 255 characters.
Build examples:
#### 4. Build ROM

Run `make` to build the ROM (defaults to `VERSION=us`). Make sure your path to the repo
is not too long or else this process will error, as the emulated IDO compiler cannot
handle paths longer than 255 characters.
Examples:
```
make VERSION=jp -j4 # build (J) version instead with 4 jobs
make VERSION=eu COMPARE=0 # non-matching EU version still WIP
```

## Windows

For Windows, install WSL and a distro of your choice and follow the Linux guide.
For Windows, install WSL and a distro of your choice following
[Windows Subsystem for Linux Installation Guide for Windows 10](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
We recommend either Debian or Ubuntu 18.04 Linux distributions under WSL.

Then follow the directions in the [Linux](#linux) installation section above.

## macOS

macOS is currently unsupported as qemu-irix is unable to be built for macOS host.
The recommended path is installing a Linux distribution under a VM.

## Contributing

Expand Down
108 changes: 54 additions & 54 deletions actors/amp/geo.s
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
glabel amp_geo # 0x0F000028
geo_shadow SHADOW_CIRCLE_4_VERTS, 0xC8, 100
geo_open_node
geo_scale 0x00, 16384
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002C88
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_close_node
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002D70
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_billboard
geo_open_node
geo_display_list LAYER_ALPHA, amp_seg8_dl_08002E58
geo_close_node
geo_close_node
geo_close_node
geo_close_node
geo_close_node
geo_end
glabel amp_geo # 0x0F000028
geo_shadow SHADOW_CIRCLE_4_VERTS, 0xC8, 100
geo_open_node
geo_scale 0x00, 16384
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002C88
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_switch_case 2, geo_switch_anim_state
geo_open_node
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002BA0
geo_close_node
geo_close_node
geo_close_node
geo_animated_part LAYER_ALPHA, 0, 0, 0, amp_seg8_dl_08002D70
geo_animated_part LAYER_OPAQUE, 0, 0, 0
geo_open_node
geo_billboard
geo_open_node
geo_display_list LAYER_ALPHA, amp_seg8_dl_08002E58
geo_close_node
geo_close_node
geo_close_node
geo_close_node
geo_close_node
geo_end
Loading

0 comments on commit 1ef98ec

Please sign in to comment.