You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Compare commits
43 Commits
develop/2.
...
develop/2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93a0816b6c | ||
|
|
85b72619e4 | ||
|
|
9500f7a8d7 | ||
|
|
e206d4477c | ||
|
|
63250a04fb | ||
|
|
d20112107c | ||
|
|
29a402dbb1 | ||
|
|
8bb943d533 | ||
|
|
76559c07f7 | ||
|
|
83426bae74 | ||
|
|
233d105662 | ||
|
|
cf88d09f5e | ||
|
|
533d1ddaa2 | ||
|
|
e513c7272f | ||
|
|
6589012fe5 | ||
|
|
3af936f6de | ||
|
|
cbd0c05447 | ||
|
|
8f4b5b99c9 | ||
|
|
94bfaff1ae | ||
|
|
da18d323f4 | ||
|
|
2dd4171fee | ||
|
|
3c65ad1fed | ||
|
|
39d0ccb412 | ||
|
|
a334872dec | ||
|
|
e8e4210406 | ||
|
|
72f200653b | ||
|
|
e43749b254 | ||
|
|
67ab8512b7 | ||
|
|
2c15b0e642 | ||
|
|
3edf4bc593 | ||
|
|
48ecd1da98 | ||
|
|
e1486216d7 | ||
|
|
50b773d9ed | ||
|
|
a4f6c95360 | ||
|
|
dc212c24f7 | ||
|
|
aef3252921 | ||
|
|
d3a104ac39 | ||
|
|
8281d4bc23 | ||
|
|
bb60f2d851 | ||
|
|
3f579629c8 | ||
|
|
d43157c82c | ||
|
|
ff82298b31 | ||
|
|
c46fa2d090 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -979,10 +979,6 @@ levels/wmotr/1.rgba16.png
|
||||
levels/wmotr/2.rgba16.png
|
||||
levels/wmotr/3.rgba16.png
|
||||
levels/wmotr/4.rgba16.png
|
||||
sound/samples/bowser_organ/00_organ_1.aiff
|
||||
sound/samples/bowser_organ/01_organ_1_lq.aiff
|
||||
sound/samples/bowser_organ/02_boys_choir.aiff
|
||||
sound/samples/course_start/00_la.aiff
|
||||
sound/samples/instruments/00.aiff
|
||||
sound/samples/instruments/01_banjo_1.aiff
|
||||
sound/samples/instruments/02.aiff
|
||||
@@ -1059,7 +1055,6 @@ sound/samples/instruments/45b_la.aiff
|
||||
sound/samples/instruments/46_pizzicato_strings_1.aiff
|
||||
sound/samples/instruments/47_pizzicato_strings_2.aiff
|
||||
sound/samples/instruments/48_steel_drum.aiff
|
||||
sound/samples/piranha_music_box/00_music_box.aiff
|
||||
sound/samples/sfx_1/00_twirl.aiff
|
||||
sound/samples/sfx_1/01_brushing.aiff
|
||||
sound/samples/sfx_1/02_hand_touch.aiff
|
||||
@@ -2152,3 +2147,4 @@ lib/libs2d_engine.a
|
||||
|
||||
# user-specific config file
|
||||
include/config/config_local.h
|
||||
.DS_Store
|
||||
|
||||
3
.vscode/c_cpp_properties.json
vendored
3
.vscode/c_cpp_properties.json
vendored
@@ -27,8 +27,7 @@
|
||||
"F3DEX_GBI_2=1",
|
||||
"F3DZEX_NON_GBI_2=1",
|
||||
"F3DEX_GBI_SHARED=1",
|
||||
"LIBPL=1",
|
||||
"SDATA=1"
|
||||
"LIBPL=1"
|
||||
],
|
||||
"compilerPath": "/usr/bin/mips-linux-gnu-gcc",
|
||||
"cStandard": "gnu17",
|
||||
|
||||
224
Makefile
224
Makefile
@@ -67,7 +67,7 @@ else ifeq ($(SAVETYPE),sram)
|
||||
DEFINES += SRAM=1
|
||||
endif
|
||||
|
||||
DEFINES += NO_ERRNO_H=1 NO_GZIP=1
|
||||
DEFINES += NO_ERRNO_H=1
|
||||
|
||||
# VERSION - selects the version of the game to build
|
||||
# jp - builds the 1996 Japanese version
|
||||
@@ -135,7 +135,7 @@ endif
|
||||
#==============================================================================#
|
||||
|
||||
# Default non-gcc opt flags
|
||||
DEFAULT_OPT_FLAGS = -Ofast -falign-functions=32
|
||||
DEFAULT_OPT_FLAGS = -Os -ffinite-math-only -fno-signed-zeros -fno-math-errno
|
||||
# Note: -fno-associative-math is used here to suppress warnings, ideally we would enable this as an optimization but
|
||||
# this conflicts with -ftrapping-math apparently.
|
||||
# TODO: Figure out how to allow -fassociative-math to be enabled
|
||||
@@ -265,25 +265,14 @@ ifeq ($(LIBPL),1)
|
||||
SRC_DIRS += $(LIBPL_DIR)
|
||||
endif
|
||||
|
||||
# SDATA - use 64kb sdata and sbss sections to enhance performance (requires some housekeeping; recommended for experienced hackers only)
|
||||
# 1 - includes sdata and sbss in ROM
|
||||
# 0 - does not
|
||||
SDATA ?= 0
|
||||
$(eval $(call validate-option,SDATA,0 1))
|
||||
ifeq ($(SDATA),1)
|
||||
DEFINES += SDATA=1
|
||||
endif
|
||||
|
||||
BUILD_DIR_BASE := build
|
||||
# BUILD_DIR is the location where all build artifacts are placed
|
||||
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_$(CONSOLE)
|
||||
|
||||
COMPRESS ?= yay0
|
||||
$(eval $(call validate-option,COMPRESS,mio0 yay0 gzip rnc1 rnc2 uncomp))
|
||||
COMPRESS ?= lz4t
|
||||
$(eval $(call validate-option,COMPRESS,mio0 yay0 lz4t gzip rnc1 rnc2 uncomp))
|
||||
ifeq ($(COMPRESS),gzip)
|
||||
DEFINES += GZIP=1
|
||||
LIBZRULE := $(BUILD_DIR)/libz.a
|
||||
LIBZLINK := -lz
|
||||
else ifeq ($(COMPRESS),rnc1)
|
||||
DEFINES += RNC1=1
|
||||
else ifeq ($(COMPRESS),rnc2)
|
||||
@@ -292,13 +281,12 @@ else ifeq ($(COMPRESS),yay0)
|
||||
DEFINES += YAY0=1
|
||||
else ifeq ($(COMPRESS),mio0)
|
||||
DEFINES += MIO0=1
|
||||
else ifeq ($(COMPRESS),lz4t)
|
||||
DEFINES += LZ4T=1
|
||||
else ifeq ($(COMPRESS),uncomp)
|
||||
DEFINES += UNCOMPRESSED=1
|
||||
endif
|
||||
|
||||
GZIPVER ?= std
|
||||
$(eval $(call validate-option,GZIPVER,std libdef))
|
||||
|
||||
# Whether to hide commands or not
|
||||
VERBOSE ?= 0
|
||||
ifeq ($(VERBOSE),0)
|
||||
@@ -323,36 +311,18 @@ PYTHON := python3
|
||||
|
||||
ifeq ($(filter clean distclean print-%,$(MAKECMDGOALS)),)
|
||||
|
||||
# Make sure assets exist
|
||||
# Extract assets if necessary
|
||||
NOEXTRACT ?= 0
|
||||
ifeq ($(NOEXTRACT),0)
|
||||
DUMMY != $(PYTHON) extract_assets.py us >&2 || echo FAIL
|
||||
DUMMY != $(PYTHON) extract_assets.py >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets from US ROM)
|
||||
endif
|
||||
ifneq (,$(shell python3 tools/detect_baseroms.py jp))
|
||||
DUMMY != $(PYTHON) extract_assets.py jp >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets from JP ROM)
|
||||
endif
|
||||
endif
|
||||
ifneq (,$(shell python3 tools/detect_baseroms.py eu))
|
||||
DUMMY != $(PYTHON) extract_assets.py eu >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets from EU ROM)
|
||||
endif
|
||||
endif
|
||||
ifneq (,$(shell python3 tools/detect_baseroms.py sh))
|
||||
DUMMY != $(PYTHON) extract_assets.py sh >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets from SH ROM)
|
||||
endif
|
||||
$(error Failed to extract assets from found baseroms)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Make tools if out of date
|
||||
$(info Building tools...)
|
||||
DUMMY != $(MAKE) -s -C $(TOOLS_DIR) >&2 || echo FAIL
|
||||
DUMMY != "$(MAKE)" -s -C $(TOOLS_DIR) >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to build tools)
|
||||
endif
|
||||
@@ -382,7 +352,6 @@ BUILD_DIR_BASE := build
|
||||
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_$(CONSOLE)
|
||||
ROM := $(BUILD_DIR)/$(TARGET_STRING).z64
|
||||
ELF := $(BUILD_DIR)/$(TARGET_STRING).elf
|
||||
LIBZ := $(BUILD_DIR)/libz.a
|
||||
LD_SCRIPT := sm64.ld
|
||||
YAY0_DIR := $(BUILD_DIR)/bin
|
||||
SOUND_BIN_DIR := $(BUILD_DIR)/sound
|
||||
@@ -391,7 +360,7 @@ ACTOR_DIR := actors
|
||||
LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
|
||||
|
||||
# Directories containing source files
|
||||
SRC_DIRS += src src/boot src/game src/engine src/audio src/menu src/buffers actors levels bin data assets asm lib sound
|
||||
SRC_DIRS += src src/boot src/boot/deflate src/game src/engine src/audio src/menu src/buffers lib/librtc actors levels bin data assets asm lib sound
|
||||
LIBZ_SRC_DIRS := src/libz
|
||||
GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
|
||||
BIN_DIRS := bin bin/$(VERSION)
|
||||
@@ -403,7 +372,6 @@ include Makefile.split
|
||||
LEVEL_C_FILES := $(wildcard levels/*/leveldata.c) $(wildcard levels/*/script.c) $(wildcard levels/*/geo.c)
|
||||
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES)
|
||||
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
||||
LIBZ_C_FILES := $(foreach dir,$(LIBZ_SRC_DIRS),$(wildcard $(dir)/*.c))
|
||||
GODDARD_C_FILES := $(foreach dir,$(GODDARD_SRC_DIRS),$(wildcard $(dir)/*.c))
|
||||
S_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.s))
|
||||
GENERATED_C_FILES := $(BUILD_DIR)/assets/mario_anim_data.c $(BUILD_DIR)/assets/demo_data.c
|
||||
@@ -432,38 +400,18 @@ O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
|
||||
$(foreach file,$(GENERATED_C_FILES),$(file:.c=.o)) \
|
||||
lib/PR/hvqm/hvqm2sp1.o lib/PR/hvqm/hvqm2sp2.o
|
||||
|
||||
LIBZ_O_FILES := $(foreach file,$(LIBZ_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
# Automatic dependency files
|
||||
DEP_FILES := $(O_FILES:.o=.d) $(LIBZ_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d
|
||||
DEP_FILES := $(O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d
|
||||
|
||||
#==============================================================================#
|
||||
# Compiler Options #
|
||||
#==============================================================================#
|
||||
|
||||
# detect prefix for MIPS toolchain
|
||||
ifneq ($(call find-command,mips64-elf-ld),)
|
||||
CROSS := mips64-elf-
|
||||
else ifneq ($(call find-command,mips-n64-ld),)
|
||||
CROSS := mips-n64-
|
||||
else ifneq ($(call find-command,mips64-ld),)
|
||||
CROSS := mips64-
|
||||
else ifneq ($(call find-command,mips-linux-gnu-ld),)
|
||||
CROSS := mips-linux-gnu-
|
||||
else ifneq ($(call find-command,mips64-linux-gnu-ld),)
|
||||
CROSS := mips64-linux-gnu-
|
||||
else ifneq ($(call find-command,mips64-none-elf-ld),)
|
||||
CROSS := mips64-none-elf-
|
||||
else ifneq ($(call find-command,mips-ld),)
|
||||
CROSS := mips-
|
||||
else ifneq ($(call find-command,mips-suse-linux-ld ),)
|
||||
CROSS := mips-suse-linux-
|
||||
else
|
||||
$(error Unable to detect a suitable MIPS toolchain installed)
|
||||
endif
|
||||
CROSS := $(call find-mips-toolchain)
|
||||
|
||||
LIBRARIES := nustd hvqm2 z goddard
|
||||
LIBRARIES := nustd hvqm2 goddard
|
||||
|
||||
LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
|
||||
|
||||
@@ -475,24 +423,22 @@ ifeq ($(COMPILER),gcc)
|
||||
CXX := $(CROSS)g++
|
||||
$(BUILD_DIR)/actors/%.o: OPT_FLAGS := -Ofast -mlong-calls
|
||||
$(BUILD_DIR)/levels/%.o: OPT_FLAGS := -Ofast -mlong-calls
|
||||
ifeq ($(SDATA),1)
|
||||
$(BUILD_DIR)/actors/%.o: CFLAGS += -G 0
|
||||
$(BUILD_DIR)/levels/%.o: CFLAGS += -G 0
|
||||
endif
|
||||
else ifeq ($(COMPILER),clang)
|
||||
CC := clang
|
||||
CXX := clang++
|
||||
endif
|
||||
# Prefer gcc's cpp if installed on the system
|
||||
ifneq (,$(call find-command,cpp-10))
|
||||
CPP := cpp-10
|
||||
|
||||
ARCH := $(shell uname -p)
|
||||
|
||||
# Check processor architecture. ARM users need a different binutils package.
|
||||
ifeq ($(ARCH), arm)
|
||||
LD := tools/mips64-elf-ld-arm
|
||||
else
|
||||
CPP := cpp
|
||||
endif
|
||||
ifneq ($(call find-command,mips-n64-ld),)
|
||||
LD := mips-n64-ld
|
||||
else
|
||||
LD := tools/mips64-elf-ld
|
||||
ifneq ($(call find-command,mips-n64-ld),)
|
||||
LD := mips-n64-ld
|
||||
else
|
||||
LD := tools/mips64-elf-ld
|
||||
endif
|
||||
endif
|
||||
AR := $(CROSS)ar
|
||||
OBJDUMP := $(CROSS)objdump
|
||||
@@ -518,32 +464,35 @@ endif
|
||||
C_DEFINES := $(foreach d,$(DEFINES),-D$(d))
|
||||
DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES)
|
||||
|
||||
# Prefer gcc's cpp if installed on the system
|
||||
ifneq (,$(call find-command,clang))
|
||||
CPP := clang
|
||||
CPPFLAGS := -E -P -x c -Wno-trigraphs $(DEF_INC_CFLAGS)
|
||||
else ifneq (,$(call find-command,cpp-10))
|
||||
CPP := cpp-10
|
||||
CPPFLAGS := -P -Wno-trigraphs $(DEF_INC_CFLAGS)
|
||||
else
|
||||
CPP := cpp
|
||||
CPPFLAGS := -P -Wno-trigraphs $(DEF_INC_CFLAGS)
|
||||
endif
|
||||
|
||||
# C compiler options
|
||||
CFLAGS = $(OPT_FLAGS) $(TARGET_CFLAGS) $(MIPSISET) $(DEF_INC_CFLAGS)
|
||||
CFLAGS = -std=gnu17 -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) $(MIPSISET) $(DEF_INC_CFLAGS)
|
||||
ifeq ($(COMPILER),gcc)
|
||||
CFLAGS += -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra -Wno-missing-braces
|
||||
CFLAGS += -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
|
||||
CFLAGS += -Wno-missing-braces
|
||||
else ifeq ($(COMPILER),clang)
|
||||
CFLAGS += -mfpxx -target mips -mabi=32 -mhard-float -fomit-frame-pointer -fno-stack-protector -fno-common -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra -Wno-missing-braces
|
||||
CFLAGS += -mfpxx -target mips -mabi=32 -G 0 -mhard-float -fomit-frame-pointer -fno-stack-protector -fno-common -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
|
||||
CFLAGS += -Wno-missing-braces
|
||||
else
|
||||
CFLAGS += -non_shared -Wab,-r4300_mul -Xcpluscomm -Xfullwarn -signed -32
|
||||
endif
|
||||
ASMFLAGS = -G 3 $(OPT_FLAGS) $(TARGET_CFLAGS) -mips3 $(DEF_INC_CFLAGS) -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
|
||||
|
||||
ifeq ($(SDATA),1)
|
||||
ASMFLAGS += -G 3
|
||||
else
|
||||
CFLAGS += -G 0
|
||||
ifeq ($(COMPILER),gcc)
|
||||
CFLAGS += -fno-zero-initialized-in-bss
|
||||
endif
|
||||
ASMFLAGS += -G 0
|
||||
endif
|
||||
ASMFLAGS = -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) -mips3 $(DEF_INC_CFLAGS) -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
|
||||
|
||||
ASFLAGS := -march=vr4300 -mabi=32 $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(foreach d,$(DEFINES),--defsym $(d))
|
||||
RSPASMFLAGS := $(foreach d,$(DEFINES),-definelabel $(subst =, ,$(d)))
|
||||
|
||||
# C preprocessor flags
|
||||
CPPFLAGS := -P -Wno-trigraphs $(DEF_INC_CFLAGS)
|
||||
|
||||
#==============================================================================#
|
||||
# Miscellaneous Tools #
|
||||
@@ -552,6 +501,8 @@ CPPFLAGS := -P -Wno-trigraphs $(DEF_INC_CFLAGS)
|
||||
# N64 tools
|
||||
YAY0TOOL := $(TOOLS_DIR)/slienc
|
||||
MIO0TOOL := $(TOOLS_DIR)/mio0
|
||||
LZ4TPACK := $(TOOLS_DIR)/lz4tpack
|
||||
DEFLATEPACK := $(TOOLS_DIR)/deflatepack
|
||||
RNCPACK := $(TOOLS_DIR)/rncpack
|
||||
FILESIZER := $(TOOLS_DIR)/filesizer
|
||||
N64CKSUM := $(TOOLS_DIR)/n64cksum
|
||||
@@ -565,11 +516,6 @@ EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
|
||||
SKYCONV := $(TOOLS_DIR)/skyconv
|
||||
FIXLIGHTS_PY := $(TOOLS_DIR)/fixlights.py
|
||||
FLIPS := $(TOOLS_DIR)/flips
|
||||
ifeq ($(GZIPVER),std)
|
||||
GZIP := gzip
|
||||
else
|
||||
GZIP := libdeflate-gzip
|
||||
endif
|
||||
# Use the system installed armips if available. Otherwise use the one provided with this repository.
|
||||
ifneq (,$(call find-command,armips))
|
||||
RSPASM := armips
|
||||
@@ -595,9 +541,9 @@ ifneq (,$(wildcard $(LOADER_DIR_FILE_SPECIFICATION_PATH)))
|
||||
LOADER_DIR = $(shell cat $(LOADER_DIR_FILE_SPECIFICATION_PATH))
|
||||
endif
|
||||
ifneq (,$(call find-command,wslview))
|
||||
LOADER_EXEC = $(LOADER_DIR)/UNFLoader.exe
|
||||
UNFLOADER_EXEC = $(LOADER_DIR)/UNFLoader.exe
|
||||
else
|
||||
LOADER_EXEC = $(LOADER_DIR)/UNFLoader
|
||||
UNFLOADER_EXEC = $(LOADER_DIR)/UNFLoader
|
||||
endif
|
||||
|
||||
SHA1SUM = sha1sum
|
||||
@@ -638,12 +584,12 @@ clean:
|
||||
$(RM) -r $(BUILD_DIR_BASE)
|
||||
|
||||
rebuildtools:
|
||||
$(MAKE) -C tools distclean
|
||||
$(MAKE) -C tools
|
||||
"$(MAKE)" -C tools distclean
|
||||
"$(MAKE)" -C tools
|
||||
|
||||
distclean: clean
|
||||
$(PYTHON) extract_assets.py --clean
|
||||
$(MAKE) -C $(TOOLS_DIR) clean
|
||||
"$(MAKE)" -C $(TOOLS_DIR) clean
|
||||
|
||||
test: $(ROM)
|
||||
$(EMULATOR) $(EMU_FLAGS) $<
|
||||
@@ -653,26 +599,33 @@ test-pj64: $(ROM)
|
||||
# someone2639
|
||||
|
||||
# download and extract most recent unfloader build if needed
|
||||
$(LOADER_EXEC):
|
||||
ifeq (,$(wildcard $(LOADER_EXEC)))
|
||||
$(UNFLOADER_EXEC):
|
||||
ifeq (,$(wildcard $(UNFLOADER_EXEC)))
|
||||
@$(PRINT) "Downloading latest UNFLoader...$(NO_COL)\n"
|
||||
$(PYTHON) $(TOOLS_DIR)/get_latest_unfloader.py $(LOADER_DIR)
|
||||
endif
|
||||
|
||||
load: $(ROM) $(LOADER_EXEC)
|
||||
$(LOADER_EXEC) -r $<
|
||||
load: $(ROM) $(UNFLOADER_EXEC)
|
||||
$(UNFLOADER_EXEC) -r $<
|
||||
|
||||
unf: $(ROM) $(LOADER_EXEC)
|
||||
$(LOADER_EXEC) -d -r $<
|
||||
unf: $(ROM) $(UNFLOADER_EXEC)
|
||||
$(UNFLOADER_EXEC) -d -r $<
|
||||
|
||||
libultra: $(BUILD_DIR)/libultra.a
|
||||
|
||||
patch: $(ROM)
|
||||
$(FLIPS) --create --bps $(shell python3 tools/detect_baseroms.py $(VERSION)) $(ROM) $(BUILD_DIR)/$(TARGET_STRING).bps
|
||||
ifeq ($(shell uname), Darwin)
|
||||
ifeq ($(MAKECMDGOALS), patch)
|
||||
$(error "The 'make patch' command is not supported on macOS.")
|
||||
endif
|
||||
else
|
||||
$(FLIPS) --create --bps "$(shell python3 tools/detect_baseroms.py $(VERSION))" "$(ROM)" "$(BUILD_DIR)/$(TARGET_STRING).bps"
|
||||
endif
|
||||
|
||||
# Extra object file dependencies
|
||||
$(BUILD_DIR)/asm/ipl3.o: $(IPL3_RAW_FILES)
|
||||
$(BUILD_DIR)/src/game/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
|
||||
$(BUILD_DIR)/src/game/fasttext.o: $(FASTTEXT_TEXTURE_C_FILES)
|
||||
$(BUILD_DIR)/src/game/version.o: $(BUILD_DIR)/src/game/version_data.h
|
||||
$(BUILD_DIR)/lib/aspMain.o: $(BUILD_DIR)/rsp/audio.bin
|
||||
$(SOUND_BIN_DIR)/sound_data.o: $(SOUND_BIN_DIR)/sound_data.ctl $(SOUND_BIN_DIR)/sound_data.tbl $(SOUND_BIN_DIR)/sequences.bin $(SOUND_BIN_DIR)/bank_sets
|
||||
@@ -684,11 +637,6 @@ endif
|
||||
|
||||
$(CRASH_TEXTURE_C_FILES): TEXTURE_ENCODING := u32
|
||||
|
||||
ifeq ($(COMPILER),gcc)
|
||||
$(BUILD_DIR)/src/libz/%.o: OPT_FLAGS := -Os
|
||||
$(BUILD_DIR)/src/libz/%.o: CFLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-pointer-sign
|
||||
endif
|
||||
|
||||
ifeq ($(VERSION),eu)
|
||||
TEXT_DIRS := text/de text/us text/fr
|
||||
|
||||
@@ -717,13 +665,8 @@ $(BUILD_DIR)/src/usb/usb.o: CFLAGS += -Wno-unused-variable -Wno-sign-compare -Wn
|
||||
$(BUILD_DIR)/src/usb/debug.o: OPT_FLAGS := -O0
|
||||
$(BUILD_DIR)/src/usb/debug.o: CFLAGS += -Wno-unused-parameter -Wno-maybe-uninitialized
|
||||
# File specific opt flags
|
||||
ifeq ($(SDATA),1)
|
||||
$(BUILD_DIR)/src/audio/heap.o: OPT_FLAGS := -Os -fno-jump-tables -ffunction-sections -fdata-sections
|
||||
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -Os -fno-jump-tables -ffunction-sections -fdata-sections
|
||||
else
|
||||
$(BUILD_DIR)/src/audio/heap.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
endif
|
||||
$(BUILD_DIR)/src/audio/heap.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
|
||||
$(BUILD_DIR)/src/engine/surface_collision.o: OPT_FLAGS := $(COLLISION_OPT_FLAGS)
|
||||
$(BUILD_DIR)/src/engine/math_util.o: OPT_FLAGS := $(MATH_UTIL_OPT_FLAGS)
|
||||
@@ -734,7 +677,7 @@ $(BUILD_DIR)/src/game/rendering_graph_node.o: OPT_FLAGS := $(GRAPH_NODE_OPT_FLAG
|
||||
# $(info MATH_UTIL_OPT_FLAGS: $(MATH_UTIL_OPT_FLAGS))
|
||||
# $(info GRAPH_NODE_OPT_FLAGS: $(GRAPH_NODE_OPT_FLAGS))
|
||||
|
||||
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) asm/debug $(GODDARD_SRC_DIRS) $(LIBZ_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
|
||||
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) asm/debug $(GODDARD_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
|
||||
|
||||
# Make sure build directory exists before compiling anything
|
||||
DUMMY != mkdir -p $(ALL_DIRS)
|
||||
@@ -757,9 +700,13 @@ $(BUILD_DIR)/%: %.png
|
||||
$(call print,Converting:,$<,$@)
|
||||
$(V)$(N64GRAPHICS) -s raw -i $@ -g $< -f $(lastword $(subst ., ,$@))
|
||||
|
||||
$(BUILD_DIR)/%.preswap.inc.c: %.preswap.png
|
||||
$(call print,Converting:,$<,$@)
|
||||
$(V)$(N64GRAPHICS) -s $(TEXTURE_ENCODING) -i $@ -g $< -f $(lastword ,$(subst ., ,$*)) -S
|
||||
|
||||
$(BUILD_DIR)/%.inc.c: %.png
|
||||
$(call print,Converting:,$<,$@)
|
||||
$(V)$(N64GRAPHICS) -s $(TEXTURE_ENCODING) -i $@ -g $< -f $(lastword ,$(subst ., ,$(basename $<)))
|
||||
$(V)$(N64GRAPHICS) -s $(TEXTURE_ENCODING) -i $@ -g $< -f $(lastword ,$(subst ., ,$*))
|
||||
|
||||
# Color Index CI8
|
||||
$(BUILD_DIR)/%.ci8.inc.c: %.ci8.png
|
||||
@@ -807,6 +754,8 @@ else ifeq ($(COMPRESS),yay0)
|
||||
include compression/yay0rules.mk
|
||||
else ifeq ($(COMPRESS),mio0)
|
||||
include compression/mio0rules.mk
|
||||
else ifeq ($(COMPRESS),lz4t)
|
||||
include compression/lz4trules.mk
|
||||
else ifeq ($(COMPRESS),uncomp)
|
||||
include compression/uncomprules.mk
|
||||
endif
|
||||
@@ -905,23 +854,9 @@ ifeq ($(FIXLIGHTS),1)
|
||||
DUMMY != $(PYTHON) $(FIXLIGHTS_PY) actors
|
||||
DUMMY != $(PYTHON) $(FIXLIGHTS_PY) levels
|
||||
endif
|
||||
|
||||
ifeq ($(SDATA),1)
|
||||
$(BUILD_DIR)/src/boot/%.o: src/boot/%.c
|
||||
$(call print,Compiling Boot:,$<,$@)
|
||||
$(V)$(CC) -c -G 0 $(CFLAGS) -MMD -MF $(BUILD_DIR)/src/boot/$*.d -o $@ $<
|
||||
$(BUILD_DIR)/src/%.o: src/%.c
|
||||
$(call print,Compiling:,$<,$@)
|
||||
$(V)$(CC) -c -G 64 $(CFLAGS) -MMD -MF $(BUILD_DIR)/src/$*.d -o $@ $<
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
$(call print,Compiling:,$<,$@)
|
||||
$(V)$(CC) -c -G 0 -fno-zero-initialized-in-bss $(CFLAGS) -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<
|
||||
else
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
$(call print,Compiling:,$<,$@)
|
||||
$(V)$(CC) -c $(CFLAGS) -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/%.o: %.cpp
|
||||
$(call print,Compiling (C++):,$<,$@)
|
||||
$(V)$(CXX) -c $(CFLAGS) -std=c++17 -Wno-register -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<
|
||||
@@ -949,13 +884,8 @@ $(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
|
||||
@$(PRINT) "$(GREEN)Linking libgoddard: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(AR) rcs -o $@ $(GODDARD_O_FILES)
|
||||
|
||||
# Link libz
|
||||
$(BUILD_DIR)/libz.a: $(LIBZ_O_FILES)
|
||||
@$(PRINT) "$(GREEN)Linking libz: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(AR) rcs -o $@ $(LIBZ_O_FILES)
|
||||
|
||||
# SS2: Goddard rules to get size
|
||||
$(BUILD_DIR)/sm64_prelim.ld: sm64.ld $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/libgoddard.a $(BUILD_DIR)/libz.a
|
||||
$(BUILD_DIR)/sm64_prelim.ld: sm64.ld $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/libgoddard.a
|
||||
$(call print,Preprocessing preliminary linker script:,$<,$@)
|
||||
$(V)$(CPP) $(CPPFLAGS) -DPRELIMINARY=1 -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) -MMD -MP -MT $@ -MF $@.d -o $@ $<
|
||||
|
||||
@@ -965,7 +895,7 @@ $(BUILD_DIR)/sm64_prelim.elf: $(BUILD_DIR)/sm64_prelim.ld
|
||||
|
||||
$(BUILD_DIR)/goddard.txt: $(BUILD_DIR)/sm64_prelim.elf
|
||||
$(call print,Getting Goddard size...)
|
||||
$(V)python3 tools/getGoddardSize.py $(BUILD_DIR)/sm64_prelim.map $(VERSION)
|
||||
$(V)python3 tools/getGoddardSize.py $(BUILD_DIR)/sm64_prelim.map $(BUILD_DIR)
|
||||
|
||||
$(BUILD_DIR)/asm/debug/map.o: asm/debug/map.s $(BUILD_DIR)/sm64_prelim.elf
|
||||
$(call print,Assembling:,$<,$@)
|
||||
@@ -973,7 +903,7 @@ $(BUILD_DIR)/asm/debug/map.o: asm/debug/map.s $(BUILD_DIR)/sm64_prelim.elf
|
||||
$(V)$(CROSS)gcc -c $(ASMFLAGS) $(foreach i,$(INCLUDE_DIRS),-Wa,-I$(i)) -x assembler-with-cpp -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<
|
||||
|
||||
# Link SM64 ELF file
|
||||
$(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(BUILD_DIR)/libz.a $(BUILD_DIR)/libgoddard.a
|
||||
$(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(BUILD_DIR)/libgoddard.a
|
||||
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc
|
||||
|
||||
|
||||
@@ -270,3 +270,6 @@ IPL3_RAW_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%,$(IP
|
||||
|
||||
CRASH_TEXTURE_FILES := $(wildcard $(TEXTURE_DIR)/crash_custom/*.png)
|
||||
CRASH_TEXTURE_C_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.inc.c,$(CRASH_TEXTURE_FILES)))
|
||||
|
||||
FASTTEXT_TEXTURE_FILES := $(wildcard $(TEXTURE_DIR)/fasttext/*.png)
|
||||
FASTTEXT_TEXTURE_C_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.inc.c,$(FASTTEXT_TEXTURE_FILES)))
|
||||
|
||||
17
README.md
17
README.md
@@ -4,9 +4,9 @@
|
||||
|
||||
HackerSM64 now has a discord server! https://discord.gg/brETAakcXr
|
||||
|
||||
This repo requires BOTH a US ROM and a JP ROM in order to build. Place baserom.us.z64 in the repo as usual and ALSO include baserom.jp.z64.
|
||||
This repo requires a US ROM in order to build. JP/EU ROMs are optional for some assets.
|
||||
|
||||
This repo needs gcc in order to be able to build it. To install it, run `sudo apt install gcc-mips-linux-gnu`
|
||||
[How to install everything needed and build HackerSM64](https://github.com/HackerN64/HackerSM64/wiki/Installing-HackerSM64)
|
||||
|
||||
This is a fork of the ultrasm64 repo by CrashOveride which includes the following commonly used patches (patches marked with `*` are toggleable in the config files):
|
||||
|
||||
@@ -118,7 +118,6 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
|
||||
- This repo supports a much better implementation of reverb over vanilla's fake echo reverb. Great for caves or eerie levels, as well as just a better audio experience in general. See `audio/synthesis.c` for more details and configuration info. (By ArcticJaguar725) *
|
||||
- Fazana's "puppyprint" text engine. *
|
||||
- Use `print_small_text` to print normal text. The two last params are aligment and how many characters to print (-1 means PRINT_ALL).
|
||||
- Use `render_multi_image` to draw large texture rectangles consisting of multiple images on the screen.
|
||||
- More info in `puppyprint.c`
|
||||
- Wiseguy's Farcall TLB mapping allows to store executable code inside uncompressed segments, that can be loaded and ran as needed, instead of it having to be loaded at all times. See `farcall.h` in the include folder for instructions and details.
|
||||
- Red Coin Stars now support up to 99 red coins! In addition, multi-area red coin missions can now be created by setting the 2nd behavior paramater of the red coin star to the number of reds required for the star to spawn.
|
||||
@@ -139,14 +138,6 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
|
||||
- Separate defines for emulator and console black border height.
|
||||
- Getting HVQM FMV support to work with the game is WIP.
|
||||
|
||||
Requirements are the same as regular SM64, however a GCC MIPS cross compiler is also required. If you're on Debian-like Linux, you can use the ``gcc-mips-linux-gnu`` package. The toolchain that comes with my SDK is also supported.
|
||||
|
||||
## Additional Prerequisites
|
||||
|
||||
BinPNG (the CI texture converter) requires some python3 dependencies. Use pip to install them.
|
||||
|
||||
``pip install pypng bitstring``
|
||||
|
||||
## UNFLoader support
|
||||
|
||||
The repository supports UNFLoader for debugging.
|
||||
@@ -207,7 +198,3 @@ Thanks to "someone2639" for this hacky-ass idea
|
||||
Q: Will this allow me to use FlashRAM/Transfer Pak/microcode swapping/Other Cool N64 Features?
|
||||
|
||||
A: Theoretically, all yes.
|
||||
|
||||
## Installation help
|
||||
|
||||
Go read the original SM64 repo README.md
|
||||
|
||||
11
asm/emux.s
11
asm/emux.s
@@ -1,11 +0,0 @@
|
||||
// Detect if the emux emulator extension is supported
|
||||
// https://hackmd.io/@rasky/r1k7na6Jn
|
||||
|
||||
.include "macros.inc"
|
||||
.section .text, "ax"
|
||||
.set noreorder
|
||||
|
||||
glabel emux_detect
|
||||
or $v0, $0, $0
|
||||
jr $ra
|
||||
tne $v0, $v0, 0x0
|
||||
@@ -1,14 +0,0 @@
|
||||
// Used as part of emulator detection. The dynarec core of PJ64 4.0 only updates
|
||||
// the COUNT register in between recompiled functions, so this will return 0 on
|
||||
// PJ64 4.0 dynarec, but will instead return the count factor on other versions.
|
||||
|
||||
.include "macros.inc"
|
||||
.section .text, "ax"
|
||||
.set noreorder
|
||||
|
||||
.balign 32
|
||||
glabel pj64_get_count_factor_asm
|
||||
mfc0 $t0, $9 // $9 is the COUNT register
|
||||
mfc0 $t1, $9
|
||||
jr $ra
|
||||
subu $v0, $t1, $t0
|
||||
@@ -14,7 +14,7 @@
|
||||
.word 0x00000000 /* Checksum 2 */
|
||||
.word 0x00000000 /* Unknown */
|
||||
.word 0x00000000 /* Unknown */
|
||||
.ascii INTERNAL_ROM_NAME /* Internal ROM name */
|
||||
.ascii INTERNAL_ROM_NAME /* Internal ROM name */
|
||||
#if defined(EMU_DEFAULT_TO_GCN)
|
||||
/* Advanced homebrew ROM header bytes: https://n64brew.dev/wiki/ROM_Header#Advanced_Homebrew_ROM_Header */
|
||||
.word 0x82000000
|
||||
@@ -22,11 +22,8 @@
|
||||
.word 0x00000000 /* Unknown */
|
||||
#endif
|
||||
.word 0x0000004E /* Cartridge */
|
||||
#if defined(EEP4K) && !defined(EMU_DEFAULT_TO_GCN)
|
||||
.ascii "SM" /* Cartridge ID */
|
||||
#else
|
||||
|
||||
.ascii "ED" /* Cartridge ID */
|
||||
#endif
|
||||
|
||||
/* Region */
|
||||
#if defined(VERSION_JP) || defined(VERSION_SH)
|
||||
@@ -35,14 +32,21 @@
|
||||
.ascii "E" /* NTSC-U (North America) */
|
||||
#endif
|
||||
|
||||
#if defined(SRAM)
|
||||
.byte 0x32 /* Version */
|
||||
#elif defined(EEP16K)
|
||||
.byte 0x22 /* Version */
|
||||
#elif defined(SRAM768K)
|
||||
.byte 0x42 /* Version */
|
||||
#elif defined(FLASHRAM)
|
||||
.byte 0x52 /* Version */
|
||||
#if defined(USE_RTC)
|
||||
#define RTC_BIT 0x1
|
||||
#else
|
||||
.byte 0x12 /* Version */
|
||||
#define RTC_BIT 0x0
|
||||
#endif
|
||||
|
||||
/* Savetype, region, and RTC */
|
||||
#if defined(SRAM)
|
||||
.byte 0x32 | RTC_BIT
|
||||
#elif defined(EEP16K)
|
||||
.byte 0x22 | RTC_BIT
|
||||
#elif defined(SRAM768K)
|
||||
.byte 0x42 | RTC_BIT
|
||||
#elif defined(FLASHRAM)
|
||||
.byte 0x52 | RTC_BIT
|
||||
#else
|
||||
.byte 0x12 | RTC_BIT
|
||||
#endif
|
||||
|
||||
18
asm/setgp.s
18
asm/setgp.s
@@ -1,18 +0,0 @@
|
||||
#ifdef SDATA
|
||||
|
||||
// assembler directives
|
||||
.set noat // allow manual use of $at
|
||||
.set noreorder // don't insert nops after branches
|
||||
.set gp=64
|
||||
|
||||
#include "macros.inc"
|
||||
|
||||
|
||||
.section .text, "ax"
|
||||
|
||||
glabel setgp
|
||||
lui $gp, %hi(_gp)
|
||||
jr $ra
|
||||
addiu $gp, %lo(_gp)
|
||||
|
||||
#endif
|
||||
11
assets.json
11
assets.json
@@ -1861,10 +1861,6 @@
|
||||
"textures/water/jrb_textures.0A000.rgba16.png": [32,32,2048,{"jp":[3354832,40960],"us":[3361584,40960],"eu":[3235184,40960],"sh":[3209552,40960]}],
|
||||
"textures/water/jrb_textures.0A800.rgba16.png": [64,32,4096,{"jp":[3354832,43008],"us":[3361584,43008],"eu":[3235184,43008],"sh":[3209552,43008]}],
|
||||
"textures/water/jrb_textures.0B800.rgba16.png": [64,32,4096,{"jp":[3354832,47104],"us":[3361584,47104],"eu":[3235184,47104],"sh":[3209552,47104]}],
|
||||
"sound/samples/bowser_organ/00_organ_1.aiff": [0,{"jp":["@sound",195],"us":["@sound",216],"eu":["@sound",216]}],
|
||||
"sound/samples/bowser_organ/01_organ_1_lq.aiff": [0,{"jp":["@sound",196],"us":["@sound",217],"eu":["@sound",217]}],
|
||||
"sound/samples/bowser_organ/02_boys_choir.aiff": [0,{"jp":["@sound",197],"us":["@sound",218],"eu":["@sound",218]}],
|
||||
"sound/samples/course_start/00_la.aiff": [0,{"jp":["@sound",194],"us":["@sound",215],"eu":["@sound",215]}],
|
||||
"sound/samples/instruments/00.aiff": [0,{"jp":["@sound",120],"us":["@sound",141],"eu":["@sound",141],"sh":["@sound",141]}],
|
||||
"sound/samples/instruments/01_banjo_1.aiff": [0,{"jp":["@sound",121],"us":["@sound",142],"eu":["@sound",142],"sh":["@sound",142]}],
|
||||
"sound/samples/instruments/02.aiff": [0,{"jp":["@sound",122],"us":["@sound",143],"eu":["@sound",143],"sh":["@sound",143]}],
|
||||
@@ -1918,8 +1914,8 @@
|
||||
"sound/samples/instruments/32_metal_rimshot.aiff": [0,{"jp":["@sound",170],"us":["@sound",191],"eu":["@sound",191],"sh":["@sound",191]}],
|
||||
"sound/samples/instruments/33_kick_drum_2.aiff": [0,{"jp":["@sound",171],"us":["@sound",192],"eu":["@sound",192],"sh":["@sound",192]}],
|
||||
"sound/samples/instruments/34_alto_flute.aiff": [0,{"jp":["@sound",172],"us":["@sound",193],"eu":["@sound",193],"sh":["@sound",193]}],
|
||||
"sound/samples/instruments/34b_organ.aiff": [0,{"sh":["@sound",194]}],
|
||||
"sound/samples/instruments/34c_organ_lq.aiff": [0,{"sh":["@sound",195]}],
|
||||
"sound/samples/instruments/34b_organ.aiff": [0,{"jp":["@sound",195],"us":["@sound",216],"eu":["@sound",216],"sh":["@sound",194]}],
|
||||
"sound/samples/instruments/34c_organ_lq.aiff": [0,{"jp":["@sound",196],"us":["@sound",217],"eu":["@sound",217],"sh":["@sound",195]}],
|
||||
"sound/samples/instruments/35_gospel_organ.aiff": [0,{"jp":["@sound",173],"us":["@sound",194],"eu":["@sound",194],"sh":["@sound",196]}],
|
||||
"sound/samples/instruments/36_sawtooth_synth.aiff": [0,{"jp":["@sound",174],"us":["@sound",195],"eu":["@sound",195],"sh":["@sound",197]}],
|
||||
"sound/samples/instruments/37_square_synth.aiff": [0,{"jp":["@sound",175],"us":["@sound",196],"eu":["@sound",196],"sh":["@sound",198]}],
|
||||
@@ -1937,11 +1933,10 @@
|
||||
"sound/samples/instruments/43_harmonica.aiff": [0,{"jp":["@sound",187],"us":["@sound",208],"eu":["@sound",208],"sh":["@sound",210]}],
|
||||
"sound/samples/instruments/44_grand_piano.aiff": [0,{"jp":["@sound",188],"us":["@sound",209],"eu":["@sound",209],"sh":["@sound",211]}],
|
||||
"sound/samples/instruments/45_french_horns_lq.aiff": [0,{"jp":["@sound",189],"us":["@sound",210],"eu":["@sound",210],"sh":["@sound",212]}],
|
||||
"sound/samples/instruments/45b_la.aiff": [0,{"sh":["@sound",213]}],
|
||||
"sound/samples/instruments/45b_la.aiff": [0,{"jp":["@sound",194],"us":["@sound",215],"eu":["@sound",215],"sh":["@sound",213]}],
|
||||
"sound/samples/instruments/46_pizzicato_strings_1.aiff": [0,{"jp":["@sound",190],"us":["@sound",211],"eu":["@sound",211],"sh":["@sound",214]}],
|
||||
"sound/samples/instruments/47_pizzicato_strings_2.aiff": [0,{"jp":["@sound",191],"us":["@sound",212],"eu":["@sound",212],"sh":["@sound",215]}],
|
||||
"sound/samples/instruments/48_steel_drum.aiff": [0,{"jp":["@sound",192],"us":["@sound",213],"eu":["@sound",213],"sh":["@sound",216]}],
|
||||
"sound/samples/piranha_music_box/00_music_box.aiff": [0,{"jp":["@sound",193],"us":["@sound",214],"eu":["@sound",214]}],
|
||||
"sound/samples/sfx_1/00_twirl.aiff": [0,{"jp":["@sound",0],"us":["@sound",0],"eu":["@sound",0],"sh":["@sound",0]}],
|
||||
"sound/samples/sfx_1/01_brushing.aiff": [0,{"jp":["@sound",1],"us":["@sound",1],"eu":["@sound",1],"sh":["@sound",1]}],
|
||||
"sound/samples/sfx_1/02_hand_touch.aiff": [0,{"jp":["@sound",2],"us":["@sound",2],"eu":["@sound",2],"sh":["@sound",2]}],
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
// SM64 (US/JP/EU/SH) Segment 02
|
||||
#ifdef PUPPYPRINT
|
||||
ALIGNED8 static const Texture small_font_default[] = {
|
||||
#include "textures/segment2/custom_text.i4.inc.c"
|
||||
#include "textures/segment2/custom_text.i4.preswap.inc.c"
|
||||
};
|
||||
ALIGNED8 static const Texture small_font_outline[] = {
|
||||
#include "textures/segment2/custom_text2.ia4.inc.c"
|
||||
#include "textures/segment2/custom_text2.ia4.preswap.inc.c"
|
||||
};
|
||||
ALIGNED8 static const Texture small_font_plain[] = {
|
||||
#include "textures/segment2/custom_text3.i4.inc.c"
|
||||
#include "textures/segment2/custom_text3.i4.preswap.inc.c"
|
||||
};
|
||||
ALIGNED8 static const Texture small_font_vanilla[] = {
|
||||
#include "textures/segment2/custom_text4.i4.inc.c"
|
||||
#include "textures/segment2/custom_text4.i4.preswap.inc.c"
|
||||
};
|
||||
|
||||
const u8 small_font_kerning_default[] = {
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
# Compress binary file to gzip
|
||||
$(BUILD_DIR)/%.gz: $(BUILD_DIR)/%.bin
|
||||
# Compress binary file
|
||||
$(BUILD_DIR)/%.szp: $(BUILD_DIR)/%.bin
|
||||
$(call print,Compressing:,$<,$@)
|
||||
ifeq ($(GZIPVER),std)
|
||||
$(V)$(GZIP) -c -9 -n $< > $@
|
||||
else
|
||||
$(V)$(GZIP) -c -12 -n $< > $@
|
||||
endif
|
||||
|
||||
# Strip gzip header
|
||||
$(BUILD_DIR)/%.szp: $(BUILD_DIR)/%.gz
|
||||
$(call print,Converting:,$<,$@)
|
||||
$(V)dd bs=10 skip=1 if=$< of=$(<:.gz=.gz.strip) status=none
|
||||
$(V)$(FILESIZER) $(<:.gz=.gz.strip) $@ `stat --format="%s" $(<:.gz=.bin)`
|
||||
$(V)$(DEFLATEPACK) $< $@
|
||||
|
||||
# convert binary szp to object file
|
||||
$(BUILD_DIR)/%.szp.o: $(BUILD_DIR)/%.szp
|
||||
$(call print,Converting GZIP to ELF:,$<,$@)
|
||||
$(call print,Converting deflate to ELF:,$<,$@)
|
||||
$(V)$(LD) -r -b binary $< -o $@
|
||||
|
||||
9
compression/lz4trules.mk
Normal file
9
compression/lz4trules.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
# Compress binary file
|
||||
$(BUILD_DIR)/%.szp: $(BUILD_DIR)/%.bin
|
||||
$(call print,Compressing:,$<,$@)
|
||||
$(V)$(LZ4TPACK) $< $@
|
||||
|
||||
# convert binary szp to object file
|
||||
$(BUILD_DIR)/%.szp.o: $(BUILD_DIR)/%.szp
|
||||
$(call print,Converting LZ4T to ELF:,$<,$@)
|
||||
$(V)$(LD) -r -b binary $< -o $@
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
from tools.detect_baseroms import get_rom_candidates
|
||||
from tools.detect_baseroms import get_rom_candidates, ROMS_DIR
|
||||
|
||||
envmap_table = set([
|
||||
"actors/mario/mario_metal.rgba16.png",
|
||||
@@ -65,7 +65,7 @@ def remove_file(fname):
|
||||
def clean_assets(local_asset_file):
|
||||
assets = set(read_asset_map().keys())
|
||||
assets.update(read_local_asset_list(local_asset_file))
|
||||
for fname in list(assets) + [".assets-local.txt"]:
|
||||
for fname in list(assets):
|
||||
if fname.startswith("@"):
|
||||
continue
|
||||
try:
|
||||
@@ -73,6 +73,19 @@ def clean_assets(local_asset_file):
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
if local_asset_file is not None:
|
||||
local_asset_file.close()
|
||||
remove_file(".assets-local.txt")
|
||||
|
||||
def usage():
|
||||
all_langs = ["jp", "us", "eu", "sh"]
|
||||
langs_str = " ".join("[" + lang + "]" for lang in all_langs)
|
||||
print("Usage: ")
|
||||
print(f" Show this help message: {sys.argv[0]} --help")
|
||||
print(f" Extract from all found baseroms: {sys.argv[0]}")
|
||||
print(f" Extract from specified versions: {sys.argv[0]} {langs_str}")
|
||||
print(f" (For each version, its ROM file must exist,")
|
||||
print(f" either in this folder or {ROMS_DIR}/)")
|
||||
|
||||
def main():
|
||||
# In case we ever need to change formats of generated files, we keep a
|
||||
@@ -91,6 +104,9 @@ def main():
|
||||
if langs == ["--clean"]:
|
||||
clean_assets(local_asset_file)
|
||||
sys.exit(0)
|
||||
elif langs == ["--help"] or langs == ["-h"]:
|
||||
usage()
|
||||
sys.exit(0)
|
||||
|
||||
asset_map = read_asset_map()
|
||||
all_assets = []
|
||||
@@ -112,6 +128,8 @@ def main():
|
||||
|
||||
romLUT = get_rom_candidates()
|
||||
|
||||
if not langs:
|
||||
langs = romLUT.keys()
|
||||
|
||||
# verify the correct rom
|
||||
for lang in langs:
|
||||
@@ -134,7 +152,6 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
# Late imports (to optimize startup perf)
|
||||
import hashlib
|
||||
import tempfile
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include "config/config_objects.h"
|
||||
#include "config/config_rom.h"
|
||||
|
||||
// Local config - include a gitignore'd config file that's specific to just the user (if the file exists)
|
||||
#if __has_include("config/config_local.h")
|
||||
// Local config - include a gitignore'd config file that's specific to just the user (if the file exists). Ignored for release builds.
|
||||
#if __has_include("config/config_local.h") && !defined(DISABLE_ALL)
|
||||
#include "config/config_local.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
|
||||
/**
|
||||
* Forces the camera mode to your choice (except when swimming or flying).
|
||||
* It does this by setting the area's camera->defMode to this mode, and also
|
||||
* changes hardcoded modes to use c->defMode.
|
||||
* Note: removes door cutscenes due to the way they're designed to work with specific modes.
|
||||
* Search for FORCED_CAMERA_MODE in camera.c for more information.
|
||||
* It does this by setting the area's camera->defMode to this mode.
|
||||
*/
|
||||
#define FORCED_CAMERA_MODE CAMERA_MODE_8_DIRECTIONS
|
||||
|
||||
@@ -60,17 +57,9 @@
|
||||
/***** Vanilla config options *****/
|
||||
/**********************************/
|
||||
|
||||
/**
|
||||
* Included for ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS define.
|
||||
*/
|
||||
#include "config_game.h"
|
||||
|
||||
/**
|
||||
* Allow course specific camera processing.
|
||||
* You will likely want this disabled in non-vanilla hacks.
|
||||
* This is automatically enabled when ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS is enabled,
|
||||
* but feel free to override it if you really want to for some reason.
|
||||
* Enabling this will automatically disable FORCED_CAMERA_MODE and USE_COURSE_DEFAULT_MODE.
|
||||
*/
|
||||
#ifdef ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS
|
||||
#define ENABLE_VANILLA_CAM_PROCESSING
|
||||
#endif
|
||||
// #define ENABLE_VANILLA_CAM_PROCESSING
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
/**
|
||||
* May break viewport widescreen hacks.
|
||||
* When this is disabled, the culling will only be skipped according to the NO_CULLING_EMULATOR_BLACKLIST.
|
||||
* When this is disabled, the culling will only be skipped according to the NO_CULLING_EMULATOR_WHITELIST.
|
||||
*/
|
||||
// #define CULLING_ON_EMULATOR
|
||||
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
*/
|
||||
#define INTERNAL_ROM_NAME "HackerSM64 "
|
||||
|
||||
/**
|
||||
* Enable the realtime clock (RTC)
|
||||
* See lib/librtc/librtc.h for RTC related functions
|
||||
*/
|
||||
// #define USE_RTC
|
||||
|
||||
/**
|
||||
* Force the game to delete any existing save data originating from a different hack. This requires INTERNAL_ROM_NAME to be unique to work properly.
|
||||
* It is recommended to enable this if any significant changes to the save file are made that could cause issues with this or other hacks.
|
||||
|
||||
@@ -122,6 +122,11 @@
|
||||
* config_camera.h
|
||||
*/
|
||||
|
||||
#ifdef ENABLE_VANILLA_CAM_PROCESSING
|
||||
#undef FORCED_CAMERA_MODE
|
||||
#undef USE_COURSE_DEFAULT_MODE
|
||||
#endif // ENABLE_VANILLA_CAM_PROCESSING
|
||||
|
||||
#ifdef FORCED_CAMERA_MODE
|
||||
#undef USE_COURSE_DEFAULT_MODE
|
||||
#define USE_COURSE_DEFAULT_MODE // Forced camera mode overwrites the default mode.
|
||||
|
||||
@@ -331,24 +331,43 @@ enum GeoLayoutCommands {
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* 0x14: Create billboarding node with optional display list
|
||||
* 0x14: Create billboarding node with optional display list. Axis vector must
|
||||
* be non-zero when using cylindrical billboarding.
|
||||
* 0x01: u8 params
|
||||
* 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
* 0b0000_1111: drawingLayer
|
||||
* 0x02: s16 xTranslation
|
||||
* 0x04: s16 yTranslation
|
||||
* 0x06: s16 zTranslation
|
||||
* 0x08: [u32 displayList: if MSbit of params is set, display list segmented address]
|
||||
* 0x02: u8 isCylindrical: if set, use cylindical billboarding
|
||||
* 0x03: unused
|
||||
* 0x04: s16 xTranslation
|
||||
* 0x06: s16 yTranslation
|
||||
* 0x08: s16 zTranslation
|
||||
* 0x0A: s16 xAxis
|
||||
* 0x0C: s16 yAxis
|
||||
* 0x0E: s16 zAxis
|
||||
* 0x10: [u32 displayList: if MSbit of params is set, display list segmented address]
|
||||
*/
|
||||
#define GEO_BILLBOARD_WITH_PARAMS(layer, tx, ty, tz) \
|
||||
CMD_BBH(GEO_CMD_NODE_BILLBOARD, layer, tx), \
|
||||
CMD_HH(ty, tz)
|
||||
#define GEO_BILLBOARD_WITH_PARAMS_AND_DL(layer, tx, ty, tz, displayList) \
|
||||
CMD_BBH(GEO_CMD_NODE_BILLBOARD, (layer | 0x80), tx), \
|
||||
CMD_HH(ty, tz), \
|
||||
#define GEO_BILLBOARD_WITH_MODE(layer, isCylindrical, tx, ty, tz, ax, ay, az) \
|
||||
CMD_BBBB(GEO_CMD_NODE_BILLBOARD, layer, isCylindrical, 0x00), \
|
||||
CMD_HH(tx, ty), \
|
||||
CMD_HH(tz, ax), \
|
||||
CMD_HH(ay, az)
|
||||
#define GEO_BILLBOARD_WITH_MODE_AND_DL(layer, isCylindrical, tx, ty, tz, ax, ay, az, displayList) \
|
||||
CMD_BBBB(GEO_CMD_NODE_BILLBOARD, (0x80 | layer), isCylindrical, 0x00), \
|
||||
CMD_HH(tx, ty), \
|
||||
CMD_HH(tz, ax), \
|
||||
CMD_HH(ay, az), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
#define GEO_BILLBOARD_WITH_PARAMS(layer, tx, ty, tz) \
|
||||
GEO_BILLBOARD_WITH_MODE(layer, FALSE, tx, ty, tz, 0, 0, 0)
|
||||
#define GEO_BILLBOARD_WITH_PARAMS_AND_DL(layer, tx, ty, tz, displayList) \
|
||||
GEO_BILLBOARD_WITH_MODE_AND_DL(layer, FALSE, tx, ty, tz, 0, 0, 0, displayList)
|
||||
#define GEO_BILLBOARD() \
|
||||
GEO_BILLBOARD_WITH_PARAMS(0, 0, 0, 0)
|
||||
#define GEO_BILLBOARD_CYLINDRICAL(ax, ay, az) \
|
||||
GEO_BILLBOARD_WITH_MODE(0, TRUE, 0, 0, 0, ax, ay, az)
|
||||
#define GEO_BILLBOARD_CYLINDRICAL_WITH_DL(layer, ax, ay, az, displayList) \
|
||||
GEO_BILLBOARD_WITH_MODE_AND_DL(layer, TRUE, 0, 0, 0, ax, ay, az, displayList)
|
||||
|
||||
/**
|
||||
* 0x15: Create plain display list scene graph node
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user