diff --git a/Dockerfile b/Dockerfile index ca63fa0f2c..302a75fc42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,13 +14,6 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* -RUN wget \ - https://github.com/n64decomp/qemu-irix/releases/download/v2.11-deb/qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb \ - -O qemu.deb && \ - echo 8170f37cf03a08cc2d7c1c58f10d650ea0d158f711f6916da9364f6d8c85f741 qemu.deb | sha256sum --check && \ - dpkg -i qemu.deb && \ - rm qemu.deb - RUN git clone --depth 1 https://github.com/emscripten-core/emsdk.git && \ ./emsdk/emsdk install latest && \ ./emsdk/emsdk activate latest diff --git a/Doxyfile b/Doxyfile index f73f4c637e..8087a237bc 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2089,7 +2089,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = NON_MATCHING AVOID_UB +PREDEFINED = AVOID_UB # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/Jenkinsfile b/Jenkinsfile index eee93a9fce..1d04100265 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,7 +41,7 @@ pipeline { git clean -fd . git checkout -- . echo 'y' | tools/apply_patch.sh "$f" - make -j4 VERSION=us COMPARE=0 + make -j4 VERSION=us done ''' } diff --git a/Makefile b/Makefile index 56404185f5..b0e9e7121f 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,8 @@ default: all VERSION ?= us # Graphics microcode used GRUCODE ?= f3d_old -# If COMPARE is 1, check the output sha1sum when building 'all' -COMPARE ?= 1 -# If NON_MATCHING is 1, define the NON_MATCHING and AVOID_UB macros when building (recommended) -NON_MATCHING ?= 1 + +# Define AVOID_UB macros when building (recommended) # Build and optimize for Raspberry Pi(s) TARGET_RPI ?= 0 @@ -28,25 +26,32 @@ TARGET_WEB ?= 0 # Makeflag to enable OSX fixes OSX_BUILD ?= 0 +# Makeflag to enable Windows fixes +WINDOWS_BUILD ?= 0 + # Specify the target you are building for, TARGET_BITS=0 means native TARGET_ARCH ?= native TARGET_BITS ?= 0 # Disable better camera by default BETTERCAMERA ?= 0 + # Disable no drawing distance by default NODRAWINGDISTANCE ?= 0 + # Disable texture fixes by default (helps with them purists) TEXTURE_FIX ?= 0 + # Enable extended options menu by default EXT_OPTIONS_MENU ?= 1 -# Disable text-based save-files by default + +# Disable text-based save files by default TEXTSAVES ?= 0 + # Load textures from external PNG files EXTERNAL_TEXTURES ?= 0 # Various workarounds for weird toolchains - NO_BZERO_BCOPY ?= 0 NO_LDIV ?= 0 @@ -56,9 +61,7 @@ LEGACY_GL ?= 0 # Automatic settings for PC port(s) -NON_MATCHING := 1 GRUCODE := f3dex2e -WINDOWS_BUILD ?= 0 ifeq ($(TARGET_WEB),0) ifeq ($(OS),Windows_NT) @@ -74,7 +77,7 @@ ifeq ($(WINDOWS_BUILD),1) TARGET_BITS = 32 NO_BZERO_BCOPY := 1 else ifeq ($(CROSS),x86_64-w64-mingw32.static-) - TARGET_ARCH = i386pe + TARGET_ARCH = i386pep TARGET_BITS = 64 NO_BZERO_BCOPY := 1 endif @@ -94,22 +97,19 @@ ifeq ($(VERSION),jp) GRUCODE_CFLAGS := -DF3D_OLD GRUCODE_ASFLAGS := --defsym F3D_OLD=1 TARGET := sm64.jp -else -ifeq ($(VERSION),us) +else ifeq ($(VERSION),us) VERSION_CFLAGS := -DVERSION_US VERSION_ASFLAGS := --defsym VERSION_US=1 GRUCODE_CFLAGS := -DF3D_OLD GRUCODE_ASFLAGS := --defsym F3D_OLD=1 TARGET := sm64.us -else -ifeq ($(VERSION),eu) +else ifeq ($(VERSION),eu) VERSION_CFLAGS := -DVERSION_EU VERSION_ASFLAGS := --defsym VERSION_EU=1 GRUCODE_CFLAGS := -DF3D_NEW GRUCODE_ASFLAGS := --defsym F3D_NEW=1 TARGET := sm64.eu -else -ifeq ($(VERSION),sh) +else ifeq ($(VERSION),sh) $(warning Building SH is experimental and is prone to breaking. Try at your own risk.) VERSION_CFLAGS := -DVERSION_SH VERSION_ASFLAGS := --defsym VERSION_SH=1 @@ -121,9 +121,6 @@ ifeq ($(VERSION),sh) else $(error unknown version "$(VERSION)") endif -endif -endif -endif # Stuff for showing the git hash in the intro on nightly builds # From https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source @@ -139,54 +136,40 @@ ifeq ($(GRUCODE),f3dex) # Fast3DEX GRUCODE_CFLAGS := -DF3DEX_GBI GRUCODE_ASFLAGS := --defsym F3DEX_GBI_SHARED=1 --defsym F3DEX_GBI=1 TARGET := $(TARGET).f3dex - COMPARE := 0 -else -ifeq ($(GRUCODE), f3dex2) # Fast3DEX2 +else ifeq ($(GRUCODE), f3dex2) # Fast3DEX2 GRUCODE_CFLAGS := -DF3DEX_GBI_2 GRUCODE_ASFLAGS := --defsym F3DEX_GBI_SHARED=1 --defsym F3DEX_GBI_2=1 TARGET := $(TARGET).f3dex2 - COMPARE := 0 -else -ifeq ($(GRUCODE), f3dex2e) # Fast3DEX2 Extended (PC default) +else ifeq ($(GRUCODE), f3dex2e) # Fast3DEX2 Extended (PC default) GRUCODE_CFLAGS := -DF3DEX_GBI_2E TARGET := $(TARGET).f3dex2e - COMPARE := 0 -else -ifeq ($(GRUCODE),f3d_new) # Fast3D 2.0H (Shindou) +else ifeq ($(GRUCODE),f3d_old) # Fast3D 2.0D (US and JP) + GRUCODE_CFLAGS := -DF3D_OLD + GRUCODE_ASFLAGS := --defsym F3D_OLD=1 + TARGET := $(TARGET).f3d_old +else ifeq ($(GRUCODE),f3d_new) # Fast3D 2.0H (Shindou) GRUCODE_CFLAGS := -DF3D_NEW GRUCODE_ASFLAGS := --defsym F3D_NEW=1 TARGET := $(TARGET).f3d_new - COMPARE := 0 -else -ifeq ($(GRUCODE),f3dzex) # Fast3DZEX (2.0J / Animal Forest - Dōbutsu no Mori) +else ifeq ($(GRUCODE),f3dzex) # Fast3DZEX (2.0J / Animal Forest - Dōbutsu no Mori) $(warning Fast3DZEX is experimental. Try at your own risk.) GRUCODE_CFLAGS := -DF3DEX_GBI_2 GRUCODE_ASFLAGS := --defsym F3DEX_GBI_SHARED=1 --defsym F3DZEX_GBI=1 TARGET := $(TARGET).f3dzex - COMPARE := 0 -endif -endif -endif -endif endif # Default build is for PC now -VERSION_CFLAGS := $(VERSION_CFLAGS) -DNON_MATCHING -DAVOID_UB +VERSION_CFLAGS += -DNON_MATCHING -DAVOID_UB ifeq ($(TARGET_RPI),1) # Define RPi to change SDL2 title & GLES2 hints - VERSION_CFLAGS += -DUSE_GLES -endif - -ifeq ($(OSX_BUILD),1) # Modify GFX & SDL2 for OSX GL - VERSION_CFLAGS += -DOSX_BUILD + VERSION_CFLAGS += -DUSE_GLES +else ifeq ($(OSX_BUILD),1) # Modify GFX & SDL2 for OSX GL + VERSION_CFLAGS += -DOSX_BUILD +else ifeq ($(TARGET_WEB),1) + VERSION_CFLAGS += -DTARGET_WEB endif VERSION_ASFLAGS := --defsym AVOID_UB=1 -COMPARE := 0 - -ifeq ($(TARGET_WEB),1) - VERSION_CFLAGS := $(VERSION_CFLAGS) -DTARGET_WEB -endif ################### Universal Dependencies ################### @@ -194,8 +177,7 @@ endif # on tools and assets, and we use directory globs further down # in the makefile that we want should cover assets.) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) +ifeq (,$(findstring clean,$(MAKECMDGOALS))) # Make sure assets exist NOEXTRACT ?= 0 @@ -212,7 +194,6 @@ ifeq ($(DUMMY),FAIL) $(error Failed to build tools) endif -endif endif ################ Target Executable and Sources ############### @@ -222,25 +203,26 @@ BUILD_DIR_BASE := build ifeq ($(TARGET_WEB),1) BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_web +else ifeq ($(WINDOWS_BUILD),1) + BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_pc_win +else ifeq ($(TARGET_RPI),1) + BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_pi +else ifeq ($(OSX_BUILD),1) + BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_mac else - BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_pc + BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_pc_linux endif LIBULTRA := $(BUILD_DIR)/libultra.a ifeq ($(TARGET_WEB),1) EXE := $(BUILD_DIR)/$(TARGET).html - else - ifeq ($(WINDOWS_BUILD),1) - EXE := $(BUILD_DIR)/$(TARGET).exe - - else # Linux builds/binary namer - ifeq ($(TARGET_RPI),1) - EXE := $(BUILD_DIR)/$(TARGET).arm - else - EXE := $(BUILD_DIR)/$(TARGET) - endif - endif +else ifeq ($(WINDOWS_BUILD),1) +EXE := $(BUILD_DIR)/$(TARGET).exe +else ifeq ($(TARGET_RPI),1) # Linux builds/binary namer +EXE := $(BUILD_DIR)/$(TARGET).arm +else +EXE := $(BUILD_DIR)/$(TARGET) endif ELF := $(BUILD_DIR)/$(TARGET).elf @@ -270,13 +252,11 @@ MIPSBIT := -32 ifeq ($(VERSION),eu) OPT_FLAGS := -O2 -else -ifeq ($(VERSION),sh) +else ifeq ($(VERSION),sh) OPT_FLAGS := -O2 else OPT_FLAGS := -g endif -endif # Set BITS (32/64) to compile for OPT_FLAGS += $(BITS) @@ -291,33 +271,32 @@ endif ifeq ($(TARGET_RPI),1) machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown') + # Raspberry Pi B+, Zero, etc ifneq (,$(findstring armv6l,$(machine))) - OPT_FLAGS := -march=armv6zk+fp -mfpu=vfp -Ofast - endif + OPT_FLAGS := -march=armv6zk+fp -mfpu=vfp -Ofast + endif # Raspberry Pi 2 and 3 in ARM 32bit mode - ifneq (,$(findstring armv7l,$(machine))) - model = $(shell sh -c 'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown') - - ifneq (,$(findstring 3,$(model))) - OPT_FLAGS := -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -O3 - else - OPT_FLAGS := -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -O3 - endif - endif + ifneq (,$(findstring armv7l,$(machine))) + model = $(shell sh -c 'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown') + ifneq (,$(findstring 3,$(model))) + OPT_FLAGS := -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -O3 + else + OPT_FLAGS := -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -O3 + endif + endif # RPi3 or RPi4, in ARM64 (aarch64) mode. NEEDS TESTING 32BIT. # DO NOT pass -mfpu stuff here, thats for 32bit ARM only and will fail for 64bit ARM. - ifneq (,$(findstring aarch64,$(machine))) - model = $(shell sh -c 'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown') - ifneq (,$(findstring 3,$(model))) - OPT_FLAGS := -march=armv8-a+crc -mtune=cortex-a53 -O3 - else ifneq (,$(findstring 4,$(model))) - OPT_FLAGS := -march=armv8-a+crc+simd -mtune=cortex-a72 -O3 - endif - - endif + ifneq (,$(findstring aarch64,$(machine))) + model = $(shell sh -c 'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown') + ifneq (,$(findstring 3,$(model))) + OPT_FLAGS := -march=armv8-a+crc -mtune=cortex-a53 -O3 + else ifneq (,$(findstring 4,$(model))) + OPT_FLAGS := -march=armv8-a+crc+simd -mtune=cortex-a72 -O3 + endif + endif endif # File dependencies and variables for specific files @@ -338,69 +317,11 @@ ifeq ($(WINDOWS_BUILD),0) CXX_FILES := endif -# We need to keep this for now -# If we're not N64 use below - - ULTRA_C_FILES_SKIP := \ - sqrtf.c \ - string.c \ - sprintf.c \ - _Printf.c \ - kdebugserver.c \ - osInitialize.c \ - func_802F7140.c \ - func_802F71F0.c \ - func_802F4A20.c \ - EU_D_802f4330.c \ - D_802F4380.c \ - osLeoDiskInit.c \ - osCreateThread.c \ - osDestroyThread.c \ - osStartThread.c \ - osSetThreadPri.c \ - osPiStartDma.c \ - osPiRawStartDma.c \ - osPiRawReadIo.c \ - osPiGetCmdQueue.c \ - osJamMesg.c \ - osSendMesg.c \ - osRecvMesg.c \ - osSetEventMesg.c \ - osTimer.c \ - osSetTimer.c \ - osSetTime.c \ - osCreateViManager.c \ - osViSetSpecialFeatures.c \ - osVirtualToPhysical.c \ - osViBlack.c \ - osViSetEvent.c \ - osViSetMode.c \ - osViSwapBuffer.c \ - osSpTaskLoadGo.c \ - osCreatePiManager.c \ - osGetTime.c \ - osEepromProbe.c \ - osEepromWrite.c \ - osEepromLongWrite.c \ - osEepromRead.c \ - osEepromLongRead.c \ - osContInit.c \ - osContStartReadData.c \ - osAiGetLength.c \ - osAiSetFrequency.c \ - osAiSetNextBuffer.c \ - __osViInit.c \ - __osSyncPutChars.c \ - __osAtomicDec.c \ - __osSiRawStartDma.c \ - __osViSwapContext.c \ - __osViGetCurrentContext.c \ - __osDevMgrMain.c - - C_FILES := $(filter-out src/game/main.c,$(C_FILES)) - ULTRA_C_FILES := $(filter-out $(addprefix lib/src/,$(ULTRA_C_FILES_SKIP)),$(ULTRA_C_FILES)) - -# "If we're not N64, use the above" +# A big PC-only section was here +# Now unnecessary due to the files in question having been deleted from the code entirely + +C_FILES := $(C_FILES) +ULTRA_C_FILES := $(ULTRA_C_FILES) ifeq ($(VERSION),sh) SOUND_BANK_FILES := $(wildcard sound/sound_banks/*.json) @@ -479,8 +400,8 @@ ifeq ($(WINDOWS_BUILD),1) # fixes compilation in MXE on Linux and WSL OBJDUMP := $(CROSS)objdump else ifeq ($(OSX_BUILD),1) CPP := cpp-9 -P - OBJDUMP := i686-w64-mingw32-objdump OBJCOPY := i686-w64-mingw32-objcopy + OBJDUMP := i686-w64-mingw32-objdump else # Linux & other builds CPP := $(CROSS)cpp -P OBJCOPY := $(CROSS)objcopy @@ -491,16 +412,15 @@ PYTHON := python3 SDLCONFIG := $(CROSS)sdl2-config ifeq ($(WINDOWS_BUILD),1) -CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) `$(SDLCONFIG) --cflags` -DUSE_SDL=2 +CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) `$(SDLCONFIG) --cflags` -DUSE_SDL=2 CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv `$(SDLCONFIG) --cflags` -DUSE_SDL=2 else ifeq ($(TARGET_WEB),1) -CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -s USE_SDL=2 +CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -s USE_SDL=2 CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -s USE_SDL=2 -# Linux / Other builds below -else -CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) `$(SDLCONFIG) --cflags` -DUSE_SDL=2 +else # Linux / Other builds below +CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) `$(SDLCONFIG) --cflags` -DUSE_SDL=2 CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv `$(SDLCONFIG) --cflags` -DUSE_SDL=2 endif @@ -513,6 +433,7 @@ ifeq ($(BETTERCAMERA),1) EXT_OPTIONS_MENU := 1 endif +# Check for text-based save option ifeq ($(TEXTSAVES),1) CC_CHECK += -DTEXTSAVES CFLAGS += -DTEXTSAVES @@ -568,21 +489,15 @@ ifeq ($(TARGET_WEB),1) LDFLAGS := -lm -lGL -lSDL2 -no-pie -s TOTAL_MEMORY=20MB -g4 --source-map-base http://localhost:8080/ -s "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']" else ifeq ($(WINDOWS_BUILD),1) LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread -lglew32 `$(SDLCONFIG) --static-libs` -lm -lglu32 -lsetupapi -ldinput8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion -luuid -lopengl32 -static - ifeq ($(CROSS),) - LDFLAGS += -no-pie - endif ifeq ($(WINDOWS_CONSOLE),1) LDFLAGS += -mconsole endif -else ifeq ($(TARGET_RPI),1) -# Linux / Other builds below -LDFLAGS := $(OPT_FLAGS) -lm -lGLESv2 `$(SDLCONFIG) --libs` -no-pie -else -ifeq ($(OSX_BUILD),1) -LDFLAGS := -lm -framework OpenGL `$(SDLCONFIG) --libs` -no-pie -lpthread `pkg-config --libs libusb-1.0 glfw3 glew` +else ifeq ($(TARGET_RPI),1) # Linux / Other builds below +LDFLAGS := $(OPT_FLAGS) -lm -lGLESv2 `$(SDLCONFIG) --libs` +else ifeq ($(OSX_BUILD),1) +LDFLAGS := -lm -framework OpenGL `$(SDLCONFIG) --libs` -lpthread `pkg-config --libs libusb-1.0 glfw3 glew` else -LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm -lGL `$(SDLCONFIG) --libs` -no-pie -lpthread -endif +LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm -lGL `$(SDLCONFIG) --libs` -lpthread endif # End of LDFLAGS # Prevent a crash with -sopt @@ -593,7 +508,6 @@ export LANG := C # N64 conversion tools TOOLS_DIR = tools MIO0TOOL = $(TOOLS_DIR)/mio0 -N64CKSUM = $(TOOLS_DIR)/n64cksum N64GRAPHICS = $(TOOLS_DIR)/n64graphics N64GRAPHICS_CI = $(TOOLS_DIR)/n64graphics_ci TEXTCONV = $(TOOLS_DIR)/textconv @@ -634,17 +548,20 @@ clean: $(RM) -r $(BUILD_DIR_BASE) cleantools: - $(MAKE) -s -C tools clean + $(MAKE) -C tools clean + +cleanall: + $(RM) -r $(BUILD_DIR_BASE) + $(MAKE) -C tools clean distclean: $(RM) -r $(BUILD_DIR_BASE) ./extract_assets.py --clean -test: $(ROM) - $(EMULATOR) $(EMU_FLAGS) $< - -load: $(ROM) - $(LOADER) $(LOADER_FLAGS) $< +distcleanall: + $(RM) -r $(BUILD_DIR_BASE) + ./extract_assets.py --clean + $(MAKE) -C tools clean libultra: $(BUILD_DIR)/libultra.a @@ -677,8 +594,7 @@ $(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/us/define_courses.inc.c $(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/de/define_courses.inc.c $(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/fr/define_courses.inc.c -else -ifeq ($(VERSION),sh) +else ifeq ($(VERSION),sh) TEXT_DIRS := text/jp $(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/jp/define_text.inc.c @@ -688,14 +604,13 @@ TEXT_DIRS := text/$(VERSION) # non-EU encoded text inserted into segment 0x02 $(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/$(VERSION)/define_text.inc.c endif -endif $(BUILD_DIR)/text/%/define_courses.inc.c: text/define_courses.inc.c text/%/courses.h $(CPP) $(VERSION_CFLAGS) $< -o $@ -I text/$*/ $(TEXTCONV) charmap.txt $@ $@ $(BUILD_DIR)/text/%/define_text.inc.c: text/define_text.inc.c text/%/courses.h text/%/dialogs.h - $(CPP) $(VERSION_CFLAGS) $< -o $@ -I text/$*/ + $(CPP) $(VERSION_CFLAGS) -Wno-trigraphs $< -o $@ -I text/$*/ $(TEXTCONV) charmap.txt $@ $@ ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(GODDARD_SRC_DIRS) $(ULTRA_SRC_DIRS) $(ULTRA_ASM_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) include) $(MIO0_DIR) $(addprefix $(MIO0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION) @@ -861,9 +776,9 @@ $(BUILD_DIR)/src/audio/%.copt: $(BUILD_DIR)/src/audio/%.acpp $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/copt -signed -I=$< -CMP=$@ -cp=i -scalaroptimize=1 endif -# Rebuild files with 'GLOBAL_ASM' if the NON_MATCHING flag changes. -$(GLOBAL_ASM_O_FILES): $(GLOBAL_ASM_DEP).$(NON_MATCHING) -$(GLOBAL_ASM_DEP).$(NON_MATCHING): +# Rebuild files with 'GLOBAL_ASM' if something happens? +$(GLOBAL_ASM_O_FILES): $(GLOBAL_ASM_DEP) +$(GLOBAL_ASM_DEP): @rm -f $(GLOBAL_ASM_DEP).* touch $@ @@ -888,7 +803,7 @@ $(BUILD_DIR)/%.o: %.s $(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(LD) -L $(BUILD_DIR) -o $@ $(O_FILES) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(LDFLAGS) -.PHONY: all clean distclean default diff test load libultra res +.PHONY: all clean cleantools cleanall distclean distcleanall default diff libultra res .PRECIOUS: $(BUILD_DIR)/bin/%.elf $(SOUND_BIN_DIR)/%.ctl $(SOUND_BIN_DIR)/%.tbl $(SOUND_SAMPLE_TABLES) $(SOUND_BIN_DIR)/%.s $(BUILD_DIR)/% .DELETE_ON_ERROR: diff --git a/Makefile.split b/Makefile.split index c7bdaa2e6c..662d294a44 100644 --- a/Makefile.split +++ b/Makefile.split @@ -145,13 +145,11 @@ define level_rules = $$(BUILD_DIR)/levels/$(1)/leveldata.elf: TEXTURE_BIN := $(2) endef -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) +ifeq (,$(findstring clean,$(MAKECMDGOALS))) $(BUILD_DIR)/level_rules.mk: levels/level_rules.mk levels/level_defines.h $(CPP) $(VERSION_CFLAGS) -I . -o $@ $< include $(BUILD_DIR)/level_rules.mk endif -endif # -------------------------------------- # Extra Level Rules diff --git a/actors/burn_smoke/model.inc.c b/actors/burn_smoke/model.inc.c index bcf4fd6f4d..e23f68040d 100644 --- a/actors/burn_smoke/model.inc.c +++ b/actors/burn_smoke/model.inc.c @@ -10,7 +10,7 @@ static const Vtx burn_smoke_seg4_vertex_040217C0[] = { // //! Wrong texture format. Called as rgba16, which makes the burn smoke appear // as a transparent black burn smoke. Probably meant to show up as white-ish -// burn smoke, but mistakened for being intended as black smoke. +// burn smoke, but mistaken for being intended as black smoke. // Due to debate in the Koopa shorts PR surrounding the fix to a similar bug, // said fix is on a compile-time variable. Use TEXTURE_FIX=1 at compile time // to fix this. diff --git a/asm/non_matchings/eu/audio/seq_channel_layer_process_script.s b/asm/non_matchings/eu/audio/seq_channel_layer_process_script.s deleted file mode 100644 index 7f85ce25cc..0000000000 --- a/asm/non_matchings/eu/audio/seq_channel_layer_process_script.s +++ /dev/null @@ -1,781 +0,0 @@ -.late_rodata -glabel jtbl_EU_803066A0 - .word L_EU_802E7960, L_EU_802E7B6C - .word L_EU_802E7B6C, L_EU_802E78F8 - .word L_EU_802E78C0, L_EU_802E7B6C - .word L_EU_802E7B6C, L_EU_802E7940 - .word L_EU_802E7880, L_EU_802E7B6C - .word L_EU_802E7B6C, L_EU_802E7848 - -glabel jtbl_EU_803066D0 - .word L_EU_802E7980, L_EU_802E79BC - .word L_EU_802E7A1C, L_EU_802E79E4 - .word L_EU_802E79E4, L_EU_802E7A30 - .word L_EU_802E7AA0, L_EU_802E7B28 - .word L_EU_802E79BC, L_EU_802E7980 - .word L_EU_802E7B30, L_EU_802E7B5C - -glabel jtbl_EU_80306700 - .word L_EU_802E7F48, L_EU_802E7F50 - .word L_EU_802E7F48, L_EU_802E7F50 - .word L_EU_802E7F48 - -.text -glabel seq_channel_layer_process_script -/* 0A6F08 802E7708 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0A6F0C 802E770C 240E0001 */ li $t6, 1 -/* 0A6F10 802E7710 AFBF002C */ sw $ra, 0x2c($sp) -/* 0A6F14 802E7714 AFB40028 */ sw $s4, 0x28($sp) -/* 0A6F18 802E7718 AFB30024 */ sw $s3, 0x24($sp) -/* 0A6F1C 802E771C AFB20020 */ sw $s2, 0x20($sp) -/* 0A6F20 802E7720 AFB1001C */ sw $s1, 0x1c($sp) -/* 0A6F24 802E7724 AFB00018 */ sw $s0, 0x18($sp) -/* 0A6F28 802E7728 AFAE0044 */ sw $t6, 0x44($sp) -/* 0A6F2C 802E772C 8C820000 */ lw $v0, ($a0) -/* 0A6F30 802E7730 00808825 */ move $s1, $a0 -/* 0A6F34 802E7734 00027FC2 */ srl $t7, $v0, 0x1f -/* 0A6F38 802E7738 51E0028E */ beql $t7, $zero, .L80202184 -/* 0A6F3C 802E773C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0A6F40 802E7740 84830038 */ lh $v1, 0x38($a0) -/* 0A6F44 802E7744 00024080 */ sll $t0, $v0, 2 -/* 0A6F48 802E7748 000278C0 */ sll $t7, $v0, 3 -/* 0A6F4C 802E774C 28610002 */ slti $at, $v1, 2 -/* 0A6F50 802E7750 1420000E */ bnez $at, .L8020179C -/* 0A6F54 802E7754 2478FFFF */ addiu $t8, $v1, -1 -/* 0A6F58 802E7758 05000285 */ bltz $t0, .L80202180 -/* 0A6F5C 802E775C A4980038 */ sh $t8, 0x38($a0) -/* 0A6F60 802E7760 8489003A */ lh $t1, 0x3a($a0) -/* 0A6F64 802E7764 848A0038 */ lh $t2, 0x38($a0) -/* 0A6F68 802E7768 012A082A */ slt $at, $t1, $t2 -/* 0A6F6C 802E776C 54200281 */ bnezl $at, .L80202184 -/* 0A6F70 802E7770 8FBF002C */ lw $ra, 0x2c($sp) -/* 0A6F74 802E7774 0C0B95B3 */ jal seq_channel_layer_note_decay -/* 0A6F78 802E7778 00000000 */ nop -/* 0A6F7C 802E777C 922C0000 */ lbu $t4, ($s1) -/* 0A6F80 802E7780 358D0020 */ ori $t5, $t4, 0x20 -/* 0A6F84 802E7784 1000027A */ b .L80202180 -/* 0A6F88 802E7788 A22D0000 */ sb $t5, ($s1) -.L8020179C: -/* 0A6F8C 802E778C 05E20004 */ bltzl $t7, .L802017B0 -/* 0A6F90 802E7790 92220008 */ lbu $v0, 8($s1) -/* 0A6F94 802E7794 0C0B95B3 */ jal seq_channel_layer_note_decay -/* 0A6F98 802E7798 02202025 */ move $a0, $s1 -/* 0A6F9C 802E779C 92220008 */ lbu $v0, 8($s1) -.L802017B0: -/* 0A6FA0 802E77A0 2401FF7F */ li $at, -129 -/* 0A6FA4 802E77A4 0041C024 */ and $t8, $v0, $at -/* 0A6FA8 802E77A8 24010001 */ li $at, 1 -/* 0A6FAC 802E77AC 13010003 */ beq $t8, $at, .L802017CC -/* 0A6FB0 802E77B0 24010002 */ li $at, 2 -/* 0A6FB4 802E77B4 57010003 */ bnel $t8, $at, .L802017D4 -/* 0A6FB8 802E77B8 8E22004C */ lw $v0, 0x4c($s1) -.L802017CC: -/* 0A6FBC 802E77BC A2200008 */ sb $zero, 8($s1) -/* 0A6FC0 802E77C0 8E22004C */ lw $v0, 0x4c($s1) -.L802017D4: -/* 0A6FC4 802E77C4 92280000 */ lbu $t0, ($s1) -/* 0A6FC8 802E77C8 26300050 */ addiu $s0, $s1, 0x50 -/* 0A6FCC 802E77CC 8C540044 */ lw $s4, 0x44($v0) -/* 0A6FD0 802E77D0 35090004 */ ori $t1, $t0, 4 -/* 0A6FD4 802E77D4 A2290000 */ sb $t1, ($s1) -/* 0A6FD8 802E77D8 97B3004A */ lhu $s3, 0x4a($sp) -/* 0A6FDC 802E77DC AFA20068 */ sw $v0, 0x68($sp) -.L802017F0: -/* 0A6FE0 802E77E0 0C0B9DA0 */ jal m64_read_u8 -/* 0A6FE4 802E77E4 02002025 */ move $a0, $s0 -/* 0A6FE8 802E77E8 284100C1 */ slti $at, $v0, 0xc1 -/* 0A6FEC 802E77EC 305200FF */ andi $s2, $v0, 0xff -/* 0A6FF0 802E77F0 142000F7 */ bnez $at, .L80201BE0 -/* 0A6FF4 802E77F4 00402825 */ move $a1, $v0 -/* 0A6FF8 802E77F8 284100CD */ slti $at, $v0, 0xcd -/* 0A6FFC 802E77FC 1420000A */ bnez $at, .L80201838 -/* 0A7000 802E7800 24ABFF3F */ addiu $t3, $a1, -0xc1 -/* 0A7004 802E7804 244AFF0C */ addiu $t2, $v0, -0xf4 -/* 0A7008 802E7808 2D41000C */ sltiu $at, $t2, 0xc -/* 0A700C 802E780C 102000D7 */ beqz $at, .L_EU_802E7B6C -/* 0A7010 802E7810 000A5080 */ sll $t2, $t2, 2 -/* 0A7014 802E7814 3C018030 */ lui $at, %hi(jtbl_EU_803066A0) -/* 0A7018 802E7818 002A0821 */ addu $at, $at, $t2 -/* 0A701C 802E781C 8C2A66A0 */ lw $t2, %lo(jtbl_EU_803066A0)($at) -/* 0A7020 802E7820 01400008 */ jr $t2 -/* 0A7024 802E7824 00000000 */ nop -.L80201838: -/* 0A7028 802E7828 2D61000C */ sltiu $at, $t3, 0xc -/* 0A702C 802E782C 102000CF */ beqz $at, .L_EU_802E7B6C -/* 0A7030 802E7830 000B5880 */ sll $t3, $t3, 2 -/* 0A7034 802E7834 3C018030 */ lui $at, %hi(jtbl_EU_803066D0) -/* 0A7038 802E7838 002B0821 */ addu $at, $at, $t3 -/* 0A703C 802E783C 8C2B66D0 */ lw $t3, %lo(jtbl_EU_803066D0)($at) -/* 0A7040 802E7840 01600008 */ jr $t3 -/* 0A7044 802E7844 00000000 */ nop -glabel L_EU_802E7848 -/* 0A7048 802E7848 92030018 */ lbu $v1, 0x18($s0) -/* 0A704C 802E784C 14600005 */ bnez $v1, .L80201874 -/* 0A7050 802E7850 2462FFFF */ addiu $v0, $v1, -1 -/* 0A7054 802E7854 0C0B9C1E */ jal seq_channel_layer_disable -/* 0A7058 802E7858 02202025 */ move $a0, $s1 -/* 0A705C 802E785C 10000245 */ b .L80202184 -/* 0A7060 802E7860 8FBF002C */ lw $ra, 0x2c($sp) -.L80201874: -/* 0A7064 802E7864 304C00FF */ andi $t4, $v0, 0xff -/* 0A7068 802E7868 000C6880 */ sll $t5, $t4, 2 -/* 0A706C 802E786C 020D7021 */ addu $t6, $s0, $t5 -/* 0A7070 802E7870 A20C0018 */ sb $t4, 0x18($s0) -/* 0A7074 802E7874 8DCF0004 */ lw $t7, 4($t6) -/* 0A7078 802E7878 1000FFD9 */ b .L802017F0 -/* 0A707C 802E787C AE0F0000 */ sw $t7, ($s0) -glabel L_EU_802E7880 -/* 0A7080 802E7880 0C0B9DA5 */ jal m64_read_s16 -/* 0A7084 802E7884 02002025 */ move $a0, $s0 -/* 0A7088 802E7888 92190018 */ lbu $t9, 0x18($s0) -/* 0A708C 802E788C 8E180000 */ lw $t8, ($s0) -/* 0A7090 802E7890 304DFFFF */ andi $t5, $v0, 0xffff -/* 0A7094 802E7894 00194080 */ sll $t0, $t9, 2 -/* 0A7098 802E7898 02084821 */ addu $t1, $s0, $t0 -/* 0A709C 802E789C AD380004 */ sw $t8, 4($t1) -/* 0A70A0 802E78A0 920A0018 */ lbu $t2, 0x18($s0) -/* 0A70A4 802E78A4 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A70A8 802E78A8 254B0001 */ addiu $t3, $t2, 1 -/* 0A70AC 802E78AC A20B0018 */ sb $t3, 0x18($s0) -/* 0A70B0 802E78B0 8E8C0014 */ lw $t4, 0x14($s4) -/* 0A70B4 802E78B4 018D7021 */ addu $t6, $t4, $t5 -/* 0A70B8 802E78B8 1000FFC9 */ b .L802017F0 -/* 0A70BC 802E78BC AE0E0000 */ sw $t6, ($s0) -glabel L_EU_802E78C0 -/* 0A70C0 802E78C0 0C0B9DA0 */ jal m64_read_u8 -/* 0A70C4 802E78C4 02002025 */ move $a0, $s0 -/* 0A70C8 802E78C8 920F0018 */ lbu $t7, 0x18($s0) -/* 0A70CC 802E78CC 020FC821 */ addu $t9, $s0, $t7 -/* 0A70D0 802E78D0 A3220014 */ sb $v0, 0x14($t9) -/* 0A70D4 802E78D4 92180018 */ lbu $t8, 0x18($s0) -/* 0A70D8 802E78D8 8E080000 */ lw $t0, ($s0) -/* 0A70DC 802E78DC 00184880 */ sll $t1, $t8, 2 -/* 0A70E0 802E78E0 02095021 */ addu $t2, $s0, $t1 -/* 0A70E4 802E78E4 AD480004 */ sw $t0, 4($t2) -/* 0A70E8 802E78E8 920B0018 */ lbu $t3, 0x18($s0) -/* 0A70EC 802E78EC 256C0001 */ addiu $t4, $t3, 1 -/* 0A70F0 802E78F0 1000FFBB */ b .L802017F0 -/* 0A70F4 802E78F4 A20C0018 */ sb $t4, 0x18($s0) -glabel L_EU_802E78F8 -/* 0A70F8 802E78F8 920D0018 */ lbu $t5, 0x18($s0) -/* 0A70FC 802E78FC 020D1021 */ addu $v0, $s0, $t5 -/* 0A7100 802E7900 904E0013 */ lbu $t6, 0x13($v0) -/* 0A7104 802E7904 25CFFFFF */ addiu $t7, $t6, -1 -/* 0A7108 802E7908 A04F0013 */ sb $t7, 0x13($v0) -/* 0A710C 802E790C 92030018 */ lbu $v1, 0x18($s0) -/* 0A7110 802E7910 0203C821 */ addu $t9, $s0, $v1 -/* 0A7114 802E7914 93380013 */ lbu $t8, 0x13($t9) -/* 0A7118 802E7918 00602025 */ move $a0, $v1 -/* 0A711C 802E791C 00044880 */ sll $t1, $a0, 2 -/* 0A7120 802E7920 13000005 */ beqz $t8, .L80201948 -/* 0A7124 802E7924 246BFFFF */ addiu $t3, $v1, -1 -/* 0A7128 802E7928 02094021 */ addu $t0, $s0, $t1 -/* 0A712C 802E792C 8D0A0000 */ lw $t2, ($t0) -/* 0A7130 802E7930 1000FFAB */ b .L802017F0 -/* 0A7134 802E7934 AE0A0000 */ sw $t2, ($s0) -.L80201948: -/* 0A7138 802E7938 1000FFA9 */ b .L802017F0 -/* 0A713C 802E793C A20B0018 */ sb $t3, 0x18($s0) -glabel L_EU_802E7940 -/* 0A7140 802E7940 0C0B9DA5 */ jal m64_read_s16 -/* 0A7144 802E7944 02002025 */ move $a0, $s0 -/* 0A7148 802E7948 8E8C0014 */ lw $t4, 0x14($s4) -/* 0A714C 802E794C 304DFFFF */ andi $t5, $v0, 0xffff -/* 0A7150 802E7950 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A7154 802E7954 018D7021 */ addu $t6, $t4, $t5 -/* 0A7158 802E7958 1000FFA1 */ b .L802017F0 -/* 0A715C 802E795C AE0E0000 */ sw $t6, ($s0) -glabel L_EU_802E7960 -/* 0A7160 802E7960 0C0B9DA0 */ jal m64_read_u8 -/* 0A7164 802E7964 02002025 */ move $a0, $s0 -/* 0A7168 802E7968 8E0F0000 */ lw $t7, ($s0) -/* 0A716C 802E796C 0002CE00 */ sll $t9, $v0, 0x18 -/* 0A7170 802E7970 0019C603 */ sra $t8, $t9, 0x18 -/* 0A7174 802E7974 01F84821 */ addu $t1, $t7, $t8 -/* 0A7178 802E7978 1000FF99 */ b .L802017F0 -/* 0A717C 802E797C AE090000 */ sw $t1, ($s0) -glabel L_EU_802E7980 -/* 0A7180 802E7980 8E030000 */ lw $v1, ($s0) -/* 0A7184 802E7984 240100C1 */ li $at, 193 -/* 0A7188 802E7988 90640000 */ lbu $a0, ($v1) -/* 0A718C 802E798C 24680001 */ addiu $t0, $v1, 1 -/* 0A7190 802E7990 14A10008 */ bne $a1, $at, .L802019C4 -/* 0A7194 802E7994 AE080000 */ sw $t0, ($s0) -/* 0A7198 802E7998 00840019 */ multu $a0, $a0 -/* 0A719C 802E799C 00005012 */ mflo $t2 -/* 0A71A0 802E79A0 448A2000 */ mtc1 $t2, $f4 -/* 0A71A4 802E79A4 00000000 */ nop -/* 0A71A8 802E79A8 468021A0 */ cvt.s.w $f6, $f4 -/* 0A71AC 802E79AC 1000FF8C */ b .L802017F0 -/* 0A71B0 802E79B0 E6260028 */ swc1 $f6, 0x28($s1) -.L802019C4: -/* 0A71B4 802E79B4 1000FF8A */ b .L802017F0 -/* 0A71B8 802E79B8 A2240005 */ sb $a0, 5($s1) -glabel L_EU_802E79BC -/* 0A71BC 802E79BC 8E030000 */ lw $v1, ($s0) -/* 0A71C0 802E79C0 240100C9 */ li $at, 201 -/* 0A71C4 802E79C4 90640000 */ lbu $a0, ($v1) -/* 0A71C8 802E79C8 246B0001 */ addiu $t3, $v1, 1 -/* 0A71CC 802E79CC 14A10003 */ bne $a1, $at, .L802019EC -/* 0A71D0 802E79D0 AE0B0000 */ sw $t3, ($s0) -/* 0A71D4 802E79D4 1000FF82 */ b .L802017F0 -/* 0A71D8 802E79D8 A2240003 */ sb $a0, 3($s1) -.L802019EC: -/* 0A71DC 802E79DC 1000FF80 */ b .L802017F0 -/* 0A71E0 802E79E0 A6240022 */ sh $a0, 0x22($s1) -glabel L_EU_802E79E4 -/* 0A71E4 802E79E4 240100C4 */ li $at, 196 -/* 0A71E8 802E79E8 54A10006 */ bnel $a1, $at, .L80201A14 -/* 0A71EC 802E79EC 92390000 */ lbu $t9, ($s1) -/* 0A71F0 802E79F0 922D0000 */ lbu $t5, ($s1) -/* 0A71F4 802E79F4 35AE0010 */ ori $t6, $t5, 0x10 -/* 0A71F8 802E79F8 10000004 */ b .L80201A1C -/* 0A71FC 802E79FC A22E0000 */ sb $t6, ($s1) -/* 0A7200 802E7A00 92390000 */ lbu $t9, ($s1) -.L80201A14: -/* 0A7204 802E7A04 332FFFEF */ andi $t7, $t9, 0xffef -/* 0A7208 802E7A08 A22F0000 */ sb $t7, ($s1) -.L80201A1C: -/* 0A720C 802E7A0C 0C0B95B3 */ jal seq_channel_layer_note_decay -/* 0A7210 802E7A10 02202025 */ move $a0, $s1 -/* 0A7214 802E7A14 1000FF72 */ b .L802017F0 -/* 0A7218 802E7A18 00000000 */ nop -glabel L_EU_802E7A1C -/* 0A721C 802E7A1C 0C0B9DB1 */ jal m64_read_compressed_u16 -/* 0A7220 802E7A20 02002025 */ move $a0, $s0 -/* 0A7224 802E7A24 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A7228 802E7A28 1000FF6D */ b .L802017F0 -/* 0A722C 802E7A2C A6220034 */ sh $v0, 0x34($s1) -glabel L_EU_802E7A30 -/* 0A7230 802E7A30 0C0B9DA0 */ jal m64_read_u8 -/* 0A7234 802E7A34 02002025 */ move $a0, $s0 -/* 0A7238 802E7A38 2841007F */ slti $at, $v0, 0x7f -/* 0A723C 802E7A3C 305200FF */ andi $s2, $v0, 0xff -/* 0A7240 802E7A40 1420000D */ bnez $at, .L80201A88 -/* 0A7244 802E7A44 00402825 */ move $a1, $v0 -/* 0A7248 802E7A48 2401007F */ li $at, 127 -/* 0A724C 802E7A4C 54410004 */ bnel $v0, $at, .L80201A70 -/* 0A7250 802E7A50 A2220001 */ sb $v0, 1($s1) -/* 0A7254 802E7A54 10000003 */ b .L80201A74 -/* 0A7258 802E7A58 A2200001 */ sb $zero, 1($s1) -/* 0A725C 802E7A5C A2220001 */ sb $v0, 1($s1) -.L80201A70: -/* 0A7260 802E7A60 AE200044 */ sw $zero, 0x44($s1) -.L80201A74: -/* 0A7264 802E7A64 240100FF */ li $at, 255 -/* 0A7268 802E7A68 14A1FF5D */ bne $a1, $at, .L802017F0 -/* 0A726C 802E7A6C 00000000 */ nop -/* 0A7270 802E7A70 1000FF5B */ b .L802017F0 -/* 0A7274 802E7A74 A2200018 */ sb $zero, 0x18($s1) -.L80201A88: -/* 0A7278 802E7A78 8FA40068 */ lw $a0, 0x68($sp) -/* 0A727C 802E7A7C 324500FF */ andi $a1, $s2, 0xff -/* 0A7280 802E7A80 26260044 */ addiu $a2, $s1, 0x44 -/* 0A7284 802E7A84 0C0BA064 */ jal get_instrument -/* 0A7288 802E7A88 26270018 */ addiu $a3, $s1, 0x18 -/* 0A728C 802E7A8C 1440FF54 */ bnez $v0, .L802017F0 -/* 0A7290 802E7A90 A2220001 */ sb $v0, 1($s1) -/* 0A7294 802E7A94 241800FF */ li $t8, 255 -/* 0A7298 802E7A98 1000FF51 */ b .L802017F0 -/* 0A729C 802E7A9C A2380001 */ sb $t8, 1($s1) -glabel L_EU_802E7AA0 -/* 0A72A0 802E7AA0 0C0B9DA0 */ jal m64_read_u8 -/* 0A72A4 802E7AA4 02002025 */ move $a0, $s0 -/* 0A72A8 802E7AA8 A2220008 */ sb $v0, 8($s1) -/* 0A72AC 802E7AAC 0C0B9DA0 */ jal m64_read_u8 -/* 0A72B0 802E7AB0 02002025 */ move $a0, $s0 -/* 0A72B4 802E7AB4 8FA90068 */ lw $t1, 0x68($sp) -/* 0A72B8 802E7AB8 862B0022 */ lh $t3, 0x22($s1) -/* 0A72BC 802E7ABC 868D000C */ lh $t5, 0xc($s4) -/* 0A72C0 802E7AC0 8528001E */ lh $t0, 0x1e($t1) -/* 0A72C4 802E7AC4 00485021 */ addu $t2, $v0, $t0 -/* 0A72C8 802E7AC8 014B6021 */ addu $t4, $t2, $t3 -/* 0A72CC 802E7ACC 018D9021 */ addu $s2, $t4, $t5 -/* 0A72D0 802E7AD0 324E00FF */ andi $t6, $s2, 0xff -/* 0A72D4 802E7AD4 29C10080 */ slti $at, $t6, 0x80 -/* 0A72D8 802E7AD8 14200002 */ bnez $at, .L80201AF4 -/* 0A72DC 802E7ADC 01C09025 */ move $s2, $t6 -/* 0A72E0 802E7AE0 00009025 */ move $s2, $zero -.L80201AF4: -/* 0A72E4 802E7AE4 92390008 */ lbu $t9, 8($s1) -/* 0A72E8 802E7AE8 A2320004 */ sb $s2, 4($s1) -/* 0A72EC 802E7AEC 332F0080 */ andi $t7, $t9, 0x80 -/* 0A72F0 802E7AF0 11E00008 */ beqz $t7, .L80201B24 -/* 0A72F4 802E7AF4 00000000 */ nop -/* 0A72F8 802E7AF8 8E180000 */ lw $t8, ($s0) -/* 0A72FC 802E7AFC 93090000 */ lbu $t1, ($t8) -/* 0A7300 802E7B00 A6290020 */ sh $t1, 0x20($s1) -/* 0A7304 802E7B04 8E080000 */ lw $t0, ($s0) -/* 0A7308 802E7B08 250A0001 */ addiu $t2, $t0, 1 -/* 0A730C 802E7B0C 1000FF34 */ b .L802017F0 -/* 0A7310 802E7B10 AE0A0000 */ sw $t2, ($s0) -.L80201B24: -/* 0A7314 802E7B14 0C0B9DB1 */ jal m64_read_compressed_u16 -/* 0A7318 802E7B18 02002025 */ move $a0, $s0 -/* 0A731C 802E7B1C 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A7320 802E7B20 1000FF2F */ b .L802017F0 -/* 0A7324 802E7B24 A6220020 */ sh $v0, 0x20($s1) -glabel L_EU_802E7B28 -/* 0A7328 802E7B28 1000FF2D */ b .L802017F0 -/* 0A732C 802E7B2C A2200008 */ sb $zero, 8($s1) -glabel L_EU_802E7B30 -/* 0A7330 802E7B30 0C0B9DA5 */ jal m64_read_s16 -/* 0A7334 802E7B34 02002025 */ move $a0, $s0 -/* 0A7338 802E7B38 8E8B0014 */ lw $t3, 0x14($s4) -/* 0A733C 802E7B3C 304CFFFF */ andi $t4, $v0, 0xffff -/* 0A7340 802E7B40 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A7344 802E7B44 016C6821 */ addu $t5, $t3, $t4 -/* 0A7348 802E7B48 AE2D001C */ sw $t5, 0x1c($s1) -/* 0A734C 802E7B4C 0C0B9DA0 */ jal m64_read_u8 -/* 0A7350 802E7B50 02002025 */ move $a0, $s0 -/* 0A7354 802E7B54 1000FF22 */ b .L802017F0 -/* 0A7358 802E7B58 A2220018 */ sb $v0, 0x18($s1) -glabel L_EU_802E7B5C -/* 0A735C 802E7B5C 92390000 */ lbu $t9, ($s1) -/* 0A7360 802E7B60 372F0002 */ ori $t7, $t9, 2 -/* 0A7364 802E7B64 1000FF1E */ b .L802017F0 -/* 0A7368 802E7B68 A22F0000 */ sb $t7, ($s1) -glabel L_EU_802E7B6C -.L_EU_802E7B6C: -/* 0A736C 802E7B6C 30A300F0 */ andi $v1, $a1, 0xf0 -/* 0A7370 802E7B70 240100D0 */ li $at, 208 -/* 0A7374 802E7B74 10610005 */ beq $v1, $at, .L80201B9C -/* 0A7378 802E7B78 240100E0 */ li $at, 224 -/* 0A737C 802E7B7C 5061000F */ beql $v1, $at, .L80201BCC -/* 0A7380 802E7B80 8E8B0090 */ lw $t3, 0x90($s4) -/* 0A7384 802E7B84 1000FF16 */ b .L802017F0 -/* 0A7388 802E7B88 00000000 */ nop -.L80201B9C: -/* 0A738C 802E7B8C 8E98008C */ lw $t8, 0x8c($s4) -/* 0A7390 802E7B90 30A9000F */ andi $t1, $a1, 0xf -/* 0A7394 802E7B94 03094021 */ addu $t0, $t8, $t1 -/* 0A7398 802E7B98 91130000 */ lbu $s3, ($t0) -/* 0A739C 802E7B9C 02730019 */ multu $s3, $s3 -/* 0A73A0 802E7BA0 00005012 */ mflo $t2 -/* 0A73A4 802E7BA4 448A4000 */ mtc1 $t2, $f8 -/* 0A73A8 802E7BA8 00000000 */ nop -/* 0A73AC 802E7BAC 468042A0 */ cvt.s.w $f10, $f8 -/* 0A73B0 802E7BB0 1000FF0B */ b .L802017F0 -/* 0A73B4 802E7BB4 E62A0028 */ swc1 $f10, 0x28($s1) -/* 0A73B8 802E7BB8 8E8B0090 */ lw $t3, 0x90($s4) -.L80201BCC: -/* 0A73BC 802E7BBC 30AC000F */ andi $t4, $a1, 0xf -/* 0A73C0 802E7BC0 016C6821 */ addu $t5, $t3, $t4 -/* 0A73C4 802E7BC4 91AE0000 */ lbu $t6, ($t5) -/* 0A73C8 802E7BC8 1000FF05 */ b .L802017F0 -/* 0A73CC 802E7BCC A22E0003 */ sb $t6, 3($s1) -.L80201BE0: -/* 0A73D0 802E7BD0 240100C0 */ li $at, 192 -/* 0A73D4 802E7BD4 14A10008 */ bne $a1, $at, .L80201C08 -/* 0A73D8 802E7BD8 30A300C0 */ andi $v1, $a1, 0xc0 -/* 0A73DC 802E7BDC 0C0B9DB1 */ jal m64_read_compressed_u16 -/* 0A73E0 802E7BE0 02002025 */ move $a0, $s0 -/* 0A73E4 802E7BE4 922F0000 */ lbu $t7, ($s1) -/* 0A73E8 802E7BE8 A6220038 */ sh $v0, 0x38($s1) -/* 0A73EC 802E7BEC 35F80020 */ ori $t8, $t7, 0x20 -/* 0A73F0 802E7BF0 10000125 */ b .L80202098 -/* 0A73F4 802E7BF4 A2380000 */ sb $t8, ($s1) -.L80201C08: -/* 0A73F8 802E7BF8 92290000 */ lbu $t1, ($s1) -/* 0A73FC 802E7BFC 24010001 */ li $at, 1 -/* 0A7400 802E7C00 3128FFDF */ andi $t0, $t1, 0xffdf -/* 0A7404 802E7C04 A2280000 */ sb $t0, ($s1) -/* 0A7408 802E7C08 8FAA0068 */ lw $t2, 0x68($sp) -/* 0A740C 802E7C0C 8D4B0000 */ lw $t3, ($t2) -/* 0A7410 802E7C10 000B6180 */ sll $t4, $t3, 6 -/* 0A7414 802E7C14 000C6FC2 */ srl $t5, $t4, 0x1f -/* 0A7418 802E7C18 15A10038 */ bne $t5, $at, .L80201D0C -/* 0A741C 802E7C1C 00000000 */ nop -/* 0A7420 802E7C20 30A300C0 */ andi $v1, $a1, 0xc0 -/* 0A7424 802E7C24 10600007 */ beqz $v1, .L80201C54 -/* 0A7428 802E7C28 24010040 */ li $at, 64 -/* 0A742C 802E7C2C 10610014 */ beq $v1, $at, .L80201C90 -/* 0A7430 802E7C30 24010080 */ li $at, 128 -/* 0A7434 802E7C34 1061001D */ beq $v1, $at, .L80201CBC -/* 0A7438 802E7C38 02602025 */ move $a0, $s3 -/* 0A743C 802E7C3C 10000026 */ b .L80201CE8 -/* 0A7440 802E7C40 8FA60034 */ lw $a2, 0x34($sp) -.L80201C54: -/* 0A7444 802E7C44 0C0B9DB1 */ jal m64_read_compressed_u16 -/* 0A7448 802E7C48 02002025 */ move $a0, $s0 -/* 0A744C 802E7C4C 8E030000 */ lw $v1, ($s0) -/* 0A7450 802E7C50 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A7454 802E7C54 02602025 */ move $a0, $s3 -/* 0A7458 802E7C58 90660000 */ lbu $a2, ($v1) -/* 0A745C 802E7C5C 246E0001 */ addiu $t6, $v1, 1 -/* 0A7460 802E7C60 AE0E0000 */ sw $t6, ($s0) -/* 0A7464 802E7C64 91CF0000 */ lbu $t7, ($t6) -/* 0A7468 802E7C68 A22F0003 */ sb $t7, 3($s1) -/* 0A746C 802E7C6C 8E180000 */ lw $t8, ($s0) -/* 0A7470 802E7C70 27090001 */ addiu $t1, $t8, 1 -/* 0A7474 802E7C74 AE090000 */ sw $t1, ($s0) -/* 0A7478 802E7C78 10000017 */ b .L80201CE8 -/* 0A747C 802E7C7C A6220036 */ sh $v0, 0x36($s1) -.L80201C90: -/* 0A7480 802E7C80 0C0B9DB1 */ jal m64_read_compressed_u16 -/* 0A7484 802E7C84 02002025 */ move $a0, $s0 -/* 0A7488 802E7C88 8E030000 */ lw $v1, ($s0) -/* 0A748C 802E7C8C 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A7490 802E7C90 02602025 */ move $a0, $s3 -/* 0A7494 802E7C94 90660000 */ lbu $a2, ($v1) -/* 0A7498 802E7C98 24680001 */ addiu $t0, $v1, 1 -/* 0A749C 802E7C9C AE080000 */ sw $t0, ($s0) -/* 0A74A0 802E7CA0 A2200003 */ sb $zero, 3($s1) -/* 0A74A4 802E7CA4 1000000C */ b .L80201CE8 -/* 0A74A8 802E7CA8 A6220036 */ sh $v0, 0x36($s1) -.L80201CBC: -/* 0A74AC 802E7CAC 8E030000 */ lw $v1, ($s0) -/* 0A74B0 802E7CB0 96330036 */ lhu $s3, 0x36($s1) -/* 0A74B4 802E7CB4 90660000 */ lbu $a2, ($v1) -/* 0A74B8 802E7CB8 246A0001 */ addiu $t2, $v1, 1 -/* 0A74BC 802E7CBC AE0A0000 */ sw $t2, ($s0) -/* 0A74C0 802E7CC0 914C0000 */ lbu $t4, ($t2) -/* 0A74C4 802E7CC4 02602025 */ move $a0, $s3 -/* 0A74C8 802E7CC8 A22C0003 */ sb $t4, 3($s1) -/* 0A74CC 802E7CCC 8E0D0000 */ lw $t5, ($s0) -/* 0A74D0 802E7CD0 25AE0001 */ addiu $t6, $t5, 1 -/* 0A74D4 802E7CD4 AE0E0000 */ sw $t6, ($s0) -.L80201CE8: -/* 0A74D8 802E7CD8 44868000 */ mtc1 $a2, $f16 -/* 0A74DC 802E7CDC 325900C0 */ andi $t9, $s2, 0xc0 -/* 0A74E0 802E7CE0 02599023 */ subu $s2, $s2, $t9 -/* 0A74E4 802E7CE4 46808020 */ cvt.s.w $f0, $f16 -/* 0A74E8 802E7CE8 324F00FF */ andi $t7, $s2, 0xff -/* 0A74EC 802E7CEC 01E09025 */ move $s2, $t7 -/* 0A74F0 802E7CF0 46000482 */ mul.s $f18, $f0, $f0 -/* 0A74F4 802E7CF4 10000018 */ b .L80201D68 -/* 0A74F8 802E7CF8 E6320028 */ swc1 $f18, 0x28($s1) -.L80201D0C: -/* 0A74FC 802E7CFC 10600007 */ beqz $v1, .L80201D2C -/* 0A7500 802E7D00 24010040 */ li $at, 64 -/* 0A7504 802E7D04 1061000B */ beq $v1, $at, .L80201D44 -/* 0A7508 802E7D08 24010080 */ li $at, 128 -/* 0A750C 802E7D0C 5061000D */ beql $v1, $at, .L80201D54 -/* 0A7510 802E7D10 96330036 */ lhu $s3, 0x36($s1) -/* 0A7514 802E7D14 1000000C */ b .L80201D58 -/* 0A7518 802E7D18 02602025 */ move $a0, $s3 -.L80201D2C: -/* 0A751C 802E7D1C 0C0B9DB1 */ jal m64_read_compressed_u16 -/* 0A7520 802E7D20 02002025 */ move $a0, $s0 -/* 0A7524 802E7D24 3053FFFF */ andi $s3, $v0, 0xffff -/* 0A7528 802E7D28 A6220036 */ sh $v0, 0x36($s1) -/* 0A752C 802E7D2C 10000006 */ b .L80201D58 -/* 0A7530 802E7D30 02602025 */ move $a0, $s3 -.L80201D44: -/* 0A7534 802E7D34 96330034 */ lhu $s3, 0x34($s1) -/* 0A7538 802E7D38 10000003 */ b .L80201D58 -/* 0A753C 802E7D3C 02602025 */ move $a0, $s3 -/* 0A7540 802E7D40 96330036 */ lhu $s3, 0x36($s1) -.L80201D54: -/* 0A7544 802E7D44 02602025 */ move $a0, $s3 -.L80201D58: -/* 0A7548 802E7D48 325800C0 */ andi $t8, $s2, 0xc0 -/* 0A754C 802E7D4C 02589023 */ subu $s2, $s2, $t8 -/* 0A7550 802E7D50 324900FF */ andi $t1, $s2, 0xff -/* 0A7554 802E7D54 01209025 */ move $s2, $t1 -.L80201D68: -/* 0A7558 802E7D58 92280003 */ lbu $t0, 3($s1) -/* 0A755C 802E7D5C A6240038 */ sh $a0, 0x38($s1) -/* 0A7560 802E7D60 01040019 */ multu $t0, $a0 -/* 0A7564 802E7D64 00005012 */ mflo $t2 -/* 0A7568 802E7D68 000A5A03 */ sra $t3, $t2, 8 -/* 0A756C 802E7D6C A62B003A */ sh $t3, 0x3a($s1) -/* 0A7570 802E7D70 8E8C0000 */ lw $t4, ($s4) -/* 0A7574 802E7D74 8FB90068 */ lw $t9, 0x68($sp) -/* 0A7578 802E7D78 8FA90068 */ lw $t1, 0x68($sp) -/* 0A757C 802E7D7C 000C7080 */ sll $t6, $t4, 2 -/* 0A7580 802E7D80 05C10005 */ bgez $t6, .L80201DA8 -/* 0A7584 802E7D84 8FAC0068 */ lw $t4, 0x68($sp) -/* 0A7588 802E7D88 932F0003 */ lbu $t7, 3($t9) -/* 0A758C 802E7D8C 31F80040 */ andi $t8, $t7, 0x40 -/* 0A7590 802E7D90 57000007 */ bnezl $t8, .L80201DC0 -/* 0A7594 802E7D94 922D0000 */ lbu $t5, ($s1) -.L80201DA8: -/* 0A7598 802E7D98 8D280000 */ lw $t0, ($t1) -/* 0A759C 802E7D9C 8FB90068 */ lw $t9, 0x68($sp) -/* 0A75A0 802E7DA0 000858C0 */ sll $t3, $t0, 3 -/* 0A75A4 802E7DA4 05630006 */ bgezl $t3, .L80201DD0 -/* 0A75A8 802E7DA8 92230001 */ lbu $v1, 1($s1) -/* 0A75AC 802E7DAC 922D0000 */ lbu $t5, ($s1) -.L80201DC0: -/* 0A75B0 802E7DB0 35AE0020 */ ori $t6, $t5, 0x20 -/* 0A75B4 802E7DB4 100000B4 */ b .L80202098 -/* 0A75B8 802E7DB8 A22E0000 */ sb $t6, ($s1) -/* 0A75BC 802E7DBC 92230001 */ lbu $v1, 1($s1) -.L80201DD0: -/* 0A75C0 802E7DC0 240100FF */ li $at, 255 -/* 0A75C4 802E7DC4 14610002 */ bne $v1, $at, .L80201DE0 -/* 0A75C8 802E7DC8 00601025 */ move $v0, $v1 -/* 0A75CC 802E7DCC 8722001C */ lh $v0, 0x1c($t9) -.L80201DE0: -/* 0A75D0 802E7DD0 5440001D */ bnezl $v0, .L80201E58 -/* 0A75D4 802E7DD4 868F000C */ lh $t7, 0xc($s4) -/* 0A75D8 802E7DD8 8FAF0068 */ lw $t7, 0x68($sp) -/* 0A75DC 802E7DDC 86280022 */ lh $t0, 0x22($s1) -/* 0A75E0 802E7DE0 85F8001E */ lh $t8, 0x1e($t7) -/* 0A75E4 802E7DE4 91E40006 */ lbu $a0, 6($t7) -/* 0A75E8 802E7DE8 02584821 */ addu $t1, $s2, $t8 -/* 0A75EC 802E7DEC 01289021 */ addu $s2, $t1, $t0 -/* 0A75F0 802E7DF0 0C0B93EE */ jal get_drum -/* 0A75F4 802E7DF4 324500FF */ andi $a1, $s2, 0xff -/* 0A75F8 802E7DF8 14400005 */ bnez $v0, .L80201E20 -/* 0A75FC 802E7DFC 24430004 */ addiu $v1, $v0, 4 -/* 0A7600 802E7E00 922C0000 */ lbu $t4, ($s1) -/* 0A7604 802E7E04 358D0020 */ ori $t5, $t4, 0x20 -/* 0A7608 802E7E08 1000009D */ b .L80202090 -/* 0A760C 802E7E0C A22D0000 */ sb $t5, ($s1) -.L80201E20: -/* 0A7610 802E7E10 8C4E000C */ lw $t6, 0xc($v0) -/* 0A7614 802E7E14 8E380000 */ lw $t8, ($s1) -/* 0A7618 802E7E18 AE2E001C */ sw $t6, 0x1c($s1) -/* 0A761C 802E7E1C 90590000 */ lbu $t9, ($v0) -/* 0A7620 802E7E20 00184180 */ sll $t0, $t8, 6 -/* 0A7624 802E7E24 05000003 */ bltz $t0, .L80201E44 -/* 0A7628 802E7E28 A2390018 */ sb $t9, 0x18($s1) -/* 0A762C 802E7E2C 904A0001 */ lbu $t2, 1($v0) -/* 0A7630 802E7E30 A22A0005 */ sb $t2, 5($s1) -.L80201E44: -/* 0A7634 802E7E34 AE230048 */ sw $v1, 0x48($s1) # AudioBankSound -/* 0A7638 802E7E38 C4640004 */ lwc1 $f4, 4($v1) # AudioBankSound.tuning -/* 0A763C 802E7E3C 10000090 */ b .L80202090 -/* 0A7640 802E7E40 E6240024 */ swc1 $f4, 0x24($s1) -/* 0A7644 802E7E44 868F000C */ lh $t7, 0xc($s4) -.L80201E58: -/* 0A7648 802E7E48 858D001E */ lh $t5, 0x1e($t4) -/* 0A764C 802E7E4C 86390022 */ lh $t9, 0x22($s1) -/* 0A7650 802E7E50 024F5821 */ addu $t3, $s2, $t7 -/* 0A7654 802E7E54 016D7021 */ addu $t6, $t3, $t5 -/* 0A7658 802E7E58 01D99021 */ addu $s2, $t6, $t9 -/* 0A765C 802E7E5C 324500FF */ andi $a1, $s2, 0xff # a1 = s2 & 0xff -/* 0A7660 802E7E60 28A10080 */ slti $at, $a1, 0x80 -/* 0A7664 802E7E64 14200005 */ bnez $at, .L80201E8C -/* 0A7668 802E7E68 00A09025 */ move $s2, $a1 -/* 0A766C 802E7E6C 92280000 */ lbu $t0, ($s1) -/* 0A7670 802E7E70 350A0020 */ ori $t2, $t0, 0x20 -/* 0A7674 802E7E74 10000082 */ b .L80202090 -/* 0A7678 802E7E78 A22A0000 */ sb $t2, ($s1) -.L80201E8C: -/* 0A767C 802E7E7C 240100FF */ li $at, 255 -/* 0A7680 802E7E80 14610003 */ bne $v1, $at, .L80201EA0 -/* 0A7684 802E7E84 8FAF0068 */ lw $t7, 0x68($sp) -/* 0A7688 802E7E88 10000002 */ b .L80201EA4 -/* 0A768C 802E7E8C 8DE40040 */ lw $a0, 0x40($t7) # SequenceChannel.Instrument -.L80201EA0: -/* 0A7690 802E7E90 8E240044 */ lw $a0, 0x44($s1) # SequenceChannelLayer.Instrument -.L80201EA4: -/* 0A7694 802E7E94 922C0008 */ lbu $t4, 8($s1) # SequenceChannelLayer.portamento -/* 0A7698 802E7E98 11800061 */ beqz $t4, .L80202030 -/* 0A769C 802E7E9C 00000000 */ nop -/* 0A76A0 802E7EA0 92220004 */ lbu $v0, 4($s1) # SequenceChannelLayer.portamentoTargetNote -/* 0A76A4 802E7EA4 0045082A */ slt $at, $v0, $a1 -/* 0A76A8 802E7EA8 10200003 */ beqz $at, .L80201EC8 -/* 0A76AC 802E7EAC 00403025 */ move $a2, $v0 # arg1 = min(portamentoTargetNote, a1) -/* 0A76B0 802E7EB0 10000001 */ b .L80201EC8 -/* 0A76B4 802E7EB4 00A03025 */ move $a2, $a1 -.L80201EC8: -/* 0A76B8 802E7EB8 1080000A */ beqz $a0, .L80201EF4 -/* 0A76BC 802E7EBC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A76C0 802E7EC0 0C0B9397 */ jal instrument_get_audio_bank_sound -/* 0A76C4 802E7EC4 00C02825 */ move $a1, $a2 -/* 0A76C8 802E7EC8 8E2B0048 */ lw $t3, 0x48($s1) -/* 0A76CC 802E7ECC 004B6826 */ xor $t5, $v0, $t3 -/* 0A76D0 802E7ED0 2DAD0001 */ sltiu $t5, $t5, 1 -/* 0A76D4 802E7ED4 AFAD0044 */ sw $t5, 0x44($sp) -/* 0A76D8 802E7ED8 AE220048 */ sw $v0, 0x48($s1) -/* 0A76DC 802E7EDC 10000003 */ b .L80201EFC -/* 0A76E0 802E7EE0 C4400004 */ lwc1 $f0, 4($v0) -.L80201EF4: -/* 0A76E4 802E7EE4 44810000 */ mtc1 $at, $f0 -/* 0A76E8 802E7EE8 AE200048 */ sw $zero, 0x48($s1) -.L80201EFC: -/* 0A76EC 802E7EEC 3C038030 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8030 -/* 0A76F0 802E7EF0 92380004 */ lbu $t8, 4($s1) -/* 0A76F4 802E7EF4 24630AE8 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0xae8 -/* 0A76F8 802E7EF8 00127080 */ sll $t6, $s2, 2 -/* 0A76FC 802E7EFC 006EC821 */ addu $t9, $v1, $t6 -/* 0A7700 802E7F00 C7260000 */ lwc1 $f6, ($t9) -/* 0A7704 802E7F04 922A0008 */ lbu $t2, 8($s1) -/* 0A7708 802E7F08 00184880 */ sll $t1, $t8, 2 -/* 0A770C 802E7F0C 00694021 */ addu $t0, $v1, $t1 -/* 0A7710 802E7F10 C5080000 */ lwc1 $f8, ($t0) -/* 0A7714 802E7F14 46003082 */ mul.s $f2, $f6, $f0 -/* 0A7718 802E7F18 2401FF7F */ li $at, -129 -/* 0A771C 802E7F1C 01417824 */ and $t7, $t2, $at -/* 0A7720 802E7F20 25ECFFFF */ addiu $t4, $t7, -1 -/* 0A7724 802E7F24 2D810005 */ sltiu $at, $t4, 5 -/* 0A7728 802E7F28 46004302 */ mul.s $f12, $f8, $f0 -/* 0A772C 802E7F2C 10200008 */ beqz $at, .L_EU_802E7F50 -/* 0A7730 802E7F30 000C6080 */ sll $t4, $t4, 2 -/* 0A7734 802E7F34 3C018030 */ lui $at, %hi(jtbl_EU_80306700) -/* 0A7738 802E7F38 002C0821 */ addu $at, $at, $t4 -/* 0A773C 802E7F3C 8C2C6700 */ lw $t4, %lo(jtbl_EU_80306700)($at) -/* 0A7740 802E7F40 01800008 */ jr $t4 -/* 0A7744 802E7F44 00000000 */ nop -glabel L_EU_802E7F48 -/* 0A7748 802E7F48 10000002 */ b .L80201F64 -/* 0A774C 802E7F4C 46006006 */ mov.s $f0, $f12 -glabel L_EU_802E7F50 -.L_EU_802E7F50: -/* 0A7750 802E7F50 46001006 */ mov.s $f0, $f2 -.L80201F64: -/* 0A7754 802E7F54 46001283 */ div.s $f10, $f2, $f0 -/* 0A7758 802E7F58 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A775C 802E7F5C 44818000 */ mtc1 $at, $f16 -/* 0A7760 802E7F60 26220008 */ addiu $v0, $s1, 8 -/* 0A7764 802E7F64 3C0146FE */ li $at, 0x46FE0000 # 32512.000000 -/* 0A7768 802E7F68 46105481 */ sub.s $f18, $f10, $f16 -/* 0A776C 802E7F6C E452000C */ swc1 $f18, 0xc($v0) -/* 0A7770 802E7F70 922B0008 */ lbu $t3, 8($s1) -/* 0A7774 802E7F74 316D0080 */ andi $t5, $t3, 0x80 -/* 0A7778 802E7F78 51A00017 */ beql $t5, $zero, .L80201FE8 -/* 0A777C 802E7F7C 96280020 */ lhu $t0, 0x20($s1) -/* 0A7780 802E7F80 968E0008 */ lhu $t6, 8($s4) -/* 0A7784 802E7F84 3C188023 */ lui $t8, %hi(gTempoInternalToExternal) # $t8, 0x8023 -/* 0A7788 802E7F88 8718980C */ lh $t8, %lo(gTempoInternalToExternal)($t8) -/* 0A778C 802E7F8C 448E2000 */ mtc1 $t6, $f4 -/* 0A7790 802E7F90 86390038 */ lh $t9, 0x38($s1) -/* 0A7794 802E7F94 44814000 */ mtc1 $at, $f8 -/* 0A7798 802E7F98 468021A0 */ cvt.s.w $f6, $f4 -/* 0A779C 802E7F9C 44982000 */ mtc1 $t8, $f4 -/* 0A77A0 802E7FA0 44998000 */ mtc1 $t9, $f16 -/* 0A77A4 802E7FA4 96290020 */ lhu $t1, 0x20($s1) -/* 0A77A8 802E7FA8 468084A0 */ cvt.s.w $f18, $f16 -/* 0A77AC 802E7FAC 46083282 */ mul.s $f10, $f6, $f8 -/* 0A77B0 802E7FB0 44898000 */ mtc1 $t1, $f16 -/* 0A77B4 802E7FB4 468021A0 */ cvt.s.w $f6, $f4 -/* 0A77B8 802E7FB8 46808120 */ cvt.s.w $f4, $f16 -/* 0A77BC 802E7FBC 46069202 */ mul.s $f8, $f18, $f6 -/* 0A77C0 802E7FC0 00000000 */ nop -/* 0A77C4 802E7FC4 46044482 */ mul.s $f18, $f8, $f4 -/* 0A77C8 802E7FC8 46125183 */ div.s $f6, $f10, $f18 -/* 0A77CC 802E7FCC 10000009 */ b .L80202004 -/* 0A77D0 802E7FD0 E4460008 */ swc1 $f6, 8($v0) -/* 0A77D4 802E7FD4 96280020 */ lhu $t0, 0x20($s1) -.L80201FE8: -/* 0A77D8 802E7FD8 3C0142FE */ li $at, 0x42FE0000 # 127.000000 -/* 0A77DC 802E7FDC 44818000 */ mtc1 $at, $f16 -/* 0A77E0 802E7FE0 44884000 */ mtc1 $t0, $f8 -/* 0A77E4 802E7FE4 00000000 */ nop -/* 0A77E8 802E7FE8 46804120 */ cvt.s.w $f4, $f8 -/* 0A77EC 802E7FEC 46048283 */ div.s $f10, $f16, $f4 -/* 0A77F0 802E7FF0 E44A0008 */ swc1 $f10, 8($v0) -.L80202004: -/* 0A77F4 802E7FF4 44809000 */ mtc1 $zero, $f18 -/* 0A77F8 802E7FF8 2401FF7F */ li $at, -129 -/* 0A77FC 802E7FFC E4520004 */ swc1 $f18, 4($v0) -/* 0A7800 802E8000 922A0008 */ lbu $t2, 8($s1) -/* 0A7804 802E8004 E6200024 */ swc1 $f0, 0x24($s1) -/* 0A7808 802E8008 01417824 */ and $t7, $t2, $at -/* 0A780C 802E800C 24010005 */ li $at, 5 -/* 0A7810 802E8010 55E1001C */ bnel $t7, $at, .L80202094 -/* 0A7814 802E8014 86290038 */ lh $t1, 0x38($s1) -/* 0A7818 802E8018 10000019 */ b .L80202090 -/* 0A781C 802E801C A2320004 */ sb $s2, 4($s1) -.L80202030: -/* 0A7820 802E8020 10800011 */ beqz $a0, .L80202078 -/* 0A7824 802E8024 3C038030 */ lui $v1, %hi(gNoteFrequencies) -/* 0A7828 802E8028 0C0B9397 */ jal instrument_get_audio_bank_sound -/* 0A782C 802E802C 00000000 */ nop -/* 0A7830 802E8030 8E2C0048 */ lw $t4, 0x48($s1) -/* 0A7834 802E8034 3C038030 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8030 -/* 0A7838 802E8038 24630AE8 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0xae8 -/* 0A783C 802E803C 004C5826 */ xor $t3, $v0, $t4 -/* 0A7840 802E8040 2D6B0001 */ sltiu $t3, $t3, 1 -/* 0A7844 802E8044 AFAB0044 */ sw $t3, 0x44($sp) -/* 0A7848 802E8048 AE220048 */ sw $v0, 0x48($s1) -/* 0A784C 802E804C 00126880 */ sll $t5, $s2, 2 -/* 0A7850 802E8050 006D7021 */ addu $t6, $v1, $t5 -/* 0A7854 802E8054 C5C60000 */ lwc1 $f6, ($t6) -/* 0A7858 802E8058 C4480004 */ lwc1 $f8, 4($v0) -/* 0A785C 802E805C 46083402 */ mul.s $f16, $f6, $f8 -/* 0A7860 802E8060 10000007 */ b .L80202090 -/* 0A7864 802E8064 E6300024 */ swc1 $f16, 0x24($s1) -.L80202078: -/* 0A7868 802E8068 24630AE8 */ addiu $v1, $v1, 0xae8 -/* 0A786C 802E806C 0012C880 */ sll $t9, $s2, 2 -/* 0A7870 802E8070 AE200048 */ sw $zero, 0x48($s1) -/* 0A7874 802E8074 0079C021 */ addu $t8, $v1, $t9 -/* 0A7878 802E8078 C7040000 */ lwc1 $f4, ($t8) -/* 0A787C 802E807C E6240024 */ swc1 $f4, 0x24($s1) -.L80202090: -/* 0A7880 802E8080 86290038 */ lh $t1, 0x38($s1) -.L80202094: -/* 0A7884 802E8084 A629003C */ sh $t1, 0x3c($s1) -.L80202098: -/* 0A7888 802E8088 8E220000 */ lw $v0, ($s1) -/* 0A788C 802E808C 24010001 */ li $at, 1 -/* 0A7890 802E8090 00024080 */ sll $t0, $v0, 2 -/* 0A7894 802E8094 000857C2 */ srl $t2, $t0, 0x1f -/* 0A7898 802E8098 1541000B */ bne $t2, $at, .L802020D8 -/* 0A789C 802E809C 000270C0 */ sll $t6, $v0, 3 -/* 0A78A0 802E80A0 8E2F0040 */ lw $t7, 0x40($s1) -/* 0A78A4 802E80A4 000258C0 */ sll $t3, $v0, 3 -/* 0A78A8 802E80A8 15E00003 */ bnez $t7, .L802020C8 -/* 0A78AC 802E80AC 00000000 */ nop -/* 0A78B0 802E80B0 05630030 */ bgezl $t3, .L80202184 -/* 0A78B4 802E80B4 8FBF002C */ lw $ra, 0x2c($sp) -.L802020C8: -/* 0A78B8 802E80B8 0C0B95B3 */ jal seq_channel_layer_note_decay -/* 0A78BC 802E80BC 02202025 */ move $a0, $s1 -/* 0A78C0 802E80C0 1000002C */ b .L80202184 -/* 0A78C4 802E80C4 8FBF002C */ lw $ra, 0x2c($sp) -.L802020D8: -/* 0A78C8 802E80C8 05C00003 */ bltz $t6, .L802020E8 -/* 0A78CC 802E80CC 00009025 */ move $s2, $zero -/* 0A78D0 802E80D0 1000001A */ b .L8020214C -/* 0A78D4 802E80D4 24120001 */ li $s2, 1 -.L802020E8: -/* 0A78D8 802E80D8 8E240040 */ lw $a0, 0x40($s1) -/* 0A78DC 802E80DC 10800005 */ beqz $a0, .L80202104 -/* 0A78E0 802E80E0 00000000 */ nop -/* 0A78E4 802E80E4 92390002 */ lbu $t9, 2($s1) -/* 0A78E8 802E80E8 8FB80044 */ lw $t8, 0x44($sp) -/* 0A78EC 802E80EC 17200003 */ bnez $t9, .L8020210C -/* 0A78F0 802E80F0 00000000 */ nop -.L80202104: -/* 0A78F4 802E80F4 10000011 */ b .L8020214C -/* 0A78F8 802E80F8 24120001 */ li $s2, 1 -.L8020210C: -/* 0A78FC 802E80FC 57000006 */ bnezl $t8, .L80202128 -/* 0A7900 802E8100 8C890044 */ lw $t1, 0x44($a0) -/* 0A7904 802E8104 0C0B95B3 */ jal seq_channel_layer_note_decay -/* 0A7908 802E8108 02202025 */ move $a0, $s1 -/* 0A790C 802E810C 1000000B */ b .L8020214C -/* 0A7910 802E8110 24120001 */ li $s2, 1 -/* 0A7914 802E8114 8C890044 */ lw $t1, 0x44($a0) -.L80202128: -/* 0A7918 802E8118 52290004 */ beql $s1, $t1, .L8020213C -/* 0A791C 802E811C 8E280048 */ lw $t0, 0x48($s1) -/* 0A7920 802E8120 10000006 */ b .L8020214C -/* 0A7924 802E8124 24120001 */ li $s2, 1 -/* 0A7928 802E8128 8E280048 */ lw $t0, 0x48($s1) -.L8020213C: -/* 0A792C 802E812C 15000003 */ bnez $t0, .L8020214C -/* 0A7930 802E8130 00000000 */ nop -/* 0A7934 802E8134 0C0B9604 */ jal init_synthetic_wave -/* 0A7938 802E8138 02202825 */ move $a1, $s1 -.L8020214C: -/* 0A793C 802E813C 52400005 */ beql $s2, $zero, .L80202164 -/* 0A7940 802E8140 8E240040 */ lw $a0, 0x40($s1) -/* 0A7944 802E8144 0C0B97FC */ jal alloc_note -/* 0A7948 802E8148 02202025 */ move $a0, $s1 -/* 0A794C 802E814C AE220040 */ sw $v0, 0x40($s1) -/* 0A7950 802E8150 8E240040 */ lw $a0, 0x40($s1) -.L80202164: -/* 0A7954 802E8154 50800007 */ beql $a0, $zero, .L80202184 -/* 0A7958 802E8158 8FBF002C */ lw $ra, 0x2c($sp) -/* 0A795C 802E815C 8C8A0044 */ lw $t2, 0x44($a0) -/* 0A7960 802E8160 562A0004 */ bnel $s1, $t2, .L80202184 -/* 0A7964 802E8164 8FBF002C */ lw $ra, 0x2c($sp) -/* 0A7968 802E8168 0C0B9AA0 */ jal note_vibrato_init -/* 0A796C 802E816C 00000000 */ nop -.L80202180: -/* 0A7970 802E8170 8FBF002C */ lw $ra, 0x2c($sp) -.L80202184: -/* 0A7974 802E8174 8FB00018 */ lw $s0, 0x18($sp) -/* 0A7978 802E8178 8FB1001C */ lw $s1, 0x1c($sp) -/* 0A797C 802E817C 8FB20020 */ lw $s2, 0x20($sp) -/* 0A7980 802E8180 8FB30024 */ lw $s3, 0x24($sp) -/* 0A7984 802E8184 8FB40028 */ lw $s4, 0x28($sp) -/* 0A7988 802E8188 03E00008 */ jr $ra -/* 0A798C 802E818C 27BD0070 */ addiu $sp, $sp, 0x70 diff --git a/asm/non_matchings/eu/audio/sequence_channel_process_script.s b/asm/non_matchings/eu/audio/sequence_channel_process_script.s deleted file mode 100644 index 802f5b1567..0000000000 --- a/asm/non_matchings/eu/audio/sequence_channel_process_script.s +++ /dev/null @@ -1,929 +0,0 @@ -.late_rodata -.late_rodata_alignment 4 -glabel jtbl_EU_80306714 - .word L_EU_802E8650 - .word L_EU_802E85A0, L_EU_802E866C - .word L_EU_802E867C, L_EU_802E85BC - .word L_EU_802E8888, L_EU_802E88E4 - .word L_EU_802E891C, L_EU_802E891C - .word L_EU_802E8968, L_EU_802E8978 - .word L_EU_802E891C, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8998, L_EU_802E89BC - .word L_EU_802E89CC, L_EU_802E8714 - .word L_EU_802E8878, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E87E0 - .word L_EU_802E87C4, L_EU_802E87B4 - .word L_EU_802E8798, L_EU_802E8780 - .word L_EU_802E8764, L_EU_802E8748 - .word L_EU_802E86E0, L_EU_802E868C - .word L_EU_802E86B0, L_EU_802E8830 - .word L_EU_802E87FC, L_EU_802E8864 - .word L_EU_802E89EC, L_EU_802E89DC - .word L_EU_802E8A48, L_EU_802E8A58 - .word L_EU_802E8AC0, L_EU_802E8B60 - .word L_EU_802E83EC, L_EU_802E85F8 - .word L_EU_802E8B38, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8590, L_EU_802E8568 - .word L_EU_802E8520, L_EU_802E8520 - .word L_EU_802E8520, L_EU_802E84C8 - .word L_EU_802E84B8, L_EU_802E8470 - .word L_EU_802E8438, L_EU_802E84C8 - .word L_EU_802E84C8, L_EU_802E84C8 - .word L_EU_802E83FC, L_EU_802E83DC - .word L_EU_802E8D98, L_EU_802E83A4 - -glabel jtbl_EU_80306810 - .word L_EU_802E8B9C, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8CFC, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8D2C, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8D48, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8D70, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8C04, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8C20, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8BD4, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8BE4, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8C2C, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8C78, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8368, L_EU_802E8368 - .word L_EU_802E8C94 - -.text -glabel sequence_channel_process_script -/* 0A7AB8 802E82B8 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0A7ABC 802E82BC AFBF002C */ sw $ra, 0x2c($sp) -/* 0A7AC0 802E82C0 AFB40028 */ sw $s4, 0x28($sp) -/* 0A7AC4 802E82C4 AFB30024 */ sw $s3, 0x24($sp) -/* 0A7AC8 802E82C8 AFB20020 */ sw $s2, 0x20($sp) -/* 0A7ACC 802E82CC AFB1001C */ sw $s1, 0x1c($sp) -/* 0A7AD0 802E82D0 AFB00018 */ sw $s0, 0x18($sp) -/* 0A7AD4 802E82D4 8C820000 */ lw $v0, ($a0) -/* 0A7AD8 802E82D8 00809025 */ move $s2, $a0 -/* 0A7ADC 802E82DC 000277C2 */ srl $t6, $v0, 0x1f -/* 0A7AE0 802E82E0 11C002B8 */ beqz $t6, .L080200BC4 -/* 0A7AE4 802E82E4 0002C080 */ sll $t8, $v0, 2 -/* 0A7AE8 802E82E8 0701000D */ bgez $t8, .L080200120 -/* 0A7AEC 802E82EC 00008025 */ move $s0, $zero -/* 0A7AF0 802E82F0 00808825 */ move $s1, $a0 -/* 0A7AF4 802E82F4 24120010 */ li $s2, 16 -.L0802000F8: -/* 0A7AF8 802E82F8 8E240048 */ lw $a0, 0x48($s1) -/* 0A7AFC 802E82FC 50800004 */ beql $a0, $zero, .L080200110 -/* 0A7B00 802E8300 26100004 */ addiu $s0, $s0, 4 -/* 0A7B04 802E8304 0C0B9DC2 */ jal seq_channel_layer_process_script -/* 0A7B08 802E8308 00000000 */ nop -/* 0A7B0C 802E830C 26100004 */ addiu $s0, $s0, 4 -.L080200110: -/* 0A7B10 802E8310 1612FFF9 */ bne $s0, $s2, .L0802000F8 -/* 0A7B14 802E8314 26310004 */ addiu $s1, $s1, 4 -/* 0A7B18 802E8318 100002AB */ b .L080200BC8 -/* 0A7B1C 802E831C 8FBF002C */ lw $ra, 0x2c($sp) -.L080200120: -/* 0A7B20 802E8320 8E540044 */ lw $s4, 0x44($s2) -/* 0A7B24 802E8324 8E990000 */ lw $t9, ($s4) -/* 0A7B28 802E8328 00195080 */ sll $t2, $t9, 2 -/* 0A7B2C 802E832C 05430006 */ bgezl $t2, .L080200148 -/* 0A7B30 802E8330 9643001A */ lhu $v1, 0x1a($s2) -/* 0A7B34 802E8334 924B0003 */ lbu $t3, 3($s2) -/* 0A7B38 802E8338 316C0080 */ andi $t4, $t3, 0x80 -/* 0A7B3C 802E833C 558002A2 */ bnezl $t4, .L080200BC8 -/* 0A7B40 802E8340 8FBF002C */ lw $ra, 0x2c($sp) -/* 0A7B44 802E8344 9643001A */ lhu $v1, 0x1a($s2) -.L080200148: -/* 0A7B48 802E8348 26510060 */ addiu $s1, $s2, 0x60 -/* 0A7B4C 802E834C 10600004 */ beqz $v1, .L080200160 -/* 0A7B50 802E8350 00601025 */ move $v0, $v1 -/* 0A7B54 802E8354 246DFFFF */ addiu $t5, $v1, -1 -/* 0A7B58 802E8358 A64D001A */ sh $t5, 0x1a($s2) -/* 0A7B5C 802E835C 31A2FFFF */ andi $v0, $t5, 0xffff -.L080200160: -/* 0A7B60 802E8360 1440028D */ bnez $v0, .L_EU_802E8D98 -/* 0A7B64 802E8364 83B3004B */ lb $s3, 0x4b($sp) -glabel L_EU_802E8368 -.L_EU_802E8368: -/* 0A7B68 802E8368 0C0B9DA0 */ jal m64_read_u8 -/* 0A7B6C 802E836C 02202025 */ move $a0, $s1 -/* 0A7B70 802E8370 284100C1 */ slti $at, $v0, 0xc1 -/* 0A7B74 802E8374 305000FF */ andi $s0, $v0, 0xff -/* 0A7B78 802E8378 142001FD */ bnez $at, .L080200970 -/* 0A7B7C 802E837C 00401825 */ move $v1, $v0 -/* 0A7B80 802E8380 244EFF3F */ addiu $t6, $v0, -0xc1 -/* 0A7B84 802E8384 2DC1003F */ sltiu $at, $t6, 0x3f -/* 0A7B88 802E8388 1020FFF7 */ beqz $at, .L_EU_802E8368 -/* 0A7B8C 802E838C 000E7080 */ sll $t6, $t6, 2 -/* 0A7B90 802E8390 3C018030 */ lui $at, %hi(jtbl_EU_80306714) -/* 0A7B94 802E8394 002E0821 */ addu $at, $at, $t6 -/* 0A7B98 802E8398 8C2E6714 */ lw $t6, %lo(jtbl_EU_80306714)($at) -/* 0A7B9C 802E839C 01C00008 */ jr $t6 -/* 0A7BA0 802E83A0 00000000 */ nop -glabel L_EU_802E83A4 -/* 0A7BA4 802E83A4 92240018 */ lbu $a0, 0x18($s1) -/* 0A7BA8 802E83A8 14800005 */ bnez $a0, .L0802001C0 -/* 0A7BAC 802E83AC 2482FFFF */ addiu $v0, $a0, -1 -/* 0A7BB0 802E83B0 0C0B9C41 */ jal sequence_channel_disable -/* 0A7BB4 802E83B4 02402025 */ move $a0, $s2 -/* 0A7BB8 802E83B8 10000278 */ b .L080200B9C -/* 0A7BBC 802E83BC 02408825 */ move $s1, $s2 -.L0802001C0: -/* 0A7BC0 802E83C0 304F00FF */ andi $t7, $v0, 0xff -/* 0A7BC4 802E83C4 000FC080 */ sll $t8, $t7, 2 -/* 0A7BC8 802E83C8 0238C821 */ addu $t9, $s1, $t8 -/* 0A7BCC 802E83CC A22F0018 */ sb $t7, 0x18($s1) -/* 0A7BD0 802E83D0 8F290004 */ lw $t1, 4($t9) -/* 0A7BD4 802E83D4 1000FFE4 */ b .L_EU_802E8368 -/* 0A7BD8 802E83D8 AE290000 */ sw $t1, ($s1) -glabel L_EU_802E83DC -/* 0A7BDC 802E83DC 0C0B9DB1 */ jal m64_read_compressed_u16 -/* 0A7BE0 802E83E0 02202025 */ move $a0, $s1 -/* 0A7BE4 802E83E4 1000026C */ b .L_EU_802E8D98 -/* 0A7BE8 802E83E8 A642001A */ sh $v0, 0x1a($s2) -glabel L_EU_802E83EC -/* 0A7BEC 802E83EC 924B0000 */ lbu $t3, ($s2) -/* 0A7BF0 802E83F0 356C0020 */ ori $t4, $t3, 0x20 -/* 0A7BF4 802E83F4 10000268 */ b .L_EU_802E8D98 -/* 0A7BF8 802E83F8 A24C0000 */ sb $t4, ($s2) -glabel L_EU_802E83FC -/* 0A7BFC 802E83FC 0C0B9DA5 */ jal m64_read_s16 -/* 0A7C00 802E8400 02202025 */ move $a0, $s1 -/* 0A7C04 802E8404 922E0018 */ lbu $t6, 0x18($s1) -/* 0A7C08 802E8408 8E2D0000 */ lw $t5, ($s1) -/* 0A7C0C 802E840C 304BFFFF */ andi $t3, $v0, 0xffff -/* 0A7C10 802E8410 000E7880 */ sll $t7, $t6, 2 -/* 0A7C14 802E8414 022FC021 */ addu $t8, $s1, $t7 -/* 0A7C18 802E8418 AF0D0004 */ sw $t5, 4($t8) -/* 0A7C1C 802E841C 92390018 */ lbu $t9, 0x18($s1) -/* 0A7C20 802E8420 27290001 */ addiu $t1, $t9, 1 -/* 0A7C24 802E8424 A2290018 */ sb $t1, 0x18($s1) -/* 0A7C28 802E8428 8E8A0014 */ lw $t2, 0x14($s4) -/* 0A7C2C 802E842C 014B6021 */ addu $t4, $t2, $t3 -/* 0A7C30 802E8430 1000FFCD */ b .L_EU_802E8368 -/* 0A7C34 802E8434 AE2C0000 */ sw $t4, ($s1) -glabel L_EU_802E8438 -/* 0A7C38 802E8438 0C0B9DA0 */ jal m64_read_u8 -/* 0A7C3C 802E843C 02202025 */ move $a0, $s1 -/* 0A7C40 802E8440 922E0018 */ lbu $t6, 0x18($s1) -/* 0A7C44 802E8444 022E7821 */ addu $t7, $s1, $t6 -/* 0A7C48 802E8448 A1E20014 */ sb $v0, 0x14($t7) -/* 0A7C4C 802E844C 92380018 */ lbu $t8, 0x18($s1) -/* 0A7C50 802E8450 8E2D0000 */ lw $t5, ($s1) -/* 0A7C54 802E8454 0018C880 */ sll $t9, $t8, 2 -/* 0A7C58 802E8458 02394821 */ addu $t1, $s1, $t9 -/* 0A7C5C 802E845C AD2D0004 */ sw $t5, 4($t1) -/* 0A7C60 802E8460 922A0018 */ lbu $t2, 0x18($s1) -/* 0A7C64 802E8464 254B0001 */ addiu $t3, $t2, 1 -/* 0A7C68 802E8468 1000FFBF */ b .L_EU_802E8368 -/* 0A7C6C 802E846C A22B0018 */ sb $t3, 0x18($s1) -glabel L_EU_802E8470 -/* 0A7C70 802E8470 922C0018 */ lbu $t4, 0x18($s1) -/* 0A7C74 802E8474 022C1021 */ addu $v0, $s1, $t4 -/* 0A7C78 802E8478 904E0013 */ lbu $t6, 0x13($v0) -/* 0A7C7C 802E847C 25CFFFFF */ addiu $t7, $t6, -1 -/* 0A7C80 802E8480 A04F0013 */ sb $t7, 0x13($v0) -/* 0A7C84 802E8484 92240018 */ lbu $a0, 0x18($s1) -/* 0A7C88 802E8488 0224C021 */ addu $t8, $s1, $a0 -/* 0A7C8C 802E848C 93190013 */ lbu $t9, 0x13($t8) -/* 0A7C90 802E8490 00801825 */ move $v1, $a0 -/* 0A7C94 802E8494 00036880 */ sll $t5, $v1, 2 -/* 0A7C98 802E8498 13200005 */ beqz $t9, .L0802002B0 -/* 0A7C9C 802E849C 248BFFFF */ addiu $t3, $a0, -1 -/* 0A7CA0 802E84A0 022D4821 */ addu $t1, $s1, $t5 -/* 0A7CA4 802E84A4 8D2A0000 */ lw $t2, ($t1) -/* 0A7CA8 802E84A8 1000FFAF */ b .L_EU_802E8368 -/* 0A7CAC 802E84AC AE2A0000 */ sw $t2, ($s1) -.L0802002B0: -/* 0A7CB0 802E84B0 1000FFAD */ b .L_EU_802E8368 -/* 0A7CB4 802E84B4 A22B0018 */ sb $t3, 0x18($s1) -glabel L_EU_802E84B8 -/* 0A7CB8 802E84B8 922C0018 */ lbu $t4, 0x18($s1) -/* 0A7CBC 802E84BC 258EFFFF */ addiu $t6, $t4, -1 -/* 0A7CC0 802E84C0 1000FFA9 */ b .L_EU_802E8368 -/* 0A7CC4 802E84C4 A22E0018 */ sb $t6, 0x18($s1) -glabel L_EU_802E84C8 -/* 0A7CC8 802E84C8 0C0B9DA5 */ jal m64_read_s16 -/* 0A7CCC 802E84CC 02202025 */ move $a0, $s1 -/* 0A7CD0 802E84D0 240100FA */ li $at, 250 -/* 0A7CD4 802E84D4 16010003 */ bne $s0, $at, .L0802002E4 -/* 0A7CD8 802E84D8 02001825 */ move $v1, $s0 -/* 0A7CDC 802E84DC 1660FFA2 */ bnez $s3, .L_EU_802E8368 -/* 0A7CE0 802E84E0 00000000 */ nop -.L0802002E4: -/* 0A7CE4 802E84E4 240100F9 */ li $at, 249 -/* 0A7CE8 802E84E8 54610004 */ bnel $v1, $at, .L0802002FC -/* 0A7CEC 802E84EC 240100F5 */ li $at, 245 -/* 0A7CF0 802E84F0 0661FF9D */ bgez $s3, .L_EU_802E8368 -/* 0A7CF4 802E84F4 00000000 */ nop -/* 0A7CF8 802E84F8 240100F5 */ li $at, 245 -.L0802002FC: -/* 0A7CFC 802E84FC 54610004 */ bnel $v1, $at, .L080200310 -/* 0A7D00 802E8500 8E8F0014 */ lw $t7, 0x14($s4) -/* 0A7D04 802E8504 0660FF98 */ bltz $s3, .L_EU_802E8368 -/* 0A7D08 802E8508 00000000 */ nop -/* 0A7D0C 802E850C 8E8F0014 */ lw $t7, 0x14($s4) -.L080200310: -/* 0A7D10 802E8510 3058FFFF */ andi $t8, $v0, 0xffff -/* 0A7D14 802E8514 01F8C821 */ addu $t9, $t7, $t8 -/* 0A7D18 802E8518 1000FF93 */ b .L_EU_802E8368 -/* 0A7D1C 802E851C AE390000 */ sw $t9, ($s1) -glabel L_EU_802E8520 -/* 0A7D20 802E8520 0C0B9DA0 */ jal m64_read_u8 -/* 0A7D24 802E8524 02202025 */ move $a0, $s1 -/* 0A7D28 802E8528 240100F3 */ li $at, 243 -/* 0A7D2C 802E852C 16010003 */ bne $s0, $at, .L08020033C -/* 0A7D30 802E8530 02001825 */ move $v1, $s0 -/* 0A7D34 802E8534 1660FF8C */ bnez $s3, .L_EU_802E8368 -/* 0A7D38 802E8538 00000000 */ nop -.L08020033C: -/* 0A7D3C 802E853C 240100F2 */ li $at, 242 -/* 0A7D40 802E8540 54610004 */ bnel $v1, $at, .L080200354 -/* 0A7D44 802E8544 8E2D0000 */ lw $t5, ($s1) -/* 0A7D48 802E8548 0661FF87 */ bgez $s3, .L_EU_802E8368 -/* 0A7D4C 802E854C 00000000 */ nop -/* 0A7D50 802E8550 8E2D0000 */ lw $t5, ($s1) -.L080200354: -/* 0A7D54 802E8554 00024E00 */ sll $t1, $v0, 0x18 -/* 0A7D58 802E8558 00095603 */ sra $t2, $t1, 0x18 -/* 0A7D5C 802E855C 01AA5821 */ addu $t3, $t5, $t2 -/* 0A7D60 802E8560 1000FF81 */ b .L_EU_802E8368 -/* 0A7D64 802E8564 AE2B0000 */ sw $t3, ($s1) -glabel L_EU_802E8568 -/* 0A7D68 802E8568 26500084 */ addiu $s0, $s2, 0x84 -/* 0A7D6C 802E856C 0C0B9671 */ jal note_pool_clear -/* 0A7D70 802E8570 02002025 */ move $a0, $s0 -/* 0A7D74 802E8574 0C0B9DA0 */ jal m64_read_u8 -/* 0A7D78 802E8578 02202025 */ move $a0, $s1 -/* 0A7D7C 802E857C 02002025 */ move $a0, $s0 -/* 0A7D80 802E8580 0C0B96C9 */ jal note_pool_fill -/* 0A7D84 802E8584 00402825 */ move $a1, $v0 -/* 0A7D88 802E8588 1000FF77 */ b .L_EU_802E8368 -/* 0A7D8C 802E858C 00000000 */ nop -glabel L_EU_802E8590 -/* 0A7D90 802E8590 0C0B9671 */ jal note_pool_clear -/* 0A7D94 802E8594 26440084 */ addiu $a0, $s2, 0x84 -/* 0A7D98 802E8598 1000FF73 */ b .L_EU_802E8368 -/* 0A7D9C 802E859C 00000000 */ nop -glabel L_EU_802E85A0 -/* 0A7DA0 802E85A0 0C0B9DA5 */ jal m64_read_s16 -/* 0A7DA4 802E85A4 02202025 */ move $a0, $s1 -/* 0A7DA8 802E85A8 8E8C0014 */ lw $t4, 0x14($s4) -/* 0A7DAC 802E85AC 304EFFFF */ andi $t6, $v0, 0xffff -/* 0A7DB0 802E85B0 018E7821 */ addu $t7, $t4, $t6 -/* 0A7DB4 802E85B4 1000FF6C */ b .L_EU_802E8368 -/* 0A7DB8 802E85B8 AE4F0034 */ sw $t7, 0x34($s2) -glabel L_EU_802E85BC -/* 0A7DBC 802E85BC 2401FFFF */ li $at, -1 -/* 0A7DC0 802E85C0 1261FF69 */ beq $s3, $at, .L_EU_802E8368 -/* 0A7DC4 802E85C4 00000000 */ nop -/* 0A7DC8 802E85C8 8E580034 */ lw $t8, 0x34($s2) -/* 0A7DCC 802E85CC 0013C840 */ sll $t9, $s3, 1 -/* 0A7DD0 802E85D0 8E8C0014 */ lw $t4, 0x14($s4) -/* 0A7DD4 802E85D4 03191821 */ addu $v1, $t8, $t9 -/* 0A7DD8 802E85D8 906D0000 */ lbu $t5, ($v1) -/* 0A7DDC 802E85DC 90690001 */ lbu $t1, 1($v1) -/* 0A7DE0 802E85E0 000D5200 */ sll $t2, $t5, 8 -/* 0A7DE4 802E85E4 012A3821 */ addu $a3, $t1, $t2 -/* 0A7DE8 802E85E8 30EBFFFF */ andi $t3, $a3, 0xffff -/* 0A7DEC 802E85EC 018B7021 */ addu $t6, $t4, $t3 -/* 0A7DF0 802E85F0 1000FF5D */ b .L_EU_802E8368 -/* 0A7DF4 802E85F4 AE4E0034 */ sw $t6, 0x34($s2) -glabel L_EU_802E85F8 -/* 0A7DF8 802E85F8 0C0B9DA0 */ jal m64_read_u8 -/* 0A7DFC 802E85FC 02202025 */ move $a0, $s1 -/* 0A7E00 802E8600 928F0004 */ lbu $t7, 4($s4) -/* 0A7E04 802E8604 3C038023 */ lui $v1, %hi(gAlBankSets) # $v1, 0x8023 -/* 0A7E08 802E8608 8C6397D0 */ lw $v1, %lo(gAlBankSets)($v1) -/* 0A7E0C 802E860C 000FC040 */ sll $t8, $t7, 1 -/* 0A7E10 802E8610 3C048022 */ lui $a0, %hi(gBankLoadedPool) # $a0, 0x8022 -/* 0A7E14 802E8614 0078C821 */ addu $t9, $v1, $t8 -/* 0A7E18 802E8618 97270000 */ lhu $a3, ($t9) -/* 0A7E1C 802E861C 24842840 */ addiu $a0, %lo(gBankLoadedPool) # addiu $a0, $a0, 0x2840 -/* 0A7E20 802E8620 24050002 */ li $a1, 2 -/* 0A7E24 802E8624 00E36821 */ addu $t5, $a3, $v1 -/* 0A7E28 802E8628 91A80000 */ lbu $t0, ($t5) -/* 0A7E2C 802E862C 00E84821 */ addu $t1, $a3, $t0 -/* 0A7E30 802E8630 01225023 */ subu $t2, $t1, $v0 -/* 0A7E34 802E8634 01435821 */ addu $t3, $t2, $v1 -/* 0A7E38 802E8638 91700000 */ lbu $s0, ($t3) -/* 0A7E3C 802E863C 0C0B89CF */ jal get_bank_or_seq -/* 0A7E40 802E8640 02003025 */ move $a2, $s0 -/* 0A7E44 802E8644 10400002 */ beqz $v0, .L_EU_802E8650 -/* 0A7E48 802E8648 00000000 */ nop -/* 0A7E4C 802E864C A2500006 */ sb $s0, 6($s2) -glabel L_EU_802E8650 -.L_EU_802E8650: -/* 0A7E50 802E8650 0C0B9DA0 */ jal m64_read_u8 -/* 0A7E54 802E8654 02202025 */ move $a0, $s1 -/* 0A7E58 802E8658 02402025 */ move $a0, $s2 -/* 0A7E5C 802E865C 0C0BA080 */ jal set_instrument -/* 0A7E60 802E8660 304500FF */ andi $a1, $v0, 0xff -/* 0A7E64 802E8664 1000FF40 */ b .L_EU_802E8368 -/* 0A7E68 802E8668 00000000 */ nop -glabel L_EU_802E866C -/* 0A7E6C 802E866C 924C0000 */ lbu $t4, ($s2) -/* 0A7E70 802E8670 318EFFFD */ andi $t6, $t4, 0xfffd -/* 0A7E74 802E8674 1000FF3C */ b .L_EU_802E8368 -/* 0A7E78 802E8678 A24E0000 */ sb $t6, ($s2) -glabel L_EU_802E867C -/* 0A7E7C 802E867C 92580000 */ lbu $t8, ($s2) -/* 0A7E80 802E8680 37190002 */ ori $t9, $t8, 2 -/* 0A7E84 802E8684 1000FF38 */ b .L_EU_802E8368 -/* 0A7E88 802E8688 A2590000 */ sb $t9, ($s2) -glabel L_EU_802E868C -/* 0A7E8C 802E868C 0C0B9DA0 */ jal m64_read_u8 -/* 0A7E90 802E8690 02202025 */ move $a0, $s1 -/* 0A7E94 802E8694 02402025 */ move $a0, $s2 -/* 0A7E98 802E8698 0C0BA0A5 */ jal sequence_channel_set_volume -/* 0A7E9C 802E869C 304500FF */ andi $a1, $v0, 0xff -/* 0A7EA0 802E86A0 92490001 */ lbu $t1, 1($s2) -/* 0A7EA4 802E86A4 352A0040 */ ori $t2, $t1, 0x40 -/* 0A7EA8 802E86A8 1000FF2F */ b .L_EU_802E8368 -/* 0A7EAC 802E86AC A24A0001 */ sb $t2, 1($s2) -glabel L_EU_802E86B0 -/* 0A7EB0 802E86B0 0C0B9DA0 */ jal m64_read_u8 -/* 0A7EB4 802E86B4 02202025 */ move $a0, $s1 -/* 0A7EB8 802E86B8 44822000 */ mtc1 $v0, $f4 -/* 0A7EBC 802E86BC 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 0A7EC0 802E86C0 44814000 */ mtc1 $at, $f8 -/* 0A7EC4 802E86C4 468021A0 */ cvt.s.w $f6, $f4 -/* 0A7EC8 802E86C8 924C0001 */ lbu $t4, 1($s2) -/* 0A7ECC 802E86CC 358E0040 */ ori $t6, $t4, 0x40 -/* 0A7ED0 802E86D0 A24E0001 */ sb $t6, 1($s2) -/* 0A7ED4 802E86D4 46083282 */ mul.s $f10, $f6, $f8 -/* 0A7ED8 802E86D8 1000FF23 */ b .L_EU_802E8368 -/* 0A7EDC 802E86DC E64A0020 */ swc1 $f10, 0x20($s2) -glabel L_EU_802E86E0 -/* 0A7EE0 802E86E0 0C0B9DA5 */ jal m64_read_s16 -/* 0A7EE4 802E86E4 02202025 */ move $a0, $s1 -/* 0A7EE8 802E86E8 304FFFFF */ andi $t7, $v0, 0xffff -/* 0A7EEC 802E86EC 448F8000 */ mtc1 $t7, $f16 -/* 0A7EF0 802E86F0 3C014700 */ li $at, 0x47000000 # 32768.000000 -/* 0A7EF4 802E86F4 44812000 */ mtc1 $at, $f4 -/* 0A7EF8 802E86F8 468084A0 */ cvt.s.w $f18, $f16 -/* 0A7EFC 802E86FC 92590001 */ lbu $t9, 1($s2) -/* 0A7F00 802E8700 372D0080 */ ori $t5, $t9, 0x80 -/* 0A7F04 802E8704 A24D0001 */ sb $t5, 1($s2) -/* 0A7F08 802E8708 46049183 */ div.s $f6, $f18, $f4 -/* 0A7F0C 802E870C 1000FF16 */ b .L_EU_802E8368 -/* 0A7F10 802E8710 E6460030 */ swc1 $f6, 0x30($s2) -glabel L_EU_802E8714 -/* 0A7F14 802E8714 0C0B9DA0 */ jal m64_read_u8 -/* 0A7F18 802E8718 02202025 */ move $a0, $s1 -/* 0A7F1C 802E871C 2449007F */ addiu $t1, $v0, 0x7f -/* 0A7F20 802E8720 312A00FF */ andi $t2, $t1, 0xff -/* 0A7F24 802E8724 924E0001 */ lbu $t6, 1($s2) -/* 0A7F28 802E8728 000A5880 */ sll $t3, $t2, 2 -/* 0A7F2C 802E872C 3C018030 */ lui $at, %hi(gPitchBendFrequencyScale) -/* 0A7F30 802E8730 002B0821 */ addu $at, $at, $t3 -/* 0A7F34 802E8734 C42806E8 */ lwc1 $f8, %lo(gPitchBendFrequencyScale)($at) -/* 0A7F38 802E8738 35CF0080 */ ori $t7, $t6, 0x80 -/* 0A7F3C 802E873C A24F0001 */ sb $t7, 1($s2) -/* 0A7F40 802E8740 1000FF09 */ b .L_EU_802E8368 -/* 0A7F44 802E8744 E6480030 */ swc1 $f8, 0x30($s2) -glabel L_EU_802E8748 -/* 0A7F48 802E8748 0C0B9DA0 */ jal m64_read_u8 -/* 0A7F4C 802E874C 02202025 */ move $a0, $s1 -/* 0A7F50 802E8750 92590001 */ lbu $t9, 1($s2) -/* 0A7F54 802E8754 A2420009 */ sb $v0, 9($s2) -/* 0A7F58 802E8758 372D0020 */ ori $t5, $t9, 0x20 -/* 0A7F5C 802E875C 1000FF02 */ b .L_EU_802E8368 -/* 0A7F60 802E8760 A24D0001 */ sb $t5, 1($s2) -glabel L_EU_802E8764 -/* 0A7F64 802E8764 0C0B9DA0 */ jal m64_read_u8 -/* 0A7F68 802E8768 02202025 */ move $a0, $s1 -/* 0A7F6C 802E876C 924A0001 */ lbu $t2, 1($s2) -/* 0A7F70 802E8770 A242000A */ sb $v0, 0xa($s2) -/* 0A7F74 802E8774 354B0020 */ ori $t3, $t2, 0x20 -/* 0A7F78 802E8778 1000FEFB */ b .L_EU_802E8368 -/* 0A7F7C 802E877C A24B0001 */ sb $t3, 1($s2) -glabel L_EU_802E8780 -/* 0A7F80 802E8780 8E220000 */ lw $v0, ($s1) -/* 0A7F84 802E8784 80430000 */ lb $v1, ($v0) -/* 0A7F88 802E8788 244C0001 */ addiu $t4, $v0, 1 -/* 0A7F8C 802E878C AE2C0000 */ sw $t4, ($s1) -/* 0A7F90 802E8790 1000FEF5 */ b .L_EU_802E8368 -/* 0A7F94 802E8794 A643001E */ sh $v1, 0x1e($s2) -glabel L_EU_802E8798 -/* 0A7F98 802E8798 0C0B9DA5 */ jal m64_read_s16 -/* 0A7F9C 802E879C 02202025 */ move $a0, $s1 -/* 0A7FA0 802E87A0 8E8E0014 */ lw $t6, 0x14($s4) -/* 0A7FA4 802E87A4 304FFFFF */ andi $t7, $v0, 0xffff -/* 0A7FA8 802E87A8 01CFC021 */ addu $t8, $t6, $t7 -/* 0A7FAC 802E87AC 1000FEEE */ b .L_EU_802E8368 -/* 0A7FB0 802E87B0 AE580080 */ sw $t8, 0x80($s2) -glabel L_EU_802E87B4 -/* 0A7FB4 802E87B4 0C0B9DA0 */ jal m64_read_u8 -/* 0A7FB8 802E87B8 02202025 */ move $a0, $s1 -/* 0A7FBC 802E87BC 1000FEEA */ b .L_EU_802E8368 -/* 0A7FC0 802E87C0 A242007C */ sb $v0, 0x7c($s2) -glabel L_EU_802E87C4 -/* 0A7FC4 802E87C4 0C0B9DA0 */ jal m64_read_u8 -/* 0A7FC8 802E87C8 02202025 */ move $a0, $s1 -/* 0A7FCC 802E87CC 0002C8C0 */ sll $t9, $v0, 3 -/* 0A7FD0 802E87D0 A6590012 */ sh $t9, 0x12($s2) -/* 0A7FD4 802E87D4 A640000E */ sh $zero, 0xe($s2) -/* 0A7FD8 802E87D8 1000FEE3 */ b .L_EU_802E8368 -/* 0A7FDC 802E87DC A6400016 */ sh $zero, 0x16($s2) -glabel L_EU_802E87E0 -/* 0A7FE0 802E87E0 0C0B9DA0 */ jal m64_read_u8 -/* 0A7FE4 802E87E4 02202025 */ move $a0, $s1 -/* 0A7FE8 802E87E8 00021940 */ sll $v1, $v0, 5 -/* 0A7FEC 802E87EC A6430010 */ sh $v1, 0x10($s2) -/* 0A7FF0 802E87F0 A643000C */ sh $v1, 0xc($s2) -/* 0A7FF4 802E87F4 1000FEDC */ b .L_EU_802E8368 -/* 0A7FF8 802E87F8 A6400014 */ sh $zero, 0x14($s2) -glabel L_EU_802E87FC -/* 0A7FFC 802E87FC 0C0B9DA0 */ jal m64_read_u8 -/* 0A8000 802E8800 02202025 */ move $a0, $s1 -/* 0A8004 802E8804 000268C0 */ sll $t5, $v0, 3 -/* 0A8008 802E8808 A64D000E */ sh $t5, 0xe($s2) -/* 0A800C 802E880C 0C0B9DA0 */ jal m64_read_u8 -/* 0A8010 802E8810 02202025 */ move $a0, $s1 -/* 0A8014 802E8814 000248C0 */ sll $t1, $v0, 3 -/* 0A8018 802E8818 A6490012 */ sh $t1, 0x12($s2) -/* 0A801C 802E881C 0C0B9DA0 */ jal m64_read_u8 -/* 0A8020 802E8820 02202025 */ move $a0, $s1 -/* 0A8024 802E8824 00025100 */ sll $t2, $v0, 4 -/* 0A8028 802E8828 1000FECF */ b .L_EU_802E8368 -/* 0A802C 802E882C A64A0016 */ sh $t2, 0x16($s2) -glabel L_EU_802E8830 -/* 0A8030 802E8830 0C0B9DA0 */ jal m64_read_u8 -/* 0A8034 802E8834 02202025 */ move $a0, $s1 -/* 0A8038 802E8838 00025940 */ sll $t3, $v0, 5 -/* 0A803C 802E883C A64B000C */ sh $t3, 0xc($s2) -/* 0A8040 802E8840 0C0B9DA0 */ jal m64_read_u8 -/* 0A8044 802E8844 02202025 */ move $a0, $s1 -/* 0A8048 802E8848 00026140 */ sll $t4, $v0, 5 -/* 0A804C 802E884C A64C0010 */ sh $t4, 0x10($s2) -/* 0A8050 802E8850 0C0B9DA0 */ jal m64_read_u8 -/* 0A8054 802E8854 02202025 */ move $a0, $s1 -/* 0A8058 802E8858 00027100 */ sll $t6, $v0, 4 -/* 0A805C 802E885C 1000FEC2 */ b .L_EU_802E8368 -/* 0A8060 802E8860 A64E0014 */ sh $t6, 0x14($s2) -glabel L_EU_802E8864 -/* 0A8064 802E8864 0C0B9DA0 */ jal m64_read_u8 -/* 0A8068 802E8868 02202025 */ move $a0, $s1 -/* 0A806C 802E886C 00027900 */ sll $t7, $v0, 4 -/* 0A8070 802E8870 1000FEBD */ b .L_EU_802E8368 -/* 0A8074 802E8874 A64F0018 */ sh $t7, 0x18($s2) -glabel L_EU_802E8878 -/* 0A8078 802E8878 0C0B9DA0 */ jal m64_read_u8 -/* 0A807C 802E887C 02202025 */ move $a0, $s1 -/* 0A8080 802E8880 1000FEB9 */ b .L_EU_802E8368 -/* 0A8084 802E8884 A2420004 */ sb $v0, 4($s2) -glabel L_EU_802E8888 -/* 0A8088 802E8888 0C0B9DA0 */ jal m64_read_u8 -/* 0A808C 802E888C 02202025 */ move $a0, $s1 -/* 0A8090 802E8890 92980004 */ lbu $t8, 4($s4) -/* 0A8094 802E8894 3C038023 */ lui $v1, %hi(gAlBankSets) # $v1, 0x8023 -/* 0A8098 802E8898 8C6397D0 */ lw $v1, %lo(gAlBankSets)($v1) -/* 0A809C 802E889C 0018C840 */ sll $t9, $t8, 1 -/* 0A80A0 802E88A0 3C048022 */ lui $a0, %hi(gBankLoadedPool) # $a0, 0x8022 -/* 0A80A4 802E88A4 00796821 */ addu $t5, $v1, $t9 -/* 0A80A8 802E88A8 95A70000 */ lhu $a3, ($t5) -/* 0A80AC 802E88AC 24842840 */ addiu $a0, %lo(gBankLoadedPool) # addiu $a0, $a0, 0x2840 -/* 0A80B0 802E88B0 24050002 */ li $a1, 2 -/* 0A80B4 802E88B4 00E34821 */ addu $t1, $a3, $v1 -/* 0A80B8 802E88B8 91280000 */ lbu $t0, ($t1) -/* 0A80BC 802E88BC 00E85021 */ addu $t2, $a3, $t0 -/* 0A80C0 802E88C0 01425823 */ subu $t3, $t2, $v0 -/* 0A80C4 802E88C4 01636021 */ addu $t4, $t3, $v1 -/* 0A80C8 802E88C8 91900000 */ lbu $s0, ($t4) -/* 0A80CC 802E88CC 0C0B89CF */ jal get_bank_or_seq -/* 0A80D0 802E88D0 02003025 */ move $a2, $s0 -/* 0A80D4 802E88D4 1040FEA4 */ beqz $v0, .L_EU_802E8368 -/* 0A80D8 802E88D8 00000000 */ nop -/* 0A80DC 802E88DC 1000FEA2 */ b .L_EU_802E8368 -/* 0A80E0 802E88E0 A2500006 */ sb $s0, 6($s2) -glabel L_EU_802E88E4 -/* 0A80E4 802E88E4 326E00FF */ andi $t6, $s3, 0xff -/* 0A80E8 802E88E8 AFAE0034 */ sw $t6, 0x34($sp) -/* 0A80EC 802E88EC 0C0B9DA0 */ jal m64_read_u8 -/* 0A80F0 802E88F0 02202025 */ move $a0, $s1 -/* 0A80F4 802E88F4 305000FF */ andi $s0, $v0, 0xff -/* 0A80F8 802E88F8 0C0B9DA5 */ jal m64_read_s16 -/* 0A80FC 802E88FC 02202025 */ move $a0, $s1 -/* 0A8100 802E8900 8E8F0014 */ lw $t7, 0x14($s4) -/* 0A8104 802E8904 8FB90034 */ lw $t9, 0x34($sp) -/* 0A8108 802E8908 3058FFFF */ andi $t8, $v0, 0xffff -/* 0A810C 802E890C 01F81821 */ addu $v1, $t7, $t8 -/* 0A8110 802E8910 03306821 */ addu $t5, $t9, $s0 -/* 0A8114 802E8914 1000FE94 */ b .L_EU_802E8368 -/* 0A8118 802E8918 A06D0000 */ sb $t5, ($v1) -glabel L_EU_802E891C -/* 0A811C 802E891C 0C0B9DA0 */ jal m64_read_u8 -/* 0A8120 802E8920 02202025 */ move $a0, $s1 -/* 0A8124 802E8924 240100C8 */ li $at, 200 -/* 0A8128 802E8928 16010005 */ bne $s0, $at, .L080200740 -/* 0A812C 802E892C 02001825 */ move $v1, $s0 -/* 0A8130 802E8930 02629823 */ subu $s3, $s3, $v0 -/* 0A8134 802E8934 00135E00 */ sll $t3, $s3, 0x18 -/* 0A8138 802E8938 1000FE8B */ b .L_EU_802E8368 -/* 0A813C 802E893C 000B9E03 */ sra $s3, $t3, 0x18 -.L080200740: -/* 0A8140 802E8940 240100CC */ li $at, 204 -/* 0A8144 802E8944 14610005 */ bne $v1, $at, .L08020075C -/* 0A8148 802E8948 02629824 */ and $s3, $s3, $v0 -/* 0A814C 802E894C 00029E00 */ sll $s3, $v0, 0x18 -/* 0A8150 802E8950 00137603 */ sra $t6, $s3, 0x18 -/* 0A8154 802E8954 1000FE84 */ b .L_EU_802E8368 -/* 0A8158 802E8958 01C09825 */ move $s3, $t6 -.L08020075C: -/* 0A815C 802E895C 0013CE00 */ sll $t9, $s3, 0x18 -/* 0A8160 802E8960 1000FE81 */ b .L_EU_802E8368 -/* 0A8164 802E8964 00199E03 */ sra $s3, $t9, 0x18 -glabel L_EU_802E8968 -/* 0A8168 802E8968 0C0B9DA0 */ jal m64_read_u8 -/* 0A816C 802E896C 02202025 */ move $a0, $s1 -/* 0A8170 802E8970 1000FE7D */ b .L_EU_802E8368 -/* 0A8174 802E8974 A2420003 */ sb $v0, 3($s2) -glabel L_EU_802E8978 -/* 0A8178 802E8978 0C0B9DA5 */ jal m64_read_s16 -/* 0A817C 802E897C 02202025 */ move $a0, $s1 -/* 0A8180 802E8980 8E890014 */ lw $t1, 0x14($s4) -/* 0A8184 802E8984 304AFFFF */ andi $t2, $v0, 0xffff -/* 0A8188 802E8988 01535821 */ addu $t3, $t2, $s3 -/* 0A818C 802E898C 012B6021 */ addu $t4, $t1, $t3 -/* 0A8190 802E8990 1000FE75 */ b .L_EU_802E8368 -/* 0A8194 802E8994 81930000 */ lb $s3, ($t4) -glabel L_EU_802E8998 -/* 0A8198 802E8998 0C0B9DA0 */ jal m64_read_u8 -/* 0A819C 802E899C 02202025 */ move $a0, $s1 -/* 0A81A0 802E89A0 92590000 */ lbu $t9, ($s2) -/* 0A81A4 802E89A4 00027880 */ sll $t7, $v0, 2 -/* 0A81A8 802E89A8 31F80004 */ andi $t8, $t7, 4 -/* 0A81AC 802E89AC 332DFFFB */ andi $t5, $t9, 0xfffb -/* 0A81B0 802E89B0 030D5025 */ or $t2, $t8, $t5 -/* 0A81B4 802E89B4 1000FE6C */ b .L_EU_802E8368 -/* 0A81B8 802E89B8 A24A0000 */ sb $t2, ($s2) -glabel L_EU_802E89BC -/* 0A81BC 802E89BC 0C0B9DA0 */ jal m64_read_u8 -/* 0A81C0 802E89C0 02202025 */ move $a0, $s1 -/* 0A81C4 802E89C4 1000FE68 */ b .L_EU_802E8368 -/* 0A81C8 802E89C8 A2420002 */ sb $v0, 2($s2) -glabel L_EU_802E89CC -/* 0A81CC 802E89CC 0C0B9DA0 */ jal m64_read_u8 -/* 0A81D0 802E89D0 02202025 */ move $a0, $s1 -/* 0A81D4 802E89D4 1000FE64 */ b .L_EU_802E8368 -/* 0A81D8 802E89D8 A242007D */ sb $v0, 0x7d($s2) -glabel L_EU_802E89DC -/* 0A81DC 802E89DC 0C0B9DA0 */ jal m64_read_u8 -/* 0A81E0 802E89E0 02202025 */ move $a0, $s1 -/* 0A81E4 802E89E4 1000FE60 */ b .L_EU_802E8368 -/* 0A81E8 802E89E8 A2420007 */ sb $v0, 7($s2) -glabel L_EU_802E89EC -/* 0A81EC 802E89EC 2401FFFF */ li $at, -1 -/* 0A81F0 802E89F0 1261FE5D */ beq $s3, $at, .L_EU_802E8368 -/* 0A81F4 802E89F4 00000000 */ nop -/* 0A81F8 802E89F8 92240018 */ lbu $a0, 0x18($s1) -/* 0A81FC 802E89FC 8E2B0000 */ lw $t3, ($s1) -/* 0A8200 802E8A00 8E490034 */ lw $t1, 0x34($s2) -/* 0A8204 802E8A04 00046080 */ sll $t4, $a0, 2 -/* 0A8208 802E8A08 022C7021 */ addu $t6, $s1, $t4 -/* 0A820C 802E8A0C ADCB0004 */ sw $t3, 4($t6) -/* 0A8210 802E8A10 922F0018 */ lbu $t7, 0x18($s1) -/* 0A8214 802E8A14 00131040 */ sll $v0, $s3, 1 -/* 0A8218 802E8A18 01221821 */ addu $v1, $t1, $v0 -/* 0A821C 802E8A1C 25F90001 */ addiu $t9, $t7, 1 -/* 0A8220 802E8A20 A2390018 */ sb $t9, 0x18($s1) -/* 0A8224 802E8A24 906D0000 */ lbu $t5, ($v1) -/* 0A8228 802E8A28 90780001 */ lbu $t8, 1($v1) -/* 0A822C 802E8A2C 8E8C0014 */ lw $t4, 0x14($s4) -/* 0A8230 802E8A30 000D5200 */ sll $t2, $t5, 8 -/* 0A8234 802E8A34 030A3821 */ addu $a3, $t8, $t2 -/* 0A8238 802E8A38 30E9FFFF */ andi $t1, $a3, 0xffff -/* 0A823C 802E8A3C 01895821 */ addu $t3, $t4, $t1 -/* 0A8240 802E8A40 1000FE49 */ b .L_EU_802E8368 -/* 0A8244 802E8A44 AE2B0000 */ sw $t3, ($s1) -glabel L_EU_802E8A48 -/* 0A8248 802E8A48 0C0B9DA0 */ jal m64_read_u8 -/* 0A824C 802E8A4C 02202025 */ move $a0, $s1 -/* 0A8250 802E8A50 1000FE45 */ b .L_EU_802E8368 -/* 0A8254 802E8A54 A2420008 */ sb $v0, 8($s2) -glabel L_EU_802E8A58 -/* 0A8258 802E8A58 0C0B9DA5 */ jal m64_read_s16 -/* 0A825C 802E8A5C 02202025 */ move $a0, $s1 -/* 0A8260 802E8A60 8E8E0014 */ lw $t6, 0x14($s4) -/* 0A8264 802E8A64 304FFFFF */ andi $t7, $v0, 0xffff -/* 0A8268 802E8A68 01CF1821 */ addu $v1, $t6, $t7 -/* 0A826C 802E8A6C 90790000 */ lbu $t9, ($v1) -/* 0A8270 802E8A70 24630007 */ addiu $v1, $v1, 7 -/* 0A8274 802E8A74 A2590003 */ sb $t9, 3($s2) -/* 0A8278 802E8A78 906DFFFA */ lbu $t5, -6($v1) -/* 0A827C 802E8A7C 92590001 */ lbu $t9, 1($s2) -/* 0A8280 802E8A80 A24D0002 */ sb $t5, 2($s2) -/* 0A8284 802E8A84 9078FFFB */ lbu $t8, -5($v1) -/* 0A8288 802E8A88 372D0020 */ ori $t5, $t9, 0x20 -/* 0A828C 802E8A8C A2580005 */ sb $t8, 5($s2) -/* 0A8290 802E8A90 806AFFFC */ lb $t2, -4($v1) -/* 0A8294 802E8A94 A64A001E */ sh $t2, 0x1e($s2) -/* 0A8298 802E8A98 9069FFFD */ lbu $t1, -3($v1) -/* 0A829C 802E8A9C A2490009 */ sb $t1, 9($s2) -/* 0A82A0 802E8AA0 906CFFFE */ lbu $t4, -2($v1) -/* 0A82A4 802E8AA4 A24C000A */ sb $t4, 0xa($s2) -/* 0A82A8 802E8AA8 906BFFFF */ lbu $t3, -1($v1) -/* 0A82AC 802E8AAC A24B0004 */ sb $t3, 4($s2) -/* 0A82B0 802E8AB0 906E0000 */ lbu $t6, ($v1) -/* 0A82B4 802E8AB4 A24D0001 */ sb $t5, 1($s2) -/* 0A82B8 802E8AB8 1000FE2B */ b .L_EU_802E8368 -/* 0A82BC 802E8ABC A24E0007 */ sb $t6, 7($s2) -glabel L_EU_802E8AC0 -/* 0A82C0 802E8AC0 0C0B9DA0 */ jal m64_read_u8 -/* 0A82C4 802E8AC4 02202025 */ move $a0, $s1 -/* 0A82C8 802E8AC8 A2420003 */ sb $v0, 3($s2) -/* 0A82CC 802E8ACC 0C0B9DA0 */ jal m64_read_u8 -/* 0A82D0 802E8AD0 02202025 */ move $a0, $s1 -/* 0A82D4 802E8AD4 A2420002 */ sb $v0, 2($s2) -/* 0A82D8 802E8AD8 0C0B9DA0 */ jal m64_read_u8 -/* 0A82DC 802E8ADC 02202025 */ move $a0, $s1 -/* 0A82E0 802E8AE0 A2420005 */ sb $v0, 5($s2) -/* 0A82E4 802E8AE4 0C0B9DA0 */ jal m64_read_u8 -/* 0A82E8 802E8AE8 02202025 */ move $a0, $s1 -/* 0A82EC 802E8AEC 0002C600 */ sll $t8, $v0, 0x18 -/* 0A82F0 802E8AF0 00185603 */ sra $t2, $t8, 0x18 -/* 0A82F4 802E8AF4 A64A001E */ sh $t2, 0x1e($s2) -/* 0A82F8 802E8AF8 0C0B9DA0 */ jal m64_read_u8 -/* 0A82FC 802E8AFC 02202025 */ move $a0, $s1 -/* 0A8300 802E8B00 A2420009 */ sb $v0, 9($s2) -/* 0A8304 802E8B04 0C0B9DA0 */ jal m64_read_u8 -/* 0A8308 802E8B08 02202025 */ move $a0, $s1 -/* 0A830C 802E8B0C A242000A */ sb $v0, 0xa($s2) -/* 0A8310 802E8B10 0C0B9DA0 */ jal m64_read_u8 -/* 0A8314 802E8B14 02202025 */ move $a0, $s1 -/* 0A8318 802E8B18 A2420004 */ sb $v0, 4($s2) -/* 0A831C 802E8B1C 0C0B9DA0 */ jal m64_read_u8 -/* 0A8320 802E8B20 02202025 */ move $a0, $s1 -/* 0A8324 802E8B24 924C0001 */ lbu $t4, 1($s2) -/* 0A8328 802E8B28 A2420007 */ sb $v0, 7($s2) -/* 0A832C 802E8B2C 358B0020 */ ori $t3, $t4, 0x20 -/* 0A8330 802E8B30 1000FE0D */ b .L_EU_802E8368 -/* 0A8334 802E8B34 A24B0001 */ sb $t3, 1($s2) -glabel L_EU_802E8B38 -/* 0A8338 802E8B38 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A833C 802E8B3C 44815000 */ mtc1 $at, $f10 -/* 0A8340 802E8B40 A6400012 */ sh $zero, 0x12($s2) -/* 0A8344 802E8B44 A640000E */ sh $zero, 0xe($s2) -/* 0A8348 802E8B48 A6400016 */ sh $zero, 0x16($s2) -/* 0A834C 802E8B4C A6400010 */ sh $zero, 0x10($s2) -/* 0A8350 802E8B50 A640000C */ sh $zero, 0xc($s2) -/* 0A8354 802E8B54 A6400014 */ sh $zero, 0x14($s2) -/* 0A8358 802E8B58 1000FE03 */ b .L_EU_802E8368 -/* 0A835C 802E8B5C E64A0030 */ swc1 $f10, 0x30($s2) -glabel L_EU_802E8B60 -/* 0A8360 802E8B60 0C0B9DA0 */ jal m64_read_u8 -/* 0A8364 802E8B64 02202025 */ move $a0, $s1 -/* 0A8368 802E8B68 1000FDFF */ b .L_EU_802E8368 -/* 0A836C 802E8B6C A2420005 */ sb $v0, 5($s2) -.L080200970: -/* 0A8370 802E8B70 306E00F0 */ andi $t6, $v1, 0xf0 -/* 0A8374 802E8B74 3064000F */ andi $a0, $v1, 0xf -/* 0A8378 802E8B78 2DC100B1 */ sltiu $at, $t6, 0xb1 -/* 0A837C 802E8B7C 1020FDFA */ beqz $at, .L_EU_802E8368 -/* 0A8380 802E8B80 308800FF */ andi $t0, $a0, 0xff -/* 0A8384 802E8B84 000E7080 */ sll $t6, $t6, 2 -/* 0A8388 802E8B88 3C018030 */ lui $at, %hi(jtbl_EU_80306810) -/* 0A838C 802E8B8C 002E0821 */ addu $at, $at, $t6 -/* 0A8390 802E8B90 8C2E6810 */ lw $t6, %lo(jtbl_EU_80306810)($at) -/* 0A8394 802E8B94 01C00008 */ jr $t6 -/* 0A8398 802E8B98 00000000 */ nop -glabel L_EU_802E8B9C -/* 0A839C 802E8B9C 308F00FF */ andi $t7, $a0, 0xff -/* 0A83A0 802E8BA0 000FC880 */ sll $t9, $t7, 2 -/* 0A83A4 802E8BA4 02596821 */ addu $t5, $s2, $t9 -/* 0A83A8 802E8BA8 8DA30048 */ lw $v1, 0x48($t5) -/* 0A83AC 802E8BAC 10600007 */ beqz $v1, .L0802009CC -/* 0A83B0 802E8BB0 00000000 */ nop -/* 0A83B4 802E8BB4 8C730000 */ lw $s3, ($v1) -/* 0A83B8 802E8BB8 0013C040 */ sll $t8, $s3, 1 -/* 0A83BC 802E8BBC 001857C2 */ srl $t2, $t8, 0x1f -/* 0A83C0 802E8BC0 000A4E00 */ sll $t1, $t2, 0x18 -/* 0A83C4 802E8BC4 1000FDE8 */ b .L_EU_802E8368 -/* 0A83C8 802E8BC8 00099E03 */ sra $s3, $t1, 0x18 -.L0802009CC: -/* 0A83CC 802E8BCC 1000FDE6 */ b .L_EU_802E8368 -/* 0A83D0 802E8BD0 2413FFFF */ li $s3, -1 -glabel L_EU_802E8BD4 -/* 0A83D4 802E8BD4 308B00FF */ andi $t3, $a0, 0xff -/* 0A83D8 802E8BD8 024B7021 */ addu $t6, $s2, $t3 -/* 0A83DC 802E8BDC 1000FDE2 */ b .L_EU_802E8368 -/* 0A83E0 802E8BE0 A1D30058 */ sb $s3, 0x58($t6) -glabel L_EU_802E8BE4 -/* 0A83E4 802E8BE4 308300FF */ andi $v1, $a0, 0xff -/* 0A83E8 802E8BE8 02432821 */ addu $a1, $s2, $v1 -/* 0A83EC 802E8BEC 28610004 */ slti $at, $v1, 4 -/* 0A83F0 802E8BF0 1020FDDD */ beqz $at, .L_EU_802E8368 -/* 0A83F4 802E8BF4 80B30058 */ lb $s3, 0x58($a1) -/* 0A83F8 802E8BF8 240FFFFF */ li $t7, -1 -/* 0A83FC 802E8BFC 1000FDDA */ b .L_EU_802E8368 -/* 0A8400 802E8C00 A0AF0058 */ sb $t7, 0x58($a1) -glabel L_EU_802E8C04 -/* 0A8404 802E8C04 309900FF */ andi $t9, $a0, 0xff -/* 0A8408 802E8C08 02596821 */ addu $t5, $s2, $t9 -/* 0A840C 802E8C0C 81B80058 */ lb $t8, 0x58($t5) -/* 0A8410 802E8C10 02789823 */ subu $s3, $s3, $t8 -/* 0A8414 802E8C14 00135600 */ sll $t2, $s3, 0x18 -/* 0A8418 802E8C18 1000FDD3 */ b .L_EU_802E8368 -/* 0A841C 802E8C1C 000A9E03 */ sra $s3, $t2, 0x18 -glabel L_EU_802E8C20 -/* 0A8420 802E8C20 308C00FF */ andi $t4, $a0, 0xff -/* 0A8424 802E8C24 1000005C */ b .L_EU_802E8D98 -/* 0A8428 802E8C28 A64C001A */ sh $t4, 0x1a($s2) -glabel L_EU_802E8C2C -/* 0A842C 802E8C2C 0C0B9DA5 */ jal m64_read_s16 -/* 0A8430 802E8C30 02202025 */ move $a0, $s1 -/* 0A8434 802E8C34 02003025 */ move $a2, $s0 -/* 0A8438 802E8C38 30C5000F */ andi $a1, $a2, 0xf -/* 0A843C 802E8C3C 00A03025 */ move $a2, $a1 -/* 0A8440 802E8C40 AFA50034 */ sw $a1, 0x34($sp) -/* 0A8444 802E8C44 02402025 */ move $a0, $s2 -/* 0A8448 802E8C48 0C0B9BDC */ jal seq_channel_set_layer -/* 0A844C 802E8C4C A7A20052 */ sh $v0, 0x52($sp) -/* 0A8450 802E8C50 8FA60034 */ lw $a2, 0x34($sp) -/* 0A8454 802E8C54 1440FDC4 */ bnez $v0, .L_EU_802E8368 -/* 0A8458 802E8C58 97A70052 */ lhu $a3, 0x52($sp) -/* 0A845C 802E8C5C 8E8E0014 */ lw $t6, 0x14($s4) -/* 0A8460 802E8C60 0006C880 */ sll $t9, $a2, 2 -/* 0A8464 802E8C64 02596821 */ addu $t5, $s2, $t9 -/* 0A8468 802E8C68 8DB80048 */ lw $t8, 0x48($t5) -/* 0A846C 802E8C6C 01C77821 */ addu $t7, $t6, $a3 -/* 0A8470 802E8C70 1000FDBD */ b .L_EU_802E8368 -/* 0A8474 802E8C74 AF0F0050 */ sw $t7, 0x50($t8) -glabel L_EU_802E8C78 -/* 0A8478 802E8C78 02002825 */ move $a1, $s0 -/* 0A847C 802E8C7C 30AA000F */ andi $t2, $a1, 0xf -/* 0A8480 802E8C80 01402825 */ move $a1, $t2 -/* 0A8484 802E8C84 0C0B9C2D */ jal seq_channel_layer_free -/* 0A8488 802E8C88 02402025 */ move $a0, $s2 -/* 0A848C 802E8C8C 1000FDB6 */ b .L_EU_802E8368 -/* 0A8490 802E8C90 00000000 */ nop -glabel L_EU_802E8C94 -/* 0A8494 802E8C94 2401FFFF */ li $at, -1 -/* 0A8498 802E8C98 1261FDB3 */ beq $s3, $at, .L_EU_802E8368 -/* 0A849C 802E8C9C 02402025 */ move $a0, $s2 -/* 0A84A0 802E8CA0 02003025 */ move $a2, $s0 -/* 0A84A4 802E8CA4 30C5000F */ andi $a1, $a2, 0xf -/* 0A84A8 802E8CA8 00A03025 */ move $a2, $a1 -/* 0A84AC 802E8CAC 0C0B9BDC */ jal seq_channel_set_layer -/* 0A84B0 802E8CB0 AFA50034 */ sw $a1, 0x34($sp) -/* 0A84B4 802E8CB4 2401FFFF */ li $at, -1 -/* 0A84B8 802E8CB8 1041FDAB */ beq $v0, $at, .L_EU_802E8368 -/* 0A84BC 802E8CBC 8FA60034 */ lw $a2, 0x34($sp) -/* 0A84C0 802E8CC0 8E4C0034 */ lw $t4, 0x34($s2) -/* 0A84C4 802E8CC4 00135840 */ sll $t3, $s3, 1 -/* 0A84C8 802E8CC8 8E980014 */ lw $t8, 0x14($s4) -/* 0A84CC 802E8CCC 018B1821 */ addu $v1, $t4, $t3 -/* 0A84D0 802E8CD0 90790000 */ lbu $t9, ($v1) -/* 0A84D4 802E8CD4 906E0001 */ lbu $t6, 1($v1) -/* 0A84D8 802E8CD8 00064880 */ sll $t1, $a2, 2 -/* 0A84DC 802E8CDC 00196A00 */ sll $t5, $t9, 8 -/* 0A84E0 802E8CE0 02496021 */ addu $t4, $s2, $t1 -/* 0A84E4 802E8CE4 01CD3821 */ addu $a3, $t6, $t5 -/* 0A84E8 802E8CE8 8D8B0048 */ lw $t3, 0x48($t4) -/* 0A84EC 802E8CEC 30EFFFFF */ andi $t7, $a3, 0xffff -/* 0A84F0 802E8CF0 030F5021 */ addu $t2, $t8, $t7 -/* 0A84F4 802E8CF4 1000FD9C */ b .L_EU_802E8368 -/* 0A84F8 802E8CF8 AD6A0050 */ sw $t2, 0x50($t3) -glabel L_EU_802E8CFC -/* 0A84FC 802E8CFC 0C0B9DA5 */ jal m64_read_s16 -/* 0A8500 802E8D00 02202025 */ move $a0, $s1 -/* 0A8504 802E8D04 8E8E0014 */ lw $t6, 0x14($s4) -/* 0A8508 802E8D08 02002825 */ move $a1, $s0 -/* 0A850C 802E8D0C 30B9000F */ andi $t9, $a1, 0xf -/* 0A8510 802E8D10 304DFFFF */ andi $t5, $v0, 0xffff -/* 0A8514 802E8D14 03202825 */ move $a1, $t9 -/* 0A8518 802E8D18 02802025 */ move $a0, $s4 -/* 0A851C 802E8D1C 0C0B9CFA */ jal sequence_channel_enable -/* 0A8520 802E8D20 01CD3021 */ addu $a2, $t6, $t5 -/* 0A8524 802E8D24 1000FD90 */ b .L_EU_802E8368 -/* 0A8528 802E8D28 00000000 */ nop -glabel L_EU_802E8D2C -/* 0A852C 802E8D2C 3218000F */ andi $t8, $s0, 0xf -/* 0A8530 802E8D30 00184880 */ sll $t1, $t8, 2 -/* 0A8534 802E8D34 02896021 */ addu $t4, $s4, $t1 -/* 0A8538 802E8D38 0C0B9C41 */ jal sequence_channel_disable -/* 0A853C 802E8D3C 8D840030 */ lw $a0, 0x30($t4) -/* 0A8540 802E8D40 1000FD89 */ b .L_EU_802E8368 -/* 0A8544 802E8D44 00000000 */ nop -glabel L_EU_802E8D48 -/* 0A8548 802E8D48 02202025 */ move $a0, $s1 -/* 0A854C 802E8D4C 0C0B9DA0 */ jal m64_read_u8 -/* 0A8550 802E8D50 A3A80055 */ sb $t0, 0x55($sp) -/* 0A8554 802E8D54 93A80055 */ lbu $t0, 0x55($sp) -/* 0A8558 802E8D58 00085080 */ sll $t2, $t0, 2 -/* 0A855C 802E8D5C 028A5821 */ addu $t3, $s4, $t2 -/* 0A8560 802E8D60 8D790030 */ lw $t9, 0x30($t3) -/* 0A8564 802E8D64 03227021 */ addu $t6, $t9, $v0 -/* 0A8568 802E8D68 1000FD7F */ b .L_EU_802E8368 -/* 0A856C 802E8D6C A1D30058 */ sb $s3, 0x58($t6) -glabel L_EU_802E8D70 -/* 0A8570 802E8D70 02202025 */ move $a0, $s1 -/* 0A8574 802E8D74 0C0B9DA0 */ jal m64_read_u8 -/* 0A8578 802E8D78 A3A80055 */ sb $t0, 0x55($sp) -/* 0A857C 802E8D7C 93A80055 */ lbu $t0, 0x55($sp) -/* 0A8580 802E8D80 00086880 */ sll $t5, $t0, 2 -/* 0A8584 802E8D84 028D7821 */ addu $t7, $s4, $t5 -/* 0A8588 802E8D88 8DF80030 */ lw $t8, 0x30($t7) -/* 0A858C 802E8D8C 03024821 */ addu $t1, $t8, $v0 -/* 0A8590 802E8D90 1000FD75 */ b .L_EU_802E8368 -/* 0A8594 802E8D94 81330058 */ lb $s3, 0x58($t1) -glabel L_EU_802E8D98 -.L_EU_802E8D98: -/* 0A8598 802E8D98 02408825 */ move $s1, $s2 -.L080200B9C: -/* 0A859C 802E8D9C 24120010 */ li $s2, 16 -/* 0A85A0 802E8DA0 00008025 */ move $s0, $zero -.L080200BA4: -/* 0A85A4 802E8DA4 8E240048 */ lw $a0, 0x48($s1) -/* 0A85A8 802E8DA8 50800004 */ beql $a0, $zero, .L080200BBC -/* 0A85AC 802E8DAC 26100004 */ addiu $s0, $s0, 4 -/* 0A85B0 802E8DB0 0C0B9DC2 */ jal seq_channel_layer_process_script -/* 0A85B4 802E8DB4 00000000 */ nop -/* 0A85B8 802E8DB8 26100004 */ addiu $s0, $s0, 4 -.L080200BBC: -/* 0A85BC 802E8DBC 1612FFF9 */ bne $s0, $s2, .L080200BA4 -/* 0A85C0 802E8DC0 26310004 */ addiu $s1, $s1, 4 -.L080200BC4: -/* 0A85C4 802E8DC4 8FBF002C */ lw $ra, 0x2c($sp) -.L080200BC8: -/* 0A85C8 802E8DC8 8FB00018 */ lw $s0, 0x18($sp) -/* 0A85CC 802E8DCC 8FB1001C */ lw $s1, 0x1c($sp) -/* 0A85D0 802E8DD0 8FB20020 */ lw $s2, 0x20($sp) -/* 0A85D4 802E8DD4 8FB30024 */ lw $s3, 0x24($sp) -/* 0A85D8 802E8DD8 8FB40028 */ lw $s4, 0x28($sp) -/* 0A85DC 802E8DDC 03E00008 */ jr $ra -/* 0A85E0 802E8DE0 27BD0060 */ addiu $sp, $sp, 0x60 diff --git a/asm/non_matchings/process_level_music_dynamics.s b/asm/non_matchings/process_level_music_dynamics.s deleted file mode 100644 index 7defac85c3..0000000000 --- a/asm/non_matchings/process_level_music_dynamics.s +++ /dev/null @@ -1,327 +0,0 @@ -.late_rodata -glabel jtbl_80338418 - .word L8031FBAC - .word L8031FBEC - .word L8031FC2C - .word L8031FC6C - .word L8031FCAC - .word L8031FCEC - .word L8031FD2C - .word L8031FD54 - -.text -glabel process_level_music_dynamics # US: 803208EC -/* 0DAA4C 8031FA4C 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0DAA50 8031FA50 AFBF0024 */ sw $ra, 0x24($sp) -/* 0DAA54 8031FA54 AFB20020 */ sw $s2, 0x20($sp) -/* 0DAA58 8031FA58 AFB1001C */ sw $s1, 0x1c($sp) -/* 0DAA5C 8031FA5C AFB00018 */ sw $s0, 0x18($sp) -/* 0DAA60 8031FA60 0C0C7E5B */ jal func_8031F96C -/* 0DAA64 8031FA64 00002025 */ move $a0, $zero -/* 0DAA68 8031FA68 0C0C7E5B */ jal func_8031F96C -/* 0DAA6C 8031FA6C 24040002 */ li $a0, 2 -/* 0DAA70 8031FA70 0C0C83B6 */ jal func_80320ED8 -/* 0DAA74 8031FA74 00000000 */ nop -/* 0DAA78 8031FA78 3C038033 */ lui $v1, %hi(sMusicDynamicDelay) # $v1, 0x8033 -/* 0DAA7C 8031FA7C 246320A0 */ addiu $v1, %lo(sMusicDynamicDelay) # addiu $v1, $v1, 0x20a0 -/* 0DAA80 8031FA80 90620000 */ lbu $v0, ($v1) -/* 0DAA84 8031FA84 10400003 */ beqz $v0, .L8031FA94 -/* 0DAA88 8031FA88 244EFFFF */ addiu $t6, $v0, -1 -/* 0DAA8C 8031FA8C 10000005 */ b .L8031FAA4 -/* 0DAA90 8031FA90 A06E0000 */ sb $t6, ($v1) -.L8031FA94: -/* 0DAA94 8031FA94 3C0F8033 */ lui $t7, %hi(sPlayer0CurSeqId) # $t7, 0x8033 -/* 0DAA98 8031FA98 91EF209C */ lbu $t7, %lo(sPlayer0CurSeqId)($t7) -/* 0DAA9C 8031FA9C 3C018033 */ lui $at, %hi(sBackgroundMusicForDynamics) # $at, 0x8033 -/* 0DAAA0 8031FAA0 A02F1EB0 */ sb $t7, %lo(sBackgroundMusicForDynamics)($at) -.L8031FAA4: -/* 0DAAA4 8031FAA4 3C188033 */ lui $t8, %hi(gCurrLevelNum) # $t8, 0x8033 -/* 0DAAA8 8031FAA8 8718CE98 */ lh $t8, %lo(gCurrLevelNum)($t8) -/* 0DAAAC 8031FAAC 3C098033 */ lui $t1, %hi(sLevelDynamics) -/* 0DAAB0 8031FAB0 3C0C8033 */ lui $t4, %hi(sBackgroundMusicForDynamics) # $t4, 0x8033 -/* 0DAAB4 8031FAB4 0018C880 */ sll $t9, $t8, 2 -/* 0DAAB8 8031FAB8 01394821 */ addu $t1, $t1, $t9 -/* 0DAABC 8031FABC 8D291EB4 */ lw $t1, %lo(sLevelDynamics)($t1) -/* 0DAAC0 8031FAC0 918C1EB0 */ lbu $t4, %lo(sBackgroundMusicForDynamics)($t4) -/* 0DAAC4 8031FAC4 852D0000 */ lh $t5, ($t1) -/* 0DAAC8 8031FAC8 558D00FC */ bnel $t4, $t5, .L8031FEBC -/* 0DAACC 8031FACC 8FBF0024 */ lw $ra, 0x24($sp) -/* 0DAAD0 8031FAD0 852F0002 */ lh $t7, 2($t1) -/* 0DAAD4 8031FAD4 24110002 */ li $s1, 2 -/* 0DAAD8 8031FAD8 3C0B8034 */ lui $t3, %hi(gCurrAreaIndex) # $t3, 0x8034 -/* 0DAADC 8031FADC 31F0FF00 */ andi $s0, $t7, 0xff00 -/* 0DAAE0 8031FAE0 3218FF00 */ andi $t8, $s0, 0xff00 -/* 0DAAE4 8031FAE4 130000B9 */ beqz $t8, .L8031FDCC -/* 0DAAE8 8031FAE8 A3AF0057 */ sb $t7, 0x57($sp) -/* 0DAAEC 8031FAEC 3C0A8036 */ lui $t2, %hi(gMarioCurrentRoom) # $t2, 0x8036 -/* 0DAAF0 8031FAF0 3C078034 */ lui $a3, %hi(gMarioStates) # $a3, 0x8034 -/* 0DAAF4 8031FAF4 24E79E00 */ addiu $a3, %lo(gMarioStates) # addiu $a3, $a3, -0x6200 -/* 0DAAF8 8031FAF8 254AFEE0 */ addiu $t2, %lo(gMarioCurrentRoom) # addiu $t2, $t2, -0x120 -/* 0DAAFC 8031FAFC 256BA75A */ addiu $t3, %lo(gCurrAreaIndex) # addiu $t3, $t3, -0x58a6 -/* 0DAB00 8031FB00 27A8003C */ addiu $t0, $sp, 0x3c -/* 0DAB04 8031FB04 27A60044 */ addiu $a2, $sp, 0x44 -.L8031FB08: -/* 0DAB08 8031FB08 00001025 */ move $v0, $zero -/* 0DAB0C 8031FB0C 00002025 */ move $a0, $zero -/* 0DAB10 8031FB10 34058000 */ li $a1, 32768 -.L8031FB14: -/* 0DAB14 8031FB14 00B0C824 */ and $t9, $a1, $s0 -/* 0DAB18 8031FB18 1320000F */ beqz $t9, .L8031FB58 -/* 0DAB1C 8031FB1C 00A01825 */ move $v1, $a1 -/* 0DAB20 8031FB20 00116040 */ sll $t4, $s1, 1 -/* 0DAB24 8031FB24 012C6821 */ addu $t5, $t1, $t4 -/* 0DAB28 8031FB28 85AE0000 */ lh $t6, ($t5) -/* 0DAB2C 8031FB2C 00047840 */ sll $t7, $a0, 1 -/* 0DAB30 8031FB30 01046021 */ addu $t4, $t0, $a0 -/* 0DAB34 8031FB34 00CFC021 */ addu $t8, $a2, $t7 -/* 0DAB38 8031FB38 26310001 */ addiu $s1, $s1, 1 -/* 0DAB3C 8031FB3C 24840001 */ addiu $a0, $a0, 1 -/* 0DAB40 8031FB40 323900FF */ andi $t9, $s1, 0xff -/* 0DAB44 8031FB44 308D00FF */ andi $t5, $a0, 0xff -/* 0DAB48 8031FB48 A70E0000 */ sh $t6, ($t8) -/* 0DAB4C 8031FB4C 03208825 */ move $s1, $t9 -/* 0DAB50 8031FB50 A1820000 */ sb $v0, ($t4) -/* 0DAB54 8031FB54 01A02025 */ move $a0, $t5 -.L8031FB58: -/* 0DAB58 8031FB58 24420001 */ addiu $v0, $v0, 1 -/* 0DAB5C 8031FB5C 304F00FF */ andi $t7, $v0, 0xff -/* 0DAB60 8031FB60 00032843 */ sra $a1, $v1, 1 -/* 0DAB64 8031FB64 30AEFFFF */ andi $t6, $a1, 0xffff -/* 0DAB68 8031FB68 29E10008 */ slti $at, $t7, 8 -/* 0DAB6C 8031FB6C 01E01025 */ move $v0, $t7 -/* 0DAB70 8031FB70 1420FFE8 */ bnez $at, .L8031FB14 -/* 0DAB74 8031FB74 01C02825 */ move $a1, $t6 -/* 0DAB78 8031FB78 00001025 */ move $v0, $zero -/* 0DAB7C 8031FB7C 18800083 */ blez $a0, .L8031FD8C -/* 0DAB80 8031FB80 00801825 */ move $v1, $a0 -.L8031FB84: -/* 0DAB84 8031FB84 0102C021 */ addu $t8, $t0, $v0 -/* 0DAB88 8031FB88 93190000 */ lbu $t9, ($t8) -/* 0DAB8C 8031FB8C 2F210008 */ sltiu $at, $t9, 8 -/* 0DAB90 8031FB90 10200079 */ beqz $at, .L8031FD78 -/* 0DAB94 8031FB94 0019C880 */ sll $t9, $t9, 2 -/* 0DAB98 8031FB98 3C018034 */ lui $at, %hi(jtbl_80338418) -/* 0DAB9C 8031FB9C 00390821 */ addu $at, $at, $t9 -/* 0DABA0 8031FBA0 8C398418 */ lw $t9, %lo(jtbl_80338418)($at) -/* 0DABA4 8031FBA4 03200008 */ jr $t9 -/* 0DABA8 8031FBA8 00000000 */ nop -glabel L8031FBAC -/* 0DABAC 8031FBAC C4E4003C */ lwc1 $f4, 0x3c($a3) -/* 0DABB0 8031FBB0 0002C040 */ sll $t8, $v0, 1 -/* 0DABB4 8031FBB4 00D8C821 */ addu $t9, $a2, $t8 -/* 0DABB8 8031FBB8 4600218D */ trunc.w.s $f6, $f4 -/* 0DABBC 8031FBBC 872C0000 */ lh $t4, ($t9) -/* 0DABC0 8031FBC0 440D3000 */ mfc1 $t5, $f6 -/* 0DABC4 8031FBC4 00000000 */ nop -/* 0DABC8 8031FBC8 000D7C00 */ sll $t7, $t5, 0x10 -/* 0DABCC 8031FBCC 000F7403 */ sra $t6, $t7, 0x10 -/* 0DABD0 8031FBD0 01CC082A */ slt $at, $t6, $t4 -/* 0DABD4 8031FBD4 50200069 */ beql $at, $zero, .L8031FD7C -/* 0DABD8 8031FBD8 24420001 */ addiu $v0, $v0, 1 -/* 0DABDC 8031FBDC 24620001 */ addiu $v0, $v1, 1 -/* 0DABE0 8031FBE0 304D00FF */ andi $t5, $v0, 0xff -/* 0DABE4 8031FBE4 10000064 */ b .L8031FD78 -/* 0DABE8 8031FBE8 01A01025 */ move $v0, $t5 -glabel L8031FBEC -/* 0DABEC 8031FBEC C4E80040 */ lwc1 $f8, 0x40($a3) -/* 0DABF0 8031FBF0 00026040 */ sll $t4, $v0, 1 -/* 0DABF4 8031FBF4 00CC6821 */ addu $t5, $a2, $t4 -/* 0DABF8 8031FBF8 4600428D */ trunc.w.s $f10, $f8 -/* 0DABFC 8031FBFC 85AF0000 */ lh $t7, ($t5) -/* 0DAC00 8031FC00 44185000 */ mfc1 $t8, $f10 -/* 0DAC04 8031FC04 00000000 */ nop -/* 0DAC08 8031FC08 0018CC00 */ sll $t9, $t8, 0x10 -/* 0DAC0C 8031FC0C 00197403 */ sra $t6, $t9, 0x10 -/* 0DAC10 8031FC10 01CF082A */ slt $at, $t6, $t7 -/* 0DAC14 8031FC14 50200059 */ beql $at, $zero, .L8031FD7C -/* 0DAC18 8031FC18 24420001 */ addiu $v0, $v0, 1 -/* 0DAC1C 8031FC1C 24620001 */ addiu $v0, $v1, 1 -/* 0DAC20 8031FC20 305800FF */ andi $t8, $v0, 0xff -/* 0DAC24 8031FC24 10000054 */ b .L8031FD78 -/* 0DAC28 8031FC28 03001025 */ move $v0, $t8 -glabel L8031FC2C -/* 0DAC2C 8031FC2C C4F00044 */ lwc1 $f16, 0x44($a3) -/* 0DAC30 8031FC30 00027840 */ sll $t7, $v0, 1 -/* 0DAC34 8031FC34 00CFC021 */ addu $t8, $a2, $t7 -/* 0DAC38 8031FC38 4600848D */ trunc.w.s $f18, $f16 -/* 0DAC3C 8031FC3C 87190000 */ lh $t9, ($t8) -/* 0DAC40 8031FC40 440C9000 */ mfc1 $t4, $f18 -/* 0DAC44 8031FC44 00000000 */ nop -/* 0DAC48 8031FC48 000C6C00 */ sll $t5, $t4, 0x10 -/* 0DAC4C 8031FC4C 000D7403 */ sra $t6, $t5, 0x10 -/* 0DAC50 8031FC50 01D9082A */ slt $at, $t6, $t9 -/* 0DAC54 8031FC54 50200049 */ beql $at, $zero, .L8031FD7C -/* 0DAC58 8031FC58 24420001 */ addiu $v0, $v0, 1 -/* 0DAC5C 8031FC5C 24620001 */ addiu $v0, $v1, 1 -/* 0DAC60 8031FC60 304C00FF */ andi $t4, $v0, 0xff -/* 0DAC64 8031FC64 10000044 */ b .L8031FD78 -/* 0DAC68 8031FC68 01801025 */ move $v0, $t4 -glabel L8031FC6C -/* 0DAC6C 8031FC6C C4E4003C */ lwc1 $f4, 0x3c($a3) -/* 0DAC70 8031FC70 0002C840 */ sll $t9, $v0, 1 -/* 0DAC74 8031FC74 00D96021 */ addu $t4, $a2, $t9 -/* 0DAC78 8031FC78 4600218D */ trunc.w.s $f6, $f4 -/* 0DAC7C 8031FC7C 858D0000 */ lh $t5, ($t4) -/* 0DAC80 8031FC80 440F3000 */ mfc1 $t7, $f6 -/* 0DAC84 8031FC84 00000000 */ nop -/* 0DAC88 8031FC88 000FC400 */ sll $t8, $t7, 0x10 -/* 0DAC8C 8031FC8C 00187403 */ sra $t6, $t8, 0x10 -/* 0DAC90 8031FC90 01CD082A */ slt $at, $t6, $t5 -/* 0DAC94 8031FC94 54200039 */ bnezl $at, .L8031FD7C -/* 0DAC98 8031FC98 24420001 */ addiu $v0, $v0, 1 -/* 0DAC9C 8031FC9C 24620001 */ addiu $v0, $v1, 1 -/* 0DACA0 8031FCA0 304F00FF */ andi $t7, $v0, 0xff -/* 0DACA4 8031FCA4 10000034 */ b .L8031FD78 -/* 0DACA8 8031FCA8 01E01025 */ move $v0, $t7 -glabel L8031FCAC -/* 0DACAC 8031FCAC C4E80040 */ lwc1 $f8, 0x40($a3) -/* 0DACB0 8031FCB0 00026840 */ sll $t5, $v0, 1 -/* 0DACB4 8031FCB4 00CD7821 */ addu $t7, $a2, $t5 -/* 0DACB8 8031FCB8 4600428D */ trunc.w.s $f10, $f8 -/* 0DACBC 8031FCBC 85F80000 */ lh $t8, ($t7) -/* 0DACC0 8031FCC0 44195000 */ mfc1 $t9, $f10 -/* 0DACC4 8031FCC4 00000000 */ nop -/* 0DACC8 8031FCC8 00196400 */ sll $t4, $t9, 0x10 -/* 0DACCC 8031FCCC 000C7403 */ sra $t6, $t4, 0x10 -/* 0DACD0 8031FCD0 01D8082A */ slt $at, $t6, $t8 -/* 0DACD4 8031FCD4 54200029 */ bnezl $at, .L8031FD7C -/* 0DACD8 8031FCD8 24420001 */ addiu $v0, $v0, 1 -/* 0DACDC 8031FCDC 24620001 */ addiu $v0, $v1, 1 -/* 0DACE0 8031FCE0 305900FF */ andi $t9, $v0, 0xff -/* 0DACE4 8031FCE4 10000024 */ b .L8031FD78 -/* 0DACE8 8031FCE8 03201025 */ move $v0, $t9 -glabel L8031FCEC -/* 0DACEC 8031FCEC C4F00044 */ lwc1 $f16, 0x44($a3) -/* 0DACF0 8031FCF0 0002C040 */ sll $t8, $v0, 1 -/* 0DACF4 8031FCF4 00D8C821 */ addu $t9, $a2, $t8 -/* 0DACF8 8031FCF8 4600848D */ trunc.w.s $f18, $f16 -/* 0DACFC 8031FCFC 872C0000 */ lh $t4, ($t9) -/* 0DAD00 8031FD00 440D9000 */ mfc1 $t5, $f18 -/* 0DAD04 8031FD04 00000000 */ nop -/* 0DAD08 8031FD08 000D7C00 */ sll $t7, $t5, 0x10 -/* 0DAD0C 8031FD0C 000F7403 */ sra $t6, $t7, 0x10 -/* 0DAD10 8031FD10 01CC082A */ slt $at, $t6, $t4 -/* 0DAD14 8031FD14 54200019 */ bnezl $at, .L8031FD7C -/* 0DAD18 8031FD18 24420001 */ addiu $v0, $v0, 1 -/* 0DAD1C 8031FD1C 24620001 */ addiu $v0, $v1, 1 -/* 0DAD20 8031FD20 304D00FF */ andi $t5, $v0, 0xff -/* 0DAD24 8031FD24 10000014 */ b .L8031FD78 -/* 0DAD28 8031FD28 01A01025 */ move $v0, $t5 -glabel L8031FD2C -/* 0DAD2C 8031FD2C 0002C040 */ sll $t8, $v0, 1 -/* 0DAD30 8031FD30 00D8C821 */ addu $t9, $a2, $t8 -/* 0DAD34 8031FD34 872E0000 */ lh $t6, ($t9) -/* 0DAD38 8031FD38 856F0000 */ lh $t7, ($t3) -/* 0DAD3C 8031FD3C 51EE000F */ beql $t7, $t6, .L8031FD7C -/* 0DAD40 8031FD40 24420001 */ addiu $v0, $v0, 1 -/* 0DAD44 8031FD44 24620001 */ addiu $v0, $v1, 1 -/* 0DAD48 8031FD48 304C00FF */ andi $t4, $v0, 0xff -/* 0DAD4C 8031FD4C 1000000A */ b .L8031FD78 -/* 0DAD50 8031FD50 01801025 */ move $v0, $t4 -glabel L8031FD54 -/* 0DAD54 8031FD54 0002C040 */ sll $t8, $v0, 1 -/* 0DAD58 8031FD58 00D8C821 */ addu $t9, $a2, $t8 -/* 0DAD5C 8031FD5C 872F0000 */ lh $t7, ($t9) -/* 0DAD60 8031FD60 854D0000 */ lh $t5, ($t2) -/* 0DAD64 8031FD64 51AF0005 */ beql $t5, $t7, .L8031FD7C -/* 0DAD68 8031FD68 24420001 */ addiu $v0, $v0, 1 -/* 0DAD6C 8031FD6C 24620001 */ addiu $v0, $v1, 1 -/* 0DAD70 8031FD70 304E00FF */ andi $t6, $v0, 0xff -/* 0DAD74 8031FD74 01C01025 */ move $v0, $t6 -.L8031FD78: -/* 0DAD78 8031FD78 24420001 */ addiu $v0, $v0, 1 -.L8031FD7C: -/* 0DAD7C 8031FD7C 304C00FF */ andi $t4, $v0, 0xff -/* 0DAD80 8031FD80 0183082A */ slt $at, $t4, $v1 -/* 0DAD84 8031FD84 1420FF7F */ bnez $at, .L8031FB84 -/* 0DAD88 8031FD88 01801025 */ move $v0, $t4 -.L8031FD8C: -/* 0DAD8C 8031FD8C 14620003 */ bne $v1, $v0, .L8031FD9C -/* 0DAD90 8031FD90 0011C040 */ sll $t8, $s1, 1 -/* 0DAD94 8031FD94 1000000A */ b .L8031FDC0 -/* 0DAD98 8031FD98 00001825 */ move $v1, $zero -.L8031FD9C: -/* 0DAD9C 8031FD9C 0138C821 */ addu $t9, $t1, $t8 -/* 0DADA0 8031FDA0 872F0000 */ lh $t7, ($t9) -/* 0DADA4 8031FDA4 26310001 */ addiu $s1, $s1, 1 -/* 0DADA8 8031FDA8 322E00FF */ andi $t6, $s1, 0xff -/* 0DADAC 8031FDAC 01E01825 */ move $v1, $t7 -/* 0DADB0 8031FDB0 306DFF00 */ andi $t5, $v1, 0xff00 -/* 0DADB4 8031FDB4 01A01825 */ move $v1, $t5 -/* 0DADB8 8031FDB8 01C08825 */ move $s1, $t6 -/* 0DADBC 8031FDBC A3AF0057 */ sb $t7, 0x57($sp) -.L8031FDC0: -/* 0DADC0 8031FDC0 306CFF00 */ andi $t4, $v1, 0xff00 -/* 0DADC4 8031FDC4 1580FF50 */ bnez $t4, .L8031FB08 -/* 0DADC8 8031FDC8 00608025 */ move $s0, $v1 -.L8031FDCC: -/* 0DADCC 8031FDCC 3C028033 */ lui $v0, %hi(sCurrentMusicDynamic) # $v0, 0x8033 -/* 0DADD0 8031FDD0 90421EAC */ lbu $v0, %lo(sCurrentMusicDynamic)($v0) -/* 0DADD4 8031FDD4 93B80057 */ lbu $t8, 0x57($sp) -/* 0DADD8 8031FDD8 240100FF */ li $at, 255 -/* 0DADDC 8031FDDC 00008825 */ move $s1, $zero -/* 0DADE0 8031FDE0 53020036 */ beql $t8, $v0, .L8031FEBC -/* 0DADE4 8031FDE4 8FBF0024 */ lw $ra, 0x24($sp) -/* 0DADE8 8031FDE8 1441000C */ bne $v0, $at, .L8031FE1C -/* 0DADEC 8031FDEC 24030001 */ li $v1, 1 -/* 0DADF0 8031FDF0 00187880 */ sll $t7, $t8, 2 -/* 0DADF4 8031FDF4 01F87823 */ subu $t7, $t7, $t8 -/* 0DADF8 8031FDF8 3C0E8033 */ lui $t6, %hi(sMusicDynamics) # $t6, 0x8033 -/* 0DADFC 8031FDFC 24190001 */ li $t9, 1 -/* 0DAE00 8031FE00 25CE1F50 */ addiu $t6, %lo(sMusicDynamics) # addiu $t6, $t6, 0x1f50 -/* 0DAE04 8031FE04 000F7880 */ sll $t7, $t7, 2 -/* 0DAE08 8031FE08 240D0001 */ li $t5, 1 -/* 0DAE0C 8031FE0C A7B9003A */ sh $t9, 0x3a($sp) -/* 0DAE10 8031FE10 A7AD0038 */ sh $t5, 0x38($sp) -/* 0DAE14 8031FE14 1000000C */ b .L8031FE48 -/* 0DAE18 8031FE18 01EE9021 */ addu $s2, $t7, $t6 -.L8031FE1C: -/* 0DAE1C 8031FE1C 93AC0057 */ lbu $t4, 0x57($sp) -/* 0DAE20 8031FE20 3C0D8033 */ lui $t5, %hi(sMusicDynamics) # $t5, 0x8033 -/* 0DAE24 8031FE24 25AD1F50 */ addiu $t5, %lo(sMusicDynamics) # addiu $t5, $t5, 0x1f50 -/* 0DAE28 8031FE28 000CC880 */ sll $t9, $t4, 2 -/* 0DAE2C 8031FE2C 032CC823 */ subu $t9, $t9, $t4 -/* 0DAE30 8031FE30 0019C880 */ sll $t9, $t9, 2 -/* 0DAE34 8031FE34 032D9021 */ addu $s2, $t9, $t5 -/* 0DAE38 8031FE38 86580004 */ lh $t8, 4($s2) -/* 0DAE3C 8031FE3C 864F000A */ lh $t7, 0xa($s2) -/* 0DAE40 8031FE40 A7B8003A */ sh $t8, 0x3a($sp) -/* 0DAE44 8031FE44 A7AF0038 */ sh $t7, 0x38($sp) -.L8031FE48: -/* 0DAE48 8031FE48 864E0000 */ lh $t6, ($s2) -/* 0DAE4C 8031FE4C 00608025 */ move $s0, $v1 -/* 0DAE50 8031FE50 00002025 */ move $a0, $zero -/* 0DAE54 8031FE54 01C36024 */ and $t4, $t6, $v1 -/* 0DAE58 8031FE58 11800004 */ beqz $t4, .L8031FE6C -/* 0DAE5C 8031FE5C 322500FF */ andi $a1, $s1, 0xff -/* 0DAE60 8031FE60 92460003 */ lbu $a2, 3($s2) -/* 0DAE64 8031FE64 0C0C7E22 */ jal fade_channel_volume_scale -/* 0DAE68 8031FE68 97A7003A */ lhu $a3, 0x3a($sp) -.L8031FE6C: -/* 0DAE6C 8031FE6C 86590006 */ lh $t9, 6($s2) -/* 0DAE70 8031FE70 00002025 */ move $a0, $zero -/* 0DAE74 8031FE74 322500FF */ andi $a1, $s1, 0xff -/* 0DAE78 8031FE78 03306824 */ and $t5, $t9, $s0 -/* 0DAE7C 8031FE7C 11A00003 */ beqz $t5, .L8031FE8C -/* 0DAE80 8031FE80 97A70038 */ lhu $a3, 0x38($sp) -/* 0DAE84 8031FE84 0C0C7E22 */ jal fade_channel_volume_scale -/* 0DAE88 8031FE88 92460009 */ lbu $a2, 9($s2) -.L8031FE8C: -/* 0DAE8C 8031FE8C 26310001 */ addiu $s1, $s1, 1 -/* 0DAE90 8031FE90 322F00FF */ andi $t7, $s1, 0xff -/* 0DAE94 8031FE94 00101840 */ sll $v1, $s0, 1 -/* 0DAE98 8031FE98 29E10010 */ slti $at, $t7, 0x10 -/* 0DAE9C 8031FE9C 3078FFFF */ andi $t8, $v1, 0xffff -/* 0DAEA0 8031FEA0 01E08825 */ move $s1, $t7 -/* 0DAEA4 8031FEA4 1420FFE8 */ bnez $at, .L8031FE48 -/* 0DAEA8 8031FEA8 03001825 */ move $v1, $t8 -/* 0DAEAC 8031FEAC 93AE0057 */ lbu $t6, 0x57($sp) -/* 0DAEB0 8031FEB0 3C018033 */ lui $at, %hi(sCurrentMusicDynamic) # $at, 0x8033 -/* 0DAEB4 8031FEB4 A02E1EAC */ sb $t6, %lo(sCurrentMusicDynamic)($at) -/* 0DAEB8 8031FEB8 8FBF0024 */ lw $ra, 0x24($sp) -.L8031FEBC: -/* 0DAEBC 8031FEBC 8FB00018 */ lw $s0, 0x18($sp) -/* 0DAEC0 8031FEC0 8FB1001C */ lw $s1, 0x1c($sp) -/* 0DAEC4 8031FEC4 8FB20020 */ lw $s2, 0x20($sp) -/* 0DAEC8 8031FEC8 03E00008 */ jr $ra -/* 0DAECC 8031FECC 27BD0060 */ addiu $sp, $sp, 0x60 diff --git a/asm/non_matchings/seq_channel_layer_process_script_jp.s b/asm/non_matchings/seq_channel_layer_process_script_jp.s deleted file mode 100644 index 48aeb637f2..0000000000 --- a/asm/non_matchings/seq_channel_layer_process_script_jp.s +++ /dev/null @@ -1,1040 +0,0 @@ -.late_rodata -glabel jtbl_80337C90 - .word L8031B2C0 - .word L8031B27C - .word L8031B690 - .word L8031B690 - .word L8031B30C - .word L8031B220 - .word L8031B690 - .word L8031B690 - .word L8031B1E4 - -glabel jtbl_80337CB4 - .word L8031B350 - .word L8031B3A8 - .word L8031B444 - .word L8031B3D4 - .word L8031B3D4 - .word L8031B494 - .word L8031B5B8 - .word L8031B688 - .word L8031B3A8 - .word L8031B350 - -glabel jtbl_80337CDC - .word L8031BBE8 - .word L8031BBF4 - .word L8031BBE8 - .word L8031BBF4 - .word L8031BBE8 - -glabel D_80337CF0 - .double 32512.0 - -glabel D_80337CF8 - .double 127.0 - -.text -glabel seq_channel_layer_process_script -/* 0D60A4 8031B0A4 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0D60A8 8031B0A8 240E0001 */ li $t6, 1 -/* 0D60AC 8031B0AC AFBF001C */ sw $ra, 0x1c($sp) -/* 0D60B0 8031B0B0 AFB00018 */ sw $s0, 0x18($sp) -/* 0D60B4 8031B0B4 A3AE003F */ sb $t6, 0x3f($sp) -/* 0D60B8 8031B0B8 8C820000 */ lw $v0, ($a0) -/* 0D60BC 8031B0BC 00808025 */ move $s0, $a0 -/* 0D60C0 8031B0C0 00027FC2 */ srl $t7, $v0, 0x1f -/* 0D60C4 8031B0C4 51E00376 */ beql $t7, $zero, .L8031BEA0 -/* 0D60C8 8031B0C8 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D60CC 8031B0CC 8483003C */ lh $v1, 0x3c($a0) -/* 0D60D0 8031B0D0 00027080 */ sll $t6, $v0, 2 -/* 0D60D4 8031B0D4 0002C8C0 */ sll $t9, $v0, 3 -/* 0D60D8 8031B0D8 28610002 */ slti $at, $v1, 2 -/* 0D60DC 8031B0DC 1420000E */ bnez $at, .L8031B118 -/* 0D60E0 8031B0E0 2478FFFF */ addiu $t8, $v1, -1 -/* 0D60E4 8031B0E4 05C0036D */ bltz $t6, .L8031BE9C -/* 0D60E8 8031B0E8 A498003C */ sh $t8, 0x3c($a0) -/* 0D60EC 8031B0EC 848F003E */ lh $t7, 0x3e($a0) -/* 0D60F0 8031B0F0 8498003C */ lh $t8, 0x3c($a0) -/* 0D60F4 8031B0F4 01F8082A */ slt $at, $t7, $t8 -/* 0D60F8 8031B0F8 54200369 */ bnezl $at, .L8031BEA0 -/* 0D60FC 8031B0FC 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D6100 8031B100 0C0C63B1 */ jal seq_channel_layer_note_decay -/* 0D6104 8031B104 00000000 */ nop -/* 0D6108 8031B108 920E0000 */ lbu $t6, ($s0) -/* 0D610C 8031B10C 35CF0020 */ ori $t7, $t6, 0x20 -/* 0D6110 8031B110 10000362 */ b .L8031BE9C -/* 0D6114 8031B114 A20F0000 */ sb $t7, ($s0) -.L8031B118: -/* 0D6118 8031B118 07220004 */ bltzl $t9, .L8031B12C -/* 0D611C 8031B11C 92020004 */ lbu $v0, 4($s0) -/* 0D6120 8031B120 0C0C63B1 */ jal seq_channel_layer_note_decay -/* 0D6124 8031B124 02002025 */ move $a0, $s0 -/* 0D6128 8031B128 92020004 */ lbu $v0, 4($s0) -.L8031B12C: -/* 0D612C 8031B12C 2401FF7F */ li $at, -129 -/* 0D6130 8031B130 44800000 */ mtc1 $zero, $f0 -/* 0D6134 8031B134 00417024 */ and $t6, $v0, $at -/* 0D6138 8031B138 24010001 */ li $at, 1 -/* 0D613C 8031B13C 11C10004 */ beq $t6, $at, .L8031B150 -/* 0D6140 8031B140 3C1F8022 */ lui $ra, %hi(gCtlEntries) # $ra, 0x8022 -/* 0D6144 8031B144 24010002 */ li $at, 2 -/* 0D6148 8031B148 55C10003 */ bnel $t6, $at, .L8031B158 -/* 0D614C 8031B14C 8E0D0050 */ lw $t5, 0x50($s0) -.L8031B150: -/* 0D6150 8031B150 A2000004 */ sb $zero, 4($s0) -/* 0D6154 8031B154 8E0D0050 */ lw $t5, 0x50($s0) -.L8031B158: -/* 0D6158 8031B158 3C013F80 */ lui $at, 0x3f80 -/* 0D615C 8031B15C 3C0B8022 */ lui $t3, %hi(gBankLoadedPool) -/* 0D6160 8031B160 44810800 */ mtc1 $at, $f1 -/* 0D6164 8031B164 256B14F8 */ addiu $t3, $t3, %lo(gBankLoadedPool) -/* 0D6168 8031B168 27FF6D60 */ addiu $ra, %lo(gCtlEntries) # addiu $ra, $ra, 0x6d60 -/* 0D616C 8031B16C 97AA003A */ lhu $t2, 0x3a($sp) -/* 0D6170 8031B170 240900FF */ li $t1, 255 -/* 0D6174 8031B174 8DAC0040 */ lw $t4, 0x40($t5) -.L8031B178: -/* 0D6178 8031B178 8E020054 */ lw $v0, 0x54($s0) -.L8031B17C: -/* 0D617C 8031B17C 244F0001 */ addiu $t7, $v0, 1 -/* 0D6180 8031B180 AE0F0054 */ sw $t7, 0x54($s0) -/* 0D6184 8031B184 90440000 */ lbu $a0, ($v0) -/* 0D6188 8031B188 288100C1 */ slti $at, $a0, 0xc1 -/* 0D618C 8031B18C 14200159 */ bnez $at, .L8031B6F4 -/* 0D6190 8031B190 00802825 */ move $a1, $a0 -/* 0D6194 8031B194 288100CB */ slti $at, $a0, 0xcb -/* 0D6198 8031B198 1420000A */ bnez $at, .L8031B1C4 -/* 0D619C 8031B19C 24B9FF3F */ addiu $t9, $a1, -0xc1 -/* 0D61A0 8031B1A0 2498FF09 */ addiu $t8, $a0, -0xf7 -/* 0D61A4 8031B1A4 2F010009 */ sltiu $at, $t8, 9 -/* 0D61A8 8031B1A8 10200139 */ beqz $at, .L8031B690 -/* 0D61AC 8031B1AC 0018C080 */ sll $t8, $t8, 2 -/* 0D61B0 8031B1B0 3C018033 */ lui $at, %hi(jtbl_80337C90) -/* 0D61B4 8031B1B4 00380821 */ addu $at, $at, $t8 -/* 0D61B8 8031B1B8 8C387C90 */ lw $t8, %lo(jtbl_80337C90)($at) -/* 0D61BC 8031B1BC 03000008 */ jr $t8 -/* 0D61C0 8031B1C0 00000000 */ nop -.L8031B1C4: -/* 0D61C4 8031B1C4 2F21000A */ sltiu $at, $t9, 0xa -/* 0D61C8 8031B1C8 10200131 */ beqz $at, .L8031B690 -/* 0D61CC 8031B1CC 0019C880 */ sll $t9, $t9, 2 -/* 0D61D0 8031B1D0 3C018033 */ lui $at, %hi(jtbl_80337CB4) -/* 0D61D4 8031B1D4 00390821 */ addu $at, $at, $t9 -/* 0D61D8 8031B1D8 8C397CB4 */ lw $t9, %lo(jtbl_80337CB4)($at) -/* 0D61DC 8031B1DC 03200008 */ jr $t9 -/* 0D61E0 8031B1E0 00000000 */ nop -glabel L8031B1E4 -/* 0D61E4 8031B1E4 26020054 */ addiu $v0, $s0, 0x54 -/* 0D61E8 8031B1E8 90430018 */ lbu $v1, 0x18($v0) -/* 0D61EC 8031B1EC 14600005 */ bnez $v1, .L8031B204 -/* 0D61F0 8031B1F0 246EFFFF */ addiu $t6, $v1, -1 -/* 0D61F4 8031B1F4 0C0C6A84 */ jal seq_channel_layer_disable -/* 0D61F8 8031B1F8 02002025 */ move $a0, $s0 -/* 0D61FC 8031B1FC 10000328 */ b .L8031BEA0 -/* 0D6200 8031B200 8FBF001C */ lw $ra, 0x1c($sp) -.L8031B204: -/* 0D6204 8031B204 31CF00FF */ andi $t7, $t6, 0xff -/* 0D6208 8031B208 000FC080 */ sll $t8, $t7, 2 -/* 0D620C 8031B20C 0058C821 */ addu $t9, $v0, $t8 -/* 0D6210 8031B210 A04E0018 */ sb $t6, 0x18($v0) -/* 0D6214 8031B214 8F2E0004 */ lw $t6, 4($t9) -/* 0D6218 8031B218 1000FFD7 */ b .L8031B178 -/* 0D621C 8031B21C AC4E0000 */ sw $t6, ($v0) -glabel L8031B220 -/* 0D6220 8031B220 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6224 8031B224 8C430000 */ lw $v1, ($v0) -/* 0D6228 8031B228 90640000 */ lbu $a0, ($v1) -/* 0D622C 8031B22C 246E0001 */ addiu $t6, $v1, 1 -/* 0D6230 8031B230 AC4E0000 */ sw $t6, ($v0) -/* 0D6234 8031B234 91CF0000 */ lbu $t7, ($t6) -/* 0D6238 8031B238 0004CA00 */ sll $t9, $a0, 8 -/* 0D623C 8031B23C 01F92825 */ or $a1, $t7, $t9 -/* 0D6240 8031B240 904F0018 */ lbu $t7, 0x18($v0) -/* 0D6244 8031B244 25D90001 */ addiu $t9, $t6, 1 -/* 0D6248 8031B248 AC590000 */ sw $t9, ($v0) -/* 0D624C 8031B24C 25F80001 */ addiu $t8, $t7, 1 -/* 0D6250 8031B250 330E00FF */ andi $t6, $t8, 0xff -/* 0D6254 8031B254 000E7880 */ sll $t7, $t6, 2 -/* 0D6258 8031B258 A0580018 */ sb $t8, 0x18($v0) -/* 0D625C 8031B25C 004FC021 */ addu $t8, $v0, $t7 -/* 0D6260 8031B260 AF190000 */ sw $t9, ($t8) -/* 0D6264 8031B264 8D8E0014 */ lw $t6, 0x14($t4) -/* 0D6268 8031B268 30AFFFFF */ andi $t7, $a1, 0xffff -/* 0D626C 8031B26C 30AAFFFF */ andi $t2, $a1, 0xffff -/* 0D6270 8031B270 01CFC821 */ addu $t9, $t6, $t7 -/* 0D6274 8031B274 1000FFC0 */ b .L8031B178 -/* 0D6278 8031B278 AC590000 */ sw $t9, ($v0) -glabel L8031B27C -/* 0D627C 8031B27C 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6280 8031B280 8C430000 */ lw $v1, ($v0) -/* 0D6284 8031B284 904E0018 */ lbu $t6, 0x18($v0) -/* 0D6288 8031B288 24780001 */ addiu $t8, $v1, 1 -/* 0D628C 8031B28C AC580000 */ sw $t8, ($v0) -/* 0D6290 8031B290 90650000 */ lbu $a1, ($v1) -/* 0D6294 8031B294 004E7821 */ addu $t7, $v0, $t6 -/* 0D6298 8031B298 A1E50014 */ sb $a1, 0x14($t7) -/* 0D629C 8031B29C 90590018 */ lbu $t9, 0x18($v0) -/* 0D62A0 8031B2A0 8C4E0000 */ lw $t6, ($v0) -/* 0D62A4 8031B2A4 27380001 */ addiu $t8, $t9, 1 -/* 0D62A8 8031B2A8 330F00FF */ andi $t7, $t8, 0xff -/* 0D62AC 8031B2AC 000FC880 */ sll $t9, $t7, 2 -/* 0D62B0 8031B2B0 A0580018 */ sb $t8, 0x18($v0) -/* 0D62B4 8031B2B4 0059C021 */ addu $t8, $v0, $t9 -/* 0D62B8 8031B2B8 1000FFAF */ b .L8031B178 -/* 0D62BC 8031B2BC AF0E0000 */ sw $t6, ($t8) -glabel L8031B2C0 -/* 0D62C0 8031B2C0 26020054 */ addiu $v0, $s0, 0x54 -/* 0D62C4 8031B2C4 904F0018 */ lbu $t7, 0x18($v0) -/* 0D62C8 8031B2C8 004F2021 */ addu $a0, $v0, $t7 -/* 0D62CC 8031B2CC 90990013 */ lbu $t9, 0x13($a0) -/* 0D62D0 8031B2D0 272EFFFF */ addiu $t6, $t9, -1 -/* 0D62D4 8031B2D4 A08E0013 */ sb $t6, 0x13($a0) -/* 0D62D8 8031B2D8 90430018 */ lbu $v1, 0x18($v0) -/* 0D62DC 8031B2DC 0043C021 */ addu $t8, $v0, $v1 -/* 0D62E0 8031B2E0 930F0013 */ lbu $t7, 0x13($t8) -/* 0D62E4 8031B2E4 00602825 */ move $a1, $v1 -/* 0D62E8 8031B2E8 0005C880 */ sll $t9, $a1, 2 -/* 0D62EC 8031B2EC 11E00004 */ beqz $t7, .L8031B300 -/* 0D62F0 8031B2F0 00597021 */ addu $t6, $v0, $t9 -/* 0D62F4 8031B2F4 8DD80000 */ lw $t8, ($t6) -/* 0D62F8 8031B2F8 1000FF9F */ b .L8031B178 -/* 0D62FC 8031B2FC AC580000 */ sw $t8, ($v0) -.L8031B300: -/* 0D6300 8031B300 246FFFFF */ addiu $t7, $v1, -1 -/* 0D6304 8031B304 1000FF9C */ b .L8031B178 -/* 0D6308 8031B308 A04F0018 */ sb $t7, 0x18($v0) -glabel L8031B30C -/* 0D630C 8031B30C 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6310 8031B310 8C430000 */ lw $v1, ($v0) -/* 0D6314 8031B314 90640000 */ lbu $a0, ($v1) -/* 0D6318 8031B318 246F0001 */ addiu $t7, $v1, 1 -/* 0D631C 8031B31C AC4F0000 */ sw $t7, ($v0) -/* 0D6320 8031B320 91F90000 */ lbu $t9, ($t7) -/* 0D6324 8031B324 0004C200 */ sll $t8, $a0, 8 -/* 0D6328 8031B328 25EF0001 */ addiu $t7, $t7, 1 -/* 0D632C 8031B32C 03387025 */ or $t6, $t9, $t8 -/* 0D6330 8031B330 AC4F0000 */ sw $t7, ($v0) -/* 0D6334 8031B334 8D990014 */ lw $t9, 0x14($t4) -/* 0D6338 8031B338 01C0C025 */ move $t8, $t6 -/* 0D633C 8031B33C 330AFFFF */ andi $t2, $t8, 0xffff -/* 0D6340 8031B340 330EFFFF */ andi $t6, $t8, 0xffff -/* 0D6344 8031B344 032EC021 */ addu $t8, $t9, $t6 -/* 0D6348 8031B348 1000FF8B */ b .L8031B178 -/* 0D634C 8031B34C AC580000 */ sw $t8, ($v0) -glabel L8031B350 -/* 0D6350 8031B350 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6354 8031B354 8C430000 */ lw $v1, ($v0) -/* 0D6358 8031B358 240100C1 */ li $at, 193 -/* 0D635C 8031B35C 90640000 */ lbu $a0, ($v1) -/* 0D6360 8031B360 246F0001 */ addiu $t7, $v1, 1 -/* 0D6364 8031B364 14A10008 */ bne $a1, $at, .L8031B388 -/* 0D6368 8031B368 AC4F0000 */ sw $t7, ($v0) -/* 0D636C 8031B36C 00840019 */ multu $a0, $a0 -/* 0D6370 8031B370 0000C812 */ mflo $t9 -/* 0D6374 8031B374 44992000 */ mtc1 $t9, $f4 -/* 0D6378 8031B378 00000000 */ nop -/* 0D637C 8031B37C 468021A0 */ cvt.s.w $f6, $f4 -/* 0D6380 8031B380 1000FF7D */ b .L8031B178 -/* 0D6384 8031B384 E6060024 */ swc1 $f6, 0x24($s0) -.L8031B388: -/* 0D6388 8031B388 44844000 */ mtc1 $a0, $f8 -/* 0D638C 8031B38C 00000000 */ nop -/* 0D6390 8031B390 468042A0 */ cvt.s.w $f10, $f8 -/* 0D6394 8031B394 46005421 */ cvt.d.s $f16, $f10 -/* 0D6398 8031B398 46208482 */ mul.d $f18, $f16, $f0 -/* 0D639C 8031B39C 46209120 */ cvt.s.d $f4, $f18 -/* 0D63A0 8031B3A0 1000FF75 */ b .L8031B178 -/* 0D63A4 8031B3A4 E6040028 */ swc1 $f4, 0x28($s0) -glabel L8031B3A8 -/* 0D63A8 8031B3A8 26020054 */ addiu $v0, $s0, 0x54 -/* 0D63AC 8031B3AC 8C430000 */ lw $v1, ($v0) -/* 0D63B0 8031B3B0 240100C9 */ li $at, 201 -/* 0D63B4 8031B3B4 90640000 */ lbu $a0, ($v1) -/* 0D63B8 8031B3B8 246E0001 */ addiu $t6, $v1, 1 -/* 0D63BC 8031B3BC 14A10003 */ bne $a1, $at, .L8031B3CC -/* 0D63C0 8031B3C0 AC4E0000 */ sw $t6, ($v0) -/* 0D63C4 8031B3C4 1000FF6C */ b .L8031B178 -/* 0D63C8 8031B3C8 A2040002 */ sb $a0, 2($s0) -.L8031B3CC: -/* 0D63CC 8031B3CC 1000FF6A */ b .L8031B178 -/* 0D63D0 8031B3D0 A604001E */ sh $a0, 0x1e($s0) -glabel L8031B3D4 -/* 0D63D4 8031B3D4 240100C4 */ li $at, 196 -/* 0D63D8 8031B3D8 14A10003 */ bne $a1, $at, .L8031B3E8 -/* 0D63DC 8031B3DC 02002025 */ move $a0, $s0 -/* 0D63E0 8031B3E0 10000002 */ b .L8031B3EC -/* 0D63E4 8031B3E4 24020001 */ li $v0, 1 -.L8031B3E8: -/* 0D63E8 8031B3E8 00001025 */ move $v0, $zero -.L8031B3EC: -/* 0D63EC 8031B3EC 920E0000 */ lbu $t6, ($s0) -/* 0D63F0 8031B3F0 00027900 */ sll $t7, $v0, 4 -/* 0D63F4 8031B3F4 31F90010 */ andi $t9, $t7, 0x10 -/* 0D63F8 8031B3F8 31D8FFEF */ andi $t8, $t6, 0xffef -/* 0D63FC 8031B3FC 03387825 */ or $t7, $t9, $t8 -/* 0D6400 8031B400 A20F0000 */ sb $t7, ($s0) -/* 0D6404 8031B404 AFAD0058 */ sw $t5, 0x58($sp) -/* 0D6408 8031B408 AFAC005C */ sw $t4, 0x5c($sp) -/* 0D640C 8031B40C 0C0C63B1 */ jal seq_channel_layer_note_decay -/* 0D6410 8031B410 A7AA003A */ sh $t2, 0x3a($sp) -/* 0D6414 8031B414 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0D6418 8031B418 44810800 */ mtc1 $at, $f1 -/* 0D641C 8031B41C 3C0B8022 */ lui $t3, %hi(gBankLoadedPool) # $t3, 0x8022 -/* 0D6420 8031B420 3C1F8022 */ lui $ra, %hi(gCtlEntries) -/* 0D6424 8031B424 44800000 */ mtc1 $zero, $f0 -/* 0D6428 8031B428 27FF6D60 */ addiu $ra, $ra, %lo(gCtlEntries) -/* 0D642C 8031B42C 256B14F8 */ addiu $t3, %lo(gBankLoadedPool) # addiu $t3, $t3, 0x14f8 -/* 0D6430 8031B430 240900FF */ li $t1, 255 -/* 0D6434 8031B434 97AA003A */ lhu $t2, 0x3a($sp) -/* 0D6438 8031B438 8FAC005C */ lw $t4, 0x5c($sp) -/* 0D643C 8031B43C 1000FF4E */ b .L8031B178 -/* 0D6440 8031B440 8FAD0058 */ lw $t5, 0x58($sp) -glabel L8031B444 -/* 0D6444 8031B444 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6448 8031B448 8C430000 */ lw $v1, ($v0) -/* 0D644C 8031B44C 90640000 */ lbu $a0, ($v1) -/* 0D6450 8031B450 246E0001 */ addiu $t6, $v1, 1 -/* 0D6454 8031B454 AC4E0000 */ sw $t6, ($v0) -/* 0D6458 8031B458 30990080 */ andi $t9, $a0, 0x80 -/* 0D645C 8031B45C 1320000A */ beqz $t9, .L8031B488 -/* 0D6460 8031B460 00802825 */ move $a1, $a0 -/* 0D6464 8031B464 01C01825 */ move $v1, $t6 -/* 0D6468 8031B468 91CE0000 */ lbu $t6, ($t6) -/* 0D646C 8031B46C 00052200 */ sll $a0, $a1, 8 -/* 0D6470 8031B470 308F7F00 */ andi $t7, $a0, 0x7f00 -/* 0D6474 8031B474 01CF2025 */ or $a0, $t6, $t7 -/* 0D6478 8031B478 3085FFFF */ andi $a1, $a0, 0xffff -/* 0D647C 8031B47C 24780001 */ addiu $t8, $v1, 1 -/* 0D6480 8031B480 AC580000 */ sw $t8, ($v0) -/* 0D6484 8031B484 00A02025 */ move $a0, $a1 -.L8031B488: -/* 0D6488 8031B488 308AFFFF */ andi $t2, $a0, 0xffff -/* 0D648C 8031B48C 1000FF3A */ b .L8031B178 -/* 0D6490 8031B490 A6050038 */ sh $a1, 0x38($s0) -glabel L8031B494 -/* 0D6494 8031B494 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6498 8031B498 8C430000 */ lw $v1, ($v0) -/* 0D649C 8031B49C 246F0001 */ addiu $t7, $v1, 1 -/* 0D64A0 8031B4A0 AC4F0000 */ sw $t7, ($v0) -/* 0D64A4 8031B4A4 90650000 */ lbu $a1, ($v1) -/* 0D64A8 8031B4A8 28A1007F */ slti $at, $a1, 0x7f -/* 0D64AC 8031B4AC 5020FF33 */ beql $at, $zero, .L8031B17C -/* 0D64B0 8031B4B0 8E020054 */ lw $v0, 0x54($s0) -/* 0D64B4 8031B4B4 91B90005 */ lbu $t9, 5($t5) -/* 0D64B8 8031B4B8 8FEE0000 */ lw $t6, ($ra) -/* 0D64BC 8031B4BC 30A200FF */ andi $v0, $a1, 0xff -/* 0D64C0 8031B4C0 0019C080 */ sll $t8, $t9, 2 -/* 0D64C4 8031B4C4 0319C023 */ subu $t8, $t8, $t9 -/* 0D64C8 8031B4C8 0018C080 */ sll $t8, $t8, 2 -/* 0D64CC 8031B4CC 01D83821 */ addu $a3, $t6, $t8 -/* 0D64D0 8031B4D0 90E30001 */ lbu $v1, 1($a3) -/* 0D64D4 8031B4D4 00A3082A */ slt $at, $a1, $v1 -/* 0D64D8 8031B4D8 54200008 */ bnezl $at, .L8031B4FC -/* 0D64DC 8031B4DC 8CE30004 */ lw $v1, 4($a3) -/* 0D64E0 8031B4E0 306200FF */ andi $v0, $v1, 0xff -/* 0D64E4 8031B4E4 5040FF25 */ beql $v0, $zero, .L8031B17C -/* 0D64E8 8031B4E8 8E020054 */ lw $v0, 0x54($s0) -/* 0D64EC 8031B4EC 2442FFFF */ addiu $v0, $v0, -1 -/* 0D64F0 8031B4F0 304F00FF */ andi $t7, $v0, 0xff -/* 0D64F4 8031B4F4 01E01025 */ move $v0, $t7 -/* 0D64F8 8031B4F8 8CE30004 */ lw $v1, 4($a3) -.L8031B4FC: -/* 0D64FC 8031B4FC 0002C880 */ sll $t9, $v0, 2 -/* 0D6500 8031B500 26050048 */ addiu $a1, $s0, 0x48 -/* 0D6504 8031B504 00797021 */ addu $t6, $v1, $t9 -/* 0D6508 8031B508 8DC40000 */ lw $a0, ($t6) -/* 0D650C 8031B50C 5480000C */ bnezl $a0, .L8031B540 -/* 0D6510 8031B510 8D630004 */ lw $v1, 4($t3) -/* 0D6514 8031B514 11220009 */ beq $t1, $v0, .L8031B53C -.L8031B518: -/* 0D6518 8031B518 0002C080 */ sll $t8, $v0, 2 -/* 0D651C 8031B51C 00787821 */ addu $t7, $v1, $t8 -/* 0D6520 8031B520 8DE40000 */ lw $a0, ($t7) -/* 0D6524 8031B524 54800006 */ bnezl $a0, .L8031B540 -/* 0D6528 8031B528 8D630004 */ lw $v1, 4($t3) -/* 0D652C 8031B52C 2442FFFF */ addiu $v0, $v0, -1 -/* 0D6530 8031B530 305900FF */ andi $t9, $v0, 0xff -/* 0D6534 8031B534 1539FFF8 */ bne $t1, $t9, .L8031B518 -/* 0D6538 8031B538 03201025 */ move $v0, $t9 -.L8031B53C: -/* 0D653C 8031B53C 8D630004 */ lw $v1, 4($t3) -.L8031B540: -/* 0D6540 8031B540 0083082B */ sltu $at, $a0, $v1 -/* 0D6544 8031B544 54200007 */ bnezl $at, .L8031B564 -/* 0D6548 8031B548 8D630198 */ lw $v1, 0x198($t3) -/* 0D654C 8031B54C 8D6E000C */ lw $t6, 0xc($t3) -/* 0D6550 8031B550 006EC021 */ addu $t8, $v1, $t6 -/* 0D6554 8031B554 0304082B */ sltu $at, $t8, $a0 -/* 0D6558 8031B558 5020000B */ beql $at, $zero, .L8031B588 -/* 0D655C 8031B55C 8C8E0004 */ lw $t6, 4($a0) -/* 0D6560 8031B560 8D630198 */ lw $v1, 0x198($t3) -.L8031B564: -/* 0D6564 8031B564 0083082B */ sltu $at, $a0, $v1 -/* 0D6568 8031B568 5420000E */ bnezl $at, .L8031B5A4 -/* 0D656C 8031B56C 3C010002 */ lui $at, 2 -/* 0D6570 8031B570 8D6F01A0 */ lw $t7, 0x1a0($t3) -/* 0D6574 8031B574 006FC821 */ addu $t9, $v1, $t7 -/* 0D6578 8031B578 0324082B */ sltu $at, $t9, $a0 -/* 0D657C 8031B57C 54200009 */ bnezl $at, .L8031B5A4 -/* 0D6580 8031B580 3C010002 */ lui $at, 2 -/* 0D6584 8031B584 8C8E0004 */ lw $t6, 4($a0) -.L8031B588: -/* 0D6588 8031B588 26020014 */ addiu $v0, $s0, 0x14 -/* 0D658C 8031B58C AC4E0004 */ sw $t6, 4($v0) -/* 0D6590 8031B590 90980003 */ lbu $t8, 3($a0) -/* 0D6594 8031B594 A0580000 */ sb $t8, ($v0) -/* 0D6598 8031B598 1000FEF7 */ b .L8031B178 -/* 0D659C 8031B59C ACA40000 */ sw $a0, ($a1) -/* 0D65A0 8031B5A0 3C010002 */ lui $at, 2 -.L8031B5A4: -/* 0D65A4 8031B5A4 00417821 */ addu $t7, $v0, $at -/* 0D65A8 8031B5A8 3C018033 */ lui $at, %hi(gAudioErrorFlags) # $at, 0x8033 -/* 0D65AC 8031B5AC AC2F1D40 */ sw $t7, %lo(gAudioErrorFlags)($at) -/* 0D65B0 8031B5B0 1000FEF1 */ b .L8031B178 -/* 0D65B4 8031B5B4 ACA00000 */ sw $zero, ($a1) -glabel L8031B5B8 -/* 0D65B8 8031B5B8 26020054 */ addiu $v0, $s0, 0x54 -/* 0D65BC 8031B5BC 8C430000 */ lw $v1, ($v0) -/* 0D65C0 8031B5C0 24790001 */ addiu $t9, $v1, 1 -/* 0D65C4 8031B5C4 AC590000 */ sw $t9, ($v0) -/* 0D65C8 8031B5C8 90650000 */ lbu $a1, ($v1) -/* 0D65CC 8031B5CC A2050004 */ sb $a1, 4($s0) -/* 0D65D0 8031B5D0 8C430000 */ lw $v1, ($v0) -/* 0D65D4 8031B5D4 246E0001 */ addiu $t6, $v1, 1 -/* 0D65D8 8031B5D8 AC4E0000 */ sw $t6, ($v0) -/* 0D65DC 8031B5DC 85B8001A */ lh $t8, 0x1a($t5) -/* 0D65E0 8031B5E0 90670000 */ lbu $a3, ($v1) -/* 0D65E4 8031B5E4 8619001E */ lh $t9, 0x1e($s0) -/* 0D65E8 8031B5E8 03077821 */ addu $t7, $t8, $a3 -/* 0D65EC 8031B5EC 85980010 */ lh $t8, 0x10($t4) -/* 0D65F0 8031B5F0 01F97021 */ addu $t6, $t7, $t9 -/* 0D65F4 8031B5F4 01D84021 */ addu $t0, $t6, $t8 -/* 0D65F8 8031B5F8 310F00FF */ andi $t7, $t0, 0xff -/* 0D65FC 8031B5FC 29E10080 */ slti $at, $t7, 0x80 -/* 0D6600 8031B600 14200002 */ bnez $at, .L8031B60C -/* 0D6604 8031B604 01E04025 */ move $t0, $t7 -/* 0D6608 8031B608 00004025 */ move $t0, $zero -.L8031B60C: -/* 0D660C 8031B60C 92190004 */ lbu $t9, 4($s0) -/* 0D6610 8031B610 A2080003 */ sb $t0, 3($s0) -/* 0D6614 8031B614 332E0080 */ andi $t6, $t9, 0x80 -/* 0D6618 8031B618 51C00009 */ beql $t6, $zero, .L8031B640 -/* 0D661C 8031B61C 8C430000 */ lw $v1, ($v0) -/* 0D6620 8031B620 8C580000 */ lw $t8, ($v0) -/* 0D6624 8031B624 930F0000 */ lbu $t7, ($t8) -/* 0D6628 8031B628 A60F001C */ sh $t7, 0x1c($s0) -/* 0D662C 8031B62C 8C590000 */ lw $t9, ($v0) -/* 0D6630 8031B630 272E0001 */ addiu $t6, $t9, 1 -/* 0D6634 8031B634 1000FED0 */ b .L8031B178 -/* 0D6638 8031B638 AC4E0000 */ sw $t6, ($v0) -/* 0D663C 8031B63C 8C430000 */ lw $v1, ($v0) -.L8031B640: -/* 0D6640 8031B640 90640000 */ lbu $a0, ($v1) -/* 0D6644 8031B644 24780001 */ addiu $t8, $v1, 1 -/* 0D6648 8031B648 AC580000 */ sw $t8, ($v0) -/* 0D664C 8031B64C 308F0080 */ andi $t7, $a0, 0x80 -/* 0D6650 8031B650 11E0000A */ beqz $t7, .L8031B67C -/* 0D6654 8031B654 00802825 */ move $a1, $a0 -/* 0D6658 8031B658 03001825 */ move $v1, $t8 -/* 0D665C 8031B65C 93180000 */ lbu $t8, ($t8) -/* 0D6660 8031B660 00052200 */ sll $a0, $a1, 8 -/* 0D6664 8031B664 308E7F00 */ andi $t6, $a0, 0x7f00 -/* 0D6668 8031B668 030E2025 */ or $a0, $t8, $t6 -/* 0D666C 8031B66C 308FFFFF */ andi $t7, $a0, 0xffff -/* 0D6670 8031B670 24790001 */ addiu $t9, $v1, 1 -/* 0D6674 8031B674 AC590000 */ sw $t9, ($v0) -/* 0D6678 8031B678 01E02025 */ move $a0, $t7 -.L8031B67C: -/* 0D667C 8031B67C 308AFFFF */ andi $t2, $a0, 0xffff -/* 0D6680 8031B680 1000FEBD */ b .L8031B178 -/* 0D6684 8031B684 A604001C */ sh $a0, 0x1c($s0) -glabel L8031B688 -/* 0D6688 8031B688 1000FEBB */ b .L8031B178 -/* 0D668C 8031B68C A2000004 */ sb $zero, 4($s0) -.L8031B690: -glabel L8031B690 -/* 0D6690 8031B690 30A200F0 */ andi $v0, $a1, 0xf0 -/* 0D6694 8031B694 240100D0 */ li $at, 208 -/* 0D6698 8031B698 10410005 */ beq $v0, $at, .L8031B6B0 -/* 0D669C 8031B69C 240100E0 */ li $at, 224 -/* 0D66A0 8031B6A0 5041000F */ beql $v0, $at, .L8031B6E0 -/* 0D66A4 8031B6A4 8D8E008C */ lw $t6, 0x8c($t4) -/* 0D66A8 8031B6A8 1000FEB4 */ b .L8031B17C -/* 0D66AC 8031B6AC 8E020054 */ lw $v0, 0x54($s0) -.L8031B6B0: -/* 0D66B0 8031B6B0 8D8E0088 */ lw $t6, 0x88($t4) -/* 0D66B4 8031B6B4 30B8000F */ andi $t8, $a1, 0xf -/* 0D66B8 8031B6B8 01D87821 */ addu $t7, $t6, $t8 -/* 0D66BC 8031B6BC 91EA0000 */ lbu $t2, ($t7) -/* 0D66C0 8031B6C0 014A0019 */ multu $t2, $t2 -/* 0D66C4 8031B6C4 0000C812 */ mflo $t9 -/* 0D66C8 8031B6C8 44993000 */ mtc1 $t9, $f6 -/* 0D66CC 8031B6CC 00000000 */ nop -/* 0D66D0 8031B6D0 46803220 */ cvt.s.w $f8, $f6 -/* 0D66D4 8031B6D4 1000FEA8 */ b .L8031B178 -/* 0D66D8 8031B6D8 E6080024 */ swc1 $f8, 0x24($s0) -/* 0D66DC 8031B6DC 8D8E008C */ lw $t6, 0x8c($t4) -.L8031B6E0: -/* 0D66E0 8031B6E0 30B8000F */ andi $t8, $a1, 0xf -/* 0D66E4 8031B6E4 01D87821 */ addu $t7, $t6, $t8 -/* 0D66E8 8031B6E8 91F90000 */ lbu $t9, ($t7) -/* 0D66EC 8031B6EC 1000FEA2 */ b .L8031B178 -/* 0D66F0 8031B6F0 A2190002 */ sb $t9, 2($s0) -.L8031B6F4: -/* 0D66F4 8031B6F4 240100C0 */ li $at, 192 -/* 0D66F8 8031B6F8 14A10015 */ bne $a1, $at, .L8031B750 -/* 0D66FC 8031B6FC 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6700 8031B700 8C430000 */ lw $v1, ($v0) -/* 0D6704 8031B704 90640000 */ lbu $a0, ($v1) -/* 0D6708 8031B708 246E0001 */ addiu $t6, $v1, 1 -/* 0D670C 8031B70C AC4E0000 */ sw $t6, ($v0) -/* 0D6710 8031B710 30980080 */ andi $t8, $a0, 0x80 -/* 0D6714 8031B714 13000009 */ beqz $t8, .L8031B73C -/* 0D6718 8031B718 00802825 */ move $a1, $a0 -/* 0D671C 8031B71C 01C01825 */ move $v1, $t6 -/* 0D6720 8031B720 91CE0000 */ lbu $t6, ($t6) -/* 0D6724 8031B724 00042200 */ sll $a0, $a0, 8 -/* 0D6728 8031B728 30997F00 */ andi $t9, $a0, 0x7f00 -/* 0D672C 8031B72C 246F0001 */ addiu $t7, $v1, 1 -/* 0D6730 8031B730 01D92025 */ or $a0, $t6, $t9 -/* 0D6734 8031B734 3085FFFF */ andi $a1, $a0, 0xffff -/* 0D6738 8031B738 AC4F0000 */ sw $t7, ($v0) -.L8031B73C: -/* 0D673C 8031B73C 920E0000 */ lbu $t6, ($s0) -/* 0D6740 8031B740 A605003C */ sh $a1, 0x3c($s0) -/* 0D6744 8031B744 35D80020 */ ori $t8, $t6, 0x20 -/* 0D6748 8031B748 1000019C */ b .L8031BDBC -/* 0D674C 8031B74C A2180000 */ sb $t8, ($s0) -.L8031B750: -/* 0D6750 8031B750 920F0000 */ lbu $t7, ($s0) -/* 0D6754 8031B754 24010001 */ li $at, 1 -/* 0D6758 8031B758 30A900C0 */ andi $t1, $a1, 0xc0 -/* 0D675C 8031B75C 31F9FFDF */ andi $t9, $t7, 0xffdf -/* 0D6760 8031B760 A2190000 */ sb $t9, ($s0) -/* 0D6764 8031B764 8DAE0000 */ lw $t6, ($t5) -/* 0D6768 8031B768 000EC180 */ sll $t8, $t6, 6 -/* 0D676C 8031B76C 00187FC2 */ srl $t7, $t8, 0x1f -/* 0D6770 8031B770 15E10057 */ bne $t7, $at, .L8031B8D0 -/* 0D6774 8031B774 00000000 */ nop -/* 0D6778 8031B778 30A900C0 */ andi $t1, $a1, 0xc0 -/* 0D677C 8031B77C 11200009 */ beqz $t1, .L8031B7A4 -/* 0D6780 8031B780 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6784 8031B784 24010040 */ li $at, 64 -/* 0D6788 8031B788 11210023 */ beq $t1, $at, .L8031B818 -/* 0D678C 8031B78C 26020054 */ addiu $v0, $s0, 0x54 -/* 0D6790 8031B790 24010080 */ li $at, 128 -/* 0D6794 8031B794 11210039 */ beq $t1, $at, .L8031B87C -/* 0D6798 8031B798 26020054 */ addiu $v0, $s0, 0x54 -/* 0D679C 8031B79C 10000043 */ b .L8031B8AC -/* 0D67A0 8031B7A0 01402025 */ move $a0, $t2 -.L8031B7A4: -/* 0D67A4 8031B7A4 8C430000 */ lw $v1, ($v0) -/* 0D67A8 8031B7A8 90660000 */ lbu $a2, ($v1) -/* 0D67AC 8031B7AC 24790001 */ addiu $t9, $v1, 1 -/* 0D67B0 8031B7B0 AC590000 */ sw $t9, ($v0) -/* 0D67B4 8031B7B4 30CE0080 */ andi $t6, $a2, 0x80 -/* 0D67B8 8031B7B8 11C0000A */ beqz $t6, .L8031B7E4 -/* 0D67BC 8031B7BC 00C03825 */ or $a3, $a2, $zero -/* 0D67C0 8031B7C0 03201825 */ move $v1, $t9 -/* 0D67C4 8031B7C4 93390000 */ lbu $t9, ($t9) -/* 0D67C8 8031B7C8 00073200 */ sll $a2, $a3, 8 -/* 0D67CC 8031B7CC 30CF7F00 */ andi $t7, $a2, 0x7f00 -/* 0D67D0 8031B7D0 032F3025 */ or $a2, $t9, $t7 -/* 0D67D4 8031B7D4 30C7FFFF */ andi $a3, $a2, 0xffff -/* 0D67D8 8031B7D8 24780001 */ addiu $t8, $v1, 1 -/* 0D67DC 8031B7DC AC580000 */ sw $t8, ($v0) -/* 0D67E0 8031B7E0 00E03025 */ move $a2, $a3 -.L8031B7E4: -/* 0D67E4 8031B7E4 8C430000 */ lw $v1, ($v0) -/* 0D67E8 8031B7E8 30CAFFFF */ andi $t2, $a2, 0xffff -/* 0D67EC 8031B7EC 01402025 */ move $a0, $t2 -/* 0D67F0 8031B7F0 906B0000 */ lbu $t3, ($v1) -/* 0D67F4 8031B7F4 246F0001 */ addiu $t7, $v1, 1 -/* 0D67F8 8031B7F8 AC4F0000 */ sw $t7, ($v0) -/* 0D67FC 8031B7FC 91EE0000 */ lbu $t6, ($t7) -/* 0D6800 8031B800 A20E0002 */ sb $t6, 2($s0) -/* 0D6804 8031B804 8C580000 */ lw $t8, ($v0) -/* 0D6808 8031B808 270F0001 */ addiu $t7, $t8, 1 -/* 0D680C 8031B80C AC4F0000 */ sw $t7, ($v0) -/* 0D6810 8031B810 10000027 */ b .L8031B8B0 -/* 0D6814 8031B814 A607003A */ sh $a3, 0x3a($s0) -.L8031B818: -/* 0D6818 8031B818 8C430000 */ lw $v1, ($v0) -/* 0D681C 8031B81C 90660000 */ lbu $a2, ($v1) -/* 0D6820 8031B820 24790001 */ addiu $t9, $v1, 1 -/* 0D6824 8031B824 AC590000 */ sw $t9, ($v0) -/* 0D6828 8031B828 30CE0080 */ andi $t6, $a2, 0x80 -/* 0D682C 8031B82C 11C0000A */ beqz $t6, .L8031B858 -/* 0D6830 8031B830 00C03825 */ or $a3, $a2, $zero -/* 0D6834 8031B834 03201825 */ move $v1, $t9 -/* 0D6838 8031B838 93390000 */ lbu $t9, ($t9) -/* 0D683C 8031B83C 00073200 */ sll $a2, $a3, 8 -/* 0D6840 8031B840 30CF7F00 */ andi $t7, $a2, 0x7f00 -/* 0D6844 8031B844 032F3025 */ or $a2, $t9, $t7 -/* 0D6848 8031B848 30C7FFFF */ andi $a3, $a2, 0xffff -/* 0D684C 8031B84C 24780001 */ addiu $t8, $v1, 1 -/* 0D6850 8031B850 AC580000 */ sw $t8, ($v0) -/* 0D6854 8031B854 00E03025 */ move $a2, $a3 -.L8031B858: -/* 0D6858 8031B858 8C430000 */ lw $v1, ($v0) -/* 0D685C 8031B85C 30CAFFFF */ andi $t2, $a2, 0xffff -/* 0D6860 8031B860 01402025 */ move $a0, $t2 -/* 0D6864 8031B864 906B0000 */ lbu $t3, ($v1) -/* 0D6868 8031B868 246F0001 */ addiu $t7, $v1, 1 -/* 0D686C 8031B86C AC4F0000 */ sw $t7, ($v0) -/* 0D6870 8031B870 A2000002 */ sb $zero, 2($s0) -/* 0D6874 8031B874 1000000E */ b .L8031B8B0 -/* 0D6878 8031B878 A607003A */ sh $a3, 0x3a($s0) -.L8031B87C: -/* 0D687C 8031B87C 8C430000 */ lw $v1, ($v0) -/* 0D6880 8031B880 960A003A */ lhu $t2, 0x3a($s0) -/* 0D6884 8031B884 906B0000 */ lbu $t3, ($v1) -/* 0D6888 8031B888 24790001 */ addiu $t9, $v1, 1 -/* 0D688C 8031B88C AC590000 */ sw $t9, ($v0) -/* 0D6890 8031B890 93380000 */ lbu $t8, ($t9) -/* 0D6894 8031B894 01402025 */ move $a0, $t2 -/* 0D6898 8031B898 A2180002 */ sb $t8, 2($s0) -/* 0D689C 8031B89C 8C4F0000 */ lw $t7, ($v0) -/* 0D68A0 8031B8A0 25F90001 */ addiu $t9, $t7, 1 -/* 0D68A4 8031B8A4 10000002 */ b .L8031B8B0 -/* 0D68A8 8031B8A8 AC590000 */ sw $t9, ($v0) -.L8031B8AC: -/* 0D68AC 8031B8AC 8FAB0030 */ lw $t3, 0x30($sp) -.L8031B8B0: -/* 0D68B0 8031B8B0 016B0019 */ multu $t3, $t3 -/* 0D68B4 8031B8B4 00A91823 */ subu $v1, $a1, $t1 -/* 0D68B8 8031B8B8 00007012 */ mflo $t6 -/* 0D68BC 8031B8BC 448E5000 */ mtc1 $t6, $f10 -/* 0D68C0 8031B8C0 00000000 */ nop -/* 0D68C4 8031B8C4 46805420 */ cvt.s.w $f16, $f10 -/* 0D68C8 8031B8C8 10000024 */ b .L8031B95C -/* 0D68CC 8031B8CC E6100024 */ swc1 $f16, 0x24($s0) -.L8031B8D0: -/* 0D68D0 8031B8D0 11200008 */ beqz $t1, .L8031B8F4 -/* 0D68D4 8031B8D4 26020054 */ addiu $v0, $s0, 0x54 -/* 0D68D8 8031B8D8 24010040 */ li $at, 64 -/* 0D68DC 8031B8DC 11210019 */ beq $t1, $at, .L8031B944 -/* 0D68E0 8031B8E0 24010080 */ li $at, 128 -/* 0D68E4 8031B8E4 5121001B */ beql $t1, $at, .L8031B954 -/* 0D68E8 8031B8E8 960A003A */ lhu $t2, 0x3a($s0) -/* 0D68EC 8031B8EC 1000001A */ b .L8031B958 -/* 0D68F0 8031B8F0 01402025 */ move $a0, $t2 -.L8031B8F4: -/* 0D68F4 8031B8F4 8C430000 */ lw $v1, ($v0) -/* 0D68F8 8031B8F8 90660000 */ lbu $a2, ($v1) -/* 0D68FC 8031B8FC 24780001 */ addiu $t8, $v1, 1 -/* 0D6900 8031B900 AC580000 */ sw $t8, ($v0) -/* 0D6904 8031B904 30CF0080 */ andi $t7, $a2, 0x80 -/* 0D6908 8031B908 11E0000A */ beqz $t7, .L8031B934 -/* 0D690C 8031B90C 00C03825 */ or $a3, $a2, $zero -/* 0D6910 8031B910 03001825 */ move $v1, $t8 -/* 0D6914 8031B914 93180000 */ lbu $t8, ($t8) -/* 0D6918 8031B918 00073200 */ sll $a2, $a3, 8 -/* 0D691C 8031B91C 30CE7F00 */ andi $t6, $a2, 0x7f00 -/* 0D6920 8031B920 030E3025 */ or $a2, $t8, $t6 -/* 0D6924 8031B924 30C7FFFF */ andi $a3, $a2, 0xffff -/* 0D6928 8031B928 24790001 */ addiu $t9, $v1, 1 -/* 0D692C 8031B92C AC590000 */ sw $t9, ($v0) -/* 0D6930 8031B930 00E03025 */ move $a2, $a3 -.L8031B934: -/* 0D6934 8031B934 30CAFFFF */ andi $t2, $a2, 0xffff -/* 0D6938 8031B938 A607003A */ sh $a3, 0x3a($s0) -/* 0D693C 8031B93C 10000006 */ b .L8031B958 -/* 0D6940 8031B940 01402025 */ move $a0, $t2 -.L8031B944: -/* 0D6944 8031B944 960A0038 */ lhu $t2, 0x38($s0) -/* 0D6948 8031B948 10000003 */ b .L8031B958 -/* 0D694C 8031B94C 01402025 */ move $a0, $t2 -/* 0D6950 8031B950 960A003A */ lhu $t2, 0x3a($s0) -.L8031B954: -/* 0D6954 8031B954 01402025 */ move $a0, $t2 -.L8031B958: -/* 0D6958 8031B958 00A91823 */ subu $v1, $a1, $t1 -.L8031B95C: -/* 0D695C 8031B95C 920E0002 */ lbu $t6, 2($s0) -/* 0D6960 8031B960 A604003C */ sh $a0, 0x3c($s0) -/* 0D6964 8031B964 01C40019 */ multu $t6, $a0 -/* 0D6968 8031B968 0000C012 */ mflo $t8 -/* 0D696C 8031B96C 07010003 */ bgez $t8, .L8031B97C -/* 0D6970 8031B970 00187A03 */ sra $t7, $t8, 8 -/* 0D6974 8031B974 270100FF */ addiu $at, $t8, 0xff -/* 0D6978 8031B978 00017A03 */ sra $t7, $at, 8 -.L8031B97C: -/* 0D697C 8031B97C A60F003E */ sh $t7, 0x3e($s0) -/* 0D6980 8031B980 8D990000 */ lw $t9, ($t4) -/* 0D6984 8031B984 0019C080 */ sll $t8, $t9, 2 -/* 0D6988 8031B988 07030006 */ bgezl $t8, .L8031B9A4 -/* 0D698C 8031B98C 8DA20000 */ lw $v0, ($t5) -/* 0D6990 8031B990 91AF0002 */ lbu $t7, 2($t5) -/* 0D6994 8031B994 31F90040 */ andi $t9, $t7, 0x40 -/* 0D6998 8031B998 57200008 */ bnezl $t9, .L8031B9BC -/* 0D699C 8031B99C 92180000 */ lbu $t8, ($s0) -/* 0D69A0 8031B9A0 8DA20000 */ lw $v0, ($t5) -.L8031B9A4: -/* 0D69A4 8031B9A4 0002C0C0 */ sll $t8, $v0, 3 -/* 0D69A8 8031B9A8 07000003 */ bltz $t8, .L8031B9B8 -/* 0D69AC 8031B9AC 0002C900 */ sll $t9, $v0, 4 -/* 0D69B0 8031B9B0 07220006 */ bltzl $t9, .L8031B9CC -/* 0D69B4 8031B9B4 85B90018 */ lh $t9, 0x18($t5) -.L8031B9B8: -/* 0D69B8 8031B9B8 92180000 */ lbu $t8, ($s0) -.L8031B9BC: -/* 0D69BC 8031B9BC 370F0020 */ ori $t7, $t8, 0x20 -/* 0D69C0 8031B9C0 100000FE */ b .L8031BDBC -/* 0D69C4 8031B9C4 A20F0000 */ sb $t7, ($s0) -/* 0D69C8 8031B9C8 85B90018 */ lh $t9, 0x18($t5) -.L8031B9CC: -/* 0D69CC 8031B9CC 5720003B */ bnezl $t9, .L8031BABC -/* 0D69D0 8031B9D0 85980010 */ lh $t8, 0x10($t4) -/* 0D69D4 8031B9D4 85B8001A */ lh $t8, 0x1a($t5) -/* 0D69D8 8031B9D8 8619001E */ lh $t9, 0x1e($s0) -/* 0D69DC 8031B9DC 00787821 */ addu $t7, $v1, $t8 -/* 0D69E0 8031B9E0 01F94021 */ addu $t0, $t7, $t9 -/* 0D69E4 8031B9E4 91AF0005 */ lbu $t7, 5($t5) -/* 0D69E8 8031B9E8 8FF80000 */ lw $t8, ($ra) -/* 0D69EC 8031B9EC 310E00FF */ andi $t6, $t0, 0xff -/* 0D69F0 8031B9F0 000FC880 */ sll $t9, $t7, 2 -/* 0D69F4 8031B9F4 032FC823 */ subu $t9, $t9, $t7 -/* 0D69F8 8031B9F8 0019C880 */ sll $t9, $t9, 2 -/* 0D69FC 8031B9FC 03193821 */ addu $a3, $t8, $t9 -/* 0D6A00 8031BA00 90E20002 */ lbu $v0, 2($a3) -/* 0D6A04 8031BA04 01C04025 */ move $t0, $t6 -/* 0D6A08 8031BA08 01C2082A */ slt $at, $t6, $v0 -/* 0D6A0C 8031BA0C 5420000C */ bnezl $at, .L8031BA40 -/* 0D6A10 8031BA10 8CEE0008 */ lw $t6, 8($a3) -/* 0D6A14 8031BA14 304800FF */ andi $t0, $v0, 0xff -/* 0D6A18 8031BA18 55000006 */ bnezl $t0, .L8031BA34 -/* 0D6A1C 8031BA1C 2508FFFF */ addiu $t0, $t0, -1 -/* 0D6A20 8031BA20 920F0000 */ lbu $t7, ($s0) -/* 0D6A24 8031BA24 35F80020 */ ori $t8, $t7, 0x20 -/* 0D6A28 8031BA28 100000E2 */ b .L8031BDB4 -/* 0D6A2C 8031BA2C A2180000 */ sb $t8, ($s0) -/* 0D6A30 8031BA30 2508FFFF */ addiu $t0, $t0, -1 -.L8031BA34: -/* 0D6A34 8031BA34 311900FF */ andi $t9, $t0, 0xff -/* 0D6A38 8031BA38 03204025 */ move $t0, $t9 -/* 0D6A3C 8031BA3C 8CEE0008 */ lw $t6, 8($a3) -.L8031BA40: -/* 0D6A40 8031BA40 00087880 */ sll $t7, $t0, 2 -/* 0D6A44 8031BA44 01CFC021 */ addu $t8, $t6, $t7 -/* 0D6A48 8031BA48 8F020000 */ lw $v0, ($t8) -/* 0D6A4C 8031BA4C 54400006 */ bnezl $v0, .L8031BA68 -/* 0D6A50 8031BA50 8C58000C */ lw $t8, 0xc($v0) -/* 0D6A54 8031BA54 920E0000 */ lbu $t6, ($s0) -/* 0D6A58 8031BA58 35CF0020 */ ori $t7, $t6, 0x20 -/* 0D6A5C 8031BA5C 100000D5 */ b .L8031BDB4 -/* 0D6A60 8031BA60 A20F0000 */ sb $t7, ($s0) -/* 0D6A64 8031BA64 8C58000C */ lw $t8, 0xc($v0) -.L8031BA68: -/* 0D6A68 8031BA68 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D6A6C 8031BA6C AE180018 */ sw $t8, 0x18($s0) -/* 0D6A70 8031BA70 90590000 */ lbu $t9, ($v0) -/* 0D6A74 8031BA74 A2190014 */ sb $t9, 0x14($s0) -/* 0D6A78 8031BA78 904E0001 */ lbu $t6, 1($v0) -/* 0D6A7C 8031BA7C 448E9000 */ mtc1 $t6, $f18 -/* 0D6A80 8031BA80 05C10004 */ bgez $t6, .L8031BA94 -/* 0D6A84 8031BA84 46809120 */ cvt.s.w $f4, $f18 -/* 0D6A88 8031BA88 44813000 */ mtc1 $at, $f6 -/* 0D6A8C 8031BA8C 00000000 */ nop -/* 0D6A90 8031BA90 46062100 */ add.s $f4, $f4, $f6 -.L8031BA94: -/* 0D6A94 8031BA94 46002221 */ cvt.d.s $f8, $f4 -/* 0D6A98 8031BA98 24430004 */ addiu $v1, $v0, 4 -/* 0D6A9C 8031BA9C 46204282 */ mul.d $f10, $f8, $f0 -/* 0D6AA0 8031BAA0 AE03004C */ sw $v1, 0x4c($s0) -/* 0D6AA4 8031BAA4 46205420 */ cvt.s.d $f16, $f10 -/* 0D6AA8 8031BAA8 E6100028 */ swc1 $f16, 0x28($s0) -/* 0D6AAC 8031BAAC C4720004 */ lwc1 $f18, 4($v1) -/* 0D6AB0 8031BAB0 100000C0 */ b .L8031BDB4 -/* 0D6AB4 8031BAB4 E6120020 */ swc1 $f18, 0x20($s0) -/* 0D6AB8 8031BAB8 85980010 */ lh $t8, 0x10($t4) -.L8031BABC: -/* 0D6ABC 8031BABC 85AE001A */ lh $t6, 0x1a($t5) -/* 0D6AC0 8031BAC0 0078C821 */ addu $t9, $v1, $t8 -/* 0D6AC4 8031BAC4 8618001E */ lh $t8, 0x1e($s0) -/* 0D6AC8 8031BAC8 032E7821 */ addu $t7, $t9, $t6 -/* 0D6ACC 8031BACC 01F84021 */ addu $t0, $t7, $t8 -/* 0D6AD0 8031BAD0 310200FF */ andi $v0, $t0, 0xff -/* 0D6AD4 8031BAD4 28410080 */ slti $at, $v0, 0x80 -/* 0D6AD8 8031BAD8 14200005 */ bnez $at, .L8031BAF0 -/* 0D6ADC 8031BADC 00404025 */ move $t0, $v0 -/* 0D6AE0 8031BAE0 920F0000 */ lbu $t7, ($s0) -/* 0D6AE4 8031BAE4 35F80020 */ ori $t8, $t7, 0x20 -/* 0D6AE8 8031BAE8 100000B2 */ b .L8031BDB4 -/* 0D6AEC 8031BAEC A2180000 */ sb $t8, ($s0) -.L8031BAF0: -/* 0D6AF0 8031BAF0 8E030048 */ lw $v1, 0x48($s0) -/* 0D6AF4 8031BAF4 54600003 */ bnezl $v1, .L8031BB04 -/* 0D6AF8 8031BAF8 92190004 */ lbu $t9, 4($s0) -/* 0D6AFC 8031BAFC 8DA3003C */ lw $v1, 0x3c($t5) -/* 0D6B00 8031BB00 92190004 */ lbu $t9, 4($s0) -.L8031BB04: -/* 0D6B04 8031BB04 13200088 */ beqz $t9, .L8031BD28 -/* 0D6B08 8031BB08 00000000 */ nop -/* 0D6B0C 8031BB0C 92040003 */ lbu $a0, 3($s0) -/* 0D6B10 8031BB10 0082082A */ slt $at, $a0, $v0 -/* 0D6B14 8031BB14 10200003 */ beqz $at, .L8031BB24 -/* 0D6B18 8031BB18 00802825 */ move $a1, $a0 -/* 0D6B1C 8031BB1C 10000001 */ b .L8031BB24 -/* 0D6B20 8031BB20 00402825 */ move $a1, $v0 -.L8031BB24: -/* 0D6B24 8031BB24 10600017 */ beqz $v1, .L8031BB84 -/* 0D6B28 8031BB28 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0D6B2C 8031BB2C 906E0001 */ lbu $t6, 1($v1) -/* 0D6B30 8031BB30 30A200FF */ andi $v0, $a1, 0xff -/* 0D6B34 8031BB34 004E082A */ slt $at, $v0, $t6 -/* 0D6B38 8031BB38 50200004 */ beql $at, $zero, .L8031BB4C -/* 0D6B3C 8031BB3C 906F0002 */ lbu $t7, 2($v1) -/* 0D6B40 8031BB40 10000009 */ b .L8031BB68 -/* 0D6B44 8031BB44 24620008 */ addiu $v0, $v1, 8 -/* 0D6B48 8031BB48 906F0002 */ lbu $t7, 2($v1) -.L8031BB4C: -/* 0D6B4C 8031BB4C 24640018 */ addiu $a0, $v1, 0x18 -/* 0D6B50 8031BB50 01E2082A */ slt $at, $t7, $v0 -/* 0D6B54 8031BB54 14200003 */ bnez $at, .L8031BB64 -/* 0D6B58 8031BB58 00000000 */ nop -/* 0D6B5C 8031BB5C 10000001 */ b .L8031BB64 -/* 0D6B60 8031BB60 24640010 */ addiu $a0, $v1, 0x10 -.L8031BB64: -/* 0D6B64 8031BB64 00801025 */ move $v0, $a0 -.L8031BB68: -/* 0D6B68 8031BB68 8E18004C */ lw $t8, 0x4c($s0) -/* 0D6B6C 8031BB6C 0058C826 */ xor $t9, $v0, $t8 -/* 0D6B70 8031BB70 2F390001 */ sltiu $t9, $t9, 1 -/* 0D6B74 8031BB74 A3B9003F */ sb $t9, 0x3f($sp) -/* 0D6B78 8031BB78 AE02004C */ sw $v0, 0x4c($s0) -/* 0D6B7C 8031BB7C 10000003 */ b .L8031BB8C -/* 0D6B80 8031BB80 C4400004 */ lwc1 $f0, 4($v0) -.L8031BB84: -/* 0D6B84 8031BB84 44810000 */ mtc1 $at, $f0 -/* 0D6B88 8031BB88 AE00004C */ sw $zero, 0x4c($s0) -.L8031BB8C: -/* 0D6B8C 8031BB8C 3C038033 */ lui $v1, %hi(gNoteFrequencies) -/* 0D6B90 8031BB90 24632884 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0x2884 -/* 0D6B94 8031BB94 00087080 */ sll $t6, $t0, 2 -/* 0D6B98 8031BB98 92180003 */ lbu $t8, 3($s0) -/* 0D6B9C 8031BB9C 006E7821 */ addu $t7, $v1, $t6 -/* 0D6BA0 8031BBA0 C5E60000 */ lwc1 $f6, ($t7) -/* 0D6BA4 8031BBA4 920F0004 */ lbu $t7, 4($s0) -/* 0D6BA8 8031BBA8 0018C880 */ sll $t9, $t8, 2 -/* 0D6BAC 8031BBAC 00797021 */ addu $t6, $v1, $t9 -/* 0D6BB0 8031BBB0 C5C40000 */ lwc1 $f4, ($t6) -/* 0D6BB4 8031BBB4 46003082 */ mul.s $f2, $f6, $f0 -/* 0D6BB8 8031BBB8 2401FF7F */ li $at, -129 -/* 0D6BBC 8031BBBC 01E1C024 */ and $t8, $t7, $at -/* 0D6BC0 8031BBC0 2719FFFF */ addiu $t9, $t8, -1 -/* 0D6BC4 8031BBC4 2F210005 */ sltiu $at, $t9, 5 -/* 0D6BC8 8031BBC8 46002302 */ mul.s $f12, $f4, $f0 -/* 0D6BCC 8031BBCC 1020000C */ beqz $at, .L8031BC00 -/* 0D6BD0 8031BBD0 0019C880 */ sll $t9, $t9, 2 -/* 0D6BD4 8031BBD4 3C018033 */ lui $at, %hi(jtbl_80337CDC) -/* 0D6BD8 8031BBD8 00390821 */ addu $at, $at, $t9 -/* 0D6BDC 8031BBDC 8C397CDC */ lw $t9, %lo(jtbl_80337CDC)($at) -/* 0D6BE0 8031BBE0 03200008 */ jr $t9 -/* 0D6BE4 8031BBE4 00000000 */ nop -glabel L8031BBE8 -/* 0D6BE8 8031BBE8 E7A20024 */ swc1 $f2, 0x24($sp) -/* 0D6BEC 8031BBEC 10000005 */ b .L8031BC04 -/* 0D6BF0 8031BBF0 46006006 */ mov.s $f0, $f12 -glabel L8031BBF4 -/* 0D6BF4 8031BBF4 46001006 */ mov.s $f0, $f2 -/* 0D6BF8 8031BBF8 10000002 */ b .L8031BC04 -/* 0D6BFC 8031BBFC E7AC0024 */ swc1 $f12, 0x24($sp) -.L8031BC00: -/* 0D6C00 8031BC00 C7A00028 */ lwc1 $f0, 0x28($sp) -.L8031BC04: -/* 0D6C04 8031BC04 C7A80024 */ lwc1 $f8, 0x24($sp) -/* 0D6C08 8031BC08 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 -/* 0D6C0C 8031BC0C 44819800 */ mtc1 $at, $f19 -/* 0D6C10 8031BC10 46004283 */ div.s $f10, $f8, $f0 -/* 0D6C14 8031BC14 44809000 */ mtc1 $zero, $f18 -/* 0D6C18 8031BC18 26020004 */ addiu $v0, $s0, 4 -/* 0D6C1C 8031BC1C 46005421 */ cvt.d.s $f16, $f10 -/* 0D6C20 8031BC20 46328181 */ sub.d $f6, $f16, $f18 -/* 0D6C24 8031BC24 46203120 */ cvt.s.d $f4, $f6 -/* 0D6C28 8031BC28 E444000C */ swc1 $f4, 0xc($v0) -/* 0D6C2C 8031BC2C 920E0004 */ lbu $t6, 4($s0) -/* 0D6C30 8031BC30 31CF0080 */ andi $t7, $t6, 0x80 -/* 0D6C34 8031BC34 11E00023 */ beqz $t7, .L8031BCC4 -/* 0D6C38 8031BC38 3C0E8022 */ lui $t6, %hi(gTempoInternalToExternal) -/* 0D6C3C 8031BC3C 9598000A */ lhu $t8, 0xa($t4) -/* 0D6C40 8031BC40 3C018033 */ lui $at, %hi(D_80337CF0) -/* 0D6C44 8031BC44 D4287CF0 */ ldc1 $f8, %lo(D_80337CF0)($at) -/* 0D6C48 8031BC48 44985000 */ mtc1 $t8, $f10 -/* 0D6C4C 8031BC4C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D6C50 8031BC50 07010004 */ bgez $t8, .L8031BC64 -/* 0D6C54 8031BC54 46805420 */ cvt.s.w $f16, $f10 -/* 0D6C58 8031BC58 44819000 */ mtc1 $at, $f18 -/* 0D6C5C 8031BC5C 00000000 */ nop -/* 0D6C60 8031BC60 46128400 */ add.s $f16, $f16, $f18 -.L8031BC64: -/* 0D6C64 8031BC64 8619003C */ lh $t9, 0x3c($s0) -/* 0D6C68 8031BC68 85CE6D7C */ lh $t6, %lo(gTempoInternalToExternal)($t6) -/* 0D6C6C 8031BC6C 460081A1 */ cvt.d.s $f6, $f16 -/* 0D6C70 8031BC70 44995000 */ mtc1 $t9, $f10 -/* 0D6C74 8031BC74 448E8000 */ mtc1 $t6, $f16 -/* 0D6C78 8031BC78 46264102 */ mul.d $f4, $f8, $f6 -/* 0D6C7C 8031BC7C 960F001C */ lhu $t7, 0x1c($s0) -/* 0D6C80 8031BC80 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D6C84 8031BC84 468054A0 */ cvt.s.w $f18, $f10 -/* 0D6C88 8031BC88 448F5000 */ mtc1 $t7, $f10 -/* 0D6C8C 8031BC8C 46808220 */ cvt.s.w $f8, $f16 -/* 0D6C90 8031BC90 46805420 */ cvt.s.w $f16, $f10 -/* 0D6C94 8031BC94 46089182 */ mul.s $f6, $f18, $f8 -/* 0D6C98 8031BC98 05E10004 */ bgez $t7, .L8031BCAC -/* 0D6C9C 8031BC9C 00000000 */ nop -/* 0D6CA0 8031BCA0 44819000 */ mtc1 $at, $f18 -/* 0D6CA4 8031BCA4 00000000 */ nop -/* 0D6CA8 8031BCA8 46128400 */ add.s $f16, $f16, $f18 -.L8031BCAC: -/* 0D6CAC 8031BCAC 46068202 */ mul.s $f8, $f16, $f6 -/* 0D6CB0 8031BCB0 460042A1 */ cvt.d.s $f10, $f8 -/* 0D6CB4 8031BCB4 462A2483 */ div.d $f18, $f4, $f10 -/* 0D6CB8 8031BCB8 46209420 */ cvt.s.d $f16, $f18 -/* 0D6CBC 8031BCBC 1000000F */ b .L8031BCFC -/* 0D6CC0 8031BCC0 E4500008 */ swc1 $f16, 8($v0) -.L8031BCC4: -/* 0D6CC4 8031BCC4 9618001C */ lhu $t8, 0x1c($s0) -/* 0D6CC8 8031BCC8 3C018033 */ lui $at, %hi(D_80337CF8) -/* 0D6CCC 8031BCCC D4267CF8 */ ldc1 $f6, %lo(D_80337CF8)($at) -/* 0D6CD0 8031BCD0 44984000 */ mtc1 $t8, $f8 -/* 0D6CD4 8031BCD4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D6CD8 8031BCD8 07010004 */ bgez $t8, .L8031BCEC -/* 0D6CDC 8031BCDC 46804120 */ cvt.s.w $f4, $f8 -/* 0D6CE0 8031BCE0 44815000 */ mtc1 $at, $f10 -/* 0D6CE4 8031BCE4 00000000 */ nop -/* 0D6CE8 8031BCE8 460A2100 */ add.s $f4, $f4, $f10 -.L8031BCEC: -/* 0D6CEC 8031BCEC 460024A1 */ cvt.d.s $f18, $f4 -/* 0D6CF0 8031BCF0 46323403 */ div.d $f16, $f6, $f18 -/* 0D6CF4 8031BCF4 46208220 */ cvt.s.d $f8, $f16 -/* 0D6CF8 8031BCF8 E4480008 */ swc1 $f8, 8($v0) -.L8031BCFC: -/* 0D6CFC 8031BCFC 44805000 */ mtc1 $zero, $f10 -/* 0D6D00 8031BD00 2401FF7F */ li $at, -129 -/* 0D6D04 8031BD04 E44A0004 */ swc1 $f10, 4($v0) -/* 0D6D08 8031BD08 92190004 */ lbu $t9, 4($s0) -/* 0D6D0C 8031BD0C E6000020 */ swc1 $f0, 0x20($s0) -/* 0D6D10 8031BD10 03217024 */ and $t6, $t9, $at -/* 0D6D14 8031BD14 24010005 */ li $at, 5 -/* 0D6D18 8031BD18 55C10027 */ bnel $t6, $at, .L8031BDB8 -/* 0D6D1C 8031BD1C 860F003C */ lh $t7, 0x3c($s0) -/* 0D6D20 8031BD20 10000024 */ b .L8031BDB4 -/* 0D6D24 8031BD24 A2080003 */ sb $t0, 3($s0) -.L8031BD28: -/* 0D6D28 8031BD28 1060001C */ beqz $v1, .L8031BD9C -/* 0D6D2C 8031BD2C 0008C880 */ sll $t9, $t0, 2 -/* 0D6D30 8031BD30 906F0001 */ lbu $t7, 1($v1) -/* 0D6D34 8031BD34 004F082A */ slt $at, $v0, $t7 -/* 0D6D38 8031BD38 10200003 */ beqz $at, .L8031BD48 -/* 0D6D3C 8031BD3C 00087880 */ sll $t7, $t0, 2 -/* 0D6D40 8031BD40 10000009 */ b .L8031BD68 -/* 0D6D44 8031BD44 24620008 */ addiu $v0, $v1, 8 -.L8031BD48: -/* 0D6D48 8031BD48 90780002 */ lbu $t8, 2($v1) -/* 0D6D4C 8031BD4C 24640018 */ addiu $a0, $v1, 0x18 -/* 0D6D50 8031BD50 0302082A */ slt $at, $t8, $v0 -/* 0D6D54 8031BD54 14200003 */ bnez $at, .L8031BD64 -/* 0D6D58 8031BD58 00000000 */ nop -/* 0D6D5C 8031BD5C 10000001 */ b .L8031BD64 -/* 0D6D60 8031BD60 24640010 */ addiu $a0, $v1, 0x10 -.L8031BD64: -/* 0D6D64 8031BD64 00801025 */ move $v0, $a0 -.L8031BD68: -/* 0D6D68 8031BD68 8E19004C */ lw $t9, 0x4c($s0) -/* 0D6D6C 8031BD6C 3C038033 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8033 -/* 0D6D70 8031BD70 24632884 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0x2884 -/* 0D6D74 8031BD74 00597026 */ xor $t6, $v0, $t9 -/* 0D6D78 8031BD78 2DCE0001 */ sltiu $t6, $t6, 1 -/* 0D6D7C 8031BD7C A3AE003F */ sb $t6, 0x3f($sp) -/* 0D6D80 8031BD80 AE02004C */ sw $v0, 0x4c($s0) -/* 0D6D84 8031BD84 006FC021 */ addu $t8, $v1, $t7 -/* 0D6D88 8031BD88 C7060000 */ lwc1 $f6, ($t8) -/* 0D6D8C 8031BD8C C4440004 */ lwc1 $f4, 4($v0) -/* 0D6D90 8031BD90 46062482 */ mul.s $f18, $f4, $f6 -/* 0D6D94 8031BD94 10000007 */ b .L8031BDB4 -/* 0D6D98 8031BD98 E6120020 */ swc1 $f18, 0x20($s0) -.L8031BD9C: -/* 0D6D9C 8031BD9C 3C038033 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8033 -/* 0D6DA0 8031BDA0 24632884 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0x2884 -/* 0D6DA4 8031BDA4 AE00004C */ sw $zero, 0x4c($s0) -/* 0D6DA8 8031BDA8 00797021 */ addu $t6, $v1, $t9 -/* 0D6DAC 8031BDAC C5D00000 */ lwc1 $f16, ($t6) -/* 0D6DB0 8031BDB0 E6100020 */ swc1 $f16, 0x20($s0) -.L8031BDB4: -/* 0D6DB4 8031BDB4 860F003C */ lh $t7, 0x3c($s0) -.L8031BDB8: -/* 0D6DB8 8031BDB8 A60F0040 */ sh $t7, 0x40($s0) -.L8031BDBC: -/* 0D6DBC 8031BDBC 8E020000 */ lw $v0, ($s0) -/* 0D6DC0 8031BDC0 24010001 */ li $at, 1 -/* 0D6DC4 8031BDC4 0002C080 */ sll $t8, $v0, 2 -/* 0D6DC8 8031BDC8 0018CFC2 */ srl $t9, $t8, 0x1f -/* 0D6DCC 8031BDCC 5721000C */ bnel $t9, $at, .L8031BE00 -/* 0D6DD0 8031BDD0 000270C0 */ sll $t6, $v0, 3 -/* 0D6DD4 8031BDD4 8E0E0044 */ lw $t6, 0x44($s0) -/* 0D6DD8 8031BDD8 0002C0C0 */ sll $t8, $v0, 3 -/* 0D6DDC 8031BDDC 15C00003 */ bnez $t6, .L8031BDEC -/* 0D6DE0 8031BDE0 00000000 */ nop -/* 0D6DE4 8031BDE4 0703002E */ bgezl $t8, .L8031BEA0 -/* 0D6DE8 8031BDE8 8FBF001C */ lw $ra, 0x1c($sp) -.L8031BDEC: -/* 0D6DEC 8031BDEC 0C0C63B1 */ jal seq_channel_layer_note_decay -/* 0D6DF0 8031BDF0 02002025 */ move $a0, $s0 -/* 0D6DF4 8031BDF4 1000002A */ b .L8031BEA0 -/* 0D6DF8 8031BDF8 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D6DFC 8031BDFC 000270C0 */ sll $t6, $v0, 3 -.L8031BE00: -/* 0D6E00 8031BE00 05C00003 */ bltz $t6, .L8031BE10 -/* 0D6E04 8031BE04 00004025 */ move $t0, $zero -/* 0D6E08 8031BE08 10000017 */ b .L8031BE68 -/* 0D6E0C 8031BE0C 24080001 */ li $t0, 1 -.L8031BE10: -/* 0D6E10 8031BE10 8E040044 */ lw $a0, 0x44($s0) -/* 0D6E14 8031BE14 10800005 */ beqz $a0, .L8031BE2C -/* 0D6E18 8031BE18 00000000 */ nop -/* 0D6E1C 8031BE1C 920F0001 */ lbu $t7, 1($s0) -/* 0D6E20 8031BE20 93B8003F */ lbu $t8, 0x3f($sp) -/* 0D6E24 8031BE24 15E00003 */ bnez $t7, .L8031BE34 -/* 0D6E28 8031BE28 00000000 */ nop -.L8031BE2C: -/* 0D6E2C 8031BE2C 1000000E */ b .L8031BE68 -/* 0D6E30 8031BE30 24080001 */ li $t0, 1 -.L8031BE34: -/* 0D6E34 8031BE34 57000006 */ bnezl $t8, .L8031BE50 -/* 0D6E38 8031BE38 8E19004C */ lw $t9, 0x4c($s0) -/* 0D6E3C 8031BE3C 0C0C63B1 */ jal seq_channel_layer_note_decay -/* 0D6E40 8031BE40 02002025 */ move $a0, $s0 -/* 0D6E44 8031BE44 10000008 */ b .L8031BE68 -/* 0D6E48 8031BE48 24080001 */ li $t0, 1 -/* 0D6E4C 8031BE4C 8E19004C */ lw $t9, 0x4c($s0) -.L8031BE50: -/* 0D6E50 8031BE50 02002825 */ move $a1, $s0 -/* 0D6E54 8031BE54 17200004 */ bnez $t9, .L8031BE68 -/* 0D6E58 8031BE58 00000000 */ nop -/* 0D6E5C 8031BE5C 0C0C6459 */ jal init_synthetic_wave -/* 0D6E60 8031BE60 A3A8003D */ sb $t0, 0x3d($sp) -/* 0D6E64 8031BE64 93A8003D */ lbu $t0, 0x3d($sp) -.L8031BE68: -/* 0D6E68 8031BE68 51000005 */ beql $t0, $zero, .L8031BE80 -/* 0D6E6C 8031BE6C 8E040044 */ lw $a0, 0x44($s0) -/* 0D6E70 8031BE70 0C0C6638 */ jal alloc_note -/* 0D6E74 8031BE74 02002025 */ move $a0, $s0 -/* 0D6E78 8031BE78 AE020044 */ sw $v0, 0x44($s0) -/* 0D6E7C 8031BE7C 8E040044 */ lw $a0, 0x44($s0) -.L8031BE80: -/* 0D6E80 8031BE80 50800007 */ beql $a0, $zero, .L8031BEA0 -/* 0D6E84 8031BE84 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D6E88 8031BE88 8C8E002C */ lw $t6, 0x2c($a0) -/* 0D6E8C 8031BE8C 560E0004 */ bnel $s0, $t6, .L8031BEA0 -/* 0D6E90 8031BE90 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D6E94 8031BE94 0C0C691E */ jal note_vibrato_init -/* 0D6E98 8031BE98 00000000 */ nop -.L8031BE9C: -/* 0D6E9C 8031BE9C 8FBF001C */ lw $ra, 0x1c($sp) -.L8031BEA0: -/* 0D6EA0 8031BEA0 8FB00018 */ lw $s0, 0x18($sp) -/* 0D6EA4 8031BEA4 27BD0060 */ addiu $sp, $sp, 0x60 -/* 0D6EA8 8031BEA8 03E00008 */ jr $ra -/* 0D6EAC 8031BEAC 00000000 */ nop diff --git a/asm/non_matchings/seq_channel_layer_process_script_us.s b/asm/non_matchings/seq_channel_layer_process_script_us.s deleted file mode 100644 index 32e57b678b..0000000000 --- a/asm/non_matchings/seq_channel_layer_process_script_us.s +++ /dev/null @@ -1,999 +0,0 @@ -.late_rodata -glabel jtbl_80337C90 - .word L_U_8031C2DC - .word L_U_8031C298 - .word L_U_8031C6A0 - .word L_U_8031C6A0 - .word L_U_8031C328 - .word L_U_8031C23C - .word L_U_8031C6A0 - .word L_U_8031C6A0 - .word L_U_8031C200 - -glabel jtbl_80337CB4 - .word L_U_8031C36C - .word L_U_8031C3BC - .word L_U_8031C454 - .word L_U_8031C3E8 - .word L_U_8031C3E8 - .word L_U_8031C4A4 - .word L_U_8031C5C8 - .word L_U_8031C698 - .word L_U_8031C3BC - .word L_U_8031C36C - -glabel jtbl_80337CDC - .word L_U_8031CBE0 - .word L_U_8031CBEC - .word L_U_8031CBE0 - .word L_U_8031CBEC - .word L_U_8031CBE0 - -.text -glabel seq_channel_layer_process_script -/* 0D70C4 8031C0C4 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0D70C8 8031C0C8 240E0001 */ li $t6, 1 -/* 0D70CC 8031C0CC AFBF001C */ sw $ra, 0x1c($sp) -/* 0D70D0 8031C0D0 AFB00018 */ sw $s0, 0x18($sp) -/* 0D70D4 8031C0D4 A3AE003F */ sb $t6, 0x3f($sp) -/* 0D70D8 8031C0D8 8C820000 */ lw $v0, ($a0) -/* 0D70DC 8031C0DC 00808025 */ move $s0, $a0 -/* 0D70E0 8031C0E0 00027FC2 */ srl $t7, $v0, 0x1f -/* 0D70E4 8031C0E4 51E00357 */ beql $t7, $zero, .L8031CE44 -/* 0D70E8 8031C0E8 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D70EC 8031C0EC 8483003C */ lh $v1, 0x3c($a0) -/* 0D70F0 8031C0F0 00027080 */ sll $t6, $v0, 2 -/* 0D70F4 8031C0F4 0002C8C0 */ sll $t9, $v0, 3 -/* 0D70F8 8031C0F8 28610002 */ slti $at, $v1, 2 -/* 0D70FC 8031C0FC 1420000E */ bnez $at, .L8031C138 -/* 0D7100 8031C100 2478FFFF */ addiu $t8, $v1, -1 -/* 0D7104 8031C104 05C0034E */ bltz $t6, .L8031CE40 -/* 0D7108 8031C108 A498003C */ sh $t8, 0x3c($a0) -/* 0D710C 8031C10C 848F003E */ lh $t7, 0x3e($a0) -/* 0D7110 8031C110 8498003C */ lh $t8, 0x3c($a0) -/* 0D7114 8031C114 01F8082A */ slt $at, $t7, $t8 -/* 0D7118 8031C118 5420034A */ bnezl $at, .L8031CE44 -/* 0D711C 8031C11C 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D7120 8031C120 0C0C67D9 */ jal seq_channel_layer_note_decay -/* 0D7124 8031C124 00000000 */ nop -/* 0D7128 8031C128 920E0000 */ lbu $t6, ($s0) -/* 0D712C 8031C12C 35CF0020 */ ori $t7, $t6, 0x20 -/* 0D7130 8031C130 10000343 */ b .L8031CE40 -/* 0D7134 8031C134 A20F0000 */ sb $t7, ($s0) -.L8031C138: -/* 0D7138 8031C138 07220004 */ bltzl $t9, .L8031C14C_2 -/* 0D713C 8031C13C 92020004 */ lbu $v0, 4($s0) -/* 0D7140 8031C140 0C0C67D9 */ jal seq_channel_layer_note_decay -/* 0D7144 8031C144 02002025 */ move $a0, $s0 -/* 0D7148 8031C148 92020004 */ lbu $v0, 4($s0) -.L8031C14C_2: -/* 0D714C 8031C14C 2401FF7F */ li $at, -129 -/* 0D7150 8031C150 3C1F8022 */ lui $ra, %hi(gCtlEntries) # $ra, 0x8022 -/* 0D7154 8031C154 00417024 */ and $t6, $v0, $at -/* 0D7158 8031C158 24010001 */ li $at, 1 -/* 0D715C 8031C15C 11C10004 */ beq $t6, $at, .L8031C170 -/* 0D7160 8031C160 27FF6B60 */ addiu $ra, %lo(gCtlEntries) # addiu $ra, $ra, 0x6b60 -/* 0D7164 8031C164 24010002 */ li $at, 2 -/* 0D7168 8031C168 55C10003 */ bnel $t6, $at, .L8031C178 -/* 0D716C 8031C16C 8E0D0050 */ lw $t5, 0x50($s0) -.L8031C170: -/* 0D7170 8031C170 A2000004 */ sb $zero, 4($s0) -/* 0D7174 8031C174 8E0D0050 */ lw $t5, 0x50($s0) -.L8031C178: -/* 0D7178 8031C178 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 0D717C 8031C17C 3C0B8022 */ lui $t3, %hi(gBankLoadedPool) # $t3, 0x8022 -/* 0D7180 8031C180 44810000 */ mtc1 $at, $f0 -/* 0D7184 8031C184 256B10F8 */ addiu $t3, %lo(gBankLoadedPool) # addiu $t3, $t3, 0x10f8 -/* 0D7188 8031C188 97AA003A */ lhu $t2, 0x3a($sp) -/* 0D718C 8031C18C 240900FF */ li $t1, 255 -/* 0D7190 8031C190 8DAC0040 */ lw $t4, 0x40($t5) -.L8031C194: -/* 0D7194 8031C194 8E020054 */ lw $v0, 0x54($s0) -.L8031C198: -/* 0D7198 8031C198 244F0001 */ addiu $t7, $v0, 1 -/* 0D719C 8031C19C AE0F0054 */ sw $t7, 0x54($s0) -/* 0D71A0 8031C1A0 90440000 */ lbu $a0, ($v0) -/* 0D71A4 8031C1A4 288100C1 */ slti $at, $a0, 0xc1 -/* 0D71A8 8031C1A8 14200156 */ bnez $at, .L8031C704 -/* 0D71AC 8031C1AC 00802825 */ move $a1, $a0 -/* 0D71B0 8031C1B0 288100CB */ slti $at, $a0, 0xcb -/* 0D71B4 8031C1B4 1420000A */ bnez $at, .L8031C1E0 -/* 0D71B8 8031C1B8 24B9FF3F */ addiu $t9, $a1, -0xc1 -/* 0D71BC 8031C1BC 2498FF09 */ addiu $t8, $a0, -0xf7 -/* 0D71C0 8031C1C0 2F010009 */ sltiu $at, $t8, 9 -/* 0D71C4 8031C1C4 10200136 */ beqz $at, .L8031C6A0 -/* 0D71C8 8031C1C8 0018C080 */ sll $t8, $t8, 2 -/* 0D71CC 8031C1CC 3C018034 */ lui $at, %hi(jtbl_80337C90) -/* 0D71D0 8031C1D0 00380821 */ addu $at, $at, $t8 -/* 0D71D4 8031C1D4 8C388E60 */ lw $t8, %lo(jtbl_80337C90)($at) -/* 0D71D8 8031C1D8 03000008 */ jr $t8 -/* 0D71DC 8031C1DC 00000000 */ nop -.L8031C1E0: -/* 0D71E0 8031C1E0 2F21000A */ sltiu $at, $t9, 0xa -/* 0D71E4 8031C1E4 1020012E */ beqz $at, .L8031C6A0 -/* 0D71E8 8031C1E8 0019C880 */ sll $t9, $t9, 2 -/* 0D71EC 8031C1EC 3C018034 */ lui $at, %hi(jtbl_80337CB4) -/* 0D71F0 8031C1F0 00390821 */ addu $at, $at, $t9 -/* 0D71F4 8031C1F4 8C398E84 */ lw $t9, %lo(jtbl_80337CB4)($at) -/* 0D71F8 8031C1F8 03200008 */ jr $t9 -/* 0D71FC 8031C1FC 00000000 */ nop -glabel L_U_8031C200 -/* 0D7200 8031C200 26020054 */ addiu $v0, $s0, 0x54 -/* 0D7204 8031C204 90430018 */ lbu $v1, 0x18($v0) -/* 0D7208 8031C208 14600005 */ bnez $v1, .L8031C220 -/* 0D720C 8031C20C 246EFFFF */ addiu $t6, $v1, -1 -/* 0D7210 8031C210 0C0C6E8C */ jal seq_channel_layer_disable -/* 0D7214 8031C214 02002025 */ move $a0, $s0 -/* 0D7218 8031C218 1000030A */ b .L8031CE44 -/* 0D721C 8031C21C 8FBF001C */ lw $ra, 0x1c($sp) -.L8031C220: -/* 0D7220 8031C220 31CF00FF */ andi $t7, $t6, 0xff -/* 0D7224 8031C224 000FC080 */ sll $t8, $t7, 2 -/* 0D7228 8031C228 0058C821 */ addu $t9, $v0, $t8 -/* 0D722C 8031C22C A04E0018 */ sb $t6, 0x18($v0) -/* 0D7230 8031C230 8F2E0004 */ lw $t6, 4($t9) -/* 0D7234 8031C234 1000FFD7 */ b .L8031C194 -/* 0D7238 8031C238 AC4E0000 */ sw $t6, ($v0) -glabel L_U_8031C23C -/* 0D723C 8031C23C 26020054 */ addiu $v0, $s0, 0x54 -/* 0D7240 8031C240 8C430000 */ lw $v1, ($v0) -/* 0D7244 8031C244 90640000 */ lbu $a0, ($v1) -/* 0D7248 8031C248 246E0001 */ addiu $t6, $v1, 1 -/* 0D724C 8031C24C AC4E0000 */ sw $t6, ($v0) -/* 0D7250 8031C250 91CF0000 */ lbu $t7, ($t6) -/* 0D7254 8031C254 0004CA00 */ sll $t9, $a0, 8 -/* 0D7258 8031C258 01F92825 */ or $a1, $t7, $t9 -/* 0D725C 8031C25C 904F0018 */ lbu $t7, 0x18($v0) -/* 0D7260 8031C260 25D90001 */ addiu $t9, $t6, 1 -/* 0D7264 8031C264 AC590000 */ sw $t9, ($v0) -/* 0D7268 8031C268 25F80001 */ addiu $t8, $t7, 1 -/* 0D726C 8031C26C 330E00FF */ andi $t6, $t8, 0xff -/* 0D7270 8031C270 000E7880 */ sll $t7, $t6, 2 -/* 0D7274 8031C274 A0580018 */ sb $t8, 0x18($v0) -/* 0D7278 8031C278 004FC021 */ addu $t8, $v0, $t7 -/* 0D727C 8031C27C AF190000 */ sw $t9, ($t8) -/* 0D7280 8031C280 8D8E0014 */ lw $t6, 0x14($t4) -/* 0D7284 8031C284 30AFFFFF */ andi $t7, $a1, 0xffff -/* 0D7288 8031C288 30AAFFFF */ andi $t2, $a1, 0xffff -/* 0D728C 8031C28C 01CFC821 */ addu $t9, $t6, $t7 -/* 0D7290 8031C290 1000FFC0 */ b .L8031C194 -/* 0D7294 8031C294 AC590000 */ sw $t9, ($v0) -glabel L_U_8031C298 -/* 0D7298 8031C298 26020054 */ addiu $v0, $s0, 0x54 -/* 0D729C 8031C29C 8C430000 */ lw $v1, ($v0) -/* 0D72A0 8031C2A0 904E0018 */ lbu $t6, 0x18($v0) -/* 0D72A4 8031C2A4 24780001 */ addiu $t8, $v1, 1 -/* 0D72A8 8031C2A8 AC580000 */ sw $t8, ($v0) -/* 0D72AC 8031C2AC 90650000 */ lbu $a1, ($v1) -/* 0D72B0 8031C2B0 004E7821 */ addu $t7, $v0, $t6 -/* 0D72B4 8031C2B4 A1E50014 */ sb $a1, 0x14($t7) -/* 0D72B8 8031C2B8 90590018 */ lbu $t9, 0x18($v0) -/* 0D72BC 8031C2BC 8C4E0000 */ lw $t6, ($v0) -/* 0D72C0 8031C2C0 27380001 */ addiu $t8, $t9, 1 -/* 0D72C4 8031C2C4 330F00FF */ andi $t7, $t8, 0xff -/* 0D72C8 8031C2C8 000FC880 */ sll $t9, $t7, 2 -/* 0D72CC 8031C2CC A0580018 */ sb $t8, 0x18($v0) -/* 0D72D0 8031C2D0 0059C021 */ addu $t8, $v0, $t9 -/* 0D72D4 8031C2D4 1000FFAF */ b .L8031C194 -/* 0D72D8 8031C2D8 AF0E0000 */ sw $t6, ($t8) -glabel L_U_8031C2DC -/* 0D72DC 8031C2DC 26020054 */ addiu $v0, $s0, 0x54 -/* 0D72E0 8031C2E0 904F0018 */ lbu $t7, 0x18($v0) -/* 0D72E4 8031C2E4 004F2021 */ addu $a0, $v0, $t7 -/* 0D72E8 8031C2E8 90990013 */ lbu $t9, 0x13($a0) -/* 0D72EC 8031C2EC 272EFFFF */ addiu $t6, $t9, -1 -/* 0D72F0 8031C2F0 A08E0013 */ sb $t6, 0x13($a0) -/* 0D72F4 8031C2F4 90430018 */ lbu $v1, 0x18($v0) -/* 0D72F8 8031C2F8 0043C021 */ addu $t8, $v0, $v1 -/* 0D72FC 8031C2FC 930F0013 */ lbu $t7, 0x13($t8) -/* 0D7300 8031C300 00602825 */ move $a1, $v1 -/* 0D7304 8031C304 0005C880 */ sll $t9, $a1, 2 -/* 0D7308 8031C308 11E00004 */ beqz $t7, .L8031C31C -/* 0D730C 8031C30C 00597021 */ addu $t6, $v0, $t9 -/* 0D7310 8031C310 8DD80000 */ lw $t8, ($t6) -/* 0D7314 8031C314 1000FF9F */ b .L8031C194 -/* 0D7318 8031C318 AC580000 */ sw $t8, ($v0) -.L8031C31C: -/* 0D731C 8031C31C 246FFFFF */ addiu $t7, $v1, -1 -/* 0D7320 8031C320 1000FF9C */ b .L8031C194 -/* 0D7324 8031C324 A04F0018 */ sb $t7, 0x18($v0) -glabel L_U_8031C328 -/* 0D7328 8031C328 26020054 */ addiu $v0, $s0, 0x54 -/* 0D732C 8031C32C 8C430000 */ lw $v1, ($v0) -/* 0D7330 8031C330 90640000 */ lbu $a0, ($v1) -/* 0D7334 8031C334 246F0001 */ addiu $t7, $v1, 1 -/* 0D7338 8031C338 AC4F0000 */ sw $t7, ($v0) -/* 0D733C 8031C33C 91F90000 */ lbu $t9, ($t7) -/* 0D7340 8031C340 0004C200 */ sll $t8, $a0, 8 -/* 0D7344 8031C344 25EF0001 */ addiu $t7, $t7, 1 -/* 0D7348 8031C348 03387025 */ or $t6, $t9, $t8 -/* 0D734C 8031C34C AC4F0000 */ sw $t7, ($v0) -/* 0D7350 8031C350 8D990014 */ lw $t9, 0x14($t4) -/* 0D7354 8031C354 01C0C025 */ move $t8, $t6 -/* 0D7358 8031C358 330AFFFF */ andi $t2, $t8, 0xffff -/* 0D735C 8031C35C 330EFFFF */ andi $t6, $t8, 0xffff -/* 0D7360 8031C360 032EC021 */ addu $t8, $t9, $t6 -/* 0D7364 8031C364 1000FF8B */ b .L8031C194 -/* 0D7368 8031C368 AC580000 */ sw $t8, ($v0) -glabel L_U_8031C36C -/* 0D736C 8031C36C 26020054 */ addiu $v0, $s0, 0x54 -/* 0D7370 8031C370 8C430000 */ lw $v1, ($v0) -/* 0D7374 8031C374 240100C1 */ li $at, 193 -/* 0D7378 8031C378 90640000 */ lbu $a0, ($v1) -/* 0D737C 8031C37C 246F0001 */ addiu $t7, $v1, 1 -/* 0D7380 8031C380 14A10008 */ bne $a1, $at, .L8031C3A4 -/* 0D7384 8031C384 AC4F0000 */ sw $t7, ($v0) -/* 0D7388 8031C388 00840019 */ multu $a0, $a0 -/* 0D738C 8031C38C 0000C812 */ mflo $t9 -/* 0D7390 8031C390 44992000 */ mtc1 $t9, $f4 -/* 0D7394 8031C394 00000000 */ nop -/* 0D7398 8031C398 468021A0 */ cvt.s.w $f6, $f4 -/* 0D739C 8031C39C 1000FF7D */ b .L8031C194 -/* 0D73A0 8031C3A0 E6060024 */ swc1 $f6, 0x24($s0) -.L8031C3A4: -/* 0D73A4 8031C3A4 44844000 */ mtc1 $a0, $f8 -/* 0D73A8 8031C3A8 00000000 */ nop -/* 0D73AC 8031C3AC 468042A0 */ cvt.s.w $f10, $f8 -/* 0D73B0 8031C3B0 46005402 */ mul.s $f16, $f10, $f0 -/* 0D73B4 8031C3B4 1000FF77 */ b .L8031C194 -/* 0D73B8 8031C3B8 E6100028 */ swc1 $f16, 0x28($s0) -glabel L_U_8031C3BC -/* 0D73BC 8031C3BC 26020054 */ addiu $v0, $s0, 0x54 -/* 0D73C0 8031C3C0 8C430000 */ lw $v1, ($v0) -/* 0D73C4 8031C3C4 240100C9 */ li $at, 201 -/* 0D73C8 8031C3C8 90640000 */ lbu $a0, ($v1) -/* 0D73CC 8031C3CC 246E0001 */ addiu $t6, $v1, 1 -/* 0D73D0 8031C3D0 14A10003 */ bne $a1, $at, .L8031C3E0 -/* 0D73D4 8031C3D4 AC4E0000 */ sw $t6, ($v0) -/* 0D73D8 8031C3D8 1000FF6E */ b .L8031C194 -/* 0D73DC 8031C3DC A2040002 */ sb $a0, 2($s0) -.L8031C3E0: -/* 0D73E0 8031C3E0 1000FF6C */ b .L8031C194 -/* 0D73E4 8031C3E4 A604001E */ sh $a0, 0x1e($s0) -glabel L_U_8031C3E8 -/* 0D73E8 8031C3E8 240100C4 */ li $at, 196 -/* 0D73EC 8031C3EC 14A10003 */ bne $a1, $at, .L8031C3FC -/* 0D73F0 8031C3F0 02002025 */ move $a0, $s0 -/* 0D73F4 8031C3F4 10000002 */ b .L8031C400 -/* 0D73F8 8031C3F8 24020001 */ li $v0, 1 -.L8031C3FC: -/* 0D73FC 8031C3FC 00001025 */ move $v0, $zero -.L8031C400: -/* 0D7400 8031C400 920E0000 */ lbu $t6, ($s0) -/* 0D7404 8031C404 00027900 */ sll $t7, $v0, 4 -/* 0D7408 8031C408 31F90010 */ andi $t9, $t7, 0x10 -/* 0D740C 8031C40C 31D8FFEF */ andi $t8, $t6, 0xffef -/* 0D7410 8031C410 03387825 */ or $t7, $t9, $t8 -/* 0D7414 8031C414 A20F0000 */ sb $t7, ($s0) -/* 0D7418 8031C418 AFAD0058 */ sw $t5, 0x58($sp) -/* 0D741C 8031C41C AFAC005C */ sw $t4, 0x5c($sp) -/* 0D7420 8031C420 0C0C67D9 */ jal seq_channel_layer_note_decay -/* 0D7424 8031C424 A7AA003A */ sh $t2, 0x3a($sp) -/* 0D7428 8031C428 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 0D742C 8031C42C 44810000 */ mtc1 $at, $f0 -/* 0D7430 8031C430 3C0B8022 */ lui $t3, %hi(gBankLoadedPool) # $t3, 0x8022 -/* 0D7434 8031C434 3C1F8022 */ lui $ra, %hi(gCtlEntries) # $ra, 0x8022 -/* 0D7438 8031C438 27FF6B60 */ addiu $ra, %lo(gCtlEntries) # addiu $ra, $ra, 0x6b60 -/* 0D743C 8031C43C 256B10F8 */ addiu $t3, %lo(gBankLoadedPool) # addiu $t3, $t3, 0x10f8 -/* 0D7440 8031C440 240900FF */ li $t1, 255 -/* 0D7444 8031C444 97AA003A */ lhu $t2, 0x3a($sp) -/* 0D7448 8031C448 8FAC005C */ lw $t4, 0x5c($sp) -/* 0D744C 8031C44C 1000FF51 */ b .L8031C194 -/* 0D7450 8031C450 8FAD0058 */ lw $t5, 0x58($sp) -glabel L_U_8031C454 -/* 0D7454 8031C454 26020054 */ addiu $v0, $s0, 0x54 -/* 0D7458 8031C458 8C430000 */ lw $v1, ($v0) -/* 0D745C 8031C45C 90640000 */ lbu $a0, ($v1) -/* 0D7460 8031C460 246E0001 */ addiu $t6, $v1, 1 -/* 0D7464 8031C464 AC4E0000 */ sw $t6, ($v0) -/* 0D7468 8031C468 30990080 */ andi $t9, $a0, 0x80 -/* 0D746C 8031C46C 1320000A */ beqz $t9, .L8031C498 -/* 0D7470 8031C470 00802825 */ move $a1, $a0 -/* 0D7474 8031C474 01C01825 */ move $v1, $t6 -/* 0D7478 8031C478 91CE0000 */ lbu $t6, ($t6) -/* 0D747C 8031C47C 00052200 */ sll $a0, $a1, 8 -/* 0D7480 8031C480 308F7F00 */ andi $t7, $a0, 0x7f00 -/* 0D7484 8031C484 01CF2025 */ or $a0, $t6, $t7 -/* 0D7488 8031C488 3085FFFF */ andi $a1, $a0, 0xffff -/* 0D748C 8031C48C 24780001 */ addiu $t8, $v1, 1 -/* 0D7490 8031C490 AC580000 */ sw $t8, ($v0) -/* 0D7494 8031C494 00A02025 */ move $a0, $a1 -.L8031C498: -/* 0D7498 8031C498 308AFFFF */ andi $t2, $a0, 0xffff -/* 0D749C 8031C49C 1000FF3D */ b .L8031C194 -/* 0D74A0 8031C4A0 A6050038 */ sh $a1, 0x38($s0) -glabel L_U_8031C4A4 -/* 0D74A4 8031C4A4 26020054 */ addiu $v0, $s0, 0x54 -/* 0D74A8 8031C4A8 8C430000 */ lw $v1, ($v0) -/* 0D74AC 8031C4AC 246F0001 */ addiu $t7, $v1, 1 -/* 0D74B0 8031C4B0 AC4F0000 */ sw $t7, ($v0) -/* 0D74B4 8031C4B4 90650000 */ lbu $a1, ($v1) -/* 0D74B8 8031C4B8 28A1007F */ slti $at, $a1, 0x7f -/* 0D74BC 8031C4BC 5020FF36 */ beql $at, $zero, .L8031C198 -/* 0D74C0 8031C4C0 8E020054 */ lw $v0, 0x54($s0) -/* 0D74C4 8031C4C4 91B90005 */ lbu $t9, 5($t5) -/* 0D74C8 8031C4C8 8FEE0000 */ lw $t6, ($ra) -/* 0D74CC 8031C4CC 30A200FF */ andi $v0, $a1, 0xff -/* 0D74D0 8031C4D0 0019C080 */ sll $t8, $t9, 2 -/* 0D74D4 8031C4D4 0319C023 */ subu $t8, $t8, $t9 -/* 0D74D8 8031C4D8 0018C080 */ sll $t8, $t8, 2 -/* 0D74DC 8031C4DC 01D83821 */ addu $a3, $t6, $t8 -/* 0D74E0 8031C4E0 90E30001 */ lbu $v1, 1($a3) -/* 0D74E4 8031C4E4 00A3082A */ slt $at, $a1, $v1 -/* 0D74E8 8031C4E8 54200008 */ bnezl $at, .L8031C50C -/* 0D74EC 8031C4EC 8CE30004 */ lw $v1, 4($a3) -/* 0D74F0 8031C4F0 306200FF */ andi $v0, $v1, 0xff -/* 0D74F4 8031C4F4 5040FF28 */ beql $v0, $zero, .L8031C198 -/* 0D74F8 8031C4F8 8E020054 */ lw $v0, 0x54($s0) -/* 0D74FC 8031C4FC 2442FFFF */ addiu $v0, $v0, -1 -/* 0D7500 8031C500 304F00FF */ andi $t7, $v0, 0xff -/* 0D7504 8031C504 01E01025 */ move $v0, $t7 -/* 0D7508 8031C508 8CE30004 */ lw $v1, 4($a3) -.L8031C50C: -/* 0D750C 8031C50C 0002C880 */ sll $t9, $v0, 2 -/* 0D7510 8031C510 26050048 */ addiu $a1, $s0, 0x48 -/* 0D7514 8031C514 00797021 */ addu $t6, $v1, $t9 -/* 0D7518 8031C518 8DC40000 */ lw $a0, ($t6) -/* 0D751C 8031C51C 5480000C */ bnezl $a0, .L8031C550 -/* 0D7520 8031C520 8D630004 */ lw $v1, 4($t3) -/* 0D7524 8031C524 11220009 */ beq $t1, $v0, .L8031C54C -.L8031C528: -/* 0D7528 8031C528 0002C080 */ sll $t8, $v0, 2 -/* 0D752C 8031C52C 00787821 */ addu $t7, $v1, $t8 -/* 0D7530 8031C530 8DE40000 */ lw $a0, ($t7) -/* 0D7534 8031C534 54800006 */ bnezl $a0, .L8031C550 -/* 0D7538 8031C538 8D630004 */ lw $v1, 4($t3) -/* 0D753C 8031C53C 2442FFFF */ addiu $v0, $v0, -1 -/* 0D7540 8031C540 305900FF */ andi $t9, $v0, 0xff -/* 0D7544 8031C544 1539FFF8 */ bne $t1, $t9, .L8031C528 -/* 0D7548 8031C548 03201025 */ move $v0, $t9 -.L8031C54C: -/* 0D754C 8031C54C 8D630004 */ lw $v1, 4($t3) -.L8031C550: -/* 0D7550 8031C550 0083082B */ sltu $at, $a0, $v1 -/* 0D7554 8031C554 54200007 */ bnezl $at, .L8031C574 -/* 0D7558 8031C558 8D630198 */ lw $v1, 0x198($t3) -/* 0D755C 8031C55C 8D6E000C */ lw $t6, 0xc($t3) -/* 0D7560 8031C560 006EC021 */ addu $t8, $v1, $t6 -/* 0D7564 8031C564 0304082B */ sltu $at, $t8, $a0 -/* 0D7568 8031C568 5020000B */ beql $at, $zero, .L8031C598 -/* 0D756C 8031C56C 8C8E0004 */ lw $t6, 4($a0) -/* 0D7570 8031C570 8D630198 */ lw $v1, 0x198($t3) -.L8031C574: -/* 0D7574 8031C574 0083082B */ sltu $at, $a0, $v1 -/* 0D7578 8031C578 5420000E */ bnezl $at, .L8031C5B4 -/* 0D757C 8031C57C 3C010002 */ lui $at, 2 -/* 0D7580 8031C580 8D6F01A0 */ lw $t7, 0x1a0($t3) -/* 0D7584 8031C584 006FC821 */ addu $t9, $v1, $t7 -/* 0D7588 8031C588 0324082B */ sltu $at, $t9, $a0 -/* 0D758C 8031C58C 54200009 */ bnezl $at, .L8031C5B4 -/* 0D7590 8031C590 3C010002 */ lui $at, 2 -/* 0D7594 8031C594 8C8E0004 */ lw $t6, 4($a0) -.L8031C598: -/* 0D7598 8031C598 26020014 */ addiu $v0, $s0, 0x14 -/* 0D759C 8031C59C AC4E0004 */ sw $t6, 4($v0) -/* 0D75A0 8031C5A0 90980003 */ lbu $t8, 3($a0) -/* 0D75A4 8031C5A4 A0580000 */ sb $t8, ($v0) -/* 0D75A8 8031C5A8 1000FEFA */ b .L8031C194 -/* 0D75AC 8031C5AC ACA40000 */ sw $a0, ($a1) -/* 0D75B0 8031C5B0 3C010002 */ lui $at, 2 -.L8031C5B4: -/* 0D75B4 8031C5B4 00417821 */ addu $t7, $v0, $at -/* 0D75B8 8031C5B8 3C018033 */ lui $at, %hi(gAudioErrorFlags) # $at, 0x8033 -/* 0D75BC 8031C5BC AC2F2E50 */ sw $t7, %lo(gAudioErrorFlags)($at) -/* 0D75C0 8031C5C0 1000FEF4 */ b .L8031C194 -/* 0D75C4 8031C5C4 ACA00000 */ sw $zero, ($a1) -glabel L_U_8031C5C8 -/* 0D75C8 8031C5C8 26020054 */ addiu $v0, $s0, 0x54 -/* 0D75CC 8031C5CC 8C430000 */ lw $v1, ($v0) -/* 0D75D0 8031C5D0 24790001 */ addiu $t9, $v1, 1 -/* 0D75D4 8031C5D4 AC590000 */ sw $t9, ($v0) -/* 0D75D8 8031C5D8 90650000 */ lbu $a1, ($v1) -/* 0D75DC 8031C5DC A2050004 */ sb $a1, 4($s0) -/* 0D75E0 8031C5E0 8C430000 */ lw $v1, ($v0) -/* 0D75E4 8031C5E4 246E0001 */ addiu $t6, $v1, 1 -/* 0D75E8 8031C5E8 AC4E0000 */ sw $t6, ($v0) -/* 0D75EC 8031C5EC 85B8001A */ lh $t8, 0x1a($t5) -/* 0D75F0 8031C5F0 90670000 */ lbu $a3, ($v1) -/* 0D75F4 8031C5F4 8619001E */ lh $t9, 0x1e($s0) -/* 0D75F8 8031C5F8 03077821 */ addu $t7, $t8, $a3 -/* 0D75FC 8031C5FC 85980010 */ lh $t8, 0x10($t4) -/* 0D7600 8031C600 01F97021 */ addu $t6, $t7, $t9 -/* 0D7604 8031C604 01D84021 */ addu $t0, $t6, $t8 -/* 0D7608 8031C608 310F00FF */ andi $t7, $t0, 0xff -/* 0D760C 8031C60C 29E10080 */ slti $at, $t7, 0x80 -/* 0D7610 8031C610 14200002 */ bnez $at, .L8031C61C -/* 0D7614 8031C614 01E04025 */ move $t0, $t7 -/* 0D7618 8031C618 00004025 */ move $t0, $zero -.L8031C61C: -/* 0D761C 8031C61C 92190004 */ lbu $t9, 4($s0) -/* 0D7620 8031C620 A2080003 */ sb $t0, 3($s0) -/* 0D7624 8031C624 332E0080 */ andi $t6, $t9, 0x80 -/* 0D7628 8031C628 51C00009 */ beql $t6, $zero, .L8031C650 -/* 0D762C 8031C62C 8C430000 */ lw $v1, ($v0) -/* 0D7630 8031C630 8C580000 */ lw $t8, ($v0) -/* 0D7634 8031C634 930F0000 */ lbu $t7, ($t8) -/* 0D7638 8031C638 A60F001C */ sh $t7, 0x1c($s0) -/* 0D763C 8031C63C 8C590000 */ lw $t9, ($v0) -/* 0D7640 8031C640 272E0001 */ addiu $t6, $t9, 1 -/* 0D7644 8031C644 1000FED3 */ b .L8031C194 -/* 0D7648 8031C648 AC4E0000 */ sw $t6, ($v0) -/* 0D764C 8031C64C 8C430000 */ lw $v1, ($v0) -.L8031C650: -/* 0D7650 8031C650 90640000 */ lbu $a0, ($v1) -/* 0D7654 8031C654 24780001 */ addiu $t8, $v1, 1 -/* 0D7658 8031C658 AC580000 */ sw $t8, ($v0) -/* 0D765C 8031C65C 308F0080 */ andi $t7, $a0, 0x80 -/* 0D7660 8031C660 11E0000A */ beqz $t7, .L8031C68C -/* 0D7664 8031C664 00802825 */ move $a1, $a0 -/* 0D7668 8031C668 03001825 */ move $v1, $t8 -/* 0D766C 8031C66C 93180000 */ lbu $t8, ($t8) -/* 0D7670 8031C670 00052200 */ sll $a0, $a1, 8 -/* 0D7674 8031C674 308E7F00 */ andi $t6, $a0, 0x7f00 -/* 0D7678 8031C678 030E2025 */ or $a0, $t8, $t6 -/* 0D767C 8031C67C 308FFFFF */ andi $t7, $a0, 0xffff -/* 0D7680 8031C680 24790001 */ addiu $t9, $v1, 1 -/* 0D7684 8031C684 AC590000 */ sw $t9, ($v0) -/* 0D7688 8031C688 01E02025 */ move $a0, $t7 -.L8031C68C: -/* 0D768C 8031C68C 308AFFFF */ andi $t2, $a0, 0xffff -/* 0D7690 8031C690 1000FEC0 */ b .L8031C194 -/* 0D7694 8031C694 A604001C */ sh $a0, 0x1c($s0) -glabel L_U_8031C698 -/* 0D7698 8031C698 1000FEBE */ b .L8031C194 -/* 0D769C 8031C69C A2000004 */ sb $zero, 4($s0) -glabel L_U_8031C6A0 -.L8031C6A0: -/* 0D76A0 8031C6A0 30A200F0 */ andi $v0, $a1, 0xf0 -/* 0D76A4 8031C6A4 240100D0 */ li $at, 208 -/* 0D76A8 8031C6A8 10410005 */ beq $v0, $at, .L8031C6C0 -/* 0D76AC 8031C6AC 240100E0 */ li $at, 224 -/* 0D76B0 8031C6B0 5041000F */ beql $v0, $at, .L8031C6F0 -/* 0D76B4 8031C6B4 8D8E008C */ lw $t6, 0x8c($t4) -/* 0D76B8 8031C6B8 1000FEB7 */ b .L8031C198 -/* 0D76BC 8031C6BC 8E020054 */ lw $v0, 0x54($s0) -.L8031C6C0: -/* 0D76C0 8031C6C0 8D8E0088 */ lw $t6, 0x88($t4) -/* 0D76C4 8031C6C4 30B8000F */ andi $t8, $a1, 0xf -/* 0D76C8 8031C6C8 01D87821 */ addu $t7, $t6, $t8 -/* 0D76CC 8031C6CC 91EA0000 */ lbu $t2, ($t7) -/* 0D76D0 8031C6D0 014A0019 */ multu $t2, $t2 -/* 0D76D4 8031C6D4 0000C812 */ mflo $t9 -/* 0D76D8 8031C6D8 44999000 */ mtc1 $t9, $f18 -/* 0D76DC 8031C6DC 00000000 */ nop -/* 0D76E0 8031C6E0 46809120 */ cvt.s.w $f4, $f18 -/* 0D76E4 8031C6E4 1000FEAB */ b .L8031C194 -/* 0D76E8 8031C6E8 E6040024 */ swc1 $f4, 0x24($s0) -/* 0D76EC 8031C6EC 8D8E008C */ lw $t6, 0x8c($t4) -.L8031C6F0: -/* 0D76F0 8031C6F0 30B8000F */ andi $t8, $a1, 0xf -/* 0D76F4 8031C6F4 01D87821 */ addu $t7, $t6, $t8 -/* 0D76F8 8031C6F8 91F90000 */ lbu $t9, ($t7) -/* 0D76FC 8031C6FC 1000FEA5 */ b .L8031C194 -/* 0D7700 8031C700 A2190002 */ sb $t9, 2($s0) -.L8031C704: -/* 0D7704 8031C704 240100C0 */ li $at, 192 -/* 0D7708 8031C708 14A10015 */ bne $a1, $at, .L8031C760 -/* 0D770C 8031C70C 26020054 */ addiu $v0, $s0, 0x54 -/* 0D7710 8031C710 8C430000 */ lw $v1, ($v0) -/* 0D7714 8031C714 90640000 */ lbu $a0, ($v1) -/* 0D7718 8031C718 246E0001 */ addiu $t6, $v1, 1 -/* 0D771C 8031C71C AC4E0000 */ sw $t6, ($v0) -/* 0D7720 8031C720 30980080 */ andi $t8, $a0, 0x80 -/* 0D7724 8031C724 13000009 */ beqz $t8, .L8031C74C -/* 0D7728 8031C728 00802825 */ move $a1, $a0 -/* 0D772C 8031C72C 01C01825 */ move $v1, $t6 -/* 0D7730 8031C730 91CE0000 */ lbu $t6, ($t6) -/* 0D7734 8031C734 00042200 */ sll $a0, $a0, 8 -/* 0D7738 8031C738 30997F00 */ andi $t9, $a0, 0x7f00 -/* 0D773C 8031C73C 246F0001 */ addiu $t7, $v1, 1 -/* 0D7740 8031C740 01D92025 */ or $a0, $t6, $t9 -/* 0D7744 8031C744 3085FFFF */ andi $a1, $a0, 0xffff -/* 0D7748 8031C748 AC4F0000 */ sw $t7, ($v0) -.L8031C74C: -/* 0D774C 8031C74C 920E0000 */ lbu $t6, ($s0) -/* 0D7750 8031C750 A605003C */ sh $a1, 0x3c($s0) -/* 0D7754 8031C754 35D80020 */ ori $t8, $t6, 0x20 -/* 0D7758 8031C758 10000181 */ b .L8031CD60 -/* 0D775C 8031C75C A2180000 */ sb $t8, ($s0) -.L8031C760: -/* 0D7760 8031C760 920F0000 */ lbu $t7, ($s0) -/* 0D7764 8031C764 24010001 */ li $at, 1 -/* 0D7768 8031C768 30A900C0 */ andi $t1, $a1, 0xc0 -/* 0D776C 8031C76C 31F9FFDF */ andi $t9, $t7, 0xffdf -/* 0D7770 8031C770 A2190000 */ sb $t9, ($s0) -/* 0D7774 8031C774 8DAE0000 */ lw $t6, ($t5) -/* 0D7778 8031C778 000EC180 */ sll $t8, $t6, 6 -/* 0D777C 8031C77C 00187FC2 */ srl $t7, $t8, 0x1f -/* 0D7780 8031C780 15E10057 */ bne $t7, $at, .L8031C8E0 -/* 0D7784 8031C784 00000000 */ nop -/* 0D7788 8031C788 30A900C0 */ andi $t1, $a1, 0xc0 -/* 0D778C 8031C78C 11200009 */ beqz $t1, .L8031C7B4 -/* 0D7790 8031C790 26020054 */ addiu $v0, $s0, 0x54 -/* 0D7794 8031C794 24010040 */ li $at, 64 -/* 0D7798 8031C798 11210023 */ beq $t1, $at, .L8031C828 -/* 0D779C 8031C79C 26020054 */ addiu $v0, $s0, 0x54 -/* 0D77A0 8031C7A0 24010080 */ li $at, 128 -/* 0D77A4 8031C7A4 11210039 */ beq $t1, $at, .L8031C88C -/* 0D77A8 8031C7A8 26020054 */ addiu $v0, $s0, 0x54 -/* 0D77AC 8031C7AC 10000043 */ b .L8031C8BC -/* 0D77B0 8031C7B0 01402025 */ move $a0, $t2 -.L8031C7B4: -/* 0D77B4 8031C7B4 8C430000 */ lw $v1, ($v0) -/* 0D77B8 8031C7B8 90660000 */ lbu $a2, ($v1) -/* 0D77BC 8031C7BC 24790001 */ addiu $t9, $v1, 1 -/* 0D77C0 8031C7C0 AC590000 */ sw $t9, ($v0) -/* 0D77C4 8031C7C4 30CE0080 */ andi $t6, $a2, 0x80 -/* 0D77C8 8031C7C8 11C0000A */ beqz $t6, .L8031C7F4 -/* 0D77CC 8031C7CC 00C03825 */ move $a3, $a2 -/* 0D77D0 8031C7D0 03201825 */ move $v1, $t9 -/* 0D77D4 8031C7D4 93390000 */ lbu $t9, ($t9) -/* 0D77D8 8031C7D8 00073200 */ sll $a2, $a3, 8 -/* 0D77DC 8031C7DC 30CF7F00 */ andi $t7, $a2, 0x7f00 -/* 0D77E0 8031C7E0 032F3025 */ or $a2, $t9, $t7 -/* 0D77E4 8031C7E4 30C7FFFF */ andi $a3, $a2, 0xffff -/* 0D77E8 8031C7E8 24780001 */ addiu $t8, $v1, 1 -/* 0D77EC 8031C7EC AC580000 */ sw $t8, ($v0) -/* 0D77F0 8031C7F0 00E03025 */ move $a2, $a3 -.L8031C7F4: -/* 0D77F4 8031C7F4 8C430000 */ lw $v1, ($v0) -/* 0D77F8 8031C7F8 30CAFFFF */ andi $t2, $a2, 0xffff -/* 0D77FC 8031C7FC 01402025 */ move $a0, $t2 -/* 0D7800 8031C800 906B0000 */ lbu $t3, ($v1) -/* 0D7804 8031C804 246F0001 */ addiu $t7, $v1, 1 -/* 0D7808 8031C808 AC4F0000 */ sw $t7, ($v0) -/* 0D780C 8031C80C 91EE0000 */ lbu $t6, ($t7) -/* 0D7810 8031C810 A20E0002 */ sb $t6, 2($s0) -/* 0D7814 8031C814 8C580000 */ lw $t8, ($v0) -/* 0D7818 8031C818 270F0001 */ addiu $t7, $t8, 1 -/* 0D781C 8031C81C AC4F0000 */ sw $t7, ($v0) -/* 0D7820 8031C820 10000027 */ b .L8031C8C0 -/* 0D7824 8031C824 A607003A */ sh $a3, 0x3a($s0) -.L8031C828: -/* 0D7828 8031C828 8C430000 */ lw $v1, ($v0) -/* 0D782C 8031C82C 90660000 */ lbu $a2, ($v1) -/* 0D7830 8031C830 24790001 */ addiu $t9, $v1, 1 -/* 0D7834 8031C834 AC590000 */ sw $t9, ($v0) -/* 0D7838 8031C838 30CE0080 */ andi $t6, $a2, 0x80 -/* 0D783C 8031C83C 11C0000A */ beqz $t6, .L8031C868 -/* 0D7840 8031C840 00C03825 */ move $a3, $a2 -/* 0D7844 8031C844 03201825 */ move $v1, $t9 -/* 0D7848 8031C848 93390000 */ lbu $t9, ($t9) -/* 0D784C 8031C84C 00073200 */ sll $a2, $a3, 8 -/* 0D7850 8031C850 30CF7F00 */ andi $t7, $a2, 0x7f00 -/* 0D7854 8031C854 032F3025 */ or $a2, $t9, $t7 -/* 0D7858 8031C858 30C7FFFF */ andi $a3, $a2, 0xffff -/* 0D785C 8031C85C 24780001 */ addiu $t8, $v1, 1 -/* 0D7860 8031C860 AC580000 */ sw $t8, ($v0) -/* 0D7864 8031C864 00E03025 */ move $a2, $a3 -.L8031C868: -/* 0D7868 8031C868 8C430000 */ lw $v1, ($v0) -/* 0D786C 8031C86C 30CAFFFF */ andi $t2, $a2, 0xffff -/* 0D7870 8031C870 01402025 */ move $a0, $t2 -/* 0D7874 8031C874 906B0000 */ lbu $t3, ($v1) -/* 0D7878 8031C878 246F0001 */ addiu $t7, $v1, 1 -/* 0D787C 8031C87C AC4F0000 */ sw $t7, ($v0) -/* 0D7880 8031C880 A2000002 */ sb $zero, 2($s0) -/* 0D7884 8031C884 1000000E */ b .L8031C8C0 -/* 0D7888 8031C888 A607003A */ sh $a3, 0x3a($s0) -.L8031C88C: -/* 0D788C 8031C88C 8C430000 */ lw $v1, ($v0) -/* 0D7890 8031C890 960A003A */ lhu $t2, 0x3a($s0) -/* 0D7894 8031C894 906B0000 */ lbu $t3, ($v1) -/* 0D7898 8031C898 24790001 */ addiu $t9, $v1, 1 -/* 0D789C 8031C89C AC590000 */ sw $t9, ($v0) -/* 0D78A0 8031C8A0 93380000 */ lbu $t8, ($t9) -/* 0D78A4 8031C8A4 01402025 */ move $a0, $t2 -/* 0D78A8 8031C8A8 A2180002 */ sb $t8, 2($s0) -/* 0D78AC 8031C8AC 8C4F0000 */ lw $t7, ($v0) -/* 0D78B0 8031C8B0 25F90001 */ addiu $t9, $t7, 1 -/* 0D78B4 8031C8B4 10000002 */ b .L8031C8C0 -/* 0D78B8 8031C8B8 AC590000 */ sw $t9, ($v0) -.L8031C8BC: -/* 0D78BC 8031C8BC 8FAB0030 */ lw $t3, 0x30($sp) -.L8031C8C0: -/* 0D78C0 8031C8C0 016B0019 */ multu $t3, $t3 -/* 0D78C4 8031C8C4 00A91823 */ subu $v1, $a1, $t1 -/* 0D78C8 8031C8C8 00007012 */ mflo $t6 -/* 0D78CC 8031C8CC 448E3000 */ mtc1 $t6, $f6 -/* 0D78D0 8031C8D0 00000000 */ nop -/* 0D78D4 8031C8D4 46803220 */ cvt.s.w $f8, $f6 -/* 0D78D8 8031C8D8 10000024 */ b .L8031C96C -/* 0D78DC 8031C8DC E6080024 */ swc1 $f8, 0x24($s0) -.L8031C8E0: -/* 0D78E0 8031C8E0 11200008 */ beqz $t1, .L8031C904 -/* 0D78E4 8031C8E4 26020054 */ addiu $v0, $s0, 0x54 -/* 0D78E8 8031C8E8 24010040 */ li $at, 64 -/* 0D78EC 8031C8EC 11210019 */ beq $t1, $at, .L8031C954 -/* 0D78F0 8031C8F0 24010080 */ li $at, 128 -/* 0D78F4 8031C8F4 5121001B */ beql $t1, $at, .L8031C964 -/* 0D78F8 8031C8F8 960A003A */ lhu $t2, 0x3a($s0) -/* 0D78FC 8031C8FC 1000001A */ b .L8031C968 -/* 0D7900 8031C900 01402025 */ move $a0, $t2 -.L8031C904: -/* 0D7904 8031C904 8C430000 */ lw $v1, ($v0) -/* 0D7908 8031C908 90660000 */ lbu $a2, ($v1) -/* 0D790C 8031C90C 24780001 */ addiu $t8, $v1, 1 -/* 0D7910 8031C910 AC580000 */ sw $t8, ($v0) -/* 0D7914 8031C914 30CF0080 */ andi $t7, $a2, 0x80 -/* 0D7918 8031C918 11E0000A */ beqz $t7, .L8031C944 -/* 0D791C 8031C91C 00C03825 */ move $a3, $a2 -/* 0D7920 8031C920 03001825 */ move $v1, $t8 -/* 0D7924 8031C924 93180000 */ lbu $t8, ($t8) -/* 0D7928 8031C928 00073200 */ sll $a2, $a3, 8 -/* 0D792C 8031C92C 30CE7F00 */ andi $t6, $a2, 0x7f00 -/* 0D7930 8031C930 030E3025 */ or $a2, $t8, $t6 -/* 0D7934 8031C934 30C7FFFF */ andi $a3, $a2, 0xffff -/* 0D7938 8031C938 24790001 */ addiu $t9, $v1, 1 -/* 0D793C 8031C93C AC590000 */ sw $t9, ($v0) -/* 0D7940 8031C940 00E03025 */ move $a2, $a3 -.L8031C944: -/* 0D7944 8031C944 30CAFFFF */ andi $t2, $a2, 0xffff -/* 0D7948 8031C948 A607003A */ sh $a3, 0x3a($s0) -/* 0D794C 8031C94C 10000006 */ b .L8031C968 -/* 0D7950 8031C950 01402025 */ move $a0, $t2 -.L8031C954: -/* 0D7954 8031C954 960A0038 */ lhu $t2, 0x38($s0) -/* 0D7958 8031C958 10000003 */ b .L8031C968 -/* 0D795C 8031C95C 01402025 */ move $a0, $t2 -/* 0D7960 8031C960 960A003A */ lhu $t2, 0x3a($s0) -.L8031C964: -/* 0D7964 8031C964 01402025 */ move $a0, $t2 -.L8031C968: -/* 0D7968 8031C968 00A91823 */ subu $v1, $a1, $t1 -.L8031C96C: -/* 0D796C 8031C96C 920E0002 */ lbu $t6, 2($s0) -/* 0D7970 8031C970 A604003C */ sh $a0, 0x3c($s0) -/* 0D7974 8031C974 01C40019 */ multu $t6, $a0 -/* 0D7978 8031C978 0000C012 */ mflo $t8 -/* 0D797C 8031C97C 07010003 */ bgez $t8, .L8031C98C -/* 0D7980 8031C980 00187A03 */ sra $t7, $t8, 8 -/* 0D7984 8031C984 270100FF */ addiu $at, $t8, 0xff -/* 0D7988 8031C988 00017A03 */ sra $t7, $at, 8 -.L8031C98C: -/* 0D798C 8031C98C A60F003E */ sh $t7, 0x3e($s0) -/* 0D7990 8031C990 8D990000 */ lw $t9, ($t4) -/* 0D7994 8031C994 0019C080 */ sll $t8, $t9, 2 -/* 0D7998 8031C998 07030006 */ bgezl $t8, .L8031C9B4 -/* 0D799C 8031C99C 8DA20000 */ lw $v0, ($t5) -/* 0D79A0 8031C9A0 91AF0002 */ lbu $t7, 2($t5) -/* 0D79A4 8031C9A4 31F90040 */ andi $t9, $t7, 0x40 -/* 0D79A8 8031C9A8 57200008 */ bnezl $t9, .L8031C9CC -/* 0D79AC 8031C9AC 92180000 */ lbu $t8, ($s0) -/* 0D79B0 8031C9B0 8DA20000 */ lw $v0, ($t5) -.L8031C9B4: -/* 0D79B4 8031C9B4 0002C0C0 */ sll $t8, $v0, 3 -/* 0D79B8 8031C9B8 07000003 */ bltz $t8, .L8031C9C8 -/* 0D79BC 8031C9BC 0002C900 */ sll $t9, $v0, 4 -/* 0D79C0 8031C9C0 07220006 */ bltzl $t9, .L8031C9DC -/* 0D79C4 8031C9C4 85B90018 */ lh $t9, 0x18($t5) -.L8031C9C8: -/* 0D79C8 8031C9C8 92180000 */ lbu $t8, ($s0) -.L8031C9CC: -/* 0D79CC 8031C9CC 370F0020 */ ori $t7, $t8, 0x20 -/* 0D79D0 8031C9D0 100000E3 */ b .L8031CD60 -/* 0D79D4 8031C9D4 A20F0000 */ sb $t7, ($s0) -/* 0D79D8 8031C9D8 85B90018 */ lh $t9, 0x18($t5) -.L8031C9DC: -/* 0D79DC 8031C9DC 57200035 */ bnezl $t9, .L8031CAB4 -/* 0D79E0 8031C9E0 85980010 */ lh $t8, 0x10($t4) -/* 0D79E4 8031C9E4 85B8001A */ lh $t8, 0x1a($t5) -/* 0D79E8 8031C9E8 8619001E */ lh $t9, 0x1e($s0) -/* 0D79EC 8031C9EC 00787821 */ addu $t7, $v1, $t8 -/* 0D79F0 8031C9F0 01F94021 */ addu $t0, $t7, $t9 -/* 0D79F4 8031C9F4 91AF0005 */ lbu $t7, 5($t5) -/* 0D79F8 8031C9F8 8FF80000 */ lw $t8, ($ra) -/* 0D79FC 8031C9FC 310E00FF */ andi $t6, $t0, 0xff -/* 0D7A00 8031CA00 000FC880 */ sll $t9, $t7, 2 -/* 0D7A04 8031CA04 032FC823 */ subu $t9, $t9, $t7 -/* 0D7A08 8031CA08 0019C880 */ sll $t9, $t9, 2 -/* 0D7A0C 8031CA0C 03193821 */ addu $a3, $t8, $t9 -/* 0D7A10 8031CA10 90E20002 */ lbu $v0, 2($a3) -/* 0D7A14 8031CA14 01C04025 */ move $t0, $t6 -/* 0D7A18 8031CA18 01C2082A */ slt $at, $t6, $v0 -/* 0D7A1C 8031CA1C 5420000C */ bnezl $at, .L8031CA50 -/* 0D7A20 8031CA20 8CEE0008 */ lw $t6, 8($a3) -/* 0D7A24 8031CA24 304800FF */ andi $t0, $v0, 0xff -/* 0D7A28 8031CA28 55000006 */ bnezl $t0, .L8031CA44 -/* 0D7A2C 8031CA2C 2508FFFF */ addiu $t0, $t0, -1 -/* 0D7A30 8031CA30 920F0000 */ lbu $t7, ($s0) -/* 0D7A34 8031CA34 35F80020 */ ori $t8, $t7, 0x20 -/* 0D7A38 8031CA38 100000C7 */ b .L8031CD58 -/* 0D7A3C 8031CA3C A2180000 */ sb $t8, ($s0) -/* 0D7A40 8031CA40 2508FFFF */ addiu $t0, $t0, -1 -.L8031CA44: -/* 0D7A44 8031CA44 311900FF */ andi $t9, $t0, 0xff -/* 0D7A48 8031CA48 03204025 */ move $t0, $t9 -/* 0D7A4C 8031CA4C 8CEE0008 */ lw $t6, 8($a3) -.L8031CA50: -/* 0D7A50 8031CA50 00087880 */ sll $t7, $t0, 2 -/* 0D7A54 8031CA54 01CFC021 */ addu $t8, $t6, $t7 -/* 0D7A58 8031CA58 8F020000 */ lw $v0, ($t8) -/* 0D7A5C 8031CA5C 54400006 */ bnezl $v0, .L8031CA78 -/* 0D7A60 8031CA60 8C58000C */ lw $t8, 0xc($v0) -/* 0D7A64 8031CA64 920E0000 */ lbu $t6, ($s0) -/* 0D7A68 8031CA68 35CF0020 */ ori $t7, $t6, 0x20 -/* 0D7A6C 8031CA6C 100000BA */ b .L8031CD58 -/* 0D7A70 8031CA70 A20F0000 */ sb $t7, ($s0) -/* 0D7A74 8031CA74 8C58000C */ lw $t8, 0xc($v0) -.L8031CA78: -/* 0D7A78 8031CA78 24430004 */ addiu $v1, $v0, 4 -/* 0D7A7C 8031CA7C AE180018 */ sw $t8, 0x18($s0) -/* 0D7A80 8031CA80 90590000 */ lbu $t9, ($v0) -/* 0D7A84 8031CA84 A2190014 */ sb $t9, 0x14($s0) -/* 0D7A88 8031CA88 904E0001 */ lbu $t6, 1($v0) -/* 0D7A8C 8031CA8C AE03004C */ sw $v1, 0x4c($s0) -/* 0D7A90 8031CA90 448E5000 */ mtc1 $t6, $f10 -/* 0D7A94 8031CA94 00000000 */ nop -/* 0D7A98 8031CA98 46805420 */ cvt.s.w $f16, $f10 -/* 0D7A9C 8031CA9C 46008482 */ mul.s $f18, $f16, $f0 -/* 0D7AA0 8031CAA0 E6120028 */ swc1 $f18, 0x28($s0) -/* 0D7AA4 8031CAA4 C4640004 */ lwc1 $f4, 4($v1) -/* 0D7AA8 8031CAA8 100000AB */ b .L8031CD58 -/* 0D7AAC 8031CAAC E6040020 */ swc1 $f4, 0x20($s0) -/* 0D7AB0 8031CAB0 85980010 */ lh $t8, 0x10($t4) -.L8031CAB4: -/* 0D7AB4 8031CAB4 85AE001A */ lh $t6, 0x1a($t5) -/* 0D7AB8 8031CAB8 0078C821 */ addu $t9, $v1, $t8 -/* 0D7ABC 8031CABC 8618001E */ lh $t8, 0x1e($s0) -/* 0D7AC0 8031CAC0 032E7821 */ addu $t7, $t9, $t6 -/* 0D7AC4 8031CAC4 01F84021 */ addu $t0, $t7, $t8 -/* 0D7AC8 8031CAC8 310200FF */ andi $v0, $t0, 0xff -/* 0D7ACC 8031CACC 28410080 */ slti $at, $v0, 0x80 -/* 0D7AD0 8031CAD0 14200005 */ bnez $at, .L8031CAE8 -/* 0D7AD4 8031CAD4 00404025 */ move $t0, $v0 -/* 0D7AD8 8031CAD8 920F0000 */ lbu $t7, ($s0) -/* 0D7ADC 8031CADC 35F80020 */ ori $t8, $t7, 0x20 -/* 0D7AE0 8031CAE0 1000009D */ b .L8031CD58 -/* 0D7AE4 8031CAE4 A2180000 */ sb $t8, ($s0) -.L8031CAE8: -/* 0D7AE8 8031CAE8 8E030048 */ lw $v1, 0x48($s0) -/* 0D7AEC 8031CAEC 54600003 */ bnezl $v1, .L8031CAFC -/* 0D7AF0 8031CAF0 92190004 */ lbu $t9, 4($s0) -/* 0D7AF4 8031CAF4 8DA3003C */ lw $v1, 0x3c($t5) -/* 0D7AF8 8031CAF8 92190004 */ lbu $t9, 4($s0) -.L8031CAFC: -/* 0D7AFC 8031CAFC 13200073 */ beqz $t9, .L8031CCCC -/* 0D7B00 8031CB00 00000000 */ nop -/* 0D7B04 8031CB04 92040003 */ lbu $a0, 3($s0) -/* 0D7B08 8031CB08 0082082A */ slt $at, $a0, $v0 -/* 0D7B0C 8031CB0C 10200003 */ beqz $at, .L8031CB1C -/* 0D7B10 8031CB10 00802825 */ move $a1, $a0 -/* 0D7B14 8031CB14 10000001 */ b .L8031CB1C -/* 0D7B18 8031CB18 00402825 */ move $a1, $v0 -.L8031CB1C: -/* 0D7B1C 8031CB1C 10600017 */ beqz $v1, .L8031CB7C -/* 0D7B20 8031CB20 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0D7B24 8031CB24 906E0001 */ lbu $t6, 1($v1) -/* 0D7B28 8031CB28 30A200FF */ andi $v0, $a1, 0xff -/* 0D7B2C 8031CB2C 004E082A */ slt $at, $v0, $t6 -/* 0D7B30 8031CB30 50200004 */ beql $at, $zero, .L8031CB44 -/* 0D7B34 8031CB34 906F0002 */ lbu $t7, 2($v1) -/* 0D7B38 8031CB38 10000009 */ b .L8031CB60 -/* 0D7B3C 8031CB3C 24620008 */ addiu $v0, $v1, 8 -/* 0D7B40 8031CB40 906F0002 */ lbu $t7, 2($v1) -.L8031CB44: -/* 0D7B44 8031CB44 24640018 */ addiu $a0, $v1, 0x18 -/* 0D7B48 8031CB48 01E2082A */ slt $at, $t7, $v0 -/* 0D7B4C 8031CB4C 14200003 */ bnez $at, .L8031CB5C -/* 0D7B50 8031CB50 00000000 */ nop -/* 0D7B54 8031CB54 10000001 */ b .L8031CB5C -/* 0D7B58 8031CB58 24640010 */ addiu $a0, $v1, 0x10 -.L8031CB5C: -/* 0D7B5C 8031CB5C 00801025 */ move $v0, $a0 -.L8031CB60: -/* 0D7B60 8031CB60 8E18004C */ lw $t8, 0x4c($s0) -/* 0D7B64 8031CB64 0058C826 */ xor $t9, $v0, $t8 -/* 0D7B68 8031CB68 2F390001 */ sltiu $t9, $t9, 1 -/* 0D7B6C 8031CB6C A3B9003F */ sb $t9, 0x3f($sp) -/* 0D7B70 8031CB70 AE02004C */ sw $v0, 0x4c($s0) -/* 0D7B74 8031CB74 10000003 */ b .L8031CB84 -/* 0D7B78 8031CB78 C4400004 */ lwc1 $f0, 4($v0) -.L8031CB7C: -/* 0D7B7C 8031CB7C 44810000 */ mtc1 $at, $f0 -/* 0D7B80 8031CB80 AE00004C */ sw $zero, 0x4c($s0) -.L8031CB84: -/* 0D7B84 8031CB84 3C038033 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8033 -/* 0D7B88 8031CB88 24633994 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0x3994 -/* 0D7B8C 8031CB8C 00087080 */ sll $t6, $t0, 2 -/* 0D7B90 8031CB90 92180003 */ lbu $t8, 3($s0) -/* 0D7B94 8031CB94 006E7821 */ addu $t7, $v1, $t6 -/* 0D7B98 8031CB98 C5E60000 */ lwc1 $f6, ($t7) -/* 0D7B9C 8031CB9C 920F0004 */ lbu $t7, 4($s0) -/* 0D7BA0 8031CBA0 0018C880 */ sll $t9, $t8, 2 -/* 0D7BA4 8031CBA4 00797021 */ addu $t6, $v1, $t9 -/* 0D7BA8 8031CBA8 C5C80000 */ lwc1 $f8, ($t6) -/* 0D7BAC 8031CBAC 46003082 */ mul.s $f2, $f6, $f0 -/* 0D7BB0 8031CBB0 2401FF7F */ li $at, -129 -/* 0D7BB4 8031CBB4 01E1C024 */ and $t8, $t7, $at -/* 0D7BB8 8031CBB8 2719FFFF */ addiu $t9, $t8, -1 -/* 0D7BBC 8031CBBC 2F210005 */ sltiu $at, $t9, 5 -/* 0D7BC0 8031CBC0 46004302 */ mul.s $f12, $f8, $f0 -/* 0D7BC4 8031CBC4 1020000C */ beqz $at, .L8031CBF8 -/* 0D7BC8 8031CBC8 0019C880 */ sll $t9, $t9, 2 -/* 0D7BCC 8031CBCC 3C018034 */ lui $at, %hi(jtbl_80337CDC) -/* 0D7BD0 8031CBD0 00390821 */ addu $at, $at, $t9 -/* 0D7BD4 8031CBD4 8C398EAC */ lw $t9, %lo(jtbl_80337CDC)($at) -/* 0D7BD8 8031CBD8 03200008 */ jr $t9 -/* 0D7BDC 8031CBDC 00000000 */ nop -glabel L_U_8031CBE0 -/* 0D7BE0 8031CBE0 E7A20024 */ swc1 $f2, 0x24($sp) -/* 0D7BE4 8031CBE4 10000005 */ b .L8031CBFC -/* 0D7BE8 8031CBE8 46006006 */ mov.s $f0, $f12 -glabel L_U_8031CBEC -/* 0D7BEC 8031CBEC 46001006 */ mov.s $f0, $f2 -/* 0D7BF0 8031CBF0 10000002 */ b .L8031CBFC -/* 0D7BF4 8031CBF4 E7AC0024 */ swc1 $f12, 0x24($sp) -.L8031CBF8: -/* 0D7BF8 8031CBF8 C7A00028 */ lwc1 $f0, 0x28($sp) -.L8031CBFC: -/* 0D7BFC 8031CBFC C7AA0024 */ lwc1 $f10, 0x24($sp) -/* 0D7C00 8031CC00 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0D7C04 8031CC04 44819000 */ mtc1 $at, $f18 -/* 0D7C08 8031CC08 46005403 */ div.s $f16, $f10, $f0 -/* 0D7C0C 8031CC0C 26020004 */ addiu $v0, $s0, 4 -/* 0D7C10 8031CC10 3C0146FE */ li $at, 0x46FE0000 # 32512.000000 -/* 0D7C14 8031CC14 46128101 */ sub.s $f4, $f16, $f18 -/* 0D7C18 8031CC18 E444000C */ swc1 $f4, 0xc($v0) -/* 0D7C1C 8031CC1C 920E0004 */ lbu $t6, 4($s0) -/* 0D7C20 8031CC20 31CF0080 */ andi $t7, $t6, 0x80 -/* 0D7C24 8031CC24 51E00017 */ beql $t7, $zero, .L8031CC84 -/* 0D7C28 8031CC28 9618001C */ lhu $t8, 0x1c($s0) -/* 0D7C2C 8031CC2C 9598000A */ lhu $t8, 0xa($t4) -/* 0D7C30 8031CC30 3C0E8022 */ lui $t6, %hi(gTempoInternalToExternal) # $t6, 0x8022 -/* 0D7C34 8031CC34 85CE6B7C */ lh $t6, %lo(gTempoInternalToExternal)($t6) -/* 0D7C38 8031CC38 44984000 */ mtc1 $t8, $f8 -/* 0D7C3C 8031CC3C 8619003C */ lh $t9, 0x3c($s0) -/* 0D7C40 8031CC40 44813000 */ mtc1 $at, $f6 -/* 0D7C44 8031CC44 468042A0 */ cvt.s.w $f10, $f8 -/* 0D7C48 8031CC48 448E4000 */ mtc1 $t6, $f8 -/* 0D7C4C 8031CC4C 44999000 */ mtc1 $t9, $f18 -/* 0D7C50 8031CC50 960F001C */ lhu $t7, 0x1c($s0) -/* 0D7C54 8031CC54 46809120 */ cvt.s.w $f4, $f18 -/* 0D7C58 8031CC58 460A3402 */ mul.s $f16, $f6, $f10 -/* 0D7C5C 8031CC5C 448F9000 */ mtc1 $t7, $f18 -/* 0D7C60 8031CC60 468041A0 */ cvt.s.w $f6, $f8 -/* 0D7C64 8031CC64 46809220 */ cvt.s.w $f8, $f18 -/* 0D7C68 8031CC68 46062282 */ mul.s $f10, $f4, $f6 -/* 0D7C6C 8031CC6C 00000000 */ nop -/* 0D7C70 8031CC70 460A4102 */ mul.s $f4, $f8, $f10 -/* 0D7C74 8031CC74 46048183 */ div.s $f6, $f16, $f4 -/* 0D7C78 8031CC78 10000009 */ b .L8031CCA0 -/* 0D7C7C 8031CC7C E4460008 */ swc1 $f6, 8($v0) -/* 0D7C80 8031CC80 9618001C */ lhu $t8, 0x1c($s0) -.L8031CC84: -/* 0D7C84 8031CC84 3C0142FE */ li $at, 0x42FE0000 # 127.000000 -/* 0D7C88 8031CC88 44819000 */ mtc1 $at, $f18 -/* 0D7C8C 8031CC8C 44984000 */ mtc1 $t8, $f8 -/* 0D7C90 8031CC90 00000000 */ nop -/* 0D7C94 8031CC94 468042A0 */ cvt.s.w $f10, $f8 -/* 0D7C98 8031CC98 460A9403 */ div.s $f16, $f18, $f10 -/* 0D7C9C 8031CC9C E4500008 */ swc1 $f16, 8($v0) -.L8031CCA0: -/* 0D7CA0 8031CCA0 44802000 */ mtc1 $zero, $f4 -/* 0D7CA4 8031CCA4 2401FF7F */ li $at, -129 -/* 0D7CA8 8031CCA8 E4440004 */ swc1 $f4, 4($v0) -/* 0D7CAC 8031CCAC 92190004 */ lbu $t9, 4($s0) -/* 0D7CB0 8031CCB0 E6000020 */ swc1 $f0, 0x20($s0) -/* 0D7CB4 8031CCB4 03217024 */ and $t6, $t9, $at -/* 0D7CB8 8031CCB8 24010005 */ li $at, 5 -/* 0D7CBC 8031CCBC 55C10027 */ bnel $t6, $at, .L8031CD5C -/* 0D7CC0 8031CCC0 860F003C */ lh $t7, 0x3c($s0) -/* 0D7CC4 8031CCC4 10000024 */ b .L8031CD58 -/* 0D7CC8 8031CCC8 A2080003 */ sb $t0, 3($s0) -.L8031CCCC: -/* 0D7CCC 8031CCCC 1060001C */ beqz $v1, .L8031CD40 -/* 0D7CD0 8031CCD0 0008C880 */ sll $t9, $t0, 2 -/* 0D7CD4 8031CCD4 906F0001 */ lbu $t7, 1($v1) -/* 0D7CD8 8031CCD8 004F082A */ slt $at, $v0, $t7 -/* 0D7CDC 8031CCDC 10200003 */ beqz $at, .L8031CCEC -/* 0D7CE0 8031CCE0 00087880 */ sll $t7, $t0, 2 -/* 0D7CE4 8031CCE4 10000009 */ b .L8031CD0C -/* 0D7CE8 8031CCE8 24620008 */ addiu $v0, $v1, 8 -.L8031CCEC: -/* 0D7CEC 8031CCEC 90780002 */ lbu $t8, 2($v1) -/* 0D7CF0 8031CCF0 24640018 */ addiu $a0, $v1, 0x18 -/* 0D7CF4 8031CCF4 0302082A */ slt $at, $t8, $v0 -/* 0D7CF8 8031CCF8 14200003 */ bnez $at, .L8031CD08 -/* 0D7CFC 8031CCFC 00000000 */ nop -/* 0D7D00 8031CD00 10000001 */ b .L8031CD08 -/* 0D7D04 8031CD04 24640010 */ addiu $a0, $v1, 0x10 -.L8031CD08: -/* 0D7D08 8031CD08 00801025 */ move $v0, $a0 -.L8031CD0C: -/* 0D7D0C 8031CD0C 8E19004C */ lw $t9, 0x4c($s0) -/* 0D7D10 8031CD10 3C038033 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8033 -/* 0D7D14 8031CD14 24633994 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0x3994 -/* 0D7D18 8031CD18 00597026 */ xor $t6, $v0, $t9 -/* 0D7D1C 8031CD1C 2DCE0001 */ sltiu $t6, $t6, 1 -/* 0D7D20 8031CD20 A3AE003F */ sb $t6, 0x3f($sp) -/* 0D7D24 8031CD24 AE02004C */ sw $v0, 0x4c($s0) -/* 0D7D28 8031CD28 006FC021 */ addu $t8, $v1, $t7 -/* 0D7D2C 8031CD2C C7080000 */ lwc1 $f8, ($t8) -/* 0D7D30 8031CD30 C4460004 */ lwc1 $f6, 4($v0) -/* 0D7D34 8031CD34 46083482 */ mul.s $f18, $f6, $f8 -/* 0D7D38 8031CD38 10000007 */ b .L8031CD58 -/* 0D7D3C 8031CD3C E6120020 */ swc1 $f18, 0x20($s0) -.L8031CD40: -/* 0D7D40 8031CD40 3C038033 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8033 -/* 0D7D44 8031CD44 24633994 */ addiu $v1, %lo(gNoteFrequencies) # addiu $v1, $v1, 0x3994 -/* 0D7D48 8031CD48 AE00004C */ sw $zero, 0x4c($s0) -/* 0D7D4C 8031CD4C 00797021 */ addu $t6, $v1, $t9 -/* 0D7D50 8031CD50 C5CA0000 */ lwc1 $f10, ($t6) -/* 0D7D54 8031CD54 E60A0020 */ swc1 $f10, 0x20($s0) -.L8031CD58: -/* 0D7D58 8031CD58 860F003C */ lh $t7, 0x3c($s0) -.L8031CD5C: -/* 0D7D5C 8031CD5C A60F0040 */ sh $t7, 0x40($s0) -.L8031CD60: -/* 0D7D60 8031CD60 8E020000 */ lw $v0, ($s0) -/* 0D7D64 8031CD64 24010001 */ li $at, 1 -/* 0D7D68 8031CD68 0002C080 */ sll $t8, $v0, 2 -/* 0D7D6C 8031CD6C 0018CFC2 */ srl $t9, $t8, 0x1f -/* 0D7D70 8031CD70 5721000C */ bnel $t9, $at, .L8031CDA4 -/* 0D7D74 8031CD74 000270C0 */ sll $t6, $v0, 3 -/* 0D7D78 8031CD78 8E0E0044 */ lw $t6, 0x44($s0) -/* 0D7D7C 8031CD7C 0002C0C0 */ sll $t8, $v0, 3 -/* 0D7D80 8031CD80 15C00003 */ bnez $t6, .L8031CD90 -/* 0D7D84 8031CD84 00000000 */ nop -/* 0D7D88 8031CD88 0703002E */ bgezl $t8, .L8031CE44 -/* 0D7D8C 8031CD8C 8FBF001C */ lw $ra, 0x1c($sp) -.L8031CD90: -/* 0D7D90 8031CD90 0C0C67D9 */ jal seq_channel_layer_note_decay -/* 0D7D94 8031CD94 02002025 */ move $a0, $s0 -/* 0D7D98 8031CD98 1000002A */ b .L8031CE44 -/* 0D7D9C 8031CD9C 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D7DA0 8031CDA0 000270C0 */ sll $t6, $v0, 3 -.L8031CDA4: -/* 0D7DA4 8031CDA4 05C00003 */ bltz $t6, .L8031CDB4 -/* 0D7DA8 8031CDA8 00004025 */ move $t0, $zero -/* 0D7DAC 8031CDAC 10000017 */ b .L8031CE0C -/* 0D7DB0 8031CDB0 24080001 */ li $t0, 1 -.L8031CDB4: -/* 0D7DB4 8031CDB4 8E040044 */ lw $a0, 0x44($s0) -/* 0D7DB8 8031CDB8 10800005 */ beqz $a0, .L8031CDD0 -/* 0D7DBC 8031CDBC 00000000 */ nop -/* 0D7DC0 8031CDC0 920F0001 */ lbu $t7, 1($s0) -/* 0D7DC4 8031CDC4 93B8003F */ lbu $t8, 0x3f($sp) -/* 0D7DC8 8031CDC8 15E00003 */ bnez $t7, .L8031CDD8 -/* 0D7DCC 8031CDCC 00000000 */ nop -.L8031CDD0: -/* 0D7DD0 8031CDD0 1000000E */ b .L8031CE0C -/* 0D7DD4 8031CDD4 24080001 */ li $t0, 1 -.L8031CDD8: -/* 0D7DD8 8031CDD8 57000006 */ bnezl $t8, .L8031CDF4 -/* 0D7DDC 8031CDDC 8E19004C */ lw $t9, 0x4c($s0) -/* 0D7DE0 8031CDE0 0C0C67D9 */ jal seq_channel_layer_note_decay -/* 0D7DE4 8031CDE4 02002025 */ move $a0, $s0 -/* 0D7DE8 8031CDE8 10000008 */ b .L8031CE0C -/* 0D7DEC 8031CDEC 24080001 */ li $t0, 1 -/* 0D7DF0 8031CDF0 8E19004C */ lw $t9, 0x4c($s0) -.L8031CDF4: -/* 0D7DF4 8031CDF4 02002825 */ move $a1, $s0 -/* 0D7DF8 8031CDF8 17200004 */ bnez $t9, .L8031CE0C -/* 0D7DFC 8031CDFC 00000000 */ nop -/* 0D7E00 8031CE00 0C0C6874 */ jal init_synthetic_wave -/* 0D7E04 8031CE04 A3A8003D */ sb $t0, 0x3d($sp) -/* 0D7E08 8031CE08 93A8003D */ lbu $t0, 0x3d($sp) -.L8031CE0C: -/* 0D7E0C 8031CE0C 51000005 */ beql $t0, $zero, .L8031CE24 -/* 0D7E10 8031CE10 8E040044 */ lw $a0, 0x44($s0) -/* 0D7E14 8031CE14 0C0C6A53 */ jal alloc_note -/* 0D7E18 8031CE18 02002025 */ move $a0, $s0 -/* 0D7E1C 8031CE1C AE020044 */ sw $v0, 0x44($s0) -/* 0D7E20 8031CE20 8E040044 */ lw $a0, 0x44($s0) -.L8031CE24: -/* 0D7E24 8031CE24 50800007 */ beql $a0, $zero, .L8031CE44 -/* 0D7E28 8031CE28 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D7E2C 8031CE2C 8C8E002C */ lw $t6, 0x2c($a0) -/* 0D7E30 8031CE30 560E0004 */ bnel $s0, $t6, .L8031CE44 -/* 0D7E34 8031CE34 8FBF001C */ lw $ra, 0x1c($sp) -/* 0D7E38 8031CE38 0C0C6D28 */ jal note_vibrato_init -/* 0D7E3C 8031CE3C 00000000 */ nop -.L8031CE40: -/* 0D7E40 8031CE40 8FBF001C */ lw $ra, 0x1c($sp) -.L8031CE44: -/* 0D7E44 8031CE44 8FB00018 */ lw $s0, 0x18($sp) -/* 0D7E48 8031CE48 27BD0060 */ addiu $sp, $sp, 0x60 -/* 0D7E4C 8031CE4C 03E00008 */ jr $ra -/* 0D7E50 8031CE50 00000000 */ nop diff --git a/asm/non_matchings/sequence_channel_process_script_jp.s b/asm/non_matchings/sequence_channel_process_script_jp.s deleted file mode 100644 index e28faf8190..0000000000 --- a/asm/non_matchings/sequence_channel_process_script_jp.s +++ /dev/null @@ -1,954 +0,0 @@ -.late_rodata -.late_rodata_alignment 8 -glabel jtbl_80337D08 # US: 80338EC0 - .word L8031C430 - .word L8031C3DC - .word L8031C44C - .word L8031C45C - .word L8031C3F8 - .word L8031C6C8 - .word L8031C724 - .word L8031C75C - .word L8031C75C - .word L8031C7A8 - .word L8031C7B8 - .word L8031C75C - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C7D8 - .word L8031C7FC - .word L8031C80C - .word L8031C508 - .word L8031C6B8 - .word L8031C1CC - .word L8031C698 - .word L8031C600 - .word L8031C5E4 - .word L8031C5D4 - .word L8031C5B8 - .word L8031C5A0 - .word L8031C568 - .word L8031C530 - .word L8031C4C0 - .word L8031C46C - .word L8031C488 - .word L8031C650 - .word L8031C61C - .word L8031C684 - .word L8031C820 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C3CC - .word L8031C3A4 - .word L8031C1CC - .word L8031C1CC - .word L8031C34C - .word L8031C33C - .word L8031C2F4 - .word L8031C2BC - .word L8031C34C - .word L8031C34C - .word L8031C34C - .word L8031C280 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - -glabel jtbl_80337E04 # US: 80338FBC - .word L8031C89C - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C9E4 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031CA14 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031CA30 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031CA58 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C8F8 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C9DC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C8CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C8DC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C914 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C960 - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C1CC - .word L8031C97C - -.text -glabel sequence_channel_process_script -/* 0D7104 8031C104 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0D7108 8031C108 AFBF0034 */ sw $ra, 0x34($sp) -/* 0D710C 8031C10C AFB50030 */ sw $s5, 0x30($sp) -/* 0D7110 8031C110 AFB4002C */ sw $s4, 0x2c($sp) -/* 0D7114 8031C114 AFB30028 */ sw $s3, 0x28($sp) -/* 0D7118 8031C118 AFB20024 */ sw $s2, 0x24($sp) -/* 0D711C 8031C11C AFB10020 */ sw $s1, 0x20($sp) -/* 0D7120 8031C120 AFB0001C */ sw $s0, 0x1c($sp) -/* 0D7124 8031C124 F7B40010 */ sdc1 $f20, 0x10($sp) -/* 0D7128 8031C128 8C820000 */ lw $v0, ($a0) -/* 0D712C 8031C12C 00809025 */ move $s2, $a0 -/* 0D7130 8031C130 000277C2 */ srl $t6, $v0, 0x1f -/* 0D7134 8031C134 11C0025D */ beqz $t6, .L8031CAAC -/* 0D7138 8031C138 0002C080 */ sll $t8, $v0, 2 -/* 0D713C 8031C13C 0701000D */ bgez $t8, .L8031C174 -/* 0D7140 8031C140 00008025 */ move $s0, $zero -/* 0D7144 8031C144 00808825 */ move $s1, $a0 -/* 0D7148 8031C148 24120010 */ li $s2, 16 -.L8031C14C: -/* 0D714C 8031C14C 8E240044 */ lw $a0, 0x44($s1) -/* 0D7150 8031C150 50800004 */ beql $a0, $zero, .L8031C164 -/* 0D7154 8031C154 26100004 */ addiu $s0, $s0, 4 -/* 0D7158 8031C158 0C0C6C29 */ jal seq_channel_layer_process_script -/* 0D715C 8031C15C 00000000 */ nop -/* 0D7160 8031C160 26100004 */ addiu $s0, $s0, 4 -.L8031C164: -/* 0D7164 8031C164 1612FFF9 */ bne $s0, $s2, .L8031C14C -/* 0D7168 8031C168 26310004 */ addiu $s1, $s1, 4 -/* 0D716C 8031C16C 10000250 */ b .L8031CAB0 -/* 0D7170 8031C170 8FBF0034 */ lw $ra, 0x34($sp) -.L8031C174: -/* 0D7174 8031C174 8E540040 */ lw $s4, 0x40($s2) -/* 0D7178 8031C178 8E990000 */ lw $t9, ($s4) -/* 0D717C 8031C17C 00195080 */ sll $t2, $t9, 2 -/* 0D7180 8031C180 05430006 */ bgezl $t2, .L8031C19C -/* 0D7184 8031C184 96430016 */ lhu $v1, 0x16($s2) -/* 0D7188 8031C188 924B0002 */ lbu $t3, 2($s2) -/* 0D718C 8031C18C 316C0080 */ andi $t4, $t3, 0x80 -/* 0D7190 8031C190 55800247 */ bnezl $t4, .L8031CAB0 -/* 0D7194 8031C194 8FBF0034 */ lw $ra, 0x34($sp) -/* 0D7198 8031C198 96430016 */ lhu $v1, 0x16($s2) -.L8031C19C: -/* 0D719C 8031C19C 2650005C */ addiu $s0, $s2, 0x5c -/* 0D71A0 8031C1A0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0D71A4 8031C1A4 10600004 */ beqz $v1, .L8031C1B8 -/* 0D71A8 8031C1A8 00601025 */ move $v0, $v1 -/* 0D71AC 8031C1AC 246DFFFF */ addiu $t5, $v1, -1 -/* 0D71B0 8031C1B0 A64D0016 */ sh $t5, 0x16($s2) -/* 0D71B4 8031C1B4 31A2FFFF */ andi $v0, $t5, 0xffff -.L8031C1B8: -/* 0D71B8 8031C1B8 14400231 */ bnez $v0, .L8031CA80 -/* 0D71BC 8031C1BC 2415FFFF */ li $s5, -1 -/* 0D71C0 8031C1C0 4481A800 */ mtc1 $at, $f21 -/* 0D71C4 8031C1C4 4480A000 */ mtc1 $zero, $f20 -/* 0D71C8 8031C1C8 83B30053 */ lb $s3, 0x53($sp) -.L8031C1CC: -glabel L8031C1CC -/* 0D71CC 8031C1CC 0C0C6C07 */ jal m64_read_u8 -/* 0D71D0 8031C1D0 02002025 */ move $a0, $s0 -/* 0D71D4 8031C1D4 240100FF */ li $at, 255 -/* 0D71D8 8031C1D8 305100FF */ andi $s1, $v0, 0xff -/* 0D71DC 8031C1DC 1441000E */ bne $v0, $at, .L8031C218 -/* 0D71E0 8031C1E0 00401825 */ move $v1, $v0 -/* 0D71E4 8031C1E4 92040018 */ lbu $a0, 0x18($s0) -/* 0D71E8 8031C1E8 14800005 */ bnez $a0, .L8031C200 -/* 0D71EC 8031C1EC 248EFFFF */ addiu $t6, $a0, -1 -/* 0D71F0 8031C1F0 0C0C6AB4 */ jal sequence_channel_disable -/* 0D71F4 8031C1F4 02402025 */ move $a0, $s2 -/* 0D71F8 8031C1F8 10000222 */ b .L8031CA84 -/* 0D71FC 8031C1FC 02408825 */ move $s1, $s2 -.L8031C200: -/* 0D7200 8031C200 31CF00FF */ andi $t7, $t6, 0xff -/* 0D7204 8031C204 000FC080 */ sll $t8, $t7, 2 -/* 0D7208 8031C208 0218C821 */ addu $t9, $s0, $t8 -/* 0D720C 8031C20C A20E0018 */ sb $t6, 0x18($s0) -/* 0D7210 8031C210 8F290004 */ lw $t1, 4($t9) -/* 0D7214 8031C214 AE090000 */ sw $t1, ($s0) -.L8031C218: -/* 0D7218 8031C218 240100FE */ li $at, 254 -/* 0D721C 8031C21C 10610218 */ beq $v1, $at, .L8031CA80 -/* 0D7220 8031C220 240100FD */ li $at, 253 -/* 0D7224 8031C224 14610005 */ bne $v1, $at, .L8031C23C -/* 0D7228 8031C228 307900F0 */ andi $t9, $v1, 0xf0 -/* 0D722C 8031C22C 0C0C6C18 */ jal m64_read_compressed_u16 -/* 0D7230 8031C230 02002025 */ move $a0, $s0 -/* 0D7234 8031C234 10000212 */ b .L8031CA80 -/* 0D7238 8031C238 A6420016 */ sh $v0, 0x16($s2) -.L8031C23C: -/* 0D723C 8031C23C 240100F3 */ li $at, 243 -/* 0D7240 8031C240 14610005 */ bne $v1, $at, .L8031C258 -/* 0D7244 8031C244 246DFF3F */ addiu $t5, $v1, -0xc1 -/* 0D7248 8031C248 924B0000 */ lbu $t3, ($s2) -/* 0D724C 8031C24C 356C0020 */ ori $t4, $t3, 0x20 -/* 0D7250 8031C250 1000020B */ b .L8031CA80 -/* 0D7254 8031C254 A24C0000 */ sb $t4, ($s2) -.L8031C258: -/* 0D7258 8031C258 286100C1 */ slti $at, $v1, 0xc1 -/* 0D725C 8031C25C 14200185 */ bnez $at, .L8031C874 -/* 0D7260 8031C260 2DA1003F */ sltiu $at, $t5, 0x3f -/* 0D7264 8031C264 1020FFD9 */ beqz $at, .L8031C1CC -/* 0D7268 8031C268 000D6880 */ sll $t5, $t5, 2 -/* 0D726C 8031C26C 3C018033 */ lui $at, %hi(jtbl_80337D08) -/* 0D7270 8031C270 002D0821 */ addu $at, $at, $t5 -/* 0D7274 8031C274 8C2D7D08 */ lw $t5, %lo(jtbl_80337D08)($at) -/* 0D7278 8031C278 01A00008 */ jr $t5 -/* 0D727C 8031C27C 00000000 */ nop -glabel L8031C280 -/* 0D7280 8031C280 0C0C6C0C */ jal m64_read_s16 -/* 0D7284 8031C284 02002025 */ move $a0, $s0 -/* 0D7288 8031C288 920E0018 */ lbu $t6, 0x18($s0) -/* 0D728C 8031C28C 8E180000 */ lw $t8, ($s0) -/* 0D7290 8031C290 304CFFFF */ andi $t4, $v0, 0xffff -/* 0D7294 8031C294 25CF0001 */ addiu $t7, $t6, 1 -/* 0D7298 8031C298 31F900FF */ andi $t9, $t7, 0xff -/* 0D729C 8031C29C 00194880 */ sll $t1, $t9, 2 -/* 0D72A0 8031C2A0 02095021 */ addu $t2, $s0, $t1 -/* 0D72A4 8031C2A4 A20F0018 */ sb $t7, 0x18($s0) -/* 0D72A8 8031C2A8 AD580000 */ sw $t8, ($t2) -/* 0D72AC 8031C2AC 8E8B0014 */ lw $t3, 0x14($s4) -/* 0D72B0 8031C2B0 016C6821 */ addu $t5, $t3, $t4 -/* 0D72B4 8031C2B4 1000FFC5 */ b .L8031C1CC -/* 0D72B8 8031C2B8 AE0D0000 */ sw $t5, ($s0) -glabel L8031C2BC -/* 0D72BC 8031C2BC 0C0C6C07 */ jal m64_read_u8 -/* 0D72C0 8031C2C0 02002025 */ move $a0, $s0 -/* 0D72C4 8031C2C4 920E0018 */ lbu $t6, 0x18($s0) -/* 0D72C8 8031C2C8 020E7821 */ addu $t7, $s0, $t6 -/* 0D72CC 8031C2CC A1E20014 */ sb $v0, 0x14($t7) -/* 0D72D0 8031C2D0 92190018 */ lbu $t9, 0x18($s0) -/* 0D72D4 8031C2D4 8E180000 */ lw $t8, ($s0) -/* 0D72D8 8031C2D8 27290001 */ addiu $t1, $t9, 1 -/* 0D72DC 8031C2DC 312A00FF */ andi $t2, $t1, 0xff -/* 0D72E0 8031C2E0 000A5880 */ sll $t3, $t2, 2 -/* 0D72E4 8031C2E4 020B6021 */ addu $t4, $s0, $t3 -/* 0D72E8 8031C2E8 A2090018 */ sb $t1, 0x18($s0) -/* 0D72EC 8031C2EC 1000FFB7 */ b .L8031C1CC -/* 0D72F0 8031C2F0 AD980000 */ sw $t8, ($t4) -glabel L8031C2F4 -/* 0D72F4 8031C2F4 920D0018 */ lbu $t5, 0x18($s0) -/* 0D72F8 8031C2F8 020D1021 */ addu $v0, $s0, $t5 -/* 0D72FC 8031C2FC 904E0013 */ lbu $t6, 0x13($v0) -/* 0D7300 8031C300 25CFFFFF */ addiu $t7, $t6, -1 -/* 0D7304 8031C304 A04F0013 */ sb $t7, 0x13($v0) -/* 0D7308 8031C308 92040018 */ lbu $a0, 0x18($s0) -/* 0D730C 8031C30C 0204C821 */ addu $t9, $s0, $a0 -/* 0D7310 8031C310 93290013 */ lbu $t1, 0x13($t9) -/* 0D7314 8031C314 00801825 */ move $v1, $a0 -/* 0D7318 8031C318 00035080 */ sll $t2, $v1, 2 -/* 0D731C 8031C31C 11200005 */ beqz $t1, .L8031C334 -/* 0D7320 8031C320 248CFFFF */ addiu $t4, $a0, -1 -/* 0D7324 8031C324 020A5821 */ addu $t3, $s0, $t2 -/* 0D7328 8031C328 8D780000 */ lw $t8, ($t3) -/* 0D732C 8031C32C 1000FFA7 */ b .L8031C1CC -/* 0D7330 8031C330 AE180000 */ sw $t8, ($s0) -.L8031C334: -/* 0D7334 8031C334 1000FFA5 */ b .L8031C1CC -/* 0D7338 8031C338 A20C0018 */ sb $t4, 0x18($s0) -glabel L8031C33C -/* 0D733C 8031C33C 920D0018 */ lbu $t5, 0x18($s0) -/* 0D7340 8031C340 25AEFFFF */ addiu $t6, $t5, -1 -/* 0D7344 8031C344 1000FFA1 */ b .L8031C1CC -/* 0D7348 8031C348 A20E0018 */ sb $t6, 0x18($s0) -glabel L8031C34C -/* 0D734C 8031C34C 0C0C6C0C */ jal m64_read_s16 -/* 0D7350 8031C350 02002025 */ move $a0, $s0 -/* 0D7354 8031C354 240100FA */ li $at, 250 -/* 0D7358 8031C358 16210003 */ bne $s1, $at, .L8031C368 -/* 0D735C 8031C35C 02201825 */ move $v1, $s1 -/* 0D7360 8031C360 1660FF9A */ bnez $s3, .L8031C1CC -/* 0D7364 8031C364 00000000 */ nop -.L8031C368: -/* 0D7368 8031C368 240100F9 */ li $at, 249 -/* 0D736C 8031C36C 54610004 */ bnel $v1, $at, .L8031C380 -/* 0D7370 8031C370 240100F5 */ li $at, 245 -/* 0D7374 8031C374 0661FF95 */ bgez $s3, .L8031C1CC -/* 0D7378 8031C378 00000000 */ nop -/* 0D737C 8031C37C 240100F5 */ li $at, 245 -.L8031C380: -/* 0D7380 8031C380 54610004 */ bnel $v1, $at, .L8031C394 -/* 0D7384 8031C384 8E8F0014 */ lw $t7, 0x14($s4) -/* 0D7388 8031C388 0660FF90 */ bltz $s3, .L8031C1CC -/* 0D738C 8031C38C 00000000 */ nop -/* 0D7390 8031C390 8E8F0014 */ lw $t7, 0x14($s4) -.L8031C394: -/* 0D7394 8031C394 3059FFFF */ andi $t9, $v0, 0xffff -/* 0D7398 8031C398 01F94821 */ addu $t1, $t7, $t9 -/* 0D739C 8031C39C 1000FF8B */ b .L8031C1CC -/* 0D73A0 8031C3A0 AE090000 */ sw $t1, ($s0) -glabel L8031C3A4 -/* 0D73A4 8031C3A4 26510080 */ addiu $s1, $s2, 0x80 -/* 0D73A8 8031C3A8 0C0C64BF */ jal note_pool_clear -/* 0D73AC 8031C3AC 02202025 */ move $a0, $s1 -/* 0D73B0 8031C3B0 0C0C6C07 */ jal m64_read_u8 -/* 0D73B4 8031C3B4 02002025 */ move $a0, $s0 -/* 0D73B8 8031C3B8 02202025 */ move $a0, $s1 -/* 0D73BC 8031C3BC 0C0C650A */ jal note_pool_fill -/* 0D73C0 8031C3C0 00402825 */ move $a1, $v0 -/* 0D73C4 8031C3C4 1000FF81 */ b .L8031C1CC -/* 0D73C8 8031C3C8 00000000 */ nop -glabel L8031C3CC -/* 0D73CC 8031C3CC 0C0C64BF */ jal note_pool_clear -/* 0D73D0 8031C3D0 26440080 */ addiu $a0, $s2, 0x80 -/* 0D73D4 8031C3D4 1000FF7D */ b .L8031C1CC -/* 0D73D8 8031C3D8 00000000 */ nop -glabel L8031C3DC -/* 0D73DC 8031C3DC 0C0C6C0C */ jal m64_read_s16 -/* 0D73E0 8031C3E0 02002025 */ move $a0, $s0 -/* 0D73E4 8031C3E4 8E8A0014 */ lw $t2, 0x14($s4) -/* 0D73E8 8031C3E8 304BFFFF */ andi $t3, $v0, 0xffff -/* 0D73EC 8031C3EC 014BC021 */ addu $t8, $t2, $t3 -/* 0D73F0 8031C3F0 1000FF76 */ b .L8031C1CC -/* 0D73F4 8031C3F4 AE580030 */ sw $t8, 0x30($s2) -glabel L8031C3F8 -/* 0D73F8 8031C3F8 1275FF74 */ beq $s3, $s5, .L8031C1CC -/* 0D73FC 8031C3FC 00000000 */ nop -/* 0D7400 8031C400 8E4C0030 */ lw $t4, 0x30($s2) -/* 0D7404 8031C404 00136840 */ sll $t5, $s3, 1 -/* 0D7408 8031C408 8E8A0014 */ lw $t2, 0x14($s4) -/* 0D740C 8031C40C 018D1021 */ addu $v0, $t4, $t5 -/* 0D7410 8031C410 904F0000 */ lbu $t7, ($v0) -/* 0D7414 8031C414 904E0001 */ lbu $t6, 1($v0) -/* 0D7418 8031C418 000FCA00 */ sll $t9, $t7, 8 -/* 0D741C 8031C41C 01D93821 */ addu $a3, $t6, $t9 -/* 0D7420 8031C420 30E9FFFF */ andi $t1, $a3, 0xffff -/* 0D7424 8031C424 01495821 */ addu $t3, $t2, $t1 -/* 0D7428 8031C428 1000FF68 */ b .L8031C1CC -/* 0D742C 8031C42C AE4B0030 */ sw $t3, 0x30($s2) -glabel L8031C430 -/* 0D7430 8031C430 0C0C6C07 */ jal m64_read_u8 -/* 0D7434 8031C434 02002025 */ move $a0, $s0 -/* 0D7438 8031C438 02402025 */ move $a0, $s2 -/* 0D743C 8031C43C 0C0C700C */ jal set_instrument -/* 0D7440 8031C440 304500FF */ andi $a1, $v0, 0xff -/* 0D7444 8031C444 1000FF61 */ b .L8031C1CC -/* 0D7448 8031C448 00000000 */ nop -glabel L8031C44C -/* 0D744C 8031C44C 92580000 */ lbu $t8, ($s2) -/* 0D7450 8031C450 330CFFFD */ andi $t4, $t8, 0xfffd -/* 0D7454 8031C454 1000FF5D */ b .L8031C1CC -/* 0D7458 8031C458 A24C0000 */ sb $t4, ($s2) -glabel L8031C45C -/* 0D745C 8031C45C 924F0000 */ lbu $t7, ($s2) -/* 0D7460 8031C460 35EE0002 */ ori $t6, $t7, 2 -/* 0D7464 8031C464 1000FF59 */ b .L8031C1CC -/* 0D7468 8031C468 A24E0000 */ sb $t6, ($s2) -glabel L8031C46C -/* 0D746C 8031C46C 0C0C6C07 */ jal m64_read_u8 -/* 0D7470 8031C470 02002025 */ move $a0, $s0 -/* 0D7474 8031C474 02402025 */ move $a0, $s2 -/* 0D7478 8031C478 0C0C7031 */ jal sequence_channel_set_volume -/* 0D747C 8031C47C 304500FF */ andi $a1, $v0, 0xff -/* 0D7480 8031C480 1000FF52 */ b .L8031C1CC -/* 0D7484 8031C484 00000000 */ nop -glabel L8031C488 -/* 0D7488 8031C488 0C0C6C07 */ jal m64_read_u8 -/* 0D748C 8031C48C 02002025 */ move $a0, $s0 -/* 0D7490 8031C490 44822000 */ mtc1 $v0, $f4 -/* 0D7494 8031C494 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D7498 8031C498 04410004 */ bgez $v0, .L8031C4AC -/* 0D749C 8031C49C 468021A0 */ cvt.s.w $f6, $f4 -/* 0D74A0 8031C4A0 44814000 */ mtc1 $at, $f8 -/* 0D74A4 8031C4A4 00000000 */ nop -/* 0D74A8 8031C4A8 46083180 */ add.s $f6, $f6, $f8 -.L8031C4AC: -/* 0D74AC 8031C4AC 460032A1 */ cvt.d.s $f10, $f6 -/* 0D74B0 8031C4B0 46345402 */ mul.d $f16, $f10, $f20 -/* 0D74B4 8031C4B4 462084A0 */ cvt.s.d $f18, $f16 -/* 0D74B8 8031C4B8 1000FF44 */ b .L8031C1CC -/* 0D74BC 8031C4BC E652001C */ swc1 $f18, 0x1c($s2) -glabel L8031C4C0 -/* 0D74C0 8031C4C0 0C0C6C0C */ jal m64_read_s16 -/* 0D74C4 8031C4C4 02002025 */ move $a0, $s0 -/* 0D74C8 8031C4C8 3059FFFF */ andi $t9, $v0, 0xffff -/* 0D74CC 8031C4CC 44992000 */ mtc1 $t9, $f4 -/* 0D74D0 8031C4D0 44808000 */ mtc1 $zero, $f16 -/* 0D74D4 8031C4D4 07210005 */ bgez $t9, .L8031C4EC -/* 0D74D8 8031C4D8 46802220 */ cvt.s.w $f8, $f4 -/* 0D74DC 8031C4DC 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D74E0 8031C4E0 44813000 */ mtc1 $at, $f6 -/* 0D74E4 8031C4E4 00000000 */ nop -/* 0D74E8 8031C4E8 46064200 */ add.s $f8, $f8, $f6 -.L8031C4EC: -/* 0D74EC 8031C4EC 3C0140E0 */ li $at, 0x40E00000 # 7.000000 -/* 0D74F0 8031C4F0 44818800 */ mtc1 $at, $f17 -/* 0D74F4 8031C4F4 460042A1 */ cvt.d.s $f10, $f8 -/* 0D74F8 8031C4F8 46305483 */ div.d $f18, $f10, $f16 -/* 0D74FC 8031C4FC 46209120 */ cvt.s.d $f4, $f18 -/* 0D7500 8031C500 1000FF32 */ b .L8031C1CC -/* 0D7504 8031C504 E644002C */ swc1 $f4, 0x2c($s2) -glabel L8031C508 -/* 0D7508 8031C508 0C0C6C07 */ jal m64_read_u8 -/* 0D750C 8031C50C 02002025 */ move $a0, $s0 -/* 0D7510 8031C510 2449007F */ addiu $t1, $v0, 0x7f -/* 0D7514 8031C514 312A00FF */ andi $t2, $t1, 0xff -/* 0D7518 8031C518 000A5880 */ sll $t3, $t2, 2 -/* 0D751C 8031C51C 3C018033 */ lui $at, %hi(gPitchBendFrequencyScale) -/* 0D7520 8031C520 002B0821 */ addu $at, $at, $t3 -/* 0D7524 8031C524 C4262488 */ lwc1 $f6, %lo(gPitchBendFrequencyScale)($at) -/* 0D7528 8031C528 1000FF28 */ b .L8031C1CC -/* 0D752C 8031C52C E646002C */ swc1 $f6, 0x2c($s2) -glabel L8031C530 -/* 0D7530 8031C530 0C0C6C07 */ jal m64_read_u8 -/* 0D7534 8031C534 02002025 */ move $a0, $s0 -/* 0D7538 8031C538 44824000 */ mtc1 $v0, $f8 -/* 0D753C 8031C53C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D7540 8031C540 04410004 */ bgez $v0, .L8031C554 -/* 0D7544 8031C544 468042A0 */ cvt.s.w $f10, $f8 -/* 0D7548 8031C548 44818000 */ mtc1 $at, $f16 -/* 0D754C 8031C54C 00000000 */ nop -/* 0D7550 8031C550 46105280 */ add.s $f10, $f10, $f16 -.L8031C554: -/* 0D7554 8031C554 460054A1 */ cvt.d.s $f18, $f10 -/* 0D7558 8031C558 46349102 */ mul.d $f4, $f18, $f20 -/* 0D755C 8031C55C 462021A0 */ cvt.s.d $f6, $f4 -/* 0D7560 8031C560 1000FF1A */ b .L8031C1CC -/* 0D7564 8031C564 E6460024 */ swc1 $f6, 0x24($s2) -glabel L8031C568 -/* 0D7568 8031C568 0C0C6C07 */ jal m64_read_u8 -/* 0D756C 8031C56C 02002025 */ move $a0, $s0 -/* 0D7570 8031C570 44824000 */ mtc1 $v0, $f8 -/* 0D7574 8031C574 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0D7578 8031C578 04410004 */ bgez $v0, .L8031C58C -/* 0D757C 8031C57C 46804420 */ cvt.s.w $f16, $f8 -/* 0D7580 8031C580 44815000 */ mtc1 $at, $f10 -/* 0D7584 8031C584 00000000 */ nop -/* 0D7588 8031C588 460A8400 */ add.s $f16, $f16, $f10 -.L8031C58C: -/* 0D758C 8031C58C 460084A1 */ cvt.d.s $f18, $f16 -/* 0D7590 8031C590 46349102 */ mul.d $f4, $f18, $f20 -/* 0D7594 8031C594 462021A0 */ cvt.s.d $f6, $f4 -/* 0D7598 8031C598 1000FF0C */ b .L8031C1CC -/* 0D759C 8031C59C E6460028 */ swc1 $f6, 0x28($s2) -glabel L8031C5A0 -/* 0D75A0 8031C5A0 8E020000 */ lw $v0, ($s0) -/* 0D75A4 8031C5A4 80430000 */ lb $v1, ($v0) -/* 0D75A8 8031C5A8 24580001 */ addiu $t8, $v0, 1 -/* 0D75AC 8031C5AC AE180000 */ sw $t8, ($s0) -/* 0D75B0 8031C5B0 1000FF06 */ b .L8031C1CC -/* 0D75B4 8031C5B4 A643001A */ sh $v1, 0x1a($s2) -glabel L8031C5B8 -/* 0D75B8 8031C5B8 0C0C6C0C */ jal m64_read_s16 -/* 0D75BC 8031C5BC 02002025 */ move $a0, $s0 -/* 0D75C0 8031C5C0 8E8C0014 */ lw $t4, 0x14($s4) -/* 0D75C4 8031C5C4 304DFFFF */ andi $t5, $v0, 0xffff -/* 0D75C8 8031C5C8 018D7821 */ addu $t7, $t4, $t5 -/* 0D75CC 8031C5CC 1000FEFF */ b .L8031C1CC -/* 0D75D0 8031C5D0 AE4F007C */ sw $t7, 0x7c($s2) -glabel L8031C5D4 -/* 0D75D4 8031C5D4 0C0C6C07 */ jal m64_read_u8 -/* 0D75D8 8031C5D8 02002025 */ move $a0, $s0 -/* 0D75DC 8031C5DC 1000FEFB */ b .L8031C1CC -/* 0D75E0 8031C5E0 A2420078 */ sb $v0, 0x78($s2) -glabel L8031C5E4 -/* 0D75E4 8031C5E4 0C0C6C07 */ jal m64_read_u8 -/* 0D75E8 8031C5E8 02002025 */ move $a0, $s0 -/* 0D75EC 8031C5EC 000270C0 */ sll $t6, $v0, 3 -/* 0D75F0 8031C5F0 A64E000E */ sh $t6, 0xe($s2) -/* 0D75F4 8031C5F4 A640000A */ sh $zero, 0xa($s2) -/* 0D75F8 8031C5F8 1000FEF4 */ b .L8031C1CC -/* 0D75FC 8031C5FC A6400012 */ sh $zero, 0x12($s2) -glabel L8031C600 -/* 0D7600 8031C600 0C0C6C07 */ jal m64_read_u8 -/* 0D7604 8031C604 02002025 */ move $a0, $s0 -/* 0D7608 8031C608 00021940 */ sll $v1, $v0, 5 -/* 0D760C 8031C60C A643000C */ sh $v1, 0xc($s2) -/* 0D7610 8031C610 A6430008 */ sh $v1, 8($s2) -/* 0D7614 8031C614 1000FEED */ b .L8031C1CC -/* 0D7618 8031C618 A6400010 */ sh $zero, 0x10($s2) -glabel L8031C61C -/* 0D761C 8031C61C 0C0C6C07 */ jal m64_read_u8 -/* 0D7620 8031C620 02002025 */ move $a0, $s0 -/* 0D7624 8031C624 0002C8C0 */ sll $t9, $v0, 3 -/* 0D7628 8031C628 A659000A */ sh $t9, 0xa($s2) -/* 0D762C 8031C62C 0C0C6C07 */ jal m64_read_u8 -/* 0D7630 8031C630 02002025 */ move $a0, $s0 -/* 0D7634 8031C634 000248C0 */ sll $t1, $v0, 3 -/* 0D7638 8031C638 A649000E */ sh $t1, 0xe($s2) -/* 0D763C 8031C63C 0C0C6C07 */ jal m64_read_u8 -/* 0D7640 8031C640 02002025 */ move $a0, $s0 -/* 0D7644 8031C644 00025100 */ sll $t2, $v0, 4 -/* 0D7648 8031C648 1000FEE0 */ b .L8031C1CC -/* 0D764C 8031C64C A64A0012 */ sh $t2, 0x12($s2) -glabel L8031C650 -/* 0D7650 8031C650 0C0C6C07 */ jal m64_read_u8 -/* 0D7654 8031C654 02002025 */ move $a0, $s0 -/* 0D7658 8031C658 00025940 */ sll $t3, $v0, 5 -/* 0D765C 8031C65C A64B0008 */ sh $t3, 8($s2) -/* 0D7660 8031C660 0C0C6C07 */ jal m64_read_u8 -/* 0D7664 8031C664 02002025 */ move $a0, $s0 -/* 0D7668 8031C668 0002C140 */ sll $t8, $v0, 5 -/* 0D766C 8031C66C A658000C */ sh $t8, 0xc($s2) -/* 0D7670 8031C670 0C0C6C07 */ jal m64_read_u8 -/* 0D7674 8031C674 02002025 */ move $a0, $s0 -/* 0D7678 8031C678 00026100 */ sll $t4, $v0, 4 -/* 0D767C 8031C67C 1000FED3 */ b .L8031C1CC -/* 0D7680 8031C680 A64C0010 */ sh $t4, 0x10($s2) -glabel L8031C684 -/* 0D7684 8031C684 0C0C6C07 */ jal m64_read_u8 -/* 0D7688 8031C688 02002025 */ move $a0, $s0 -/* 0D768C 8031C68C 00026900 */ sll $t5, $v0, 4 -/* 0D7690 8031C690 1000FECE */ b .L8031C1CC -/* 0D7694 8031C694 A64D0014 */ sh $t5, 0x14($s2) -glabel L8031C698 -/* 0D7698 8031C698 0C0C6C07 */ jal m64_read_u8 -/* 0D769C 8031C69C 02002025 */ move $a0, $s0 -/* 0D76A0 8031C6A0 14400003 */ bnez $v0, .L8031C6B0 -/* 0D76A4 8031C6A4 305100FF */ andi $s1, $v0, 0xff -/* 0D76A8 8031C6A8 3C118022 */ lui $s1, %hi(gAudioUpdatesPerFrame) # $s1, 0x8022 -/* 0D76AC 8031C6AC 92316D7E */ lbu $s1, %lo(gAudioUpdatesPerFrame)($s1) -.L8031C6B0: -/* 0D76B0 8031C6B0 1000FEC6 */ b .L8031C1CC -/* 0D76B4 8031C6B4 A2510006 */ sb $s1, 6($s2) -glabel L8031C6B8 -/* 0D76B8 8031C6B8 0C0C6C07 */ jal m64_read_u8 -/* 0D76BC 8031C6BC 02002025 */ move $a0, $s0 -/* 0D76C0 8031C6C0 1000FEC2 */ b .L8031C1CC -/* 0D76C4 8031C6C4 A2420003 */ sb $v0, 3($s2) -glabel L8031C6C8 -/* 0D76C8 8031C6C8 0C0C6C07 */ jal m64_read_u8 -/* 0D76CC 8031C6CC 02002025 */ move $a0, $s0 -/* 0D76D0 8031C6D0 928F0005 */ lbu $t7, 5($s4) -/* 0D76D4 8031C6D4 3C038022 */ lui $v1, %hi(gAlBankSets) # $v1, 0x8022 -/* 0D76D8 8031C6D8 8C636D58 */ lw $v1, %lo(gAlBankSets)($v1) -/* 0D76DC 8031C6DC 000F7040 */ sll $t6, $t7, 1 -/* 0D76E0 8031C6E0 3C048022 */ lui $a0, %hi(gBankLoadedPool) # $a0, 0x8022 -/* 0D76E4 8031C6E4 006EC821 */ addu $t9, $v1, $t6 -/* 0D76E8 8031C6E8 97270000 */ lhu $a3, ($t9) -/* 0D76EC 8031C6EC 248414F8 */ addiu $a0, %lo(gBankLoadedPool) # addiu $a0, $a0, 0x14f8 -/* 0D76F0 8031C6F0 24050002 */ li $a1, 2 -/* 0D76F4 8031C6F4 00E34821 */ addu $t1, $a3, $v1 -/* 0D76F8 8031C6F8 91280000 */ lbu $t0, ($t1) -/* 0D76FC 8031C6FC 00E85021 */ addu $t2, $a3, $t0 -/* 0D7700 8031C700 01425823 */ subu $t3, $t2, $v0 -/* 0D7704 8031C704 0163C021 */ addu $t8, $t3, $v1 -/* 0D7708 8031C708 93110000 */ lbu $s1, ($t8) -/* 0D770C 8031C70C 0C0C5A03 */ jal get_bank_or_seq -/* 0D7710 8031C710 02203025 */ move $a2, $s1 -/* 0D7714 8031C714 1040FEAD */ beqz $v0, .L8031C1CC -/* 0D7718 8031C718 00000000 */ nop -/* 0D771C 8031C71C 1000FEAB */ b .L8031C1CC -/* 0D7720 8031C720 A2510005 */ sb $s1, 5($s2) -glabel L8031C724 -/* 0D7724 8031C724 326C00FF */ andi $t4, $s3, 0xff -/* 0D7728 8031C728 AFAC0038 */ sw $t4, 0x38($sp) -/* 0D772C 8031C72C 0C0C6C07 */ jal m64_read_u8 -/* 0D7730 8031C730 02002025 */ move $a0, $s0 -/* 0D7734 8031C734 305100FF */ andi $s1, $v0, 0xff -/* 0D7738 8031C738 0C0C6C0C */ jal m64_read_s16 -/* 0D773C 8031C73C 02002025 */ move $a0, $s0 -/* 0D7740 8031C740 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D7744 8031C744 8FAE0038 */ lw $t6, 0x38($sp) -/* 0D7748 8031C748 304FFFFF */ andi $t7, $v0, 0xffff -/* 0D774C 8031C74C 01AF1821 */ addu $v1, $t5, $t7 -/* 0D7750 8031C750 01D1C821 */ addu $t9, $t6, $s1 -/* 0D7754 8031C754 1000FE9D */ b .L8031C1CC -/* 0D7758 8031C758 A0790000 */ sb $t9, ($v1) -glabel L8031C75C -/* 0D775C 8031C75C 0C0C6C07 */ jal m64_read_u8 -/* 0D7760 8031C760 02002025 */ move $a0, $s0 -/* 0D7764 8031C764 240100C8 */ li $at, 200 -/* 0D7768 8031C768 16210005 */ bne $s1, $at, .L8031C780 -/* 0D776C 8031C76C 02201825 */ move $v1, $s1 -/* 0D7770 8031C770 02629823 */ subu $s3, $s3, $v0 -/* 0D7774 8031C774 00135E00 */ sll $t3, $s3, 0x18 -/* 0D7778 8031C778 1000FE94 */ b .L8031C1CC -/* 0D777C 8031C77C 000B9E03 */ sra $s3, $t3, 0x18 -.L8031C780: -/* 0D7780 8031C780 240100CC */ li $at, 204 -/* 0D7784 8031C784 14610005 */ bne $v1, $at, .L8031C79C -/* 0D7788 8031C788 02629824 */ and $s3, $s3, $v0 -/* 0D778C 8031C78C 00029E00 */ sll $s3, $v0, 0x18 -/* 0D7790 8031C790 00136603 */ sra $t4, $s3, 0x18 -/* 0D7794 8031C794 1000FE8D */ b .L8031C1CC -/* 0D7798 8031C798 01809825 */ move $s3, $t4 -.L8031C79C: -/* 0D779C 8031C79C 00137600 */ sll $t6, $s3, 0x18 -/* 0D77A0 8031C7A0 1000FE8A */ b .L8031C1CC -/* 0D77A4 8031C7A4 000E9E03 */ sra $s3, $t6, 0x18 -glabel L8031C7A8 -/* 0D77A8 8031C7A8 0C0C6C07 */ jal m64_read_u8 -/* 0D77AC 8031C7AC 02002025 */ move $a0, $s0 -/* 0D77B0 8031C7B0 1000FE86 */ b .L8031C1CC -/* 0D77B4 8031C7B4 A2420002 */ sb $v0, 2($s2) -glabel L8031C7B8 -/* 0D77B8 8031C7B8 0C0C6C0C */ jal m64_read_s16 -/* 0D77BC 8031C7BC 02002025 */ move $a0, $s0 -/* 0D77C0 8031C7C0 8E890014 */ lw $t1, 0x14($s4) -/* 0D77C4 8031C7C4 304AFFFF */ andi $t2, $v0, 0xffff -/* 0D77C8 8031C7C8 01535821 */ addu $t3, $t2, $s3 -/* 0D77CC 8031C7CC 012BC021 */ addu $t8, $t1, $t3 -/* 0D77D0 8031C7D0 1000FE7E */ b .L8031C1CC -/* 0D77D4 8031C7D4 83130000 */ lb $s3, ($t8) -glabel L8031C7D8 -/* 0D77D8 8031C7D8 0C0C6C07 */ jal m64_read_u8 -/* 0D77DC 8031C7DC 02002025 */ move $a0, $s0 -/* 0D77E0 8031C7E0 924E0000 */ lbu $t6, ($s2) -/* 0D77E4 8031C7E4 00026880 */ sll $t5, $v0, 2 -/* 0D77E8 8031C7E8 31AF0004 */ andi $t7, $t5, 4 -/* 0D77EC 8031C7EC 31D9FFFB */ andi $t9, $t6, 0xfffb -/* 0D77F0 8031C7F0 01F95025 */ or $t2, $t7, $t9 -/* 0D77F4 8031C7F4 1000FE75 */ b .L8031C1CC -/* 0D77F8 8031C7F8 A24A0000 */ sb $t2, ($s2) -glabel L8031C7FC -/* 0D77FC 8031C7FC 0C0C6C07 */ jal m64_read_u8 -/* 0D7800 8031C800 02002025 */ move $a0, $s0 -/* 0D7804 8031C804 1000FE71 */ b .L8031C1CC -/* 0D7808 8031C808 A2420001 */ sb $v0, 1($s2) -glabel L8031C80C -/* 0D780C 8031C80C 0C0C6C07 */ jal m64_read_u8 -/* 0D7810 8031C810 02002025 */ move $a0, $s0 -/* 0D7814 8031C814 00024A00 */ sll $t1, $v0, 8 -/* 0D7818 8031C818 1000FE6C */ b .L8031C1CC -/* 0D781C 8031C81C A649007A */ sh $t1, 0x7a($s2) -glabel L8031C820 -/* 0D7820 8031C820 1275FE6A */ beq $s3, $s5, .L8031C1CC -/* 0D7824 8031C824 0013C040 */ sll $t8, $s3, 1 -/* 0D7828 8031C828 920C0018 */ lbu $t4, 0x18($s0) -/* 0D782C 8031C82C 8E4B0030 */ lw $t3, 0x30($s2) -/* 0D7830 8031C830 8E0E0000 */ lw $t6, ($s0) -/* 0D7834 8031C834 258D0001 */ addiu $t5, $t4, 1 -/* 0D7838 8031C838 31AF00FF */ andi $t7, $t5, 0xff -/* 0D783C 8031C83C 000FC880 */ sll $t9, $t7, 2 -/* 0D7840 8031C840 02195021 */ addu $t2, $s0, $t9 -/* 0D7844 8031C844 A20D0018 */ sb $t5, 0x18($s0) -/* 0D7848 8031C848 01781021 */ addu $v0, $t3, $t8 -/* 0D784C 8031C84C AD4E0000 */ sw $t6, ($t2) -/* 0D7850 8031C850 904B0000 */ lbu $t3, ($v0) -/* 0D7854 8031C854 90490001 */ lbu $t1, 1($v0) -/* 0D7858 8031C858 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D785C 8031C85C 000BC200 */ sll $t8, $t3, 8 -/* 0D7860 8031C860 01383821 */ addu $a3, $t1, $t8 -/* 0D7864 8031C864 30ECFFFF */ andi $t4, $a3, 0xffff -/* 0D7868 8031C868 01AC7821 */ addu $t7, $t5, $t4 -/* 0D786C 8031C86C 1000FE57 */ b .L8031C1CC -/* 0D7870 8031C870 AE0F0000 */ sw $t7, ($s0) -.L8031C874: -/* 0D7874 8031C874 3064000F */ andi $a0, $v1, 0xf -/* 0D7878 8031C878 2F2100B1 */ sltiu $at, $t9, 0xb1 -/* 0D787C 8031C87C 1020FE53 */ beqz $at, .L8031C1CC -/* 0D7880 8031C880 308800FF */ andi $t0, $a0, 0xff -/* 0D7884 8031C884 0019C880 */ sll $t9, $t9, 2 -/* 0D7888 8031C888 3C018033 */ lui $at, %hi(jtbl_80337E04) -/* 0D788C 8031C88C 00390821 */ addu $at, $at, $t9 -/* 0D7890 8031C890 8C397E04 */ lw $t9, %lo(jtbl_80337E04)($at) -/* 0D7894 8031C894 03200008 */ jr $t9 -/* 0D7898 8031C898 00000000 */ nop -glabel L8031C89C -/* 0D789C 8031C89C 308E00FF */ andi $t6, $a0, 0xff -/* 0D78A0 8031C8A0 000E5080 */ sll $t2, $t6, 2 -/* 0D78A4 8031C8A4 024A5821 */ addu $t3, $s2, $t2 -/* 0D78A8 8031C8A8 8D630044 */ lw $v1, 0x44($t3) -/* 0D78AC 8031C8AC 1060FE47 */ beqz $v1, .L8031C1CC -/* 0D78B0 8031C8B0 00000000 */ nop -/* 0D78B4 8031C8B4 8C730000 */ lw $s3, ($v1) -/* 0D78B8 8031C8B8 00134840 */ sll $t1, $s3, 1 -/* 0D78BC 8031C8BC 0009C7C2 */ srl $t8, $t1, 0x1f -/* 0D78C0 8031C8C0 00186600 */ sll $t4, $t8, 0x18 -/* 0D78C4 8031C8C4 1000FE41 */ b .L8031C1CC -/* 0D78C8 8031C8C8 000C9E03 */ sra $s3, $t4, 0x18 -glabel L8031C8CC -/* 0D78CC 8031C8CC 308F00FF */ andi $t7, $a0, 0xff -/* 0D78D0 8031C8D0 024FC821 */ addu $t9, $s2, $t7 -/* 0D78D4 8031C8D4 1000FE3D */ b .L8031C1CC -/* 0D78D8 8031C8D8 A3330054 */ sb $s3, 0x54($t9) -glabel L8031C8DC -/* 0D78DC 8031C8DC 308300FF */ andi $v1, $a0, 0xff -/* 0D78E0 8031C8E0 02432821 */ addu $a1, $s2, $v1 -/* 0D78E4 8031C8E4 28610004 */ slti $at, $v1, 4 -/* 0D78E8 8031C8E8 1020FE38 */ beqz $at, .L8031C1CC -/* 0D78EC 8031C8EC 80B30054 */ lb $s3, 0x54($a1) -/* 0D78F0 8031C8F0 1000FE36 */ b .L8031C1CC -/* 0D78F4 8031C8F4 A0B50054 */ sb $s5, 0x54($a1) -glabel L8031C8F8 -/* 0D78F8 8031C8F8 308E00FF */ andi $t6, $a0, 0xff -/* 0D78FC 8031C8FC 024E5021 */ addu $t2, $s2, $t6 -/* 0D7900 8031C900 814B0054 */ lb $t3, 0x54($t2) -/* 0D7904 8031C904 026B9823 */ subu $s3, $s3, $t3 -/* 0D7908 8031C908 00134E00 */ sll $t1, $s3, 0x18 -/* 0D790C 8031C90C 1000FE2F */ b .L8031C1CC -/* 0D7910 8031C910 00099E03 */ sra $s3, $t1, 0x18 -glabel L8031C914 -/* 0D7914 8031C914 0C0C6C0C */ jal m64_read_s16 -/* 0D7918 8031C918 02002025 */ move $a0, $s0 -/* 0D791C 8031C91C 02201825 */ move $v1, $s1 -/* 0D7920 8031C920 3065000F */ andi $a1, $v1, 0xf -/* 0D7924 8031C924 00A01825 */ move $v1, $a1 -/* 0D7928 8031C928 AFA50038 */ sw $a1, 0x38($sp) -/* 0D792C 8031C92C 02402025 */ move $a0, $s2 -/* 0D7930 8031C930 0C0C6A48 */ jal seq_channel_set_layer -/* 0D7934 8031C934 A7A2005A */ sh $v0, 0x5a($sp) -/* 0D7938 8031C938 8FA30038 */ lw $v1, 0x38($sp) -/* 0D793C 8031C93C 1440FE23 */ bnez $v0, .L8031C1CC -/* 0D7940 8031C940 97A7005A */ lhu $a3, 0x5a($sp) -/* 0D7944 8031C944 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D7948 8031C948 0003C880 */ sll $t9, $v1, 2 -/* 0D794C 8031C94C 02597021 */ addu $t6, $s2, $t9 -/* 0D7950 8031C950 8DCA0044 */ lw $t2, 0x44($t6) -/* 0D7954 8031C954 01A77821 */ addu $t7, $t5, $a3 -/* 0D7958 8031C958 1000FE1C */ b .L8031C1CC -/* 0D795C 8031C95C AD4F0054 */ sw $t7, 0x54($t2) -glabel L8031C960 -/* 0D7960 8031C960 02202825 */ move $a1, $s1 -/* 0D7964 8031C964 30AB000F */ andi $t3, $a1, 0xf -/* 0D7968 8031C968 01602825 */ move $a1, $t3 -/* 0D796C 8031C96C 0C0C6A93 */ jal seq_channel_layer_free -/* 0D7970 8031C970 02402025 */ move $a0, $s2 -/* 0D7974 8031C974 1000FE15 */ b .L8031C1CC -/* 0D7978 8031C978 00000000 */ nop -glabel L8031C97C -/* 0D797C 8031C97C 1275FE13 */ beq $s3, $s5, .L8031C1CC -/* 0D7980 8031C980 02402025 */ move $a0, $s2 -/* 0D7984 8031C984 02201825 */ move $v1, $s1 -/* 0D7988 8031C988 3065000F */ andi $a1, $v1, 0xf -/* 0D798C 8031C98C 00A01825 */ move $v1, $a1 -/* 0D7990 8031C990 0C0C6A48 */ jal seq_channel_set_layer -/* 0D7994 8031C994 AFA50038 */ sw $a1, 0x38($sp) -/* 0D7998 8031C998 1055FE0C */ beq $v0, $s5, .L8031C1CC -/* 0D799C 8031C99C 8FA30038 */ lw $v1, 0x38($sp) -/* 0D79A0 8031C9A0 8E580030 */ lw $t8, 0x30($s2) -/* 0D79A4 8031C9A4 00136040 */ sll $t4, $s3, 1 -/* 0D79A8 8031C9A8 8E8A0014 */ lw $t2, 0x14($s4) -/* 0D79AC 8031C9AC 030C1021 */ addu $v0, $t8, $t4 -/* 0D79B0 8031C9B0 90590000 */ lbu $t9, ($v0) -/* 0D79B4 8031C9B4 904D0001 */ lbu $t5, 1($v0) -/* 0D79B8 8031C9B8 00034880 */ sll $t1, $v1, 2 -/* 0D79BC 8031C9BC 00197200 */ sll $t6, $t9, 8 -/* 0D79C0 8031C9C0 0249C021 */ addu $t8, $s2, $t1 -/* 0D79C4 8031C9C4 01AE3821 */ addu $a3, $t5, $t6 -/* 0D79C8 8031C9C8 8F0C0044 */ lw $t4, 0x44($t8) -/* 0D79CC 8031C9CC 30EFFFFF */ andi $t7, $a3, 0xffff -/* 0D79D0 8031C9D0 014F5821 */ addu $t3, $t2, $t7 -/* 0D79D4 8031C9D4 1000FDFD */ b .L8031C1CC -/* 0D79D8 8031C9D8 AD8B0054 */ sw $t3, 0x54($t4) -glabel L8031C9DC -/* 0D79DC 8031C9DC 1000FDFB */ b .L8031C1CC -/* 0D79E0 8031C9E0 A2440004 */ sb $a0, 4($s2) -glabel L8031C9E4 -/* 0D79E4 8031C9E4 0C0C6C0C */ jal m64_read_s16 -/* 0D79E8 8031C9E8 02002025 */ move $a0, $s0 -/* 0D79EC 8031C9EC 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D79F0 8031C9F0 02202825 */ move $a1, $s1 -/* 0D79F4 8031C9F4 30B9000F */ andi $t9, $a1, 0xf -/* 0D79F8 8031C9F8 304EFFFF */ andi $t6, $v0, 0xffff -/* 0D79FC 8031C9FC 03202825 */ move $a1, $t9 -/* 0D7A00 8031CA00 02802025 */ move $a0, $s4 -/* 0D7A04 8031CA04 0C0C6B60 */ jal sequence_channel_enable -/* 0D7A08 8031CA08 01AE3021 */ addu $a2, $t5, $t6 -/* 0D7A0C 8031CA0C 1000FDEF */ b .L8031C1CC -/* 0D7A10 8031CA10 00000000 */ nop -glabel L8031CA14 -/* 0D7A14 8031CA14 322A000F */ andi $t2, $s1, 0xf -/* 0D7A18 8031CA18 000A4880 */ sll $t1, $t2, 2 -/* 0D7A1C 8031CA1C 0289C021 */ addu $t8, $s4, $t1 -/* 0D7A20 8031CA20 0C0C6AB4 */ jal sequence_channel_disable -/* 0D7A24 8031CA24 8F04002C */ lw $a0, 0x2c($t8) -/* 0D7A28 8031CA28 1000FDE8 */ b .L8031C1CC -/* 0D7A2C 8031CA2C 00000000 */ nop -glabel L8031CA30 -/* 0D7A30 8031CA30 02002025 */ move $a0, $s0 -/* 0D7A34 8031CA34 0C0C6C07 */ jal m64_read_u8 -/* 0D7A38 8031CA38 A3A8005D */ sb $t0, 0x5d($sp) -/* 0D7A3C 8031CA3C 93A8005D */ lbu $t0, 0x5d($sp) -/* 0D7A40 8031CA40 00085880 */ sll $t3, $t0, 2 -/* 0D7A44 8031CA44 028B6021 */ addu $t4, $s4, $t3 -/* 0D7A48 8031CA48 8D99002C */ lw $t9, 0x2c($t4) -/* 0D7A4C 8031CA4C 03226821 */ addu $t5, $t9, $v0 -/* 0D7A50 8031CA50 1000FDDE */ b .L8031C1CC -/* 0D7A54 8031CA54 A1B30054 */ sb $s3, 0x54($t5) -glabel L8031CA58 -/* 0D7A58 8031CA58 02002025 */ move $a0, $s0 -/* 0D7A5C 8031CA5C 0C0C6C07 */ jal m64_read_u8 -/* 0D7A60 8031CA60 A3A8005D */ sb $t0, 0x5d($sp) -/* 0D7A64 8031CA64 93A8005D */ lbu $t0, 0x5d($sp) -/* 0D7A68 8031CA68 00087080 */ sll $t6, $t0, 2 -/* 0D7A6C 8031CA6C 028E7821 */ addu $t7, $s4, $t6 -/* 0D7A70 8031CA70 8DEA002C */ lw $t2, 0x2c($t7) -/* 0D7A74 8031CA74 01424821 */ addu $t1, $t2, $v0 -/* 0D7A78 8031CA78 1000FDD4 */ b .L8031C1CC -/* 0D7A7C 8031CA7C 81330054 */ lb $s3, 0x54($t1) -.L8031CA80: -/* 0D7A80 8031CA80 02408825 */ move $s1, $s2 -.L8031CA84: -/* 0D7A84 8031CA84 24120010 */ li $s2, 16 -/* 0D7A88 8031CA88 00008025 */ move $s0, $zero -.L8031CA8C: -/* 0D7A8C 8031CA8C 8E240044 */ lw $a0, 0x44($s1) -/* 0D7A90 8031CA90 50800004 */ beql $a0, $zero, .L8031CAA4 -/* 0D7A94 8031CA94 26100004 */ addiu $s0, $s0, 4 -/* 0D7A98 8031CA98 0C0C6C29 */ jal seq_channel_layer_process_script -/* 0D7A9C 8031CA9C 00000000 */ nop -/* 0D7AA0 8031CAA0 26100004 */ addiu $s0, $s0, 4 -.L8031CAA4: -/* 0D7AA4 8031CAA4 1612FFF9 */ bne $s0, $s2, .L8031CA8C -/* 0D7AA8 8031CAA8 26310004 */ addiu $s1, $s1, 4 -.L8031CAAC: -/* 0D7AAC 8031CAAC 8FBF0034 */ lw $ra, 0x34($sp) -.L8031CAB0: -/* 0D7AB0 8031CAB0 D7B40010 */ ldc1 $f20, 0x10($sp) -/* 0D7AB4 8031CAB4 8FB0001C */ lw $s0, 0x1c($sp) -/* 0D7AB8 8031CAB8 8FB10020 */ lw $s1, 0x20($sp) -/* 0D7ABC 8031CABC 8FB20024 */ lw $s2, 0x24($sp) -/* 0D7AC0 8031CAC0 8FB30028 */ lw $s3, 0x28($sp) -/* 0D7AC4 8031CAC4 8FB4002C */ lw $s4, 0x2c($sp) -/* 0D7AC8 8031CAC8 8FB50030 */ lw $s5, 0x30($sp) -/* 0D7ACC 8031CACC 03E00008 */ jr $ra -/* 0D7AD0 8031CAD0 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/asm/non_matchings/sequence_channel_process_script_us.s b/asm/non_matchings/sequence_channel_process_script_us.s deleted file mode 100644 index d64254d7fa..0000000000 --- a/asm/non_matchings/sequence_channel_process_script_us.s +++ /dev/null @@ -1,922 +0,0 @@ -.late_rodata -.late_rodata_alignment 8 -glabel jtbl_80337D08 # US: 80338EC0 - .word L_U_8031D3A8 - .word L_U_8031D354 - .word L_U_8031D3C4 - .word L_U_8031D3D4 - .word L_U_8031D370 - .word L_U_8031D5E4 - .word L_U_8031D640 - .word L_U_8031D678 - .word L_U_8031D678 - .word L_U_8031D6C4 - .word L_U_8031D6D4 - .word L_U_8031D678 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D6F4 - .word L_U_8031D718 - .word L_U_8031D728 - .word L_U_8031D44C - .word L_U_8031D5D4 - .word L_U_8031D144 - .word L_U_8031D5B4 - .word L_U_8031D51C - .word L_U_8031D500 - .word L_U_8031D4F0 - .word L_U_8031D4D4 - .word L_U_8031D4BC - .word L_U_8031D498 - .word L_U_8031D474 - .word L_U_8031D424 - .word L_U_8031D3E4 - .word L_U_8031D400 - .word L_U_8031D56C - .word L_U_8031D538 - .word L_U_8031D5A0 - .word L_U_8031D73C - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D344 - .word L_U_8031D31C - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D2C4 - .word L_U_8031D2B4 - .word L_U_8031D26C - .word L_U_8031D234 - .word L_U_8031D2C4 - .word L_U_8031D2C4 - .word L_U_8031D2C4 - .word L_U_8031D1F8 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - -glabel jtbl_80337E04 # US: 80338FBC - .word L_U_8031D7B8 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D900 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D930 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D94C - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D974 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D814 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D8F8 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D7E8 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D7F8 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D830 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D87C - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D144 - .word L_U_8031D898 - -.text -glabel sequence_channel_process_script -/* 0D808C 8031D08C 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0D8090 8031D090 AFBF002C */ sw $ra, 0x2c($sp) -/* 0D8094 8031D094 AFB50028 */ sw $s5, 0x28($sp) -/* 0D8098 8031D098 AFB40024 */ sw $s4, 0x24($sp) -/* 0D809C 8031D09C AFB30020 */ sw $s3, 0x20($sp) -/* 0D80A0 8031D0A0 AFB2001C */ sw $s2, 0x1c($sp) -/* 0D80A4 8031D0A4 AFB10018 */ sw $s1, 0x18($sp) -/* 0D80A8 8031D0A8 AFB00014 */ sw $s0, 0x14($sp) -/* 0D80AC 8031D0AC 8C820000 */ lw $v0, ($a0) -/* 0D80B0 8031D0B0 00809025 */ move $s2, $a0 -/* 0D80B4 8031D0B4 000277C2 */ srl $t6, $v0, 0x1f -/* 0D80B8 8031D0B8 11C00243 */ beqz $t6, .L8031D9C8 -/* 0D80BC 8031D0BC 0002C080 */ sll $t8, $v0, 2 -/* 0D80C0 8031D0C0 0701000D */ bgez $t8, .L8031D0F8 -/* 0D80C4 8031D0C4 00008025 */ move $s0, $zero -/* 0D80C8 8031D0C8 00808825 */ move $s1, $a0 -/* 0D80CC 8031D0CC 24120010 */ li $s2, 16 -.L8031D0D0: -/* 0D80D0 8031D0D0 8E240044 */ lw $a0, 0x44($s1) -/* 0D80D4 8031D0D4 50800004 */ beql $a0, $zero, .L8031D0E8 -/* 0D80D8 8031D0D8 26100004 */ addiu $s0, $s0, 4 -/* 0D80DC 8031D0DC 0C0C7031 */ jal seq_channel_layer_process_script -/* 0D80E0 8031D0E0 00000000 */ nop -/* 0D80E4 8031D0E4 26100004 */ addiu $s0, $s0, 4 -.L8031D0E8: -/* 0D80E8 8031D0E8 1612FFF9 */ bne $s0, $s2, .L8031D0D0 -/* 0D80EC 8031D0EC 26310004 */ addiu $s1, $s1, 4 -/* 0D80F0 8031D0F0 10000236 */ b .L8031D9CC -/* 0D80F4 8031D0F4 8FBF002C */ lw $ra, 0x2c($sp) -.L8031D0F8: -/* 0D80F8 8031D0F8 8E540040 */ lw $s4, 0x40($s2) -/* 0D80FC 8031D0FC 8E990000 */ lw $t9, ($s4) -/* 0D8100 8031D100 00195080 */ sll $t2, $t9, 2 -/* 0D8104 8031D104 05430006 */ bgezl $t2, .L8031D120 -/* 0D8108 8031D108 96430016 */ lhu $v1, 0x16($s2) -/* 0D810C 8031D10C 924B0002 */ lbu $t3, 2($s2) -/* 0D8110 8031D110 316C0080 */ andi $t4, $t3, 0x80 -/* 0D8114 8031D114 5580022D */ bnezl $t4, .L8031D9CC -/* 0D8118 8031D118 8FBF002C */ lw $ra, 0x2c($sp) -/* 0D811C 8031D11C 96430016 */ lhu $v1, 0x16($s2) -.L8031D120: -/* 0D8120 8031D120 2650005C */ addiu $s0, $s2, 0x5c -/* 0D8124 8031D124 2415FFFF */ li $s5, -1 -/* 0D8128 8031D128 10600004 */ beqz $v1, .L8031D13C -/* 0D812C 8031D12C 00601025 */ move $v0, $v1 -/* 0D8130 8031D130 246DFFFF */ addiu $t5, $v1, -1 -/* 0D8134 8031D134 A64D0016 */ sh $t5, 0x16($s2) -/* 0D8138 8031D138 31A2FFFF */ andi $v0, $t5, 0xffff -.L8031D13C: -/* 0D813C 8031D13C 14400217 */ bnez $v0, .L8031D99C -/* 0D8140 8031D140 83B3004B */ lb $s3, 0x4b($sp) -glabel L_U_8031D144 -.L8031D144: -/* 0D8144 8031D144 0C0C700F */ jal m64_read_u8 -/* 0D8148 8031D148 02002025 */ move $a0, $s0 -/* 0D814C 8031D14C 240100FF */ li $at, 255 -/* 0D8150 8031D150 305100FF */ andi $s1, $v0, 0xff -/* 0D8154 8031D154 1441000E */ bne $v0, $at, .L8031D190 -/* 0D8158 8031D158 00401825 */ move $v1, $v0 -/* 0D815C 8031D15C 92040018 */ lbu $a0, 0x18($s0) -/* 0D8160 8031D160 14800005 */ bnez $a0, .L8031D178 -/* 0D8164 8031D164 248EFFFF */ addiu $t6, $a0, -1 -/* 0D8168 8031D168 0C0C6EBC */ jal sequence_channel_disable -/* 0D816C 8031D16C 02402025 */ move $a0, $s2 -/* 0D8170 8031D170 1000020B */ b .L8031D9A0 -/* 0D8174 8031D174 02408825 */ move $s1, $s2 -.L8031D178: -/* 0D8178 8031D178 31CF00FF */ andi $t7, $t6, 0xff -/* 0D817C 8031D17C 000FC080 */ sll $t8, $t7, 2 -/* 0D8180 8031D180 0218C821 */ addu $t9, $s0, $t8 -/* 0D8184 8031D184 A20E0018 */ sb $t6, 0x18($s0) -/* 0D8188 8031D188 8F290004 */ lw $t1, 4($t9) -/* 0D818C 8031D18C AE090000 */ sw $t1, ($s0) -.L8031D190: -/* 0D8190 8031D190 240100FE */ li $at, 254 -/* 0D8194 8031D194 10610201 */ beq $v1, $at, .L8031D99C -/* 0D8198 8031D198 240100FD */ li $at, 253 -/* 0D819C 8031D19C 14610005 */ bne $v1, $at, .L8031D1B4 -/* 0D81A0 8031D1A0 307900F0 */ andi $t9, $v1, 0xf0 -/* 0D81A4 8031D1A4 0C0C7020 */ jal m64_read_compressed_u16 -/* 0D81A8 8031D1A8 02002025 */ move $a0, $s0 -/* 0D81AC 8031D1AC 100001FB */ b .L8031D99C -/* 0D81B0 8031D1B0 A6420016 */ sh $v0, 0x16($s2) -.L8031D1B4: -/* 0D81B4 8031D1B4 240100F3 */ li $at, 243 -/* 0D81B8 8031D1B8 14610005 */ bne $v1, $at, .L8031D1D0 -/* 0D81BC 8031D1BC 246DFF3F */ addiu $t5, $v1, -0xc1 -/* 0D81C0 8031D1C0 924B0000 */ lbu $t3, ($s2) -/* 0D81C4 8031D1C4 356C0020 */ ori $t4, $t3, 0x20 -/* 0D81C8 8031D1C8 100001F4 */ b .L8031D99C -/* 0D81CC 8031D1CC A24C0000 */ sb $t4, ($s2) -.L8031D1D0: -/* 0D81D0 8031D1D0 286100C1 */ slti $at, $v1, 0xc1 -/* 0D81D4 8031D1D4 1420016E */ bnez $at, .L8031D790 -/* 0D81D8 8031D1D8 2DA1003F */ sltiu $at, $t5, 0x3f -/* 0D81DC 8031D1DC 1020FFD9 */ beqz $at, .L8031D144 -/* 0D81E0 8031D1E0 000D6880 */ sll $t5, $t5, 2 -/* 0D81E4 8031D1E4 3C018034 */ lui $at, %hi(jtbl_80337D08) -/* 0D81E8 8031D1E8 002D0821 */ addu $at, $at, $t5 -/* 0D81EC 8031D1EC 8C2D8EC0 */ lw $t5, %lo(jtbl_80337D08)($at) -/* 0D81F0 8031D1F0 01A00008 */ jr $t5 -/* 0D81F4 8031D1F4 00000000 */ nop -glabel L_U_8031D1F8 -/* 0D81F8 8031D1F8 0C0C7014 */ jal m64_read_s16 -/* 0D81FC 8031D1FC 02002025 */ move $a0, $s0 -/* 0D8200 8031D200 920E0018 */ lbu $t6, 0x18($s0) -/* 0D8204 8031D204 8E180000 */ lw $t8, ($s0) -/* 0D8208 8031D208 304CFFFF */ andi $t4, $v0, 0xffff -/* 0D820C 8031D20C 25CF0001 */ addiu $t7, $t6, 1 -/* 0D8210 8031D210 31F900FF */ andi $t9, $t7, 0xff -/* 0D8214 8031D214 00194880 */ sll $t1, $t9, 2 -/* 0D8218 8031D218 02095021 */ addu $t2, $s0, $t1 -/* 0D821C 8031D21C A20F0018 */ sb $t7, 0x18($s0) -/* 0D8220 8031D220 AD580000 */ sw $t8, ($t2) -/* 0D8224 8031D224 8E8B0014 */ lw $t3, 0x14($s4) -/* 0D8228 8031D228 016C6821 */ addu $t5, $t3, $t4 -/* 0D822C 8031D22C 1000FFC5 */ b .L8031D144 -/* 0D8230 8031D230 AE0D0000 */ sw $t5, ($s0) -glabel L_U_8031D234 -/* 0D8234 8031D234 0C0C700F */ jal m64_read_u8 -/* 0D8238 8031D238 02002025 */ move $a0, $s0 -/* 0D823C 8031D23C 920E0018 */ lbu $t6, 0x18($s0) -/* 0D8240 8031D240 020E7821 */ addu $t7, $s0, $t6 -/* 0D8244 8031D244 A1E20014 */ sb $v0, 0x14($t7) -/* 0D8248 8031D248 92190018 */ lbu $t9, 0x18($s0) -/* 0D824C 8031D24C 8E180000 */ lw $t8, ($s0) -/* 0D8250 8031D250 27290001 */ addiu $t1, $t9, 1 -/* 0D8254 8031D254 312A00FF */ andi $t2, $t1, 0xff -/* 0D8258 8031D258 000A5880 */ sll $t3, $t2, 2 -/* 0D825C 8031D25C 020B6021 */ addu $t4, $s0, $t3 -/* 0D8260 8031D260 A2090018 */ sb $t1, 0x18($s0) -/* 0D8264 8031D264 1000FFB7 */ b .L8031D144 -/* 0D8268 8031D268 AD980000 */ sw $t8, ($t4) -glabel L_U_8031D26C -/* 0D826C 8031D26C 920D0018 */ lbu $t5, 0x18($s0) -/* 0D8270 8031D270 020D1021 */ addu $v0, $s0, $t5 -/* 0D8274 8031D274 904E0013 */ lbu $t6, 0x13($v0) -/* 0D8278 8031D278 25CFFFFF */ addiu $t7, $t6, -1 -/* 0D827C 8031D27C A04F0013 */ sb $t7, 0x13($v0) -/* 0D8280 8031D280 92040018 */ lbu $a0, 0x18($s0) -/* 0D8284 8031D284 0204C821 */ addu $t9, $s0, $a0 -/* 0D8288 8031D288 93290013 */ lbu $t1, 0x13($t9) -/* 0D828C 8031D28C 00801825 */ move $v1, $a0 -/* 0D8290 8031D290 00035080 */ sll $t2, $v1, 2 -/* 0D8294 8031D294 11200005 */ beqz $t1, .L8031D2AC -/* 0D8298 8031D298 248CFFFF */ addiu $t4, $a0, -1 -/* 0D829C 8031D29C 020A5821 */ addu $t3, $s0, $t2 -/* 0D82A0 8031D2A0 8D780000 */ lw $t8, ($t3) -/* 0D82A4 8031D2A4 1000FFA7 */ b .L8031D144 -/* 0D82A8 8031D2A8 AE180000 */ sw $t8, ($s0) -.L8031D2AC: -/* 0D82AC 8031D2AC 1000FFA5 */ b .L8031D144 -/* 0D82B0 8031D2B0 A20C0018 */ sb $t4, 0x18($s0) -glabel L_U_8031D2B4 -/* 0D82B4 8031D2B4 920D0018 */ lbu $t5, 0x18($s0) -/* 0D82B8 8031D2B8 25AEFFFF */ addiu $t6, $t5, -1 -/* 0D82BC 8031D2BC 1000FFA1 */ b .L8031D144 -/* 0D82C0 8031D2C0 A20E0018 */ sb $t6, 0x18($s0) -glabel L_U_8031D2C4 -/* 0D82C4 8031D2C4 0C0C7014 */ jal m64_read_s16 -/* 0D82C8 8031D2C8 02002025 */ move $a0, $s0 -/* 0D82CC 8031D2CC 240100FA */ li $at, 250 -/* 0D82D0 8031D2D0 16210003 */ bne $s1, $at, .L8031D2E0 -/* 0D82D4 8031D2D4 02201825 */ move $v1, $s1 -/* 0D82D8 8031D2D8 1660FF9A */ bnez $s3, .L8031D144 -/* 0D82DC 8031D2DC 00000000 */ nop -.L8031D2E0: -/* 0D82E0 8031D2E0 240100F9 */ li $at, 249 -/* 0D82E4 8031D2E4 54610004 */ bnel $v1, $at, .L8031D2F8 -/* 0D82E8 8031D2E8 240100F5 */ li $at, 245 -/* 0D82EC 8031D2EC 0661FF95 */ bgez $s3, .L8031D144 -/* 0D82F0 8031D2F0 00000000 */ nop -/* 0D82F4 8031D2F4 240100F5 */ li $at, 245 -.L8031D2F8: -/* 0D82F8 8031D2F8 54610004 */ bnel $v1, $at, .L8031D30C -/* 0D82FC 8031D2FC 8E8F0014 */ lw $t7, 0x14($s4) -/* 0D8300 8031D300 0660FF90 */ bltz $s3, .L8031D144 -/* 0D8304 8031D304 00000000 */ nop -/* 0D8308 8031D308 8E8F0014 */ lw $t7, 0x14($s4) -.L8031D30C: -/* 0D830C 8031D30C 3059FFFF */ andi $t9, $v0, 0xffff -/* 0D8310 8031D310 01F94821 */ addu $t1, $t7, $t9 -/* 0D8314 8031D314 1000FF8B */ b .L8031D144 -/* 0D8318 8031D318 AE090000 */ sw $t1, ($s0) -glabel L_U_8031D31C -/* 0D831C 8031D31C 26510080 */ addiu $s1, $s2, 0x80 -/* 0D8320 8031D320 0C0C68DA */ jal note_pool_clear -/* 0D8324 8031D324 02202025 */ move $a0, $s1 -/* 0D8328 8031D328 0C0C700F */ jal m64_read_u8 -/* 0D832C 8031D32C 02002025 */ move $a0, $s0 -/* 0D8330 8031D330 02202025 */ move $a0, $s1 -/* 0D8334 8031D334 0C0C6925 */ jal note_pool_fill -/* 0D8338 8031D338 00402825 */ move $a1, $v0 -/* 0D833C 8031D33C 1000FF81 */ b .L8031D144 -/* 0D8340 8031D340 00000000 */ nop -glabel L_U_8031D344 -/* 0D8344 8031D344 0C0C68DA */ jal note_pool_clear -/* 0D8348 8031D348 26440080 */ addiu $a0, $s2, 0x80 -/* 0D834C 8031D34C 1000FF7D */ b .L8031D144 -/* 0D8350 8031D350 00000000 */ nop -glabel L_U_8031D354 -/* 0D8354 8031D354 0C0C7014 */ jal m64_read_s16 -/* 0D8358 8031D358 02002025 */ move $a0, $s0 -/* 0D835C 8031D35C 8E8A0014 */ lw $t2, 0x14($s4) -/* 0D8360 8031D360 304BFFFF */ andi $t3, $v0, 0xffff -/* 0D8364 8031D364 014BC021 */ addu $t8, $t2, $t3 -/* 0D8368 8031D368 1000FF76 */ b .L8031D144 -/* 0D836C 8031D36C AE580030 */ sw $t8, 0x30($s2) -glabel L_U_8031D370 -/* 0D8370 8031D370 1275FF74 */ beq $s3, $s5, .L8031D144 -/* 0D8374 8031D374 00000000 */ nop -/* 0D8378 8031D378 8E4C0030 */ lw $t4, 0x30($s2) -/* 0D837C 8031D37C 00136840 */ sll $t5, $s3, 1 -/* 0D8380 8031D380 8E8A0014 */ lw $t2, 0x14($s4) -/* 0D8384 8031D384 018D1021 */ addu $v0, $t4, $t5 -/* 0D8388 8031D388 904F0000 */ lbu $t7, ($v0) -/* 0D838C 8031D38C 904E0001 */ lbu $t6, 1($v0) -/* 0D8390 8031D390 000FCA00 */ sll $t9, $t7, 8 -/* 0D8394 8031D394 01D93821 */ addu $a3, $t6, $t9 -/* 0D8398 8031D398 30E9FFFF */ andi $t1, $a3, 0xffff -/* 0D839C 8031D39C 01495821 */ addu $t3, $t2, $t1 -/* 0D83A0 8031D3A0 1000FF68 */ b .L8031D144 -/* 0D83A4 8031D3A4 AE4B0030 */ sw $t3, 0x30($s2) -glabel L_U_8031D3A8 -/* 0D83A8 8031D3A8 0C0C700F */ jal m64_read_u8 -/* 0D83AC 8031D3AC 02002025 */ move $a0, $s0 -/* 0D83B0 8031D3B0 02402025 */ move $a0, $s2 -/* 0D83B4 8031D3B4 0C0C73F5 */ jal set_instrument -/* 0D83B8 8031D3B8 304500FF */ andi $a1, $v0, 0xff -/* 0D83BC 8031D3BC 1000FF61 */ b .L8031D144 -/* 0D83C0 8031D3C0 00000000 */ nop -glabel L_U_8031D3C4 -/* 0D83C4 8031D3C4 92580000 */ lbu $t8, ($s2) -/* 0D83C8 8031D3C8 330CFFFD */ andi $t4, $t8, 0xfffd -/* 0D83CC 8031D3CC 1000FF5D */ b .L8031D144 -/* 0D83D0 8031D3D0 A24C0000 */ sb $t4, ($s2) -glabel L_U_8031D3D4 -/* 0D83D4 8031D3D4 924F0000 */ lbu $t7, ($s2) -/* 0D83D8 8031D3D8 35EE0002 */ ori $t6, $t7, 2 -/* 0D83DC 8031D3DC 1000FF59 */ b .L8031D144 -/* 0D83E0 8031D3E0 A24E0000 */ sb $t6, ($s2) -glabel L_U_8031D3E4 -/* 0D83E4 8031D3E4 0C0C700F */ jal m64_read_u8 -/* 0D83E8 8031D3E8 02002025 */ move $a0, $s0 -/* 0D83EC 8031D3EC 02402025 */ move $a0, $s2 -/* 0D83F0 8031D3F0 0C0C741A */ jal sequence_channel_set_volume -/* 0D83F4 8031D3F4 304500FF */ andi $a1, $v0, 0xff -/* 0D83F8 8031D3F8 1000FF52 */ b .L8031D144 -/* 0D83FC 8031D3FC 00000000 */ nop -glabel L_U_8031D400 -/* 0D8400 8031D400 0C0C700F */ jal m64_read_u8 -/* 0D8404 8031D404 02002025 */ move $a0, $s0 -/* 0D8408 8031D408 44822000 */ mtc1 $v0, $f4 -/* 0D840C 8031D40C 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 0D8410 8031D410 44814000 */ mtc1 $at, $f8 -/* 0D8414 8031D414 468021A0 */ cvt.s.w $f6, $f4 -/* 0D8418 8031D418 46083282 */ mul.s $f10, $f6, $f8 -/* 0D841C 8031D41C 1000FF49 */ b .L8031D144 -/* 0D8420 8031D420 E64A001C */ swc1 $f10, 0x1c($s2) -glabel L_U_8031D424 -/* 0D8424 8031D424 0C0C7014 */ jal m64_read_s16 -/* 0D8428 8031D428 02002025 */ move $a0, $s0 -/* 0D842C 8031D42C 3059FFFF */ andi $t9, $v0, 0xffff -/* 0D8430 8031D430 44998000 */ mtc1 $t9, $f16 -/* 0D8434 8031D434 3C014700 */ li $at, 0x47000000 # 32768.000000 -/* 0D8438 8031D438 44812000 */ mtc1 $at, $f4 -/* 0D843C 8031D43C 468084A0 */ cvt.s.w $f18, $f16 -/* 0D8440 8031D440 46049183 */ div.s $f6, $f18, $f4 -/* 0D8444 8031D444 1000FF3F */ b .L8031D144 -/* 0D8448 8031D448 E646002C */ swc1 $f6, 0x2c($s2) -glabel L_U_8031D44C -/* 0D844C 8031D44C 0C0C700F */ jal m64_read_u8 -/* 0D8450 8031D450 02002025 */ move $a0, $s0 -/* 0D8454 8031D454 2449007F */ addiu $t1, $v0, 0x7f -/* 0D8458 8031D458 312A00FF */ andi $t2, $t1, 0xff -/* 0D845C 8031D45C 000A5880 */ sll $t3, $t2, 2 -/* 0D8460 8031D460 3C018033 */ lui $at, %hi(gPitchBendFrequencyScale) -/* 0D8464 8031D464 002B0821 */ addu $at, $at, $t3 -/* 0D8468 8031D468 C4283598 */ lwc1 $f8, %lo(gPitchBendFrequencyScale)($at) -/* 0D846C 8031D46C 1000FF35 */ b .L8031D144 -/* 0D8470 8031D470 E648002C */ swc1 $f8, 0x2c($s2) -glabel L_U_8031D474 -/* 0D8474 8031D474 0C0C700F */ jal m64_read_u8 -/* 0D8478 8031D478 02002025 */ move $a0, $s0 -/* 0D847C 8031D47C 44825000 */ mtc1 $v0, $f10 -/* 0D8480 8031D480 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 0D8484 8031D484 44819000 */ mtc1 $at, $f18 -/* 0D8488 8031D488 46805420 */ cvt.s.w $f16, $f10 -/* 0D848C 8031D48C 46128102 */ mul.s $f4, $f16, $f18 -/* 0D8490 8031D490 1000FF2C */ b .L8031D144 -/* 0D8494 8031D494 E6440024 */ swc1 $f4, 0x24($s2) -glabel L_U_8031D498 -/* 0D8498 8031D498 0C0C700F */ jal m64_read_u8 -/* 0D849C 8031D49C 02002025 */ move $a0, $s0 -/* 0D84A0 8031D4A0 44823000 */ mtc1 $v0, $f6 -/* 0D84A4 8031D4A4 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 0D84A8 8031D4A8 44815000 */ mtc1 $at, $f10 -/* 0D84AC 8031D4AC 46803220 */ cvt.s.w $f8, $f6 -/* 0D84B0 8031D4B0 460A4402 */ mul.s $f16, $f8, $f10 -/* 0D84B4 8031D4B4 1000FF23 */ b .L8031D144 -/* 0D84B8 8031D4B8 E6500028 */ swc1 $f16, 0x28($s2) -glabel L_U_8031D4BC -/* 0D84BC 8031D4BC 8E020000 */ lw $v0, ($s0) -/* 0D84C0 8031D4C0 80430000 */ lb $v1, ($v0) -/* 0D84C4 8031D4C4 24580001 */ addiu $t8, $v0, 1 -/* 0D84C8 8031D4C8 AE180000 */ sw $t8, ($s0) -/* 0D84CC 8031D4CC 1000FF1D */ b .L8031D144 -/* 0D84D0 8031D4D0 A643001A */ sh $v1, 0x1a($s2) -glabel L_U_8031D4D4 -/* 0D84D4 8031D4D4 0C0C7014 */ jal m64_read_s16 -/* 0D84D8 8031D4D8 02002025 */ move $a0, $s0 -/* 0D84DC 8031D4DC 8E8C0014 */ lw $t4, 0x14($s4) -/* 0D84E0 8031D4E0 304DFFFF */ andi $t5, $v0, 0xffff -/* 0D84E4 8031D4E4 018D7821 */ addu $t7, $t4, $t5 -/* 0D84E8 8031D4E8 1000FF16 */ b .L8031D144 -/* 0D84EC 8031D4EC AE4F007C */ sw $t7, 0x7c($s2) -glabel L_U_8031D4F0 -/* 0D84F0 8031D4F0 0C0C700F */ jal m64_read_u8 -/* 0D84F4 8031D4F4 02002025 */ move $a0, $s0 -/* 0D84F8 8031D4F8 1000FF12 */ b .L8031D144 -/* 0D84FC 8031D4FC A2420078 */ sb $v0, 0x78($s2) -glabel L_U_8031D500 -/* 0D8500 8031D500 0C0C700F */ jal m64_read_u8 -/* 0D8504 8031D504 02002025 */ move $a0, $s0 -/* 0D8508 8031D508 000270C0 */ sll $t6, $v0, 3 -/* 0D850C 8031D50C A64E000E */ sh $t6, 0xe($s2) -/* 0D8510 8031D510 A640000A */ sh $zero, 0xa($s2) -/* 0D8514 8031D514 1000FF0B */ b .L8031D144 -/* 0D8518 8031D518 A6400012 */ sh $zero, 0x12($s2) -glabel L_U_8031D51C -/* 0D851C 8031D51C 0C0C700F */ jal m64_read_u8 -/* 0D8520 8031D520 02002025 */ move $a0, $s0 -/* 0D8524 8031D524 00021940 */ sll $v1, $v0, 5 -/* 0D8528 8031D528 A643000C */ sh $v1, 0xc($s2) -/* 0D852C 8031D52C A6430008 */ sh $v1, 8($s2) -/* 0D8530 8031D530 1000FF04 */ b .L8031D144 -/* 0D8534 8031D534 A6400010 */ sh $zero, 0x10($s2) -glabel L_U_8031D538 -/* 0D8538 8031D538 0C0C700F */ jal m64_read_u8 -/* 0D853C 8031D53C 02002025 */ move $a0, $s0 -/* 0D8540 8031D540 0002C8C0 */ sll $t9, $v0, 3 -/* 0D8544 8031D544 A659000A */ sh $t9, 0xa($s2) -/* 0D8548 8031D548 0C0C700F */ jal m64_read_u8 -/* 0D854C 8031D54C 02002025 */ move $a0, $s0 -/* 0D8550 8031D550 000248C0 */ sll $t1, $v0, 3 -/* 0D8554 8031D554 A649000E */ sh $t1, 0xe($s2) -/* 0D8558 8031D558 0C0C700F */ jal m64_read_u8 -/* 0D855C 8031D55C 02002025 */ move $a0, $s0 -/* 0D8560 8031D560 00025100 */ sll $t2, $v0, 4 -/* 0D8564 8031D564 1000FEF7 */ b .L8031D144 -/* 0D8568 8031D568 A64A0012 */ sh $t2, 0x12($s2) -glabel L_U_8031D56C -/* 0D856C 8031D56C 0C0C700F */ jal m64_read_u8 -/* 0D8570 8031D570 02002025 */ move $a0, $s0 -/* 0D8574 8031D574 00025940 */ sll $t3, $v0, 5 -/* 0D8578 8031D578 A64B0008 */ sh $t3, 8($s2) -/* 0D857C 8031D57C 0C0C700F */ jal m64_read_u8 -/* 0D8580 8031D580 02002025 */ move $a0, $s0 -/* 0D8584 8031D584 0002C140 */ sll $t8, $v0, 5 -/* 0D8588 8031D588 A658000C */ sh $t8, 0xc($s2) -/* 0D858C 8031D58C 0C0C700F */ jal m64_read_u8 -/* 0D8590 8031D590 02002025 */ move $a0, $s0 -/* 0D8594 8031D594 00026100 */ sll $t4, $v0, 4 -/* 0D8598 8031D598 1000FEEA */ b .L8031D144 -/* 0D859C 8031D59C A64C0010 */ sh $t4, 0x10($s2) -glabel L_U_8031D5A0 -/* 0D85A0 8031D5A0 0C0C700F */ jal m64_read_u8 -/* 0D85A4 8031D5A4 02002025 */ move $a0, $s0 -/* 0D85A8 8031D5A8 00026900 */ sll $t5, $v0, 4 -/* 0D85AC 8031D5AC 1000FEE5 */ b .L8031D144 -/* 0D85B0 8031D5B0 A64D0014 */ sh $t5, 0x14($s2) -glabel L_U_8031D5B4 -/* 0D85B4 8031D5B4 0C0C700F */ jal m64_read_u8 -/* 0D85B8 8031D5B8 02002025 */ move $a0, $s0 -/* 0D85BC 8031D5BC 14400003 */ bnez $v0, .L8031D5CC -/* 0D85C0 8031D5C0 305100FF */ andi $s1, $v0, 0xff -/* 0D85C4 8031D5C4 3C118022 */ lui $s1, %hi(gAudioUpdatesPerFrame) # $s1, 0x8022 -/* 0D85C8 8031D5C8 92316B7E */ lbu $s1, %lo(gAudioUpdatesPerFrame)($s1) -.L8031D5CC: -/* 0D85CC 8031D5CC 1000FEDD */ b .L8031D144 -/* 0D85D0 8031D5D0 A2510006 */ sb $s1, 6($s2) -glabel L_U_8031D5D4 -/* 0D85D4 8031D5D4 0C0C700F */ jal m64_read_u8 -/* 0D85D8 8031D5D8 02002025 */ move $a0, $s0 -/* 0D85DC 8031D5DC 1000FED9 */ b .L8031D144 -/* 0D85E0 8031D5E0 A2420003 */ sb $v0, 3($s2) -glabel L_U_8031D5E4 -/* 0D85E4 8031D5E4 0C0C700F */ jal m64_read_u8 -/* 0D85E8 8031D5E8 02002025 */ move $a0, $s0 -/* 0D85EC 8031D5EC 928F0005 */ lbu $t7, 5($s4) -/* 0D85F0 8031D5F0 3C038022 */ lui $v1, %hi(gAlBankSets) # $v1, 0x8022 -/* 0D85F4 8031D5F4 8C636B58 */ lw $v1, %lo(gAlBankSets)($v1) -/* 0D85F8 8031D5F8 000F7040 */ sll $t6, $t7, 1 -/* 0D85FC 8031D5FC 3C048022 */ lui $a0, %hi(gBankLoadedPool) # $a0, 0x8022 -/* 0D8600 8031D600 006EC821 */ addu $t9, $v1, $t6 -/* 0D8604 8031D604 97270000 */ lhu $a3, ($t9) -/* 0D8608 8031D608 248410F8 */ addiu $a0, %lo(gBankLoadedPool) # addiu $a0, $a0, 0x10f8 -/* 0D860C 8031D60C 24050002 */ li $a1, 2 -/* 0D8610 8031D610 00E34821 */ addu $t1, $a3, $v1 -/* 0D8614 8031D614 91280000 */ lbu $t0, ($t1) -/* 0D8618 8031D618 00E85021 */ addu $t2, $a3, $t0 -/* 0D861C 8031D61C 01425823 */ subu $t3, $t2, $v0 -/* 0D8620 8031D620 0163C021 */ addu $t8, $t3, $v1 -/* 0D8624 8031D624 93110000 */ lbu $s1, ($t8) -/* 0D8628 8031D628 0C0C5E0B */ jal get_bank_or_seq -/* 0D862C 8031D62C 02203025 */ move $a2, $s1 -/* 0D8630 8031D630 1040FEC4 */ beqz $v0, .L8031D144 -/* 0D8634 8031D634 00000000 */ nop -/* 0D8638 8031D638 1000FEC2 */ b .L8031D144 -/* 0D863C 8031D63C A2510005 */ sb $s1, 5($s2) -glabel L_U_8031D640 -/* 0D8640 8031D640 326C00FF */ andi $t4, $s3, 0xff -/* 0D8644 8031D644 AFAC0030 */ sw $t4, 0x30($sp) -/* 0D8648 8031D648 0C0C700F */ jal m64_read_u8 -/* 0D864C 8031D64C 02002025 */ move $a0, $s0 -/* 0D8650 8031D650 305100FF */ andi $s1, $v0, 0xff -/* 0D8654 8031D654 0C0C7014 */ jal m64_read_s16 -/* 0D8658 8031D658 02002025 */ move $a0, $s0 -/* 0D865C 8031D65C 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D8660 8031D660 8FAE0030 */ lw $t6, 0x30($sp) -/* 0D8664 8031D664 304FFFFF */ andi $t7, $v0, 0xffff -/* 0D8668 8031D668 01AF1821 */ addu $v1, $t5, $t7 -/* 0D866C 8031D66C 01D1C821 */ addu $t9, $t6, $s1 -/* 0D8670 8031D670 1000FEB4 */ b .L8031D144 -/* 0D8674 8031D674 A0790000 */ sb $t9, ($v1) -glabel L_U_8031D678 -/* 0D8678 8031D678 0C0C700F */ jal m64_read_u8 -/* 0D867C 8031D67C 02002025 */ move $a0, $s0 -/* 0D8680 8031D680 240100C8 */ li $at, 200 -/* 0D8684 8031D684 16210005 */ bne $s1, $at, .L8031D69C -/* 0D8688 8031D688 02201825 */ move $v1, $s1 -/* 0D868C 8031D68C 02629823 */ subu $s3, $s3, $v0 -/* 0D8690 8031D690 00135E00 */ sll $t3, $s3, 0x18 -/* 0D8694 8031D694 1000FEAB */ b .L8031D144 -/* 0D8698 8031D698 000B9E03 */ sra $s3, $t3, 0x18 -.L8031D69C: -/* 0D869C 8031D69C 240100CC */ li $at, 204 -/* 0D86A0 8031D6A0 14610005 */ bne $v1, $at, .L8031D6B8 -/* 0D86A4 8031D6A4 02629824 */ and $s3, $s3, $v0 -/* 0D86A8 8031D6A8 00029E00 */ sll $s3, $v0, 0x18 -/* 0D86AC 8031D6AC 00136603 */ sra $t4, $s3, 0x18 -/* 0D86B0 8031D6B0 1000FEA4 */ b .L8031D144 -/* 0D86B4 8031D6B4 01809825 */ move $s3, $t4 -.L8031D6B8: -/* 0D86B8 8031D6B8 00137600 */ sll $t6, $s3, 0x18 -/* 0D86BC 8031D6BC 1000FEA1 */ b .L8031D144 -/* 0D86C0 8031D6C0 000E9E03 */ sra $s3, $t6, 0x18 -glabel L_U_8031D6C4 -/* 0D86C4 8031D6C4 0C0C700F */ jal m64_read_u8 -/* 0D86C8 8031D6C8 02002025 */ move $a0, $s0 -/* 0D86CC 8031D6CC 1000FE9D */ b .L8031D144 -/* 0D86D0 8031D6D0 A2420002 */ sb $v0, 2($s2) -glabel L_U_8031D6D4 -/* 0D86D4 8031D6D4 0C0C7014 */ jal m64_read_s16 -/* 0D86D8 8031D6D8 02002025 */ move $a0, $s0 -/* 0D86DC 8031D6DC 8E890014 */ lw $t1, 0x14($s4) -/* 0D86E0 8031D6E0 304AFFFF */ andi $t2, $v0, 0xffff -/* 0D86E4 8031D6E4 01535821 */ addu $t3, $t2, $s3 -/* 0D86E8 8031D6E8 012BC021 */ addu $t8, $t1, $t3 -/* 0D86EC 8031D6EC 1000FE95 */ b .L8031D144 -/* 0D86F0 8031D6F0 83130000 */ lb $s3, ($t8) -glabel L_U_8031D6F4 -/* 0D86F4 8031D6F4 0C0C700F */ jal m64_read_u8 -/* 0D86F8 8031D6F8 02002025 */ move $a0, $s0 -/* 0D86FC 8031D6FC 924E0000 */ lbu $t6, ($s2) -/* 0D8700 8031D700 00026880 */ sll $t5, $v0, 2 -/* 0D8704 8031D704 31AF0004 */ andi $t7, $t5, 4 -/* 0D8708 8031D708 31D9FFFB */ andi $t9, $t6, 0xfffb -/* 0D870C 8031D70C 01F95025 */ or $t2, $t7, $t9 -/* 0D8710 8031D710 1000FE8C */ b .L8031D144 -/* 0D8714 8031D714 A24A0000 */ sb $t2, ($s2) -glabel L_U_8031D718 -/* 0D8718 8031D718 0C0C700F */ jal m64_read_u8 -/* 0D871C 8031D71C 02002025 */ move $a0, $s0 -/* 0D8720 8031D720 1000FE88 */ b .L8031D144 -/* 0D8724 8031D724 A2420001 */ sb $v0, 1($s2) -glabel L_U_8031D728 -/* 0D8728 8031D728 0C0C700F */ jal m64_read_u8 -/* 0D872C 8031D72C 02002025 */ move $a0, $s0 -/* 0D8730 8031D730 00024A00 */ sll $t1, $v0, 8 -/* 0D8734 8031D734 1000FE83 */ b .L8031D144 -/* 0D8738 8031D738 A649007A */ sh $t1, 0x7a($s2) -glabel L_U_8031D73C -/* 0D873C 8031D73C 1275FE81 */ beq $s3, $s5, .L8031D144 -/* 0D8740 8031D740 0013C040 */ sll $t8, $s3, 1 -/* 0D8744 8031D744 920C0018 */ lbu $t4, 0x18($s0) -/* 0D8748 8031D748 8E4B0030 */ lw $t3, 0x30($s2) -/* 0D874C 8031D74C 8E0E0000 */ lw $t6, ($s0) -/* 0D8750 8031D750 258D0001 */ addiu $t5, $t4, 1 -/* 0D8754 8031D754 31AF00FF */ andi $t7, $t5, 0xff -/* 0D8758 8031D758 000FC880 */ sll $t9, $t7, 2 -/* 0D875C 8031D75C 02195021 */ addu $t2, $s0, $t9 -/* 0D8760 8031D760 A20D0018 */ sb $t5, 0x18($s0) -/* 0D8764 8031D764 01781021 */ addu $v0, $t3, $t8 -/* 0D8768 8031D768 AD4E0000 */ sw $t6, ($t2) -/* 0D876C 8031D76C 904B0000 */ lbu $t3, ($v0) -/* 0D8770 8031D770 90490001 */ lbu $t1, 1($v0) -/* 0D8774 8031D774 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D8778 8031D778 000BC200 */ sll $t8, $t3, 8 -/* 0D877C 8031D77C 01383821 */ addu $a3, $t1, $t8 -/* 0D8780 8031D780 30ECFFFF */ andi $t4, $a3, 0xffff -/* 0D8784 8031D784 01AC7821 */ addu $t7, $t5, $t4 -/* 0D8788 8031D788 1000FE6E */ b .L8031D144 -/* 0D878C 8031D78C AE0F0000 */ sw $t7, ($s0) -.L8031D790: -/* 0D8790 8031D790 3064000F */ andi $a0, $v1, 0xf -/* 0D8794 8031D794 2F2100B1 */ sltiu $at, $t9, 0xb1 -/* 0D8798 8031D798 1020FE6A */ beqz $at, .L8031D144 -/* 0D879C 8031D79C 308800FF */ andi $t0, $a0, 0xff -/* 0D87A0 8031D7A0 0019C880 */ sll $t9, $t9, 2 -/* 0D87A4 8031D7A4 3C018034 */ lui $at, %hi(jtbl_80337E04) -/* 0D87A8 8031D7A8 00390821 */ addu $at, $at, $t9 -/* 0D87AC 8031D7AC 8C398FBC */ lw $t9, %lo(jtbl_80337E04)($at) -/* 0D87B0 8031D7B0 03200008 */ jr $t9 -/* 0D87B4 8031D7B4 00000000 */ nop -glabel L_U_8031D7B8 -/* 0D87B8 8031D7B8 308E00FF */ andi $t6, $a0, 0xff -/* 0D87BC 8031D7BC 000E5080 */ sll $t2, $t6, 2 -/* 0D87C0 8031D7C0 024A5821 */ addu $t3, $s2, $t2 -/* 0D87C4 8031D7C4 8D630044 */ lw $v1, 0x44($t3) -/* 0D87C8 8031D7C8 1060FE5E */ beqz $v1, .L8031D144 -/* 0D87CC 8031D7CC 00000000 */ nop -/* 0D87D0 8031D7D0 8C730000 */ lw $s3, ($v1) -/* 0D87D4 8031D7D4 00134840 */ sll $t1, $s3, 1 -/* 0D87D8 8031D7D8 0009C7C2 */ srl $t8, $t1, 0x1f -/* 0D87DC 8031D7DC 00186600 */ sll $t4, $t8, 0x18 -/* 0D87E0 8031D7E0 1000FE58 */ b .L8031D144 -/* 0D87E4 8031D7E4 000C9E03 */ sra $s3, $t4, 0x18 -glabel L_U_8031D7E8 -/* 0D87E8 8031D7E8 308F00FF */ andi $t7, $a0, 0xff -/* 0D87EC 8031D7EC 024FC821 */ addu $t9, $s2, $t7 -/* 0D87F0 8031D7F0 1000FE54 */ b .L8031D144 -/* 0D87F4 8031D7F4 A3330054 */ sb $s3, 0x54($t9) -glabel L_U_8031D7F8 -/* 0D87F8 8031D7F8 308300FF */ andi $v1, $a0, 0xff -/* 0D87FC 8031D7FC 02432821 */ addu $a1, $s2, $v1 -/* 0D8800 8031D800 28610004 */ slti $at, $v1, 4 -/* 0D8804 8031D804 1020FE4F */ beqz $at, .L8031D144 -/* 0D8808 8031D808 80B30054 */ lb $s3, 0x54($a1) -/* 0D880C 8031D80C 1000FE4D */ b .L8031D144 -/* 0D8810 8031D810 A0B50054 */ sb $s5, 0x54($a1) -glabel L_U_8031D814 -/* 0D8814 8031D814 308E00FF */ andi $t6, $a0, 0xff -/* 0D8818 8031D818 024E5021 */ addu $t2, $s2, $t6 -/* 0D881C 8031D81C 814B0054 */ lb $t3, 0x54($t2) -/* 0D8820 8031D820 026B9823 */ subu $s3, $s3, $t3 -/* 0D8824 8031D824 00134E00 */ sll $t1, $s3, 0x18 -/* 0D8828 8031D828 1000FE46 */ b .L8031D144 -/* 0D882C 8031D82C 00099E03 */ sra $s3, $t1, 0x18 -glabel L_U_8031D830 -/* 0D8830 8031D830 0C0C7014 */ jal m64_read_s16 -/* 0D8834 8031D834 02002025 */ move $a0, $s0 -/* 0D8838 8031D838 02201825 */ move $v1, $s1 -/* 0D883C 8031D83C 3065000F */ andi $a1, $v1, 0xf -/* 0D8840 8031D840 00A01825 */ move $v1, $a1 -/* 0D8844 8031D844 AFA50030 */ sw $a1, 0x30($sp) -/* 0D8848 8031D848 02402025 */ move $a0, $s2 -/* 0D884C 8031D84C 0C0C6E50 */ jal seq_channel_set_layer -/* 0D8850 8031D850 A7A20052 */ sh $v0, 0x52($sp) -/* 0D8854 8031D854 8FA30030 */ lw $v1, 0x30($sp) -/* 0D8858 8031D858 1440FE3A */ bnez $v0, .L8031D144 -/* 0D885C 8031D85C 97A70052 */ lhu $a3, 0x52($sp) -/* 0D8860 8031D860 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D8864 8031D864 0003C880 */ sll $t9, $v1, 2 -/* 0D8868 8031D868 02597021 */ addu $t6, $s2, $t9 -/* 0D886C 8031D86C 8DCA0044 */ lw $t2, 0x44($t6) -/* 0D8870 8031D870 01A77821 */ addu $t7, $t5, $a3 -/* 0D8874 8031D874 1000FE33 */ b .L8031D144 -/* 0D8878 8031D878 AD4F0054 */ sw $t7, 0x54($t2) -glabel L_U_8031D87C -/* 0D887C 8031D87C 02202825 */ move $a1, $s1 -/* 0D8880 8031D880 30AB000F */ andi $t3, $a1, 0xf -/* 0D8884 8031D884 01602825 */ move $a1, $t3 -/* 0D8888 8031D888 0C0C6E9B */ jal seq_channel_layer_free -/* 0D888C 8031D88C 02402025 */ move $a0, $s2 -/* 0D8890 8031D890 1000FE2C */ b .L8031D144 -/* 0D8894 8031D894 00000000 */ nop -glabel L_U_8031D898 -/* 0D8898 8031D898 1275FE2A */ beq $s3, $s5, .L8031D144 -/* 0D889C 8031D89C 02402025 */ move $a0, $s2 -/* 0D88A0 8031D8A0 02201825 */ move $v1, $s1 -/* 0D88A4 8031D8A4 3065000F */ andi $a1, $v1, 0xf -/* 0D88A8 8031D8A8 00A01825 */ move $v1, $a1 -/* 0D88AC 8031D8AC 0C0C6E50 */ jal seq_channel_set_layer -/* 0D88B0 8031D8B0 AFA50030 */ sw $a1, 0x30($sp) -/* 0D88B4 8031D8B4 1055FE23 */ beq $v0, $s5, .L8031D144 -/* 0D88B8 8031D8B8 8FA30030 */ lw $v1, 0x30($sp) -/* 0D88BC 8031D8BC 8E580030 */ lw $t8, 0x30($s2) -/* 0D88C0 8031D8C0 00136040 */ sll $t4, $s3, 1 -/* 0D88C4 8031D8C4 8E8A0014 */ lw $t2, 0x14($s4) -/* 0D88C8 8031D8C8 030C1021 */ addu $v0, $t8, $t4 -/* 0D88CC 8031D8CC 90590000 */ lbu $t9, ($v0) -/* 0D88D0 8031D8D0 904D0001 */ lbu $t5, 1($v0) -/* 0D88D4 8031D8D4 00034880 */ sll $t1, $v1, 2 -/* 0D88D8 8031D8D8 00197200 */ sll $t6, $t9, 8 -/* 0D88DC 8031D8DC 0249C021 */ addu $t8, $s2, $t1 -/* 0D88E0 8031D8E0 01AE3821 */ addu $a3, $t5, $t6 -/* 0D88E4 8031D8E4 8F0C0044 */ lw $t4, 0x44($t8) -/* 0D88E8 8031D8E8 30EFFFFF */ andi $t7, $a3, 0xffff -/* 0D88EC 8031D8EC 014F5821 */ addu $t3, $t2, $t7 -/* 0D88F0 8031D8F0 1000FE14 */ b .L8031D144 -/* 0D88F4 8031D8F4 AD8B0054 */ sw $t3, 0x54($t4) -glabel L_U_8031D8F8 -/* 0D88F8 8031D8F8 1000FE12 */ b .L8031D144 -/* 0D88FC 8031D8FC A2440004 */ sb $a0, 4($s2) -glabel L_U_8031D900 -/* 0D8900 8031D900 0C0C7014 */ jal m64_read_s16 -/* 0D8904 8031D904 02002025 */ move $a0, $s0 -/* 0D8908 8031D908 8E8D0014 */ lw $t5, 0x14($s4) -/* 0D890C 8031D90C 02202825 */ move $a1, $s1 -/* 0D8910 8031D910 30B9000F */ andi $t9, $a1, 0xf -/* 0D8914 8031D914 304EFFFF */ andi $t6, $v0, 0xffff -/* 0D8918 8031D918 03202825 */ move $a1, $t9 -/* 0D891C 8031D91C 02802025 */ move $a0, $s4 -/* 0D8920 8031D920 0C0C6F68 */ jal sequence_channel_enable -/* 0D8924 8031D924 01AE3021 */ addu $a2, $t5, $t6 -/* 0D8928 8031D928 1000FE06 */ b .L8031D144 -/* 0D892C 8031D92C 00000000 */ nop -glabel L_U_8031D930 -/* 0D8930 8031D930 322A000F */ andi $t2, $s1, 0xf -/* 0D8934 8031D934 000A4880 */ sll $t1, $t2, 2 -/* 0D8938 8031D938 0289C021 */ addu $t8, $s4, $t1 -/* 0D893C 8031D93C 0C0C6EBC */ jal sequence_channel_disable -/* 0D8940 8031D940 8F04002C */ lw $a0, 0x2c($t8) -/* 0D8944 8031D944 1000FDFF */ b .L8031D144 -/* 0D8948 8031D948 00000000 */ nop -glabel L_U_8031D94C -/* 0D894C 8031D94C 02002025 */ move $a0, $s0 -/* 0D8950 8031D950 0C0C700F */ jal m64_read_u8 -/* 0D8954 8031D954 A3A80055 */ sb $t0, 0x55($sp) -/* 0D8958 8031D958 93A80055 */ lbu $t0, 0x55($sp) -/* 0D895C 8031D95C 00085880 */ sll $t3, $t0, 2 -/* 0D8960 8031D960 028B6021 */ addu $t4, $s4, $t3 -/* 0D8964 8031D964 8D99002C */ lw $t9, 0x2c($t4) -/* 0D8968 8031D968 03226821 */ addu $t5, $t9, $v0 -/* 0D896C 8031D96C 1000FDF5 */ b .L8031D144 -/* 0D8970 8031D970 A1B30054 */ sb $s3, 0x54($t5) -glabel L_U_8031D974 -/* 0D8974 8031D974 02002025 */ move $a0, $s0 -/* 0D8978 8031D978 0C0C700F */ jal m64_read_u8 -/* 0D897C 8031D97C A3A80055 */ sb $t0, 0x55($sp) -/* 0D8980 8031D980 93A80055 */ lbu $t0, 0x55($sp) -/* 0D8984 8031D984 00087080 */ sll $t6, $t0, 2 -/* 0D8988 8031D988 028E7821 */ addu $t7, $s4, $t6 -/* 0D898C 8031D98C 8DEA002C */ lw $t2, 0x2c($t7) -/* 0D8990 8031D990 01424821 */ addu $t1, $t2, $v0 -/* 0D8994 8031D994 1000FDEB */ b .L8031D144 -/* 0D8998 8031D998 81330054 */ lb $s3, 0x54($t1) -.L8031D99C: -/* 0D899C 8031D99C 02408825 */ move $s1, $s2 -.L8031D9A0: -/* 0D89A0 8031D9A0 24120010 */ li $s2, 16 -/* 0D89A4 8031D9A4 00008025 */ move $s0, $zero -.L8031D9A8: -/* 0D89A8 8031D9A8 8E240044 */ lw $a0, 0x44($s1) -/* 0D89AC 8031D9AC 50800004 */ beql $a0, $zero, .L8031D9C0 -/* 0D89B0 8031D9B0 26100004 */ addiu $s0, $s0, 4 -/* 0D89B4 8031D9B4 0C0C7031 */ jal seq_channel_layer_process_script -/* 0D89B8 8031D9B8 00000000 */ nop -/* 0D89BC 8031D9BC 26100004 */ addiu $s0, $s0, 4 -.L8031D9C0: -/* 0D89C0 8031D9C0 1612FFF9 */ bne $s0, $s2, .L8031D9A8 -/* 0D89C4 8031D9C4 26310004 */ addiu $s1, $s1, 4 -.L8031D9C8: -/* 0D89C8 8031D9C8 8FBF002C */ lw $ra, 0x2c($sp) -.L8031D9CC: -/* 0D89CC 8031D9CC 8FB00014 */ lw $s0, 0x14($sp) -/* 0D89D0 8031D9D0 8FB10018 */ lw $s1, 0x18($sp) -/* 0D89D4 8031D9D4 8FB2001C */ lw $s2, 0x1c($sp) -/* 0D89D8 8031D9D8 8FB30020 */ lw $s3, 0x20($sp) -/* 0D89DC 8031D9DC 8FB40024 */ lw $s4, 0x24($sp) -/* 0D89E0 8031D9E0 8FB50028 */ lw $s5, 0x28($sp) -/* 0D89E4 8031D9E4 03E00008 */ jr $ra -/* 0D89E8 8031D9E8 27BD0060 */ addiu $sp, $sp, 0x60 diff --git a/asm/rom_header.s b/asm/rom_header.s deleted file mode 100644 index 88ac440fdb..0000000000 --- a/asm/rom_header.s +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Super Mario 64 ROM header - * Only the first 0x18 bytes matter to the console. - */ - -.byte 0x80, 0x37, 0x12, 0x40 /* PI BSD Domain 1 register */ -.word 0x0000000F /* Clockrate setting*/ -.word entry_point /* Entrypoint */ - -/* Revision */ -.if VERSION_SH == 1 - .word 0x00001448 -.elseif VERSION_EU == 1 - .word 0x00001446 -.else /* NTSC-U and NTSC-J 1.0 */ - .word 0x00001444 -.endif - -.word 0x4EAA3D0E /* Checksum 1 */ -.word 0x74757C24 /* Checksum 2 */ -.word 0x00000000 /* Unknown */ -.word 0x00000000 /* Unknown */ -.if VERSION_SH == 1 -.ascii "SUPERMARIO64 " /* Internal ROM name */ -.else -.ascii "SUPER MARIO 64 " /* Internal ROM name */ -.endif -.word 0x00000000 /* Unknown */ -.word 0x0000004E /* Cartridge */ -.ascii "SM" /* Cartridge ID */ - -/* Region */ -.if VERSION_US == 1 - .ascii "E" /* NTSC-U (North America) */ -.elseif (VERSION_JP == 1 || VERSION_SH == 1) - .ascii "J" /* NTSC-J (Japan) */ -.else - .ascii "P" /* PAL (Europe) */ -.endif - -.if VERSION_SH == 1 - .byte 0x03 /* Version (Shindou) */ -.else - .byte 0x00 /* Version */ -.endif - diff --git a/bin/segment2.c b/bin/segment2.c index 5d5398aa87..075ec935e1 100644 --- a/bin/segment2.c +++ b/bin/segment2.c @@ -2492,7 +2492,7 @@ ALIGNED8 const u8 texture_waterbox_lava[] = { }; // Unreferenced light group -static const Lights1 segment2_lights_unused = gdSPDefLights1( +UNUSED static const Lights1 segment2_lights_unused = gdSPDefLights1( 0x40, 0x40, 0x40, 0xff, 0xff, 0xff, 0x28, 0x28, 0x28 ); diff --git a/build.sh b/build.sh index d5429ce563..b3031d842b 100644 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ LIBAFLA=libaudiofile.la AUDDIR=./tools/audiofile-0.3.6 # Command line options -OPTIONS=("Analog Camera" "No Draw Distance" "Text-saves" "Smoke Texture Fix" "Clean build") +OPTIONS=("Analog Camera" "No Draw Distance" "Text Saves" "Texture Fixes" "Clean build") EXTRA=("BETTERCAMERA=1" "NODRAWINGDISTANCE=1" "TEXTSAVES=1" "TEXTURE_FIX=1" "clean") # Colors @@ -46,15 +46,6 @@ else printf "${YELLOW} Going up one directory.${RESET}\n\n" cd ../ - printf "${GREEN}Notepad will now open, please follow the instructions carefully.\n\n" - printf "${YELLOW}Locate the line: " - printf "${CYAN}tabledesign_CFLAGS := -Wno-uninitialized -laudiofile\n" - printf "${YELLOW}Then add at the end: ${CYAN}-lstdc++\n" - printf "${YELLOW}So it reads: " - printf "${CYAN}tabledesign_CFLAGS := -Wno-uninitialized -laudiofile -lstdc++\n\n" - notepad "Makefile" - read -n 1 -r -s -p $'\e[32mPRESS ENTER TO CONTINUE...\e[0m\n' - printf "${YELLOW} Executing: ${CYAN}make -j${RESET}\n\n" PATH=/mingw64/bin:/mingw32/bin:$PATH make -j @@ -90,7 +81,7 @@ PATH=/mingw32/bin:/mingw64/bin:$PATH make $CMDL -j -d if [ "${CMDL}" != " clean" ]; then - printf "\n${GREEN}If all went well you should have a compiled .EXE in the 'builds/us_pc/' folder.\n" + printf "\n${GREEN}If all went well, you should have a compiled .EXE in the 'builds/us_pc/' folder.\n" printf "${CYAN}Would you like to run the game? [y or n]: ${RESET}" read TEST @@ -98,5 +89,5 @@ if [ "${CMDL}" != " clean" ]; then exec ./build/us_pc/sm64.us.f3dex2e.exe fi else - printf "\nYour build is now clean\n" + printf "\nYour build is now clean.\n" fi \ No newline at end of file diff --git a/data/behavior_data.c b/data/behavior_data.c index 3b4af5a08f..f18e2529f9 100644 --- a/data/behavior_data.c +++ b/data/behavior_data.c @@ -12,6 +12,7 @@ #include "game/debug.h" #include "menu/file_select.h" #include "engine/surface_load.h" +#include "../include/macros.h" #include "actors/common0.h" #include "actors/common1.h" @@ -3144,7 +3145,7 @@ const BehaviorScript bhvUnusedFakeStar[] = { }; // What is this? -static const BehaviorScript unused_1[] = { +UNUSED static const BehaviorScript unused_1[] = { BREAK(), BREAK(), BREAK(), diff --git a/enhancements/README.md b/enhancements/README.md index 241d82f345..6d967cee06 100644 --- a/enhancements/README.md +++ b/enhancements/README.md @@ -15,10 +15,6 @@ branch, make your changes to the code (but do not commit), then run `tools/creat The following enhancements are included in this directory: -## Crash Screen - `crash.patch` - -This enhancement provides a crash screen that is displayed when the code throws a hardware exception. This may be useful for diagnosing crashes in game code. - ## Debug Box - `debug_box.patch` This allows you to draw 3D boxes for debugging purposes. @@ -26,20 +22,6 @@ This allows you to draw 3D boxes for debugging purposes. Call the `debug_box` function whenever you want to draw one. `debug_box` by default takes two arguments: a center and bounds vec3f. This will draw a box starting from the point (center - bounds) to (center + bounds). Use `debug_box_rot` to draw a box rotated in the xz-plane. If you want to draw a box by specifying min and max points, use `debug_box_pos` instead. -## FPS Counter - `fps.patch` - -This patch provides an in-game FPS counter to measure the frame rate. - -## iQue Player Support - `ique_support.patch` - -This enhancement allows the same ROM to work on both the Nintendo 64 and the iQue Player. - -## Memory Expansion Pak Error Screen - `mem_error_screen.patch` - -Use this patch if your game requires over 4 MB of memory and requires the -Expansion Pak. If the Expansion Pak is not present, an error message will be -shown on startup. - ## Demo Input Recorder - `record_demo.patch` This patch allows you to record gameplay demos for the attract screen. It requires the latest nightly versions of Project64, and uses the Project64 JavaScript API to dump the demo input data from RAM and write it to a file. diff --git a/enhancements/crash.patch b/enhancements/crash.patch deleted file mode 100644 index 1ff6fd472b..0000000000 --- a/enhancements/crash.patch +++ /dev/null @@ -1,529 +0,0 @@ -diff --git a/asm/crash.s b/asm/crash.s -new file mode 100644 -index 00000000..870b7e2c ---- /dev/null -+++ b/asm/crash.s -@@ -0,0 +1,160 @@ -+# SM64 Crash Handler -+# See Readme below. -+ -+.include "macros.inc" -+ -+.set COP0_CAUSE, 13 -+.set COP0_EPC, 14 -+.set COP0_BADVADDR, 8 -+ -+/* --------------------------------------------------------------- -+ * IMPORTANT README: -+ * --------------------------------------------------------------- -+ * To use this crash screen, in lib/__osExceptionPreamble.s, change -+ * the function to use the following assembly: -+ * -+ * lui $k0, %hi(__crash_handler_entry) -+ * addiu $k0, $k0, %lo(__crash_handler_entry) -+ * jr $k0 -+ * nop -+ * -+ * Doing just a jal __crash_handler_entry will cause mupen recompiler -+ * errors, so be sure to use the original exception style assembly -+ * above! -+ * -+ * Be sure to add #include "../../enhancements/crash.inc.c" to -+ * the top of game.c. Add .include "../enhancements/crash.inc.s" to -+ * the bottom of asm/decompress.s. Add "../enhancements/crash.h" to -+ * the top of sm64.h, above the CRASH_SCREEN_INCLUDED condition. -+ * -+ * See the DEBUG_ASSERT macro on how to call the crash screen for -+ * detected exceptions. -+ */ -+ -+glabel crashFont -+ .incbin "enhancements/crash_font.bin" -+ .align 4 -+ -+glabel exceptionRegContext -+ .fill 0x108 -+ -+glabel pAssertFile -+ .dword 0 -+glabel nAssertLine -+ .dword 0 -+glabel pAssertExpression -+ .dword 0 -+glabel nAssertStopProgram -+ .dword 0 -+ -+glabel _n64_assert -+ lui $at, %hi(pAssertFile) -+ sw $a0, %lo(pAssertFile)($at) -+ lui $at, %hi(nAssertLine) -+ sw $a1, %lo(nAssertLine)($at) -+ lui $at, %hi(pAssertExpression) -+ sw $a2, %lo(pAssertExpression)($at) -+ lui $at, %hi(nAssertStopProgram) -+ sw $a3, %lo(nAssertStopProgram)($at) -+ beqz $a3, .end_2 -+ nop -+ syscall # trigger crash screen -+.end_2: -+ jr $ra -+ nop -+ -+glabel cop0_get_cause -+ jr $ra -+ mfc0 $v0, $13 # COP0_CAUSE -+ -+glabel cop0_get_epc -+ jr $ra -+ mfc0 $v0, $14 # COP0_EPC -+ -+glabel cop0_get_badvaddr -+ jr $ra -+ mfc0 $v0, $8 # COP0_BADVADDR -+ -+# If the error code field of cop0's cause register is non-zero, -+# draw crash details to the screen and hang -+# -+# If there wasn't an error, continue to the original handler -+ -+glabel __crash_handler_entry -+ la $k0, exceptionRegContext -+ sd $zero, 0x018 ($k0) -+ sd $at, 0x020 ($k0) -+ sd $v0, 0x028 ($k0) -+ sd $v1, 0x030 ($k0) -+ sd $a0, 0x038 ($k0) -+ sd $a1, 0x040 ($k0) -+ sd $a2, 0x048 ($k0) -+ sd $a3, 0x050 ($k0) -+ sd $t0, 0x058 ($k0) -+ sd $t1, 0x060 ($k0) -+ sd $t2, 0x068 ($k0) -+ sd $t3, 0x070 ($k0) -+ sd $t4, 0x078 ($k0) -+ sd $t5, 0x080 ($k0) -+ sd $t6, 0x088 ($k0) -+ sd $t7, 0x090 ($k0) -+ sd $s0, 0x098 ($k0) -+ sd $s1, 0x0A0 ($k0) -+ sd $s2, 0x0A8 ($k0) -+ sd $s3, 0x0B0 ($k0) -+ sd $s4, 0x0B8 ($k0) -+ sd $s5, 0x0C0 ($k0) -+ sd $s6, 0x0C8 ($k0) -+ sd $s7, 0x0D0 ($k0) -+ sd $t8, 0x0D8 ($k0) -+ sd $t9, 0x0E0 ($k0) -+ sd $gp, 0x0E8 ($k0) -+ sd $sp, 0x0F0 ($k0) -+ sd $s8, 0x0F8 ($k0) -+ sd $ra, 0x100 ($k0) -+ mfc0 $t0, $13 # COP0_CAUSE -+ srl $t0, $t0, 2 -+ andi $t0, $t0, 0x1F -+ beqz $t0, .end -+ nop -+ # cop unusable exception fired twice on startup so we'll ignore it for now -+ li $at, 0x0B -+ beq $t0, $at, .end -+ nop -+ jal show_crash_screen_and_hang -+ nop -+ .end: -+ ld $zero, 0x018 ($k0) -+ ld $at, 0x020 ($k0) -+ ld $v0, 0x028 ($k0) -+ ld $v1, 0x030 ($k0) -+ ld $a0, 0x038 ($k0) -+ ld $a1, 0x040 ($k0) -+ ld $a2, 0x048 ($k0) -+ ld $a3, 0x050 ($k0) -+ ld $t0, 0x058 ($k0) -+ ld $t1, 0x060 ($k0) -+ ld $t2, 0x068 ($k0) -+ ld $t3, 0x070 ($k0) -+ ld $t4, 0x078 ($k0) -+ ld $t5, 0x080 ($k0) -+ ld $t6, 0x088 ($k0) -+ ld $t7, 0x090 ($k0) -+ ld $s0, 0x098 ($k0) -+ ld $s1, 0x0A0 ($k0) -+ ld $s2, 0x0A8 ($k0) -+ ld $s3, 0x0B0 ($k0) -+ ld $s4, 0x0B8 ($k0) -+ ld $s5, 0x0C0 ($k0) -+ ld $s6, 0x0C8 ($k0) -+ ld $s7, 0x0D0 ($k0) -+ ld $t8, 0x0D8 ($k0) -+ ld $t9, 0x0E0 ($k0) -+ ld $gp, 0x0E8 ($k0) -+ ld $sp, 0x0F0 ($k0) -+ ld $s8, 0x0F8 ($k0) -+ ld $ra, 0x100 ($k0) -+ lui $k0, %hi(__osException) -+ addiu $k0, $k0, %lo(__osException) -+ jr $k0 # run the original handler -+ nop -diff --git a/lib/asm/__osExceptionPreamble.s b/lib/asm/__osExceptionPreamble.s -index fdc36c8b..ccbf4ecc 100644 ---- a/lib/asm/__osExceptionPreamble.s -+++ b/lib/asm/__osExceptionPreamble.s -@@ -8,12 +8,11 @@ - .section .text, "ax" - - glabel __osExceptionPreamble -- lui $k0, %hi(__osException) # $k0, 0x8032 -- addiu $k0, %lo(__osException) # addiu $k0, $k0, 0x66d0 -+ lui $k0, %hi(__crash_handler_entry) # $k0, 0x8032 -+ addiu $k0, %lo(__crash_handler_entry) # addiu $k0, $k0, 0x66d0 - jr $k0 - nop - -- - glabel __osException - lui $k0, %hi(gInterruptedThread) # $k0, 0x8036 - addiu $k0, %lo(gInterruptedThread) # addiu $k0, $k0, 0x5f40 -diff --git a/sm64.ld b/sm64.ld -index dea5c8bd..22fff2d8 100755 ---- a/sm64.ld -+++ b/sm64.ld -@@ -112,6 +112,7 @@ SECTIONS - BUILD_DIR/src/game/rendering_graph_node.o(.text); - BUILD_DIR/src/game/profiler.o(.text); - BUILD_DIR/asm/decompress.o(.text); -+ BUILD_DIR/asm/crash.o(.text); - BUILD_DIR/src/game/camera.o(.text); - BUILD_DIR/src/game/debug_course.o(.text); - BUILD_DIR/src/game/object_list_processor.o(.text); -diff --git a/src/game/crash.c b/src/game/crash.c -new file mode 100644 -index 00000000..587ac86d ---- /dev/null -+++ b/src/game/crash.c -@@ -0,0 +1,291 @@ -+/* SM64 Crash Handler */ -+ -+#include -+ -+#include "crash.h" -+ -+extern u32 exceptionRegContext[]; -+ -+extern char *pAssertFile; -+extern int nAssertLine; -+extern char *pAssertExpression; -+extern int nAssertStopProgram; -+ -+u16 fbFillColor = 0xFFFF; -+u16 fbShadeColor = 0x0000; -+u16 *fbAddress = NULL; -+ -+extern u8 crashFont[]; -+ -+const char *szErrCodes[] = { -+ "INTERRUPT", -+ "TLB MOD", -+ "UNMAPPED LOAD ADDR", -+ "UNMAPPED STORE ADDR", -+ "BAD LOAD ADDR", -+ "BAD STORE ADDR", -+ "BUS ERR ON INSTR FETCH", -+ "BUS ERR ON LOADSTORE", -+ "SYSCALL", -+ "BREAKPOINT", -+ "UNKNOWN INSTR", -+ "COP UNUSABLE", -+ "ARITHMETIC OVERFLOW", -+ "TRAP EXC", -+ "VIRTUAL COHERENCY INSTR", -+ "FLOAT EXC", -+}; -+ -+const char *szGPRegisters1[] = { "R0", "AT", "V0", "V1", "A0", "A1", "A2", "A3", -+ "T0", "T1", "T2", "T3", "T4", "T5", "T6", NULL }; -+ -+const char *szGPRegisters2[] = { "T7", "S0", "S1", "S2", "S3", "S4", -+ "S5", "S6", "S7", "T8", "T9", /*"K0", "K1",*/ -+ "GP", "SP", "FP", "RA", NULL }; -+ -+/* -+ Generates new preamble code at the exception vectors (0x000, 0x180) -+ -+ eg: generate_exception_preambles(crash_handler_entry); -+ -+ 000: lui k0, hi(crash_handler_entry) -+ 004: addiu k0, k0, lo(crash_handler_entry) -+ 008: jr k0 -+ 00C: nop -+*/ -+void generate_exception_preambles(void *entryPoint) { -+ u8 *mem = (u8 *) 0xA0000000; -+ int offs = 0; -+ int i; -+ -+ u16 hi = (u32) entryPoint >> 16; -+ u16 lo = (u32) entryPoint & 0xFFFF; -+ -+ if (lo & 0x8000) { -+ hi++; -+ } -+ -+ for (i = 0; i < 2; i++) { -+ *(u32 *) &mem[offs + 0x00] = 0x3C1A0000 | hi; -+ *(u32 *) &mem[offs + 0x04] = 0x275A0000 | lo; -+ *(u32 *) &mem[offs + 0x08] = 0x03400008; -+ *(u32 *) &mem[offs + 0x0C] = 0x00000000; -+ offs += 0x180; -+ } -+} -+ -+int crash_strlen(char *str) { -+ int len = 0; -+ while (*str++) { -+ len++; -+ } -+ return len; -+} -+ -+void show_crash_screen_and_hang(void) { -+ u32 cause; -+ u32 epc; -+ u8 errno; -+ -+ fb_set_address((void *) (*(u32 *) 0xA4400004 | 0x80000000)); // replace me -+ -+ cause = cop0_get_cause(); -+ epc = cop0_get_epc(); -+ -+ errno = (cause >> 2) & 0x1F; -+ -+ if (nAssertStopProgram == 0) { -+ fbFillColor = 0x6253; -+ fb_fill(10, 10, 300, 220); -+ -+ fb_print_str(80, 20, "AN ERROR HAS OCCURRED!"); -+ fb_print_int_hex(80, 30, errno, 8); -+ fb_print_str(107, 30, szErrCodes[errno]); -+ -+ if (errno >= 2 && errno <= 5) { -+ /* -+ 2 UNMAPPED LOAD ADDR -+ 3 UNMAPPED STORE ADDR -+ 4 BAD LOAD ADDR -+ 5 BAD STORE ADDR -+ */ -+ u32 badvaddr = cop0_get_badvaddr(); -+ -+ fb_print_str(188, 50, "VA"); -+ fb_print_int_hex(215, 50, badvaddr, 32); -+ } -+ } else { -+ int afterFileX; -+ int exprBoxWidth; -+ fbFillColor = 0x5263; -+ fb_fill(10, 10, 300, 220); -+ -+ fb_print_str(80, 20, "ASSERTION FAILED!"); -+ -+ afterFileX = fb_print_str(80, 30, pAssertFile); -+ fb_print_str(afterFileX, 30, ":"); -+ fb_print_uint(afterFileX + 5, 30, nAssertLine); -+ -+ exprBoxWidth = (crash_strlen(pAssertExpression) * 5) + 2; -+ fbFillColor = 0x0001; -+ fb_fill(80 - 1, 40 - 1, exprBoxWidth, 10); -+ fb_print_str(80, 40, pAssertExpression); -+ } -+ -+ fb_print_str(80, 50, "PC"); -+ fb_print_int_hex(95, 50, epc, 32); -+ -+ fb_print_gpr_states(80, 70, szGPRegisters1, &exceptionRegContext[6 + 0]); -+ fb_print_gpr_states(145, 70, szGPRegisters2, &exceptionRegContext[6 + 15 * 2]); -+ -+ fb_swap(); -+ osWritebackDCacheAll(); -+ -+ while (1) // hang forever -+ { -+ UNUSED volatile int t = 0; // keep pj64 happy -+ } -+} -+ -+u8 ascii_to_idx(char c) { -+ return c - 0x20; -+} -+ -+void fb_set_address(void *address) { -+ fbAddress = (u16 *) address; -+} -+ -+void fb_swap() { -+ // update VI frame buffer register -+ // todo other registers -+ *(u32 *) (0xA4400004) = (u32) fbAddress & 0x00FFFFFF; -+} -+ -+void fb_fill(int baseX, int baseY, int width, int height) { -+ int y, x; -+ -+ for (y = baseY; y < baseY + height; y++) { -+ for (x = baseX; x < baseX + width; x++) { -+ fbAddress[y * 320 + x] = fbFillColor; -+ } -+ } -+} -+ -+void fb_draw_char(int x, int y, u8 idx) { -+ u16 *out = &fbAddress[y * 320 + x]; -+ const u8 *in = &crashFont[idx * 3]; -+ int nbyte; -+ int nrow; -+ int ncol; -+ -+ for (nbyte = 0; nbyte < 3; nbyte++) { -+ u8 curbyte = in[nbyte]; -+ for (nrow = 0; nrow < 2; nrow++) { -+ for (ncol = 0; ncol < 4; ncol++) { -+ u8 px = curbyte & (1 << 7 - (nrow * 4 + ncol)); -+ if (px != 0) { -+ out[ncol] = fbFillColor; -+ } -+ } -+ out += 320; -+ } -+ } -+} -+ -+void fb_draw_char_shaded(int x, int y, u8 idx) { -+ fbFillColor = 0x0001; -+ fb_draw_char(x - 1, y + 1, idx); -+ -+ fbFillColor = 0xFFFF; -+ fb_draw_char(x, y, idx); -+} -+ -+int fb_print_str(int x, int y, const char *str) { -+ while (1) { -+ int yoffs = 0; -+ u8 idx; -+ char c = *str++; -+ -+ if (c == '\0') { -+ break; -+ } -+ -+ if (c == ' ') { -+ x += 5; -+ continue; -+ } -+ -+ switch (c) { -+ case 'j': -+ case 'g': -+ case 'p': -+ case 'q': -+ case 'y': -+ case 'Q': -+ yoffs = 1; -+ break; -+ case ',': -+ yoffs = 2; -+ break; -+ } -+ -+ idx = ascii_to_idx(c); -+ fb_draw_char_shaded(x, y + yoffs, idx); -+ x += 5; -+ } -+ -+ return x; -+} -+ -+void fb_print_int_hex(int x, int y, u32 value, int nbits) { -+ nbits -= 4; -+ -+ while (nbits >= 0) { -+ int nib = ((value >> nbits) & 0xF); -+ u8 idx; -+ -+ if (nib > 9) { -+ idx = ('A' - 0x20) + (nib - 0xa); -+ } else { -+ idx = ('0' - 0x20) + nib; -+ } -+ -+ fb_draw_char_shaded(x, y, idx); -+ x += 5; -+ -+ nbits -= 4; -+ } -+} -+ -+int fb_print_uint(int x, int y, u32 value) { -+ int nchars = 0; -+ -+ int v = value; -+ int i; -+ while (v /= 10) { -+ nchars++; -+ } -+ -+ x += nchars * 5; -+ -+ for (i = nchars; i >= 0; i--) { -+ fb_draw_char_shaded(x, y, ('0' - 0x20) + (value % 10)); -+ value /= 10; -+ x -= 5; -+ } -+ -+ return (x + nchars * 5); -+} -+ -+void fb_print_gpr_states(int x, int y, const char *regNames[], u32 *regContext) { -+ int i; -+ for (i = 0;; i++) { -+ if (regNames[i] == NULL) { -+ break; -+ } -+ -+ fb_print_str(x, y, regNames[i]); -+ fb_print_int_hex(x + 15, y, regContext[i * 2 + 1], 32); -+ y += 10; -+ } -+} -diff --git a/src/game/crash.h b/src/game/crash.h -new file mode 100644 -index 00000000..da4e011e ---- /dev/null -+++ b/src/game/crash.h -@@ -0,0 +1,29 @@ -+#ifndef _CRASH_H_ -+#define _CRASH_H_ -+ -+#include -+ -+#define CRASH_SCREEN_INCLUDED 1 -+ -+extern u32 cop0_get_cause(void); -+extern u32 cop0_get_epc(void); -+extern u32 cop0_get_badvaddr(void); -+ -+extern void _n64_assert(const char* pFile, int nLine, const char *pExpression, int nStopProgram); -+ -+extern u8 __crash_handler_entry[]; -+ -+void generate_exception_preambles(void *entryPoint); -+void show_crash_screen_and_hang(void); -+u8 ascii_to_idx(char c); -+void fb_set_address(void *address); -+void fb_swap(void); -+void fb_fill(int baseX, int baseY, int width, int height); -+void fb_draw_char(int x, int y, u8 idx); -+void fb_draw_char_shaded(int x, int y, u8 idx); -+int fb_print_str(int x, int y, const char *str); -+int fb_print_uint(int x, int y, u32 value); -+void fb_print_int_hex(int x, int y, u32 value, int nbits); -+void fb_print_gpr_states(int x, int y, const char* regStrs[], u32 *regContext); -+ -+#endif /* _CRASH_H_ */ diff --git a/enhancements/crash_font.bin b/enhancements/crash_font.bin deleted file mode 100644 index 1577738864..0000000000 Binary files a/enhancements/crash_font.bin and /dev/null differ diff --git a/enhancements/ique_support.patch b/enhancements/ique_support.patch deleted file mode 100644 index 05b474b92d..0000000000 --- a/enhancements/ique_support.patch +++ /dev/null @@ -1,312 +0,0 @@ -diff --git a/include/PR/console_type.h b/include/PR/console_type.h -new file mode 100644 -index 00000000..e60550ab ---- /dev/null -+++ b/include/PR/console_type.h -@@ -0,0 +1,7 @@ -+enum ConsoleType { -+ CONSOLE_N64, -+ CONSOLE_IQUE -+}; -+ -+extern enum ConsoleType gConsoleType; -+extern enum ConsoleType get_console_type(void); -diff --git a/lib/asm/skGetId.s b/lib/asm/skGetId.s -new file mode 100644 -index 00000000..8fb4c449 ---- /dev/null -+++ b/lib/asm/skGetId.s -@@ -0,0 +1,18 @@ -+# Code by stuckpixel -+ -+.set noreorder -+.set gp=64 -+ -+.include "macros.inc" -+ -+glabel skGetId -+ li $v0, 0 -+ li $t0, 0xA4300014 -+ lw $t1, 0x00($t0) -+ nop -+ jr $ra -+ nop -+ nop -+ nop -+ nop -+ nop -diff --git a/lib/src/__osViSwapContext.c b/lib/src/__osViSwapContext.c -index d7741994..9aced7cf 100644 ---- a/lib/src/__osViSwapContext.c -+++ b/lib/src/__osViSwapContext.c -@@ -52,7 +52,9 @@ void __osViSwapContext() { - HW_REG(VI_INTR_REG, u32) = s0->fldRegs[field].vIntr; - HW_REG(VI_X_SCALE_REG, u32) = s1->unk20; - HW_REG(VI_Y_SCALE_REG, u32) = s1->unk2c; -- HW_REG(VI_CONTROL_REG, u32) = s1->features; -+ /* Make sure bit 13 is cleared. Otherwise, graphics will be corrupted on -+ * iQue Player. This has no effect on N64. */ -+ HW_REG(VI_CONTROL_REG, u32) = s1->features & ~(1 << 13); - D_80334914 = D_80334910; - D_80334910 = s1; - *D_80334914 = *D_80334910; -diff --git a/lib/src/consoleType.c b/lib/src/consoleType.c -new file mode 100644 -index 00000000..ef08d1ef ---- /dev/null -+++ b/lib/src/consoleType.c -@@ -0,0 +1,12 @@ -+#include "libultra_internal.h" -+#include -+ -+enum ConsoleType gConsoleType; -+ -+void skGetId(u32 *out); -+ -+enum ConsoleType get_console_type(void) { -+ u32 id = 0; -+ skGetId(&id); -+ return (id == 0) ? CONSOLE_N64 : CONSOLE_IQUE; -+} -diff --git a/lib/src/osEepromProbe.c b/lib/src/osEepromProbe.c -index d550b846..bbaf2bcc 100644 ---- a/lib/src/osEepromProbe.c -+++ b/lib/src/osEepromProbe.c -@@ -1,4 +1,5 @@ - #include "libultra_internal.h" -+#include - - // TODO: merge with osEepromWrite - typedef struct { -@@ -13,11 +14,23 @@ s32 osEepromProbe(OSMesgQueue *mq) { - unkStruct sp18; - - __osSiGetAccess(); -- status = __osEepStatus(mq, &sp18); -- if (status == 0 && (sp18.unk00 & 0x8000) != 0) { -- status = 1; -- } else { -- status = 0; -+ if (gConsoleType == CONSOLE_N64) { -+ status = __osEepStatus(mq, &sp18); -+ if (status == 0 && (sp18.unk00 & 0x8000) != 0) { -+ status = 1; -+ } else { -+ status = 0; -+ } -+ } else if (gConsoleType == CONSOLE_IQUE) { -+ s32 __osBbEepromSize = * (s32*) 0x80000360; -+ -+ if (__osBbEepromSize == 0x200) { -+ status = 1; -+ } -+ -+ if (__osBbEepromSize == 0x800) { -+ status = 2; -+ } - } - __osSiRelAccess(); - return status; -diff --git a/lib/src/osEepromRead.c b/lib/src/osEepromRead.c -index 905eff74..23f34dd5 100644 ---- a/lib/src/osEepromRead.c -+++ b/lib/src/osEepromRead.c -@@ -1,4 +1,5 @@ - #include "libultra_internal.h" -+#include - - extern u32 D_80365E00[15]; - extern u32 D_80365E3C; -@@ -44,33 +45,44 @@ s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer) { - return -1; - } - __osSiGetAccess(); -- sp34 = __osEepStatus(mq, &sp28); -- if (sp34 != 0 || sp28.unk00 != 0x8000) { -+ if (gConsoleType == CONSOLE_N64) { -+ sp34 = __osEepStatus(mq, &sp28); -+ if (sp34 != 0 || sp28.unk00 != 0x8000) { - -- return 8; -- } -- while (sp28.unk02 & 0x80) { -- __osEepStatus(mq, &sp28); -- } -- __osPackEepReadData(address); -- sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -- for (sp30 = 0; sp30 < 0x10; sp30++) { -- (D_80365E00)[sp30] = 255; -- } -- D_80365E3C = 0; -- sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -- D_80365D20 = 4; -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -- for (sp30 = 0; sp30 < 4; sp30++) { -- sp2c++; -- } -- sp20 = *(unkStruct2 *) sp2c; -- sp34 = (sp20.unk01 & 0xc0) >> 4; -- if (sp34 == 0) { -- for (sp30 = 0; sp30 < 8; sp30++) { -- *buffer++ = ((u8 *) &sp20.unk04)[sp30]; -+ return 8; -+ } -+ while (sp28.unk02 & 0x80) { -+ __osEepStatus(mq, &sp28); -+ } -+ __osPackEepReadData(address); -+ sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ for (sp30 = 0; sp30 < 0x10; sp30++) { -+ (D_80365E00)[sp30] = 255; - } -+ D_80365E3C = 0; -+ sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -+ D_80365D20 = 4; -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ for (sp30 = 0; sp30 < 4; sp30++) { -+ sp2c++; -+ } -+ sp20 = *(unkStruct2 *) sp2c; -+ sp34 = (sp20.unk01 & 0xc0) >> 4; -+ if (sp34 == 0) { -+ for (sp30 = 0; sp30 < 8; sp30++) { -+ *buffer++ = ((u8 *) &sp20.unk04)[sp30]; -+ } -+ } -+ } else if (gConsoleType == CONSOLE_IQUE) { -+ u8 *__osBbEepromAddress = * (u8**) 0x8000035C; -+ s32 i; -+ -+ for (i = 0; i < 8; i++) { -+ buffer[i] = __osBbEepromAddress[(address << 3) + i]; -+ } -+ -+ sp34 = 0; - } - __osSiRelAccess(); - return sp34; -diff --git a/lib/src/osEepromWrite.c b/lib/src/osEepromWrite.c -index 71d0b7d6..c855cc20 100644 ---- a/lib/src/osEepromWrite.c -+++ b/lib/src/osEepromWrite.c -@@ -1,5 +1,6 @@ - #include "libultra_internal.h" - #include "osContInternal.h" -+#include - - u32 D_80365E00[0x3c >> 2]; - u32 D_80365E3C; -@@ -46,36 +47,47 @@ s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer) { - } - - __osSiGetAccess(); -- sp34 = __osEepStatus(mq, &sp1c); -+ if (gConsoleType == CONSOLE_N64) { -+ sp34 = __osEepStatus(mq, &sp1c); - -- if (sp34 != 0 || sp1c.unk00 != 0x8000) { -- return 8; -- } -+ if (sp34 != 0 || sp1c.unk00 != 0x8000) { -+ return 8; -+ } - -- while (sp1c.unk02 & 0x80) { -- __osEepStatus(mq, &sp1c); -- } -+ while (sp1c.unk02 & 0x80) { -+ __osEepStatus(mq, &sp1c); -+ } - -- __osPackEepWriteData(address, buffer); -+ __osPackEepWriteData(address, buffer); - -- sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); - -- for (sp30 = 0; sp30 < 0x10; sp30++) { -- (D_80365E00)[sp30] = 255; -- } -+ for (sp30 = 0; sp30 < 0x10; sp30++) { -+ (D_80365E00)[sp30] = 255; -+ } - -- D_80365E3C = 0; -- sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -- D_80365D20 = 5; -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ D_80365E3C = 0; -+ sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -+ D_80365D20 = 5; -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); - -- for (sp30 = 0; sp30 < 4; sp30++) { -- sp2c++; -- } -+ for (sp30 = 0; sp30 < 4; sp30++) { -+ sp2c++; -+ } -+ -+ sp20 = *(unkStruct2 *) sp2c; -+ sp34 = (sp20.unk01 & 0xc0) >> 4; -+ } else if (gConsoleType == CONSOLE_N64) { -+ u8 *__osBbEepromAddress = * (u8**) 0x8000035C; -+ s32 i; - -- sp20 = *(unkStruct2 *) sp2c; -- sp34 = (sp20.unk01 & 0xc0) >> 4; -+ for (i = 0; i < 8; i++) { -+ __osBbEepromAddress[(address << 3) + i] = buffer[i]; -+ } -+ -+ sp34 = 0; -+ } - __osSiRelAccess(); - return sp34; - } -diff --git a/lib/src/osInitialize.c b/lib/src/osInitialize.c -index 0b9f7128..660d1991 100644 ---- a/lib/src/osInitialize.c -+++ b/lib/src/osInitialize.c -@@ -1,6 +1,7 @@ - #include "libultra_internal.h" - #include "hardware.h" - #include -+#include - - #define PIF_ADDR_START (void *) 0x1FC007FC - -@@ -46,6 +47,7 @@ void osInitialize(void) { - UNUSED u32 eu_sp30; - #endif - UNUSED u32 sp2c; -+ gConsoleType = get_console_type(); - D_80365CD0 = TRUE; - __osSetSR(__osGetSR() | 0x20000000); - __osSetFpcCsr(0x01000800); -diff --git a/sm64.ld b/sm64.ld -index 59a5a2a6..c8976649 100755 ---- a/sm64.ld -+++ b/sm64.ld -@@ -256,6 +256,8 @@ SECTIONS - BUILD_DIR/libultra.a:func_802F7140.o(.text) - BUILD_DIR/libultra.a:func_802F71A0.o(.text) - BUILD_DIR/libultra.a:func_802F71F0.o(.text) -+ BUILD_DIR/libultra.a:consoleType.o(.text) -+ BUILD_DIR/libultra.a:skGetId.o(.text) - - BUILD_DIR/lib/rsp.o(.text); - -@@ -369,6 +371,8 @@ SECTIONS - BUILD_DIR/libultra.a:__osGetCause.o(.text); - BUILD_DIR/libultra.a:__osAtomicDec.o(.text); - BUILD_DIR/libultra.a:guLookAtRef.o(.text); /* Fast3DEX2 only */ -+ BUILD_DIR/libultra.a:consoleType.o(.text); -+ BUILD_DIR/libultra.a:skGetId.o(.text); - BUILD_DIR/lib/rsp.o(.text); - #endif - diff --git a/enhancements/mem_error_screen.patch b/enhancements/mem_error_screen.patch deleted file mode 100644 index 87d995d684..0000000000 --- a/enhancements/mem_error_screen.patch +++ /dev/null @@ -1,298 +0,0 @@ -diff --git a/Makefile b/Makefile -index 88c8dbbe..f60df04f 100644 ---- a/Makefile -+++ b/Makefile -@@ -382,6 +382,7 @@ $(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_menu_strings.h - $(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h - $(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h - $(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h -+$(BUILD_DIR)/src/game/mem_error_screen.o: $(BUILD_DIR)/include/text_strings.h - - ################################################################ - # TEXTURE GENERATION # -diff --git a/include/segments.h b/include/segments.h -index c98040a8..eeecb4f6 100644 ---- a/include/segments.h -+++ b/include/segments.h -@@ -1,6 +1,9 @@ - #ifndef _SEGMENTS_H - #define _SEGMENTS_H - -+/* Use expansion pack RAM */ -+#define USE_EXT_RAM 1 -+ - /* - * Memory addresses for segments. Ideally, this header file would not be - * needed, and the addresses would be defined in sm64.ld and linker-inserted -diff --git a/include/text_strings.h.in b/include/text_strings.h.in -index 4e36eb96..7aadf0cb 100644 ---- a/include/text_strings.h.in -+++ b/include/text_strings.h.in -@@ -25,6 +25,11 @@ - #define TEXT_PAUSE _("PAUSE") // Pause text, Castle Courses - #define TEXT_HUD_CONGRATULATIONS _("CONGRATULATIONS") // Course Complete Text, Bowser Courses - -+// Memory Expansion Error Screen -+#define TEXT_CONSOLE_8MB _("If you're using an N64 console, then you will need to buy an\nExpansion Pak to play this ROM hack.") -+#define TEXT_PJ64 _("If you are using PJ64 1.6, go to:\nOptions > Settings > Rom Settings Tab > Memory Size\nthen select 8 MB from the drop-down box.") -+#define TEXT_PJ64_2 _("If you are using PJ64 2.X, go to:\nOptions > Settings > Config: > Memory Size, select 8 MB") -+ - #if defined(VERSION_JP) || defined(VERSION_SH) - - /** -diff --git a/levels/entry.c b/levels/entry.c -index 015eeb6b..cc010ca1 100644 ---- a/levels/entry.c -+++ b/levels/entry.c -@@ -15,3 +15,12 @@ const LevelScript level_script_entry[] = { - EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_1), - JUMP(/*target*/ level_script_entry), - }; -+ -+const LevelScript level_script_entry_error_screen[] = { -+ INIT_LEVEL(), -+ SLEEP(/*frames*/ 2), -+ BLACKOUT(/*active*/ FALSE), -+ SET_REG(/*value*/ 0), -+ EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_error_screen), -+ JUMP(/*target*/ level_script_entry_error_screen), -+}; -diff --git a/levels/intro/geo.c b/levels/intro/geo.c -index 8ac70024..72766f3f 100644 ---- a/levels/intro/geo.c -+++ b/levels/intro/geo.c -@@ -15,6 +15,24 @@ - - #include "levels/intro/header.h" - -+const GeoLayout intro_geo_error_screen[] = { -+ GEO_NODE_SCREEN_AREA(0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2), -+ GEO_OPEN_NODE(), -+ GEO_ZBUFFER(0), -+ GEO_OPEN_NODE(), -+ GEO_NODE_ORTHO(100), -+ GEO_OPEN_NODE(), -+ GEO_BACKGROUND_COLOR(0x0001), -+ GEO_CLOSE_NODE(), -+ GEO_CLOSE_NODE(), -+ GEO_ZBUFFER(0), -+ GEO_OPEN_NODE(), -+ GEO_ASM(0, geo18_display_error_message), -+ GEO_CLOSE_NODE(), -+ GEO_CLOSE_NODE(), -+ GEO_END(), -+}; -+ - // 0x0E0002D0 - const GeoLayout intro_geo_0002D0[] = { - GEO_NODE_SCREEN_AREA(0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2), -diff --git a/levels/intro/header.h b/levels/intro/header.h -index e0f6292d..8f77fb26 100644 ---- a/levels/intro/header.h -+++ b/levels/intro/header.h -@@ -26,4 +26,8 @@ extern const LevelScript script_intro_L3[]; - extern const LevelScript script_intro_L4[]; - extern const LevelScript script_intro_L5[]; - -+extern const GeoLayout intro_geo_error_screen[]; -+extern const LevelScript level_intro_entry_error_screen[]; -+extern Gfx *geo18_display_error_message(u32 run, UNUSED struct GraphNode *sp44, UNUSED u32 sp48); -+ - #endif -diff --git a/levels/intro/script.c b/levels/intro/script.c -index 4975dbb2..5ee6c688 100644 ---- a/levels/intro/script.c -+++ b/levels/intro/script.c -@@ -18,6 +18,21 @@ - #include "make_const_nonconst.h" - #include "levels/intro/header.h" - -+const LevelScript level_intro_entry_error_screen[] = { -+ INIT_LEVEL(), -+ FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), -+ LOAD_MIO0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd), -+ ALLOC_LEVEL_POOL(), -+ -+ AREA(/*index*/ 1, intro_geo_error_screen), -+ END_AREA(), -+ -+ FREE_LEVEL_POOL(), -+ LOAD_AREA(/*area*/ 1), -+ SLEEP(/*frames*/ 32767), -+ EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen), -+}; -+ - const LevelScript level_intro_entry_1[] = { - INIT_LEVEL(), - FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), -diff --git a/src/engine/level_script.h b/src/engine/level_script.h -index 89bfb4ed..0ea607c5 100644 ---- a/src/engine/level_script.h -+++ b/src/engine/level_script.h -@@ -4,5 +4,6 @@ - struct LevelCommand *level_script_execute(struct LevelCommand *cmd); - - extern u8 level_script_entry[]; -+extern u8 level_script_entry_error_screen[]; - - #endif /* _LEVEL_SCRIPT_H */ -diff --git a/src/game/main.c b/src/game/main.c -index a3afffee..8b05fcf1 100644 ---- a/src/game/main.c -+++ b/src/game/main.c -@@ -12,6 +12,7 @@ - #include "segments.h" - #include "main.h" - #include "thread6.h" -+#include "mem_error_screen.h" - - // Message IDs - #define MESG_SP_COMPLETE 100 -@@ -125,6 +126,10 @@ void alloc_pool(void) { - void *start = (void *) SEG_POOL_START; - void *end = (void *) SEG_POOL_END; - -+ // Detect memory size -+ if (does_pool_end_lie_out_of_bounds(end)) -+ end = (void *)SEG_POOL_END_4MB; -+ - main_pool_init(start, end); - gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT); - } -@@ -330,7 +335,10 @@ void thread3_main(UNUSED void *arg) { - create_thread(&gSoundThread, 4, thread4_sound, NULL, gThread4Stack + 0x2000, 20); - osStartThread(&gSoundThread); - -- create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10); -+ if (!gNotEnoughMemory) -+ create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10); -+ else -+ create_thread(&gGameLoopThread, 5, thread5_mem_error_message_loop, NULL, gThread5Stack + 0x2000, 10); - osStartThread(&gGameLoopThread); - - while (1) { -diff --git a/src/game/mem_error_screen.c b/src/game/mem_error_screen.c -new file mode 100644 -index 00000000..81efaf91 ---- /dev/null -+++ b/src/game/mem_error_screen.c -@@ -0,0 +1,104 @@ -+/* clang-format off */ -+/* -+ * mem_error_screen.inc.c -+ * -+ * This enhancement should be used for ROM hacks that require the expansion pak. -+ * -+ */ -+/* clang-format on */ -+ -+#include -+#include "segments.h" -+#include "text_strings.h" -+#include "game_init.h" -+#include "main.h" -+#include "print.h" -+#include "ingame_menu.h" -+#include "segment2.h" -+#include "../engine/level_script.h" -+ -+// Ensure that USE_EXT_RAM is defined. -+#ifndef USE_EXT_RAM -+#error You have to define USE_EXT_RAM in 'include/segments.h' -+#endif -+ -+// Require 8 MB of RAM, even if the pool doesn't go into extended memory. -+// Change the '8' to whatever MB limit you want. -+// Note: only special emulators allow for RAM sizes above 8 MB. -+#define REQUIRED_MIN_MEM_SIZE 1048576 * 8 -+ -+u8 gNotEnoughMemory = FALSE; -+u8 gDelayForErrorMessage = 0; -+ -+u8 does_pool_end_lie_out_of_bounds(void *end) { -+ u32 endPhy = ((u32) end) & 0x1FFFFFFF; -+ u32 memSize = *((u32 *) 0x80000318); -+ -+ if (endPhy > memSize) { -+ gNotEnoughMemory = TRUE; -+ return TRUE; -+ } else { -+ if (memSize < REQUIRED_MIN_MEM_SIZE) { -+ gNotEnoughMemory = TRUE; -+ } -+ return FALSE; -+ } -+} -+ -+// If you're using an N64 console, then you will need to buy an\nexpansion pak to play this ROM hack. -+u8 text_console_8mb[] = { TEXT_CONSOLE_8MB }; -+ -+// If you are using PJ64 1.6, go to: Options ► Settings ► Rom Settings Tab ► Memory Size then select 8 -+// MB from the drop-down box. -+u8 text_pj64[] = { TEXT_PJ64 }; -+ -+// If you are using PJ64 2.X, go to: Options ► Settings ► Config: ► Memory Size, select 8 MB -+u8 text_pj64_2[] = { TEXT_PJ64_2 }; -+ -+Gfx *geo18_display_error_message(u32 run, UNUSED struct GraphNode *sp44, UNUSED u32 sp48) { -+ if (run) { -+ if (gDelayForErrorMessage > 0) { -+ // Draw color text title. -+ print_text(10, 210, "ERROR Need more memory"); -+ -+ // Init generic text rendering -+ create_dl_ortho_matrix(); -+ gSPDisplayList(gDisplayListHead++, -+ dl_ia_text_begin); // Init rendering stuff for generic text -+ -+ // Set text color to white -+ gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); -+ -+ print_generic_string(8, 170, text_console_8mb); -+ print_generic_string(8, 120, text_pj64); -+ print_generic_string(8, 54, text_pj64_2); -+ -+ // Cleanup -+ gSPDisplayList(gDisplayListHead++, -+ dl_ia_text_end); // Reset back to default render settings. -+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); -+ } else { -+ gDelayForErrorMessage += 1; -+ } -+ } -+ -+ return 0; -+} -+ -+// Basic main loop for the error screen. Note that controllers are not enabled here. -+void thread5_mem_error_message_loop(UNUSED void *arg) { -+ struct LevelCommand *addr; -+ -+ setup_game_memory(); -+ set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg) 1); -+ -+ addr = segmented_to_virtual(level_script_entry_error_screen); -+ -+ rendering_init(); -+ -+ while (1) { -+ config_gfx_pool(); -+ addr = level_script_execute(addr); -+ display_and_vsync(); -+ } -+} -\ No newline at end of file -diff --git a/src/game/mem_error_screen.h b/src/game/mem_error_screen.h -new file mode 100644 -index 00000000..9fbff34c ---- /dev/null -+++ b/src/game/mem_error_screen.h -@@ -0,0 +1,8 @@ -+#ifndef MEM_ERROR_SCREEN_H -+#define MEM_ERROR_SCREEN_H -+ -+extern u8 gNotEnoughMemory; -+void thread5_mem_error_message_loop(UNUSED void *arg); -+u8 does_pool_end_lie_out_of_bounds(void *end); -+ -+#endif diff --git a/extract_assets.py b/extract_assets.py index 7c29358b53..706fc7284c 100755 --- a/extract_assets.py +++ b/extract_assets.py @@ -47,7 +47,6 @@ 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)) - local_asset_file.close() for fname in list(assets) + [".assets-local.txt"]: if fname.startswith("@"): continue diff --git a/include/PR/ultratypes.h b/include/PR/ultratypes.h index 1ebde7756d..9459168818 100644 --- a/include/PR/ultratypes.h +++ b/include/PR/ultratypes.h @@ -33,13 +33,9 @@ typedef double f64; #include #include -#if defined(__MINGW32__) +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) #include <_mingw.h> -#if !defined(__MINGW64_VERSION_MAJOR) typedef long ssize_t; -#else -typedef ptrdiff_t ssize_t; -#endif #endif #endif // _ULTRA64_TYPES_H_ diff --git a/include/macros.h b/include/macros.h index f93642fb81..1a252b69e9 100644 --- a/include/macros.h +++ b/include/macros.h @@ -7,12 +7,6 @@ #define GLOBAL_ASM(...) #endif -#if !defined(__sgi) && (!defined(NON_MATCHING) || !defined(AVOID_UB)) -// asm-process isn't supported outside of IDO, and undefined behavior causes -// crashes. -#error Matching build is only possible on IDO; please build with NON_MATCHING=1. -#endif - #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define GLUE(a, b) a ## b diff --git a/include/types.h b/include/types.h index 870223eb8d..f51c57286b 100644 --- a/include/types.h +++ b/include/types.h @@ -291,6 +291,7 @@ struct MarioState /*0x0C*/ u32 action; /*0x10*/ u32 prevAction; /*0x14*/ u32 terrainSoundAddend; + //*0x18*/ u32 actionState; // makes the game harder /*0x18*/ u16 actionState; /*0x1A*/ u16 actionTimer; /*0x1C*/ u32 actionArg; diff --git a/include/ultra64.h b/include/ultra64.h index e78ded499c..409a3cf76a 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -30,13 +30,4 @@ #include #include -#if defined(__MINGW32__) -#include <_mingw.h> -#if !defined(__MINGW64_VERSION_MAJOR) -#include -#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) -#define bcopy(s1, s2, n) memmove((s2), (s1), (n)) -#endif -#endif - #endif diff --git a/lib/src/D_802F4380.c b/lib/src/D_802F4380.c deleted file mode 100644 index cfc1ae250e..0000000000 --- a/lib/src/D_802F4380.c +++ /dev/null @@ -1,147 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -#include "new_func.h" -#include "macros.h" -#if defined(VERSION_EU) || defined(VERSION_SH) -u32 D_802F4380() { - u32 sp3c; - u32 sp38; - u32 sp34; - __OSTranxInfo *sp30; - __OSBlockInfo *sp2c; - u32 sp28; - UNUSED __OSBlockInfo *sp24; - if (!EU_D_80302090) { - return 0; - } - sp30 = &__osDiskHandle->transferInfo; - sp2c = &sp30->block[sp30->blockNum]; - sp38 = HW_REG(PI_STATUS_REG, u32); - if (sp38 & PI_STATUS_BUSY) { - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_RESET_CONTROLLER | PI_STATUS_CLEAR_INTR; - WAIT_ON_IOBUSY(sp38); - sp3c = HW_REG(ASIC_STATUS, u32); - if (sp3c & MECHANIC_INTERRUPT) { - WAIT_ON_IOBUSY(sp38); - HW_REG(ASIC_BM_CTL, u32) = sp30->bmCtlShadow | MECHANIC_INTERRUPT_RESET; - } - sp30->unk10 = 75; - func_802F4A20(); - return 1; - } - WAIT_ON_IOBUSY(sp38); - sp3c = HW_REG(ASIC_STATUS, u32); - if (sp3c & MECHANIC_INTERRUPT) { - WAIT_ON_IOBUSY(sp38); - HW_REG(ASIC_BM_CTL, u32) = sp30->bmCtlShadow | MECHANIC_INTERRUPT_RESET; - sp30->unk10 = 0; - return 0; - } - if (sp3c & BUFFER_MANAGER_ERROR) { - sp30->unk10 = 3; - func_802F4A20(); - return 1; - } - if (sp30->cmdType == 1) { - if ((sp3c & DATA_REQUEST) == 0) { - if (sp30->sectorNum + 1 != sp30->transferMode * 85) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR; - D_8030208C |= 0x00100401; - sp30->unk10 = 0; - func_802F4B08(); - return 1; - } - sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize); - sp30->sectorNum += 1; - osEPiRawStartDma(__osDiskHandle, 1, 0x05000400, sp2c->dramAddr, sp2c->sectorSize); - return 1; - } - if (sp30->cmdType == 0) { - if (sp30->transferMode == 3) { - if ((s32)(sp2c->C1ErrNum + 17) < sp30->sectorNum) { - sp30->unk10 = 0; - func_802F4A20(); - return 1; - } - if ((sp3c & DATA_REQUEST) == 0) { - sp30->unk10 = 17; - func_802F4A20(); - return 1; - } - } else { - sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize); - } - sp34 = HW_REG(ASIC_BM_STATUS, u32); - if (((C1_SINGLE & sp34) && (C1_DOUBLE & sp34)) || (sp34 & MICRO_STATUS)) - { - if (sp2c->C1ErrNum > 3) { - if (sp30->transferMode != 3 || sp30->sectorNum > 0x52) { - sp30->unk10 = 17; - func_802F4A20(); - return 1; - } - } else { - sp28 = sp2c->C1ErrNum; - sp2c->C1ErrSector[sp28] = sp30->sectorNum + 1; - } - sp2c->C1ErrNum += 1; - } - if (sp3c & C2_TRANSFER) { - if (sp30->sectorNum != 87) { - sp30->unk10 = 6; - func_802F4A20(); - } - if (sp30->transferMode == 2 && sp30->blockNum == 0) { - sp30->blockNum = 1; - sp30->sectorNum = -1; - sp30->block[1].dramAddr = - (void *) ((u32) sp30->block[1].dramAddr - sp30->block[1].sectorSize); - } else { - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR; - D_8030208C |= 0x00100401; - } - osEPiRawStartDma(__osDiskHandle, 0, 0x5000000, sp2c->C2Addr, sp2c->sectorSize * 4); - sp30->unk10 = 0; - return 1; - } - - if (sp30->sectorNum == -1 && sp30->transferMode == 2 && sp30->blockNum == 1) { - sp24 = &sp30->block[0]; - if (sp30->block[0].C1ErrNum == 0) { - if (((u32 *) sp30->block[0].C2Addr)[0] | ((u32 *) sp30->block[0].C2Addr)[1] - | ((u32 *) sp30->block[0].C2Addr)[2] | ((u32 *) sp30->block[0].C2Addr)[3]) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - } - sp30->unk10 = 0; - func_802F4B08(); - } - sp30->sectorNum += 1; - if (sp3c & DATA_REQUEST) { - if (sp30->sectorNum > 0x54) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - osEPiRawStartDma(__osDiskHandle, 0, 0x05000400, sp2c->dramAddr, sp2c->sectorSize); - sp30->unk10 = 0; - return 1; - } - if (sp30->sectorNum <= 0x54) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - return 1; - } - sp30->unk10 = 75; - func_802F4A20(); - return 1; -} -#endif diff --git a/lib/src/EU_D_802f4330.c b/lib/src/EU_D_802f4330.c deleted file mode 100644 index a67673d255..0000000000 --- a/lib/src/EU_D_802f4330.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "libultra_internal.h" - -// an array of pointers to functions taking no arguments and returning u32... -// this is only referenced in the exception handler and here. this function is called with a0=1 and -// then the same memory address is loaded. it's definitely an array access though.. -extern u32 (*D_80334920[8])() ; - -void EU_D_802f4330(u32 a0, u32 a1(void)) { - register u32 int_disabled = __osDisableInt(); - D_80334920[a0] = a1; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/_Ldtob.c b/lib/src/_Ldtob.c index 3656bd45af..0b74280c04 100644 --- a/lib/src/_Ldtob.c +++ b/lib/src/_Ldtob.c @@ -26,7 +26,7 @@ const double D_80338670[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L #define _CSIGN 1 #define _ILONG 0 #define _MBMAX 8 -#define NAN 2 +#define _NAN 2 #define INF 1 #define FINITE -1 #define _DFRAC ((1 << _DOFF) - 1) @@ -166,14 +166,14 @@ static s16 _Ldunscale(s16 *pex, printf_struct *px) { short xchar = (ps[_D0] & _DMASK) >> _DOFF; if (xchar == _DMAX) { /* NaN or INF */ *pex = 0; - return (s16)(ps[_D0] & _DFRAC || ps[_D1] || ps[_D2] || ps[_D3] ? NAN : INF); + return (s16)(ps[_D0] & _DFRAC || ps[_D1] || ps[_D2] || ps[_D3] ? _NAN : INF); } else if (0 < xchar) { ps[_D0] = (ps[_D0] & ~_DMASK) | (_DBIAS << _DOFF); *pex = xchar - (_DBIAS - 1); return (FINITE); } if (0 > xchar) { - return NAN; + return _NAN; } else { *pex = 0; return (0); diff --git a/lib/src/_Printf.c b/lib/src/_Printf.c deleted file mode 100644 index 743a788a03..0000000000 --- a/lib/src/_Printf.c +++ /dev/null @@ -1,229 +0,0 @@ -#include "libultra_internal.h" -#include -#include -#include "printf.h" - -#define ATOI(i, a) \ - for (i = 0; *a >= '0' && *a <= '9'; a++) \ - if (i < 999) \ - i = *a + i * 10 - '0'; -#define _PROUT(dst, fmt, _size) \ - if (_size > 0) { \ - dst = prout(dst, fmt, _size); \ - if (dst != 0) \ - sp78.size += _size; \ - else \ - return sp78.size; \ - } -#define _PAD(i, m, c, src, extracond) \ - if (extracond && m > 0) \ - for (i = m; i > 0; i -= c) { \ - if ((u32) i > 32) \ - c = 32; \ - else \ - c = i; \ - _PROUT(dst, src, c); \ - } - -const char length_str[] = "hlL"; -const char flags_str[] = " +-#0"; -const u32 flags_arr[] = { FLAGS_SPACE, FLAGS_PLUS, FLAGS_MINUS, FLAGS_HASH, FLAGS_ZERO, 0 }; -char _spaces[] = " "; -char _zeroes[] = "00000000000000000000000000000000"; - -static void _Putfld(printf_struct *, va_list *, u8, u8 *); - -s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args) { - printf_struct sp78; - const u8 *fmt_ptr; - u8 c; - const char *flag_index; - u8 sp4c[0x20]; // probably a buffer? - s32 sp48, sp44, sp40, sp3c, sp38, sp34, sp30, sp2c, sp28, sp24; - sp78.size = 0; - while (1) { - fmt_ptr = (u8 *) fmt; - while ((c = *fmt_ptr++) > 0) { - if (c == '%') { - fmt_ptr--; - break; - } - } - _PROUT(dst, fmt, fmt_ptr - (u8 *) fmt); - if (c == 0) { - return sp78.size; - } - fmt = (char *) ++fmt_ptr; - sp78.flags = 0; - for (; (flag_index = strchr(flags_str, *fmt_ptr)) != NULL; fmt_ptr++) { - sp78.flags |= flags_arr[flag_index - flags_str]; - } - if (*fmt_ptr == '*') { - sp78.width = va_arg(args, s32); - if (sp78.width < 0) { - sp78.width = -sp78.width; - sp78.flags |= FLAGS_MINUS; - } - fmt_ptr++; - } else { - ATOI(sp78.width, fmt_ptr); - } - if (*fmt_ptr != '.') { - sp78.precision = -1; - } else { - fmt_ptr++; - if (*fmt_ptr == '*') { - sp78.precision = va_arg(args, s32); - fmt_ptr++; - } else { - ATOI(sp78.precision, fmt_ptr); - } - } - if (strchr(length_str, *fmt_ptr) != NULL) { - sp78.length = *fmt_ptr++; - } else { - sp78.length = 0; - } - - if (sp78.length == 'l' && *fmt_ptr == 'l') { - sp78.length = 'L'; - fmt_ptr++; - } - _Putfld(&sp78, &args, *fmt_ptr, sp4c); - sp78.width -= sp78.part1_len + sp78.num_leading_zeros + sp78.part2_len + sp78.num_mid_zeros - + sp78.part3_len + sp78.num_trailing_zeros; - _PAD(sp44, sp78.width, sp48, _spaces, !(sp78.flags & FLAGS_MINUS)); - _PROUT(dst, (char *) sp4c, sp78.part1_len); - _PAD(sp3c, sp78.num_leading_zeros, sp40, _zeroes, 1); - _PROUT(dst, sp78.buff, sp78.part2_len); - _PAD(sp34, sp78.num_mid_zeros, sp38, _zeroes, 1); - _PROUT(dst, (char *) (&sp78.buff[sp78.part2_len]), sp78.part3_len) - _PAD(sp2c, sp78.num_trailing_zeros, sp30, _zeroes, 1); - _PAD(sp24, sp78.width, sp28, _spaces, sp78.flags & FLAGS_MINUS); - fmt = (char *) fmt_ptr + 1; - } -} - -static void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) { - a0->part1_len = a0->num_leading_zeros = a0->part2_len = a0->num_mid_zeros = a0->part3_len = - a0->num_trailing_zeros = 0; - - switch (type) { - - case 'c': - buff[a0->part1_len++] = va_arg(*args, u32); - break; - - case 'd': - case 'i': - if (a0->length == 'l') { - a0->value.s64 = va_arg(*args, s32); - } else if (a0->length == 'L') { - a0->value.s64 = va_arg(*args, s64); - } else { - a0->value.s64 = va_arg(*args, s32); - } - - if (a0->length == 'h') { - a0->value.s64 = (s16) a0->value.s64; - } - - if (a0->value.s64 < 0) { - buff[a0->part1_len++] = '-'; - } else if (a0->flags & FLAGS_PLUS) { - buff[a0->part1_len++] = '+'; - } else if (a0->flags & FLAGS_SPACE) { - buff[a0->part1_len++] = ' '; - } - - a0->buff = (char *) &buff[a0->part1_len]; - - _Litob(a0, type); - break; - - case 'x': - case 'X': - case 'u': - case 'o': - if (a0->length == 'l') { - a0->value.s64 = va_arg(*args, s32); - } else if (a0->length == 'L') { - a0->value.s64 = va_arg(*args, s64); - } else { - a0->value.s64 = va_arg(*args, s32); - } - - if (a0->length == 'h') { - a0->value.s64 = (u16) a0->value.s64; - } else if (a0->length == 0) { - a0->value.s64 = (u32) a0->value.s64; - } - - if (a0->flags & FLAGS_HASH) { - buff[a0->part1_len++] = '0'; - if (type == 'x' || type == 'X') { - - buff[a0->part1_len++] = type; - } - } - a0->buff = (char *) &buff[a0->part1_len]; - _Litob(a0, type); - break; - - case 'e': - case 'f': - case 'g': - case 'E': - case 'G': - //... okay? - a0->value.f64 = a0->length == 'L' ? va_arg(*args, f64) : va_arg(*args, f64); - - if (a0->value.u16 & 0x8000) { - buff[a0->part1_len++] = '-'; - } else { - if (a0->flags & FLAGS_PLUS) { - buff[a0->part1_len++] = '+'; - } else if (a0->flags & FLAGS_SPACE) { - buff[a0->part1_len++] = ' '; - } - } - - a0->buff = (char *) &buff[a0->part1_len]; - _Ldtob(a0, type); - break; - - case 'n': - if (a0->length == 'h') { - *(va_arg(*args, u16 *)) = a0->size; - } else if (a0->length == 'l') { - *va_arg(*args, u32 *) = a0->size; - } else if (a0->length == 'L') { - *va_arg(*args, u64 *) = a0->size; - } else { - *va_arg(*args, u32 *) = a0->size; - } - break; - - case 'p': - a0->value.s64 = (intptr_t) va_arg(*args, void *); - a0->buff = (char *) &buff[a0->part1_len]; - _Litob(a0, 'x'); - break; - - case 's': - a0->buff = va_arg(*args, char *); - a0->part2_len = strlen(a0->buff); - if (a0->precision >= 0 && a0->part2_len > a0->precision) { - a0->part2_len = a0->precision; - } - break; - - case '%': - buff[a0->part1_len++] = '%'; - break; - - default: - buff[a0->part1_len++] = type; - break; - } -} diff --git a/lib/src/__osAtomicDec.c b/lib/src/__osAtomicDec.c deleted file mode 100644 index 87ff265ebb..0000000000 --- a/lib/src/__osAtomicDec.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "libultra_internal.h" - -s32 __osAtomicDec(u32 *a0) { - s32 sp1c; - s32 sp18; - sp1c = __osDisableInt(); - - if (*a0 != 0) { - (*a0)--; - sp18 = 1; - } else { - sp18 = 0; - } - - __osRestoreInt(sp1c); - return sp18; -} diff --git a/lib/src/__osDevMgrMain.c b/lib/src/__osDevMgrMain.c deleted file mode 100644 index 3cfe19b744..0000000000 --- a/lib/src/__osDevMgrMain.c +++ /dev/null @@ -1,121 +0,0 @@ -#include "libultra_internal.h" -#include "macros.h" -#if defined(VERSION_EU) -#include "new_func.h" -void __osDevMgrMain(void *args) { - OSIoMesg *sp44; - OSMesg sp40; - OSMesg sp3c; - s32 sp38; - OSMgrArgs *sp34; - UNUSED u32 sp30; - u32 sp2c; - __OSBlockInfo *sp28; - __OSTranxInfo *sp24; - sp30 = 0; - sp2c = 0; - sp44 = NULL; - sp38 = 0; - sp34 = (OSMgrArgs *) args; - while (1) { - osRecvMesg(sp34->unk08, (OSMesg) &sp44, OS_MESG_BLOCK); - if (sp44->piHandle != NULL && sp44->piHandle->type == 2 - && (sp44->piHandle->transferInfo.cmdType == 0 - || sp44->piHandle->transferInfo.cmdType == 1)) { - sp24 = &sp44->piHandle->transferInfo; - sp28 = &sp24->block[sp24->blockNum]; - sp24->sectorNum = -1; - if (sp24->transferMode != 3) { - sp28->dramAddr = (void *) ((u32) sp28->dramAddr - sp28->sectorSize); - } - if (sp24->transferMode == 2 && sp44->piHandle->transferInfo.cmdType == 0) - sp2c = 1; - else - sp2c = 0; - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - func_802F7140(0x00100401); // remove magic constant! - func_802F71A0(sp44->piHandle, 0x05000510, (sp24->bmCtlShadow | 0x80000000)); - while (1) { - osRecvMesg(sp34->unk0c, &sp40, OS_MESG_BLOCK); - sp30 = osSendMesg(sp44->hdr.retQueue, sp44, OS_MESG_NOBLOCK); - if (sp2c != 1 || sp44->piHandle->transferInfo.unk10 != 0) - break; - sp2c = 0; - } - osSendMesg(sp34->unk10, NULL, OS_MESG_NOBLOCK); - if (sp44->piHandle->transferInfo.blockNum == 1) - func_802F71F0(); - } else { - switch (sp44->hdr.type) { - case 11: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->dma_func(OS_READ, sp44->devAddr, sp44->dramAddr, sp44->size); - break; - case 12: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->dma_func(OS_WRITE, sp44->devAddr, sp44->dramAddr, sp44->size); - break; - case 15: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->edma_func(sp44->piHandle, OS_READ, sp44->devAddr, sp44->dramAddr, - sp44->size); - break; - case 16: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->edma_func(sp44->piHandle, OS_WRITE, sp44->devAddr, sp44->dramAddr, - sp44->size); - break; - case 10: - osSendMesg(sp44->hdr.retQueue, sp44, OS_MESG_NOBLOCK); - sp38 = -1; - break; - break; - default: - sp38 = -1; - break; - } - if (sp38 == 0) { - osRecvMesg(sp34->unk0c, &sp40, OS_MESG_BLOCK); - sp30 = osSendMesg(sp44->hdr.retQueue, sp44, OS_MESG_NOBLOCK); - osSendMesg(sp34->unk10, NULL, OS_MESG_NOBLOCK); - } - } - } -} -#else -void __osDevMgrMain(void *args) { - OSIoMesg *sp34; - OSMesg sp30; - OSMesg sp2c; - s32 sp28; - OSMgrArgs *sp24; - sp34 = NULL; - sp28 = 0; - sp24 = (OSMgrArgs *) args; - while (1) { - osRecvMesg(sp24->unk08, (OSMesg) &sp34, OS_MESG_BLOCK); - switch (sp34->hdr.type) { - case 11: - osRecvMesg(sp24->unk10, &sp2c, OS_MESG_BLOCK); - sp28 = sp24->dma_func(OS_READ, sp34->devAddr, sp34->dramAddr, sp34->size); - break; - case 12: - osRecvMesg(sp24->unk10, &sp2c, OS_MESG_BLOCK); - sp28 = sp24->dma_func(OS_WRITE, sp34->devAddr, sp34->dramAddr, sp34->size); - break; - case 10: - osSendMesg(sp34->hdr.retQueue, sp34, OS_MESG_NOBLOCK); - sp28 = -1; - break; - default: - sp28 = -1; - break; - } - if (sp28 == 0) { - osRecvMesg(sp24->unk0c, &sp30, OS_MESG_BLOCK); - osSendMesg(sp34->hdr.retQueue, sp34, OS_MESG_NOBLOCK); - osSendMesg(sp24->unk10, NULL, OS_MESG_NOBLOCK); - } - } -} -#endif diff --git a/lib/src/__osSiRawStartDma.c b/lib/src/__osSiRawStartDma.c deleted file mode 100644 index 965b718794..0000000000 --- a/lib/src/__osSiRawStartDma.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -s32 __osSiRawStartDma(s32 dir, void *addr) { - if (__osSiDeviceBusy()) { - return -1; - } - - if (dir == OS_WRITE) { - osWritebackDCache(addr, 64); - } - - HW_REG(SI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(addr); - - if (dir == OS_READ) { - HW_REG(SI_PIF_ADDR_RD64B_REG, u32) = 0x1FC007C0; - } else { - HW_REG(SI_PIF_ADDR_WR64B_REG, u32) = 0x1FC007C0; - } - - if (dir == OS_READ) { - osInvalDCache(addr, 64); - } - return 0; -} diff --git a/lib/src/__osSyncPutChars.c b/lib/src/__osSyncPutChars.c deleted file mode 100644 index a27ef60f8c..0000000000 --- a/lib/src/__osSyncPutChars.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "libultra_internal.h" - -typedef struct { - u8 unk00 : 2; - u8 pad : 4; - u8 unk01 : 2; - u8 unk2[3]; -} unkStruct; - -u32 D_80334A40 = 0; -u32 D_80334A44 = 1; - -void __osSyncPutChars(s32 a0, s32 a1, u8 *a2) { - unkStruct sp24; - s32 sp20; - u32 sp1c; - sp24.unk00 = a0; - sp24.unk01 = a1; - - for (sp20 = 0; sp20 < a1; sp20++) { - sp24.unk2[sp20] = a2[sp20]; - } - - while (!__osAtomicDec(&D_80334A44)) { - ; - } - - sp1c = __osDisableInt(); - - *(u32 *) 0xC0000000 = *(u32 *) &sp24; - while (!(__osGetCause() & 0x2000)) { - ; - } - *(u32 *) 0xC000000C = 0; - D_80334A44++; - - __osRestoreInt(sp1c); -} diff --git a/lib/src/__osViGetCurrentContext.c b/lib/src/__osViGetCurrentContext.c deleted file mode 100644 index 1482e04845..0000000000 --- a/lib/src/__osViGetCurrentContext.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334910; -OSViContext *__osViGetCurrentContext() { - return D_80334910; -} diff --git a/lib/src/__osViInit.c b/lib/src/__osViInit.c deleted file mode 100644 index 92d649581e..0000000000 --- a/lib/src/__osViInit.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -#ifndef VERSION_JP -extern u32 osTvType; -#endif - -OSViContext D_803348B0[2] = { 0 }; -OSViContext *D_80334910 = &D_803348B0[0]; -OSViContext *D_80334914 = &D_803348B0[1]; -#ifdef VERSION_EU -u32 D_8033491C = 0x02E6D354; -u32 D_80334918 = TV_TYPE_PAL; -#else -u32 D_80334918 = TV_TYPE_NTSC; -u32 D_8033491C = 0x02E6D354; -#endif - -extern OSViMode D_80334990; -extern OSViMode D_803349E0; -#ifdef VERSION_EU -extern OSViMode D_80302FD0; -#endif - -void __osViInit(void) { -//#ifdef VERSION_JP -#ifdef VERSION_US - D_80334918 = osTvType; -#endif - bzero(D_803348B0, sizeof(D_803348B0)); - D_80334910 = &D_803348B0[0]; - D_80334914 = &D_803348B0[1]; - D_80334914->retraceCount = 1; - D_80334910->retraceCount = 1; - -#ifdef VERSION_EU - - if (osTvType == TV_TYPE_PAL) { - D_80334914->unk08 = &D_80334990; - D_8033491C = 0x02F5B2D2; - } else if (osTvType == TV_TYPE_MPAL) { - D_80334914->unk08 = &D_803349E0; - D_8033491C = 0x02E6025C; - } else { - D_80334914->unk08 = &D_80302FD0; - D_8033491C = 0x02E6D354; - } - -#else -#ifdef VERSION_JP - if (D_80334918 != TV_TYPE_PAL) -#else - if (D_80334918 == TV_TYPE_NTSC) -#endif - { - D_80334914->unk08 = &D_80334990; - D_8033491C = 0x02E6D354; - } else { - D_80334914->unk08 = &D_803349E0; -#ifdef VERSION_JP - D_8033491C = 0x02F5B2D2; -#else - D_8033491C = 0x02E6025C; -#endif - } -#endif - D_80334914->unk00 = 32; - D_80334914->features = D_80334914->unk08->comRegs.ctrl; -#ifndef VERSION_JP - while (HW_REG(VI_CURRENT_REG, u32) > 0xa) { - ; - } - HW_REG(VI_STATUS_REG, u32) = 0; -#endif - __osViSwapContext(); -} diff --git a/lib/src/__osViSwapContext.c b/lib/src/__osViSwapContext.c deleted file mode 100644 index d774199453..0000000000 --- a/lib/src/__osViSwapContext.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -extern OSViContext *D_80334914; -extern OSViContext *D_80334910; -void __osViSwapContext() { - register OSViMode *s0; - register OSViContext *s1; - u32 origin; - u32 hStart; - u32 sp34; - u32 field; - register u32 s2; - field = 0; - s1 = D_80334914; - s0 = s1->unk08; - field = HW_REG(VI_V_CURRENT_LINE_REG, u32) & 1; - s2 = osVirtualToPhysical(s1->buffer); - origin = (s0->fldRegs[field].origin) + s2; - if (s1->unk00 & 2) { - s1->unk20 |= s0->comRegs.xScale & ~0xfff; - } else { - s1->unk20 = s0->comRegs.xScale; - } - if (s1->unk00 & 4) { - sp34 = (u32)(s0->fldRegs[field].yScale & 0xfff); - s1->unk2c = s1->unk24 * sp34; - s1->unk2c |= s0->fldRegs[field].yScale & ~0xfff; - } else { - s1->unk2c = s0->fldRegs[field].yScale; - } - hStart = s0->comRegs.hStart; - if (s1->unk00 & 0x20) { - hStart = 0; - } - if (s1->unk00 & 0x40) { - s1->unk2c = 0; - origin = osVirtualToPhysical(s1->buffer); - } - if (s1->unk00 & 0x80) { - s1->unk2c = (s1->unk28 << 0x10) & 0x3ff0000; - origin = osVirtualToPhysical(s1->buffer); - } - HW_REG(VI_ORIGIN_REG, u32) = origin; - HW_REG(VI_WIDTH_REG, u32) = s0->comRegs.width; - HW_REG(VI_BURST_REG, u32) = s0->comRegs.burst; - HW_REG(VI_V_SYNC_REG, u32) = s0->comRegs.vSync; - HW_REG(VI_H_SYNC_REG, u32) = s0->comRegs.hSync; - HW_REG(VI_LEAP_REG, u32) = s0->comRegs.leap; - HW_REG(VI_H_START_REG, u32) = hStart; - HW_REG(VI_V_START_REG, u32) = s0->fldRegs[field].vStart; - HW_REG(VI_V_BURST_REG, u32) = s0->fldRegs[field].vBurst; - HW_REG(VI_INTR_REG, u32) = s0->fldRegs[field].vIntr; - HW_REG(VI_X_SCALE_REG, u32) = s1->unk20; - HW_REG(VI_Y_SCALE_REG, u32) = s1->unk2c; - HW_REG(VI_CONTROL_REG, u32) = s1->features; - D_80334914 = D_80334910; - D_80334910 = s1; - *D_80334914 = *D_80334910; -} diff --git a/lib/src/func_802F4A20.c b/lib/src/func_802F4A20.c deleted file mode 100644 index f1e8562554..0000000000 --- a/lib/src/func_802F4A20.c +++ /dev/null @@ -1,170 +0,0 @@ -#include "new_func.h" - -void func_802F4A20() { - __OSTranxInfo *sp1c; - volatile u32 sp18; - // lui $t6, %hi(__osDiskHandle) # $t6, 0x8033 - // lw $t6, %lo(__osDiskHandle)($t6) - // addiu $sp, $sp, -0x20 - // sw $ra, 0x14($sp) - // addiu $t7, $t6, 0x14 - // sw $t7, 0x1c($sp) - sp1c = &__osDiskHandle->transferInfo; - // lui $t8, %hi(PI_STATUS_REG) # $t8, 0xa460 - // lw $t9, %lo(PI_STATUS_REG)($t8) - // sw $t9, 0x18($sp) - // sp18 = HW_REG(PI_STATUS_REG, u32); - // while(sp18 & 0x2) sp18 = HW_REG(PI_STATUS_REG, u32); - WAIT_ON_IOBUSY(sp18); - // lw $t0, 0x18($sp) - // andi $t1, $t0, 2 - // beqz $t1, .L802F4A70 - // nop - // L802F4A54: - // lui $t2, %hi(PI_STATUS_REG) # $t2, 0xa460 - // lw $t3, %lo(PI_STATUS_REG)($t2) - // sw $t3, 0x18($sp) - // lw $t4, 0x18($sp) - // andi $t5, $t4, 2 - // bnez $t5, .L802F4A54 - // nop - - // L802F4A70: - // lw $t6, 0x1c($sp) - // lui $at, 0x1000 - // lui $t9, %hi(D_A5000510) # $t9, 0xa500 - // lw $t7, 0x14($t6) - // lui $t0, %hi(PI_STATUS_REG) # $t0, 0xa460 - // or $t8, $t7, $at - // sw $t8, %lo(D_A5000510)($t9) - HW_REG(ASIC_BM_CTL, u32) = BUFFER_MANAGER_RESET | sp1c->bmCtlShadow; //should be unk10?? - // lw $t1, %lo(PI_STATUS_REG)($t0) - // sw $t1, 0x18($sp) - // lw $t2, 0x18($sp) - // andi $t3, $t2, 2 - // beqz $t3, .L802F4AC0 - // nop - WAIT_ON_IOBUSY(sp18); - // L802F4AA4: - // lui $t4, %hi(PI_STATUS_REG) # $t4, 0xa460 - // lw $t5, %lo(PI_STATUS_REG)($t4) - // sw $t5, 0x18($sp) - // lw $t6, 0x18($sp) - // andi $t7, $t6, 2 - // bnez $t7, .L802F4AA4 - // nop - // L802F4AC0: - - // lw $t8, 0x1c($sp) - // lui $t0, %hi(D_A5000510) # $t0, 0xa500 - // lw $t9, 0x14($t8) - // jal func_802F4B08 - // sw $t9, %lo(D_A5000510)($t0) - HW_REG(ASIC_BM_CTL, u32) = sp1c->bmCtlShadow; - func_802F4B08(); - // li $t1, 2 - // lui $t2, %hi(PI_STATUS_REG) # $t2, 0xa460 - // sw $t1, %lo(PI_STATUS_REG)($t2) - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR; - // lui $t3, %hi(D_8030208C) # $t3, 0x8030 - // lw $t3, %lo(D_8030208C)($t3) - // lui $at, (0x00100401 >> 16) # lui $at, 0x10 - // lw $ra, 0x14($sp) - // ori $at, (0x00100401 & 0xFFFF) # ori $at, $at, 0x401 - // or $t4, $t3, $at - // lui $at, %hi(D_8030208C) # $at, 0x8030 - // sw $t4, %lo(D_8030208C)($at) - D_8030208C |= 0x00100401; //TODO: fix magic numbers - // jr $ra - // addiu $sp, $sp, 0x20 -} - -typedef struct OSEventMessageStruct_0_s { - OSMesgQueue *queue; - OSMesg msg; -} OSEventMessageStruct_0; - -extern OSEventMessageStruct_0 D_80363830[16]; // should be OS_NUM_EVENTS + 1 I think -void func_802F4B08() { - OSEventMessageStruct_0 *sp2c; - OSMesgQueue *sp28; - u32 sp24; - register OSThread *s0; - // addiu $sp, $sp, -0x30 - // lui $t6, %hi(D_80363830) # $t6, 0x8033 - // addiu $t6, %lo(D_80363830) # addiu $t6, $t6, 0x36d0 - // addiu $t7, $t6, 0x40 - // sw $ra, 0x1c($sp) - // sw $s0, 0x18($sp) - // sw $t7, 0x2c($sp) - sp2c = &D_80363830[OS_EVENT_PI]; - // lw $t8, 0x40($t6) - // beqz $t8, .L802F4BE0 - // sw $t8, 0x28($sp) - sp28 = sp2c->queue; - // lw $t9, 8($t8) - // lw $t0, 0x10($t8) - // slt $at, $t9, $t0 - // beqz $at, .L802F4BE0 - // nop - if (!sp28 || sp28->validCount >= sp28->msgCount) - return; - // lw $t1, 0x28($sp) - // lw $t6, 0x2c($sp) - // lw $t2, 0xc($t1) - // lw $t3, 8($t1) - // lw $t5, 0x10($t1) - // addu $t4, $t2, $t3 - // div $zero, $t4, $t5 - // mfhi $t7 - // sw $t7, 0x24($sp) - sp24 = (sp28->first + sp28->validCount) % sp28->msgCount; - // lw $t0, 0x14($t1) - // lw $t8, 4($t6) - // sll $t9, $t7, 2 - // addu $t2, $t0, $t9 - // sw $t8, ($t2) - sp28->msg[sp24] = sp2c->msg; - // lw $t3, 0x28($sp) - // bnez $t5, .L802F4B8C - // nop - // break 7 - // L802F4B8C: - // li $at, -1 - // bne $t5, $at, .L802F4BA4 - // lui $at, 0x8000 - // bne $t4, $at, .L802F4BA4 - // nop - // break 6 - // L802F4BA4: - // lw $t4, 8($t3) - // addiu $t5, $t4, 1 - // sw $t5, 8($t3) - sp28->validCount += 1; - // lw $t6, 0x28($sp) - // lw $t7, ($t6) - // lw $t1, ($t7) - // beqz $t1, .L802F4BE0 - // nop - // jal __osPopThread - // move $a0, $t6 - if (sp28->mtqueue->next != NULL) { - s0 = __osPopThread(&sp28->mtqueue); - // move $s0, $v0 - // lui $a0, %hi(D_80334898) # $a0, 0x8030 - // addiu $a0, %lo(D_80334898) # addiu $a0, $a0, 0x2ef8 - // jal __osEnqueueThread - // move $a1, $s0 - __osEnqueueThread(&D_80334898, s0); - } - // L802F4BE0: - // lw $ra, 0x1c($sp) - // lw $s0, 0x18($sp) - // addiu $sp, $sp, 0x30 - // jr $ra - // nop - - // nop - // nop - // nop -} diff --git a/lib/src/func_802F7140.c b/lib/src/func_802F7140.c deleted file mode 100644 index 3c328c69a9..0000000000 --- a/lib/src/func_802F7140.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "libultra_internal.h" -extern u32 D_8030208C; -void func_802F7140(u32 a0) { - register u32 s0; - s0 = __osDisableInt(); - D_8030208C &= ~(-0x402 & a0); - __osRestoreInt(s0); -} -/* -/ 0B6940 802F7140 27BDFFD8 / addiu $sp, $sp, -0x28 -/ 0B6944 802F7144 AFBF001C / sw $ra, 0x1c($sp) -/ 0B6948 802F7148 AFA40028 / sw $a0, 0x28($sp) -/ 0B694C 802F714C 0C0BD400 / jal __osDisableInt -/ 0B6950 802F7150 AFB00018 / sw $s0, 0x18($sp) -/ 0B6954 802F7154 8FAF0028 / lw $t7, 0x28($sp) -/ 0B6958 802F7158 3C0E8030 / lui $t6, %hi(D_8030208C) # $t6, 0x8030 -/ 0B695C 802F715C 8DCE208C / lw $t6, %lo(D_8030208C)($t6) -/ 0B6960 802F7160 2401FBFE / li $at, -1026 -/ 0B6964 802F7164 01E1C024 / and $t8, $t7, $at -/ 0B6968 802F7168 0300C827 / not $t9, $t8 -/ 0B696C 802F716C 00408025 / move $s0, $v0 -/ 0B6970 802F7170 3C018030 / lui $at, %hi(D_8030208C) # $at, 0x8030 -/ 0B6974 802F7174 01D94024 / and $t0, $t6, $t9 -/ 0B6978 802F7178 AC28208C / sw $t0, %lo(D_8030208C)($at) -/ 0B697C 802F717C 0C0BD408 / jal __osRestoreInt -/ 0B6980 802F7180 02002025 / move $a0, $s0 -/ 0B6984 802F7184 8FBF001C / lw $ra, 0x1c($sp) -/ 0B6988 802F7188 8FB00018 / lw $s0, 0x18($sp) -/ 0B698C 802F718C 27BD0028 / addiu $sp, $sp, 0x28 -/ 0B6990 802F7190 03E00008 / jr $ra -/ 0B6994 802F7194 00000000 / nop */ diff --git a/lib/src/func_802F71F0.c b/lib/src/func_802F71F0.c deleted file mode 100644 index 6785cc42fb..0000000000 --- a/lib/src/func_802F71F0.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "libultra_internal.h" - -void func_802F71F0() { - register u32 s0 = __osDisableInt(); - D_803348A0->state = OS_STATE_RUNNABLE; - __osEnqueueAndYield(&D_80334898); - __osRestoreInt(s0); -} -/* -/ 0B69F0 802F71F0 27BDFFD8 / addiu $sp, $sp, -0x28 -/ 0B69F4 802F71F4 AFBF001C / sw $ra, 0x1c($sp) -/ 0B69F8 802F71F8 0C0BD400 / jal __osDisableInt -/ 0B69FC 802F71FC AFB00018 / sw $s0, 0x18($sp) -/ 0B6A00 802F7200 3C0F8030 / lui $t7, %hi(D_803348A0) # $t7, 0x8030 -/ 0B6A04 802F7204 8DEF2F00 / lw $t7, %lo(D_803348A0)($t7) -/ 0B6A08 802F7208 240E0002 / li $t6, 2 -/ 0B6A0C 802F720C 3C048030 / lui $a0, %hi(D_80334898) # $a0, 0x8030 -/ 0B6A10 802F7210 00408025 / move $s0, $v0 -/ 0B6A14 802F7214 24842EF8 / addiu $a0, %lo(D_80334898) # addiu $a0, $a0, 0x2ef8 -/ 0B6A18 802F7218 0C0BCFC3 / jal __osEnqueueAndYield -/ 0B6A1C 802F721C A5EE0010 / sh $t6, 0x10($t7) - -/ 0B6A20 802F7220 0C0BD408 / jal __osRestoreInt -/ 0B6A24 802F7224 02002025 / move $a0, $s0 -/ 0B6A28 802F7228 8FBF001C / lw $ra, 0x1c($sp) -/ 0B6A2C 802F722C 8FB00018 / lw $s0, 0x18($sp) -/ 0B6A30 802F7230 27BD0028 / addiu $sp, $sp, 0x28 -/ 0B6A34 802F7234 03E00008 / jr $ra -/ 0B6A38 802F7238 00000000 / nop - -/ 0B6A3C 802F723C 00000000 / nop */ diff --git a/lib/src/kdebugserver.c b/lib/src/kdebugserver.c deleted file mode 100644 index 96743337ea..0000000000 --- a/lib/src/kdebugserver.c +++ /dev/null @@ -1,131 +0,0 @@ -#include "libultra_internal.h" - -typedef struct { - u8 unk00 : 2; - u8 pad : 4; - u8 unk01 : 2; - u8 unk2[3]; -} unkStruct; - -extern u32 D_80334A44; - -u32 D_80334A30 = 0; -u32 D_80334A34 = 0; -s32 D_80334A38 = 0; - -extern u8 D_80365E40[0x1000]; - -OSThread gInterruptedThread; - -void u32_to_string(u32 i, u8 *str) { - str[0] = (i >> 0x18) & 0xff; - str[1] = (i >> 0x10) & 0xff; - str[2] = (i >> 0x8) & 0xff; - str[3] = i & 0xff; -} - -u32 string_to_u32(u8 *str) { - u32 i; - i = (str[0] & 0xff) << 0x18; - i |= (str[1] & 0xff) << 0x10; - i |= (str[2] & 0xff) << 0x8; - i |= (str[3] & 0xff); - return i; -} - -void send_packet(u8 *a0, s32 a1) { - unkStruct sp1c; - s32 i; - sp1c.unk00 = 2; - for (sp1c.unk01 = a1, i = 0; i < a1; i++) { - sp1c.unk2[i] = a0[i]; - } - *(volatile u32 *) 0xc0000000 = *(u32 *) &sp1c; - while (!(__osGetCause() & 0x2000)) { - ; - } - *(volatile u32 *) 0xc000000c = 0; -} - -void send(u8 *buff, s32 len) { - s32 i; - s32 end; - s32 rem; - if (!D_80334A44) { - while (!(__osGetCause() & 0x2000)) { - ; - } - *(volatile u32 *) 0xc000000c = 0; - D_80334A44 = 1; - } - i = 0; - rem = len % 3; - end = len - rem; - for (; i < end; i += 3) { - send_packet(&buff[i], 3); - } - if (rem > 0) { - send_packet(&buff[end], rem); - } -} -void process_command_memory() { - u32 sp1c; - u32 sp18; - sp1c = string_to_u32(&D_80365E40[1]); - sp18 = string_to_u32(&D_80365E40[5]); - send((u8 *) (uintptr_t) sp1c, sp18); -} -void process_command_register() { - send((u8 *) &gInterruptedThread.context, sizeof(__OSThreadContext)); -} - -void kdebugserver(u32 a0) { - u32 sp2c; - unkStruct sp28; - *(u32 *) &sp28 = a0; - for (sp2c = 0; sp2c < sp28.unk01; sp2c++) { - D_80365E40[D_80334A34] = sp28.unk2[sp2c]; - D_80334A34++; - } - D_80334A38 -= sp28.unk01; - switch (D_80334A30) { - case 0: - switch (sp28.unk2[0]) { - case 1: - D_80334A30 = 1; - D_80334A38 = 9 - sp28.unk01; - break; - case 2: - process_command_register(); - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - break; - default: - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - break; - } - break; - case 1: - if (D_80334A38 <= 0) { - if (D_80365E40[0] == 1) { - process_command_memory(); - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - } else { - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - } - } - break; - default: - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - break; - } -} diff --git a/lib/src/osAiGetLength.c b/lib/src/osAiGetLength.c deleted file mode 100644 index 08458a7ab8..0000000000 --- a/lib/src/osAiGetLength.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libultra_internal.h" -#include "osAi.h" -#include "hardware.h" - -u32 osAiGetLength() { - return HW_REG(AI_LEN_REG, u32); -} diff --git a/lib/src/osAiSetFrequency.c b/lib/src/osAiSetFrequency.c deleted file mode 100644 index 7ece6a15d9..0000000000 --- a/lib/src/osAiSetFrequency.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "libultra_internal.h" -#include "osAi.h" -#include "hardware.h" - -extern s32 D_8033491C; - -s32 osAiSetFrequency(u32 freq) { - register u32 a1; - register s32 a2; - register float ftmp; - ftmp = D_8033491C / (float) freq + .5f; - - a1 = ftmp; - - if (a1 < 0x84) { - return -1; - } - - a2 = (a1 / 66) & 0xff; - if (a2 > 16) { - a2 = 16; - } - - HW_REG(AI_DACRATE_REG, u32) = a1 - 1; - HW_REG(AI_BITRATE_REG, u32) = a2 - 1; - HW_REG(AI_CONTROL_REG, u32) = 1; // enable dma - return D_8033491C / (s32) a1; -} - -// put some extra jr $ra's down there please -static void filler1(void) { -} -static void filler2(void) { -} diff --git a/lib/src/osAiSetNextBuffer.c b/lib/src/osAiSetNextBuffer.c deleted file mode 100644 index cc27ae4c90..0000000000 --- a/lib/src/osAiSetNextBuffer.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "libultra_internal.h" -#include "osAi.h" -#include "hardware.h" - -u8 D_80334820 = 0; - -/** - * It is worth noting that a previous hardware bug has been fixed by a software - * patch in osAiSetNextBuffer. This bug occurred when the address of the end of the - * buffer specified by osAiSetNextBuffer was at a specific value. This value - * occurred when the following was true: - * - * (vaddr + nbytes) & 0x00003FFF == 0x00002000 - * - * (when the buffer ends with address of lower 14 bits 0x2000) In this case, the - * DMA transfer does not complete successfully. This can cause clicks and pops in - * the audio output. This bug no longer requires special handling by the application - * because it is now patched by osAiSetNextBuffer. - */ - -s32 osAiSetNextBuffer(void *buff, u32 len) { - u8 *sp1c = buff; - if (D_80334820 != 0) { - sp1c -= 0x2000; - } - - if ((((uintptr_t) buff + len) & 0x3fff) == 0x2000) { - D_80334820 = 1; - } else { - D_80334820 = 0; - } - - if (__osAiDeviceBusy()) { - return -1; - } - - HW_REG(AI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(sp1c); - HW_REG(AI_LEN_REG, u32) = len; - return 0; -} diff --git a/lib/src/osContInit.c b/lib/src/osContInit.c deleted file mode 100644 index d40bf7e043..0000000000 --- a/lib/src/osContInit.c +++ /dev/null @@ -1,99 +0,0 @@ -#include "libultra_internal.h" -#include "osContInternal.h" - -void __osPackRequestData(u8); -void __osContGetInitData(u8 *, OSContStatus *); - -u32 D_80334810 = 0; // probably initialized - -extern u64 osClockRate; - -// these probably belong in EEPROMlongread or something -u8 D_80365D20; -u8 _osCont_numControllers; -OSTimer D_80365D28; // some kind of buffer, or maybe an as yet unknown struct -OSMesgQueue _osContMesgQueue; -OSMesg _osContMesgBuff[4]; -s32 osContInit(OSMesgQueue *mq, u8 *a1, OSContStatus *status) { - OSMesg mesg; - u32 sp78 = 0; - OSTime currentTime; - OSTimer sp50; - OSMesgQueue sp38; - - if (D_80334810) { - return 0; - } - D_80334810 = 1; - currentTime = osGetTime(); - if (500000 * osClockRate / 1000000 > currentTime) { - osCreateMesgQueue(&sp38, &mesg, 1); - osSetTimer(&sp50, 500000 * osClockRate / 1000000 - currentTime, 0, &sp38, &mesg); - osRecvMesg(&sp38, &mesg, OS_MESG_BLOCK); - } - _osCont_numControllers = 4; // TODO: figure out what it means -#ifdef VERSION_EU - __osPackRequestData(0); -#else - __osPackRequestData(255); -#endif - sp78 = __osSiRawStartDma(1, D_80365CE0); - osRecvMesg(mq, &mesg, OS_MESG_BLOCK); - sp78 = __osSiRawStartDma(0, D_80365CE0); - osRecvMesg(mq, &mesg, OS_MESG_BLOCK); - __osContGetInitData(a1, status); -#ifdef VERSION_EU - D_80365D20 = 0; -#else - D_80365D20 = 255; -#endif - __osSiCreateAccessQueue(); - osCreateMesgQueue(&_osContMesgQueue, _osContMesgBuff, 1); - return sp78; -} -void __osContGetInitData(u8 *a0, OSContStatus *status) { - OSContPackedRequest *sp14; - OSContPackedRequest spc; - s32 i; - u8 sp7; - - sp7 = 0; - sp14 = &(D_80365CE0[0].request); - for (i = 0; i < _osCont_numControllers; i++, sp14++, status++) { - spc = *(OSContPackedRequest *) sp14; - status->errnum = (spc.unk02 & 0xc0) >> 4; - if (status->errnum == 0) { - status->type = spc.unk05 << 8 | spc.unk04; - status->status = spc.unk06; - - sp7 |= 1 << i; - } - } - *a0 = sp7; -} -void __osPackRequestData(u8 a0) { - OSContPackedRequest *spc; - OSContPackedRequest sp4; - s32 i; - - // some kind of weird zeroing code - for (i = 0; i < 0x10; i++) { - *((u32 *) &D_80365CE0 + i) = 0; - } - - D_80365D1C = 1; - spc = &D_80365CE0[0].request; - sp4.unk00 = 255; - sp4.unk01 = 1; - sp4.unk02 = 3; - sp4.unk03 = a0; - sp4.unk04 = 255; - sp4.unk05 = 255; - sp4.unk06 = 255; - sp4.unk07 = 255; - - for (i = 0; i < _osCont_numControllers; i++) { - *spc++ = sp4; - } - spc->unk00 = 254; -} diff --git a/lib/src/osContStartReadData.c b/lib/src/osContStartReadData.c deleted file mode 100644 index 3f3c43e978..0000000000 --- a/lib/src/osContStartReadData.c +++ /dev/null @@ -1,73 +0,0 @@ -#include "libultra_internal.h" -#include "osContInternal.h" -#include - -#ifndef AVOID_UB -OSContPackedStruct D_80365CE0[7]; -UNUSED static u32 unused; // padding between these two variables -u32 D_80365D1C; -#else -// Reordered gcc vars above will disturb the aliasing done to access all 8 members of this array, hence AVOID_UB. -OSContPackedStruct D_80365CE0[8]; -#endif - -extern u8 D_80365D20; -extern u8 _osCont_numControllers; - -void __osPackReadData(void); -s32 osContStartReadData(OSMesgQueue *mesg) { - s32 ret = 0; - s32 i; - __osSiGetAccess(); - if (D_80365D20 != 1) { - __osPackReadData(); - ret = __osSiRawStartDma(1, D_80365CE0); - osRecvMesg(mesg, NULL, OS_MESG_BLOCK); - } - for (i = 0; i < 0x10; i++) { - *((u32 *) &D_80365CE0 + i) = 255; - } - - D_80365D1C = 0; - ret = __osSiRawStartDma(0, &D_80365CE0); - D_80365D20 = 1; - __osSiRelAccess(); - return ret; -} -void osContGetReadData(OSContPad *pad) { - OSContPackedRead *spc; - OSContPackedRead sp4; - s32 i; - spc = &D_80365CE0[0].read; - for (i = 0; i < _osCont_numControllers; i++, spc++, pad++) { - sp4 = *spc; - pad->errnum = (sp4.unk02 & 0xc0) >> 4; - if (pad->errnum == 0) { - pad->button = sp4.button; - pad->stick_x = sp4.rawStickX; - pad->stick_y = sp4.rawStickY; - } - }; -} -void __osPackReadData() { - OSContPackedRead *spc; - OSContPackedRead sp4; - s32 i; - spc = &D_80365CE0[0].read; - for (i = 0; i < 0x10; i++) { - *((u32 *) &D_80365CE0 + i) = 0; - } - - D_80365D1C = 1; - sp4.unk00 = 255; - sp4.unk01 = 1; - sp4.unk02 = 4; - sp4.unk03 = 1; - sp4.button = 65535; - sp4.rawStickX = -1; - sp4.rawStickY = -1; - for (i = 0; i < _osCont_numControllers; i++) { - *spc++ = sp4; - } - spc->unk00 = 254; -} diff --git a/lib/src/osCreatePiManager.c b/lib/src/osCreatePiManager.c deleted file mode 100644 index 0bdc9d2e80..0000000000 --- a/lib/src/osCreatePiManager.c +++ /dev/null @@ -1,53 +0,0 @@ -#include "libultra_internal.h" - -#define OS_PI_MGR_MESG_BUFF_SIZE 1 - -OSMgrArgs piMgrArgs = { 0 }; -#if defined(VERSION_EU) || defined(VERSION_SH) -OSPiHandle *D_80302DFC = NULL; -#endif -OSThread piMgrThread; -u32 piMgrStack[0x400]; // stack bottom -OSMesgQueue __osPiMesgQueue; -OSMesg piMgrMesgBuff[OS_PI_MGR_MESG_BUFF_SIZE + 1]; - -extern u32 gOsPiAccessQueueCreated; -extern OSMesgQueue gOsPiMessageQueue; -void __osDevMgrMain(void *); - -void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt) { - u32 int_disabled; - OSPri newPri; - OSPri currentPri; - - if (!piMgrArgs.initialized) { - osCreateMesgQueue(cmdQ, cmdBuf, cmdMsgCnt); - osCreateMesgQueue(&__osPiMesgQueue, &piMgrMesgBuff[0], OS_PI_MGR_MESG_BUFF_SIZE); - if (!gOsPiAccessQueueCreated) { - __osPiCreateAccessQueue(); - } // what is this constant geez - osSetEventMesg(OS_EVENT_PI, &__osPiMesgQueue, (void *) 0x22222222); - newPri = -1; - currentPri = osGetThreadPri(NULL); - if (currentPri < pri) { - newPri = currentPri; - osSetThreadPri(NULL, pri); - } - int_disabled = __osDisableInt(); - piMgrArgs.initialized = TRUE; - piMgrArgs.mgrThread = &piMgrThread; - piMgrArgs.unk08 = cmdQ; - piMgrArgs.unk0c = &__osPiMesgQueue; - piMgrArgs.unk10 = &gOsPiMessageQueue; - piMgrArgs.dma_func = osPiRawStartDma; -#ifdef VERSION_EU - piMgrArgs.edma_func = osEPiRawStartDma; -#endif - osCreateThread(&piMgrThread, 0, __osDevMgrMain, (void *) &piMgrArgs, &piMgrStack[0x400], pri); - osStartThread(&piMgrThread); - __osRestoreInt(int_disabled); - if (newPri != -1) { - osSetThreadPri(NULL, newPri); - } - } -} diff --git a/lib/src/osCreateThread.c b/lib/src/osCreateThread.c deleted file mode 100644 index b4e283f27c..0000000000 --- a/lib/src/osCreateThread.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "libultra_internal.h" - -void __osCleanupThread(void); - -// Don't warn about pointer->u64 cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpointer-to-int-cast" - -void osCreateThread(OSThread *thread, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri pri) { - register u32 int_disabled; - u32 tmp; - thread->id = id; - thread->priority = pri; - thread->next = NULL; - thread->queue = NULL; - thread->context.pc = (u32) entry; - thread->context.a0 = (u64) arg; - thread->context.sp = (u64) sp - 16; - thread->context.ra = (u64) __osCleanupThread; - tmp = OS_IM_ALL; - thread->context.sr = 65283; - thread->context.rcp = (tmp & 0x3f0000) >> 16; - thread->context.fpcsr = (u32) 0x01000800; - thread->fp = 0; - thread->state = OS_STATE_STOPPED; - thread->flags = 0; - int_disabled = __osDisableInt(); - thread->tlnext = D_8033489C; - - D_8033489C = thread; - __osRestoreInt(int_disabled); -} - -#pragma GCC diagnostic pop diff --git a/lib/src/osCreateViManager.c b/lib/src/osCreateViManager.c deleted file mode 100644 index 65e10d11a7..0000000000 --- a/lib/src/osCreateViManager.c +++ /dev/null @@ -1,108 +0,0 @@ -#include "libultra_internal.h" - -#define OS_VI_MANAGER_MESSAGE_BUFF_SIZE 5 - -static OSMgrArgs viMgrMainArgs = { 0 }; -static OSThread viMgrThread; -static u32 viMgrStack[0x400]; // stack bottom -static OSMesgQueue __osViMesgQueue; -static OSMesg viMgrMesgBuff[OS_VI_MANAGER_MESSAGE_BUFF_SIZE]; - -static OSIoMesg viEventViMesg; -static OSIoMesg viEventCounterMesg; - -extern void __osTimerServicesInit(void); -extern void __osTimerInterrupt(void); -extern OSTime _osCurrentTime; -extern u32 D_80365DA8; -extern u32 __osViIntrCount; -void viMgrMain(void *); - -void osCreateViManager(OSPri pri) { - u32 int_disabled; - OSPri newPri; - OSPri currentPri; - if (!viMgrMainArgs.initialized) { - __osTimerServicesInit(); - osCreateMesgQueue(&__osViMesgQueue, &viMgrMesgBuff[0], OS_VI_MANAGER_MESSAGE_BUFF_SIZE); - viEventViMesg.hdr.type = 13; - viEventViMesg.hdr.pri = 0; - viEventViMesg.hdr.retQueue = 0; - viEventCounterMesg.hdr.type = 14; - viEventCounterMesg.hdr.pri = 0; - viEventCounterMesg.hdr.retQueue = 0; - osSetEventMesg(OS_EVENT_VI, &__osViMesgQueue, &viEventViMesg); - osSetEventMesg(OS_EVENT_COUNTER, &__osViMesgQueue, &viEventCounterMesg); - newPri = -1; - currentPri = osGetThreadPri(NULL); - if (currentPri < pri) { - newPri = currentPri; - osSetThreadPri(NULL, pri); - } - int_disabled = __osDisableInt(); - viMgrMainArgs.initialized = TRUE; - viMgrMainArgs.mgrThread = &viMgrThread; - viMgrMainArgs.unk08 = &__osViMesgQueue; - viMgrMainArgs.unk0c = &__osViMesgQueue; - viMgrMainArgs.unk10 = NULL; - viMgrMainArgs.dma_func = NULL; -#ifdef VERSION_EU - viMgrMainArgs.edma_func = NULL; -#endif - - osCreateThread(&viMgrThread, 0, viMgrMain, (void *) &viMgrMainArgs, &viMgrStack[0x400], pri); - __osViInit(); - osStartThread(&viMgrThread); - __osRestoreInt(int_disabled); - if (newPri != -1) { - osSetThreadPri(NULL, newPri); - } - } -} -void viMgrMain(void *vargs) { - static u16 retrace; - OSViContext *context; - OSMgrArgs *args; - OSMesg mesg; - u32 sp28; // always 0 - u32 sp24; // time related - mesg = NULL; - sp28 = FALSE; - context = __osViGetCurrentContext(); - - if ((retrace = context->retraceCount) == 0) { - retrace = 1; - } - - args = (OSMgrArgs *) vargs; - - while (1) { - osRecvMesg(args->unk0c, &mesg, OS_MESG_BLOCK); - switch (*(u16 *) mesg) { - case 13: - __osViSwapContext(); - if (!--retrace) { - context = __osViGetCurrentContext(); - if (context->mq != NULL) { - osSendMesg(context->mq, context->msg, OS_MESG_NOBLOCK); - } - retrace = context->retraceCount; - } - __osViIntrCount++; - if (sp28) { - sp24 = osGetCount(); - _osCurrentTime = sp24; - sp28 = 0; - } - sp24 = D_80365DA8; - D_80365DA8 = osGetCount(); - sp24 = D_80365DA8 - sp24; - _osCurrentTime = _osCurrentTime + sp24; - break; - - case 14: - __osTimerInterrupt(); - break; - } - } -} diff --git a/lib/src/osDestroyThread.c b/lib/src/osDestroyThread.c deleted file mode 100644 index 215ce07377..0000000000 --- a/lib/src/osDestroyThread.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "libultra_internal.h" - -void osDestroyThread(OSThread *thread) { - register s32 int_disabled; - register OSThread *s1; - register OSThread *s2; - - int_disabled = __osDisableInt(); - - if (thread == NULL) { - thread = D_803348A0; - } else if (thread->state != OS_STATE_STOPPED) { - __osDequeueThread(thread->queue, thread); - } - - if (D_8033489C == thread) { - D_8033489C = D_8033489C->tlnext; - } else { - s1 = D_8033489C; - s2 = s1->tlnext; - while (s2 != NULL) { - if (s2 == thread) { - s1->tlnext = thread->tlnext; - break; - } else { - s1 = s2; - s2 = s1->tlnext; - } - } - } - - if (thread == D_803348A0) { - __osDispatchThread(); - } - - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osEepromLongRead.c b/lib/src/osEepromLongRead.c deleted file mode 100644 index 2a0b956b2b..0000000000 --- a/lib/src/osEepromLongRead.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "libultra_internal.h" - -extern u64 osClockRate; -extern u8 D_80365D20; -extern u8 _osCont_numControllers; -extern OSTimer D_80365D28; // not sure what this is yet -extern OSMesgQueue _osContMesgQueue; -extern OSMesg _osContMesgBuff[4]; - -s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes) { - s32 status = 0; - if (address > 0x40) { - return -1; - } - - while (nbytes > 0) { - status = osEepromRead(mq, address, buffer); - if (status != 0) { - return status; - } - - nbytes -= 8; - address += 1; - buffer += 8; - osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff); - osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK); - } - return status; -} diff --git a/lib/src/osEepromLongWrite.c b/lib/src/osEepromLongWrite.c deleted file mode 100644 index 78c094f045..0000000000 --- a/lib/src/osEepromLongWrite.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "libultra_internal.h" - -extern u64 osClockRate; -extern u8 D_80365D20; -extern u8 _osCont_numControllers; -extern OSTimer D_80365D28; -extern OSMesgQueue _osContMesgQueue; -extern OSMesg _osContMesgBuff[4]; -// exactly the same as osEepromLongRead except for osEepromWrite call - -s32 osEepromLongWrite(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes) { - s32 result = 0; - if (address > 0x40) { - return -1; - } - - while (nbytes > 0) { - result = osEepromWrite(mq, address, buffer); - if (result != 0) { - return result; - } - nbytes -= 8; - address += 1; - buffer += 8; - osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff); - osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK); - } - - return result; -} diff --git a/lib/src/osEepromProbe.c b/lib/src/osEepromProbe.c deleted file mode 100644 index d550b84645..0000000000 --- a/lib/src/osEepromProbe.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libultra_internal.h" - -// TODO: merge with osEepromWrite -typedef struct { - u16 unk00; - u8 unk02; - u8 unk03; -} unkStruct; - -s32 __osEepStatus(OSMesgQueue *, unkStruct *); -s32 osEepromProbe(OSMesgQueue *mq) { - s32 status = 0; - unkStruct sp18; - - __osSiGetAccess(); - status = __osEepStatus(mq, &sp18); - if (status == 0 && (sp18.unk00 & 0x8000) != 0) { - status = 1; - } else { - status = 0; - } - __osSiRelAccess(); - return status; -} diff --git a/lib/src/osEepromRead.c b/lib/src/osEepromRead.c deleted file mode 100644 index 9c4aa64180..0000000000 --- a/lib/src/osEepromRead.c +++ /dev/null @@ -1,99 +0,0 @@ -#include "libultra_internal.h" - -extern u8 D_80365D20; - -typedef struct { - u16 unk00; - u8 unk02; - u8 unk03; -} unkStruct; -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - u8 unk04; - u8 unk05; - u8 unk06; - u8 unk07; -} unkStruct3; - -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - unkStruct3 unk04; -} unkStruct2; - -s32 __osEepStatus(OSMesgQueue *, unkStruct *); -s32 __osPackEepReadData(u8); - -s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer) { - s32 sp34; - s32 sp30; - u8 *sp2c; - unkStruct sp28; - unkStruct2 sp20; - sp34 = 0; - sp30 = 0; - sp2c = (u8 *) &D_80365E00; - if (address > 0x40) { - return -1; - } - __osSiGetAccess(); - sp34 = __osEepStatus(mq, &sp28); - if (sp34 != 0 || sp28.unk00 != 0x8000) { - - return 8; - } - while (sp28.unk02 & 0x80) { - __osEepStatus(mq, &sp28); - } - __osPackEepReadData(address); - sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - for (sp30 = 0; sp30 < 0x10; sp30++) { - (D_80365E00)[sp30] = 255; - } - D_80365E3C = 0; - sp34 = __osSiRawStartDma(OS_READ, D_80365E00); - D_80365D20 = 4; - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - for (sp30 = 0; sp30 < 4; sp30++) { - sp2c++; - } - sp20 = *(unkStruct2 *) sp2c; - sp34 = (sp20.unk01 & 0xc0) >> 4; - if (sp34 == 0) { - for (sp30 = 0; sp30 < 8; sp30++) { - *buffer++ = ((u8 *) &sp20.unk04)[sp30]; - } - } - __osSiRelAccess(); - return sp34; -} - -s32 __osPackEepReadData(u8 address) { - u8 *sp14; - unkStruct2 sp8; - s32 sp4; - sp14 = (u8 *) &D_80365E00; - for (sp4 = 0; sp4 < 0x10; sp4++) { - D_80365E00[sp4] = 255; - } - D_80365E3C = 1; - sp8.unk00 = 2; - sp8.unk01 = 8; - sp8.unk02 = 4; - sp8.unk03 = address; - for (sp4 = 0; sp4 < 8; sp4++) { - ((u8 *) &sp8.unk04)[sp4] = 0; - } - for (sp4 = 0; sp4 < 4; sp4++) { - *sp14++ = 0; - } - *(unkStruct2 *) sp14 = sp8; - sp14 += 0xc; - *sp14 = 254; -} diff --git a/lib/src/osEepromWrite.c b/lib/src/osEepromWrite.c deleted file mode 100644 index ab7d544ae6..0000000000 --- a/lib/src/osEepromWrite.c +++ /dev/null @@ -1,167 +0,0 @@ -#include "libultra_internal.h" -#include "osContInternal.h" - -#ifndef AVOID_UB -u32 D_80365E00[15]; -u32 D_80365E3C; -#else -// Certain code accesses the 16th element (D_80365E3C) in this array, making a seperate -// definition UB when gcc rearranges those. -u32 D_80365E00[16]; -#endif -extern u8 D_80365D20; - -typedef struct { - u16 unk00; - u8 unk02; - u8 unk03; -} unkStruct; -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - u8 unk04; - u8 unk05; - u8 unk06; - u8 unk07; -} unkStruct3; - -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - unkStruct3 unk04; -} unkStruct2; - -s32 __osEepStatus(OSMesgQueue *, unkStruct *); -s32 __osPackEepWriteData(u8, u8 *); - -s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer) { - s32 sp34; - s32 sp30; - u8 *sp2c; - unkStruct2 sp20; - unkStruct sp1c; - sp34 = 0; - sp2c = (u8 *) &D_80365E00; - - if (address > 0x40) { - return -1; - } - - __osSiGetAccess(); - sp34 = __osEepStatus(mq, &sp1c); - - if (sp34 != 0 || sp1c.unk00 != 0x8000) { - return 8; - } - - while (sp1c.unk02 & 0x80) { - __osEepStatus(mq, &sp1c); - } - - __osPackEepWriteData(address, buffer); - - sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - - for (sp30 = 0; sp30 < 0x10; sp30++) { - (D_80365E00)[sp30] = 255; - } - - D_80365E3C = 0; - sp34 = __osSiRawStartDma(OS_READ, D_80365E00); - D_80365D20 = 5; - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - - for (sp30 = 0; sp30 < 4; sp30++) { - sp2c++; - } - - sp20 = *(unkStruct2 *) sp2c; - sp34 = (sp20.unk01 & 0xc0) >> 4; - __osSiRelAccess(); - return sp34; -} - -s32 __osPackEepWriteData(u8 address, u8 *buffer) { - u8 *sp14; - unkStruct2 sp8; - s32 sp4; - sp14 = (u8 *) &D_80365E00; - for (sp4 = 0; sp4 < 0x10; sp4++) { - D_80365E00[sp4] = 255; - } - D_80365E3C = 1; - sp8.unk00 = 10; - sp8.unk01 = 1; - sp8.unk02 = 5; - sp8.unk03 = address; - for (sp4 = 0; sp4 < 8; sp4++) { - ((u8 *) &sp8.unk04)[sp4] = *buffer++; - } - for (sp4 = 0; sp4 < 4; sp4++) { - *sp14++ = 0; - } - *(unkStruct2 *) sp14 = sp8; - sp14 += 0xc; - *sp14 = 254; -} - -s32 __osEepStatus(OSMesgQueue *a0, unkStruct *a1) { - u32 sp2c = 0; - s32 sp28; - u8 *sp24 = (u8 *) D_80365E00; - unkStruct3 sp1c; - - for (sp28 = 0; sp28 < 0x10; sp28++) { - D_80365E00[sp28] = 0; - } - - D_80365E3C = 1; - sp24 = (u8 *) D_80365E00; - for (sp28 = 0; sp28 < 4; sp28++) { - *sp24++ = 0; - } - - sp1c.unk00 = 255; - sp1c.unk01 = 1; - sp1c.unk02 = 3; - sp1c.unk03 = 0; - sp1c.unk04 = 255; - sp1c.unk05 = 255; - sp1c.unk06 = 255; - sp1c.unk07 = 255; - *(unkStruct3 *) sp24 = sp1c; - - sp24 += 8; - sp24[0] = 254; - - sp2c = __osSiRawStartDma(OS_WRITE, D_80365E00); - osRecvMesg(a0, NULL, OS_MESG_BLOCK); - - D_80365D20 = 5; - - sp2c = __osSiRawStartDma(OS_READ, D_80365E00); - osRecvMesg(a0, NULL, OS_MESG_BLOCK); - - if (sp2c != 0) { - return sp2c; - } - - sp24 = (u8 *) D_80365E00; - for (sp28 = 0; sp28 < 4; sp28++) { - *sp24++ = 0; - } - - sp1c = *(unkStruct3 *) sp24; - a1->unk03 = (sp1c.unk02 & 0xc0) >> 4; - a1->unk00 = (sp1c.unk05 << 8) | sp1c.unk04; - a1->unk02 = sp1c.unk06; - if (a1->unk03 != 0) { - return a1->unk03; - } - return 0; -} diff --git a/lib/src/osGetTime.c b/lib/src/osGetTime.c deleted file mode 100644 index 93dc8cbe0d..0000000000 --- a/lib/src/osGetTime.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "libultra_internal.h" - -extern OSTime _osCurrentTime; -extern u32 D_80365DA8; - -OSTime osGetTime() { - u32 sp34; - u32 sp30; - OSTime sp28; - register u32 int_disabled; - int_disabled = __osDisableInt(); - sp34 = osGetCount(); - sp30 = sp34 - D_80365DA8; - sp28 = _osCurrentTime; - __osRestoreInt(int_disabled); - return sp28 + sp30; -} diff --git a/lib/src/osInitialize.c b/lib/src/osInitialize.c deleted file mode 100644 index 3cbca8ea08..0000000000 --- a/lib/src/osInitialize.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -#include - -#define PIF_ADDR_START (void *) 0x1FC007FC - -typedef struct { - u32 instr00; - u32 instr01; - u32 instr02; - u32 instr03; -} exceptionPreamble; - -#if defined(VERSION_EU) || defined(VERSION_SH) -extern u32 EU_D_802f4330(u32, void (*)); -extern void D_802F4380(); - -#endif -u32 D_80365CD0; // maybe initialized? -u64 osClockRate = 62500000; -u32 D_80334808 = 0; - -#if defined(VERSION_EU) || defined(VERSION_SH) -u32 EU_D_80336C40; -u32 EU_D_80336C44; - -u32 D_8030208C = OS_IM_ALL; -u32 EU_D_80302090 = 0; -u8 EU_unusedZeroes[8] = { 0 }; -#endif - -#define EXCEPTION_TLB_MISS 0x80000000 -#define EXCEPTION_XTLB_MISS 0x80000080 -#define EXCEPTION_CACHE_ERROR 0x80000100 -#define EXCEPTION_GENERAL 0x80000180 - -extern u32 osResetType; -extern exceptionPreamble __osExceptionPreamble; - -void osInitialize(void) { - u32 sp34; - u32 sp30 = 0; - -#if defined(VERSION_EU) || defined(VERSION_SH) - UNUSED u32 eu_sp34; - UNUSED u32 eu_sp30; -#endif - UNUSED u32 sp2c; - D_80365CD0 = TRUE; - __osSetSR(__osGetSR() | 0x20000000); - __osSetFpcCsr(0x01000800); - while (__osSiRawReadIo(PIF_ADDR_START, &sp34)) { - ; - } - while (__osSiRawWriteIo(PIF_ADDR_START, sp34 | 8)) { - ; - } - *(exceptionPreamble *) EXCEPTION_TLB_MISS = __osExceptionPreamble; - *(exceptionPreamble *) EXCEPTION_XTLB_MISS = __osExceptionPreamble; - *(exceptionPreamble *) EXCEPTION_CACHE_ERROR = __osExceptionPreamble; - *(exceptionPreamble *) EXCEPTION_GENERAL = __osExceptionPreamble; - osWritebackDCache((void *) 0x80000000, - EXCEPTION_GENERAL + sizeof(exceptionPreamble) - EXCEPTION_TLB_MISS); - osInvalICache((void *) 0x80000000, - EXCEPTION_GENERAL + sizeof(exceptionPreamble) - EXCEPTION_TLB_MISS); - osMapTLBRdb(); - osPiRawReadIo(4, &sp30); - sp30 &= ~0xf; - if (sp30) { - osClockRate = sp30; - } - osClockRate = osClockRate * 3 / 4; - if (osResetType == RESET_TYPE_COLD_RESET) { - bzero(osAppNmiBuffer, sizeof(osAppNmiBuffer)); - } -#if defined(VERSION_EU) || defined(VERSION_SH) - eu_sp30 = HW_REG(PI_STATUS_REG, u32); - while (eu_sp30 & PI_STATUS_ERROR) { - eu_sp30 = HW_REG(PI_STATUS_REG, u32); - }; - if (!((eu_sp34 = HW_REG(ASIC_STATUS, u32)) & _64DD_PRESENT_MASK)) { - EU_D_80302090 = 1; - EU_D_802f4330(1, D_802F4380); - } else { - EU_D_80302090 = 0; - } -#endif -} diff --git a/lib/src/osJamMesg.c b/lib/src/osJamMesg.c deleted file mode 100644 index 725131355c..0000000000 --- a/lib/src/osJamMesg.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libultra_internal.h" - -s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag) { - register s32 int_disabled; - int_disabled = __osDisableInt(); - while (mq->validCount >= mq->msgCount) { - if (flag == OS_MESG_BLOCK) { - D_803348A0->state = OS_STATE_WAITING; - __osEnqueueAndYield(&mq->fullqueue); - } else { - __osRestoreInt(int_disabled); - return -1; - } - } - - mq->first = (mq->first + mq->msgCount - 1) % mq->msgCount; - mq->msg[mq->first] = msg; - mq->validCount++; - if (mq->mtqueue->next != NULL) { - osStartThread(__osPopThread(&mq->mtqueue)); - } - __osRestoreInt(int_disabled); - return 0; -} diff --git a/lib/src/osLeoDiskInit.c b/lib/src/osLeoDiskInit.c deleted file mode 100644 index ee8e8688bb..0000000000 --- a/lib/src/osLeoDiskInit.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -// this file must include some globally referenced data because it is not called anywhere -// data, comes shortly before _Ldtob I think, before crash_screen - -extern OSPiHandle *D_80302DFC; -// bss -OSPiHandle LeoDiskHandle; -OSPiHandle *__osDiskHandle; -// some kind of piHandle init function, maybe osDriveRomInit or osCartRomInit -OSPiHandle *osLeoDiskInit() { - s32 sp1c; - LeoDiskHandle.type = 2; - LeoDiskHandle.baseAddress = (0xa0000000 | 0x05000000); - LeoDiskHandle.latency = 3; - LeoDiskHandle.pulse = 6; - LeoDiskHandle.pageSize = 6; - LeoDiskHandle.relDuration = 2; - HW_REG(PI_BSD_DOM2_LAT_REG, u32) = LeoDiskHandle.latency; - HW_REG(PI_BSD_DOM2_PWD_REG, u32) = LeoDiskHandle.pulse; - HW_REG(PI_BSD_DOM2_PGS_REG, u32) = LeoDiskHandle.pageSize; - HW_REG(PI_BSD_DOM2_RLS_REG, u32) = LeoDiskHandle.relDuration; - bzero(&LeoDiskHandle.transferInfo, sizeof(__OSTranxInfo)); - sp1c = __osDisableInt(); - LeoDiskHandle.next = D_80302DFC; - D_80302DFC = &LeoDiskHandle; - __osDiskHandle = &LeoDiskHandle; - __osRestoreInt(sp1c); - return &LeoDiskHandle; -} diff --git a/lib/src/osPiGetCmdQueue.c b/lib/src/osPiGetCmdQueue.c deleted file mode 100644 index 7d0f06a1cc..0000000000 --- a/lib/src/osPiGetCmdQueue.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "libultra_internal.h" - -extern OSMgrArgs piMgrArgs; - -OSMesgQueue *osPiGetCmdQueue(void) { - if (!piMgrArgs.initialized) { - return NULL; - } - return piMgrArgs.unk08; -} diff --git a/lib/src/osPiRawReadIo.c b/lib/src/osPiRawReadIo.c deleted file mode 100644 index 07270788b9..0000000000 --- a/lib/src/osPiRawReadIo.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -extern u32 osRomBase; - -s32 osPiRawReadIo(u32 a0, u32 *a1) { - register int status; - status = HW_REG(PI_STATUS_REG, u32); - while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { - status = HW_REG(PI_STATUS_REG, u32); - } - *a1 = HW_REG(osRomBase | a0, u32); - return 0; -} diff --git a/lib/src/osPiRawStartDma.c b/lib/src/osPiRawStartDma.c deleted file mode 100644 index ca6044e6e5..0000000000 --- a/lib/src/osPiRawStartDma.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -extern u32 osRomBase; // TODO: figure out why this is like this - -s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size) { - register int status; - status = HW_REG(PI_STATUS_REG, u32); - while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { - status = HW_REG(PI_STATUS_REG, u32); - } - - HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr); - - HW_REG(PI_CART_ADDR_REG, void *) = (void *) (((uintptr_t) osRomBase | cart_addr) & 0x1fffffff); - - switch (dir) { - case 0: - HW_REG(PI_WR_LEN_REG, u32) = size - 1; - break; - case 1: - HW_REG(PI_RD_LEN_REG, u32) = size - 1; - break; - default: - return -1; - break; - } - return 0; -} - -#ifdef VERSION_EU -/*s32 osPiRawStartDma_2(s32 dir, u32 cart_addr, void *dram_addr, size_t size) { - register int status; - status = HW_REG(PI_STATUS_REG, u32); - while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { - status = HW_REG(PI_STATUS_REG, u32); - } - - HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr); - - HW_REG(PI_CART_ADDR_REG, void *) = (void *) (((uintptr_t) osRomBase | cart_addr) & 0x1fffffff); - - switch (dir) { - case 0: - HW_REG(PI_WR_LEN_REG, u32) = size - 1; - break; - case 1: - HW_REG(PI_RD_LEN_REG, u32) = size - 1; - break; - default: - return -1; - break; - } - return 0; -}*/ -#endif diff --git a/lib/src/osPiStartDma.c b/lib/src/osPiStartDma.c deleted file mode 100644 index 7227f83bf0..0000000000 --- a/lib/src/osPiStartDma.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "libultra_internal.h" - -extern OSMgrArgs piMgrArgs; - -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, - size_t nbytes, OSMesgQueue *mq) { - register s32 result; - register OSMesgQueue *cmdQueue; - if (!piMgrArgs.initialized) { - return -1; - } - - // TODO: name magic constants - if (direction == OS_READ) { - mb->hdr.type = 11; - } else { - mb->hdr.type = 12; - } - - mb->hdr.pri = priority; - mb->hdr.retQueue = mq; - mb->dramAddr = vAddr; - mb->devAddr = devAddr; - mb->size = nbytes; -#ifdef VERSION_EU - mb->piHandle = NULL; -#endif - - if (priority == OS_MESG_PRI_HIGH) { - cmdQueue = osPiGetCmdQueue(); - result = osJamMesg(cmdQueue, mb, OS_MESG_NOBLOCK); - } else { - cmdQueue = osPiGetCmdQueue(); - result = osSendMesg(cmdQueue, mb, OS_MESG_NOBLOCK); - } - return result; -} diff --git a/lib/src/osRecvMesg.c b/lib/src/osRecvMesg.c deleted file mode 100644 index 057ec9f054..0000000000 --- a/lib/src/osRecvMesg.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "libultra_internal.h" - -s32 osRecvMesg(OSMesgQueue *mq, OSMesg *msg, s32 flag) { - register u32 int_disabled; - register OSThread *thread; - int_disabled = __osDisableInt(); - - while (!mq->validCount) { - if (!flag) { - __osRestoreInt(int_disabled); - return -1; - } - D_803348A0->state = OS_STATE_WAITING; - __osEnqueueAndYield(&mq->mtqueue); - } - - if (msg != NULL) { - *msg = *(mq->first + mq->msg); - } - - mq->first = (mq->first + 1) % mq->msgCount; - mq->validCount--; - - if (mq->fullqueue->next != NULL) { - thread = __osPopThread(&mq->fullqueue); - osStartThread(thread); - } - - __osRestoreInt(int_disabled); - return 0; -} diff --git a/lib/src/osSendMesg.c b/lib/src/osSendMesg.c deleted file mode 100644 index f0d02fff99..0000000000 --- a/lib/src/osSendMesg.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "libultra_internal.h" - -s32 osSendMesg(OSMesgQueue *mq, OSMesg msg, s32 flag) { - register u32 int_disabled; - register s32 index; - register OSThread *s2; - int_disabled = __osDisableInt(); - - while (mq->validCount >= mq->msgCount) { - if (flag == OS_MESG_BLOCK) { - D_803348A0->state = 8; - __osEnqueueAndYield(&mq->fullqueue); - } else { - __osRestoreInt(int_disabled); - return -1; - } - } - - index = (mq->first + mq->validCount) % mq->msgCount; - mq->msg[index] = msg; - mq->validCount++; - - if (mq->mtqueue->next != NULL) { - s2 = __osPopThread(&mq->mtqueue); - osStartThread(s2); - } - - __osRestoreInt(int_disabled); - return 0; -} diff --git a/lib/src/osSetEventMesg.c b/lib/src/osSetEventMesg.c deleted file mode 100644 index dc4aee23c4..0000000000 --- a/lib/src/osSetEventMesg.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "libultra_internal.h" - -typedef struct OSEventMessageStruct_0_s { - OSMesgQueue *queue; - OSMesg msg; -} OSEventMessageStruct_0; - -OSEventMessageStruct_0 D_80363830[16]; - -void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg) { - register u32 int_disabled; - OSEventMessageStruct_0 *msgs; - int_disabled = __osDisableInt(); - msgs = D_80363830 + e; - msgs->queue = mq; - msgs->msg = msg; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osSetThreadPri.c b/lib/src/osSetThreadPri.c deleted file mode 100644 index 1c7825341d..0000000000 --- a/lib/src/osSetThreadPri.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libultra_internal.h" - -void osSetThreadPri(OSThread *thread, OSPri pri) { - register u32 int_disabled = __osDisableInt(); - if (thread == NULL) { - thread = D_803348A0; - } - - if (thread->priority != pri) { - thread->priority = pri; - if (thread != D_803348A0) { - if (thread->state != OS_STATE_STOPPED) { - __osDequeueThread(thread->queue, thread); - __osEnqueueThread(thread->queue, thread); - } - } - if (D_803348A0->priority < D_80334898->priority) { - D_803348A0->state = OS_STATE_RUNNABLE; - __osEnqueueAndYield(&D_80334898); - } - } - - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osSetTime.c b/lib/src/osSetTime.c deleted file mode 100644 index ba906b693c..0000000000 --- a/lib/src/osSetTime.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libultra_internal.h" - -extern OSTime _osCurrentTime; - -void osSetTime(OSTime time) { - _osCurrentTime = time; -} diff --git a/lib/src/osSetTimer.c b/lib/src/osSetTimer.c deleted file mode 100644 index 09bf106661..0000000000 --- a/lib/src/osSetTimer.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "libultra_internal.h" -extern OSTimer *D_80334830; -extern u64 __osInsertTimer(OSTimer *); - -u32 osSetTimer(OSTimer *a0, OSTime a1, u64 a2, OSMesgQueue *a3, OSMesg a4) { - u64 sp18; - a0->next = NULL; - a0->prev = NULL; - a0->interval = a2; - if (a1 != 0) { - a0->remaining = a1; - } else { - a0->remaining = a2; - } - a0->mq = a3; - a0->msg = a4; - sp18 = __osInsertTimer(a0); - if (D_80334830->next == a0) { - __osSetTimerIntr(sp18); - } - return 0; -} diff --git a/lib/src/osSpTaskLoadGo.c b/lib/src/osSpTaskLoadGo.c deleted file mode 100644 index 8e688277e7..0000000000 --- a/lib/src/osSpTaskLoadGo.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -#include - -#define _osVirtualToPhysical(ptr) \ - if (ptr != NULL) { \ - ptr = (void *) osVirtualToPhysical(ptr); \ - } - -OSTask D_803638B0; -OSTask *_VirtualToPhysicalTask(OSTask *task) { - OSTask *physicalTask; - physicalTask = &D_803638B0; - bcopy(task, physicalTask, sizeof(OSTask)); - _osVirtualToPhysical(physicalTask->t.ucode); - _osVirtualToPhysical(physicalTask->t.ucode_data); - _osVirtualToPhysical(physicalTask->t.dram_stack); - _osVirtualToPhysical(physicalTask->t.output_buff); - _osVirtualToPhysical(physicalTask->t.output_buff_size); - _osVirtualToPhysical(physicalTask->t.data_ptr); - _osVirtualToPhysical(physicalTask->t.yield_data_ptr); - return physicalTask; -} -void osSpTaskLoad(OSTask *task) { - OSTask *physicalTask; - physicalTask = _VirtualToPhysicalTask(task); - if (physicalTask->t.flags & M_TASK_FLAG0) { - physicalTask->t.ucode_data = physicalTask->t.yield_data_ptr; - physicalTask->t.ucode_data_size = physicalTask->t.yield_data_size; - task->t.flags &= ~M_TASK_FLAG0; - } - osWritebackDCache(physicalTask, sizeof(OSTask)); - __osSpSetStatus(SPSTATUS_CLEAR_SIGNAL0 | SPSTATUS_CLEAR_SIGNAL1 | SPSTATUS_CLEAR_SIGNAL2 - | SPSTATUS_SET_INTR_ON_BREAK); - while (__osSpSetPc((void *) SP_IMEM_START) == -1) { - ; - } - while (__osSpRawStartDma(1, (void *) (SP_IMEM_START - sizeof(*physicalTask)), physicalTask, - sizeof(OSTask)) - == -1) { - ; - } - while (__osSpDeviceBusy()) { - ; - } - while (__osSpRawStartDma(1, (void *) SP_IMEM_START, physicalTask->t.ucode_boot, - physicalTask->t.ucode_boot_size) - == -1) { - ; - } -} -void osSpTaskStartGo(UNUSED OSTask *task) { - while (__osSpDeviceBusy()) { - ; - } - __osSpSetStatus(SPSTATUS_SET_INTR_ON_BREAK | SPSTATUS_CLEAR_SSTEP | SPSTATUS_CLEAR_BROKE - | SPSTATUS_CLEAR_HALT); -} diff --git a/lib/src/osStartThread.c b/lib/src/osStartThread.c deleted file mode 100644 index c241e38858..0000000000 --- a/lib/src/osStartThread.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "libultra_internal.h" - -void osStartThread(OSThread *thread) { - register u32 int_disabled; - register uintptr_t state; - int_disabled = __osDisableInt(); - state = thread->state; - - if (state != OS_STATE_STOPPED) { - if (state == OS_STATE_WAITING) { - do { - } while (0); - thread->state = OS_STATE_RUNNABLE; - __osEnqueueThread(&D_80334898, thread); - } - } else { - if (thread->queue == NULL || thread->queue == &D_80334898) { - thread->state = OS_STATE_RUNNABLE; - - __osEnqueueThread(&D_80334898, thread); - } else { - thread->state = OS_STATE_WAITING; - __osEnqueueThread(thread->queue, thread); - state = (uintptr_t) __osPopThread(thread->queue); - __osEnqueueThread(&D_80334898, (OSThread *) state); - } - } - if (D_803348A0 == NULL) { - __osDispatchThread(); - } else { - if (D_803348A0->priority < D_80334898->priority) { - D_803348A0->state = OS_STATE_RUNNABLE; - __osEnqueueAndYield(&D_80334898); - } - } - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osTimer.c b/lib/src/osTimer.c deleted file mode 100644 index cd770c63d3..0000000000 --- a/lib/src/osTimer.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "libultra_internal.h" - - -// TODO: document -OSTimer D_80365D80; -OSTimer *D_80334830 = &D_80365D80; -OSTime _osCurrentTime; -u32 D_80365DA8; -u32 __osViIntrCount; -u32 D_80365DB0; -void __osTimerServicesInit() { - _osCurrentTime = 0; - D_80365DA8 = 0; - __osViIntrCount = 0; - D_80334830->prev = D_80334830; - D_80334830->next = D_80334830->prev; - D_80334830->remaining = 0; - D_80334830->interval = D_80334830->remaining; - D_80334830->mq = NULL; - D_80334830->msg = NULL; -} - -void __osTimerInterrupt() { - OSTimer *sp24; - u32 sp20; - u32 sp1c; - if (D_80334830->next == D_80334830) { - return; - } - while (1) { - sp24 = D_80334830->next; - if (sp24 == D_80334830) { - __osSetCompare(0); - D_80365DB0 = 0; - break; - } - sp20 = osGetCount(); - sp1c = sp20 - D_80365DB0; - D_80365DB0 = sp20; - if (sp1c < sp24->remaining) { - sp24->remaining -= sp1c; - __osSetTimerIntr(sp24->remaining); - return; - } else { - sp24->prev->next = sp24->next; - sp24->next->prev = sp24->prev; - sp24->next = NULL; - sp24->prev = NULL; - if (sp24->mq != NULL) { - osSendMesg(sp24->mq, sp24->msg, OS_MESG_NOBLOCK); - } - if (sp24->interval != 0) { - sp24->remaining = sp24->interval; - __osInsertTimer(sp24); - } - } - } -} - -void __osSetTimerIntr(u64 a0) { - u64 tmp; - s32 intDisabled = __osDisableInt(); - D_80365DB0 = osGetCount(); - tmp = a0 + D_80365DB0; - __osSetCompare(tmp); - __osRestoreInt(intDisabled); -} - -u64 __osInsertTimer(OSTimer *a0) { - OSTimer *sp34; - u64 sp28; - s32 intDisabled; - intDisabled = __osDisableInt(); - for (sp34 = D_80334830->next, sp28 = a0->remaining; sp34 != D_80334830 && sp28 > sp34->remaining; - sp28 -= sp34->remaining, sp34 = sp34->next) { - ; - } - a0->remaining = sp28; - if (sp34 != D_80334830) { - sp34->remaining -= sp28; - } - a0->next = sp34; - a0->prev = sp34->prev; - sp34->prev->next = a0; - sp34->prev = a0; - __osRestoreInt(intDisabled); - return sp28; -} diff --git a/lib/src/osViBlack.c b/lib/src/osViBlack.c deleted file mode 100644 index 7729d28aec..0000000000 --- a/lib/src/osViBlack.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -// TODO: name magic constants -void osViBlack(u8 active) { - register u32 int_disabled = __osDisableInt(); - if (active) { - D_80334914->unk00 |= 0x20; - } else { - D_80334914->unk00 &= ~0x20; - } - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViSetEvent.c b/lib/src/osViSetEvent.c deleted file mode 100644 index e74ba2b830..0000000000 --- a/lib/src/osViSetEvent.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount) { - - register u32 int_disabled = __osDisableInt(); - (D_80334914)->mq = mq; - (D_80334914)->msg = msg; - (D_80334914)->retraceCount = retraceCount; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViSetMode.c b/lib/src/osViSetMode.c deleted file mode 100644 index 518f746b78..0000000000 --- a/lib/src/osViSetMode.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSetMode(OSViMode *mode) { - register u32 int_disabled = __osDisableInt(); - D_80334914->unk08 = mode; - D_80334914->unk00 = 1; - D_80334914->features = D_80334914->unk08->comRegs.ctrl; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViSetSpecialFeatures.c b/lib/src/osViSetSpecialFeatures.c deleted file mode 100644 index 590bfad8a1..0000000000 --- a/lib/src/osViSetSpecialFeatures.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSetSpecialFeatures(u32 func) { - register u32 int_disabled = __osDisableInt(); - if (func & OS_VI_GAMMA_ON) { - D_80334914->features |= OS_VI_GAMMA; - } - if (func & OS_VI_GAMMA_OFF) { - D_80334914->features &= ~OS_VI_GAMMA; - } - if (func & OS_VI_GAMMA_DITHER_ON) { - D_80334914->features |= OS_VI_GAMMA_DITHER; - } - if (func & OS_VI_GAMMA_DITHER_OFF) { - - D_80334914->features &= ~OS_VI_GAMMA_DITHER; - } - if (func & OS_VI_DIVOT_ON) { - - D_80334914->features |= OS_VI_DIVOT; - } - if (func & OS_VI_DIVOT_OFF) { - - D_80334914->features &= ~OS_VI_DIVOT; - } - if (func & OS_VI_DITHER_FILTER_ON) { - D_80334914->features |= OS_VI_DITHER_FILTER; - D_80334914->features &= ~(OS_VI_UNK200 | OS_VI_UNK100); - } - if (func & OS_VI_DITHER_FILTER_OFF) { - D_80334914->features &= ~OS_VI_DITHER_FILTER; - D_80334914->features |= D_80334914->unk08->comRegs.ctrl & (OS_VI_UNK200 | OS_VI_UNK100); - } - D_80334914->unk00 |= 8; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViSwapBuffer.c b/lib/src/osViSwapBuffer.c deleted file mode 100644 index fcaa62fe81..0000000000 --- a/lib/src/osViSwapBuffer.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSwapBuffer(void *vaddr) { - u32 int_disabled = __osDisableInt(); - D_80334914->buffer = vaddr; - D_80334914->unk00 |= 0x10; // TODO: figure out what this flag means - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osVirtualToPhysical.c b/lib/src/osVirtualToPhysical.c deleted file mode 100644 index b1fb1a55d7..0000000000 --- a/lib/src/osVirtualToPhysical.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "libultra_internal.h" - -uintptr_t osVirtualToPhysical(void *addr) { - if ((uintptr_t) addr >= 0x80000000 && (uintptr_t) addr < 0xa0000000) { - return ((uintptr_t) addr & 0x1fffffff); - } else if ((uintptr_t) addr >= 0xa0000000 && (uintptr_t) addr < 0xc0000000) { - return ((uintptr_t) addr & 0x1fffffff); - } else { - return __osProbeTLB(addr); - } -} diff --git a/lib/src/sprintf.c b/lib/src/sprintf.c deleted file mode 100644 index cd0cf5af16..0000000000 --- a/lib/src/sprintf.c +++ /dev/null @@ -1,20 +0,0 @@ - -#include -#include "libultra_internal.h" -#include "printf.h" -#include -char *proutSprintf(char *dst, const char *src, size_t count); -int sprintf(char *dst, const char *fmt, ...) { - s32 written; - va_list args; - va_start(args, fmt); - written = _Printf(proutSprintf, dst, fmt, args); - if (written >= 0) { - dst[written] = 0; - } - return written; -} - -char *proutSprintf(char *dst, const char *src, size_t count) { - return (char *) memcpy((u8 *) dst, (u8 *) src, count) + count; -} diff --git a/lib/src/sqrtf.c b/lib/src/sqrtf.c deleted file mode 100644 index 057678802c..0000000000 --- a/lib/src/sqrtf.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#ifndef __GNUC__ -#pragma intrinsic(sqrtf) -#define __builtin_sqrtf sqrtf -#endif - -float sqrtf(float f) { - return __builtin_sqrtf(f); -} diff --git a/lib/src/string.c b/lib/src/string.c deleted file mode 100644 index 549c91484c..0000000000 --- a/lib/src/string.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "libultra_internal.h" -#include - -void *memcpy(void *dst, const void *src, size_t size) { - u8 *_dst = dst; - const u8 *_src = src; - while (size > 0) { - *_dst++ = *_src++; - size--; - } - return dst; -} -size_t strlen(const char *str) { - const u8 *ptr = (const u8 *) str; - while (*ptr) { - ptr++; - } - return (const char *) ptr - str; -} - -char *strchr(const char *str, s32 ch) { - u8 c = ch; - while (*(u8 *)str != c) { - if (*(u8 *)str == 0) { - return NULL; - } - str++; - } - return (char *) str; -} diff --git a/src/audio/data.c b/src/audio/data.c index 711ee84797..53f3a2cc52 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -175,9 +175,9 @@ s8 gVibratoCurve[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, #endif struct AdsrEnvelope gDefaultEnvelope[] = { - { BE_TO_HOST16(4), BE_TO_HOST16(32000) }, // go from 0 to 32000 over the course of 16ms - { BE_TO_HOST16(1000), BE_TO_HOST16(32000) }, // stay there for 4.16 seconds - { BE_TO_HOST16(ADSR_HANG), 0 } // then continue staying there + { (s16)BE_TO_HOST16(4), (s16)BE_TO_HOST16(32000) }, // go from 0 to 32000 over the course of 16ms + { (s16)BE_TO_HOST16(1000), (s16)BE_TO_HOST16(32000) }, // stay there for 4.16 seconds + { (s16)BE_TO_HOST16(ADSR_HANG), 0 } // then continue staying there }; #ifdef VERSION_EU diff --git a/src/audio/external.c b/src/audio/external.c index a059c0b5a6..05c083abe9 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -774,7 +774,7 @@ struct SPTask *create_next_audio_frame_task(void) { return NULL; } -void create_next_audio_buffer(s16 *samples, u32 num_samples) { +void create_next_audio_buffer(u16 *samples, u32 num_samples) { gAudioFrameCount++; if (sGameLoopTicked != 0) { update_game_sound(); @@ -1622,8 +1622,6 @@ void func_8031F96C(u8 player) { } } -#ifdef NON_MATCHING - void process_level_music_dynamics(void) { s32 conditionBits; // s0 u32 tempBits; // v1 @@ -1758,10 +1756,6 @@ void process_level_music_dynamics(void) { } } -#else -GLOBAL_ASM("asm/non_matchings/process_level_music_dynamics.s") -#endif - void unused_8031FED0(u8 player, u32 bits, s8 arg2) { u8 i; diff --git a/src/audio/heap.c b/src/audio/heap.c index d1d694179f..4b1a2d191f 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -303,7 +303,7 @@ void temporary_pools_init(struct PoolSplit *a) { } #ifndef VERSION_EU -static void unused_803163D4() { +UNUSED static void unused_803163D4() { } #endif @@ -649,7 +649,7 @@ s32 audio_shut_down_and_reset_step(void) { /** * Waits until a specified number of audio frames have been created */ -void wait_for_audio_frames(s32 frames) { +void wait_for_audio_frames(UNUSED s32 frames) { gAudioFrameCount = 0; } diff --git a/src/audio/load.c b/src/audio/load.c index 146863c1d2..536c9abe3f 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -24,7 +24,7 @@ void port_eu_init(void); struct Note *gNotes; #ifdef VERSION_EU -static u8 pad[4]; +UNUSED static u8 pad[4]; #endif struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS]; @@ -384,7 +384,7 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { #ifndef VERSION_EU // This function gets optimized out on US due to being static and never called -static +UNUSED static #endif void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED u8 *offsetBase) { @@ -875,13 +875,15 @@ void audio_init() { UNUSED s8 pad[32]; u8 buf[0x10]; #endif - s32 i, j, k; + s32 i, j; + UNUSED s32 k; UNUSED s32 lim1; // lim1 unused in EU #ifdef VERSION_EU u8 buf[0x10]; s32 UNUSED lim2, lim3; #else - s32 lim2, lim3; + s32 lim2; + UNUSED s32 lim3; #endif u32 size; UNUSED u64 *ptr64; diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index 7e66a220cf..d31cace0e8 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -378,7 +378,6 @@ u16 m64_read_compressed_u16(struct M64ScriptState *state) { return ret; } -#ifdef NON_MATCHING void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { struct SequencePlayer *seqPlayer; // sp5C, t4 struct SequenceChannel *seqChannel; // sp58, t5 @@ -1046,14 +1045,6 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { } } -#elif defined(VERSION_EU) -GLOBAL_ASM("asm/non_matchings/eu/audio/seq_channel_layer_process_script.s") -#elif defined(VERSION_JP) -GLOBAL_ASM("asm/non_matchings/seq_channel_layer_process_script_jp.s") -#else -GLOBAL_ASM("asm/non_matchings/seq_channel_layer_process_script_us.s") -#endif - u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrument **instOut, struct AdsrSettings *adsr) { @@ -1141,7 +1132,6 @@ void sequence_channel_set_volume(struct SequenceChannel *seqChannel, u8 volume) seqChannel->volume = FLOAT_CAST(volume) / US_FLOAT(127.0); } -#ifdef NON_MATCHING void sequence_channel_process_script(struct SequenceChannel *seqChannel) { u16 sp5A; s8 value; // sp53 @@ -1678,14 +1668,6 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { } } -#elif defined(VERSION_EU) -GLOBAL_ASM("asm/non_matchings/eu/audio/sequence_channel_process_script.s") -#elif defined(VERSION_JP) -GLOBAL_ASM("asm/non_matchings/sequence_channel_process_script_jp.s") -#else -GLOBAL_ASM("asm/non_matchings/sequence_channel_process_script_us.s") -#endif - void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { u8 cmd; u8 loBits; diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index b332c9f08f..79ffb74388 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -273,8 +273,7 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, u16 *aiBuf, s32 bufLen) { aiBufPtr = (u32 *) aiBuf; for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) { if (i == 1) { - // self-assignment has no affect when added here, could possibly simplify a macro definition - chunkLen = bufLen; nextVolRampTable = nextVolRampTable; leftVolRamp = gLeftVolRampings[nextVolRampTable]; rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF]; + chunkLen = bufLen; leftVolRamp = gLeftVolRampings[nextVolRampTable]; rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF]; } else { if (bufLen / i >= gAudioBufferParameters.samplesPerUpdateMax) { chunkLen = gAudioBufferParameters.samplesPerUpdateMax; nextVolRampTable = 2; leftVolRamp = gLeftVolRampings[2]; rightVolRamp = gRightVolRampings[2]; @@ -366,7 +365,11 @@ u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s1 aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH); } else { temp_t9 = (item->startPos % 8u) * 2; + #ifdef AVOID_UB + sp58 = ALIGN(item->lengths[0] + temp_t9, 4); + #else sp58 = ALIGN(item->lengths[0] + (sp58=temp_t9), 4); + #endif cmd = synthesis_load_reverb_ring_buffer(cmd, 0x20, (item->startPos - temp_t9 / 2), DEFAULT_LEN_1CH, reverbIndex); if (item->lengths[1] != 0) { diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index 539f3a328f..1263c85d6a 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -29,7 +29,7 @@ static u16 gRandomSeed16; // Unused function that directly jumps to a behavior command and resets the object's stack index. -static void goto_behavior_unused(const BehaviorScript *bhvAddr) { +UNUSED static void goto_behavior_unused(const BehaviorScript *bhvAddr) { gCurBhvCommand = segmented_to_virtual(bhvAddr); gCurrentObject->bhvStackIndex = 0; } @@ -105,7 +105,7 @@ static uintptr_t cur_obj_bhv_stack_pop(void) { return bhvAddr; } -static void stub_behavior_script_1(void) { +UNUSED static void stub_behavior_script_1(void) { for (;;) { ; } @@ -693,7 +693,7 @@ static s32 bhv_cmd_begin(void) { // It cannot be simply re-added to the table, as unlike all other bhv commands it takes a parameter. // Theoretically this command would have been of variable size. // Included below is a modified/repaired version of this function that would work properly. -static void bhv_cmd_set_int_random_from_table(s32 tableSize) { +UNUSED static void bhv_cmd_set_int_random_from_table(s32 tableSize) { u8 field = BHV_CMD_GET_2ND_U8(0); s32 table[16]; s32 i; diff --git a/src/engine/math_util.c b/src/engine/math_util.c index 3f027ed57d..70ee8df062 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -12,110 +12,92 @@ Vec4s *gSplineKeyframe; float gSplineKeyframeFraction; int gSplineState; -// These functions have bogus return values. -// Disable the compiler warning. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wreturn-local-addr" - /// Copy vector 'src' to 'dest' -void *vec3f_copy(Vec3f dest, Vec3f src) { +void vec3f_copy(Vec3f dest, Vec3f src) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; - return &dest; //! warning: function returns address of local variable } /// Set vector 'dest' to (x, y, z) -void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z) { +void vec3f_set(Vec3f dest, f32 x, f32 y, f32 z) { dest[0] = x; dest[1] = y; dest[2] = z; - return &dest; //! warning: function returns address of local variable } /// Add vector 'a' to 'dest' -void *vec3f_add(Vec3f dest, Vec3f a) { +void vec3f_add(Vec3f dest, Vec3f a) { dest[0] += a[0]; dest[1] += a[1]; dest[2] += a[2]; - return &dest; //! warning: function returns address of local variable } /// Make 'dest' the sum of vectors a and b. -void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b) { +void vec3f_sum(Vec3f dest, Vec3f a, Vec3f b) { dest[0] = a[0] + b[0]; dest[1] = a[1] + b[1]; dest[2] = a[2] + b[2]; - return &dest; //! warning: function returns address of local variable } /// Multiply vector 'dest' by a -void *vec3f_mul(Vec3f dest, f32 a) -{ +void vec3f_mul(Vec3f dest, f32 a) { dest[0] *= a; dest[1] *= a; dest[2] *= a; - return &dest; //! warning: function returns address of local variable } /// Copy vector src to dest -void *vec3s_copy(Vec3s dest, Vec3s src) { +void vec3s_copy(Vec3s dest, Vec3s src) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; - return &dest; //! warning: function returns address of local variable } /// Set vector 'dest' to (x, y, z) -void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z) { +void vec3s_set(Vec3s dest, s16 x, s16 y, s16 z) { dest[0] = x; dest[1] = y; dest[2] = z; - return &dest; //! warning: function returns address of local variable } /// Add vector a to 'dest' -void *vec3s_add(Vec3s dest, Vec3s a) { +void vec3s_add(Vec3s dest, Vec3s a) { dest[0] += a[0]; dest[1] += a[1]; dest[2] += a[2]; - return &dest; //! warning: function returns address of local variable } /// Make 'dest' the sum of vectors a and b. -void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b) { +void vec3s_sum(Vec3s dest, Vec3s a, Vec3s b) { dest[0] = a[0] + b[0]; dest[1] = a[1] + b[1]; dest[2] = a[2] + b[2]; - return &dest; //! warning: function returns address of local variable } /// Make 'dest' the difference of vectors a and b. -void *vec3f_dif(Vec3f dest, Vec3f a, Vec3f b) { +void vec3f_dif(Vec3f dest, Vec3f a, Vec3f b) { dest[0] = a[0] - b[0]; dest[1] = a[1] - b[1]; dest[2] = a[2] - b[2]; - return &dest; //! warning: function returns address of local variable } /// Convert short vector a to float vector 'dest' -void *vec3s_to_vec3f(Vec3f dest, Vec3s a) { +void vec3s_to_vec3f(Vec3f dest, Vec3s a) { dest[0] = a[0]; dest[1] = a[1]; dest[2] = a[2]; - return &dest; //! warning: function returns address of local variable } /** * Convert float vector a to a short vector 'dest' by rounding the components * to the nearest integer. */ -void *vec3f_to_vec3s(Vec3s dest, Vec3f a) { +void vec3f_to_vec3s(Vec3s dest, Vec3f a) { // add/subtract 0.5 in order to round to the nearest s32 instead of truncating dest[0] = a[0] + ((a[0] > 0) ? 0.5f : -0.5f); dest[1] = a[1] + ((a[1] > 0) ? 0.5f : -0.5f); dest[2] = a[2] + ((a[2] > 0) ? 0.5f : -0.5f); - return &dest; //! warning: function returns address of local variable } /** @@ -123,30 +105,33 @@ void *vec3f_to_vec3s(Vec3s dest, Vec3f a) { * It is similar to vec3f_cross, but it calculates the vectors (c-b) and (b-a) * at the same time. */ -void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c) { +void find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c) { dest[0] = (b[1] - a[1]) * (c[2] - b[2]) - (c[1] - b[1]) * (b[2] - a[2]); dest[1] = (b[2] - a[2]) * (c[0] - b[0]) - (c[2] - b[2]) * (b[0] - a[0]); dest[2] = (b[0] - a[0]) * (c[1] - b[1]) - (c[0] - b[0]) * (b[1] - a[1]); - return &dest; //! warning: function returns address of local variable } /// Make vector 'dest' the cross product of vectors a and b. -void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b) { +void vec3f_cross(Vec3f dest, Vec3f a, Vec3f b) { dest[0] = a[1] * b[2] - b[1] * a[2]; dest[1] = a[2] * b[0] - b[2] * a[0]; dest[2] = a[0] * b[1] - b[0] * a[1]; - return &dest; //! warning: function returns address of local variable } /// Scale vector 'dest' so it has length 1 -void *vec3f_normalize(Vec3f dest) { +void vec3f_normalize(Vec3f dest) { //! Possible division by zero - f32 invsqrt = 1.0f / sqrtf(dest[0] * dest[0] + dest[1] * dest[1] + dest[2] * dest[2]); + // Workaround done here + f32 invsqrt = 0.0f; + if (dest[0] == 0 && dest[1] == 0 && dest[2] == 0) { + invsqrt = 0.0f; + } else { + invsqrt = 1.0f / sqrtf(dest[0] * dest[0] + dest[1] * dest[1] + dest[2] * dest[2]); + } dest[0] *= invsqrt; dest[1] *= invsqrt; dest[2] *= invsqrt; - return &dest; //! warning: function returns address of local variable } /// Get length of vector 'a' @@ -161,8 +146,6 @@ f32 vec3f_dot(Vec3f a, Vec3f b) return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } -#pragma GCC diagnostic pop - /// Copy matrix 'src' to 'dest' void mtxf_copy(Mat4 dest, Mat4 src) { register s32 i; diff --git a/src/engine/math_util.h b/src/engine/math_util.h index f28799d29e..2a96f78c7a 100644 --- a/src/engine/math_util.h +++ b/src/engine/math_util.h @@ -33,22 +33,22 @@ extern f32 gCosineTable[]; #include "../../include/libc/stdlib.h" -void *vec3f_copy(Vec3f dest, Vec3f src); -void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z); -void *vec3f_add(Vec3f dest, Vec3f a); -void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b); -void *vec3f_dif(Vec3f dest, Vec3f a, Vec3f b); -void *vec3f_mul(Vec3f dest, f32 a); -void *vec3s_copy(Vec3s dest, Vec3s src); -void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z); -void *vec3s_add(Vec3s dest, Vec3s a); -void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b); -void *vec3s_sub(Vec3s dest, Vec3s a); -void *vec3s_to_vec3f(Vec3f dest, Vec3s a); -void *vec3f_to_vec3s(Vec3s dest, Vec3f a); -void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c); -void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b); -void *vec3f_normalize(Vec3f dest); +void vec3f_copy(Vec3f dest, Vec3f src); +void vec3f_set(Vec3f dest, f32 x, f32 y, f32 z); +void vec3f_add(Vec3f dest, Vec3f a); +void vec3f_sum(Vec3f dest, Vec3f a, Vec3f b); +void vec3f_dif(Vec3f dest, Vec3f a, Vec3f b); +void vec3f_mul(Vec3f dest, f32 a); +void vec3s_copy(Vec3s dest, Vec3s src); +void vec3s_set(Vec3s dest, s16 x, s16 y, s16 z); +void vec3s_add(Vec3s dest, Vec3s a); +void vec3s_sum(Vec3s dest, Vec3s a, Vec3s b); +void vec3s_sub(Vec3s dest, Vec3s a); +void vec3s_to_vec3f(Vec3f dest, Vec3s a); +void vec3f_to_vec3s(Vec3s dest, Vec3f a); +void find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c); +void vec3f_cross(Vec3f dest, Vec3f a, Vec3f b); +void vec3f_normalize(Vec3f dest); f32 vec3f_length(Vec3f a); f32 vec3f_dot(Vec3f a, Vec3f b); void mtxf_copy(f32 dest[4][4], f32 src[4][4]); diff --git a/src/engine/surface_collision.c b/src/engine/surface_collision.c index c0e97ddafe..eb8ef65829 100644 --- a/src/engine/surface_collision.c +++ b/src/engine/surface_collision.c @@ -10,6 +10,7 @@ #include "surface_load.h" #include "game/object_list_processor.h" #include "math_util.h" +#include "macros.h" /************************************************** * WALLS * @@ -373,7 +374,7 @@ f32 unused_obj_find_floor_height(struct Object *obj) { */ struct FloorGeometry sFloorGeo; -static u8 unused8038BE50[0x40]; +UNUSED static u8 unused8038BE50[0x40]; /** * Return the floor height underneath (xPos, yPos, zPos) and populate `floorGeo` diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index 7a7da511ba..3eb45124f5 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -291,7 +291,7 @@ static void add_surface(struct Surface *surface, s32 dynamic) { } } -static void stub_surface_load_1(void) { +UNUSED static void stub_surface_load_1(void) { } /** @@ -651,7 +651,7 @@ void clear_dynamic_surfaces(void) { } } -static void unused_80383604(void) { +UNUSED static void unused_80383604(void) { } /** diff --git a/src/game/area.c b/src/game/area.c index d408190c71..08f7404740 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -107,10 +107,14 @@ void set_warp_transition_rgb(u8 red, u8 green, u8 blue) { gWarpTransBlue = blue; } +#if defined(VERSION_EU) && defined(TARGET_WEB) +UNUSED +#else static int scale_x_to_correct_aspect_center(int x) { f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO; return x + (SCREEN_HEIGHT * aspect / 2) - (SCREEN_WIDTH / 2); } +#endif void print_intro_text(void) { #ifdef VERSION_EU diff --git a/src/game/behaviors/bowling_ball.inc.c b/src/game/behaviors/bowling_ball.inc.c index 292b7c4db2..0c3345c921 100644 --- a/src/game/behaviors/bowling_ball.inc.c +++ b/src/game/behaviors/bowling_ball.inc.c @@ -65,7 +65,7 @@ void bowling_ball_set_waypoints(void) { void bhv_bowling_ball_roll_loop(void) { s16 collisionFlags; - s32 sp18; + s32 sp18 = 0; bowling_ball_set_waypoints(); collisionFlags = object_step(); @@ -95,7 +95,7 @@ void bhv_bowling_ball_roll_loop(void) { } void bhv_bowling_ball_initializeLoop(void) { - s32 sp1c; + s32 sp1c = 0; bowling_ball_set_waypoints(); diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c index 38908d01e3..d4ecee14ec 100644 --- a/src/game/behaviors/bowser.inc.c +++ b/src/game/behaviors/bowser.inc.c @@ -181,7 +181,7 @@ void bowser_act_intro_walk(void) { } } -static void bowser_debug_actions(void) // unused +UNUSED static void bowser_debug_actions(void) // unused { if (gDebugInfo[5][1] != 0) { o->oAction = D_8032F4FC[gDebugInfo[5][2] & 0xf]; diff --git a/src/game/behaviors/camera_lakitu.inc.c b/src/game/behaviors/camera_lakitu.inc.c index 0f70c3398f..d96d5be0b5 100644 --- a/src/game/behaviors/camera_lakitu.inc.c +++ b/src/game/behaviors/camera_lakitu.inc.c @@ -61,8 +61,8 @@ static void camera_lakitu_intro_act_spawn_cloud(void) { * Circle down to mario, show the dialog, then fly away. */ static void camera_lakitu_intro_act_show_dialog(void) { - s16 targetMovePitch; - s16 targetMoveYaw; + s16 targetMovePitch = 0; + s16 targetMoveYaw = 0; cur_obj_play_sound_1(SOUND_AIR_LAKITU_FLY); diff --git a/src/game/behaviors/chuckya.inc.c b/src/game/behaviors/chuckya.inc.c index 4eab68c918..0b6bbf7b5c 100644 --- a/src/game/behaviors/chuckya.inc.c +++ b/src/game/behaviors/chuckya.inc.c @@ -71,7 +71,7 @@ s32 approach_forward_vel(f32 *arr, f32 spC, f32 sp10) { } void chuckya_act_0(void) { - s32 sp3C; + s32 sp3C = 0; UNUSED u8 pad[16]; s32 sp28; if (o->oTimer == 0) diff --git a/src/game/behaviors/manta_ray.inc.c b/src/game/behaviors/manta_ray.inc.c index 4ffc5bf191..4c56a3e25c 100644 --- a/src/game/behaviors/manta_ray.inc.c +++ b/src/game/behaviors/manta_ray.inc.c @@ -28,7 +28,7 @@ void bhv_manta_ray_init(void) { void manta_ray_move(void) { s16 sp1E; - s32 sp18; + s32 sp18 = 0; sp1E = o->header.gfx.unk38.animFrame; gCurrentObject->oPathedWaypointsS16 = &D_803316A8; diff --git a/src/game/behaviors/mips.inc.c b/src/game/behaviors/mips.inc.c index 358161290e..6979d591f4 100644 --- a/src/game/behaviors/mips.inc.c +++ b/src/game/behaviors/mips.inc.c @@ -110,7 +110,7 @@ void bhv_mips_act_wait_for_nearby_mario(void) { */ void bhv_mips_act_follow_path(void) { s16 collisionFlags = 0; - s32 followStatus; + s32 followStatus = 0; struct Waypoint **pathBase; struct Waypoint *waypoint; diff --git a/src/game/behaviors/snowman.inc.c b/src/game/behaviors/snowman.inc.c index 33857d0cf2..8c93ffc7a8 100644 --- a/src/game/behaviors/snowman.inc.c +++ b/src/game/behaviors/snowman.inc.c @@ -52,7 +52,7 @@ void adjust_rolling_face_pitch(f32 f12) { void snowmans_bottom_act_1(void) { UNUSED s16 sp26; - s32 sp20; + s32 sp20 = 0; UNUSED s16 sp1E; o->oPathedStartWaypoint = segmented_to_virtual(&ccm_seg7_trajectory_snowman); diff --git a/src/game/behaviors/spawn_star.inc.c b/src/game/behaviors/spawn_star.inc.c index 2571f3d6cf..e35d345148 100644 --- a/src/game/behaviors/spawn_star.inc.c +++ b/src/game/behaviors/spawn_star.inc.c @@ -122,19 +122,19 @@ struct Object *spawn_star(struct Object *sp30, f32 sp34, f32 sp38, f32 sp3C) { } void spawn_default_star(f32 sp20, f32 sp24, f32 sp28) { - struct Object *sp1C; + struct Object *sp1C = NULL; sp1C = spawn_star(sp1C, sp20, sp24, sp28); sp1C->oBehParams2ndByte = 0; } void spawn_red_coin_cutscene_star(f32 sp20, f32 sp24, f32 sp28) { - struct Object *sp1C; + struct Object *sp1C = NULL; sp1C = spawn_star(sp1C, sp20, sp24, sp28); sp1C->oBehParams2ndByte = 1; } void spawn_no_exit_star(f32 sp20, f32 sp24, f32 sp28) { - struct Object *sp1C; + struct Object *sp1C = NULL; sp1C = spawn_star(sp1C, sp20, sp24, sp28); sp1C->oBehParams2ndByte = 1; sp1C->oInteractionSubtype |= INT_SUBTYPE_NO_EXIT; diff --git a/src/game/behaviors/ukiki.inc.c b/src/game/behaviors/ukiki.inc.c index 401abaa20f..26e1d1166f 100644 --- a/src/game/behaviors/ukiki.inc.c +++ b/src/game/behaviors/ukiki.inc.c @@ -502,7 +502,7 @@ void ukiki_free_loop(void) { * * Possibly unused so AnimState could be used for wearing a hat? */ -static void ukiki_blink_timer(void) { +UNUSED static void ukiki_blink_timer(void) { if (gGlobalTimer % 50 < 7) { o->oAnimState = UKIKI_ANIM_STATE_EYE_CLOSED; } else { diff --git a/src/game/bettercamera.inc.h b/src/game/bettercamera.inc.h index e6d3bf6f1f..c200334751 100644 --- a/src/game/bettercamera.inc.h +++ b/src/game/bettercamera.inc.h @@ -129,7 +129,7 @@ void newcam_init(struct Camera *c, u8 dv) case LEVEL_CCM: if (gCurrAreaIndex == 1) {newcam_yaw = -0x4000; newcam_tilt = 2000; newcam_distance_target = newcam_distance_values[1];} else newcam_mode = NC_MODE_SLIDE; break; case LEVEL_WDW: newcam_yaw = 0x2000; newcam_tilt = 3000; newcam_distance_target = newcam_distance_values[1]; break; case 27: newcam_mode = NC_MODE_SLIDE; break; - case LEVEL_THI: if (gCurrAreaIndex == 2) newcam_mode = NC_MODE_SLIDE; break; + case LEVEL_TTM: if (gCurrAreaIndex == 2) newcam_mode = NC_MODE_SLIDE; break; } newcam_distance = newcam_distance_target; diff --git a/src/game/camera.c b/src/game/camera.c index 5ae68805be..3c55cef55b 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -700,6 +700,7 @@ f32 calc_y_to_curr_floor(f32 *posOff, f32 posMul, f32 posBound, f32 *focOff, f32 if (*focOff < -focBound) { *focOff = -focBound; } + return 0; } //Compiler gets mad if I put this any further above. thanks refresh 7 #ifdef BETTERCAMERA @@ -1707,10 +1708,11 @@ struct ParallelTrackingPoint sBBHLibraryParTrackPath[] = { { 0, { 0.0f, 0.0f, 0.0f }, 0.0f, 0.0f }, }; -s32 unused_update_mode_5_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) { +UNUSED s32 unused_update_mode_5_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) { + return 0; } -static void stub_camera_1(UNUSED s32 unused) { +UNUSED static void stub_camera_1(UNUSED s32 unused) { } void mode_boss_fight_camera(struct Camera *c) { @@ -2033,6 +2035,7 @@ void mode_behind_mario_camera(struct Camera *c) { } s32 nop_update_water_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) { + return 0; } /** @@ -4901,7 +4904,7 @@ void play_sound_if_cam_switched_to_lakitu_or_mario(void) { * Handles input for radial, outwards radial, parallel tracking, and 8 direction mode. */ s32 radial_camera_input(struct Camera *c, UNUSED f32 unused) { - s16 dummy; + s16 dummy = 0; if ((gCameraMovementFlags & CAM_MOVE_ENTERED_ROTATE_SURFACE) || !(gCameraMovementFlags & CAM_MOVE_ROTATE)) { @@ -5369,7 +5372,7 @@ void set_focus_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack * @param forwBack offset to mario's front/back, relative to his faceAngle * @param yawOff offset to mario's faceAngle, changes the direction of `leftRight` and `forwBack` */ -static void unused_set_pos_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) { +UNUSED static void unused_set_pos_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) { u16 yaw = sMarioCamState->faceAngle[1] + yawOff; c->pos[0] = sMarioCamState->pos[0] + forwBack * sins(yaw) + leftRight * coss(yaw); @@ -5418,7 +5421,7 @@ void determine_pushing_or_pulling_door(s16 *rotation) { if (sMarioCamState->action == ACT_PULLING_DOOR) { *rotation = 0; } else { - *rotation = DEGREES(180); + *rotation = (s16)DEGREES(180); } } @@ -7268,7 +7271,7 @@ void cutscene_unsoften_music(UNUSED struct Camera *c) { sequence_player_unlower(SEQ_PLAYER_LEVEL, 60); } -static void stub_camera_5(UNUSED struct Camera *c) { +UNUSED static void stub_camera_5(UNUSED struct Camera *c) { } BAD_RETURN(s32) cutscene_unused_start(UNUSED struct Camera *c) { @@ -7754,7 +7757,7 @@ BAD_RETURN(s32) cutscene_dance_rotate_move_towards_mario(struct Camera *c) { /** * Speculated to be dance-related due to its proximity to the other dance functions */ -static BAD_RETURN(s32) cutscene_dance_unused(UNUSED struct Camera *c) { +UNUSED static BAD_RETURN(s32) cutscene_dance_unused(UNUSED struct Camera *c) { } /** @@ -8667,7 +8670,7 @@ BAD_RETURN(s32) cutscene_death_stomach_goto_mario(struct Camera *c) { /** * Ah, yes */ -static void unused_water_death_move_to_side_of_mario(struct Camera *c) { +UNUSED static void unused_water_death_move_to_side_of_mario(struct Camera *c) { water_death_move_to_mario_side(c); } @@ -8941,7 +8944,7 @@ BAD_RETURN(s32) cutscene_enter_pyramid_top(struct Camera *c) { } } -static void unused_cutscene_goto_cvar(struct Camera *c) { +UNUSED static void unused_cutscene_goto_cvar(struct Camera *c) { f32 dist; dist = calc_abs_dist(sCutsceneVars[3].point, sMarioCamState->pos); @@ -9102,7 +9105,7 @@ BAD_RETURN(s32) cutscene_read_message_start(struct Camera *c) { sCutsceneVars[0].angle[0] = 0; } -static void unused_cam_to_mario(struct Camera *c) { +UNUSED static void unused_cam_to_mario(struct Camera *c) { Vec3s dir; vec3s_set(dir, 0, sMarioCamState->faceAngle[1], 0); @@ -9572,8 +9575,8 @@ s32 intro_peach_move_camera_start_to_pipe(struct Camera *c, struct CutsceneSplin // The two splines used by this function are reflected in the horizontal plane for some reason, // so they are rotated every frame. Why do this, Nintendo? - rotate_in_xz(c->focus, c->focus, DEGREES(180)); - rotate_in_xz(c->pos, c->pos, DEGREES(180)); + rotate_in_xz(c->focus, c->focus, (s16)DEGREES(180)); + rotate_in_xz(c->pos, c->pos, (s16)DEGREES(180)); vec3f_set(offset, -1328.f, 260.f, 4664.f); vec3f_add(c->focus, offset); diff --git a/src/game/debug.c b/src/game/debug.c index 2a36460581..484cb19e6d 100644 --- a/src/game/debug.c +++ b/src/game/debug.c @@ -336,7 +336,7 @@ void reset_debug_objectinfo(void) { * C Right) and then toggles the debug flags from FF to 2; 2 is unused, * despite so this has no effect, being called. (unused) */ -static void check_debug_button_seq(void) { +UNUSED static void check_debug_button_seq(void) { s16 *buttonArr; s16 cButtonMask; @@ -366,7 +366,7 @@ static void check_debug_button_seq(void) { * Poll the debug info flags and controller for appropriate presses that * control sDebugPage's range. (unused) */ -static void try_change_debug_page(void) { +UNUSED static void try_change_debug_page(void) { if (gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT) { if ((gPlayer1Controller->buttonPressed & L_JPAD) && (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) { @@ -392,9 +392,10 @@ static void try_change_debug_page(void) { * on the fly. (unused) */ #ifndef VERSION_SH -static +UNUSED static void try_modify_debug_controls(void) { +#else +UNUSED void try_modify_debug_controls(void) { #endif -void try_modify_debug_controls(void) { s32 sp4; if (gPlayer1Controller->buttonPressed & Z_TRIG) { @@ -525,9 +526,10 @@ void try_do_mario_debug_object_spawn(void) { // TODO: figure out what this is #ifndef VERSION_SH -static +UNUSED static void debug_print_obj_move_flags(void) { +#else +UNUSED void debug_print_obj_move_flags(void) { #endif -void debug_print_obj_move_flags(void) { #ifndef VERSION_EU // TODO: Is there a better way to diff this? static EU doesn't seem to work. if (gCurrentObject->oMoveFlags & OBJ_MOVE_LANDED) { print_debug_top_down_objectinfo("BOUND %x", gCurrentObject->oMoveFlags); diff --git a/src/game/envfx_snow.c b/src/game/envfx_snow.c index ea2dfc4c50..1eab0e08e2 100644 --- a/src/game/envfx_snow.c +++ b/src/game/envfx_snow.c @@ -272,7 +272,7 @@ void envfx_update_snow_blizzard(s32 snowCylinderX, s32 snowCylinderY, s32 snowCy * find it. The radius of 3000 units is quite large for that though, covering * more than half of the mirror room. */ -static s32 is_in_mystery_snow_area(s32 x, UNUSED s32 y, s32 z) { +UNUSED static s32 is_in_mystery_snow_area(s32 x, UNUSED s32 y, s32 z) { if (sqr(x - 3380) + sqr(z + 520) < sqr(3000)) { return 1; } diff --git a/src/game/game_init.c b/src/game/game_init.c index ffcf7a18e2..46a67da889 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -130,7 +130,7 @@ void clear_z_buffer(void) { gDPSetFillColor(gDisplayListHead++, GPACK_ZDZ(G_MAXFBZ, 0) << 16 | GPACK_ZDZ(G_MAXFBZ, 0)); - gDPFillRectangle(gDisplayListHead++, 0, BORDER_HEIGHT, SCREEN_WIDTH - 1, + gDPFillRectangle(gDisplayListHead++, GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(0), BORDER_HEIGHT, GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(0) - 1, SCREEN_HEIGHT - 1 - BORDER_HEIGHT); } @@ -315,7 +315,7 @@ void display_and_vsync(void) { // this function records distinct inputs over a 255-frame interval to RAM locations and was likely // used to record the demo sequences seen in the final game. This function is unused. -static void record_demo(void) { +UNUSED static void record_demo(void) { // record the player's button mask and current rawStickX and rawStickY. u8 buttonMask = ((gPlayer1Controller->buttonDown & (A_BUTTON | B_BUTTON | Z_TRIG | START_BUTTON)) >> 8) diff --git a/src/game/hud.c b/src/game/hud.c index cf3dee0f9b..baf6e967fa 100644 --- a/src/game/hud.c +++ b/src/game/hud.c @@ -53,7 +53,7 @@ static struct PowerMeterHUD sPowerMeterHUD = { // when the power meter is hidden. s32 sPowerMeterVisibleTimer = 0; -static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 }; +UNUSED static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 }; static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE }; diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 6f3d84b96a..87dfff105b 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -218,7 +218,7 @@ void create_dl_ortho_matrix(void) { } #if defined(VERSION_JP) || defined(VERSION_SH) -static inline void alloc_ia8_text_from_i1(u8 *out, u16 *in, s16 width, s16 height) { +static void alloc_ia8_text_from_i1(u8 *out, u16 *in, s16 width, s16 height) { s32 inPos; u16 bitMask; u16 inWord; @@ -241,7 +241,7 @@ static inline void alloc_ia8_text_from_i1(u8 *out, u16 *in, s16 width, s16 heigh } } -static inline u8 *convert_ia8_char(u8 c, u16 *tex, s16 w, s16 h) { +static u8 *convert_ia8_char(u8 c, u16 *tex, s16 w, s16 h) { #ifdef EXTERNAL_TEXTURES return (u8 *)tex; // the data's just a name #else @@ -284,7 +284,7 @@ void render_generic_char(u8 c) { #ifdef VERSION_EU static void alloc_ia4_tex_from_i1(u8 *out, u8 *in, s16 width, s16 height) { - u32 size = (u32) width * (u32) height; + UNUSED u32 size = (u32) width * (u32) height; s32 inPos; s16 outPos = 0; u8 bitMask; @@ -2976,13 +2976,14 @@ void render_save_confirmation(s16 x, s16 y, s8 *index, s16 sp6e) { TEXT_SAVE_AND_CONTINUE_FR }, { TEXT_SAVE_AND_CONTINUE_DE } }; + u8 textSaveAndQuitArr[][22] = { { TEXT_SAVE_AND_QUIT }, { TEXT_SAVE_AND_QUIT_FR }, { TEXT_SAVE_AND_QUIT_DE } }; - u8 textSaveExitGame[][26] = { // New function to exit game + u8 textSaveExitGame[][28] = { // New function to exit game { TEXT_SAVE_EXIT_GAME }, { TEXT_SAVE_EXIT_GAME_FR }, { TEXT_SAVE_EXIT_GAME_DE } diff --git a/src/game/interaction.c b/src/game/interaction.c index b8f3f881ed..44187dd972 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -524,7 +524,7 @@ void hit_object_from_below(struct MarioState *m, UNUSED struct Object *o) { set_camera_shake_from_hit(SHAKE_HIT_FROM_BELOW); } -static u32 unused_determine_knockback_action(struct MarioState *m) { +UNUSED static u32 unused_determine_knockback_action(struct MarioState *m) { u32 bonkAction; s16 angleToObject = mario_obj_angle_to_object(m, m->interactObj); s16 facingDYaw = angleToObject - m->faceAngle[1]; @@ -1297,7 +1297,7 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object return FALSE; } -static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +UNUSED static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) { if (!(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { sDelayInvincTimer = TRUE; } diff --git a/src/game/level_update.c b/src/game/level_update.c index 052959c454..0db276b7ea 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1126,7 +1126,7 @@ s32 play_mode_change_level(void) { * Unused play mode. Doesn't call transition update and doesn't reset transition * at the end. */ -static s32 play_mode_unused(void) { +UNUSED static s32 play_mode_unused(void) { if (--sTransitionTimer == -1) { gHudDisplay.flags = HUD_DISPLAY_NONE; diff --git a/src/game/macro_special_objects.c b/src/game/macro_special_objects.c index d931897108..3fcdf0fe75 100644 --- a/src/game/macro_special_objects.c +++ b/src/game/macro_special_objects.c @@ -79,7 +79,7 @@ void spawn_macro_abs_special(u32 model, const BehaviorScript *behavior, s16 x, s newObj->oMacroUnk110 = (f32) unkC; } -static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) { +UNUSED static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) { struct Object *sp3C; s16 model; diff --git a/src/game/main.c b/src/game/main.c deleted file mode 100644 index 2d6bf1d92c..0000000000 --- a/src/game/main.c +++ /dev/null @@ -1,472 +0,0 @@ -#include -#include - -#include "sm64.h" -#include "prevent_bss_reordering.h" -#include "audio/external.h" -#include "game_init.h" -#include "memory.h" -#include "sound_init.h" -#include "profiler.h" -#include "buffers/buffers.h" -#include "segments.h" -#include "main.h" -#include "thread6.h" - -// Message IDs -#define MESG_SP_COMPLETE 100 -#define MESG_DP_COMPLETE 101 -#define MESG_VI_VBLANK 102 -#define MESG_START_GFX_SPTASK 103 -#define MESG_NMI_REQUEST 104 - -OSThread D_80339210; // unused? -OSThread gIdleThread; -OSThread gMainThread; -OSThread gGameLoopThread; -OSThread gSoundThread; -#ifdef VERSION_SH -OSThread gRumblePakThread; - -s32 gRumblePakPfs; // Actually an OSPfs but we don't have that header yet -#endif - -OSIoMesg gDmaIoMesg; -OSMesg D_80339BEC; -OSMesgQueue gDmaMesgQueue; -OSMesgQueue gSIEventMesgQueue; -OSMesgQueue gPIMesgQueue; -OSMesgQueue gIntrMesgQueue; -OSMesgQueue gSPTaskMesgQueue; -#ifdef VERSION_SH -OSMesgQueue gRumblePakSchedulerMesgQueue; -OSMesgQueue gRumbleThreadVIMesgQueue; -#endif -OSMesg gDmaMesgBuf[1]; -OSMesg gPIMesgBuf[32]; -OSMesg gSIEventMesgBuf[1]; -OSMesg gIntrMesgBuf[16]; -OSMesg gUnknownMesgBuf[16]; -#ifdef VERSION_SH -OSMesg gRumblePakSchedulerMesgBuf[1]; -OSMesg gRumbleThreadVIMesgBuf[1]; - -struct RumbleData gRumbleDataQueue[3]; -struct StructSH8031D9B0 gCurrRumbleSettings; -#endif - -struct VblankHandler *gVblankHandler1 = NULL; -struct VblankHandler *gVblankHandler2 = NULL; -struct SPTask *gActiveSPTask = NULL; -struct SPTask *sCurrentAudioSPTask = NULL; -struct SPTask *sCurrentDisplaySPTask = NULL; -struct SPTask *sNextAudioSPTask = NULL; -struct SPTask *sNextDisplaySPTask = NULL; -s8 sAudioEnabled = 1; -u32 sNumVblanks = 0; -s8 gResetTimer = 0; -s8 D_8032C648 = 0; -s8 gDebugLevelSelect = 0; -s8 D_8032C650 = 0; - -s8 gShowProfiler = FALSE; -s8 gShowDebugText = FALSE; - -// unused -void handle_debug_key_sequences(void) { - static u16 sProfilerKeySequence[] = { - U_JPAD, U_JPAD, D_JPAD, D_JPAD, L_JPAD, R_JPAD, L_JPAD, R_JPAD - }; - static u16 sDebugTextKeySequence[] = { D_JPAD, D_JPAD, U_JPAD, U_JPAD, - L_JPAD, R_JPAD, L_JPAD, R_JPAD }; - static s16 sProfilerKey = 0; - static s16 sDebugTextKey = 0; - if (gPlayer3Controller->buttonPressed != 0) { - if (sProfilerKeySequence[sProfilerKey++] == gPlayer3Controller->buttonPressed) { - if (sProfilerKey == ARRAY_COUNT(sProfilerKeySequence)) { - sProfilerKey = 0, gShowProfiler ^= 1; - } - } else { - sProfilerKey = 0; - } - - if (sDebugTextKeySequence[sDebugTextKey++] == gPlayer3Controller->buttonPressed) { - if (sDebugTextKey == ARRAY_COUNT(sDebugTextKeySequence)) { - sDebugTextKey = 0, gShowDebugText ^= 1; - } - } else { - sDebugTextKey = 0; - } - } -} - -void unknown_main_func(void) { - // uninitialized - OSTime time; - u32 b; - - osSetTime(time); - osMapTLB(0, b, NULL, 0, 0, 0); - osUnmapTLBAll(); - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnonnull" - sprintf(NULL, NULL); -#pragma GCC diagnostic pop -} - -void stub_main_1(void) { -} - -void stub_main_2(void) { -} - -void stub_main_3(void) { -} - -void setup_mesg_queues(void) { - osCreateMesgQueue(&gDmaMesgQueue, gDmaMesgBuf, ARRAY_COUNT(gDmaMesgBuf)); - osCreateMesgQueue(&gSIEventMesgQueue, gSIEventMesgBuf, ARRAY_COUNT(gSIEventMesgBuf)); - osSetEventMesg(OS_EVENT_SI, &gSIEventMesgQueue, NULL); - - osCreateMesgQueue(&gSPTaskMesgQueue, gUnknownMesgBuf, ARRAY_COUNT(gUnknownMesgBuf)); - osCreateMesgQueue(&gIntrMesgQueue, gIntrMesgBuf, ARRAY_COUNT(gIntrMesgBuf)); - osViSetEvent(&gIntrMesgQueue, (OSMesg) MESG_VI_VBLANK, 1); - - osSetEventMesg(OS_EVENT_SP, &gIntrMesgQueue, (OSMesg) MESG_SP_COMPLETE); - osSetEventMesg(OS_EVENT_DP, &gIntrMesgQueue, (OSMesg) MESG_DP_COMPLETE); - osSetEventMesg(OS_EVENT_PRENMI, &gIntrMesgQueue, (OSMesg) MESG_NMI_REQUEST); -} - -void alloc_pool(void) { - void *start = (void *) SEG_POOL_START; - void *end = (void *) SEG_POOL_END; - - main_pool_init(start, end); - gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT); -} - -void create_thread(OSThread *thread, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri pri) { - thread->next = NULL; - thread->queue = NULL; - osCreateThread(thread, id, entry, arg, sp, pri); -} - -#ifdef VERSION_SH -extern void func_sh_802F69CC(void); -#endif - -void handle_nmi_request(void) { - gResetTimer = 1; - D_8032C648 = 0; - func_80320890(); - sound_banks_disable(2, 0x037A); - fadeout_music(90); -#ifdef VERSION_SH - func_sh_802F69CC(); -#endif -} - -void receive_new_tasks(void) { - struct SPTask *spTask; - - while (osRecvMesg(&gSPTaskMesgQueue, (OSMesg *) &spTask, OS_MESG_NOBLOCK) != -1) { - spTask->state = SPTASK_STATE_NOT_STARTED; - switch (spTask->task.t.type) { - case 2: - sNextAudioSPTask = spTask; - break; - case 1: - sNextDisplaySPTask = spTask; - break; - } - } - - if (sCurrentAudioSPTask == NULL && sNextAudioSPTask != NULL) { - sCurrentAudioSPTask = sNextAudioSPTask; - sNextAudioSPTask = NULL; - } - - if (sCurrentDisplaySPTask == NULL && sNextDisplaySPTask != NULL) { - sCurrentDisplaySPTask = sNextDisplaySPTask; - sNextDisplaySPTask = NULL; - } -} - -void start_sptask(s32 taskType) { - UNUSED s32 pad; // needed to pad the stack - - if (taskType == M_AUDTASK) { - gActiveSPTask = sCurrentAudioSPTask; - } else { - gActiveSPTask = sCurrentDisplaySPTask; - } - - osSpTaskLoad(&gActiveSPTask->task); - osSpTaskStartGo(&gActiveSPTask->task); - gActiveSPTask->state = SPTASK_STATE_RUNNING; -} - -void interrupt_gfx_sptask(void) { - if (gActiveSPTask->task.t.type == M_GFXTASK) { - gActiveSPTask->state = SPTASK_STATE_INTERRUPTED; - osSpTaskYield(); - } -} - -void start_gfx_sptask(void) { - if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL - && sCurrentDisplaySPTask->state == SPTASK_STATE_NOT_STARTED) { - profiler_log_gfx_time(TASKS_QUEUED); - start_sptask(M_GFXTASK); - } -} - -void pretend_audio_sptask_done(void) { - gActiveSPTask = sCurrentAudioSPTask; - gActiveSPTask->state = SPTASK_STATE_RUNNING; - osSendMesg(&gIntrMesgQueue, (OSMesg) MESG_SP_COMPLETE, OS_MESG_NOBLOCK); -} - -void handle_vblank(void) { - UNUSED s32 pad; // needed to pad the stack - - stub_main_3(); - sNumVblanks++; -#ifdef VERSION_SH - if (gResetTimer > 0 && gResetTimer < 100) { - gResetTimer++; - } -#else - if (gResetTimer > 0) { - gResetTimer++; - } -#endif - - receive_new_tasks(); - - // First try to kick off an audio task. If the gfx task is currently - // running, we need to asychronously interrupt it -- handle_sp_complete - // will pick up on what we're doing and start the audio task for us. - // If there is already an audio task running, there is nothing to do. - // If there is no audio task available, try a gfx task instead. - if (sCurrentAudioSPTask != NULL) { - if (gActiveSPTask != NULL) { - interrupt_gfx_sptask(); - } else { - profiler_log_vblank_time(); - if (sAudioEnabled != 0) { - start_sptask(M_AUDTASK); - } else { - pretend_audio_sptask_done(); - } - } - } else { - if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL - && sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) { - profiler_log_gfx_time(TASKS_QUEUED); - start_sptask(M_GFXTASK); - } - } -#ifdef VERSION_SH - rumble_thread_update_vi(); -#endif - - // Notify the game loop about the vblank. - if (gVblankHandler1 != NULL) { - osSendMesg(gVblankHandler1->queue, gVblankHandler1->msg, OS_MESG_NOBLOCK); - } - if (gVblankHandler2 != NULL) { - osSendMesg(gVblankHandler2->queue, gVblankHandler2->msg, OS_MESG_NOBLOCK); - } -} - -void handle_sp_complete(void) { - struct SPTask *curSPTask = gActiveSPTask; - - gActiveSPTask = NULL; - - if (curSPTask->state == SPTASK_STATE_INTERRUPTED) { - // handle_vblank tried to start an audio task while there was already a - // gfx task running, so it had to interrupt the gfx task. That interruption - // just finished. - if (osSpTaskYielded(&curSPTask->task) == 0) { - // The gfx task completed before we had time to interrupt it. - // Mark it finished, just like below. - curSPTask->state = SPTASK_STATE_FINISHED; - profiler_log_gfx_time(RSP_COMPLETE); - } - - // Start the audio task, as expected by handle_vblank. - profiler_log_vblank_time(); - if (sAudioEnabled != 0) { - start_sptask(M_AUDTASK); - } else { - pretend_audio_sptask_done(); - } - } else { - curSPTask->state = SPTASK_STATE_FINISHED; - if (curSPTask->task.t.type == M_AUDTASK) { - // After audio tasks come gfx tasks. - profiler_log_vblank_time(); - if (sCurrentDisplaySPTask != NULL - && sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) { - if (sCurrentDisplaySPTask->state != SPTASK_STATE_INTERRUPTED) { - profiler_log_gfx_time(TASKS_QUEUED); - } - start_sptask(M_GFXTASK); - } - sCurrentAudioSPTask = NULL; - if (curSPTask->msgqueue != NULL) { - osSendMesg(curSPTask->msgqueue, curSPTask->msg, OS_MESG_NOBLOCK); - } - } else { - // The SP process is done, but there is still a Display Processor notification - // that needs to arrive before we can consider the task completely finished and - // null out sCurrentDisplaySPTask. That happens in handle_dp_complete. - profiler_log_gfx_time(RSP_COMPLETE); - } - } -} - -void handle_dp_complete(void) { - // Gfx SP task is completely done. - if (sCurrentDisplaySPTask->msgqueue != NULL) { - osSendMesg(sCurrentDisplaySPTask->msgqueue, sCurrentDisplaySPTask->msg, OS_MESG_NOBLOCK); - } - profiler_log_gfx_time(RDP_COMPLETE); - sCurrentDisplaySPTask->state = SPTASK_STATE_FINISHED_DP; - sCurrentDisplaySPTask = NULL; -} - -void thread3_main(UNUSED void *arg) { - setup_mesg_queues(); - alloc_pool(); - load_engine_code_segment(); - - create_thread(&gSoundThread, 4, thread4_sound, NULL, gThread4Stack + 0x2000, 20); - osStartThread(&gSoundThread); - - create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10); - osStartThread(&gGameLoopThread); - - while (1) { - OSMesg msg; - - osRecvMesg(&gIntrMesgQueue, &msg, OS_MESG_BLOCK); - switch ((uintptr_t) msg) { - case MESG_VI_VBLANK: - handle_vblank(); - break; - case MESG_SP_COMPLETE: - handle_sp_complete(); - break; - case MESG_DP_COMPLETE: - handle_dp_complete(); - break; - case MESG_START_GFX_SPTASK: - start_gfx_sptask(); - break; - case MESG_NMI_REQUEST: - handle_nmi_request(); - break; - } - stub_main_2(); - } -} - -void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *queue, OSMesg *msg) { - handler->queue = queue; - handler->msg = msg; - - switch (index) { - case 1: - gVblankHandler1 = handler; - break; - case 2: - gVblankHandler2 = handler; - break; - } -} - -void send_sp_task_message(OSMesg *msg) { - osWritebackDCacheAll(); - osSendMesg(&gSPTaskMesgQueue, msg, OS_MESG_NOBLOCK); -} - -void dispatch_audio_sptask(struct SPTask *spTask) { - if (sAudioEnabled != 0 && spTask != NULL) { - osWritebackDCacheAll(); - osSendMesg(&gSPTaskMesgQueue, spTask, OS_MESG_NOBLOCK); - } -} - -void send_display_list(struct SPTask *spTask) { - if (spTask != NULL) { - osWritebackDCacheAll(); - spTask->state = SPTASK_STATE_NOT_STARTED; - if (sCurrentDisplaySPTask == NULL) { - sCurrentDisplaySPTask = spTask; - sNextDisplaySPTask = NULL; - osSendMesg(&gIntrMesgQueue, (OSMesg) MESG_START_GFX_SPTASK, OS_MESG_NOBLOCK); - } else { - sNextDisplaySPTask = spTask; - } - } -} - -void turn_on_audio(void) { - sAudioEnabled = 1; -} - -void turn_off_audio(void) { - sAudioEnabled = 0; - while (sCurrentAudioSPTask != NULL) { - ; - } -} - -/** - * Initialize hardware, start main thread, then idle. - */ -void thread1_idle(UNUSED void *arg) { -#if defined(VERSION_US) || defined(VERSION_SH) - s32 sp24 = osTvType; -#endif - - osCreateViManager(OS_PRIORITY_VIMGR); -#if defined(VERSION_US) || defined(VERSION_SH) - if (sp24 == TV_TYPE_NTSC) { - osViSetMode(&osViModeTable[OS_VI_NTSC_LAN1]); - } else { - osViSetMode(&osViModeTable[OS_VI_PAL_LAN1]); - } -#elif defined(VERSION_JP) - osViSetMode(&osViModeTable[OS_VI_NTSC_LAN1]); -#else // VERSION_EU - osViSetMode(&osViModeTable[OS_VI_PAL_LAN1]); -#endif - osViBlack(TRUE); - osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON); - osViSetSpecialFeatures(OS_VI_GAMMA_OFF); - osCreatePiManager(OS_PRIORITY_PIMGR, &gPIMesgQueue, gPIMesgBuf, ARRAY_COUNT(gPIMesgBuf)); - create_thread(&gMainThread, 3, thread3_main, NULL, gThread3Stack + 0x2000, 100); - if (D_8032C650 == 0) { - osStartThread(&gMainThread); - } - osSetThreadPri(NULL, 0); - - // halt - while (1) { - ; - } -} - -void main_func(void) { - UNUSED u8 pad[64]; // needed to pad the stack - - osInitialize(); - stub_main_1(); - create_thread(&gIdleThread, 1, thread1_idle, NULL, gIdleThreadStack + 0x800, 100); - osStartThread(&gIdleThread); -} diff --git a/src/game/main.h b/src/game/main.h index 901b1c0ae7..92fb91a9f7 100644 --- a/src/game/main.h +++ b/src/game/main.h @@ -73,6 +73,6 @@ extern s8 gShowDebugText; extern void set_vblank_handler(s32 a, struct VblankHandler *b, OSMesgQueue *queue, OSMesg *msg); extern void dispatch_audio_sptask(struct SPTask *spTask); extern void send_display_list(struct SPTask *a); -extern void main(void); +extern int main(void); #endif diff --git a/src/game/mario.c b/src/game/mario.c index e00d6e6028..3352b92ce1 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -33,6 +33,7 @@ #include "thread6.h" #include "pc/configfile.h" #include "pc/cheats.h" +#include "macros.h" #ifdef BETTERCAMERA #include "bettercamera.h" #endif @@ -1705,7 +1706,7 @@ void mario_update_hitbox_and_cap_model(struct MarioState *m) { * An unused and possibly a debug function. Z + another button input * sets Mario with a different cap. */ -static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u16 capMusic) { +UNUSED static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u16 capMusic) { // This checks for Z_TRIG instead of Z_DOWN flag // (which is also what other debug functions do), // so likely debug behavior rather than unused behavior. diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index 451035ae8f..e56f44d6b5 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -67,9 +67,6 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) { fallHeight = m->peakHeight - m->pos[1]; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wtype-limits" - //! Never true if (m->actionState == ACT_GROUND_POUND) { damageHeight = 600.0f; @@ -77,8 +74,6 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) { damageHeight = 1150.0f; } -#pragma GCC diagnostic pop - if (m->action != ACT_TWIRLING && m->floor->type != SURFACE_BURNING) { if (m->vel[1] < -55.0f) { if (fallHeight > 3000.0f) { diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index ef413cd989..bf5d7e3983 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -220,7 +220,7 @@ s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2) { } // unused -static void stub_is_textbox_active(u16 *a0) { +UNUSED static void stub_is_textbox_active(u16 *a0) { if (get_dialog_id() == -1) { *a0 = 0; } diff --git a/src/game/memory.c b/src/game/memory.c index 14c332cc3a..c7f24153c5 100644 --- a/src/game/memory.c +++ b/src/game/memory.c @@ -80,7 +80,7 @@ void *segmented_to_virtual(const void *addr) { return (void *) addr; } -void *virtual_to_segmented(u32 segment, const void *addr) { +void *virtual_to_segmented(UNUSED u32 segment, const void *addr) { return (void *) addr; } @@ -224,8 +224,7 @@ u32 main_pool_pop_state(void) { * function blocks until completion. */ static void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) { - u32 size = ALIGN16(srcEnd - srcStart); - + UNUSED u32 size = ALIGN16(srcEnd - srcStart); memcpy(dest, srcStart, srcEnd - srcStart); } diff --git a/src/game/obj_behaviors_2.c b/src/game/obj_behaviors_2.c index eb52683cfb..ec8d2f9a7f 100644 --- a/src/game/obj_behaviors_2.c +++ b/src/game/obj_behaviors_2.c @@ -688,7 +688,7 @@ static void obj_die_if_health_non_positive(void) { } } -static void obj_unused_die(void) { +UNUSED static void obj_unused_die(void) { o->oHealth = 0; obj_die_if_health_non_positive(); } diff --git a/src/game/object_collision.c b/src/game/object_collision.c index 5c83526ab3..be8c40c784 100644 --- a/src/game/object_collision.c +++ b/src/game/object_collision.c @@ -56,7 +56,7 @@ int detect_object_hitbox_overlap(struct Object *a, struct Object *b) { return 1; } - //! no return value + return 0; } int detect_object_hurtbox_overlap(struct Object *a, struct Object *b) { @@ -88,7 +88,7 @@ int detect_object_hurtbox_overlap(struct Object *a, struct Object *b) { return 1; } - //! no return value + return 0; } void clear_object_collision(struct Object *a) { diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index e05f77439f..b254ef7809 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -1395,7 +1395,7 @@ void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy) { } } -static void stub_obj_helpers_1(void) { +UNUSED static void stub_obj_helpers_1(void) { } static s32 clear_move_flag(u32 *bitSet, s32 flag) { @@ -2255,7 +2255,7 @@ void bhv_dust_smoke_loop(void) { o->oSmokeTimer++; } -static void stub_obj_helpers_2(void) { +UNUSED static void stub_obj_helpers_2(void) { } s32 cur_obj_set_direction_table(s8 *a0) { @@ -2404,7 +2404,7 @@ s32 is_item_in_array(s8 item, s8 *array) { return FALSE; } -static void stub_obj_helpers_5(void) { +UNUSED static void stub_obj_helpers_5(void) { } void bhv_init_room(void) { diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 3bb3ca65a9..5d4e8f82ec 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -603,7 +603,7 @@ void unload_deactivated_objects(void) { /** * Unused profiling function. */ -static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) { +UNUSED static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) { u16 time; f64 cycles; diff --git a/src/game/options_menu.c b/src/game/options_menu.c index 4e08dbdb1d..7d57e107ec 100644 --- a/src/game/options_menu.c +++ b/src/game/options_menu.c @@ -59,6 +59,7 @@ static const u8 menuStr[][32] = { }; +#if defined(BETTERCAMERA) && defined(EXT_OPTIONS_MENU) static const u8 optsCameraStr[][32] = { { TEXT_OPT_CAMX }, { TEXT_OPT_CAMY }, @@ -70,6 +71,7 @@ static const u8 optsCameraStr[][32] = { { TEXT_OPT_MOUSE }, { TEXT_OPT_CAMD }, }; +#endif static const u8 optsVideoStr[][32] = { { TEXT_OPT_FSCREEN }, diff --git a/src/game/paintings.c b/src/game/paintings.c index e53dd45f4c..bb1c210fed 100644 --- a/src/game/paintings.c +++ b/src/game/paintings.c @@ -247,6 +247,7 @@ f32 painting_ripple_y(struct Painting *painting, s8 ySource) { return painting->size / 2.0; // some concentric ripples don't care about Mario break; } + return 0; } /** @@ -272,6 +273,7 @@ f32 painting_nearest_4th(struct Painting *painting) { } else if (painting->floorEntered & ENTER_RIGHT) { return thirdQuarter; } + return 0; } /** @@ -303,6 +305,7 @@ f32 painting_ripple_x(struct Painting *painting, s8 xSource) { return painting->size / 2.0; break; } + return 0; } /** diff --git a/src/game/screen_transition.c b/src/game/screen_transition.c index c009abea50..eae9fb320a 100644 --- a/src/game/screen_transition.c +++ b/src/game/screen_transition.c @@ -238,6 +238,7 @@ int render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct Wa return render_textured_transition(fadeTimer, transTime, transData, TEX_TRANS_BOWSER, TRANS_TYPE_MIRROR); break; } + return 0; } Gfx *render_cannon_circle_base(void) { diff --git a/src/game/shadow.c b/src/game/shadow.c index 5b74545d03..0db25c379e 100644 --- a/src/game/shadow.c +++ b/src/game/shadow.c @@ -190,8 +190,7 @@ f32 get_water_level_below_shadow(struct Shadow *s) { gShadowAboveWaterOrLava = TRUE; return waterLevel; } - //! @bug Missing return statement. This compiles to return `waterLevel` - //! incidentally. + return waterLevel; } /** diff --git a/src/game/sound_init.c b/src/game/sound_init.c index ec5dfcbc1c..e5088e5b7c 100644 --- a/src/game/sound_init.c +++ b/src/game/sound_init.c @@ -29,7 +29,7 @@ static u16 sCurrentMusic = MUSIC_NONE; static u16 sCurrentShellMusic = MUSIC_NONE; static u16 sCurrentCapMusic = MUSIC_NONE; static u8 sPlayingInfiniteStairs = FALSE; -static u8 unused8032C6D8[16] = { 0 }; +UNUSED static u8 unused8032C6D8[16] = { 0 }; static s16 sSoundMenuModeToSoundMode[] = { SOUND_MODE_STEREO, SOUND_MODE_MONO, SOUND_MODE_HEADSET }; // Only the 20th array element is used. static u32 menuSoundsExtra[] = { diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c index 79f930f2f7..fbefd65ba0 100644 --- a/src/game/spawn_object.c +++ b/src/game/spawn_object.c @@ -163,7 +163,7 @@ void clear_object_lists(struct ObjectNode *objLists) { /** * Delete the leaf graph nodes under obj and obj's siblings. */ -static void unused_delete_leaf_nodes(struct Object *obj) { +UNUSED static void unused_delete_leaf_nodes(struct Object *obj) { struct Object *children; struct Object *sibling; struct Object *obj0 = obj; diff --git a/src/goddard/debug_utils.c b/src/goddard/debug_utils.c index 6bd076433c..3f906d2869 100644 --- a/src/goddard/debug_utils.c +++ b/src/goddard/debug_utils.c @@ -410,7 +410,7 @@ void fatal_printf(const char *fmt, ...) { gd_printf("%s", va_arg(vl, char *)); break; case 'c': - gd_printf("%c", va_arg(vl, char)); + gd_printf("%c", va_arg(vl, int)); break; case 'x': gd_printf("%x", va_arg(vl, s32)); diff --git a/src/goddard/draw_objects.c b/src/goddard/draw_objects.c index 63ba040461..c5bcf9e901 100644 --- a/src/goddard/draw_objects.c +++ b/src/goddard/draw_objects.c @@ -61,7 +61,7 @@ static struct GdColour sClrYellow = { 1.0, 1.0, 0.0 }; // @ 801A80DC static struct GdColour sLightColours[1] = { { 1.0, 1.0, 0.0 } }; // @ 801A80E8 static struct GdColour *sSelectedColour = &sClrRed; // @ 801A80F4 struct ObjCamera *gViewUpdateCamera = NULL; // @ 801A80F8 -static void *sUnref801A80FC = NULL; +UNUSED static void *sUnref801A80FC = NULL; static s32 sUnreadShapeFlag = 0; // @ 801A8100 struct GdColour *sColourPalette[5] = { // @ 801A8104 &sClrWhite, &sClrYellow, &sClrRed, &sClrBlack, &sClrBlack @@ -71,20 +71,20 @@ struct GdColour *sWhiteBlack[2] = { &sClrWhite, &sClrBlack, }; -static Mat4f sUnref801A8120 = { +UNUSED static Mat4f sUnref801A8120 = { { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } }; -static Mat4f sUnrefIden801A8160 = { +UNUSED static Mat4f sUnrefIden801A8160 = { { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } }; static s32 sLightDlCounter = 1; // @ 801A81A0 -static s32 sUnref801A81A4[4] = { 0 }; +UNUSED static s32 sUnref801A81A4[4] = { 0 }; // bss u8 gUnref_801B9B30[0x88]; struct ObjGroup *gGdLightGroup; // @ 801B9BB8; is this the main light group? only light group? -static u8 sUnref_801B9BBC[0x40]; +UNUSED static u8 sUnref_801B9BBC[0x40]; static enum SceneType sSceneProcessType; // @ 801B9C00 static s32 sUseSelectedColor; // @ 801B9C04 static s16 sPickBuffer[100]; ///< buffer of objects near click diff --git a/src/goddard/dynlist_proc.c b/src/goddard/dynlist_proc.c index 2ffa327a33..5888413b4f 100644 --- a/src/goddard/dynlist_proc.c +++ b/src/goddard/dynlist_proc.c @@ -720,7 +720,7 @@ void d_attach(DynId id) { */ void d_attach_to(s32 flag, struct GdObj *obj) { UNUSED u32 pad4C; - struct ObjGroup *attgrp; + struct ObjGroup *attgrp = NULL; UNUSED u32 pad[2]; UNUSED struct DynObjInfo *curInfo = sDynListCurInfo; struct GdVec3f dynobjPos; // transformed into attach offset @@ -1799,7 +1799,7 @@ struct ObjGroup *d_get_att_objgroup(void) { fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttObjGroup()", sDynListCurInfo->name, sDynListCurObj->type); } - // No null return due to `fatal_printf()` being a non-returning function? + return NULL; } /** @@ -1821,7 +1821,7 @@ struct GdObj *d_get_att_to_obj(void) { fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttToObj()", sDynListCurInfo->name, sDynListCurObj->type); } - // No null return due to `fatal_printf()` being a non-returning function? + return NULL; } /** @@ -1909,6 +1909,7 @@ void d_set_att_to_offset(UNUSED u32 a) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); + return; } dynobj = sDynListCurObj; @@ -1969,7 +1970,7 @@ void d_get_att_offset(struct GdVec3f *dst) { * Get the attached object flags for the current dynamic object. */ s32 d_get_att_flags(void) { - s32 attflag; // sp24 + s32 attflag = 0; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2090,7 +2091,7 @@ struct GdVec3f *d_get_world_pos_ptr(void) { fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetWorldPosPtr()", sDynListCurInfo->name, sDynListCurObj->type); } - // No null return due to `fatal_printf()` being a non-returning function? + return NULL; } /** @@ -3005,7 +3006,7 @@ Mat4f *d_get_rot_mtx_ptr(void) { fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetRMatrixPtr()", sDynListCurInfo->name, sDynListCurObj->type); } - // No null return due to `fatal_printf()` being a non-returning function? + return NULL; } /** @@ -3062,7 +3063,7 @@ Mat4f *d_get_matrix_ptr(void) { fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetMatrixPtr()", sDynListCurInfo->name, sDynListCurObj->type); } - // No null return due to `fatal_printf()` being a non-returning function? + return NULL; } /** @@ -3087,7 +3088,7 @@ Mat4f *d_get_idn_mtx_ptr(void) { fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetIMatrixPtr()", sDynListCurInfo->name, sDynListCurObj->type); } - // No null return due to `fatal_printf()` being a non-returning function? + return NULL; } /** diff --git a/src/goddard/dynlist_proc.h b/src/goddard/dynlist_proc.h index 6e78ba8148..d0bdd68d86 100644 --- a/src/goddard/dynlist_proc.h +++ b/src/goddard/dynlist_proc.h @@ -64,7 +64,7 @@ extern void d_copystr_to_idbuf(char *); extern struct GdObj *d_makeobj(enum DObjTypes type, DynId id); extern void d_set_shapeptrptr(struct ObjShape **); extern struct GdObj *d_use_obj(DynId); -extern void set_cur_dynobj(); //set_cur_dynobj(struct GdObj *); +extern void set_cur_dynobj(struct GdObj *); extern void d_start_group(DynId); extern void d_end_group(DynId); extern void dynid_is_int(s32); diff --git a/src/goddard/gd_main.c b/src/goddard/gd_main.c index a9f1a84bc7..5fdd0a56a5 100644 --- a/src/goddard/gd_main.c +++ b/src/goddard/gd_main.c @@ -13,11 +13,11 @@ // data s32 gGdMoveScene = TRUE; // @ 801A8050 -static s32 sUnref801A8054 = TRUE; +UNUSED static s32 sUnref801A8054 = TRUE; f32 D_801A8058 = -600.0f; s32 gGdUseVtxNormal = TRUE; // @ 801A805C; instead of face normals -static s32 sUnrefScnWidth = 320; -static s32 sUnrefScnHeight = 240; +UNUSED static s32 sUnrefScnWidth = 320; +UNUSED static s32 sUnrefScnHeight = 240; // bss struct GdControl gGdCtrl; // @ 801B9920; processed controller info diff --git a/src/goddard/joints.c b/src/goddard/joints.c index 55786a66a9..c85ae671b2 100644 --- a/src/goddard/joints.c +++ b/src/goddard/joints.c @@ -138,7 +138,7 @@ void Proc8018EBE8(struct ObjJoint *self) { } } - set_cur_dynobj(self); + set_cur_dynobj((struct GdObj *)self); sp5C = d_get_rot_mtx_ptr(); sp44.x = (*sp5C)[3][0]; sp44.y = (*sp5C)[3][1]; diff --git a/src/goddard/old_menu.c b/src/goddard/old_menu.c index 27c1dac880..26a0b90828 100644 --- a/src/goddard/old_menu.c +++ b/src/goddard/old_menu.c @@ -23,7 +23,7 @@ // bss static char sMenuStrBuf[0x100]; static struct GdVec3f sStaticVec; -static struct GdVec3f unusedVec; +UNUSED static struct GdVec3f unusedVec; static struct ObjGadget *sCurGadgetPtr; // forward declarations diff --git a/src/goddard/particles.c b/src/goddard/particles.c index a54dfacc74..9e7f469f61 100644 --- a/src/goddard/particles.c +++ b/src/goddard/particles.c @@ -25,7 +25,7 @@ struct Connection { }; // data -static void *sUnused801A81D0 = NULL; +UNUSED static void *sUnused801A81D0 = NULL; static s32 D_801A81D4[25] = { /* ID? X Y Z */ 9, 3, 12, -14, 25, 5, 16, -25, 42, 4, 15, -39, 55, @@ -236,9 +236,9 @@ struct Connection *func_801825FC(struct ObjVertex *vtx1, struct ObjVertex *vtx2) sp34->unk1C.vtx = vtx1; sp34->unk20.vtx = vtx2; push_dynobj_stash(); - set_cur_dynobj(vtx1); + set_cur_dynobj((struct GdObj *)vtx1); d_get_world_pos(&sp28); - set_cur_dynobj(vtx2); + set_cur_dynobj((struct GdObj *)vtx2); d_get_world_pos(&sp1C); sp28.x -= sp1C.x; sp28.y -= sp1C.y; diff --git a/src/goddard/renderer.c b/src/goddard/renderer.c index 4fa779863d..224a0e4ebe 100644 --- a/src/goddard/renderer.c +++ b/src/goddard/renderer.c @@ -98,7 +98,7 @@ u8 EUpad2[0x64]; static OSMesg sGdMesgBuf[1]; // @ 801BE944 u8 EUpad3[0x34]; static OSMesg D_801BE97C; // msg buf for D_801BE8B0 queue -static OSIoMesg D_801BE980; +UNUSED static OSIoMesg D_801BE980; static struct ObjView *D_801BE994; // store if View flag 0x40 set u8 EUpad4[0x88]; @@ -114,7 +114,7 @@ static s16 D_801BAF30[13][8]; // [[s16; 8]; 13]? vert i static u32 unref_801bb000[3]; static u8 *sMemBlockPoolBase; // @ 801BB00C static u32 sAllocMemory; // @ 801BB010; malloc-ed bytes -static u32 unref_801bb014; +UNUSED static u32 unref_801bb014; static s32 D_801BB018; static s32 D_801BB01C; static void *D_801BB020[0x10]; // texture pointers @@ -134,11 +134,11 @@ static s32 D_801BB0CC; // Vtx start in GD Dl static struct ObjView *sCarSceneView; // @ 801BB0D0 static s32 sUpdateYoshiScene; // @ 801BB0D4; update dl Vtx from ObjVertex? static s32 sUpdateMarioScene; // @ 801BB0D8; update dl Vtx from ObjVertex? -static u32 unref_801bb0dc; +UNUSED static u32 unref_801bb0dc; static s32 sUpdateCarScene; // @ 801BB0E0; guess, not really used -static u32 unref_801bb0e4; +UNUSED static u32 unref_801bb0e4; static struct GdVec3f D_801BB0E8; -static u32 unref_801bb0f8[2]; +UNUSED static u32 unref_801bb0f8[2]; static Mtx sIdnMtx; // @ 801BB100 static Mat4f sInitIdnMat4; // @ 801BB140 static s8 sVtxCvrtNormBuf[3]; // @ 801BB180 @@ -169,21 +169,21 @@ static LookAt D_801BE7D0[3]; #ifndef VERSION_EU static OSMesgQueue D_801BE830; // controller msg queue static OSMesg D_801BE848[10]; -static u32 unref_801be870[16]; +UNUSED static u32 unref_801be870[16]; static OSMesgQueue D_801BE8B0; static OSMesgQueue sGdDMAQueue; // @ 801BE8C8 -static u32 unref_801be8e0[25]; +UNUSED static u32 unref_801be8e0[25]; static OSMesg sGdMesgBuf[1]; // @ 801BE944 -static u32 unref_801be948[13]; +UNUSED static u32 unref_801be948[13]; static OSMesg D_801BE97C; // msg buf for D_801BE8B0 queue -static OSIoMesg D_801BE980; +UNUSED static OSIoMesg D_801BE980; static struct ObjView *D_801BE994; // store if View flag 0x40 set #endif // data -static u32 unref_801a8670 = 0; +UNUSED static u32 unref_801a8670 = 0; static s32 D_801A8674 = 0; -static u32 unref_801a8678 = 0; +UNUSED static u32 unref_801a8678 = 0; static s32 D_801A867C = 0; static s32 D_801A8680 = 0; static f32 sTracked1FrameTime = 0.0f; // @ 801A8684 @@ -198,11 +198,11 @@ static struct GdTimer *D_801A86A4 = NULL; // timer for dlgen, dynamics, or rcp static struct GdTimer *D_801A86A8 = NULL; // timer for dlgen, dynamics, or rcp static struct GdTimer *D_801A86AC = NULL; // timer for dlgen, dynamics, or rcp s32 gGdFrameBuf = 0; // @ 801A86B0 -static u32 unref_801a86B4 = 0; +UNUSED static u32 unref_801a86B4 = 0; static struct ObjShape *sHandShape = NULL; // @ 801A86B8 static s32 D_801A86BC = 1; static s32 D_801A86C0 = 0; // gd_dl id for something? -static u32 unref_801a86C4 = 10; +UNUSED static u32 unref_801a86C4 = 10; static s32 sMtxParamType = G_MTX_PROJECTION; static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f }; static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl @@ -213,10 +213,10 @@ static struct ObjView *sMenuView = NULL; // @ 801A86E8 static u32 sItemsInMenu = 0; // @ 801A86EC static s32 D_801A86F0 = 0; // frame buffer idx into D_801BD7A0? static s32 sNewZPresses = 0; // @ 801A86F4; timing activate cool down counter? -static u32 unref_801a86F8 = 0; +UNUSED static u32 unref_801a86F8 = 0; static struct GdDisplayList *sCurrentGdDl = NULL; // @ 801A86FC static u32 sGdDlCount = 0; // @ 801A8700 -static struct DynListBankInfo sDynLists[] = { // @ 801A8704 +UNUSED static struct DynListBankInfo sDynLists[] = { // @ 801A8704 { STD_LIST_BANK, dynlist_test_cube }, { STD_LIST_BANK, dynlist_unused }, { STD_LIST_BANK, dynlist_mario_master }, @@ -224,7 +224,7 @@ static struct DynListBankInfo sDynLists[] = { // @ 801A8704 }; // textures and display list data -static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728 +UNUSED static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728 gsSPEndDisplayList(), }; @@ -232,7 +232,7 @@ ALIGNED8 static u8 gd_texture_hand_open[] = { #include "textures/intro_raw/hand_open.rgba16.inc.c" }; -static Gfx gd_texture2_dummy_aligner1[] = { +UNUSED static Gfx gd_texture2_dummy_aligner1[] = { gsSPEndDisplayList() }; @@ -679,7 +679,7 @@ static Gfx *gd_silver_sparkle_dl_array[] = { #endif }; -static Gfx gd_texture3_dummy_aligner1[] = { +UNUSED static Gfx gd_texture3_dummy_aligner1[] = { gsSPEndDisplayList(), }; @@ -724,13 +724,13 @@ static Gfx gd_dl_rdp_init[] = { gsSPEndDisplayList(), }; -static u32 gd_unused_pad1 = 0; +UNUSED static u32 gd_unused_pad1 = 0; float sGdPerspTimer = 1.0; -static u32 gd_unused_pad2 = 0; +UNUSED static u32 gd_unused_pad2 = 0; -static Gfx gd_texture4_dummy_aligner1[] = { +UNUSED static Gfx gd_texture4_dummy_aligner1[] = { gsDPPipeSync(), gsSPEndDisplayList(), }; @@ -747,7 +747,7 @@ static Vtx_t gd_unused_mesh_vertex_group2[] = { {{ 3, -7, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}}, }; -static Gfx gd_dl_unused_mesh[] = { +UNUSED static Gfx gd_dl_unused_mesh[] = { gsDPPipeSync(), gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2), gsSPClearGeometryMode(0xFFFFFFFF), @@ -1718,7 +1718,7 @@ u32 Unknown8019EC88(Gfx *dl, UNUSED s32 arg1) { /* 24D4C4 -> 24D63C; orig name: func_8019ECF4 */ void mat4_to_mtx(const Mat4f *src, Mtx *dst) { - guMtxF2L(src, dst); + guMtxF2L(*(Mat4f *)src, dst); } @@ -2784,7 +2784,7 @@ void Proc801A43DC(UNUSED struct GdObj *obj) { /* 252BC0 -> 252BE0 */ void *func_801A43F0(UNUSED const char *menufmt, ...) { - //! @bug no return; function was stubbed + return 0; } /* 252BE0 -> 252BF0 */ diff --git a/src/goddard/shape_helper.c b/src/goddard/shape_helper.c index 90b14d3515..10ccf30df0 100644 --- a/src/goddard/shape_helper.c +++ b/src/goddard/shape_helper.c @@ -66,10 +66,10 @@ static struct UnkData sUnref801A835C = { { { 1, 4, &sUnref801A835C }; -static s32 sUnref801A838C[6] = { 0 }; +UNUSED static s32 sUnref801A838C[6] = { 0 }; struct ObjShape *D_801A83A4 = NULL; -static s32 sUnref801A83A8[31] = { 0 }; -static struct DynList sSimpleDylist[8] = { +UNUSED static s32 sUnref801A83A8[31] = { 0 }; +UNUSED static struct DynList sSimpleDylist[8] = { StartList(), StartGroup("simpleg"), MakeDynObj(D_NET, "simple"), @@ -84,17 +84,17 @@ static struct DynList sDynlist801A84E4[3] = { SetFlag(0x1800), StopList(), }; -static struct DynList sDynlist801A85B3[5] = { +UNUSED static struct DynList sDynlist801A85B3[5] = { StartList(), JumpToList(sDynlist801A84E4), SetFlag(0x400), SetFriction(0.04, 0.01, 0.01), StopList(), }; -static struct DynList sDynlist801A85A4[4] = { +UNUSED static struct DynList sDynlist801A85A4[4] = { StartList(), JumpToList(sDynlist801A84E4), SetFriction(0.04, 0.01, 0.01), StopList(), }; -static struct DynList sDynlist801A8604[4] = { +UNUSED static struct DynList sDynlist801A8604[4] = { StartList(), JumpToList(sDynlist801A84E4), SetFriction(0.005, 0.005, 0.005), @@ -103,35 +103,35 @@ static struct DynList sDynlist801A8604[4] = { static f64 D_801A8668 = 0.0; // bss -static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00 +UNUSED static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00 static struct ObjGroup *sCubeShapeGroup; // @ 801BAB2C -static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30 +UNUSED static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30 static struct ObjShape *sCubeShape; // @ 801BAB3C -static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40 +UNUSED static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40 static char sGdLineBuf[0x100]; // @ 801BAB48 static s32 sGdLineBufCsr; // @ 801BAC48 static struct GdFile *sGdShapeFile; // @ 801BAC4C static struct ObjShape *sGdShapeListHead; // @ 801BAC50 static u32 sGdShapeCount; // @ 801BAC54 -static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58 +UNUSED static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58 static struct GdVec3f D_801BAC60; -static u32 sUnrefSpaceC6C; // @ 801BAC6C -static u32 sUnrefSpaceC70; // @ 801BAC70 +UNUSED static u32 sUnrefSpaceC6C; // @ 801BAC6C +UNUSED static u32 sUnrefSpaceC70; // @ 801BAC70 static struct ObjPlane *D_801BAC74; static struct ObjPlane *D_801BAC78; // sShapeNetHead? -static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80 +UNUSED static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80 static struct ObjFace *D_801BAC9C; static struct ObjFace *D_801BACA0; -static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8 +UNUSED static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8 /// factor for scaling vertices in an `ObjShape` when calling `scale_verts_in_shape()` static struct GdVec3f sVertexScaleFactor; /// factor for translating vertices in an `ObjShape` when calling `translate_verts_in_shape()` static struct GdVec3f sVertexTranslateOffset; -static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8 +UNUSED static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8 static struct ObjGroup *D_801BAD08; // group of planes from make_netfromshape -static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10 +UNUSED static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10 static struct GdVec3f D_801BAD30; // printed with "c=" -static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40 +UNUSED static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40 // Forward Declarations struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *, s32, f32, f32, f32); @@ -886,7 +886,7 @@ struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *group, UNUSED s32 a1, f } newMtl = make_material(0, NULL, 1); - set_cur_dynobj(newMtl); + set_cur_dynobj((struct GdObj *)newMtl); d_set_diffuse(r, g, b); addto_group(group, (struct GdObj *) newMtl); diff --git a/src/menu/file_select.c b/src/menu/file_select.c index 3637d7d963..8e164ecda4 100644 --- a/src/menu/file_select.c +++ b/src/menu/file_select.c @@ -38,7 +38,10 @@ // the large length difference between options. // sSoundTextY unused (EU supports its existence). static s16 sSoundTextX; -static s16 sSoundTextY; +UNUSED static s16 sSoundTextY; +#elif VERSION_EU +UNUSED static s16 sSoundTextX; +UNUSED static s16 sSoundTextY; #endif //! @Bug (UB Array Access) For PAL, more buttons were added than the array was extended. @@ -62,8 +65,8 @@ static struct Object *sMainMenuButtons[NUM_BUTTONS]; // The current sound mode is automatically centered on US due to // the large length difference between options. // sSoundTextY is unused -static s16 sSoundTextX; -static s16 sSoundTextY; +UNUSED static s16 sSoundTextX; +UNUSED static s16 sSoundTextY; #endif // Used to defined yes/no fade colors after a file is selected in the erase menu. diff --git a/src/menu/level_select_menu.c b/src/menu/level_select_menu.c index b9505df91d..9594f78c43 100644 --- a/src/menu/level_select_menu.c +++ b/src/menu/level_select_menu.c @@ -69,7 +69,7 @@ int run_press_start_demo_timer(s32 timer) { return timer; } -extern int gDemoInputListID_2; +extern unsigned int gDemoInputListID_2; extern int gPressedStart; int start_demo(int timer) diff --git a/src/pc/README-n64-fast32-engine.md b/src/pc/README-n64-fast3d-engine.md similarity index 92% rename from src/pc/README-n64-fast32-engine.md rename to src/pc/README-n64-fast3d-engine.md index 4aa387d498..dc54ca6b85 100644 --- a/src/pc/README-n64-fast32-engine.md +++ b/src/pc/README-n64-fast3d-engine.md @@ -1,10 +1,10 @@ # About n64-fast32-engine -sm64pc supports OpenGL through [n64-fast32-engine](https://github.com/Emill/n64-fast3d-engine/), by [Emill](https://github.com/Emill/). +sm64pc supports OpenGL through [n64-fast3d-engine](https://github.com/Emill/n64-fast3d-engine/), by [Emill](https://github.com/Emill/). We recommend that you visit the repo if you wish for a better understanding on how this port was possible. -n64-fast32-engine is licensed under +n64-fast3d-engine is licensed under ``` Copyright (c) 2020, Emill diff --git a/src/pc/audio/audio_null.c b/src/pc/audio/audio_null.c index 4d0dd92347..e54e0f033e 100644 --- a/src/pc/audio/audio_null.c +++ b/src/pc/audio/audio_null.c @@ -1,4 +1,5 @@ #include "audio_api.h" +#include "macros.h" static bool audio_null_init(void) { return true; @@ -12,7 +13,7 @@ static int audio_null_get_desired_buffered(void) { return 0; } -static void audio_null_play(const uint8_t *buf, size_t len) { +static void audio_null_play(UNUSED const uint8_t *buf, UNUSED size_t len) { } static void audio_null_shutdown(void) { diff --git a/src/pc/controller/controller_entry_point.c b/src/pc/controller/controller_entry_point.c index 90c10c1d5a..fd7237b78f 100644 --- a/src/pc/controller/controller_entry_point.c +++ b/src/pc/controller/controller_entry_point.c @@ -20,7 +20,7 @@ static struct ControllerAPI *controller_implementations[] = { &controller_keyboard, }; -s32 osContInit(OSMesgQueue *mq, u8 *controllerBits, OSContStatus *status) { +s32 osContInit(UNUSED OSMesgQueue *mq, u8 *controllerBits, UNUSED OSContStatus *status) { for (size_t i = 0; i < sizeof(controller_implementations) / sizeof(struct ControllerAPI *); i++) { controller_implementations[i]->init(); } @@ -28,7 +28,7 @@ s32 osContInit(OSMesgQueue *mq, u8 *controllerBits, OSContStatus *status) { return 0; } -s32 osContStartReadData(OSMesgQueue *mesg) { +s32 osContStartReadData(UNUSED OSMesgQueue *mesg) { return 0; } diff --git a/src/pc/controller/controller_sdl.c b/src/pc/controller/controller_sdl.c index cbdd6178f8..654d2c7b8b 100644 --- a/src/pc/controller/controller_sdl.c +++ b/src/pc/controller/controller_sdl.c @@ -42,7 +42,7 @@ static u32 joy_binds[MAX_JOYBINDS][2]; static u32 mouse_binds[MAX_JOYBINDS][2]; static bool joy_buttons[SDL_CONTROLLER_BUTTON_MAX ] = { false }; -static u32 mouse_buttons = 0; +UNUSED static u32 mouse_buttons = 0; static u32 last_mouse = VK_INVALID; static u32 last_joybutton = VK_INVALID; diff --git a/src/pc/gfx/gfx_opengl.c b/src/pc/gfx/gfx_opengl.c index 7909d341e3..a8cba73769 100644 --- a/src/pc/gfx/gfx_opengl.c +++ b/src/pc/gfx/gfx_opengl.c @@ -129,6 +129,7 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_ return "texVal1.a"; } } + return 0; } static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) { diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index c090083177..21df0fd41c 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -4,6 +4,7 @@ #include #include #include +#include "macros.h" #ifdef EXTERNAL_TEXTURES #define STB_IMAGE_IMPLEMENTATION @@ -187,12 +188,12 @@ static unsigned long get_time(void) { static void gfx_flush(void) { if (buf_vbo_len > 0) { - int num = buf_vbo_num_tris; - unsigned long t0 = get_time(); + UNUSED int num = buf_vbo_num_tris; + UNUSED unsigned long t0 = get_time(); gfx_rapi->draw_triangles(buf_vbo, buf_vbo_len, buf_vbo_num_tris); buf_vbo_len = 0; buf_vbo_num_tris = 0; - unsigned long t1 = get_time(); + UNUSED unsigned long t1 = get_time(); /*if (t1 - t0 > 1000) { printf("f: %d %d\n", num, (int)(t1 - t0)); }*/ @@ -285,7 +286,7 @@ static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, co hash = (hash >> HASH_SHIFT) & HASH_MASK; struct TextureHashmapNode **node = &gfx_texture_cache.hashmap[hash]; - while (*node != NULL && *node - gfx_texture_cache.pool < gfx_texture_cache.pool_pos) { + while (*node != NULL && *node - gfx_texture_cache.pool < (long)gfx_texture_cache.pool_pos) { if (CMPADDR((*node)->texture_addr, orig_addr) && (*node)->fmt == fmt && (*node)->siz == siz) { gfx_rapi->select_texture(tile, (*node)->texture_id); *n = *node; @@ -322,7 +323,7 @@ static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, co static void import_texture_rgba32(int tile) { uint32_t width = rdp.texture_tile.line_size_bytes / 2; uint32_t height = (rdp.loaded_texture[tile].size_bytes / 2) / rdp.texture_tile.line_size_bytes; - gfx_rapi->upload_texture(rdp.loaded_texture[tile].addr, width, height); + gfx_rapi->upload_texture((uint8_t *)rdp.loaded_texture[tile].addr, width, height); } static void import_texture_rgba16(int tile) { @@ -599,7 +600,7 @@ static void import_texture(int tile) { stbi_image_free(data); // don't need this anymore #else // the texture data is actual texture data - int t0 = get_time(); + UNUSED int t0 = get_time(); if (fmt == G_IM_FMT_RGBA) { if (siz == G_IM_SIZ_32b) { import_texture_rgba32(tile); @@ -638,7 +639,7 @@ static void import_texture(int tile) { } else { abort(); } - int t1 = get_time(); + UNUSED int t1 = get_time(); //printf("Time diff: %d\n", t1 - t0); #endif } @@ -1119,14 +1120,14 @@ static void gfx_sp_movemem(uint8_t index, uint8_t offset, const void* data) { } } -static void gfx_sp_moveword(uint8_t index, uint16_t offset, uint32_t data) { +static void gfx_sp_moveword(uint8_t index, UNUSED uint16_t offset, uint32_t data) { switch (index) { case G_MW_NUMLIGHT: #ifdef F3DEX_GBI_2 rsp.current_num_lights = data / 24 + 1; // add ambient light #else // Ambient light is included - // The 31th bit is a flag that lights should be recalculated + // The 31st bit is a flag that lights should be recalculated rsp.current_num_lights = (data - 0x80000000U) / 32; #endif rsp.lights_changed = 1; @@ -1138,12 +1139,12 @@ static void gfx_sp_moveword(uint8_t index, uint16_t offset, uint32_t data) { } } -static void gfx_sp_texture(uint16_t sc, uint16_t tc, uint8_t level, uint8_t tile, uint8_t on) { +static void gfx_sp_texture(uint16_t sc, uint16_t tc, UNUSED uint8_t level, UNUSED uint8_t tile, UNUSED uint8_t on) { rsp.texture_scaling_factor.s = sc; rsp.texture_scaling_factor.t = tc; } -static void gfx_dp_set_scissor(uint32_t mode, uint32_t ulx, uint32_t uly, uint32_t lrx, uint32_t lry) { +static void gfx_dp_set_scissor(UNUSED uint32_t mode, uint32_t ulx, uint32_t uly, uint32_t lrx, uint32_t lry) { float x = ulx / 4.0f * RATIO_X; float y = (SCREEN_HEIGHT - lry / 4.0f) * RATIO_Y; float width = (lrx - ulx) / 4.0f * RATIO_X; @@ -1157,12 +1158,12 @@ static void gfx_dp_set_scissor(uint32_t mode, uint32_t ulx, uint32_t uly, uint32 rdp.viewport_or_scissor_changed = true; } -static void gfx_dp_set_texture_image(uint32_t format, uint32_t size, uint32_t width, const void* addr) { +static void gfx_dp_set_texture_image(UNUSED uint32_t format, uint32_t size, UNUSED uint32_t width, const void* addr) { rdp.texture_to_load.addr = addr; rdp.texture_to_load.siz = size; } -static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, uint32_t maskt, uint32_t shiftt, uint32_t cms, uint32_t masks, uint32_t shifts) { +static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, UNUSED uint32_t maskt, UNUSED uint32_t shiftt, uint32_t cms, UNUSED uint32_t masks, UNUSED uint32_t shifts) { if (tile == G_TX_RENDERTILE) { SUPPORT_CHECK(palette == 0); // palette should set upper 4 bits of color index in 4b mode @@ -1191,13 +1192,13 @@ static void gfx_dp_set_tile_size(uint8_t tile, uint16_t uls, uint16_t ult, uint1 } } -static void gfx_dp_load_tlut(uint8_t tile, uint32_t high_index) { +static void gfx_dp_load_tlut(uint8_t tile, UNUSED uint32_t high_index) { SUPPORT_CHECK(tile == G_TX_LOADTILE); SUPPORT_CHECK(rdp.texture_to_load.siz == G_IM_SIZ_16b); rdp.palette = rdp.texture_to_load.addr; } -static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, uint32_t dxt) { +static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, UNUSED uint32_t dxt) { if (tile == 1) return; SUPPORT_CHECK(tile == G_TX_LOADTILE); SUPPORT_CHECK(uls == 0); @@ -1393,7 +1394,7 @@ static void gfx_draw_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lr } } -static void gfx_dp_texture_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry, uint8_t tile, int16_t uls, int16_t ult, int16_t dsdx, int16_t dtdy, bool flip) { +static void gfx_dp_texture_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry, UNUSED uint8_t tile, int16_t uls, int16_t ult, int16_t dsdx, int16_t dtdy, bool flip) { uint32_t saved_combine_mode = rdp.combine_mode; if ((rdp.other_mode_h & (3U << G_MDSFT_CYCLETYPE)) == G_CYC_COPY) { // Per RDP Command Summary Set Tile's shift s and this dsdx should be set to 4 texels @@ -1473,7 +1474,7 @@ static void gfx_dp_set_z_image(void *z_buf_address) { rdp.z_buf_address = z_buf_address; } -static void gfx_dp_set_color_image(uint32_t format, uint32_t size, uint32_t width, void* address) { +static void gfx_dp_set_color_image(UNUSED uint32_t format, UNUSED uint32_t size, UNUSED uint32_t width, void* address) { rdp.color_image_address = address; } @@ -1493,7 +1494,7 @@ static inline void *seg_addr(uintptr_t w1) { #define C1(pos, width) ((cmd->words.w1 >> (pos)) & ((1U << width) - 1)) static void gfx_run_dl(Gfx* cmd) { - int dummy = 0; + UNUSED int dummy = 0; for (;;) { uint32_t opcode = cmd->words.w0 >> 24; @@ -1639,7 +1640,7 @@ static void gfx_run_dl(Gfx* cmd) { case G_TEXRECT: case G_TEXRECTFLIP: { - int32_t lrx, lry, tile, ulx, uly; + int32_t lrx, lry, tile = 0, ulx, uly; uint32_t uls, ult, dsdx, dtdy; #ifdef F3DEX_GBI_2E lrx = (int32_t)(C0(0, 24) << 8) >> 8; @@ -1773,11 +1774,11 @@ void gfx_run(Gfx *commands) { } dropped_frame = false; - double t0 = gfx_wapi->get_time(); + UNUSED double t0 = gfx_wapi->get_time(); gfx_rapi->start_frame(); gfx_run_dl(commands); gfx_flush(); - double t1 = gfx_wapi->get_time(); + UNUSED double t1 = gfx_wapi->get_time(); //printf("Process %f %f\n", t1, t1 - t0); gfx_wapi->swap_buffers_begin(); } diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index 58ef09af43..84a2c5623f 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -156,16 +156,17 @@ static void gfx_sdl_init(void) { else if (gCLIOpts.FullScreen == 2) configWindow.fullscreen = false; - char window_title[96] = + const char *window_title = + "Super Mario 64 PC Port " #ifndef USE_GLES - "Super Mario 64 PC port (OpenGL)"; + "(OpenGL)" #else - "Super Mario 64 PC port (OpenGL_ES2)"; + "(OpenGL_ES2)" #endif - #ifdef NIGHTLY - strcat(window_title, " nightly " GIT_HASH); + " nightly " GIT_HASH #endif + ; // end of window title string wnd = SDL_CreateWindow( window_title, @@ -204,9 +205,12 @@ static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) { } static void gfx_sdl_get_dimensions(uint32_t *width, uint32_t *height) { - SDL_GetWindowSize(wnd, width, height); + int w, h; + SDL_GetWindowSize(wnd, &w, &h); + *width = w; *height = h; } +#ifndef TARGET_WEB static int translate_scancode(int scancode) { if (scancode < 512) { return inverted_scancode_table[scancode]; @@ -214,6 +218,7 @@ static int translate_scancode(int scancode) { return 0; } } +#endif static void gfx_sdl_onkeydown(int scancode) { keyboard_on_key_down(translate_scancode(scancode)); diff --git a/src/pc/mixer.c b/src/pc/mixer.c index 82103b2b6d..a21ffcf076 100644 --- a/src/pc/mixer.c +++ b/src/pc/mixer.c @@ -1,6 +1,8 @@ #include #include #include +#include +#include "macros.h" // Note: Some of this is stolen from Mupen64Plus rsp audio plugin. // See abi.h for documentation. @@ -146,14 +148,14 @@ static inline int16_t sample_mix(int16_t dst, int16_t src, int16_t gain) { return clamp_s16(dst + src_modified); } -void aClearBuffer(uint64_t *cmd, uint16_t dmem, uint16_t count) { +void aClearBuffer(UNUSED u64 *cmd, uint16_t dmem, uint16_t count) { dmem += DMEM_BASE; //assert(align(count, 16) == count); count = align(count, 16); memset(alist_buffer + dmem, 0, count); } -void aSetBuffer(uint64_t *cmd, uint8_t flags, uint16_t dmemin, uint16_t dmemout, uint16_t count) { +void aSetBuffer(UNUSED u64 *cmd, uint8_t flags, uint16_t dmemin, uint16_t dmemout, uint16_t count) { if (flags & A_AUX) { // Parameter names are not really correct for A_AUX alist_audio.dry_right = dmemin + DMEM_BASE; @@ -166,16 +168,16 @@ void aSetBuffer(uint64_t *cmd, uint8_t flags, uint16_t dmemin, uint16_t dmemout, } } -void aLoadBuffer(uint64_t *cmd, uint16_t *addr) { +void aLoadBuffer(UNUSED u64 *cmd, uint16_t *addr) { // addr &= ~7 memcpy(alist_buffer + alist_audio.in, addr, alist_audio.count); } -void aSaveBuffer(uint64_t *cmd, uint16_t *addr) { +void aSaveBuffer(UNUSED u64 *cmd, uint16_t *addr) { memcpy(addr, alist_buffer + alist_audio.out, alist_audio.count); } -void aDMEMMove(uint64_t *cmd, uint16_t dmemin, uint16_t dmemout, uint16_t count) { +void aDMEMMove(UNUSED u64 *cmd, uint16_t dmemin, uint16_t dmemout, uint16_t count) { dmemin += DMEM_BASE; dmemout += DMEM_BASE; //assert(align(count, 16) == count); @@ -183,7 +185,7 @@ void aDMEMMove(uint64_t *cmd, uint16_t dmemin, uint16_t dmemout, uint16_t count) memmove(alist_buffer + dmemout, alist_buffer + dmemin, count); } -void aMix(uint64_t *cmd, uint8_t flags, uint16_t gain, uint16_t dmemin, uint16_t dmemout) { +void aMix(UNUSED u64 *cmd, UNUSED uint8_t flags, uint16_t gain, uint16_t dmemin, uint16_t dmemout) { dmemin += DMEM_BASE; dmemout += DMEM_BASE; @@ -220,7 +222,7 @@ static inline int16_t ramp_step(struct ramp_t* ramp) { return (int16_t)(ramp->value >> 16); } -void aEnvMixer(uint64_t *cmd, uint8_t flags, uint16_t *addr) { +void aEnvMixer(UNUSED u64 *cmd, uint8_t flags, uint16_t *addr) { size_t n = (flags & A_AUX) ? 4 : 2; const int16_t *const in = (int16_t*)(alist_buffer + alist_audio.in); @@ -309,7 +311,7 @@ void aEnvMixer(uint64_t *cmd, uint8_t flags, uint16_t *addr) { s->ramp_values[1] = ramps[1].value; } -void aResample(uint64_t *cmd, uint8_t flags, uint16_t pitch, uint16_t *state_addr) { +void aResample(UNUSED u64 *cmd, uint8_t flags, uint16_t pitch, uint16_t *state_addr) { int16_t *dst = (int16_t*)(alist_buffer + alist_audio.out); int16_t *src = (int16_t*)(alist_buffer + alist_audio.in); size_t count = alist_audio.count >> 1; @@ -340,7 +342,7 @@ void aResample(uint64_t *cmd, uint8_t flags, uint16_t pitch, uint16_t *state_add state_addr[4] = pitch_accumulator; } -void aInterleave(uint64_t *cmd, uint16_t inL, uint16_t inR) { +void aInterleave(UNUSED u64 *cmd, uint16_t inL, uint16_t inR) { inL += DMEM_BASE; inR += DMEM_BASE; @@ -369,7 +371,7 @@ void aInterleave(uint64_t *cmd, uint16_t inL, uint16_t inR) { } // These two share the same opcode but parameters and what they do are different depending on flags -void aSetVolume(uint64_t *cmd, uint8_t flags, uint16_t vol, uint16_t voltgt, uint16_t volrate) { +void aSetVolume(UNUSED u64 *cmd, uint8_t flags, uint16_t vol, UNUSED uint16_t voltgt, uint16_t volrate) { if (flags & A_AUX) { // Parameter names are not really correct for A_AUX alist_audio.dry = vol; @@ -381,7 +383,7 @@ void aSetVolume(uint64_t *cmd, uint8_t flags, uint16_t vol, uint16_t voltgt, uin alist_audio.vol[lr] = vol; } } -void aSetVolume32(uint64_t *cmd, uint8_t flags, uint16_t voltgt, uint32_t volrate) { +void aSetVolume32(UNUSED u64 *cmd, uint8_t flags, uint16_t voltgt, uint32_t volrate) { size_t lr = (flags & A_LEFT) ? 0 : 1; assert(!(flags & A_VOL) && !(flags & A_AUX)); @@ -389,11 +391,11 @@ void aSetVolume32(uint64_t *cmd, uint8_t flags, uint16_t voltgt, uint32_t volrat alist_audio.rate[lr] = volrate; } -void aSetLoop(uint64_t *cmd, uint16_t *addr) { +void aSetLoop(UNUSED u64 *cmd, uint16_t *addr) { alist_audio.loop = addr; } -void aLoadADPCM(uint64_t *cmd, uint16_t count, uint16_t *addr) { +void aLoadADPCM(UNUSED u64 *cmd, uint16_t count, uint16_t *addr) { assert(align(count, 8) == count); memcpy(alist_audio.table, addr, count); } @@ -451,7 +453,7 @@ static void adpcm_compute_residuals(int16_t* dst, const int16_t* src, } } -void aADPCMdec(uint64_t *cmd, uint8_t flags, uint16_t *last_frame_addr) { +void aADPCMdec(UNUSED u64 *cmd, uint8_t flags, uint16_t *last_frame_addr) { int16_t *dst = (int16_t*)(alist_buffer + alist_audio.out); uint8_t *src = alist_buffer + alist_audio.in; size_t count = alist_audio.count; diff --git a/src/pc/mixer.h b/src/pc/mixer.h index 5fc3346345..3b0de2bf24 100644 --- a/src/pc/mixer.h +++ b/src/pc/mixer.h @@ -20,20 +20,20 @@ #undef aADPCMdec #define aSegment(pkt, s, b) -void aClearBuffer(uint64_t *cmd, uint16_t dmem, uint16_t count); -void aSetBuffer(uint64_t *cmd, uint8_t flags, uint16_t dmemin, uint16_t dmemout, uint16_t count); -void aLoadBuffer(uint64_t *cmd, uint16_t *addr); -void aSaveBuffer(uint64_t *cmd, uint16_t *addr); -void aDMEMMove(uint64_t *cmd, uint16_t dmemin, uint16_t dmemout, uint16_t count); -void aMix(uint64_t *cmd, uint8_t flags, uint16_t gain, uint16_t dmemin, uint16_t dmemout); -void aEnvMixer(uint64_t *cmd, uint8_t flags, uint16_t *addr); -void aResample(uint64_t *cmd, uint8_t flags, uint16_t pitch, uint16_t *state_addr); -void aInterleave(uint64_t *cmd, uint16_t inL, uint16_t inR); -void aSetVolume(uint64_t *cmd, uint8_t flags, uint16_t vol, uint16_t voltgt, uint16_t volrate); -void aSetVolume32(uint64_t *cmd, uint8_t flags, uint16_t voltgt, uint32_t volrate); -void aSetLoop(uint64_t *cmd, uint16_t *addr); -void aLoadADPCM(uint64_t *cmd, uint16_t count, uint16_t *addr); -void aADPCMdec(uint64_t *cmd, uint8_t flags, uint16_t *last_frame_addr); +void aClearBuffer(UNUSED u64 *cmd, uint16_t dmem, uint16_t count); +void aSetBuffer(UNUSED u64 *cmd, uint8_t flags, uint16_t dmemin, uint16_t dmemout, uint16_t count); +void aLoadBuffer(UNUSED u64 *cmd, uint16_t *addr); +void aSaveBuffer(UNUSED u64 *cmd, uint16_t *addr); +void aDMEMMove(UNUSED u64 *cmd, uint16_t dmemin, uint16_t dmemout, uint16_t count); +void aMix(UNUSED u64 *cmd, uint8_t flags, uint16_t gain, uint16_t dmemin, uint16_t dmemout); +void aEnvMixer(UNUSED u64 *cmd, uint8_t flags, uint16_t *addr); +void aResample(UNUSED u64 *cmd, uint8_t flags, uint16_t pitch, uint16_t *state_addr); +void aInterleave(UNUSED u64 *cmd, uint16_t inL, uint16_t inR); +void aSetVolume(UNUSED u64 *cmd, uint8_t flags, uint16_t vol, uint16_t voltgt, uint16_t volrate); +void aSetVolume32(UNUSED u64 *cmd, uint8_t flags, uint16_t voltgt, uint32_t volrate); +void aSetLoop(UNUSED u64 *cmd, uint16_t *addr); +void aLoadADPCM(UNUSED u64 *cmd, uint16_t count, uint16_t *addr); +void aADPCMdec(UNUSED u64 *cmd, uint8_t flags, uint16_t *last_frame_addr); #endif diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index ddb83ce4a5..00417903c6 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -41,10 +41,10 @@ extern void thread5_game_loop(void *arg); extern void create_next_audio_buffer(s16 *samples, u32 num_samples); void game_loop_one_iteration(void); -void dispatch_audio_sptask(struct SPTask *spTask) { +void dispatch_audio_sptask(UNUSED struct SPTask *spTask) { } -void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *queue, OSMesg *msg) { +void set_vblank_handler(UNUSED s32 index, UNUSED struct VblankHandler *handler, UNUSED OSMesgQueue *queue, UNUSED OSMesg *msg) { } static bool inited = false; diff --git a/tools/Makefile b/tools/Makefile index 28ff49bff6..ff0084a4f6 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -5,7 +5,7 @@ endif CC := gcc CFLAGS := -Llib -Iinclude -I../include -I . -Wall -Wextra -Wno-unused-parameter $(OSX_BUILD) -pedantic -std=c99 -O3 -s -PROGRAMS := n64graphics n64graphics_ci mio0 n64cksum textconv patch_libultra_math iplfontutil aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv +PROGRAMS := n64graphics n64graphics_ci mio0 textconv patch_libultra_math iplfontutil aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv n64graphics_SOURCES := n64graphics.c utils.c n64graphics_CFLAGS := -DN64GRAPHICS_STANDALONE @@ -16,8 +16,6 @@ n64graphics_ci_CFLAGS := -O2 # 3s faster compile time mio0_SOURCES := libmio0.c mio0_CFLAGS := -DMIO0_STANDALONE -n64cksum_SOURCES := n64cksum.c libmio0.c libsm64.c utils.c - textconv_SOURCES := textconv.c utf8.c hashtable.c patch_libultra_math_SOURCES := patch_libultra_math.c diff --git a/tools/n64cksum.c b/tools/n64cksum.c deleted file mode 100644 index f377f9a30d..0000000000 --- a/tools/n64cksum.c +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include - -#include "libsm64.h" -#include "utils.h" - -#define N64CKSUM_VERSION "0.1" - -static void print_usage(void) -{ - ERROR("Usage: n64cksum ROM [ROM_OUT]\n" - "\n" - "n64cksum v" N64CKSUM_VERSION ": N64 ROM checksum calculator\n" - "\n" - "File arguments:\n" - " ROM input ROM file\n" - " ROM_OUT output ROM file (default: overwrites input ROM)\n"); -} - -int main(int argc, char *argv[]) -{ - unsigned char *rom_data; - char *file_in; - char *file_out; - long length; - long write_length; - if (argc < 2) { - print_usage(); - return EXIT_FAILURE; - } - - file_in = argv[1]; - if (argc > 2) { - file_out = argv[2]; - } else { - file_out = argv[1]; - } - - length = read_file(file_in, &rom_data); - if (length < 0) { - ERROR("Error reading input file \"%s\"\n", file_in); - return EXIT_FAILURE; - } - - sm64_update_checksums(rom_data); - - write_length = write_file(file_out, rom_data, length); - - free(rom_data); - - if (write_length != length) { - ERROR("Error writing to output file \"%s\"\n", file_out); - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -}